UNPKG

baseui

Version:

A React Component library implementing the Base design language

411 lines (406 loc) • 22.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _colorSemanticTokens = _interopRequireDefault(require("./color-semantic-tokens")); var _tokens = require("../../tokens"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* Copyright (c) Uber Technologies, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. */ const defaultSemanticColors = (0, _colorSemanticTokens.default)(); const tagHoverBackground = `rgba(0, 0, 0, 0.08)`; /* ---- Component colors ---- */ var _default = (semanticColors = defaultSemanticColors) => ({ // Banner bannerActionLowInfo: _tokens.primitiveLightColors.blue100, bannerActionLowNegative: _tokens.primitiveLightColors.red100, bannerActionLowPositive: _tokens.primitiveLightColors.green100, bannerActionLowWarning: _tokens.primitiveLightColors.yellow100, bannerActionHighInfo: _tokens.primitiveLightColors.blue700, bannerActionHighNegative: _tokens.primitiveLightColors.red700, bannerActionHighPositive: _tokens.primitiveLightColors.green700, bannerActionHighWarning: _tokens.primitiveLightColors.yellow200, // BottomNavigation bottomNavigationText: _tokens.primitiveLightColors.gray600, bottomNavigationSelectedText: semanticColors.contentPrimary, // Buttons buttonPrimaryFill: semanticColors.backgroundInversePrimary, buttonPrimaryText: semanticColors.contentInversePrimary, buttonPrimaryHover: _tokens.primitiveLightColors.gray900, buttonPrimaryActive: _tokens.primitiveLightColors.gray800, buttonPrimaryHoverOverlay: semanticColors.hoverOverlayInverseAlpha, buttonPrimaryActiveOverlay: semanticColors.pressedOverlayInverseAlpha, buttonPrimarySelectedFill: semanticColors.backgroundInversePrimary, buttonPrimarySelectedText: semanticColors.contentInversePrimary, buttonPrimaryLoadingFill: semanticColors.backgroundInversePrimary, buttonPrimarySpinnerForeground: semanticColors.backgroundAccent, buttonPrimarySpinnerBackground: semanticColors.backgroundPrimary, buttonSecondaryFill: semanticColors.backgroundSecondary, buttonSecondaryText: semanticColors.contentPrimary, buttonSecondaryHover: _tokens.primitiveLightColors.gray200, buttonSecondaryActive: _tokens.primitiveLightColors.gray300, buttonSecondaryHoverOverlay: semanticColors.hoverOverlayAlpha, buttonSecondaryActiveOverlay: semanticColors.pressedOverlayAlpha, buttonSecondarySelectedFill: semanticColors.backgroundInversePrimary, buttonSecondarySelectedText: semanticColors.contentInversePrimary, buttonSecondaryLoadingFill: semanticColors.backgroundSecondary, buttonSecondarySpinnerForeground: semanticColors.backgroundAccent, buttonSecondarySpinnerBackground: semanticColors.backgroundPrimary, buttonTertiaryFill: 'transparent', buttonTertiaryText: semanticColors.contentPrimary, buttonTertiaryHover: _tokens.primitiveLightColors.gray50, buttonTertiaryActive: _tokens.primitiveLightColors.gray100, buttonTertiaryHoverOverlay: semanticColors.hoverOverlayAlpha, buttonTertiaryActiveOverlay: semanticColors.pressedOverlayAlpha, buttonTertiarySelectedFill: 'transparent', buttonTertiarySelectedText: semanticColors.contentPrimary, buttonTertiaryLoadingFill: 'transparent', buttonTertiaryFocusFill: semanticColors.backgroundTertiary, buttonTertiaryDisabledActiveFill: semanticColors.backgroundStateDisabled, buttonTertiaryDisabledActiveText: semanticColors.contentStateDisabled, buttonTertiarySpinnerForeground: semanticColors.backgroundAccent, buttonTertiarySpinnerBackground: semanticColors.backgroundTertiary, buttonDangerPrimaryFill: semanticColors.backgroundNegative, buttonDangerPrimaryText: semanticColors.contentOnColor, buttonDangerPrimaryHoverOverlay: semanticColors.hoverOverlayAlpha, buttonDangerPrimaryActiveOverlay: semanticColors.pressedOverlayAlpha, buttonDangerPrimarySelectedFill: semanticColors.backgroundNegative, buttonDangerPrimarySelectedText: semanticColors.contentOnColor, buttonDangerPrimaryLoadingFill: semanticColors.backgroundNegative, buttonDangerPrimarySpinnerForeground: semanticColors.backgroundAccent, buttonDangerPrimarySpinnerBackground: semanticColors.backgroundPrimary, buttonDangerSecondaryFill: semanticColors.backgroundSecondary, buttonDangerSecondaryText: semanticColors.tagRedContentSecondary, buttonDangerSecondaryHoverOverlay: semanticColors.hoverOverlayAlpha, buttonDangerSecondaryActiveOverlay: semanticColors.pressedOverlayAlpha, buttonDangerSecondarySelectedFill: semanticColors.backgroundNegative, buttonDangerSecondarySelectedText: semanticColors.contentOnColor, buttonDangerSecondaryLoadingFill: semanticColors.backgroundSecondary, buttonDangerSecondarySpinnerForeground: semanticColors.backgroundAccent, buttonDangerSecondarySpinnerBackground: semanticColors.backgroundPrimary, buttonDangerTertiaryFill: 'transparent', buttonDangerTertiaryText: semanticColors.tagRedContentSecondary, buttonDangerTertiaryHoverOverlay: semanticColors.hoverOverlayAlpha, buttonDangerTertiaryActiveOverlay: semanticColors.pressedOverlayAlpha, buttonDangerTertiarySelectedFill: semanticColors.backgroundPrimary, buttonDangerTertiarySelectedText: semanticColors.tagRedContentSecondary, buttonDangerTertiaryLoadingFill: 'transparent', buttonDangerTertiarySpinnerForeground: semanticColors.backgroundAccent, buttonDangerTertiarySpinnerBackground: semanticColors.backgroundPrimary, buttonOutlineFill: 'transparent', buttonOutlineText: semanticColors.contentPrimary, buttonOutlineHoverOverlay: semanticColors.hoverOverlayAlpha, buttonOutlineActiveOverlay: semanticColors.pressedOverlayAlpha, buttonOutlineSelectedFill: 'transparent', buttonOutlineSelectedText: semanticColors.contentPrimary, buttonOutlineFocusFill: semanticColors.backgroundTertiary, buttonOutlineLoadingFill: 'transparent', buttonOutlineSpinnerForeground: semanticColors.backgroundAccent, buttonOutlineSpinnerBackground: semanticColors.backgroundPrimary, buttonDisabledFill: semanticColors.backgroundStateDisabled, buttonDisabledText: semanticColors.contentStateDisabled, buttonDisabledActiveFill: semanticColors.backgroundStateDisabled, buttonDisabledActiveText: semanticColors.contentStateDisabled, buttonDisabledSpinnerForeground: semanticColors.contentStateDisabled, buttonDisabledSpinnerBackground: semanticColors.backgroundPrimary, buttonOuterBorder: semanticColors.borderSelected, buttonOutlineOuterBorder: semanticColors.borderOpaque, buttonDangerTertiaryOuterBorder: semanticColors.tagRedBorderSecondarySelected, buttonInnerBorder: semanticColors.contentInversePrimary, buttonTransparentBorder: 'transparent', buttonFocusOuterBorder: semanticColors.borderAccent, // Breadcrumbs breadcrumbsText: semanticColors.contentPrimary, breadcrumbsSeparatorFill: semanticColors.contentTertiary, // Datepicker calendarBackground: semanticColors.backgroundPrimary, calendarForeground: semanticColors.contentPrimary, calendarForegroundDisabled: semanticColors.contentStateDisabled, calendarHeaderBackground: semanticColors.backgroundPrimary, calendarHeaderForeground: semanticColors.contentPrimary, calendarHeaderBackgroundActive: semanticColors.backgroundInversePrimary, calendarHeaderForegroundDisabled: semanticColors.contentStateDisabled, calendarDayForegroundPseudoSelected: semanticColors.backgroundInversePrimary, calendarDayBackgroundPseudoSelectedHighlighted: semanticColors.backgroundTertiary, calendarDayForegroundPseudoSelectedHighlighted: semanticColors.contentPrimary, calendarDayBackgroundSelected: semanticColors.backgroundInversePrimary, calendarDayForegroundSelected: semanticColors.contentInversePrimary, calendarDayBackgroundSelectedHighlighted: semanticColors.backgroundInversePrimary, calendarDayForegroundSelectedHighlighted: semanticColors.contentInversePrimary, // Combobox comboboxListItemFocus: semanticColors.backgroundSecondary, comboboxListItemHover: semanticColors.backgroundTertiary, // FileUploader fileUploaderBackgroundColor: semanticColors.backgroundSecondary, fileUploaderBackgroundColorActive: semanticColors.backgroundPrimary, fileUploaderBorderColorActive: semanticColors.borderSelected, fileUploaderBorderColorDefault: semanticColors.borderOpaque, fileUploaderMessageColor: semanticColors.contentPrimary, // Links linkText: semanticColors.contentPrimary, linkVisited: _tokens.primitiveLightColors.gray600, linkHover: _tokens.primitiveLightColors.gray800, linkActive: _tokens.primitiveLightColors.gray700, // List listHeaderFill: semanticColors.backgroundPrimary, listBodyFill: semanticColors.backgroundPrimary, // ProgressSteps progressStepsCompletedText: semanticColors.contentInversePrimary, progressStepsCompletedFill: semanticColors.backgroundInversePrimary, progressStepsActiveText: semanticColors.contentInversePrimary, progressStepsActiveFill: semanticColors.backgroundInversePrimary, // Toggle toggleFill: semanticColors.backgroundPrimary, toggleFillChecked: semanticColors.contentPrimary, toggleFillDisabled: semanticColors.contentStateDisabled, toggleTrackFill: semanticColors.backgroundTertiary, toggleTrackFillDisabled: semanticColors.backgroundStateDisabled, // Tick tickFill: semanticColors.backgroundPrimary, tickFillHover: _tokens.primitiveLightColors.gray50, tickFillActive: _tokens.primitiveLightColors.gray100, tickFillSelected: semanticColors.contentPrimary, tickFillSelectedHover: _tokens.primitiveLightColors.gray900, tickFillSelectedHoverActive: _tokens.primitiveLightColors.gray800, tickFillError: semanticColors.backgroundPrimary, tickFillErrorHover: _tokens.primitiveLightColors.gray50, tickFillErrorHoverActive: _tokens.primitiveLightColors.gray100, tickFillErrorSelected: semanticColors.contentNegative, tickFillErrorSelectedHover: _tokens.primitiveLightColors.red700, tickFillErrorSelectedHoverActive: _tokens.primitiveLightColors.red800, tickFillDisabled: semanticColors.backgroundStateDisabled, tickBorder: semanticColors.contentTertiary, tickBorderError: semanticColors.borderNegative, tickMarkFill: semanticColors.contentInversePrimary, tickMarkFillError: semanticColors.contentOnColor, tickMarkFillDisabled: semanticColors.contentInversePrimary, // Slider/Toggle sliderTrackFill: 'transparent', sliderHandleFill: semanticColors.contentPrimary, sliderHandleFillDisabled: semanticColors.backgroundStateDisabled, sliderHandleInnerFill: semanticColors.contentPrimary, sliderTrackFillHover: _tokens.primitiveLightColors.gray200, sliderTrackFillActive: _tokens.primitiveLightColors.gray300, sliderTrackFillDisabled: semanticColors.backgroundStateDisabled, sliderHandleInnerFillDisabled: semanticColors.backgroundStateDisabled, sliderHandleInnerFillSelectedHover: _tokens.primitiveLightColors.gray900, sliderHandleInnerFillSelectedActive: _tokens.primitiveLightColors.gray800, // Inputs inputBorder: semanticColors.borderOpaque, inputFill: semanticColors.backgroundSecondary, inputFillError: semanticColors.backgroundPrimary, inputFillDisabled: semanticColors.backgroundStateDisabled, inputFillActive: semanticColors.backgroundPrimary, inputFillPositive: semanticColors.backgroundPrimary, inputTextDisabled: semanticColors.contentStateDisabled, inputBorderError: semanticColors.borderNegative, inputBorderPositive: semanticColors.borderPositive, inputEnhancerFill: semanticColors.contentPrimary, inputEnhancerFillDisabled: semanticColors.contentStateDisabled, inputEnhancerTextDisabled: semanticColors.contentStateDisabled, inputPlaceholder: semanticColors.contentTertiary, inputPlaceholderDisabled: semanticColors.contentStateDisabled, // Menu menuFill: semanticColors.backgroundPrimary, menuFillHover: semanticColors.backgroundSecondary, menuFontDefault: semanticColors.contentPrimary, menuFontDisabled: semanticColors.contentStateDisabled, menuFontHighlighted: semanticColors.contentPrimary, menuFontSelected: semanticColors.contentPrimary, // Modal modalCloseColor: semanticColors.contentPrimary, modalCloseColorHover: _tokens.primitiveLightColors.gray900, modalCloseColorFocus: _tokens.primitiveLightColors.gray800, // Tab tabBarFill: semanticColors.backgroundPrimary, tabColor: semanticColors.contentTertiary, // Notification notificationInfoBackground: semanticColors.backgroundAccentLight, notificationInfoText: semanticColors.contentPrimary, notificationPositiveBackground: semanticColors.backgroundPositiveLight, notificationPositiveText: semanticColors.contentPrimary, notificationWarningBackground: semanticColors.backgroundWarningLight, notificationWarningText: semanticColors.contentPrimary, notificationNegativeBackground: semanticColors.backgroundNegativeLight, notificationNegativeText: semanticColors.contentPrimary, // Tag // Custom ramps tagFontDisabledRampUnit: '200', tagSolidFontRampUnit: '0', tagSolidRampUnit: '400', tagOutlinedFontRampUnit: '600', tagOutlinedRampUnit: '600', // Deprecated tagSolidHoverRampUnit: '50', tagSolidActiveRampUnit: '100', tagSolidDisabledRampUnit: '50', tagSolidFontHoverRampUnit: '700', tagLightRampUnit: '50', tagLightHoverRampUnit: '100', tagLightActiveRampUnit: '200', tagLightFontRampUnit: '600', tagLightFontHoverRampUnit: '200', tagOutlinedHoverRampUnit: '700', tagOutlinedActiveRampUnit: '800', tagOutlinedFontHoverRampUnit: '700', // Neutral tagNeutralFontDisabled: _tokens.primitiveLightColors.gray200, tagNeutralOutlinedDisabled: _tokens.primitiveLightColors.gray200, tagNeutralSolidFont: _tokens.primitiveLightColors.white, tagNeutralSolidBackground: _tokens.primitiveLightColors.gray600, tagNeutralOutlinedBackground: _tokens.primitiveLightColors.gray50, tagNeutralOutlinedFont: _tokens.primitiveLightColors.gray700, // Deprecated tagNeutralSolidHover: _tokens.primitiveLightColors.gray900, tagNeutralSolidActive: _tokens.primitiveLightColors.gray800, tagNeutralSolidDisabled: _tokens.primitiveLightColors.gray200, tagNeutralSolidFontHover: _tokens.primitiveLightColors.gray700, tagNeutralLightBackground: _tokens.primitiveLightColors.white, tagNeutralLightHover: _tokens.primitiveLightColors.gray50, tagNeutralLightActive: _tokens.primitiveLightColors.gray100, tagNeutralLightDisabled: _tokens.primitiveLightColors.gray200, tagNeutralLightFont: _tokens.primitiveLightColors.gray600, tagNeutralLightFontHover: _tokens.primitiveLightColors.gray700, tagNeutralOutlinedActive: _tokens.primitiveLightColors.gray800, tagNeutralOutlinedFontHover: _tokens.primitiveLightColors.gray700, tagNeutralOutlinedHover: tagHoverBackground, // Primary tagPrimaryFontDisabled: _tokens.primitiveLightColors.gray300, tagPrimaryOutlinedDisabled: _tokens.primitiveLightColors.gray200, tagPrimarySolidFont: _tokens.primitiveLightColors.white, tagPrimarySolidBackground: _tokens.primitiveLightColors.gray600, tagPrimaryOutlinedFontHover: _tokens.primitiveLightColors.gray900, tagPrimaryOutlinedFont: _tokens.primitiveLightColors.gray700, // Deprecated tagPrimarySolidHover: _tokens.primitiveLightColors.gray900, tagPrimarySolidActive: _tokens.primitiveLightColors.gray900, tagPrimarySolidDisabled: _tokens.primitiveLightColors.gray200, tagPrimarySolidFontHover: _tokens.primitiveLightColors.gray900, tagPrimaryLightBackground: _tokens.primitiveLightColors.white, tagPrimaryLightHover: _tokens.primitiveLightColors.gray50, tagPrimaryLightActive: _tokens.primitiveLightColors.gray100, tagPrimaryLightDisabled: _tokens.primitiveLightColors.gray200, tagPrimaryLightFont: _tokens.primitiveLightColors.black, tagPrimaryLightFontHover: _tokens.primitiveLightColors.gray900, tagPrimaryOutlinedActive: _tokens.primitiveLightColors.gray900, tagPrimaryOutlinedHover: tagHoverBackground, tagPrimaryOutlinedBackground: _tokens.primitiveLightColors.gray50, // Accent tagAccentFontDisabled: _tokens.primitiveLightColors.blue300, tagAccentOutlinedDisabled: _tokens.primitiveLightColors.blue200, tagAccentSolidFont: _tokens.primitiveLightColors.white, tagAccentSolidBackground: _tokens.primitiveLightColors.blue600, tagAccentOutlinedBackground: _tokens.primitiveLightColors.blue50, tagAccentOutlinedFont: _tokens.primitiveLightColors.blue700, // Deprecated tagAccentSolidHover: _tokens.primitiveLightColors.blue50, tagAccentSolidActive: _tokens.primitiveLightColors.blue100, tagAccentSolidDisabled: _tokens.primitiveLightColors.blue50, tagAccentSolidFontHover: _tokens.primitiveLightColors.blue500, tagAccentLightBackground: _tokens.primitiveLightColors.blue50, tagAccentLightHover: _tokens.primitiveLightColors.blue100, tagAccentLightActive: _tokens.primitiveLightColors.blue200, tagAccentLightDisabled: _tokens.primitiveLightColors.blue50, tagAccentLightFont: _tokens.primitiveLightColors.blue600, tagAccentLightFontHover: _tokens.primitiveLightColors.blue700, tagAccentOutlinedActive: _tokens.primitiveLightColors.blue800, tagAccentOutlinedFontHover: _tokens.primitiveLightColors.blue700, tagAccentOutlinedHover: tagHoverBackground, // Positive tagPositiveFontDisabled: _tokens.primitiveLightColors.green300, tagPositiveOutlinedDisabled: _tokens.primitiveLightColors.green200, tagPositiveSolidFont: _tokens.primitiveLightColors.white, tagPositiveSolidBackground: _tokens.primitiveLightColors.green600, tagPositiveOutlinedBackground: _tokens.primitiveLightColors.green50, tagPositiveOutlinedFont: _tokens.primitiveLightColors.green700, // Deprecated tagPositiveSolidHover: _tokens.primitiveLightColors.green50, tagPositiveSolidActive: _tokens.primitiveLightColors.green100, tagPositiveSolidDisabled: _tokens.primitiveLightColors.green50, tagPositiveSolidFontHover: _tokens.primitiveLightColors.green500, tagPositiveLightBackground: _tokens.primitiveLightColors.green50, tagPositiveLightHover: _tokens.primitiveLightColors.green100, tagPositiveLightActive: _tokens.primitiveLightColors.green200, tagPositiveLightDisabled: _tokens.primitiveLightColors.green50, tagPositiveLightFont: _tokens.primitiveLightColors.green600, tagPositiveLightFontHover: _tokens.primitiveLightColors.green700, tagPositiveOutlinedActive: _tokens.primitiveLightColors.green800, tagPositiveOutlinedFontHover: _tokens.primitiveLightColors.green700, tagPositiveOutlinedHover: tagHoverBackground, // Warning tagWarningFontDisabled: _tokens.primitiveLightColors.yellow200, tagWarningOutlinedDisabled: _tokens.primitiveLightColors.yellow200, tagWarningSolidFont: _tokens.primitiveLightColors.yellow900, tagWarningSolidBackground: _tokens.primitiveLightColors.yellow300, tagWarningOutlinedBackground: _tokens.primitiveLightColors.yellow50, tagWarningOutlinedFont: _tokens.primitiveLightColors.yellow700, // Deprecated tagWarningSolidHover: _tokens.primitiveLightColors.yellow50, tagWarningSolidActive: _tokens.primitiveLightColors.yellow100, tagWarningSolidDisabled: _tokens.primitiveLightColors.yellow50, tagWarningSolidFontHover: _tokens.primitiveLightColors.yellow500, tagWarningLightBackground: _tokens.primitiveLightColors.yellow50, tagWarningLightHover: _tokens.primitiveLightColors.yellow100, tagWarningLightActive: _tokens.primitiveLightColors.yellow200, tagWarningLightDisabled: _tokens.primitiveLightColors.yellow50, tagWarningLightFont: _tokens.primitiveLightColors.yellow600, tagWarningLightFontHover: _tokens.primitiveLightColors.yellow700, tagWarningOutlinedActive: _tokens.primitiveLightColors.yellow800, tagWarningOutlinedFontHover: _tokens.primitiveLightColors.yellow700, tagWarningOutlinedHover: tagHoverBackground, // Negative tagNegativeFontDisabled: _tokens.primitiveLightColors.red300, tagNegativeOutlinedDisabled: _tokens.primitiveLightColors.red200, tagNegativeSolidFont: _tokens.primitiveLightColors.white, tagNegativeSolidBackground: _tokens.primitiveLightColors.red600, tagNegativeOutlinedBackground: _tokens.primitiveLightColors.red50, tagNegativeOutlinedFont: _tokens.primitiveLightColors.red700, // Deprecated tagNegativeSolidHover: _tokens.primitiveLightColors.red50, tagNegativeSolidActive: _tokens.primitiveLightColors.red100, tagNegativeSolidDisabled: _tokens.primitiveLightColors.red50, tagNegativeSolidFontHover: _tokens.primitiveLightColors.red500, tagNegativeLightBackground: _tokens.primitiveLightColors.red50, tagNegativeLightHover: _tokens.primitiveLightColors.red100, tagNegativeLightActive: _tokens.primitiveLightColors.red200, tagNegativeLightDisabled: _tokens.primitiveLightColors.red50, tagNegativeLightFont: _tokens.primitiveLightColors.red600, tagNegativeLightFontHover: _tokens.primitiveLightColors.red700, tagNegativeOutlinedActive: _tokens.primitiveLightColors.red800, tagNegativeOutlinedFontHover: _tokens.primitiveLightColors.red700, tagNegativeOutlinedHover: tagHoverBackground, // Table tableHeadBackgroundColor: semanticColors.backgroundPrimary, tableBackground: semanticColors.backgroundPrimary, tableStripedBackground: semanticColors.backgroundSecondary, tableFilter: semanticColors.contentTertiary, tableFilterHeading: semanticColors.contentPrimary, tableFilterBackground: semanticColors.backgroundPrimary, tableFilterFooterBackground: semanticColors.backgroundSecondary, // Toast toastText: semanticColors.contentOnColor, toastPrimaryText: semanticColors.contentOnColor, toastInfoBackground: semanticColors.backgroundAccent, toastInfoText: semanticColors.contentOnColor, toastPositiveBackground: semanticColors.backgroundPositive, toastPositiveText: semanticColors.contentOnColor, toastWarningBackground: semanticColors.backgroundWarning, toastWarningText: semanticColors.contentOnColorInverse, toastNegativeBackground: semanticColors.backgroundNegative, toastNegativeText: semanticColors.contentOnColor, // Spinner spinnerTrackFill: semanticColors.backgroundTertiary, // Progress bar progressbarTrackFill: semanticColors.backgroundTertiary, // Tooltip tooltipBackground: semanticColors.backgroundInverseSecondary, tooltipText: semanticColors.contentInversePrimary, // Rating ratingInactiveFill: semanticColors.backgroundPrimary, ratingStroke: semanticColors.contentPrimary }); exports.default = _default;