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
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
* untyped (Figma-generated); these types describe the runtime theme that the
|
|
5
5
|
* data is unflattened into, plus the public configuration surface.
|
|
6
6
|
*/
|
|
7
|
-
import type { ComponentType } from
|
|
8
|
-
import type { ImageStyle, StyleProp } from
|
|
9
|
-
import type { DeepPartial } from
|
|
10
|
-
import type { BreakpointName } from
|
|
7
|
+
import type { ComponentType } from "react";
|
|
8
|
+
import type { ImageStyle, StyleProp } from "react-native";
|
|
9
|
+
import type { DeepPartial } from "../utils/deep-merge";
|
|
10
|
+
import type { BreakpointName } from "./breakpoints.js";
|
|
11
11
|
/** Spacing scale keys (dp, 4dp base unit). Read as `gap={3}` → string '3'. */
|
|
12
|
-
export type SpacingKey =
|
|
12
|
+
export type SpacingKey = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "12" | "14" | "16" | "20" | "24" | "32";
|
|
13
13
|
/** Border-radius scale keys. */
|
|
14
|
-
export type RadiusKey =
|
|
14
|
+
export type RadiusKey = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
|
|
15
15
|
/**
|
|
16
16
|
* The radius tokens offered as a component default. Excludes the extreme/rare
|
|
17
17
|
* steps (`xs`, `2xl`, `3xl`).
|
|
18
18
|
*/
|
|
19
|
-
export type DefaultRadiusToken =
|
|
19
|
+
export type DefaultRadiusToken = "sm" | "md" | "lg" | "xl" | "full";
|
|
20
20
|
/** Components whose default appearance can be configured. */
|
|
21
|
-
export type RadiusComponent =
|
|
21
|
+
export type RadiusComponent = "button" | "surface";
|
|
22
22
|
/** Elevation preset — platform-aware shadow + Android elevation. */
|
|
23
23
|
export interface ElevationStyle {
|
|
24
24
|
shadowColor: string;
|
|
@@ -31,12 +31,12 @@ export interface ElevationStyle {
|
|
|
31
31
|
/** Android elevation. */
|
|
32
32
|
elevation: number;
|
|
33
33
|
}
|
|
34
|
-
export type ElevationKey =
|
|
34
|
+
export type ElevationKey = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
35
35
|
export type ElevationScale = Record<ElevationKey, ElevationStyle>;
|
|
36
|
-
export type RoleTextVariant =
|
|
37
|
-
export type HeadingTextVariant =
|
|
36
|
+
export type RoleTextVariant = "display-lg" | "display-md" | "display-sm" | "headline-lg" | "headline-md" | "headline-sm" | "title-lg" | "title-md" | "title-sm" | "body-lg" | "body-md" | "body-sm" | "label-lg" | "label-md" | "label-sm" | "caption";
|
|
37
|
+
export type HeadingTextVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
38
38
|
export type TextVariant = RoleTextVariant | HeadingTextVariant;
|
|
39
|
-
export type FontWeightToken =
|
|
39
|
+
export type FontWeightToken = "regular" | "medium" | "semibold" | "bold";
|
|
40
40
|
export interface TypeStyle {
|
|
41
41
|
fontSize: number;
|
|
42
42
|
lineHeight: number;
|
|
@@ -72,71 +72,71 @@ export interface Typography {
|
|
|
72
72
|
export interface ThemeColor {
|
|
73
73
|
background: string;
|
|
74
74
|
shadow: string;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
75
|
+
"surface.default": string;
|
|
76
|
+
"surface.raised": string;
|
|
77
|
+
"surface.sunken": string;
|
|
78
|
+
"surface.overlay": string;
|
|
79
|
+
"surface.accent": string;
|
|
80
|
+
"surface.accent.subtle": string;
|
|
81
|
+
"text.default": string;
|
|
82
|
+
"text.muted": string;
|
|
83
|
+
"text.subtle": string;
|
|
84
|
+
"text.disabled": string;
|
|
85
|
+
"text.inverse": string;
|
|
86
|
+
"text.link": string;
|
|
87
|
+
"text.accent": string;
|
|
88
|
+
"text.on-accent": string;
|
|
89
|
+
"text.on-accent-subtle": string;
|
|
90
|
+
"border.subtle": string;
|
|
91
|
+
"border.default": string;
|
|
92
|
+
"border.strong": string;
|
|
93
|
+
"border.focus": string;
|
|
94
|
+
"border.accent": string;
|
|
95
|
+
"action.bg.primary": string;
|
|
96
|
+
"action.bg.primary.hover": string;
|
|
97
|
+
"action.bg.primary.active": string;
|
|
98
|
+
"action.bg.primary.disabled": string;
|
|
99
|
+
"action.fg.primary": string;
|
|
100
|
+
"action.bg.primary.subtle": string;
|
|
101
|
+
"action.bg.primary.subtle.hover": string;
|
|
102
|
+
"action.bg.primary.subtle.active": string;
|
|
103
|
+
"action.bg.primary.subtle.disabled": string;
|
|
104
|
+
"action.fg.primary.subtle": string;
|
|
105
|
+
"action.bg.secondary": string;
|
|
106
|
+
"action.fg.secondary": string;
|
|
107
|
+
"action.bg.secondary.subtle": string;
|
|
108
|
+
"action.bg.secondary.subtle.hover": string;
|
|
109
|
+
"action.bg.secondary.subtle.active": string;
|
|
110
|
+
"action.bg.secondary.subtle.disabled": string;
|
|
111
|
+
"action.fg.secondary.subtle": string;
|
|
112
|
+
"status.success": string;
|
|
113
|
+
"status.success.bg": string;
|
|
114
|
+
"status.success.bg.subtle": string;
|
|
115
|
+
"status.success.border": string;
|
|
116
|
+
"status.success.border.subtle": string;
|
|
117
|
+
"status.success.fg": string;
|
|
118
|
+
"status.success.fg.subtle": string;
|
|
119
|
+
"status.warning": string;
|
|
120
|
+
"status.warning.bg": string;
|
|
121
|
+
"status.warning.bg.subtle": string;
|
|
122
|
+
"status.warning.border": string;
|
|
123
|
+
"status.warning.border.subtle": string;
|
|
124
|
+
"status.warning.fg": string;
|
|
125
|
+
"status.warning.fg.subtle": string;
|
|
126
|
+
"status.danger": string;
|
|
127
|
+
"status.danger.bg": string;
|
|
128
|
+
"status.danger.bg.subtle": string;
|
|
129
|
+
"status.danger.border": string;
|
|
130
|
+
"status.danger.border.subtle": string;
|
|
131
|
+
"status.danger.fg": string;
|
|
132
|
+
"status.danger.fg.subtle": string;
|
|
133
|
+
"status.info": string;
|
|
134
|
+
"status.info.bg": string;
|
|
135
|
+
"status.info.bg.subtle": string;
|
|
136
|
+
"status.info.border": string;
|
|
137
|
+
"status.info.border.subtle": string;
|
|
138
|
+
"status.info.fg": string;
|
|
139
|
+
"status.info.fg.subtle": string;
|
|
140
140
|
}
|
|
141
141
|
/** State-layer opacities for disabled / pressed feedback. */
|
|
142
142
|
export interface OpacityTokens {
|
|
@@ -172,7 +172,7 @@ export interface TerraTheme {
|
|
|
172
172
|
opacity: OpacityTokens;
|
|
173
173
|
layout: LayoutTokens;
|
|
174
174
|
}
|
|
175
|
-
export type BackgroundColorToken =
|
|
175
|
+
export type BackgroundColorToken = "background";
|
|
176
176
|
export type SurfaceColorToken = Extract<keyof ThemeColor, `surface.${string}`>;
|
|
177
177
|
export type TextColorToken = Extract<keyof ThemeColor, `text.${string}`>;
|
|
178
178
|
export type BorderColorToken = Extract<keyof ThemeColor, `border.${string}`>;
|
|
@@ -186,7 +186,7 @@ export type ContentColorToken = TextColorToken;
|
|
|
186
186
|
* or a raw CSS color literal (`#fff`, `rgb(...)`, `transparent`).
|
|
187
187
|
*/
|
|
188
188
|
export type ColorToken = BackgroundColorToken | SurfaceColorToken | TextColorToken | BorderColorToken | ActionColorToken | StatusColorToken | (string & {});
|
|
189
|
-
export type Scheme =
|
|
189
|
+
export type Scheme = "light" | "dark";
|
|
190
190
|
/** A hue shorthand per scheme — expands to primary + accent token patches. */
|
|
191
191
|
export interface AccentShorthand {
|
|
192
192
|
light: string;
|
|
@@ -210,7 +210,7 @@ export interface TerraIconProps {
|
|
|
210
210
|
strokeWidth?: number;
|
|
211
211
|
}
|
|
212
212
|
export type TerraIconComponent = ComponentType<TerraIconProps>;
|
|
213
|
-
export type TerraImageContentFit =
|
|
213
|
+
export type TerraImageContentFit = "cover" | "contain" | "fill";
|
|
214
214
|
export interface TerraImageProps {
|
|
215
215
|
source: {
|
|
216
216
|
uri: string;
|
|
@@ -222,6 +222,21 @@ export interface TerraImageProps {
|
|
|
222
222
|
placeholder?: {
|
|
223
223
|
uri: string;
|
|
224
224
|
} | number;
|
|
225
|
+
/**
|
|
226
|
+
* How `placeholder` fits its container. Defaults to matching `contentFit`
|
|
227
|
+
* — the expo-image backend otherwise defaults placeholders to
|
|
228
|
+
* `'scale-down'` regardless of `contentFit`, which renders a
|
|
229
|
+
* same-resolution placeholder visibly smaller than the loaded image.
|
|
230
|
+
* No-op on the default React Native `Image` backend.
|
|
231
|
+
*/
|
|
232
|
+
placeholderContentFit?: TerraImageContentFit;
|
|
233
|
+
/**
|
|
234
|
+
* Identifies this image across recycled views (e.g. FlashList cells).
|
|
235
|
+
* Changing it resets the view to blank/placeholder before the new source
|
|
236
|
+
* loads, instead of holding the previous cell's bitmap during recycling.
|
|
237
|
+
* No-op on the default React Native `Image` backend.
|
|
238
|
+
*/
|
|
239
|
+
recyclingKey?: string | null;
|
|
225
240
|
onError?: () => void;
|
|
226
241
|
}
|
|
227
242
|
export type TerraImageComponent = ComponentType<TerraImageProps>;
|
|
@@ -233,10 +248,10 @@ declare global {
|
|
|
233
248
|
}
|
|
234
249
|
export interface TerraIconRegistry extends TerraUI.IconRegistry {
|
|
235
250
|
}
|
|
236
|
-
export type TerraSemanticIconName =
|
|
251
|
+
export type TerraSemanticIconName = "navigation.back" | "navigation.forward" | "navigation.close" | "status.info" | "status.success" | "status.warning" | "status.danger" | "person";
|
|
237
252
|
export type TerraConfiguredIconName = keyof TerraIconRegistry & string;
|
|
238
253
|
export type TerraIconName = TerraSemanticIconName | TerraConfiguredIconName;
|
|
239
|
-
export type ThemeRadiusOverride = DeepPartial<TerraTheme[
|
|
254
|
+
export type ThemeRadiusOverride = DeepPartial<TerraTheme["radius"]> & {
|
|
240
255
|
/**
|
|
241
256
|
* Base corner radius in dp — the `lg` (×1) step. The rest of the scale is
|
|
242
257
|
* derived by fixed multipliers (`xs` ×0.25, `sm` ×0.5, `md` ×0.75,
|
|
@@ -245,7 +260,7 @@ export type ThemeRadiusOverride = DeepPartial<TerraTheme['radius']> & {
|
|
|
245
260
|
*/
|
|
246
261
|
base?: number;
|
|
247
262
|
};
|
|
248
|
-
export type ThemeSpacingOverride = DeepPartial<TerraTheme[
|
|
263
|
+
export type ThemeSpacingOverride = DeepPartial<TerraTheme["spacing"]> & {
|
|
249
264
|
/**
|
|
250
265
|
* Base spacing unit in dp. Every step's value is its key multiplied by this
|
|
251
266
|
* base (e.g. `'5'` → `5 × base`). Per-step spacing overrides still win over
|
|
@@ -254,7 +269,7 @@ export type ThemeSpacingOverride = DeepPartial<TerraTheme['spacing']> & {
|
|
|
254
269
|
base?: number;
|
|
255
270
|
};
|
|
256
271
|
/** Theme override accepted at configure time. */
|
|
257
|
-
export type TerraThemeOverride = DeepPartial<Omit<TerraTheme,
|
|
272
|
+
export type TerraThemeOverride = DeepPartial<Omit<TerraTheme, "radius" | "spacing">> & {
|
|
258
273
|
radius?: ThemeRadiusOverride;
|
|
259
274
|
spacing?: ThemeSpacingOverride;
|
|
260
275
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAe,CAAC;AAIpD,8EAA8E;AAC9E,MAAM,MAAM,UAAU,GAClB,GAAG,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;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Accent, NormalizedAccent } from
|
|
1
|
+
import type { Accent, NormalizedAccent } from "../theme/types";
|
|
2
2
|
/** Normalizes any accent input into per-scheme partial-theme overrides. */
|
|
3
3
|
export declare function normalizeAccent(accent: Accent): NormalizedAccent;
|
|
4
4
|
//# sourceMappingURL=accent-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accent-utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/accent-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"accent-utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/accent-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAmB,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAuC1F,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAQhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-theme-color.d.ts","sourceRoot":"","sources":["../../../../src/utils/resolve-theme-color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS3D;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"resolve-theme-color.d.ts","sourceRoot":"","sources":["../../../../src/utils/resolve-theme-color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS3D;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAKtG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { FontWeightToken } from
|
|
1
|
+
import type { FontWeightToken } from "../theme/types";
|
|
2
2
|
/** RN's sentinel for the platform default font (SF on iOS, Roboto on Android). */
|
|
3
3
|
export declare const SYSTEM_FONT = "System";
|
|
4
4
|
/** Numeric fontWeight applied when a weight token maps to the system font. */
|
|
5
|
-
export declare const FONT_WEIGHT_VALUE: Record<FontWeightToken,
|
|
5
|
+
export declare const FONT_WEIGHT_VALUE: Record<FontWeightToken, "400" | "500" | "600" | "700">;
|
|
6
6
|
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../../src/utils/typography.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,kFAAkF;AAClF,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../../src/utils/typography.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,kFAAkF;AAClF,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAKpF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { useState } from
|
|
2
|
-
import { Text, View } from
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { StyleSheet, useUnistyles } from
|
|
4
|
+
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
5
5
|
|
|
6
|
-
import type { RadiusKey } from
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import type { AvatarProps, AvatarShape, AvatarSize } from './types';
|
|
6
|
+
import type { RadiusKey } from "#theme/types";
|
|
7
|
+
import { Icon } from "../icon";
|
|
8
|
+
import { Image } from "../image";
|
|
9
|
+
import type { AvatarProps, AvatarShape, AvatarSize } from "./types";
|
|
11
10
|
|
|
12
11
|
const SIZE_PX: Record<AvatarSize, number> = {
|
|
13
12
|
xs: 24,
|
|
@@ -27,18 +26,14 @@ const INITIALS_FONT_SIZE: Record<AvatarSize, number> = {
|
|
|
27
26
|
|
|
28
27
|
function getInitials(name: string): string {
|
|
29
28
|
const parts = name.trim().split(/\s+/);
|
|
30
|
-
const first = parts[0]?.[0] ??
|
|
31
|
-
const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ??
|
|
29
|
+
const first = parts[0]?.[0] ?? "";
|
|
30
|
+
const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ?? "") : "";
|
|
32
31
|
return (first + last).toUpperCase();
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
function getBorderRadius(
|
|
36
|
-
shape
|
|
37
|
-
|
|
38
|
-
radiusMd: number
|
|
39
|
-
): number {
|
|
40
|
-
if (shape === 'circle') return sizePx / 2;
|
|
41
|
-
if (shape === 'rounded') return radiusMd;
|
|
34
|
+
function getBorderRadius(shape: AvatarShape, sizePx: number, radiusMd: number): number {
|
|
35
|
+
if (shape === "circle") return sizePx / 2;
|
|
36
|
+
if (shape === "rounded") return radiusMd;
|
|
42
37
|
return 0;
|
|
43
38
|
}
|
|
44
39
|
|
|
@@ -47,20 +42,20 @@ function getBorderRadius(
|
|
|
47
42
|
// `'full'` (theme.radius.full) clamps to a circle at any size, same as the
|
|
48
43
|
// container's computed `sizePx / 2`.
|
|
49
44
|
function getImageRadius(shape: AvatarShape): RadiusKey {
|
|
50
|
-
if (shape ===
|
|
51
|
-
if (shape ===
|
|
52
|
-
return
|
|
45
|
+
if (shape === "circle") return "full";
|
|
46
|
+
if (shape === "rounded") return "md";
|
|
47
|
+
return "none";
|
|
53
48
|
}
|
|
54
49
|
|
|
55
50
|
export function Avatar({
|
|
56
|
-
size =
|
|
57
|
-
shape =
|
|
51
|
+
size = "md",
|
|
52
|
+
shape = "circle",
|
|
58
53
|
source,
|
|
59
54
|
name,
|
|
60
55
|
fallback,
|
|
61
|
-
contentFit =
|
|
62
|
-
color =
|
|
63
|
-
variant =
|
|
56
|
+
contentFit = "cover",
|
|
57
|
+
color = "secondary",
|
|
58
|
+
variant = "solid",
|
|
64
59
|
style,
|
|
65
60
|
...rest
|
|
66
61
|
}: AvatarProps) {
|
|
@@ -72,8 +67,8 @@ export function Avatar({
|
|
|
72
67
|
const borderRadius = getBorderRadius(shape, sizePx, theme.radius.md);
|
|
73
68
|
const showFallback = !source || hasError;
|
|
74
69
|
|
|
75
|
-
const bg = styles.base.backgroundColor ??
|
|
76
|
-
const fg = styles.base.color ??
|
|
70
|
+
const bg = styles.base.backgroundColor ?? "";
|
|
71
|
+
const fg = styles.base.color ?? "";
|
|
77
72
|
|
|
78
73
|
const fallbackContent =
|
|
79
74
|
fallback !== undefined ? (
|
|
@@ -82,7 +77,7 @@ export function Avatar({
|
|
|
82
77
|
<Text
|
|
83
78
|
style={{
|
|
84
79
|
fontSize: INITIALS_FONT_SIZE[size],
|
|
85
|
-
fontWeight:
|
|
80
|
+
fontWeight: "600",
|
|
86
81
|
color: fg,
|
|
87
82
|
includeFontPadding: false,
|
|
88
83
|
}}
|
|
@@ -103,9 +98,9 @@ export function Avatar({
|
|
|
103
98
|
height: sizePx,
|
|
104
99
|
borderRadius,
|
|
105
100
|
backgroundColor: bg,
|
|
106
|
-
alignItems:
|
|
107
|
-
justifyContent:
|
|
108
|
-
overflow:
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
justifyContent: "center",
|
|
103
|
+
overflow: "hidden",
|
|
109
104
|
},
|
|
110
105
|
style,
|
|
111
106
|
]}
|
|
@@ -151,83 +146,83 @@ const styles = StyleSheet.create((theme) => {
|
|
|
151
146
|
},
|
|
152
147
|
compoundVariants: [
|
|
153
148
|
{
|
|
154
|
-
color:
|
|
155
|
-
variant:
|
|
149
|
+
color: "secondary",
|
|
150
|
+
variant: "solid",
|
|
156
151
|
styles: {
|
|
157
|
-
backgroundColor: c[
|
|
158
|
-
color: c[
|
|
152
|
+
backgroundColor: c["action.bg.secondary"],
|
|
153
|
+
color: c["action.fg.secondary"],
|
|
159
154
|
},
|
|
160
155
|
},
|
|
161
156
|
{
|
|
162
|
-
color:
|
|
163
|
-
variant:
|
|
157
|
+
color: "secondary",
|
|
158
|
+
variant: "soft",
|
|
164
159
|
styles: {
|
|
165
|
-
backgroundColor: c[
|
|
166
|
-
color: c[
|
|
160
|
+
backgroundColor: c["action.bg.secondary.subtle"],
|
|
161
|
+
color: c["action.fg.secondary.subtle"],
|
|
167
162
|
},
|
|
168
163
|
},
|
|
169
164
|
{
|
|
170
|
-
color:
|
|
171
|
-
variant:
|
|
165
|
+
color: "primary",
|
|
166
|
+
variant: "solid",
|
|
172
167
|
styles: {
|
|
173
|
-
backgroundColor: c[
|
|
174
|
-
color: c[
|
|
168
|
+
backgroundColor: c["action.bg.primary"],
|
|
169
|
+
color: c["action.fg.primary"],
|
|
175
170
|
},
|
|
176
171
|
},
|
|
177
172
|
{
|
|
178
|
-
color:
|
|
179
|
-
variant:
|
|
173
|
+
color: "primary",
|
|
174
|
+
variant: "soft",
|
|
180
175
|
styles: {
|
|
181
|
-
backgroundColor: c[
|
|
182
|
-
color: c[
|
|
176
|
+
backgroundColor: c["action.bg.primary.subtle"],
|
|
177
|
+
color: c["action.fg.primary.subtle"],
|
|
183
178
|
},
|
|
184
179
|
},
|
|
185
180
|
{
|
|
186
|
-
color:
|
|
187
|
-
variant:
|
|
181
|
+
color: "success",
|
|
182
|
+
variant: "solid",
|
|
188
183
|
styles: {
|
|
189
|
-
backgroundColor: c[
|
|
190
|
-
color: c[
|
|
184
|
+
backgroundColor: c["status.success.bg"],
|
|
185
|
+
color: c["status.success.fg"],
|
|
191
186
|
},
|
|
192
187
|
},
|
|
193
188
|
{
|
|
194
|
-
color:
|
|
195
|
-
variant:
|
|
189
|
+
color: "success",
|
|
190
|
+
variant: "soft",
|
|
196
191
|
styles: {
|
|
197
|
-
backgroundColor: c[
|
|
198
|
-
color: c[
|
|
192
|
+
backgroundColor: c["status.success.bg.subtle"],
|
|
193
|
+
color: c["status.success.fg.subtle"],
|
|
199
194
|
},
|
|
200
195
|
},
|
|
201
196
|
{
|
|
202
|
-
color:
|
|
203
|
-
variant:
|
|
197
|
+
color: "warning",
|
|
198
|
+
variant: "solid",
|
|
204
199
|
styles: {
|
|
205
|
-
backgroundColor: c[
|
|
206
|
-
color: c[
|
|
200
|
+
backgroundColor: c["status.warning.bg"],
|
|
201
|
+
color: c["status.warning.fg"],
|
|
207
202
|
},
|
|
208
203
|
},
|
|
209
204
|
{
|
|
210
|
-
color:
|
|
211
|
-
variant:
|
|
205
|
+
color: "warning",
|
|
206
|
+
variant: "soft",
|
|
212
207
|
styles: {
|
|
213
|
-
backgroundColor: c[
|
|
214
|
-
color: c[
|
|
208
|
+
backgroundColor: c["status.warning.bg.subtle"],
|
|
209
|
+
color: c["status.warning.fg.subtle"],
|
|
215
210
|
},
|
|
216
211
|
},
|
|
217
212
|
{
|
|
218
|
-
color:
|
|
219
|
-
variant:
|
|
213
|
+
color: "danger",
|
|
214
|
+
variant: "solid",
|
|
220
215
|
styles: {
|
|
221
|
-
backgroundColor: c[
|
|
222
|
-
color: c[
|
|
216
|
+
backgroundColor: c["status.danger.bg"],
|
|
217
|
+
color: c["status.danger.fg"],
|
|
223
218
|
},
|
|
224
219
|
},
|
|
225
220
|
{
|
|
226
|
-
color:
|
|
227
|
-
variant:
|
|
221
|
+
color: "danger",
|
|
222
|
+
variant: "soft",
|
|
228
223
|
styles: {
|
|
229
|
-
backgroundColor: c[
|
|
230
|
-
color: c[
|
|
224
|
+
backgroundColor: c["status.danger.bg.subtle"],
|
|
225
|
+
color: c["status.danger.fg.subtle"],
|
|
231
226
|
},
|
|
232
227
|
},
|
|
233
228
|
],
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import type { ReactNode } from
|
|
2
|
-
import type { ViewProps } from
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ViewProps } from "react-native";
|
|
3
3
|
|
|
4
|
-
import type { TerraImageContentFit } from
|
|
4
|
+
import type { TerraImageContentFit } from "#theme/types";
|
|
5
5
|
|
|
6
|
-
export type AvatarSize =
|
|
7
|
-
export type AvatarShape =
|
|
6
|
+
export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
7
|
+
export type AvatarShape = "circle" | "rounded" | "square";
|
|
8
8
|
/** Semantic color scheme for the fallback state (initials / placeholder icon). */
|
|
9
|
-
export type AvatarColor =
|
|
10
|
-
| 'secondary'
|
|
11
|
-
| 'primary'
|
|
12
|
-
| 'success'
|
|
13
|
-
| 'warning'
|
|
14
|
-
| 'danger';
|
|
9
|
+
export type AvatarColor = "secondary" | "primary" | "success" | "warning" | "danger";
|
|
15
10
|
/** Visual weight of the fallback background. */
|
|
16
|
-
export type AvatarVariant =
|
|
11
|
+
export type AvatarVariant = "solid" | "soft";
|
|
17
12
|
|
|
18
13
|
export interface AvatarProps extends ViewProps {
|
|
19
14
|
/** Predefined size token. Defaults to `'md'`. */
|