react-native-terra-ui 0.5.1 → 0.7.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 +86 -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 +82 -12
- package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +64 -60
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/TitleHeader/index.js +33 -29
- 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 +6 -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 +103 -33
- 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/dark.js.map +1 -1
- 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 +19 -2
- 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 +1 -1
- 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 +84 -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 +77 -11
- package/src/components/header/variants/LargeTitleHeader/index.tsx +79 -142
- package/src/components/header/variants/TitleHeader/index.tsx +45 -63
- package/src/components/icon/Icon.tsx +31 -39
- package/src/components/icon/index.ts +2 -2
- package/src/components/image/Image.tsx +12 -10
- 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 +117 -72
- 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 +123 -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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Pressable } from "react-native-unistyles/components/native/Pressable";
|
|
4
|
-
import { Children, createContext, forwardRef, useContext } from
|
|
5
|
-
import { StyleSheet, useUnistyles } from
|
|
4
|
+
import { Children, createContext, forwardRef, useContext } from "react";
|
|
5
|
+
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
6
6
|
import { getDefaultRadius } from "../../theme/registry.js";
|
|
7
|
+
import { readableOn } from "../../utils/color-utils.js";
|
|
8
|
+
import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
|
|
7
9
|
import { Icon } from "../icon/index.js";
|
|
8
10
|
import { Spinner } from "../spinner/index.js";
|
|
9
11
|
import { Text } from "../text/index.js";
|
|
@@ -11,8 +13,8 @@ import { Text } from "../text/index.js";
|
|
|
11
13
|
// ─── Context (lets icons/labels read the resolved foreground + size) ───────────
|
|
12
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
15
|
const ButtonContext = /*#__PURE__*/createContext({
|
|
14
|
-
color:
|
|
15
|
-
size:
|
|
16
|
+
color: "",
|
|
17
|
+
size: "md"
|
|
16
18
|
});
|
|
17
19
|
export const useButtonContext = () => useContext(ButtonContext);
|
|
18
20
|
|
|
@@ -20,42 +22,42 @@ export const useButtonContext = () => useContext(ButtonContext);
|
|
|
20
22
|
|
|
21
23
|
function getColors(variant, theme) {
|
|
22
24
|
const c = theme.color;
|
|
23
|
-
const get = key => c[key] ??
|
|
25
|
+
const get = key => c[key] ?? "";
|
|
24
26
|
switch (variant) {
|
|
25
|
-
case
|
|
27
|
+
case "primary":
|
|
26
28
|
return {
|
|
27
|
-
bg: get(
|
|
28
|
-
border: get(
|
|
29
|
+
bg: get("action.bg.primary"),
|
|
30
|
+
border: get("action.bg.primary"),
|
|
29
31
|
borderWidth: 0,
|
|
30
|
-
fg: get(
|
|
32
|
+
fg: get("action.fg.primary")
|
|
31
33
|
};
|
|
32
|
-
case
|
|
34
|
+
case "secondary":
|
|
33
35
|
return {
|
|
34
|
-
bg: get(
|
|
35
|
-
border: get(
|
|
36
|
+
bg: get("action.bg.secondary"),
|
|
37
|
+
border: get("action.bg.secondary"),
|
|
36
38
|
borderWidth: 0,
|
|
37
|
-
fg: get(
|
|
39
|
+
fg: get("action.fg.secondary")
|
|
38
40
|
};
|
|
39
|
-
case
|
|
41
|
+
case "outline":
|
|
40
42
|
return {
|
|
41
|
-
bg:
|
|
42
|
-
border: get(
|
|
43
|
+
bg: "transparent",
|
|
44
|
+
border: get("border.default"),
|
|
43
45
|
borderWidth: 1,
|
|
44
|
-
fg: get(
|
|
46
|
+
fg: get("text.default")
|
|
45
47
|
};
|
|
46
|
-
case
|
|
48
|
+
case "ghost":
|
|
47
49
|
return {
|
|
48
|
-
bg:
|
|
49
|
-
border:
|
|
50
|
+
bg: "transparent",
|
|
51
|
+
border: "transparent",
|
|
50
52
|
borderWidth: 0,
|
|
51
|
-
fg: get(
|
|
53
|
+
fg: get("text.default")
|
|
52
54
|
};
|
|
53
|
-
case
|
|
55
|
+
case "danger":
|
|
54
56
|
return {
|
|
55
|
-
bg: get(
|
|
56
|
-
border: get(
|
|
57
|
+
bg: get("status.danger.bg"),
|
|
58
|
+
border: get("status.danger.bg"),
|
|
57
59
|
borderWidth: 0,
|
|
58
|
-
fg: get(
|
|
60
|
+
fg: get("status.danger.fg")
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -64,16 +66,16 @@ function getColors(variant, theme) {
|
|
|
64
66
|
|
|
65
67
|
const LABEL_TYPOGRAPHY = {
|
|
66
68
|
sm: {
|
|
67
|
-
variant:
|
|
68
|
-
weight:
|
|
69
|
+
variant: "label-md",
|
|
70
|
+
weight: "semibold"
|
|
69
71
|
},
|
|
70
72
|
md: {
|
|
71
|
-
variant:
|
|
72
|
-
weight:
|
|
73
|
+
variant: "label-lg",
|
|
74
|
+
weight: "semibold"
|
|
73
75
|
},
|
|
74
76
|
lg: {
|
|
75
|
-
variant:
|
|
76
|
-
weight:
|
|
77
|
+
variant: "label-lg",
|
|
78
|
+
weight: "bold"
|
|
77
79
|
}
|
|
78
80
|
};
|
|
79
81
|
const ButtonLabel = ({
|
|
@@ -120,12 +122,12 @@ const ButtonIcon = ({
|
|
|
120
122
|
};
|
|
121
123
|
function renderChildren(children) {
|
|
122
124
|
return Children.map(children, child => {
|
|
123
|
-
if (typeof child ===
|
|
125
|
+
if (typeof child === "string") {
|
|
124
126
|
return child.trim().length > 0 ? /*#__PURE__*/_jsx(ButtonLabel, {
|
|
125
127
|
children: child
|
|
126
128
|
}) : null;
|
|
127
129
|
}
|
|
128
|
-
if (typeof child ===
|
|
130
|
+
if (typeof child === "number") {
|
|
129
131
|
return /*#__PURE__*/_jsx(ButtonLabel, {
|
|
130
132
|
children: child
|
|
131
133
|
});
|
|
@@ -137,14 +139,15 @@ function renderChildren(children) {
|
|
|
137
139
|
// ─── Component ────────────────────────────────────────────────────────────────
|
|
138
140
|
|
|
139
141
|
const ButtonRoot = /*#__PURE__*/forwardRef(function Button({
|
|
140
|
-
variant =
|
|
141
|
-
size =
|
|
142
|
-
radius = getDefaultRadius(
|
|
142
|
+
variant = "primary",
|
|
143
|
+
size = "md",
|
|
144
|
+
radius = getDefaultRadius("button"),
|
|
143
145
|
isDisabled = false,
|
|
144
146
|
isLoading = false,
|
|
145
147
|
isIconOnly = false,
|
|
146
148
|
fullWidth = true,
|
|
147
149
|
compact = false,
|
|
150
|
+
background,
|
|
148
151
|
children,
|
|
149
152
|
onPress,
|
|
150
153
|
...rest
|
|
@@ -161,11 +164,14 @@ const ButtonRoot = /*#__PURE__*/forwardRef(function Button({
|
|
|
161
164
|
iconOnly: isIconOnly
|
|
162
165
|
});
|
|
163
166
|
const {
|
|
164
|
-
bg,
|
|
167
|
+
bg: variantBg,
|
|
165
168
|
border,
|
|
166
169
|
borderWidth,
|
|
167
|
-
fg
|
|
170
|
+
fg: variantFg
|
|
168
171
|
} = getColors(variant, theme);
|
|
172
|
+
const resolvedBackground = background !== undefined ? resolveThemeColor(background, theme) : undefined;
|
|
173
|
+
const bg = resolvedBackground ?? variantBg;
|
|
174
|
+
const fg = resolvedBackground !== undefined ? readableOn(resolvedBackground) : variantFg;
|
|
169
175
|
const blocked = isDisabled || isLoading;
|
|
170
176
|
const {
|
|
171
177
|
style: externalStyle,
|
|
@@ -194,7 +200,7 @@ const ButtonRoot = /*#__PURE__*/forwardRef(function Button({
|
|
|
194
200
|
opacity: theme.opacity.pressed
|
|
195
201
|
} : null, isDisabled ? {
|
|
196
202
|
opacity: theme.opacity.disabled
|
|
197
|
-
} : null, typeof externalStyle ===
|
|
203
|
+
} : null, typeof externalStyle === "function" ? externalStyle(state) : externalStyle],
|
|
198
204
|
children: [isLoading && /*#__PURE__*/_jsx(Spinner, {
|
|
199
205
|
size: "sm",
|
|
200
206
|
color: fg
|
|
@@ -211,24 +217,24 @@ Button.Label = ButtonLabel;
|
|
|
211
217
|
|
|
212
218
|
const styles = StyleSheet.create(theme => ({
|
|
213
219
|
base: {
|
|
214
|
-
flexDirection:
|
|
215
|
-
alignItems:
|
|
216
|
-
justifyContent:
|
|
217
|
-
alignSelf:
|
|
220
|
+
flexDirection: "row",
|
|
221
|
+
alignItems: "center",
|
|
222
|
+
justifyContent: "center",
|
|
223
|
+
alignSelf: "flex-start",
|
|
218
224
|
variants: {
|
|
219
225
|
size: {
|
|
220
226
|
sm: {
|
|
221
|
-
|
|
227
|
+
height: 36,
|
|
222
228
|
paddingHorizontal: 14,
|
|
223
229
|
gap: 6
|
|
224
230
|
},
|
|
225
231
|
md: {
|
|
226
|
-
|
|
232
|
+
height: 44,
|
|
227
233
|
paddingHorizontal: 16,
|
|
228
234
|
gap: 8
|
|
229
235
|
},
|
|
230
236
|
lg: {
|
|
231
|
-
|
|
237
|
+
height: 52,
|
|
232
238
|
paddingHorizontal: 20,
|
|
233
239
|
gap: 8
|
|
234
240
|
}
|
|
@@ -255,7 +261,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
255
261
|
},
|
|
256
262
|
fullWidth: {
|
|
257
263
|
true: {
|
|
258
|
-
alignSelf:
|
|
264
|
+
alignSelf: "stretch"
|
|
259
265
|
},
|
|
260
266
|
false: {}
|
|
261
267
|
},
|
|
@@ -272,7 +278,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
272
278
|
compact: {
|
|
273
279
|
paddingHorizontal: 2,
|
|
274
280
|
paddingVertical: 2,
|
|
275
|
-
|
|
281
|
+
height: undefined
|
|
276
282
|
}
|
|
277
283
|
}));
|
|
278
284
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","createContext","forwardRef","useContext","StyleSheet","useUnistyles","getDefaultRadius","Icon","Spinner","Text","jsx","_jsx","jsxs","_jsxs","ButtonContext","color","size","useButtonContext","getColors","variant","theme","c","get","key","bg","border","borderWidth","fg","LABEL_TYPOGRAPHY","sm","weight","md","lg","ButtonLabel","children","typography","style","ICON_SIZE","ButtonIcon","name","sizeProp","colorProp","strokeWidth","renderChildren","map","child","trim","length","ButtonRoot","Button","radius","isDisabled","isLoading","isIconOnly","fullWidth","compact","onPress","rest","ref","_styles","styles","useVariants","iconOnly","blocked","externalStyle","pressableRest","Provider","value","Pressable","
|
|
1
|
+
{"version":3,"names":["Children","createContext","forwardRef","useContext","StyleSheet","useUnistyles","getDefaultRadius","readableOn","resolveThemeColor","Icon","Spinner","Text","jsx","_jsx","jsxs","_jsxs","ButtonContext","color","size","useButtonContext","getColors","variant","theme","c","get","key","bg","border","borderWidth","fg","LABEL_TYPOGRAPHY","sm","weight","md","lg","ButtonLabel","children","typography","style","ICON_SIZE","ButtonIcon","name","sizeProp","colorProp","strokeWidth","renderChildren","map","child","trim","length","ButtonRoot","Button","radius","isDisabled","isLoading","isIconOnly","fullWidth","compact","background","onPress","rest","ref","_styles","styles","useVariants","iconOnly","variantBg","variantFg","resolvedBackground","undefined","blocked","externalStyle","pressableRest","Provider","value","Pressable","disabled","accessibilityRole","accessibilityState","busy","state","base","backgroundColor","borderColor","pressed","opacity","Label","create","flexDirection","alignItems","justifyContent","alignSelf","variants","height","paddingHorizontal","gap","none","borderRadius","xl","full","true","false","aspectRatio","uni__dependencies","paddingVertical"],"sourceRoot":"../../../../src","sources":["components/button/Button.tsx"],"mappings":";;;AAAA,SAASA,QAAQ,EAAqBC,aAAa,EAAEC,UAAU,EAAkBC,UAAU,QAAQ,OAAO;AAI1G,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,gBAAgB;AAEzB,SAASC,UAAU;AACnB,SAASC,iBAAiB;AAC1B,SAASC,IAAI;AACb,SAASC,OAAO;AAChB,SAASC,IAAI;;AA+Bb;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA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AE3E,KAAK,CAAC8B,MAAM,CAACnB;QAAG,CAAC;QACrCC,EAAE,EAAE;UAAE+D,YAAY,EAAE3E,KAAK,CAAC8B,MAAM,CAAClB;QAAG,CAAC;QACrCgE,EAAE,EAAE;UAAED,YAAY,EAAE3E,KAAK,CAAC8B,MAAM,CAAC8C;QAAG,CAAC;QACrCC,IAAI,EAAE;UAAEF,YAAY,EAAE3E,KAAK,CAAC8B,MAAM,CAAC+C;QAAK;MAC1C,CAAC;MACD3C,SAAS,EAAE;QACT4C,IAAI,EAAE;UAAET,SAAS,EAAE;QAAU,CAAC;QAC9BU,KAAK,EAAE,CAAC;MACV,CAAC;MACDpC,QAAQ,EAAE;QACRmC,IAAI,EAAE;UAAEN,iBAAiB,EAAE,CAAC;UAAEQ,WAAW,EAAE;QAAE,CAAC;QAC9CD,KAAK,EAAE,CAAC;MACV;IACF,CAAC;IAAAE,iBAAA;EACH,CAAC;EACD9C,OAAO,EAAE;IACPqC,iBAAiB,EAAE,CAAC;IACpBU,eAAe,EAAE,CAAC;IAClBX,MAAM,EAAExB;EACV;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
4
|
import { Text as RNText } from "react-native-unistyles/components/native/Text";
|
|
5
|
-
import { Children, createContext, forwardRef, useContext } from
|
|
6
|
-
import { StyleSheet, useUnistyles, withUnistyles } from
|
|
5
|
+
import { Children, createContext, forwardRef, useContext } from "react";
|
|
6
|
+
import { StyleSheet, useUnistyles, withUnistyles } from "react-native-unistyles";
|
|
7
7
|
import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
|
|
8
8
|
import { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "../../utils/typography.js";
|
|
9
9
|
import { Icon } from "../icon/index.js";
|
|
@@ -12,8 +12,8 @@ import { getCustomColorColors } from "./utils.js";
|
|
|
12
12
|
// ─── Context (lets Chip.Icon read the resolved foreground + size) ─────────────
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
const ChipContext = /*#__PURE__*/createContext({
|
|
15
|
-
color:
|
|
16
|
-
size:
|
|
15
|
+
color: "text.default",
|
|
16
|
+
size: "md"
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
// ─── Colors ─────────────────────────────────────────────────────────────────
|
|
@@ -32,40 +32,40 @@ const ChipContext = /*#__PURE__*/createContext({
|
|
|
32
32
|
// can't be a compound variant condition — see `getCustomColorColors` in
|
|
33
33
|
// `utils.ts` for how it's derived instead.
|
|
34
34
|
|
|
35
|
-
const SCHEME_NAMES = new Set([
|
|
35
|
+
const SCHEME_NAMES = new Set(["primary", "secondary", "success", "warning", "danger"]);
|
|
36
36
|
// `ghost` is `outline` with its border taken away, so it has no colors of its
|
|
37
37
|
// own — it borrows outline's foreground. Only the *paint* differs, and that
|
|
38
38
|
// comes from the `ghost` style variant, never from here.
|
|
39
39
|
function paintedVariant(variant) {
|
|
40
|
-
return variant ===
|
|
40
|
+
return variant === "ghost" ? "outline" : variant;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/** Foreground token per (scheme, variant) — mirrors the spec's token table. */
|
|
44
44
|
const FG_TOKEN = {
|
|
45
45
|
primary: {
|
|
46
|
-
solid:
|
|
47
|
-
soft:
|
|
48
|
-
outline:
|
|
46
|
+
solid: "action.fg.primary",
|
|
47
|
+
soft: "action.fg.primary.subtle",
|
|
48
|
+
outline: "text.accent"
|
|
49
49
|
},
|
|
50
50
|
secondary: {
|
|
51
|
-
solid:
|
|
52
|
-
soft:
|
|
53
|
-
outline:
|
|
51
|
+
solid: "action.fg.secondary",
|
|
52
|
+
soft: "action.fg.secondary.subtle",
|
|
53
|
+
outline: "text.default"
|
|
54
54
|
},
|
|
55
55
|
success: {
|
|
56
|
-
solid:
|
|
57
|
-
soft:
|
|
58
|
-
outline:
|
|
56
|
+
solid: "status.success.fg",
|
|
57
|
+
soft: "status.success.fg.subtle",
|
|
58
|
+
outline: "status.success.fg.subtle"
|
|
59
59
|
},
|
|
60
60
|
warning: {
|
|
61
|
-
solid:
|
|
62
|
-
soft:
|
|
63
|
-
outline:
|
|
61
|
+
solid: "status.warning.fg",
|
|
62
|
+
soft: "status.warning.fg.subtle",
|
|
63
|
+
outline: "status.warning.fg.subtle"
|
|
64
64
|
},
|
|
65
65
|
danger: {
|
|
66
|
-
solid:
|
|
67
|
-
soft:
|
|
68
|
-
outline:
|
|
66
|
+
solid: "status.danger.fg",
|
|
67
|
+
soft: "status.danger.fg.subtle",
|
|
68
|
+
outline: "status.danger.fg.subtle"
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
|
|
@@ -78,9 +78,9 @@ function resolveForeground(color, variant, customColors) {
|
|
|
78
78
|
// ─── Label sub-component ───────────────────────────────────────────────────────
|
|
79
79
|
|
|
80
80
|
const LABEL_VARIANT = {
|
|
81
|
-
sm:
|
|
82
|
-
md:
|
|
83
|
-
lg:
|
|
81
|
+
sm: "label-sm",
|
|
82
|
+
md: "label-md",
|
|
83
|
+
lg: "label-lg"
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
// Renders through React Native's `Text` rather than the `Text` primitive: a
|
|
@@ -147,12 +147,12 @@ const ChipIcon = ({
|
|
|
147
147
|
};
|
|
148
148
|
function renderChildren(children) {
|
|
149
149
|
return Children.map(children, child => {
|
|
150
|
-
if (typeof child ===
|
|
150
|
+
if (typeof child === "string") {
|
|
151
151
|
return child.trim().length > 0 ? /*#__PURE__*/_jsx(ChipLabel, {
|
|
152
152
|
children: child
|
|
153
153
|
}) : null;
|
|
154
154
|
}
|
|
155
|
-
if (typeof child ===
|
|
155
|
+
if (typeof child === "number") {
|
|
156
156
|
return /*#__PURE__*/_jsx(ChipLabel, {
|
|
157
157
|
children: child
|
|
158
158
|
});
|
|
@@ -164,9 +164,9 @@ function renderChildren(children) {
|
|
|
164
164
|
// ─── Component ────────────────────────────────────────────────────────────────
|
|
165
165
|
|
|
166
166
|
const ChipRoot = /*#__PURE__*/forwardRef(function Chip({
|
|
167
|
-
size =
|
|
168
|
-
variant =
|
|
169
|
-
color =
|
|
167
|
+
size = "md",
|
|
168
|
+
variant = "soft",
|
|
169
|
+
color = "secondary",
|
|
170
170
|
children,
|
|
171
171
|
style,
|
|
172
172
|
...rest
|
|
@@ -184,7 +184,7 @@ const ChipRoot = /*#__PURE__*/forwardRef(function Chip({
|
|
|
184
184
|
// Ghost takes outline's foreground but none of its paint — its transparent
|
|
185
185
|
// background and absent border come from the `ghost` style variant, so
|
|
186
186
|
// applying the derived paint here would hand it outline's border back.
|
|
187
|
-
const customPaint = customColors && variant !==
|
|
187
|
+
const customPaint = customColors && variant !== "ghost" ? {
|
|
188
188
|
backgroundColor: customColors.bg,
|
|
189
189
|
borderColor: customColors.border,
|
|
190
190
|
borderWidth: customColors.borderWidth
|
|
@@ -249,28 +249,28 @@ const styles = StyleSheet.create(theme => {
|
|
|
249
249
|
variants: {
|
|
250
250
|
size: {
|
|
251
251
|
sm: {
|
|
252
|
-
fontSize: theme.typography.variants[
|
|
253
|
-
lineHeight: theme.typography.variants[
|
|
254
|
-
letterSpacing: theme.typography.variants[
|
|
252
|
+
fontSize: theme.typography.variants["label-sm"].fontSize,
|
|
253
|
+
lineHeight: theme.typography.variants["label-sm"].lineHeight,
|
|
254
|
+
letterSpacing: theme.typography.variants["label-sm"].letterSpacing
|
|
255
255
|
},
|
|
256
256
|
md: {
|
|
257
|
-
fontSize: theme.typography.variants[
|
|
258
|
-
lineHeight: theme.typography.variants[
|
|
259
|
-
letterSpacing: theme.typography.variants[
|
|
257
|
+
fontSize: theme.typography.variants["label-md"].fontSize,
|
|
258
|
+
lineHeight: theme.typography.variants["label-md"].lineHeight,
|
|
259
|
+
letterSpacing: theme.typography.variants["label-md"].letterSpacing
|
|
260
260
|
},
|
|
261
261
|
lg: {
|
|
262
|
-
fontSize: theme.typography.variants[
|
|
263
|
-
lineHeight: theme.typography.variants[
|
|
264
|
-
letterSpacing: theme.typography.variants[
|
|
262
|
+
fontSize: theme.typography.variants["label-lg"].fontSize,
|
|
263
|
+
lineHeight: theme.typography.variants["label-lg"].lineHeight,
|
|
264
|
+
letterSpacing: theme.typography.variants["label-lg"].letterSpacing
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
},
|
|
268
268
|
uni__dependencies: [0, 4]
|
|
269
269
|
},
|
|
270
270
|
base: {
|
|
271
|
-
flexDirection:
|
|
272
|
-
alignItems:
|
|
273
|
-
alignSelf:
|
|
271
|
+
flexDirection: "row",
|
|
272
|
+
alignItems: "center",
|
|
273
|
+
alignSelf: "flex-start",
|
|
274
274
|
borderRadius: theme.radius.full,
|
|
275
275
|
variants: {
|
|
276
276
|
size: {
|
|
@@ -305,120 +305,120 @@ const styles = StyleSheet.create(theme => {
|
|
|
305
305
|
soft: {},
|
|
306
306
|
outline: {},
|
|
307
307
|
ghost: {
|
|
308
|
-
backgroundColor:
|
|
309
|
-
borderColor:
|
|
308
|
+
backgroundColor: "transparent",
|
|
309
|
+
borderColor: "transparent",
|
|
310
310
|
borderWidth: 0
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
},
|
|
314
314
|
compoundVariants: [{
|
|
315
|
-
color:
|
|
316
|
-
variant:
|
|
315
|
+
color: "primary",
|
|
316
|
+
variant: "solid",
|
|
317
317
|
styles: {
|
|
318
|
-
backgroundColor: c[
|
|
318
|
+
backgroundColor: c["action.bg.primary"],
|
|
319
319
|
borderWidth: 0
|
|
320
320
|
}
|
|
321
321
|
}, {
|
|
322
|
-
color:
|
|
323
|
-
variant:
|
|
322
|
+
color: "primary",
|
|
323
|
+
variant: "soft",
|
|
324
324
|
styles: {
|
|
325
|
-
backgroundColor: c[
|
|
325
|
+
backgroundColor: c["action.bg.primary.subtle"],
|
|
326
326
|
borderWidth: 0
|
|
327
327
|
}
|
|
328
328
|
}, {
|
|
329
|
-
color:
|
|
330
|
-
variant:
|
|
329
|
+
color: "primary",
|
|
330
|
+
variant: "outline",
|
|
331
331
|
styles: {
|
|
332
|
-
backgroundColor:
|
|
333
|
-
borderColor: c[
|
|
332
|
+
backgroundColor: "transparent",
|
|
333
|
+
borderColor: c["action.bg.primary.subtle"],
|
|
334
334
|
borderWidth: 1
|
|
335
335
|
}
|
|
336
336
|
}, {
|
|
337
|
-
color:
|
|
338
|
-
variant:
|
|
337
|
+
color: "secondary",
|
|
338
|
+
variant: "solid",
|
|
339
339
|
styles: {
|
|
340
|
-
backgroundColor: c[
|
|
340
|
+
backgroundColor: c["action.bg.secondary"],
|
|
341
341
|
borderWidth: 0
|
|
342
342
|
}
|
|
343
343
|
}, {
|
|
344
|
-
color:
|
|
345
|
-
variant:
|
|
344
|
+
color: "secondary",
|
|
345
|
+
variant: "soft",
|
|
346
346
|
styles: {
|
|
347
|
-
backgroundColor: c[
|
|
347
|
+
backgroundColor: c["action.bg.secondary.subtle"],
|
|
348
348
|
borderWidth: 0
|
|
349
349
|
}
|
|
350
350
|
}, {
|
|
351
|
-
color:
|
|
352
|
-
variant:
|
|
351
|
+
color: "secondary",
|
|
352
|
+
variant: "outline",
|
|
353
353
|
styles: {
|
|
354
|
-
backgroundColor:
|
|
355
|
-
borderColor: c[
|
|
354
|
+
backgroundColor: "transparent",
|
|
355
|
+
borderColor: c["action.bg.secondary.subtle"],
|
|
356
356
|
borderWidth: 1
|
|
357
357
|
}
|
|
358
358
|
}, {
|
|
359
|
-
color:
|
|
360
|
-
variant:
|
|
359
|
+
color: "success",
|
|
360
|
+
variant: "solid",
|
|
361
361
|
styles: {
|
|
362
|
-
backgroundColor: c[
|
|
362
|
+
backgroundColor: c["status.success.bg"],
|
|
363
363
|
borderWidth: 0
|
|
364
364
|
}
|
|
365
365
|
}, {
|
|
366
|
-
color:
|
|
367
|
-
variant:
|
|
366
|
+
color: "success",
|
|
367
|
+
variant: "soft",
|
|
368
368
|
styles: {
|
|
369
|
-
backgroundColor: c[
|
|
369
|
+
backgroundColor: c["status.success.bg.subtle"],
|
|
370
370
|
borderWidth: 0
|
|
371
371
|
}
|
|
372
372
|
}, {
|
|
373
|
-
color:
|
|
374
|
-
variant:
|
|
373
|
+
color: "success",
|
|
374
|
+
variant: "outline",
|
|
375
375
|
styles: {
|
|
376
|
-
backgroundColor:
|
|
377
|
-
borderColor: c[
|
|
376
|
+
backgroundColor: "transparent",
|
|
377
|
+
borderColor: c["status.success.bg.subtle"],
|
|
378
378
|
borderWidth: 1
|
|
379
379
|
}
|
|
380
380
|
}, {
|
|
381
|
-
color:
|
|
382
|
-
variant:
|
|
381
|
+
color: "warning",
|
|
382
|
+
variant: "solid",
|
|
383
383
|
styles: {
|
|
384
|
-
backgroundColor: c[
|
|
384
|
+
backgroundColor: c["status.warning.bg"],
|
|
385
385
|
borderWidth: 0
|
|
386
386
|
}
|
|
387
387
|
}, {
|
|
388
|
-
color:
|
|
389
|
-
variant:
|
|
388
|
+
color: "warning",
|
|
389
|
+
variant: "soft",
|
|
390
390
|
styles: {
|
|
391
|
-
backgroundColor: c[
|
|
391
|
+
backgroundColor: c["status.warning.bg.subtle"],
|
|
392
392
|
borderWidth: 0
|
|
393
393
|
}
|
|
394
394
|
}, {
|
|
395
|
-
color:
|
|
396
|
-
variant:
|
|
395
|
+
color: "warning",
|
|
396
|
+
variant: "outline",
|
|
397
397
|
styles: {
|
|
398
|
-
backgroundColor:
|
|
399
|
-
borderColor: c[
|
|
398
|
+
backgroundColor: "transparent",
|
|
399
|
+
borderColor: c["status.warning.bg.subtle"],
|
|
400
400
|
borderWidth: 1
|
|
401
401
|
}
|
|
402
402
|
}, {
|
|
403
|
-
color:
|
|
404
|
-
variant:
|
|
403
|
+
color: "danger",
|
|
404
|
+
variant: "solid",
|
|
405
405
|
styles: {
|
|
406
|
-
backgroundColor: c[
|
|
406
|
+
backgroundColor: c["status.danger.bg"],
|
|
407
407
|
borderWidth: 0
|
|
408
408
|
}
|
|
409
409
|
}, {
|
|
410
|
-
color:
|
|
411
|
-
variant:
|
|
410
|
+
color: "danger",
|
|
411
|
+
variant: "soft",
|
|
412
412
|
styles: {
|
|
413
|
-
backgroundColor: c[
|
|
413
|
+
backgroundColor: c["status.danger.bg.subtle"],
|
|
414
414
|
borderWidth: 0
|
|
415
415
|
}
|
|
416
416
|
}, {
|
|
417
|
-
color:
|
|
418
|
-
variant:
|
|
417
|
+
color: "danger",
|
|
418
|
+
variant: "outline",
|
|
419
419
|
styles: {
|
|
420
|
-
backgroundColor:
|
|
421
|
-
borderColor: c[
|
|
420
|
+
backgroundColor: "transparent",
|
|
421
|
+
borderColor: c["status.danger.bg.subtle"],
|
|
422
422
|
borderWidth: 1
|
|
423
423
|
}
|
|
424
424
|
}],
|