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,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
|
-
import { StyleSheet } from
|
|
5
|
-
import Animated, { Easing, Extrapolation, interpolate, Keyframe, useAnimatedStyle, withSpring, withTiming } from
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
import Animated, { Easing, Extrapolation, interpolate, Keyframe, useAnimatedStyle, withSpring, withTiming } from "react-native-reanimated";
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
export const enteringTop = new Keyframe({
|
|
8
8
|
0: {
|
|
@@ -98,7 +98,7 @@ export function ToastAnimatedItem({
|
|
|
98
98
|
const lastToastId = heightEntries[heightEntries.length - 1]?.[0];
|
|
99
99
|
const lastToastHeight = lastToastId ? heights.value[lastToastId] : undefined;
|
|
100
100
|
const totalValue = total.value;
|
|
101
|
-
const sign = placement ===
|
|
101
|
+
const sign = placement === "top" ? 1 : -1;
|
|
102
102
|
const inputRange = [totalValue - 1, totalValue - 2];
|
|
103
103
|
const opacityInputRange = [totalValue - maxVisibleToasts, totalValue - maxVisibleToasts - 1];
|
|
104
104
|
const opacity = interpolate(index, opacityInputRange, opacityValue);
|
|
@@ -112,7 +112,7 @@ export function ToastAnimatedItem({
|
|
|
112
112
|
stiffness: 1200,
|
|
113
113
|
mass: 3
|
|
114
114
|
}) : undefined,
|
|
115
|
-
pointerEvents: opacity === 0 ?
|
|
115
|
+
pointerEvents: opacity === 0 ? "none" : "auto",
|
|
116
116
|
opacity: withTiming(opacity, opacityTimingConfig),
|
|
117
117
|
transform: [{
|
|
118
118
|
translateY: withTiming(translateY, translateYTimingConfig)
|
|
@@ -123,10 +123,10 @@ export function ToastAnimatedItem({
|
|
|
123
123
|
};
|
|
124
124
|
});
|
|
125
125
|
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
126
|
-
entering: placement ===
|
|
127
|
-
exiting: placement ===
|
|
126
|
+
entering: placement === "top" ? enteringTop : enteringBottom,
|
|
127
|
+
exiting: placement === "top" ? exitingTop : exitingBottom,
|
|
128
128
|
pointerEvents: "box-none",
|
|
129
|
-
style: [styles.position, placement ===
|
|
129
|
+
style: [styles.position, placement === "top" ? styles.top : styles.bottom],
|
|
130
130
|
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
131
131
|
style: containerStyle,
|
|
132
132
|
children: children
|
|
@@ -143,13 +143,13 @@ export function ToastAnimatedItem({
|
|
|
143
143
|
[id]: measuredHeight
|
|
144
144
|
};
|
|
145
145
|
},
|
|
146
|
-
children: process.env.NODE_ENV ===
|
|
146
|
+
children: process.env.NODE_ENV === "test" ? null : children
|
|
147
147
|
})]
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
const styles = StyleSheet.create({
|
|
151
151
|
position: {
|
|
152
|
-
position:
|
|
152
|
+
position: "absolute",
|
|
153
153
|
left: 0,
|
|
154
154
|
right: 0
|
|
155
155
|
},
|
|
@@ -160,7 +160,7 @@ const styles = StyleSheet.create({
|
|
|
160
160
|
bottom: 0
|
|
161
161
|
},
|
|
162
162
|
measurement: {
|
|
163
|
-
position:
|
|
163
|
+
position: "absolute",
|
|
164
164
|
left: 0,
|
|
165
165
|
right: 0,
|
|
166
166
|
opacity: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","Animated","Easing","Extrapolation","interpolate","Keyframe","useAnimatedStyle","withSpring","withTiming","jsx","_jsx","jsxs","_jsxs","enteringTop","opacity","transform","translateY","easing","out","cubic","duration","exitingTop","scale","bezier","enteringBottom","exitingBottom","opacityValue","opacityTimingConfig","translateYValue","translateYTimingConfig","scaleValue","scaleTimingConfig","ToastAnimatedItem","children","heights","id","index","maxVisibleToasts","placement","total","containerStyle","heightEntries","Object","entries","value","lastToastId","length","lastToastHeight","undefined","totalValue","sign","inputRange","opacityInputRange","CLAMP","extrapolateLeft","height","damping","stiffness","mass","pointerEvents","zIndex","View","entering","exiting","style","styles","position","top","bottom","importantForAccessibility","accessibilityElementsHidden","measurement","onLayout","event","measuredHeight","nativeEvent","layout","process","env","NODE_ENV","create","left","right"],"sourceRoot":"../../../../../src","sources":["components/toast/parts/ToastAnimatedItem.tsx"],"mappings":";;;AACA,SAASA,UAAU,QAAc,cAAc;AAE/C,OAAOC,QAAQ,IACbC,MAAM,EACNC,aAAa,EACbC,WAAW,EACXC,QAAQ,EAERC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAcjC,OAAO,MAAMC,WAAW,GAAG,IAAIR,QAAQ,CAAC;EACtC,CAAC,EAAE;IACDS,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE,CAAC;MAAEC,UAAU,EAAE,CAAC;IAAI,CAAC;E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AAEC,UAAU,EAAE;IAAE,CAAC,EAAE;MAAEM,KAAK,EAAE;IAAE,CAAC;EAC7C,CAAC;EACD,GAAG,EAAE;IACHR,OAAO,EAAE,GAAG;IACZC,SAAS,EAAE,CAAC;MAAEC,UAAU,EAAE;IAAI,CAAC,EAAE;MAAEM,KAAK,EAAE;IAAK,CAAC,CAAC;IACjDL,MAAM,EAAEf,MAAM,CAACqB,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;EACpC;AACF,CAAC,CAAC,CAACH,QAAQ,CAAC,GAAG,CAAC;AAEhB,MAAMM,YAAY,GAAG,CAAC,CAAC,EAAE,CAAC,CAAqB;AAC/C,MAAMC,mBAAmB,GAAG;EAAEP,QAAQ,EAAE;AAAI,CAAC;AAC7C,MAAMQ,eAAe,GAAG,CAAC,CAAC,EAAE,EAAE,CAAqB;AACnD,MAAMC,sBAAsB,GAAG;EAAET,QAAQ,EAAE;AAAI,CAAC;AAChD,MAAMU,UAAU,GAAG,CAAC,CAAC,EAAE,IAAI,CAAqB;AAChD,MAAMC,iBAAiB,GAAG;EAAEX,QAAQ,EAAE;AAAI,CAAC;AAE3C,OAAO,SAASY,iBAAiBA,CAAC;EAChCC,QAAQ;EACRC,OAAO;EACPC,EAAE;EACFC,KAAK;EACLC,gBAAgB;EAChBC,SAAS;EACTC;AACsB,CAAC,EAAE;EACzB,MAAMC,cAAc,GAAGlC,gBAAgB,CAAC,MAAM;IAC5C,MAAMmC,aAAa,GAAGC,MAAM,CAACC,OAAO,CAACT,OAAO,CAACU,KAAK,CAAC;IACnD,MAAMC,WAAW,GAAGJ,aAAa,CAACA,aAAa,CAACK,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAChE,MAAMC,eAAe,GAAGF,WAAW,
|
|
1
|
+
{"version":3,"names":["StyleSheet","Animated","Easing","Extrapolation","interpolate","Keyframe","useAnimatedStyle","withSpring","withTiming","jsx","_jsx","jsxs","_jsxs","enteringTop","opacity","transform","translateY","easing","out","cubic","duration","exitingTop","scale","bezier","enteringBottom","exitingBottom","opacityValue","opacityTimingConfig","translateYValue","translateYTimingConfig","scaleValue","scaleTimingConfig","ToastAnimatedItem","children","heights","id","index","maxVisibleToasts","placement","total","containerStyle","heightEntries","Object","entries","value","lastToastId","length","lastToastHeight","undefined","totalValue","sign","inputRange","opacityInputRange","CLAMP","extrapolateLeft","height","damping","stiffness","mass","pointerEvents","zIndex","View","entering","exiting","style","styles","position","top","bottom","importantForAccessibility","accessibilityElementsHidden","measurement","onLayout","event","measuredHeight","nativeEvent","layout","process","env","NODE_ENV","create","left","right"],"sourceRoot":"../../../../../src","sources":["components/toast/parts/ToastAnimatedItem.tsx"],"mappings":";;;AACA,SAASA,UAAU,QAAc,cAAc;AAE/C,OAAOC,QAAQ,IACbC,MAAM,EACNC,aAAa,EACbC,WAAW,EACXC,QAAQ,EAERC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAcjC,OAAO,MAAMC,WAAW,GAAG,IAAIR,QAAQ,CAAC;EACtC,CAAC,EAAE;IACDS,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE,CAAC;MAAEC,UAAU,EAAE,CAAC;IAAI,CAAC;EAClC,CAAC;EACD,GAAG,EAAE;IACHF,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE,CAAC;MAAEC,UAAU,EAAE;IAAE,CAAC,CAAC;IAC9BC,MAAM,EAAEf,MAAM,CAACgB,GAAG,CAAChB,MAAM,CAACiB,KAAK;EACjC;AACF,CAAC,CAAC,CAACC,QAAQ,CAAC,GAAG,CAAC;AAEhB,OAAO,MAAMC,UAAU,GAAG,IAAIhB,QAAQ,CAAC;EACrC,CAAC,EAAE;IACDS,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE,CAAC;MAAEC,UAAU,EAAE;IAAE,CAAC,EAAE;MAAEM,KAAK,EAAE;IAAE,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,IAAI;MACHF,aAAa,EAAC,MAAM;MACpB,mBAAW;MACXU,yBAAyB,EAAC,qBAAqB;MAC/CC,2BAA2B;MAC3BN,KAAK,EAAEC,MAAM,CAACM,WAAY;MAC1BC,QAAQ,EAAGC,KAAK,IAAK;QACnB,MAAMC,cAAc,GAAGD,KAAK,CAACE,WAAW,CAACC,MAAM,CAACrB,MAAM;QACtDrB,OAAO,CAACU,KAAK,GAAG;UACd,GAAGV,OAAO,CAACU,KAAK;UAChB,CAACT,EAAE,GAAGuC;QACR,CAAC;MACH,CAAE;MAAAzC,QAAA,EAED4C,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,GAAG,IAAI,GAAG9C;IAAQ,CAC9C,CAAC;EAAA,CACM,CAAC;AAEpB;AAEA,MAAMgC,MAAM,GAAGjE,UAAU,CAACgF,MAAM,CAAC;EAC/Bd,QAAQ,EAAE;IACRA,QAAQ,EAAE,UAAU;IACpBe,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT,CAAC;EACDf,GAAG,EAAE;IACHA,GAAG,EAAE;EACP,CAAC;EACDC,MAAM,EAAE;IACNA,MAAM,EAAE;EACV,CAAC;EACDG,WAAW,EAAE;IACXL,QAAQ,EAAE,UAAU;IACpBe,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRpE,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -7,9 +7,9 @@ export function setToastManager(manager) {
|
|
|
7
7
|
export function showToast(options) {
|
|
8
8
|
if (!activeManager) {
|
|
9
9
|
if (__DEV__) {
|
|
10
|
-
console.warn(
|
|
10
|
+
console.warn("[react-native-terra-ui] Toast.show() called before <TerraUIProvider> mounted.");
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return "";
|
|
13
13
|
}
|
|
14
14
|
return activeManager.show(options);
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["activeManager","setToastManager","manager","showToast","options","__DEV__","console","warn","show","hideToast","id","hide"],"sourceRoot":"../../../../../src","sources":["components/toast/utils/controller.ts"],"mappings":";;AAEA,IAAIA,aAAkC,GAAG,IAAI;AAE7C,OAAO,SAASC,eAAeA,CAACC,OAA4B,EAAQ;EAClEF,aAAa,GAAGE,OAAO;AACzB;AAEA,OAAO,SAASC,SAASA,CAACC,OAAyB,EAAW;EAC5D,IAAI,CAACJ,aAAa,EAAE;IAClB,IAAIK,OAAO,EAAE;MACXC,OAAO,CAACC,IAAI,
|
|
1
|
+
{"version":3,"names":["activeManager","setToastManager","manager","showToast","options","__DEV__","console","warn","show","hideToast","id","hide"],"sourceRoot":"../../../../../src","sources":["components/toast/utils/controller.ts"],"mappings":";;AAEA,IAAIA,aAAkC,GAAG,IAAI;AAE7C,OAAO,SAASC,eAAeA,CAACC,OAA4B,EAAQ;EAClEF,aAAa,GAAGE,OAAO;AACzB;AAEA,OAAO,SAASC,SAASA,CAACC,OAAyB,EAAW;EAC5D,IAAI,CAACJ,aAAa,EAAE;IAClB,IAAIK,OAAO,EAAE;MACXC,OAAO,CAACC,IAAI,CAAC,+EAA+E,CAAC;IAC/F;IACA,OAAO,EAAE;EACX;EACA,OAAOP,aAAa,CAACQ,IAAI,CAACJ,OAAO,CAAC;AACpC;AAEA,OAAO,SAASK,SAASA,CAACC,EAAgC,EAAQ;EAChEV,aAAa,EAAEW,IAAI,CAACD,EAAE,CAAC;AACzB","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
4
|
import { Pressable } from "react-native-unistyles/components/native/Pressable";
|
|
5
|
-
import { Children, createContext, forwardRef, useContext, useMemo } from
|
|
6
|
-
import { StyleSheet } from
|
|
5
|
+
import { Children, createContext, forwardRef, useContext, useMemo } from "react";
|
|
6
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
7
7
|
import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
|
|
8
8
|
import { Icon } from "../icon/index.js";
|
|
9
9
|
import { Text } from "../text/index.js";
|
|
@@ -17,19 +17,52 @@ import { Text } from "../text/index.js";
|
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
/** Non-null default, so a bare `Toolbar.Button` still paints its own circle. */
|
|
19
19
|
const ToolbarGroupContext = /*#__PURE__*/createContext({
|
|
20
|
-
background:
|
|
21
|
-
tint:
|
|
20
|
+
background: "surface.default",
|
|
21
|
+
tint: "text.default",
|
|
22
22
|
isGrouped: false
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Square cell of an icon-only item, in dp. Just under Apple's 44pt minimum
|
|
27
|
+
* touch target; `HIT_SLOP` carries the cell past it.
|
|
28
|
+
*/
|
|
29
|
+
const ITEM_SIZE = 42;
|
|
30
|
+
|
|
31
|
+
/** Horizontal padding of an item that owns its footprint, in dp. */
|
|
32
|
+
const ITEM_PADDING = 10;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* How far a filled cell is inset inside the capsule, per edge, in dp. A fill
|
|
36
|
+
* flush with the capsule's own height would collide with its rounded end caps;
|
|
37
|
+
* the inset keeps the two curves clear of one another.
|
|
38
|
+
*/
|
|
39
|
+
const FILLED_INSET = 4;
|
|
40
|
+
|
|
41
|
+
/** Cell of a grouped item that paints its own fill, in dp. */
|
|
42
|
+
const FILLED_ITEM_SIZE = ITEM_SIZE - FILLED_INSET * 2;
|
|
43
|
+
|
|
44
|
+
/** Horizontal padding inside the capsule's end caps, in dp. */
|
|
45
|
+
const CAPSULE_PADDING = 10;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Item count from which a capsule takes {@link CAPSULE_PADDING_EXTRA}. A lone
|
|
49
|
+
* item sits in a capsule barely wider than itself and needs no extra room; from
|
|
50
|
+
* two up the run reads as a bar, and end caps sized for one look pinched.
|
|
51
|
+
*/
|
|
52
|
+
const CAPSULE_WIDE_ITEMS = 2;
|
|
53
|
+
|
|
54
|
+
/** Additional end-cap padding at {@link CAPSULE_WIDE_ITEMS} items or more, in dp. */
|
|
55
|
+
const CAPSULE_PADDING_EXTRA = 4;
|
|
27
56
|
|
|
28
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Touch expansion outside the cell, in dp — uniform on all four sides, grouped
|
|
59
|
+
* or not. Safe inside a capsule because its 20dp item gap exceeds two
|
|
60
|
+
* neighbouring 8dp expansions, so no item can steal a tap aimed at the next.
|
|
61
|
+
*/
|
|
29
62
|
const HIT_SLOP = 8;
|
|
30
63
|
|
|
31
64
|
/** Typographic role of a text item's label. */
|
|
32
|
-
const LABEL_VARIANT =
|
|
65
|
+
const LABEL_VARIANT = "label-md";
|
|
33
66
|
|
|
34
67
|
// ─── Button ───────────────────────────────────────────────────────────────────
|
|
35
68
|
|
|
@@ -71,12 +104,18 @@ export function ToolbarButton({
|
|
|
71
104
|
// live theme, so they keep their own subscriptions.
|
|
72
105
|
const fg = tint ?? groupTint;
|
|
73
106
|
const bg = background ?? groupBackground;
|
|
74
|
-
const shape = Children.count(children) > 0 ?
|
|
107
|
+
const shape = Children.count(children) > 0 ? "label" : "icon";
|
|
108
|
+
// A grouped cell normally shrinks to its glyph, which is invisible while it is
|
|
109
|
+
// transparent but shows as a lozenge the width of that glyph the moment the
|
|
110
|
+
// cell paints. An explicit `background` therefore has to buy the footprint
|
|
111
|
+
// back — see the `filled` variant.
|
|
112
|
+
const isFilled = isGrouped && background !== undefined;
|
|
75
113
|
const _styles = styles;
|
|
76
114
|
{
|
|
77
115
|
const styles = _styles.useVariants({
|
|
78
116
|
shape,
|
|
79
|
-
grouped: isGrouped
|
|
117
|
+
grouped: isGrouped,
|
|
118
|
+
filled: isFilled
|
|
80
119
|
});
|
|
81
120
|
// Read during render rather than inside the `style` callback below. The
|
|
82
121
|
// callback can run after sibling buttons have rendered, and `useVariants` is
|
|
@@ -91,7 +130,7 @@ export function ToolbarButton({
|
|
|
91
130
|
hitSlop: hitSlop,
|
|
92
131
|
onPress: onPress,
|
|
93
132
|
...rest,
|
|
94
|
-
style: state => [cell, styles.fill(bg, state.pressed), typeof style ===
|
|
133
|
+
style: state => [cell, styles.fill(bg, state.pressed), typeof style === "function" ? style(state) : style],
|
|
95
134
|
children: [icon !== undefined && /*#__PURE__*/_jsx(Icon, {
|
|
96
135
|
size: iconSize,
|
|
97
136
|
color: fg,
|
|
@@ -104,7 +143,7 @@ export function ToolbarButton({
|
|
|
104
143
|
/** Auto-wraps text children in the button's tint, as `Chip` does its label. */
|
|
105
144
|
function renderLabel(children, tint) {
|
|
106
145
|
return Children.map(children, child => {
|
|
107
|
-
if (typeof child ===
|
|
146
|
+
if (typeof child === "string") {
|
|
108
147
|
return child.trim().length > 0 ? /*#__PURE__*/_jsx(Text, {
|
|
109
148
|
variant: LABEL_VARIANT,
|
|
110
149
|
color: tint,
|
|
@@ -112,7 +151,7 @@ function renderLabel(children, tint) {
|
|
|
112
151
|
children: child
|
|
113
152
|
}) : null;
|
|
114
153
|
}
|
|
115
|
-
if (typeof child ===
|
|
154
|
+
if (typeof child === "number") {
|
|
116
155
|
return /*#__PURE__*/_jsx(Text, {
|
|
117
156
|
variant: LABEL_VARIANT,
|
|
118
157
|
color: tint,
|
|
@@ -143,22 +182,27 @@ function renderLabel(children, tint) {
|
|
|
143
182
|
* ```
|
|
144
183
|
*/
|
|
145
184
|
export const ToolbarGroup = /*#__PURE__*/forwardRef(function ToolbarGroup({
|
|
146
|
-
background =
|
|
147
|
-
tint =
|
|
185
|
+
background = "surface.default",
|
|
186
|
+
tint = "text.default",
|
|
148
187
|
children,
|
|
149
188
|
style,
|
|
150
189
|
...rest
|
|
151
190
|
}, ref) {
|
|
152
191
|
const context = useMemo(() => ({
|
|
153
|
-
background:
|
|
192
|
+
background: "transparent",
|
|
154
193
|
tint,
|
|
155
194
|
isGrouped: true
|
|
156
195
|
}), [tint]);
|
|
196
|
+
|
|
197
|
+
// `Children.count` treats a fragment as a single child, so items wrapped in
|
|
198
|
+
// one keep the tighter padding. Walking the tree to flatten them would cost a
|
|
199
|
+
// traversal per render to settle 4dp, which is not a trade worth making.
|
|
200
|
+
const isCrowded = Children.count(children) >= CAPSULE_WIDE_ITEMS;
|
|
157
201
|
return /*#__PURE__*/_jsx(ToolbarGroupContext.Provider, {
|
|
158
202
|
value: context,
|
|
159
203
|
children: /*#__PURE__*/_jsx(View, {
|
|
160
204
|
ref: ref,
|
|
161
|
-
style: [styles.capsule(background), style],
|
|
205
|
+
style: [styles.capsule(background, isCrowded), style],
|
|
162
206
|
...rest,
|
|
163
207
|
children: children
|
|
164
208
|
})
|
|
@@ -185,7 +229,7 @@ export const ToolbarGroup = /*#__PURE__*/forwardRef(function ToolbarGroup({
|
|
|
185
229
|
* ```
|
|
186
230
|
*/
|
|
187
231
|
const ToolbarRoot = /*#__PURE__*/forwardRef(function Toolbar({
|
|
188
|
-
gap =
|
|
232
|
+
gap = "2",
|
|
189
233
|
children,
|
|
190
234
|
style,
|
|
191
235
|
...rest
|
|
@@ -205,23 +249,23 @@ Toolbar.Button = ToolbarButton;
|
|
|
205
249
|
|
|
206
250
|
const styles = StyleSheet.create(theme => ({
|
|
207
251
|
row: gap => ({
|
|
208
|
-
flexDirection:
|
|
209
|
-
alignItems:
|
|
252
|
+
flexDirection: "row",
|
|
253
|
+
alignItems: "center",
|
|
210
254
|
gap: theme.spacing[gap],
|
|
211
255
|
uni__dependencies: [0]
|
|
212
256
|
}),
|
|
213
257
|
// `background` is an open `ColorToken` — it accepts raw literals, so it cannot
|
|
214
258
|
// be enumerated as a variant. Resolving inside the factory keeps the fill tied
|
|
215
259
|
// to the live theme.
|
|
216
|
-
capsule: background => ({
|
|
217
|
-
flexDirection:
|
|
218
|
-
alignItems:
|
|
219
|
-
gap: theme.spacing[
|
|
220
|
-
paddingHorizontal:
|
|
260
|
+
capsule: (background, isCrowded) => ({
|
|
261
|
+
flexDirection: "row",
|
|
262
|
+
alignItems: "center",
|
|
263
|
+
gap: theme.spacing["5"],
|
|
264
|
+
paddingHorizontal: CAPSULE_PADDING + (isCrowded ? CAPSULE_PADDING_EXTRA : 0),
|
|
221
265
|
borderRadius: theme.radius.full,
|
|
222
266
|
backgroundColor: resolveThemeColor(background, theme),
|
|
223
267
|
borderWidth: StyleSheet.hairlineWidth,
|
|
224
|
-
borderColor: theme.color[
|
|
268
|
+
borderColor: theme.color["border.subtle"],
|
|
225
269
|
...theme.elevation.xs,
|
|
226
270
|
uni__dependencies: [0]
|
|
227
271
|
}),
|
|
@@ -231,9 +275,9 @@ const styles = StyleSheet.create(theme => ({
|
|
|
231
275
|
// supplies it.
|
|
232
276
|
button: {
|
|
233
277
|
height: ITEM_SIZE,
|
|
234
|
-
flexDirection:
|
|
235
|
-
alignItems:
|
|
236
|
-
justifyContent:
|
|
278
|
+
flexDirection: "row",
|
|
279
|
+
alignItems: "center",
|
|
280
|
+
justifyContent: "center",
|
|
237
281
|
borderRadius: theme.radius.full,
|
|
238
282
|
variants: {
|
|
239
283
|
shape: {
|
|
@@ -241,7 +285,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
241
285
|
width: ITEM_SIZE
|
|
242
286
|
},
|
|
243
287
|
label: {
|
|
244
|
-
gap: theme.spacing[
|
|
288
|
+
gap: theme.spacing["1"]
|
|
245
289
|
}
|
|
246
290
|
},
|
|
247
291
|
grouped: {
|
|
@@ -250,19 +294,45 @@ const styles = StyleSheet.create(theme => ({
|
|
|
250
294
|
},
|
|
251
295
|
false: {
|
|
252
296
|
minWidth: ITEM_SIZE,
|
|
253
|
-
paddingHorizontal:
|
|
297
|
+
paddingHorizontal: ITEM_PADDING,
|
|
254
298
|
borderWidth: StyleSheet.hairlineWidth,
|
|
255
|
-
borderColor: theme.color[
|
|
299
|
+
borderColor: theme.color["border.subtle"],
|
|
256
300
|
...theme.elevation.xs
|
|
257
301
|
}
|
|
302
|
+
},
|
|
303
|
+
// Only meaningful inside a capsule: a standalone cell already owns its
|
|
304
|
+
// footprint, so painting it a different colour changes nothing but paint.
|
|
305
|
+
filled: {
|
|
306
|
+
true: {},
|
|
307
|
+
false: {}
|
|
258
308
|
}
|
|
259
309
|
},
|
|
260
310
|
compoundVariants: [{
|
|
261
|
-
shape:
|
|
311
|
+
shape: "icon",
|
|
262
312
|
grouped: true,
|
|
313
|
+
filled: false,
|
|
263
314
|
styles: {
|
|
264
315
|
width: undefined
|
|
265
316
|
}
|
|
317
|
+
},
|
|
318
|
+
// A filled cell takes its footprint back, inset from the capsule's height
|
|
319
|
+
// so its curve clears the capsule's own.
|
|
320
|
+
{
|
|
321
|
+
shape: "icon",
|
|
322
|
+
grouped: true,
|
|
323
|
+
filled: true,
|
|
324
|
+
styles: {
|
|
325
|
+
width: FILLED_ITEM_SIZE,
|
|
326
|
+
height: FILLED_ITEM_SIZE
|
|
327
|
+
}
|
|
328
|
+
}, {
|
|
329
|
+
shape: "label",
|
|
330
|
+
grouped: true,
|
|
331
|
+
filled: true,
|
|
332
|
+
styles: {
|
|
333
|
+
height: FILLED_ITEM_SIZE,
|
|
334
|
+
paddingHorizontal: ITEM_PADDING
|
|
335
|
+
}
|
|
266
336
|
}],
|
|
267
337
|
uni__dependencies: [0, 4]
|
|
268
338
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","createContext","forwardRef","useContext","useMemo","StyleSheet","resolveThemeColor","Icon","Text","jsx","_jsx","jsxs","_jsxs","ToolbarGroupContext","background","tint","isGrouped","ITEM_SIZE","HIT_SLOP","LABEL_VARIANT","ToolbarButton","icon","iconSize","children","accessibilityLabel","onPress","hitSlop","style","rest","groupBackground","groupTint","fg","bg","shape","count","_styles","styles","useVariants","grouped","cell","button","Pressable","accessibilityRole","state","fill","pressed","
|
|
1
|
+
{"version":3,"names":["Children","createContext","forwardRef","useContext","useMemo","StyleSheet","resolveThemeColor","Icon","Text","jsx","_jsx","jsxs","_jsxs","ToolbarGroupContext","background","tint","isGrouped","ITEM_SIZE","ITEM_PADDING","FILLED_INSET","FILLED_ITEM_SIZE","CAPSULE_PADDING","CAPSULE_WIDE_ITEMS","CAPSULE_PADDING_EXTRA","HIT_SLOP","LABEL_VARIANT","ToolbarButton","icon","iconSize","children","accessibilityLabel","onPress","hitSlop","style","rest","groupBackground","groupTint","fg","bg","shape","count","isFilled","undefined","_styles","styles","useVariants","grouped","filled","cell","button","Pressable","accessibilityRole","state","fill","pressed","size","color","name","renderLabel","map","child","trim","length","variant","weight","ToolbarGroup","ref","context","isCrowded","Provider","value","View","capsule","ToolbarRoot","Toolbar","gap","row","Group","Button","create","theme","flexDirection","alignItems","spacing","uni__dependencies","paddingHorizontal","borderRadius","radius","full","backgroundColor","borderWidth","hairlineWidth","borderColor","elevation","xs","height","justifyContent","variants","width","label","true","false","minWidth","compoundVariants","opacity"],"sourceRoot":"../../../../src","sources":["components/toolbar/Toolbar.tsx"],"mappings":";;;;AAAA,SACEA,QAAQ,EAERC,aAAa,EACbC,UAAU,EAEVC,UAAU,EACVC,OAAO,QACF,OAAO;AAGd,SAASC,UAAU,QAAQ,wBAAwB;AAGnD,SAASC,iBAAiB;AAC1B,SAASC,IAAI;AACb,SAASC,IAAI;;AAEb;AACA;AACA;AACA;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAeA;AACA,MAAMC,mBAAmB,gBAAGZ,aAAa,CAA2B;EAClEa,UAAU,EAAE,iBAAiB;EAC7BC,IAAI,EAAE,cAAc;EACpBC,SAAS,EAAE;AACb,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,MAAMC,SAAS,GAAG,EAAE;;AAEpB;AACA,MAAMC,YAAY,GAAG,EAAE;;AAEvB;AACA;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,gBAAgB,GAAGH,SAAS,GAAGE,YAAY,GAAG,CAAC;;AAErD;AACA,MAAME,eAAe,GAAG,EAAE;;AAE1B;AACA;AACA;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GAAG0B,KAAK,CAACwB,OAAO,CAAClD,OAAO,GAAG,CAAC;IAAA8B,iBAAA;EAC9C,CAAC;AACH,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { createContext, useCallback, useContext, useMemo, useState } from
|
|
4
|
-
import { SafeAreaProvider } from
|
|
5
|
-
import { useUnistyles } from
|
|
3
|
+
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
4
|
+
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
5
|
+
import { useUnistyles } from "react-native-unistyles";
|
|
6
6
|
import { bootstrapTerraUI } from "../theme/registry.js";
|
|
7
7
|
import { applyAccent, applyScheme, getCurrentAccent } from "../theme/runtime.js";
|
|
8
8
|
import { resolveScreenMargin } from "../theme/screen-margin.js";
|
|
@@ -55,7 +55,7 @@ export function useTheme() {
|
|
|
55
55
|
}, []);
|
|
56
56
|
return {
|
|
57
57
|
theme,
|
|
58
|
-
scheme: rt.themeName ??
|
|
58
|
+
scheme: rt.themeName ?? "light",
|
|
59
59
|
setScheme,
|
|
60
60
|
accent: ctx?.accent,
|
|
61
61
|
setAccent: ctx?.setAccent ?? noopSetAccent
|
|
@@ -77,7 +77,7 @@ export function useScreenMargin() {
|
|
|
77
77
|
}
|
|
78
78
|
const noopSetAccent = _name => {
|
|
79
79
|
if (__DEV__) {
|
|
80
|
-
console.warn(
|
|
80
|
+
console.warn("[react-native-terra-ui] setAccent called outside <TerraUIProvider>.");
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
//# sourceMappingURL=ThemeProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useCallback","useContext","useMemo","useState","SafeAreaProvider","useUnistyles","bootstrapTerraUI","applyAccent","applyScheme","getCurrentAccent","resolveScreenMargin","jsx","_jsx","ThemeContext","TerraUIProvider","children","accent","setAccentState","setAccent","name","value","Provider","useTheme","theme","rt","ctx","setScheme","scheme","themeName","noopSetAccent","useScreenMargin","breakpoint","_name","__DEV__","console","warn"],"sourceRoot":"../../../src","sources":["context/ThemeProvider.tsx"],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"names":["createContext","useCallback","useContext","useMemo","useState","SafeAreaProvider","useUnistyles","bootstrapTerraUI","applyAccent","applyScheme","getCurrentAccent","resolveScreenMargin","jsx","_jsx","ThemeContext","TerraUIProvider","children","accent","setAccentState","setAccent","name","value","Provider","useTheme","theme","rt","ctx","setScheme","scheme","themeName","noopSetAccent","useScreenMargin","breakpoint","_name","__DEV__","console","warn"],"sourceRoot":"../../../src","sources":["context/ThemeProvider.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAA0BC,WAAW,EAAEC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEzG,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,YAAY,QAAQ,wBAAwB;AAErD,SAASC,gBAAgB;AACzB,SAASC,WAAW,EAAEC,WAAW,EAAEC,gBAAgB;AACnD,SAAoCC,mBAAmB;AAAiC,SAAAC,GAAA,IAAAC,IAAA;AAGxF;AACA;AACA;AACAN,gBAAgB,CAAC,CAAC;AAOlB,MAAMO,YAAY,gBAAGd,aAAa,CAA2B,IAAI,CAAC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMe,eAAe,GAAGA,CAAC;EAAEC;AAA4B,CAAC,KAAK;EAClE,MAAM,CAACC,MAAM,EAAEC,cAAc,CAAC,GAAGd,QAAQ,CAAqB,MAAMM,gBAAgB,CAAC,CAAC,CAAC;EAEvF,MAAMS,SAAS,GAAGlB,WAAW,CAAEmB,IAAY,IAAK;IAC9CZ,WAAW,CAACY,IAAI,CAAC;IACjBF,cAAc,CAACE,IAAI,CAAC;EACtB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,KAAK,GAAGlB,OAAO,CAAoB,OAAO;IAAEc,MAAM;IAAEE;EAAU,CAAC,CAAC,EAAE,CAACF,MAAM,EAAEE,SAAS,CAAC,CAAC;EAE5F,oBACEN,IAAA,CAACC,YAAY,CAACQ,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAL,QAAA,eAClCH,IAAA,CAACR,gBAAgB;MAAAW,QAAA,EAAEA;IAAQ,CAAmB;EAAC,CAC1B,CAAC;AAE5B,CAAC;AAeD;AACA;AACA;AACA;AACA,OAAO,SAASO,QAAQA,CAAA,EAAmB;EACzC,MAAM;IAAEC,KAAK;IAAEC;EAAG,CAAC,GAAGnB,YAAY,CAAC,CAAC;EACpC,MAAMoB,GAAG,GAAGxB,UAAU,CAACY,YAAY,CAAC;EAEpC,MAAMa,SAAS,GAAG1B,WAAW,CAAE2B,MAAc,IAAK;IAChDnB,WAAW,CAACmB,MAAM,CAAC;EACrB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLJ,KAAK;IACLI,MAAM,EAAGH,EAAE,CAACI,SAAS,IAAI,OAAkB;IAC3CF,SAAS;IACTV,MAAM,EAAES,GAAG,EAAET,MAAM;IACnBE,SAAS,EAAEO,GAAG,EAAEP,SAAS,IAAIW;EAC/B,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAyB;EACtD,MAAM;IAAEP,KAAK;IAAEC;EAAG,CAAC,GAAGnB,YAAY,CAAC,CAAC;EACpC,OAAOK,mBAAmB,CAACa,KAAK,EAAEC,EAAE,CAACO,UAAU,CAAC;AAClD;AAEA,MAAMF,aAAa,GAAIG,KAAa,IAAW;EAC7C,IAAIC,OAAO,EAAE;IACXC,OAAO,CAACC,IAAI,CAAC,qEAAqE,CAAC;EACrF;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["breakpoints","xs","sm","md","lg","xl","resolveBreakpointValue","values","breakpoint","undefined"],"sourceRoot":"../../../src","sources":["theme/breakpoints.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,GAAG;EACzBC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE;AACN,CAAU;AASV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,MAAiC,EACjCC,UAAkD,EAC/C;EACH,OAAOA,UAAU,KAAKC,SAAS,IAAID,UAAU,IAAID,MAAM,
|
|
1
|
+
{"version":3,"names":["breakpoints","xs","sm","md","lg","xl","resolveBreakpointValue","values","breakpoint","undefined"],"sourceRoot":"../../../src","sources":["theme/breakpoints.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,GAAG;EACzBC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE;AACN,CAAU;AASV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,MAAiC,EACjCC,UAAkD,EAC/C;EACH,OAAOA,UAAU,KAAKC,SAAS,IAAID,UAAU,IAAID,MAAM,GAAGA,MAAM,CAACC,UAAU,CAAmB,GAAGD,MAAM,CAACN,EAAE;AAC5G","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import Svg, { Circle, Path } from
|
|
3
|
+
import Svg, { Circle, Path } from "react-native-svg";
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
const DEFAULT_SIZE = 20;
|
|
6
|
-
const DEFAULT_COLOR =
|
|
6
|
+
const DEFAULT_COLOR = "#000000";
|
|
7
7
|
const DEFAULT_STROKE_WIDTH = 2;
|
|
8
8
|
const resolveIconProps = ({
|
|
9
9
|
size = DEFAULT_SIZE,
|
|
@@ -17,8 +17,8 @@ const resolveIconProps = ({
|
|
|
17
17
|
const strokeProps = (color, strokeWidth) => ({
|
|
18
18
|
stroke: color,
|
|
19
19
|
strokeWidth,
|
|
20
|
-
strokeLinecap:
|
|
21
|
-
strokeLinejoin:
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round"
|
|
22
22
|
});
|
|
23
23
|
const SvgIcon = ({
|
|
24
24
|
size,
|
|
@@ -176,13 +176,13 @@ export const PersonIcon = props => {
|
|
|
176
176
|
});
|
|
177
177
|
};
|
|
178
178
|
export const defaultIcons = {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
179
|
+
"navigation.back": BackIcon,
|
|
180
|
+
"navigation.forward": ForwardIcon,
|
|
181
|
+
"navigation.close": CloseIcon,
|
|
182
|
+
"status.info": InfoIcon,
|
|
183
|
+
"status.success": SuccessIcon,
|
|
184
|
+
"status.warning": WarningIcon,
|
|
185
|
+
"status.danger": DangerIcon,
|
|
186
186
|
person: PersonIcon
|
|
187
187
|
};
|
|
188
188
|
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Svg","Circle","Path","jsx","_jsx","jsxs","_jsxs","DEFAULT_SIZE","DEFAULT_COLOR","DEFAULT_STROKE_WIDTH","resolveIconProps","size","color","strokeWidth","strokeProps","stroke","strokeLinecap","strokeLinejoin","SvgIcon","children","width","height","viewBox","fill","PathIcon","d","props","NAV_CENTER","NAV_CHEVRON_OPEN","NAV_CHEVRON_ARM","BackIcon","ForwardIcon","CloseIcon","InfoIcon","cx","cy","r","SuccessIcon","WarningIcon","DangerIcon","PersonIcon","iconSize","defaultIcons","person"],"sourceRoot":"../../../../src","sources":["theme/defaults/icons.tsx"],"mappings":";;AAAA,OAAOA,GAAG,IAAIC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["Svg","Circle","Path","jsx","_jsx","jsxs","_jsxs","DEFAULT_SIZE","DEFAULT_COLOR","DEFAULT_STROKE_WIDTH","resolveIconProps","size","color","strokeWidth","strokeProps","stroke","strokeLinecap","strokeLinejoin","SvgIcon","children","width","height","viewBox","fill","PathIcon","d","props","NAV_CENTER","NAV_CHEVRON_OPEN","NAV_CHEVRON_ARM","BackIcon","ForwardIcon","CloseIcon","InfoIcon","cx","cy","r","SuccessIcon","WarningIcon","DangerIcon","PersonIcon","iconSize","defaultIcons","person"],"sourceRoot":"../../../../src","sources":["theme/defaults/icons.tsx"],"mappings":";;AAAA,OAAOA,GAAG,IAAIC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAIrD,MAAMC,YAAY,GAAG,EAAE;AACvB,MAAMC,aAAa,GAAG,SAAS;AAC/B,MAAMC,oBAAoB,GAAG,CAAC;AAE9B,MAAMC,gBAAgB,GAAGA,CAAC;EACxBC,IAAI,GAAGJ,YAAY;EACnBK,KAAK,GAAGJ,aAAa;EACrBK,WAAW,GAAGJ;AACA,CAAC,MAAM;EAAEG,KAAK;EAAED,IAAI;EAAEE;AAAY,CAAC,CAAC;AAEpD,MAAMC,WAAW,GAAGA,CAACF,KAAa,EAAEC,WAAmB,MAAM;EAC3DE,MAAM,EAAEH,KAAK;EACbC,WAAW;EACXG,aAAa,EAAE,OAAgB;EAC/BC,cAAc,EAAE;AAClB,CAAC,CAAC;AAEF,MAAMC,OAAO,GAAGA,CAAC;EAAEP,IAAI;EAAEQ;AAAsD,CAAC,kBAC9Ef,IAAA,CAACJ,GAAG;EAACoB,KAAK,EAAET,IAAK;EAACU,MAAM,EAAEV,IAAK;EAACW,OAAO,EAAC,WAAW;EAACC,IAA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AQ,GAAG9B,IAAI,GAAG,IAAI;EAE5B,oBACEL,KAAA,CAACN,GAAG;IAACoB,KAAK,EAAEqB,QAAS;IAACpB,MAAM,EAAEoB,QAAS;IAACnB,OAAO,EAAC,WAAW;IAACC,IAAI,EAAC,MAAM;IAAAJ,QAAA,gBACrEf,IAAA,CAACH,MAAM;MAACiC,EAAE,EAAE,EAAG;MAACC,EAAE,EAAE,CAAE;MAACC,CAAC,EAAE,CAAE;MAAA,GAAKrB;IAAM,CAAG,CAAC,eAC3CX,IAAA,CAACF,IAAI;MAACuB,CAAC,EAAC,+BAA+B;MAAA,GAAKV;IAAM,CAAG,CAAC;EAAA,CACnD,CAAC;AAEV,CAAC;AAED,OAAO,MAAM2B,YAA+D,GAAG;EAC7E,iBAAiB,EAAEZ,QAAQ;EAC3B,oBAAoB,EAAEC,WAAW;EACjC,kBAAkB,EAAEC,SAAS;EAC7B,aAAa,EAAEC,QAAQ;EACvB,gBAAgB,EAAEI,WAAW;EAC7B,gBAAgB,EAAEC,WAAW;EAC7B,eAAe,EAAEC,UAAU;EAC3BI,MAAM,EAAEH;AACV,CAAC","ignoreList":[]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Image } from "react-native-unistyles/components/native/Image";
|
|
4
|
-
import { createElement } from
|
|
5
|
-
import { Platform } from
|
|
4
|
+
import { createElement } from "react";
|
|
5
|
+
import { Platform } from "react-native";
|
|
6
6
|
const CONTENT_FIT_MAP = {
|
|
7
|
-
cover:
|
|
8
|
-
contain:
|
|
9
|
-
fill:
|
|
7
|
+
cover: "cover",
|
|
8
|
+
contain: "contain",
|
|
9
|
+
fill: "stretch"
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
/** Default image implementation, backed by React Native's `Image`. */
|
|
13
13
|
export const defaultImage = ({
|
|
14
|
-
contentFit =
|
|
14
|
+
contentFit = "cover",
|
|
15
15
|
source,
|
|
16
16
|
style,
|
|
17
17
|
accessibilityLabel,
|
|
@@ -25,7 +25,7 @@ export const defaultImage = ({
|
|
|
25
25
|
// `defaultSource` (iOS only) and `loadingIndicatorSource` (Android only).
|
|
26
26
|
// Only one may be set — Android's Image throws outright when it is handed
|
|
27
27
|
// both — so the placeholder goes to whichever this platform reads.
|
|
28
|
-
...(Platform.OS ===
|
|
28
|
+
...(Platform.OS === "android" ? {
|
|
29
29
|
loadingIndicatorSource: placeholder
|
|
30
30
|
} : {
|
|
31
31
|
defaultSource: placeholder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElement","Platform","CONTENT_FIT_MAP","cover","contain","fill","defaultImage","contentFit","source","style","accessibilityLabel","placeholder","onError","Image","OS","loadingIndicatorSource","defaultSource","resizeMode","undefined"],"sourceRoot":"../../../../src","sources":["theme/defaults/image.tsx"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,SAAgBC,QAAQ,QAAQ,cAAc;AAI9C,MAAMC,eAAe,GAAG;EACtBC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE;AACR,
|
|
1
|
+
{"version":3,"names":["createElement","Platform","CONTENT_FIT_MAP","cover","contain","fill","defaultImage","contentFit","source","style","accessibilityLabel","placeholder","onError","Image","OS","loadingIndicatorSource","defaultSource","resizeMode","undefined"],"sourceRoot":"../../../../src","sources":["theme/defaults/image.tsx"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,SAAgBC,QAAQ,QAAQ,cAAc;AAI9C,MAAMC,eAAe,GAAG;EACtBC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE;AACR,CAAkF;;AAElF;AACA,OAAO,MAAMC,YAAiC,GAAGA,CAAC;EAChDC,UAAU,GAAG,OAAO;EACpBC,MAAM;EACNC,KAAK;EACLC,kBAAkB;EAClBC,WAAW;EACXC;AACF,CAAC,kBACCZ,aAAa,CAACa,KAAK,EAAE;EACnBL,MAAM;EACNC,KAAK;EACLC,kBAAkB;EAClB;EACA;EACA;EACA;EACA,IAAIT,QAAQ,CAACa,EAAE,KAAK,SAAS,GAAG;IAAEC,sBAAsB,EAAEJ;EAAY,CAAC,GAAG;IAAEK,aAAa,EAAEL;EAAY,CAAC,CAAC;EACzGM,UAAU,EAAEf,eAAe,CAACK,UAAU,CAAC;EACvCK,OAAO,EAAEA,OAAO,GAAG,MAAMA,OAAO,CAAC,CAAC,GAAGM;AACvC,CAAC,CAAC","ignoreList":[]}
|