react-native-terra-ui 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/lib/module/components/avatar/Avatar.js +60 -60
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/box/Box.js +2 -2
- package/lib/module/components/box/Box.js.map +1 -1
- package/lib/module/components/box/utils.js +19 -19
- package/lib/module/components/box/utils.js.map +1 -1
- package/lib/module/components/button/Button.js +54 -48
- package/lib/module/components/button/Button.js.map +1 -1
- package/lib/module/components/chip/Chip.js +94 -94
- package/lib/module/components/chip/Chip.js.map +1 -1
- package/lib/module/components/chip/utils.js +3 -3
- package/lib/module/components/empty-state/EmptyState.js +40 -40
- package/lib/module/components/empty-state/EmptyState.js.map +1 -1
- package/lib/module/components/header/header-buttons.js +5 -5
- package/lib/module/components/header/header-buttons.js.map +1 -1
- package/lib/module/components/header/parts/HeaderGradientOverlay.js +2 -2
- package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +58 -58
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/TitleHeader/index.js +27 -27
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
- package/lib/module/components/icon/Icon.js +6 -6
- package/lib/module/components/icon/Icon.js.map +1 -1
- package/lib/module/components/image/Image.js +11 -6
- package/lib/module/components/image/Image.js.map +1 -1
- package/lib/module/components/page-indicator/PageIndicator.js +1 -1
- package/lib/module/components/page-indicator/PageIndicatorRoot.js.map +1 -1
- package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +8 -8
- package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js.map +1 -1
- package/lib/module/components/page-indicator/hooks/use-page-indicator-core.js.map +1 -1
- package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js +6 -6
- package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js.map +1 -1
- package/lib/module/components/page-indicator/utils.js +8 -8
- package/lib/module/components/page-indicator/utils.js.map +1 -1
- package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js +2 -2
- package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js.map +1 -1
- package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js +9 -9
- package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js.map +1 -1
- package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js +2 -2
- package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js.map +1 -1
- package/lib/module/components/page-indicator/variants/DotIndicator/index.js +3 -3
- package/lib/module/components/page-indicator/variants/DotIndicator/index.js.map +1 -1
- package/lib/module/components/page-indicator/variants/DotIndicator/utils.js +1 -1
- package/lib/module/components/page-indicator/variants/DotIndicator/utils.js.map +1 -1
- package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js +1 -1
- package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js.map +1 -1
- package/lib/module/components/page-indicator/variants/PillIndicator/index.js +5 -5
- package/lib/module/components/page-indicator/variants/PillIndicator/index.js.map +1 -1
- package/lib/module/components/page-indicator/variants/PillIndicator/utils.js +3 -3
- package/lib/module/components/portal/Portal.js +1 -1
- package/lib/module/components/portal/PortalContext.js +1 -1
- package/lib/module/components/portal/PortalHost.js +1 -1
- package/lib/module/components/portal/PortalProvider.js +1 -1
- package/lib/module/components/portal/PortalProvider.js.map +1 -1
- package/lib/module/components/screen/Screen.js +8 -8
- package/lib/module/components/screen/Screen.js.map +1 -1
- package/lib/module/components/screen/ScreenContext.js +6 -6
- package/lib/module/components/screen/ScreenContext.js.map +1 -1
- package/lib/module/components/screen/ScreenFlatList.js +3 -3
- package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
- package/lib/module/components/screen/ScreenList.js +5 -5
- package/lib/module/components/screen/ScreenList.js.map +1 -1
- package/lib/module/components/screen/ScreenScrollView.js +6 -6
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/components/screen/parts/BottomSafeArea.js +1 -1
- package/lib/module/components/screen/parts/BottomSafeArea.js.map +1 -1
- package/lib/module/components/screen/parts/ScreenPlaceholder.js +3 -3
- package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -1
- package/lib/module/components/screen/utils.js +3 -3
- package/lib/module/components/screen/utils.js.map +1 -1
- package/lib/module/components/slot/Slot.js +2 -2
- package/lib/module/components/slot/Slot.js.map +1 -1
- package/lib/module/components/slot/utils.js +3 -3
- package/lib/module/components/slot/utils.js.map +1 -1
- package/lib/module/components/spinner/Spinner.js +10 -10
- package/lib/module/components/spinner/Spinner.js.map +1 -1
- package/lib/module/components/surface/Surface.js +14 -14
- package/lib/module/components/surface/Surface.js.map +1 -1
- package/lib/module/components/text/Text.js +13 -13
- package/lib/module/components/text/Text.js.map +1 -1
- package/lib/module/components/toast/Toast.js +46 -46
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/components/toast/ToastProvider.js +32 -32
- package/lib/module/components/toast/ToastProvider.js.map +1 -1
- package/lib/module/components/toast/parts/ToastAnimatedItem.js +10 -10
- package/lib/module/components/toast/parts/ToastAnimatedItem.js.map +1 -1
- package/lib/module/components/toast/utils/controller.js +2 -2
- package/lib/module/components/toast/utils/controller.js.map +1 -1
- package/lib/module/components/toolbar/Toolbar.js +25 -25
- package/lib/module/components/toolbar/Toolbar.js.map +1 -1
- package/lib/module/context/ThemeProvider.js +5 -5
- package/lib/module/context/ThemeProvider.js.map +1 -1
- package/lib/module/theme/breakpoints.js.map +1 -1
- package/lib/module/theme/defaults/icons.js +11 -11
- package/lib/module/theme/defaults/icons.js.map +1 -1
- package/lib/module/theme/defaults/image.js +7 -7
- package/lib/module/theme/defaults/image.js.map +1 -1
- package/lib/module/theme/registry.js +11 -11
- package/lib/module/theme/registry.js.map +1 -1
- package/lib/module/theme/runtime.js +3 -3
- package/lib/module/theme/runtime.js.map +1 -1
- package/lib/module/theme/theme.js +9 -9
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/theme/tokens/dark.js +67 -67
- package/lib/module/theme/tokens/light.js +67 -67
- package/lib/module/theme/tokens/primitives.js +417 -417
- package/lib/module/utils/accent-utils.js +16 -16
- package/lib/module/utils/accent-utils.js.map +1 -1
- package/lib/module/utils/color-utils.js +3 -3
- package/lib/module/utils/deep-merge.js +1 -1
- package/lib/module/utils/resolve-theme-color.js +2 -2
- package/lib/module/utils/resolve-theme-color.js.map +1 -1
- package/lib/module/utils/typography.js +5 -5
- package/lib/module/utils/typography.js.map +1 -1
- package/lib/module/utils/unflatten.js +2 -2
- package/lib/typescript/src/components/avatar/Avatar.d.ts +1 -1
- package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/avatar/index.d.ts +2 -2
- package/lib/typescript/src/components/avatar/types.d.ts +7 -7
- package/lib/typescript/src/components/avatar/types.d.ts.map +1 -1
- package/lib/typescript/src/components/box/Box.d.ts +2 -2
- package/lib/typescript/src/components/box/Box.d.ts.map +1 -1
- package/lib/typescript/src/components/box/index.d.ts +3 -3
- package/lib/typescript/src/components/box/utils.d.ts +7 -7
- package/lib/typescript/src/components/box/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/button/Button.d.ts +15 -8
- package/lib/typescript/src/components/button/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +2 -2
- package/lib/typescript/src/components/chip/Chip.d.ts +5 -5
- package/lib/typescript/src/components/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/index.d.ts +3 -3
- package/lib/typescript/src/components/chip/types.d.ts +3 -3
- package/lib/typescript/src/components/chip/utils.d.ts +1 -1
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts +5 -5
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts +3 -3
- package/lib/typescript/src/components/empty-state/types.d.ts +1 -1
- package/lib/typescript/src/components/header/Header.d.ts +2 -2
- package/lib/typescript/src/components/header/header-buttons.d.ts +3 -3
- package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -1
- package/lib/typescript/src/components/header/index.d.ts +6 -6
- package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +4 -4
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/Icon.d.ts +3 -3
- package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/index.d.ts +2 -2
- package/lib/typescript/src/components/image/Image.d.ts +2 -2
- package/lib/typescript/src/components/image/Image.d.ts.map +1 -1
- package/lib/typescript/src/components/image/index.d.ts +2 -2
- package/lib/typescript/src/components/image/types.d.ts +1 -1
- package/lib/typescript/src/components/index.d.ts +17 -17
- package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts +10 -10
- package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts +2 -2
- package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts +1 -1
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts +3 -3
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts +2 -2
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/index.d.ts +3 -3
- package/lib/typescript/src/components/page-indicator/utils.d.ts +2 -2
- package/lib/typescript/src/components/page-indicator/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts +1 -1
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts +2 -2
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts +2 -2
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts +3 -3
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts +2 -2
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts +3 -3
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts.map +1 -1
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/utils.d.ts +1 -1
- package/lib/typescript/src/components/portal/Portal.d.ts +3 -3
- package/lib/typescript/src/components/portal/PortalContext.d.ts +1 -1
- package/lib/typescript/src/components/portal/PortalHost.d.ts +2 -2
- package/lib/typescript/src/components/portal/PortalProvider.d.ts +1 -1
- package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/index.d.ts +7 -7
- package/lib/typescript/src/components/screen/Screen.d.ts +10 -10
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenContext.d.ts +3 -3
- package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +3 -3
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenList.d.ts +5 -5
- package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +5 -5
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/index.d.ts +11 -11
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +3 -3
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/types.d.ts +2 -2
- package/lib/typescript/src/components/screen/utils.d.ts +2 -2
- package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/slot/Slot.d.ts +2 -2
- package/lib/typescript/src/components/slot/Slot.d.ts.map +1 -1
- package/lib/typescript/src/components/slot/index.d.ts +3 -3
- package/lib/typescript/src/components/slot/utils.d.ts +1 -1
- package/lib/typescript/src/components/slot/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/spinner/Spinner.d.ts +2 -2
- package/lib/typescript/src/components/spinner/Spinner.d.ts.map +1 -1
- package/lib/typescript/src/components/spinner/index.d.ts +2 -2
- package/lib/typescript/src/components/surface/Surface.d.ts +4 -4
- package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -1
- package/lib/typescript/src/components/surface/index.d.ts +2 -2
- package/lib/typescript/src/components/text/Text.d.ts +4 -4
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/text/index.d.ts +2 -2
- package/lib/typescript/src/components/toast/Toast.d.ts +18 -18
- package/lib/typescript/src/components/toast/Toast.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/ToastProvider.d.ts +1 -1
- package/lib/typescript/src/components/toast/ToastProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts +4 -4
- package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts +3 -3
- package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/types.d.ts +10 -10
- package/lib/typescript/src/components/toast/types.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/utils/controller.d.ts +2 -2
- package/lib/typescript/src/components/toast/utils/controller.d.ts.map +1 -1
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts +5 -5
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/typescript/src/components/toolbar/index.d.ts +2 -2
- package/lib/typescript/src/context/ThemeProvider.d.ts +3 -3
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/context/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/theme/breakpoints.d.ts +2 -2
- package/lib/typescript/src/theme/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/theme/defaults/icons.d.ts +1 -1
- package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -1
- package/lib/typescript/src/theme/defaults/image.d.ts +1 -1
- package/lib/typescript/src/theme/defaults/image.d.ts.map +1 -1
- package/lib/typescript/src/theme/index.d.ts +14 -14
- package/lib/typescript/src/theme/registry.d.ts +2 -2
- package/lib/typescript/src/theme/registry.d.ts.map +1 -1
- package/lib/typescript/src/theme/runtime.d.ts +1 -1
- package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
- package/lib/typescript/src/theme/screen-margin.d.ts +2 -2
- package/lib/typescript/src/theme/theme.d.ts +2 -2
- package/lib/typescript/src/theme/theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/dark.d.ts +67 -67
- package/lib/typescript/src/theme/tokens/light.d.ts +67 -67
- package/lib/typescript/src/theme/tokens/primitives.d.ts +417 -417
- package/lib/typescript/src/theme/types.d.ts +99 -84
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/accent-utils.d.ts +1 -1
- package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
- package/lib/typescript/src/utils/resolve-theme-color.d.ts +1 -1
- package/lib/typescript/src/utils/resolve-theme-color.d.ts.map +1 -1
- package/lib/typescript/src/utils/typography.d.ts +2 -2
- package/lib/typescript/src/utils/typography.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/Avatar.tsx +66 -71
- package/src/components/avatar/index.ts +2 -2
- package/src/components/avatar/types.ts +7 -12
- package/src/components/box/Box.tsx +7 -18
- package/src/components/box/index.ts +3 -3
- package/src/components/box/utils.ts +59 -81
- package/src/components/button/Button.tsx +119 -144
- package/src/components/button/index.ts +2 -2
- package/src/components/chip/Chip.tsx +107 -143
- package/src/components/chip/index.ts +3 -3
- package/src/components/chip/types.ts +7 -7
- package/src/components/chip/utils.ts +5 -5
- package/src/components/empty-state/EmptyState.tsx +44 -60
- package/src/components/empty-state/index.ts +3 -3
- package/src/components/empty-state/types.ts +1 -1
- package/src/components/header/Header.ts +2 -2
- package/src/components/header/header-buttons.tsx +10 -18
- package/src/components/header/index.ts +6 -6
- package/src/components/header/parts/HeaderGradientOverlay.tsx +3 -7
- package/src/components/header/variants/LargeTitleHeader/index.tsx +75 -139
- package/src/components/header/variants/TitleHeader/index.tsx +40 -62
- package/src/components/icon/Icon.tsx +31 -39
- package/src/components/icon/index.ts +2 -2
- package/src/components/image/Image.tsx +22 -11
- package/src/components/image/index.ts +2 -2
- package/src/components/image/types.ts +1 -1
- package/src/components/index.ts +17 -17
- package/src/components/page-indicator/PageIndicator.tsx +14 -14
- package/src/components/page-indicator/PageIndicatorRoot.tsx +4 -12
- package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +17 -35
- package/src/components/page-indicator/hooks/use-page-indicator-core.ts +6 -8
- package/src/components/page-indicator/hooks/use-page-indicator-progress.ts +10 -30
- package/src/components/page-indicator/index.ts +3 -3
- package/src/components/page-indicator/utils.ts +20 -48
- package/src/components/page-indicator/variants/DotIndicator/InactiveDot.tsx +5 -16
- package/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.tsx +21 -63
- package/src/components/page-indicator/variants/DotIndicator/TravelingPill.tsx +6 -16
- package/src/components/page-indicator/variants/DotIndicator/index.tsx +20 -38
- package/src/components/page-indicator/variants/DotIndicator/utils.ts +2 -6
- package/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.tsx +12 -50
- package/src/components/page-indicator/variants/PillIndicator/index.tsx +19 -41
- package/src/components/page-indicator/variants/PillIndicator/utils.ts +4 -4
- package/src/components/portal/Portal.tsx +4 -4
- package/src/components/portal/PortalContext.tsx +1 -1
- package/src/components/portal/PortalHost.tsx +4 -4
- package/src/components/portal/PortalProvider.tsx +24 -35
- package/src/components/portal/index.ts +7 -7
- package/src/components/screen/Screen.tsx +45 -52
- package/src/components/screen/ScreenContext.tsx +8 -17
- package/src/components/screen/ScreenFlatList.tsx +17 -36
- package/src/components/screen/ScreenList.tsx +31 -63
- package/src/components/screen/ScreenScrollView.tsx +17 -30
- package/src/components/screen/index.ts +11 -11
- package/src/components/screen/parts/BottomSafeArea.tsx +5 -6
- package/src/components/screen/parts/ScreenPlaceholder.tsx +9 -14
- package/src/components/screen/types.ts +2 -2
- package/src/components/screen/utils.ts +6 -19
- package/src/components/slot/Slot.tsx +5 -20
- package/src/components/slot/index.ts +3 -3
- package/src/components/slot/utils.ts +5 -8
- package/src/components/spinner/Spinner.tsx +19 -52
- package/src/components/spinner/index.ts +2 -2
- package/src/components/surface/Surface.tsx +34 -43
- package/src/components/surface/index.ts +2 -2
- package/src/components/text/Text.tsx +75 -85
- package/src/components/text/index.ts +2 -2
- package/src/components/toast/Toast.tsx +195 -251
- package/src/components/toast/ToastProvider.tsx +61 -136
- package/src/components/toast/index.ts +4 -4
- package/src/components/toast/parts/ToastAnimatedItem.tsx +14 -22
- package/src/components/toast/types.ts +11 -14
- package/src/components/toast/utils/controller.ts +4 -6
- package/src/components/toolbar/Toolbar.tsx +42 -61
- package/src/components/toolbar/index.ts +2 -2
- package/src/context/ThemeProvider.tsx +13 -28
- package/src/context/index.ts +2 -2
- package/src/index.tsx +3 -3
- package/src/theme/breakpoints.ts +3 -5
- package/src/theme/defaults/icons.tsx +15 -30
- package/src/theme/defaults/image.tsx +9 -14
- package/src/theme/index.ts +14 -14
- package/src/theme/registry.ts +30 -49
- package/src/theme/runtime.ts +6 -7
- package/src/theme/screen-margin.ts +3 -3
- package/src/theme/theme.ts +39 -60
- package/src/theme/tokens/dark.ts +67 -67
- package/src/theme/tokens/light.ts +67 -67
- package/src/theme/tokens/primitives.ts +417 -417
- package/src/theme/types.ts +138 -135
- package/src/utils/accent-utils.ts +21 -30
- package/src/utils/color-utils.ts +3 -3
- package/src/utils/deep-merge.ts +1 -1
- package/src/utils/resolve-theme-color.ts +8 -11
- package/src/utils/typography.ts +7 -10
- package/src/utils/unflatten.ts +2 -2
package/src/theme/registry.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { StyleSheet, UnistylesRuntime } from
|
|
2
|
-
|
|
3
|
-
import { normalizeAccent } from
|
|
4
|
-
import { deepMerge } from
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
buildRadiusScale,
|
|
11
|
-
buildSpacingScale,
|
|
12
|
-
defaultDarkTheme,
|
|
13
|
-
defaultLightTheme,
|
|
14
|
-
} from './theme';
|
|
1
|
+
import { StyleSheet, UnistylesRuntime } from "react-native-unistyles";
|
|
2
|
+
|
|
3
|
+
import { normalizeAccent } from "#utils/accent-utils";
|
|
4
|
+
import { deepMerge } from "#utils/deep-merge";
|
|
5
|
+
import { breakpoints } from "./breakpoints";
|
|
6
|
+
import { defaultIcons } from "./defaults/icons";
|
|
7
|
+
import { defaultImage } from "./defaults/image";
|
|
8
|
+
import { buildRadiusScale, buildSpacingScale, defaultDarkTheme, defaultLightTheme } from "./theme";
|
|
15
9
|
import type {
|
|
16
10
|
ComponentDefaults,
|
|
17
11
|
DefaultRadiusToken,
|
|
@@ -25,27 +19,25 @@ import type {
|
|
|
25
19
|
TerraSemanticIconName,
|
|
26
20
|
TerraTheme,
|
|
27
21
|
TerraThemeOverride,
|
|
28
|
-
} from
|
|
22
|
+
} from "./types";
|
|
29
23
|
|
|
30
24
|
// ─── Radius / elevation defaults ─────────────────────────────────────────────
|
|
31
25
|
|
|
32
26
|
/** Fallback when a component's radius is not configured. */
|
|
33
|
-
const DEFAULT_RADIUS: DefaultRadiusToken =
|
|
27
|
+
const DEFAULT_RADIUS: DefaultRadiusToken = "md";
|
|
34
28
|
/** Fallback when the surface elevation is not configured. */
|
|
35
|
-
const DEFAULT_ELEVATION: ElevationKey =
|
|
29
|
+
const DEFAULT_ELEVATION: ElevationKey = "none";
|
|
36
30
|
|
|
37
31
|
type ResolvedRadius = Record<RadiusComponent, DefaultRadiusToken>;
|
|
38
32
|
|
|
39
33
|
/** Resolves each component's default radius from the `components` config. */
|
|
40
|
-
const resolveDefaultRadius = (
|
|
41
|
-
components?: ComponentDefaults
|
|
42
|
-
): ResolvedRadius => ({
|
|
34
|
+
const resolveDefaultRadius = (components?: ComponentDefaults): ResolvedRadius => ({
|
|
43
35
|
button: components?.button?.radius ?? DEFAULT_RADIUS,
|
|
44
36
|
surface: components?.surface?.radius ?? DEFAULT_RADIUS,
|
|
45
37
|
});
|
|
46
38
|
|
|
47
39
|
// ─── Unistyles module augmentation ────────────────────────────────────────────
|
|
48
|
-
declare module
|
|
40
|
+
declare module "react-native-unistyles" {
|
|
49
41
|
export interface UnistylesThemes {
|
|
50
42
|
light: TerraTheme;
|
|
51
43
|
dark: TerraTheme;
|
|
@@ -83,42 +75,35 @@ export const getIsConfigured = (): boolean => registry.configured;
|
|
|
83
75
|
|
|
84
76
|
export const getAccentNames = (): string[] => Object.keys(registry.accents);
|
|
85
77
|
|
|
86
|
-
export const getImageComponent = (): TerraImageComponent =>
|
|
87
|
-
registry.imageComponent;
|
|
78
|
+
export const getImageComponent = (): TerraImageComponent => registry.imageComponent;
|
|
88
79
|
|
|
89
80
|
export const getIcon = (name: string): TerraIconComponent | undefined =>
|
|
90
81
|
registry.icons[name] ?? defaultIcons[name as TerraSemanticIconName];
|
|
91
82
|
|
|
92
|
-
export const getRequiredIcon = (
|
|
93
|
-
name
|
|
94
|
-
): TerraIconComponent => registry.icons[name] ?? defaultIcons[name];
|
|
83
|
+
export const getRequiredIcon = (name: TerraSemanticIconName): TerraIconComponent =>
|
|
84
|
+
registry.icons[name] ?? defaultIcons[name];
|
|
95
85
|
|
|
96
86
|
/**
|
|
97
87
|
* The configured default corner radius for a component (Button, Surface).
|
|
98
88
|
* Set via {@link configureTerraUI}; defaults to `'md'`.
|
|
99
89
|
*/
|
|
100
|
-
export const getDefaultRadius = (
|
|
101
|
-
component
|
|
102
|
-
): DefaultRadiusToken => registry.defaultRadius[component];
|
|
90
|
+
export const getDefaultRadius = (component: RadiusComponent): DefaultRadiusToken =>
|
|
91
|
+
registry.defaultRadius[component];
|
|
103
92
|
|
|
104
93
|
/**
|
|
105
94
|
* The configured default drop-shadow depth for Surface (`'none'` = no shadow).
|
|
106
95
|
* Set via {@link configureTerraUI}; defaults to `'none'`.
|
|
107
96
|
*/
|
|
108
|
-
export const getSurfaceElevation = (): ElevationKey =>
|
|
109
|
-
registry.surfaceElevation;
|
|
97
|
+
export const getSurfaceElevation = (): ElevationKey => registry.surfaceElevation;
|
|
110
98
|
|
|
111
99
|
/** Resolves a scheme's theme = base ⊕ the named accent's partial override. */
|
|
112
100
|
export function resolveTheme(scheme: Scheme, accentName?: string): TerraTheme {
|
|
113
|
-
const base = scheme ===
|
|
101
|
+
const base = scheme === "light" ? registry.baseLight : registry.baseDark;
|
|
114
102
|
const accent = accentName ? registry.accents[accentName] : undefined;
|
|
115
103
|
return deepMerge(base, accent ? accent[scheme] : undefined);
|
|
116
104
|
}
|
|
117
105
|
|
|
118
|
-
const mergeThemeOverride = (
|
|
119
|
-
theme: TerraTheme,
|
|
120
|
-
override?: TerraThemeOverride
|
|
121
|
-
): TerraTheme => {
|
|
106
|
+
const mergeThemeOverride = (theme: TerraTheme, override?: TerraThemeOverride): TerraTheme => {
|
|
122
107
|
if (!override) return theme;
|
|
123
108
|
|
|
124
109
|
const { radius, spacing, ...rest } = override;
|
|
@@ -166,7 +151,7 @@ export function configureTerraUI(config: TerraConfig = {}): void {
|
|
|
166
151
|
if (registry.configured && !configuredByFallback) {
|
|
167
152
|
if (__DEV__ && Object.keys(config).length > 0) {
|
|
168
153
|
console.warn(
|
|
169
|
-
|
|
154
|
+
"[react-native-terra-ui] configureTerraUI() was called more than once; the later call was ignored."
|
|
170
155
|
);
|
|
171
156
|
}
|
|
172
157
|
return;
|
|
@@ -210,8 +195,7 @@ function applyConfig(config: TerraConfig): void {
|
|
|
210
195
|
);
|
|
211
196
|
|
|
212
197
|
registry.defaultRadius = resolveDefaultRadius(config.components);
|
|
213
|
-
registry.surfaceElevation =
|
|
214
|
-
config.components?.surface?.elevation ?? DEFAULT_ELEVATION;
|
|
198
|
+
registry.surfaceElevation = config.components?.surface?.elevation ?? DEFAULT_ELEVATION;
|
|
215
199
|
registry.icons = config.icons ?? {};
|
|
216
200
|
registry.imageComponent = config.image ?? defaultImage;
|
|
217
201
|
|
|
@@ -220,14 +204,11 @@ function applyConfig(config: TerraConfig): void {
|
|
|
220
204
|
registry.accents[name] = normalizeAccent(accent);
|
|
221
205
|
}
|
|
222
206
|
const { defaultAccent } = config;
|
|
223
|
-
registry.currentAccent =
|
|
224
|
-
defaultAccent && registry.accents[defaultAccent]
|
|
225
|
-
? defaultAccent
|
|
226
|
-
: undefined;
|
|
207
|
+
registry.currentAccent = defaultAccent && registry.accents[defaultAccent] ? defaultAccent : undefined;
|
|
227
208
|
|
|
228
209
|
const themes = {
|
|
229
|
-
light: resolveTheme(
|
|
230
|
-
dark: resolveTheme(
|
|
210
|
+
light: resolveTheme("light", registry.currentAccent),
|
|
211
|
+
dark: resolveTheme("dark", registry.currentAccent),
|
|
231
212
|
};
|
|
232
213
|
|
|
233
214
|
const adaptive = config.adaptiveThemes ?? true;
|
|
@@ -235,17 +216,17 @@ function applyConfig(config: TerraConfig): void {
|
|
|
235
216
|
? { initialTheme: config.initialScheme }
|
|
236
217
|
: adaptive
|
|
237
218
|
? { adaptiveThemes: true as const }
|
|
238
|
-
: { initialTheme:
|
|
219
|
+
: { initialTheme: "light" as const };
|
|
239
220
|
|
|
240
221
|
if (unistylesConfigured) {
|
|
241
222
|
// `StyleSheet.configure` is a one-time startup call — calling it again
|
|
242
223
|
// leaves the themes it already registered in place, which would strand an
|
|
243
224
|
// app's config behind the fallback's defaults. Hand the rebuilt themes to
|
|
244
225
|
// the runtime instead, the same way `applyAccent` swaps a palette.
|
|
245
|
-
UnistylesRuntime.updateTheme(
|
|
246
|
-
UnistylesRuntime.updateTheme(
|
|
226
|
+
UnistylesRuntime.updateTheme("light", () => themes.light);
|
|
227
|
+
UnistylesRuntime.updateTheme("dark", () => themes.dark);
|
|
247
228
|
|
|
248
|
-
if (
|
|
229
|
+
if ("adaptiveThemes" in settings) {
|
|
249
230
|
UnistylesRuntime.setAdaptiveThemes(true);
|
|
250
231
|
} else {
|
|
251
232
|
UnistylesRuntime.setAdaptiveThemes(false);
|
package/src/theme/runtime.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UnistylesRuntime } from
|
|
1
|
+
import { UnistylesRuntime } from "react-native-unistyles";
|
|
2
2
|
|
|
3
|
-
import { getRegistry, resolveTheme } from
|
|
4
|
-
import type { Scheme } from
|
|
3
|
+
import { getRegistry, resolveTheme } from "./registry";
|
|
4
|
+
import type { Scheme } from "./types";
|
|
5
5
|
|
|
6
6
|
/** Apply a named accent at runtime by updating both registered themes. */
|
|
7
7
|
export function applyAccent(name: string): void {
|
|
@@ -13,12 +13,11 @@ export function applyAccent(name: string): void {
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
registry.currentAccent = name;
|
|
16
|
-
UnistylesRuntime.updateTheme(
|
|
17
|
-
UnistylesRuntime.updateTheme(
|
|
16
|
+
UnistylesRuntime.updateTheme("light", () => resolveTheme("light", name));
|
|
17
|
+
UnistylesRuntime.updateTheme("dark", () => resolveTheme("dark", name));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export const getCurrentAccent = (): string | undefined =>
|
|
21
|
-
getRegistry().currentAccent;
|
|
20
|
+
export const getCurrentAccent = (): string | undefined => getRegistry().currentAccent;
|
|
22
21
|
|
|
23
22
|
/** Switch the active color scheme, disabling adaptive (system) theming. */
|
|
24
23
|
export function applyScheme(scheme: Scheme): void {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { UnistylesBreakpoints } from
|
|
1
|
+
import type { UnistylesBreakpoints } from "react-native-unistyles";
|
|
2
2
|
|
|
3
|
-
import { resolveBreakpointValue } from
|
|
4
|
-
import type { TerraTheme } from
|
|
3
|
+
import { resolveBreakpointValue } from "./breakpoints";
|
|
4
|
+
import type { TerraTheme } from "./types";
|
|
5
5
|
|
|
6
6
|
export interface ResolvedScreenMargin {
|
|
7
7
|
x: number;
|
package/src/theme/theme.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { unflatten } from
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { primitives } from './tokens/primitives';
|
|
1
|
+
import { unflatten } from "#utils/unflatten";
|
|
2
|
+
import { dark } from "./tokens/dark";
|
|
3
|
+
import { light } from "./tokens/light";
|
|
4
|
+
import { primitives } from "./tokens/primitives";
|
|
6
5
|
import type {
|
|
7
6
|
ElevationKey,
|
|
8
7
|
ElevationScale,
|
|
@@ -14,7 +13,7 @@ import type {
|
|
|
14
13
|
TerraTheme,
|
|
15
14
|
ThemeColor,
|
|
16
15
|
Typography,
|
|
17
|
-
} from
|
|
16
|
+
} from "./types";
|
|
18
17
|
|
|
19
18
|
// Matches `{palette.key}/NN` — a palette reference with a trailing NN%
|
|
20
19
|
// opacity suffix (0-100), e.g. `{palette.amber.500}/15`.
|
|
@@ -27,7 +26,7 @@ const HEX6_PATTERN = /^#[0-9a-f]{6}$/i;
|
|
|
27
26
|
*/
|
|
28
27
|
function percentToHexAlpha(percent: number): string {
|
|
29
28
|
const byte = Math.round((percent / 100) * 255);
|
|
30
|
-
return byte.toString(16).padStart(2,
|
|
29
|
+
return byte.toString(16).padStart(2, "0");
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
/**
|
|
@@ -44,7 +43,7 @@ function resolveRefs(
|
|
|
44
43
|
): Record<string, unknown> {
|
|
45
44
|
const out: Record<string, unknown> = {};
|
|
46
45
|
for (const [k, v] of Object.entries(flat)) {
|
|
47
|
-
if (typeof v !==
|
|
46
|
+
if (typeof v !== "string") {
|
|
48
47
|
out[k] = v;
|
|
49
48
|
continue;
|
|
50
49
|
}
|
|
@@ -58,14 +57,11 @@ function resolveRefs(
|
|
|
58
57
|
const base = source[refKey];
|
|
59
58
|
const percent = Number(percentStr);
|
|
60
59
|
out[k] =
|
|
61
|
-
typeof base ===
|
|
62
|
-
? `${base}${percentToHexAlpha(percent)}`
|
|
63
|
-
: v;
|
|
60
|
+
typeof base === "string" && HEX6_PATTERN.test(base) ? `${base}${percentToHexAlpha(percent)}` : v;
|
|
64
61
|
continue;
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
out[k] =
|
|
68
|
-
v.startsWith('{') && v.endsWith('}') ? (source[v.slice(1, -1)] ?? v) : v;
|
|
64
|
+
out[k] = v.startsWith("{") && v.endsWith("}") ? (source[v.slice(1, -1)] ?? v) : v;
|
|
69
65
|
}
|
|
70
66
|
return out;
|
|
71
67
|
}
|
|
@@ -79,14 +75,12 @@ function resolveRefs(
|
|
|
79
75
|
* { 'color.surface.default': '#fff', 'color.action.bg.primary': '#009966' }
|
|
80
76
|
* → { color: { 'surface.default': '#fff', 'action.bg.primary': '#009966' } }
|
|
81
77
|
*/
|
|
82
|
-
function flattenByCategory(
|
|
83
|
-
tokens: Record<string, unknown>
|
|
84
|
-
): Record<string, Record<string, unknown>> {
|
|
78
|
+
function flattenByCategory(tokens: Record<string, unknown>): Record<string, Record<string, unknown>> {
|
|
85
79
|
const out: Record<string, Record<string, unknown>> = {};
|
|
86
80
|
for (const [key, value] of Object.entries(tokens)) {
|
|
87
|
-
const sep = key.indexOf(
|
|
81
|
+
const sep = key.indexOf(".");
|
|
88
82
|
const cat = sep === -1 ? key : key.slice(0, sep);
|
|
89
|
-
const rest = sep === -1 ?
|
|
83
|
+
const rest = sep === -1 ? "" : key.slice(sep + 1);
|
|
90
84
|
if (out[cat] === undefined) {
|
|
91
85
|
out[cat] = {};
|
|
92
86
|
}
|
|
@@ -111,7 +105,7 @@ const prim = unflatten<{
|
|
|
111
105
|
typography: Typography;
|
|
112
106
|
opacity: OpacityTokens;
|
|
113
107
|
layout: LayoutTokens;
|
|
114
|
-
elevation: Record<ElevationKey, Omit<ElevationStyle,
|
|
108
|
+
elevation: Record<ElevationKey, Omit<ElevationStyle, "shadowColor">>;
|
|
115
109
|
}>(primitives);
|
|
116
110
|
|
|
117
111
|
/**
|
|
@@ -129,23 +123,23 @@ export const DEFAULT_RADIUS_BASE = prim.radius.base;
|
|
|
129
123
|
* is needed the way {@link RADIUS_MULTIPLIERS} is for radius.
|
|
130
124
|
*/
|
|
131
125
|
export const SPACING_KEYS: SpacingKey[] = [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
126
|
+
"0",
|
|
127
|
+
"1",
|
|
128
|
+
"2",
|
|
129
|
+
"3",
|
|
130
|
+
"4",
|
|
131
|
+
"5",
|
|
132
|
+
"6",
|
|
133
|
+
"7",
|
|
134
|
+
"8",
|
|
135
|
+
"9",
|
|
136
|
+
"10",
|
|
137
|
+
"12",
|
|
138
|
+
"14",
|
|
139
|
+
"16",
|
|
140
|
+
"20",
|
|
141
|
+
"24",
|
|
142
|
+
"32",
|
|
149
143
|
];
|
|
150
144
|
|
|
151
145
|
/**
|
|
@@ -162,9 +156,7 @@ export const DEFAULT_SPACING_BASE = prim.spacing.base;
|
|
|
162
156
|
* its key multiplied by `base` — no outliers needed, since `'0'` naturally
|
|
163
157
|
* resolves to `0` for any base.
|
|
164
158
|
*/
|
|
165
|
-
export function buildSpacingScale(
|
|
166
|
-
base: number = DEFAULT_SPACING_BASE
|
|
167
|
-
): Record<SpacingKey, number> {
|
|
159
|
+
export function buildSpacingScale(base: number = DEFAULT_SPACING_BASE): Record<SpacingKey, number> {
|
|
168
160
|
const scale = {} as Record<SpacingKey, number>;
|
|
169
161
|
for (const key of SPACING_KEYS) {
|
|
170
162
|
scale[key] = Number(key) * base;
|
|
@@ -178,30 +170,23 @@ const defaultSpacing = buildSpacingScale();
|
|
|
178
170
|
* Per-token multipliers applied to the base radius (DaisyUI-style). `none` (0)
|
|
179
171
|
* and `full` (9999) are fixed and not scaled.
|
|
180
172
|
*/
|
|
181
|
-
export const RADIUS_MULTIPLIERS: Record<
|
|
182
|
-
Exclude<RadiusKey, 'none' | 'full'>,
|
|
183
|
-
number
|
|
184
|
-
> = {
|
|
173
|
+
export const RADIUS_MULTIPLIERS: Record<Exclude<RadiusKey, "none" | "full">, number> = {
|
|
185
174
|
xs: 0.25,
|
|
186
175
|
sm: 0.5,
|
|
187
176
|
md: 0.75,
|
|
188
177
|
lg: 1,
|
|
189
178
|
xl: 1.5,
|
|
190
|
-
|
|
191
|
-
|
|
179
|
+
"2xl": 2,
|
|
180
|
+
"3xl": 3,
|
|
192
181
|
};
|
|
193
182
|
|
|
194
183
|
/**
|
|
195
184
|
* Builds the full radius scale from a single base value. Derived steps keep
|
|
196
185
|
* their exact (possibly fractional) dp; `none`/`full` are constant.
|
|
197
186
|
*/
|
|
198
|
-
export function buildRadiusScale(
|
|
199
|
-
base: number = DEFAULT_RADIUS_BASE
|
|
200
|
-
): Record<RadiusKey, number> {
|
|
187
|
+
export function buildRadiusScale(base: number = DEFAULT_RADIUS_BASE): Record<RadiusKey, number> {
|
|
201
188
|
const scale = { none: 0, full: 9999 } as Record<RadiusKey, number>;
|
|
202
|
-
for (const key of Object.keys(
|
|
203
|
-
RADIUS_MULTIPLIERS
|
|
204
|
-
) as (keyof typeof RADIUS_MULTIPLIERS)[]) {
|
|
189
|
+
for (const key of Object.keys(RADIUS_MULTIPLIERS) as (keyof typeof RADIUS_MULTIPLIERS)[]) {
|
|
205
190
|
scale[key] = base * RADIUS_MULTIPLIERS[key];
|
|
206
191
|
}
|
|
207
192
|
return scale;
|
|
@@ -218,7 +203,7 @@ const darkByCategory = flattenByCategory(resolveRefs(dark, primitives));
|
|
|
218
203
|
* `dark.ts`.
|
|
219
204
|
*/
|
|
220
205
|
function withShadowColor(
|
|
221
|
-
elevation: Record<ElevationKey, Omit<ElevationStyle,
|
|
206
|
+
elevation: Record<ElevationKey, Omit<ElevationStyle, "shadowColor">>,
|
|
222
207
|
shadowColor: string
|
|
223
208
|
): ElevationScale {
|
|
224
209
|
const out = {} as ElevationScale;
|
|
@@ -232,17 +217,11 @@ function withShadowColor(
|
|
|
232
217
|
// elevation: shared shape from primitives, shadowColor layered on per scheme
|
|
233
218
|
const lightTokens = {
|
|
234
219
|
color: lightByCategory.color as unknown as ThemeColor,
|
|
235
|
-
elevation: withShadowColor(
|
|
236
|
-
prim.elevation,
|
|
237
|
-
(lightByCategory.color as unknown as ThemeColor).shadow
|
|
238
|
-
),
|
|
220
|
+
elevation: withShadowColor(prim.elevation, (lightByCategory.color as unknown as ThemeColor).shadow),
|
|
239
221
|
};
|
|
240
222
|
const darkTokens = {
|
|
241
223
|
color: darkByCategory.color as unknown as ThemeColor,
|
|
242
|
-
elevation: withShadowColor(
|
|
243
|
-
prim.elevation,
|
|
244
|
-
(darkByCategory.color as unknown as ThemeColor).shadow
|
|
245
|
-
),
|
|
224
|
+
elevation: withShadowColor(prim.elevation, (darkByCategory.color as unknown as ThemeColor).shadow),
|
|
246
225
|
};
|
|
247
226
|
|
|
248
227
|
export const defaultLightTheme: TerraTheme = {
|
package/src/theme/tokens/dark.ts
CHANGED
|
@@ -7,102 +7,102 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export const dark = {
|
|
9
9
|
// ── color: page background ────────────────────────────────────────────────
|
|
10
|
-
|
|
10
|
+
"color.background": "#050505",
|
|
11
11
|
|
|
12
12
|
// ── color: shadow (used as elevation.*.shadowColor) ───────────────────────
|
|
13
|
-
|
|
13
|
+
"color.shadow": "#FFFFFF",
|
|
14
14
|
|
|
15
15
|
// ── color: surfaces (bg implied — no property segment) ──────────────────
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
"color.surface.default": "#17191A",
|
|
17
|
+
"color.surface.raised": "{palette.neutral.800}",
|
|
18
|
+
"color.surface.sunken": "#050506",
|
|
19
|
+
"color.surface.overlay": "rgba(0, 0, 0, 0.72)",
|
|
20
|
+
"color.surface.accent": "{palette.emerald.500}",
|
|
21
|
+
"color.surface.accent.subtle": "{palette.emerald.950}",
|
|
22
22
|
|
|
23
23
|
// ── color: text / icons (fg implied — no property segment) ──────────────
|
|
24
|
-
|
|
24
|
+
"color.text.default": "{palette.neutral.50}",
|
|
25
25
|
// Off-ramp hexes (like light's) rather than neutral.400/500/600: the ramp
|
|
26
26
|
// steps are tuned for dark text on white, and reused as light text they land
|
|
27
27
|
// too dim. Set so `subtle` clears AA 4.5:1 on `surface.raised` — the lightest
|
|
28
28
|
// surface, so the worst case — which keeps the muted/subtle/disabled spacing
|
|
29
29
|
// proportional to light's.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
"color.text.muted": "#b8b8be",
|
|
31
|
+
"color.text.subtle": "#8d8d96",
|
|
32
|
+
"color.text.disabled": "#606069",
|
|
33
|
+
"color.text.inverse": "{palette.neutral.950}",
|
|
34
|
+
"color.text.link": "{palette.blue.300}",
|
|
35
|
+
"color.text.accent": "{palette.emerald.400}",
|
|
36
|
+
"color.text.on-accent": "{palette.neutral.950}",
|
|
37
|
+
"color.text.on-accent-subtle": "{palette.emerald.300}",
|
|
38
38
|
|
|
39
39
|
// ── color: borders (border-color implied — no property segment) ──────────
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
"color.border.subtle": "{palette.neutral.800}",
|
|
41
|
+
"color.border.default": "{palette.neutral.700}",
|
|
42
|
+
"color.border.strong": "{palette.neutral.600}",
|
|
43
|
+
"color.border.focus": "{palette.blue.400}",
|
|
44
|
+
"color.border.accent": "{palette.emerald.500}",
|
|
45
45
|
|
|
46
46
|
// ── color: interactive actions (bg + fg → property required) ────────────
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
"color.action.bg.primary": "{palette.emerald.500}",
|
|
48
|
+
"color.action.bg.primary.hover": "{palette.emerald.400}",
|
|
49
|
+
"color.action.bg.primary.active": "{palette.emerald.300}",
|
|
50
|
+
"color.action.bg.primary.disabled": "{palette.slate.700}",
|
|
51
|
+
"color.action.fg.primary": "{palette.slate.950}",
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
"color.action.bg.primary.subtle": "{palette.emerald.950}",
|
|
54
|
+
"color.action.bg.primary.subtle.hover": "{palette.emerald.900}",
|
|
55
|
+
"color.action.bg.primary.subtle.active": "{palette.emerald.800}",
|
|
56
|
+
"color.action.bg.primary.subtle.disabled": "{palette.neutral.900}",
|
|
57
|
+
"color.action.fg.primary.subtle": "{palette.emerald.300}",
|
|
58
58
|
|
|
59
59
|
// `secondary`'s resting fill/text — used by Avatar/Chip's `secondary` color
|
|
60
60
|
// and Button/Toast's neutral-emphasis look; sized for real separation
|
|
61
61
|
// against `color.background` (neutral.950).
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
"color.action.bg.secondary": "{palette.neutral.600}",
|
|
63
|
+
"color.action.fg.secondary": "{palette.neutral.50}",
|
|
64
64
|
// Translucent, like light's — and like the status schemes' `/30` fills above.
|
|
65
65
|
// As opaque neutral.800 this was exactly `surface.raised`, so a soft
|
|
66
66
|
// secondary Chip/Button vanished on a raised card (1.00:1), and its opaque
|
|
67
67
|
// neutral.700 hover was indistinguishable from the resting fill there. An
|
|
68
68
|
// overlay lightens whatever it sits on, so the fill separates on all three
|
|
69
69
|
// surfaces (1.49-1.59:1, matching the success/warning chips).
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
"color.action.bg.secondary.subtle": "{palette.neutral.400}/25",
|
|
71
|
+
"color.action.bg.secondary.subtle.hover": "{palette.neutral.400}/35",
|
|
72
|
+
"color.action.bg.secondary.subtle.active": "{palette.neutral.400}/45",
|
|
73
|
+
"color.action.bg.secondary.subtle.disabled": "{palette.neutral.900}",
|
|
74
|
+
"color.action.fg.secondary.subtle": "{palette.neutral.200}",
|
|
75
75
|
|
|
76
76
|
// ── color: status (bg + fg + border → property required) ────────────────
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
"color.status.success": "{palette.green.600}",
|
|
78
|
+
"color.status.success.bg": "{palette.green.600}",
|
|
79
|
+
"color.status.success.bg.subtle": "{palette.green.600}/30",
|
|
80
|
+
"color.status.success.border": "{palette.green.700}",
|
|
81
|
+
"color.status.success.border.subtle": "{palette.green.800}",
|
|
82
|
+
"color.status.success.fg": "{palette.white}",
|
|
83
|
+
"color.status.success.fg.subtle": "{palette.green.200}",
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
"color.status.warning": "{palette.yellow.600}",
|
|
86
|
+
"color.status.warning.bg": "{palette.yellow.600}",
|
|
87
|
+
"color.status.warning.bg.subtle": "{palette.yellow.600}/30",
|
|
88
|
+
"color.status.warning.border": "{palette.yellow.700}",
|
|
89
|
+
"color.status.warning.border.subtle": "{palette.yellow.800}",
|
|
90
|
+
"color.status.warning.fg": "{palette.white}",
|
|
91
|
+
"color.status.warning.fg.subtle": "{palette.yellow.200}",
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
"color.status.danger": "{palette.red.700}",
|
|
94
|
+
"color.status.danger.bg": "{palette.red.700}",
|
|
95
|
+
"color.status.danger.bg.subtle": "{palette.red.700}/30",
|
|
96
|
+
"color.status.danger.border": "{palette.red.800}",
|
|
97
|
+
"color.status.danger.border.subtle": "{palette.red.900}",
|
|
98
|
+
"color.status.danger.fg": "{palette.white}",
|
|
99
|
+
"color.status.danger.fg.subtle": "{palette.red.200}",
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
"color.status.info": "{palette.sky.500}",
|
|
102
|
+
"color.status.info.bg": "{palette.sky.500}",
|
|
103
|
+
"color.status.info.bg.subtle": "{palette.sky.950}",
|
|
104
|
+
"color.status.info.border": "{palette.sky.800}",
|
|
105
|
+
"color.status.info.border.subtle": "{palette.sky.900}",
|
|
106
|
+
"color.status.info.fg": "{palette.slate.950}",
|
|
107
|
+
"color.status.info.fg.subtle": "{palette.sky.200}",
|
|
108
108
|
};
|