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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","createContext","forwardRef","useContext","StyleSheet","useUnistyles","withUnistyles","resolveThemeColor","FONT_WEIGHT_VALUE","SYSTEM_FONT","Icon","getCustomColorColors","jsx","_jsx","ChipContext","color","size","SCHEME_NAMES","Set","paintedVariant","variant","FG_TOKEN","primary","solid","soft","outline","secondary","success","warning","danger","resolveForeground","customColors","fg","LABEL_VARIANT","sm","md","lg","ChipLabel","children","theme","_styles","styles","useVariants","RNText","style","label","maxFontSizeMultiplier","typography","variants","ICON_SIZE","ChipIcon","name","sizeProp","strokeWidth","rest","contextColor","marginVertical","renderChildren","map","child","trim","length","ChipRoot","Chip","ref","_styles2","isCustomColor","has","customPaint","backgroundColor","bg","borderColor","border","borderWidth","Provider","value","View","base","create","c","labelFont","fonts","semibold","isSystemLabelFont","paddingHorizontal","fontFamily","undefined","fontWeight","fontSize","lineHeight","letterSpacing","uni__dependencies","flexDirection","alignItems","alignSelf","borderRadius","radius","full","minHeight","paddingVertical","gap","ghost","compoundVariants"],"sourceRoot":"../../../../src","sources":["components/chip/Chip.tsx"],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"names":["Children","createContext","forwardRef","useContext","StyleSheet","useUnistyles","withUnistyles","resolveThemeColor","FONT_WEIGHT_VALUE","SYSTEM_FONT","Icon","getCustomColorColors","jsx","_jsx","ChipContext","color","size","SCHEME_NAMES","Set","paintedVariant","variant","FG_TOKEN","primary","solid","soft","outline","secondary","success","warning","danger","resolveForeground","customColors","fg","LABEL_VARIANT","sm","md","lg","ChipLabel","children","theme","_styles","styles","useVariants","RNText","style","label","maxFontSizeMultiplier","typography","variants","ICON_SIZE","ChipIcon","name","sizeProp","strokeWidth","rest","contextColor","marginVertical","renderChildren","map","child","trim","length","ChipRoot","Chip","ref","_styles2","isCustomColor","has","customPaint","backgroundColor","bg","borderColor","border","borderWidth","Provider","value","View","base","create","c","labelFont","fonts","semibold","isSystemLabelFont","paddingHorizontal","fontFamily","undefined","fontWeight","fontSize","lineHeight","letterSpacing","uni__dependencies","flexDirection","alignItems","alignSelf","borderRadius","radius","full","minHeight","paddingVertical","gap","ghost","compoundVariants"],"sourceRoot":"../../../../src","sources":["components/chip/Chip.tsx"],"mappings":";;;;AAAA,SAASA,QAAQ,EAAqBC,aAAa,EAAEC,UAAU,EAAkBC,UAAU,QAAQ,OAAO;AAG1G,SAASC,UAAU,EAAEC,YAAY,EAAEC,aAAa,QAAQ,wBAAwB;AAGhF,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB,EAAEC,WAAW;AACvC,SAASC,IAAI;AAEb,SAAgCC,oBAAoB;;AASpD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAaA,MAAMC,WAAW,gBAAGb,aAAa,CAAmB;EAClDc,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAE;AACR,CAAC,CAAC;;AA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AAC,0BAA0B,CAAC;UAC9CN,WAAW,EAAE;QACf;MACF,CAAC,EACD;QACE1D,KAAK,EAAE,SAAS;QAChBK,OAAO,EAAE,SAAS;QAClBqB,MAAM,EAAE;UACN4B,eAAe,EAAE,aAAa;UAC9BE,WAAW,EAAEQ,CAAC,CAAC,0BAA0B,CAAC;UAC1CN,WAAW,EAAE;QACf;MACF,CAAC,EACD;QACE1D,KAAK,EAAE,QAAQ;QACfK,OAAO,EAAE,OAAO;QAChBqB,MAAM,EAAE;UACN4B,eAAe,EAAEU,CAAC,CAAC,kBAAkB,CAAC;UACtCN,WAAW,EAAE;QACf;MACF,CAAC,EACD;QACE1D,KAAK,EAAE,QAAQ;QACfK,OAAO,EAAE,MAAM;QACfqB,MAAM,EAAE;UACN4B,eAAe,EAAEU,CAAC,CAAC,yBAAyB,CAAC;UAC7CN,WAAW,EAAE;QACf;MACF,CAAC,EACD;QACE1D,KAAK,EAAE,QAAQ;QACfK,OAAO,EAAE,SAAS;QAClBqB,MAAM,EAAE;UACN4B,eAAe,EAAE,aAAa;UAC9BE,WAAW,EAAEQ,CAAC,CAAC,yBAAyB,CAAC;UACzCN,WAAW,EAAE;QACf;MACF,CAAC,CACF;MAAAkB,iBAAA;IACH;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,15 +11,15 @@ const CUSTOM_COLOR_SOFT_ALPHA = 0.16;
|
|
|
11
11
|
export function getCustomColorColors(literal, variant) {
|
|
12
12
|
// Outline borrows the `soft` background as its border, so the two variants
|
|
13
13
|
// read as the same weight of colour — one filled, one drawn.
|
|
14
|
-
if (variant ===
|
|
14
|
+
if (variant === "outline") {
|
|
15
15
|
return {
|
|
16
|
-
bg:
|
|
16
|
+
bg: "transparent",
|
|
17
17
|
border: withAlpha(literal, CUSTOM_COLOR_SOFT_ALPHA),
|
|
18
18
|
borderWidth: 1,
|
|
19
19
|
fg: literal
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
if (variant ===
|
|
22
|
+
if (variant === "soft") {
|
|
23
23
|
const bg = withAlpha(literal, CUSTOM_COLOR_SOFT_ALPHA);
|
|
24
24
|
return {
|
|
25
25
|
bg,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
|
-
import { forwardRef } from
|
|
5
|
-
import { StyleSheet } from
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
6
6
|
import { Icon } from "../icon/index.js";
|
|
7
7
|
import { Text } from "../text/index.js";
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -14,16 +14,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
|
|
15
15
|
const TYPOGRAPHY = {
|
|
16
16
|
sm: {
|
|
17
|
-
title:
|
|
18
|
-
description:
|
|
17
|
+
title: "title-sm",
|
|
18
|
+
description: "body-sm"
|
|
19
19
|
},
|
|
20
20
|
md: {
|
|
21
|
-
title:
|
|
22
|
-
description:
|
|
21
|
+
title: "title-md",
|
|
22
|
+
description: "body-md"
|
|
23
23
|
},
|
|
24
24
|
lg: {
|
|
25
|
-
title:
|
|
26
|
-
description:
|
|
25
|
+
title: "title-lg",
|
|
26
|
+
description: "body-lg"
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
const ICON_SIZE = {
|
|
@@ -35,7 +35,7 @@ const ICON_SIZE = {
|
|
|
35
35
|
/** Wraps a bare string/number in the slot's themed `Text`; elements pass through. */
|
|
36
36
|
function renderSlot(node, wrap) {
|
|
37
37
|
if (node === null || node === undefined || node === false) return null;
|
|
38
|
-
return typeof node ===
|
|
38
|
+
return typeof node === "string" || typeof node === "number" ? wrap(node) : node;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -54,12 +54,12 @@ function renderSlot(node, wrap) {
|
|
|
54
54
|
*/
|
|
55
55
|
export const EmptyState = /*#__PURE__*/forwardRef(function EmptyState({
|
|
56
56
|
icon,
|
|
57
|
-
iconColor =
|
|
57
|
+
iconColor = "text.default",
|
|
58
58
|
media,
|
|
59
59
|
title,
|
|
60
60
|
description,
|
|
61
61
|
action,
|
|
62
|
-
size =
|
|
62
|
+
size = "md",
|
|
63
63
|
fill = false,
|
|
64
64
|
style,
|
|
65
65
|
...rest
|
|
@@ -112,8 +112,8 @@ export const EmptyState = /*#__PURE__*/forwardRef(function EmptyState({
|
|
|
112
112
|
// width/height, which keeps it a perfect circle on the spacing scale.
|
|
113
113
|
const styles = StyleSheet.create(theme => ({
|
|
114
114
|
root: {
|
|
115
|
-
alignItems:
|
|
116
|
-
justifyContent:
|
|
115
|
+
alignItems: "center",
|
|
116
|
+
justifyContent: "center",
|
|
117
117
|
variants: {
|
|
118
118
|
// `alignSelf` matters as much as `flex` here: a column parent hands its
|
|
119
119
|
// children the cross-axis size of their content unless they stretch, so
|
|
@@ -122,82 +122,82 @@ const styles = StyleSheet.create(theme => ({
|
|
|
122
122
|
fill: {
|
|
123
123
|
true: {
|
|
124
124
|
flex: 1,
|
|
125
|
-
alignSelf:
|
|
125
|
+
alignSelf: "stretch"
|
|
126
126
|
},
|
|
127
127
|
false: {}
|
|
128
128
|
},
|
|
129
129
|
size: {
|
|
130
130
|
sm: {
|
|
131
|
-
gap: theme.spacing[
|
|
132
|
-
paddingVertical: theme.spacing[
|
|
133
|
-
paddingHorizontal: theme.spacing[
|
|
131
|
+
gap: theme.spacing["2"],
|
|
132
|
+
paddingVertical: theme.spacing["4"],
|
|
133
|
+
paddingHorizontal: theme.spacing["4"]
|
|
134
134
|
},
|
|
135
135
|
md: {
|
|
136
|
-
gap: theme.spacing[
|
|
137
|
-
paddingVertical: theme.spacing[
|
|
138
|
-
paddingHorizontal: theme.spacing[
|
|
136
|
+
gap: theme.spacing["3"],
|
|
137
|
+
paddingVertical: theme.spacing["6"],
|
|
138
|
+
paddingHorizontal: theme.spacing["6"]
|
|
139
139
|
},
|
|
140
140
|
lg: {
|
|
141
|
-
gap: theme.spacing[
|
|
142
|
-
paddingVertical: theme.spacing[
|
|
143
|
-
paddingHorizontal: theme.spacing[
|
|
141
|
+
gap: theme.spacing["4"],
|
|
142
|
+
paddingVertical: theme.spacing["8"],
|
|
143
|
+
paddingHorizontal: theme.spacing["6"]
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
uni__dependencies: [0, 4]
|
|
148
148
|
},
|
|
149
149
|
iconBadge: {
|
|
150
|
-
alignItems:
|
|
151
|
-
justifyContent:
|
|
152
|
-
backgroundColor: theme.color[
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
justifyContent: "center",
|
|
152
|
+
backgroundColor: theme.color["action.bg.primary.subtle"],
|
|
153
153
|
borderRadius: theme.radius.full,
|
|
154
154
|
variants: {
|
|
155
155
|
size: {
|
|
156
156
|
sm: {
|
|
157
|
-
padding: theme.spacing[
|
|
157
|
+
padding: theme.spacing["3"]
|
|
158
158
|
},
|
|
159
159
|
md: {
|
|
160
|
-
padding: theme.spacing[
|
|
160
|
+
padding: theme.spacing["4"]
|
|
161
161
|
},
|
|
162
162
|
lg: {
|
|
163
|
-
padding: theme.spacing[
|
|
163
|
+
padding: theme.spacing["5"]
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
167
|
uni__dependencies: [0, 4]
|
|
168
168
|
},
|
|
169
169
|
text: {
|
|
170
|
-
alignItems:
|
|
170
|
+
alignItems: "center",
|
|
171
171
|
variants: {
|
|
172
172
|
size: {
|
|
173
173
|
sm: {
|
|
174
|
-
gap: theme.spacing[
|
|
174
|
+
gap: theme.spacing["1"]
|
|
175
175
|
},
|
|
176
176
|
md: {
|
|
177
|
-
gap: theme.spacing[
|
|
177
|
+
gap: theme.spacing["1"]
|
|
178
178
|
},
|
|
179
179
|
lg: {
|
|
180
|
-
gap: theme.spacing[
|
|
180
|
+
gap: theme.spacing["2"]
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
184
|
uni__dependencies: [0, 4]
|
|
185
185
|
},
|
|
186
186
|
actions: {
|
|
187
|
-
alignItems:
|
|
187
|
+
alignItems: "center",
|
|
188
188
|
variants: {
|
|
189
189
|
size: {
|
|
190
190
|
sm: {
|
|
191
|
-
gap: theme.spacing[
|
|
192
|
-
marginTop: theme.spacing[
|
|
191
|
+
gap: theme.spacing["2"],
|
|
192
|
+
marginTop: theme.spacing["1"]
|
|
193
193
|
},
|
|
194
194
|
md: {
|
|
195
|
-
gap: theme.spacing[
|
|
196
|
-
marginTop: theme.spacing[
|
|
195
|
+
gap: theme.spacing["3"],
|
|
196
|
+
marginTop: theme.spacing["2"]
|
|
197
197
|
},
|
|
198
198
|
lg: {
|
|
199
|
-
gap: theme.spacing[
|
|
200
|
-
marginTop: theme.spacing[
|
|
199
|
+
gap: theme.spacing["3"],
|
|
200
|
+
marginTop: theme.spacing["2"]
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","StyleSheet","Icon","Text","jsx","_jsx","jsxs","_jsxs","TYPOGRAPHY","sm","title","description","md","lg","ICON_SIZE","renderSlot","node","wrap","undefined","EmptyState","icon","iconColor","media","action","size","fill","style","rest","ref","_styles","styles","useVariants","typography","View","root","children","iconBadge","name","color","text","value","weight","variant","align","actions","create","theme","alignItems","justifyContent","variants","true","flex","alignSelf","false","gap","spacing","paddingVertical","paddingHorizontal","uni__dependencies","backgroundColor","borderRadius","radius","full","padding","marginTop"],"sourceRoot":"../../../../src","sources":["components/empty-state/EmptyState.tsx"],"mappings":";;;AAAA,SAA4BA,UAAU,QAAwB,OAAO;AAGrE,SAASC,UAAU,QAAQ,wBAAwB;
|
|
1
|
+
{"version":3,"names":["forwardRef","StyleSheet","Icon","Text","jsx","_jsx","jsxs","_jsxs","TYPOGRAPHY","sm","title","description","md","lg","ICON_SIZE","renderSlot","node","wrap","undefined","EmptyState","icon","iconColor","media","action","size","fill","style","rest","ref","_styles","styles","useVariants","typography","View","root","children","iconBadge","name","color","text","value","weight","variant","align","actions","create","theme","alignItems","justifyContent","variants","true","flex","alignSelf","false","gap","spacing","paddingVertical","paddingHorizontal","uni__dependencies","backgroundColor","borderRadius","radius","full","padding","marginTop"],"sourceRoot":"../../../../src","sources":["components/empty-state/EmptyState.tsx"],"mappings":";;;AAAA,SAA4BA,UAAU,QAAwB,OAAO;AAGrE,SAASC,UAAU,QAAQ,wBAAwB;AAGnD,SAASC,IAAI;AACb,SAASC,IAAI;AAAkB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA6B/B;AACA;AACA;AACA;AACA;;AAEA,MAAMC,UAAoF,GAAG;EAC3FC,EAAE,EAAE;IAAEC,KAAK,EAAE,UAAU;IAAEC,WAAW,EAAE;EAAU,CAAC;EACjDC,EAAE,EAAE;IAAEF,KAAK,EAAE,UAAU;IAAEC,WAAW,EAAE;EAAU,CAAC;EACjDE,EAAE,EAAE;IAAEH,KAAK,EAAE,UAAU;IAAEC,WAAW,EAAE;EAAU;AAClD,CAAC;AAED,MAAMG,SAAyC,GAAG;EAChDL,EAAE,EAAE,EAAE;EACNG,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;;AAED;AACA,SAASE,UAAUA,CAACC,IAAe,EAAEC,IAAqC,EAAa;EACrF,IAAID,IAAI,KAAK,IAAI,IAAIA,IAAI,KAAKE,SAAS,IAAIF,IAAI,KAAK,KAAK,EAAE,OAAO,IAAI;EACtE,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,QAAQ,GAAGC,IAAI,CAACD,IAAI,CAAC,GAAGA,IAAI;AACjF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,UAAU,gBAAGnB,UA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,OAAO,CAAC,GAAG;QAAE,CAAC;QAC9D1C,EAAE,EAAE;UAAEyC,GAAG,EAAER,KAAK,CAACS,OAAO,CAAC,GAAG,CAAC;UAAES,SAAS,EAAElB,KAAK,CAACS,OAAO,CAAC,GAAG;QAAE;MAC/D;IACF,CAAC;IAAAG,iBAAA;EACH;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -28,20 +28,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export const HeaderButton = Toolbar.Button;
|
|
31
|
-
const getDismissAccessibilityLabel = dismissAction => dismissAction ===
|
|
32
|
-
const getDismissIconName = dismissAction => dismissAction ===
|
|
31
|
+
const getDismissAccessibilityLabel = dismissAction => dismissAction === "close" ? "Close" : "Back";
|
|
32
|
+
const getDismissIconName = dismissAction => dismissAction === "close" ? "navigation.close" : "navigation.back";
|
|
33
33
|
export function HeaderDismissButton({
|
|
34
|
-
dismissAction =
|
|
34
|
+
dismissAction = "none",
|
|
35
35
|
navigation,
|
|
36
36
|
onDismiss
|
|
37
37
|
}) {
|
|
38
|
-
if (dismissAction ===
|
|
38
|
+
if (dismissAction === "none") return null;
|
|
39
39
|
const handlePress = () => {
|
|
40
40
|
if (onDismiss) {
|
|
41
41
|
onDismiss();
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
if (dismissAction ===
|
|
44
|
+
if (dismissAction === "close" && navigation?.dismiss) {
|
|
45
45
|
navigation.dismiss();
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Toolbar","jsx","_jsx","HeaderButton","Button","getDismissAccessibilityLabel","dismissAction","getDismissIconName","HeaderDismissButton","navigation","onDismiss","handlePress","dismiss","goBack","canGoBack","icon","iconSize","accessibilityLabel","onPress"],"sourceRoot":"../../../../src","sources":["components/header/header-buttons.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["Toolbar","jsx","_jsx","HeaderButton","Button","getDismissAccessibilityLabel","dismissAction","getDismissIconName","HeaderDismissButton","navigation","onDismiss","handlePress","dismiss","goBack","canGoBack","icon","iconSize","accessibilityLabel","onPress"],"sourceRoot":"../../../../src","sources":["components/header/header-buttons.tsx"],"mappings":";;AACA,SAASA,OAAO;;AAEhB;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGH,OAAO,CAACI,MAAM;AAmB1C,MAAMC,4BAA4B,GAAIC,aAAkC,IACtEA,aAAa,KAAK,OAAO,GAAG,OAAO,GAAG,MAAM;AAE9C,MAAMC,kBAAkB,GAAID,aAAkC,IAC5DA,aAAa,KAAK,OAAO,GAAG,kBAAkB,GAAG,iBAAiB;AAEpE,OAAO,SAASE,mBAAmBA,CAAC;EAAEF,aAAa,GAAG,MAAM;EAAEG,UAAU;EAAEC;AAA8B,CAAC,EAAE;EACzG,IAAIJ,aAAa,KAAK,MAAM,EAAE,OAAO,IAAI;EAEzC,MAAMK,WAAW,GAAGA,CAAA,KAAM;IACxB,IAAID,SAAS,EAAE;MACbA,SAAS,CAAC,CAAC;MACX;IACF;IAEA,IAAIJ,aAAa,KAAK,OAAO,IAAIG,UAAU,EAAEG,OAAO,EAAE;MACpDH,UAAU,CAACG,OAAO,CAAC,CAAC;MACpB;IACF;IAEA,IAAIH,UAAU,EAAEI,MAAM,IAAIJ,UAAU,CAACK,SAAS,GAAG,CAAC,KAAK,KAAK,EAAE;MAC5DL,UAAU,CAACI,MAAM,CAAC,CAAC;MACnB;IACF;EACF,CAAC;EAED,oBACEX,IAAA,CAACF,OAAO,CAACI,MAAM;IACbW,IAAI,EAAER,kBAAkB,CAACD,aAAa,CAAE;IACxCU,QAAQ,EAAE,EAAG;IACbC,kBAAkB,EAAEZ,4BAA4B,CAACC,aAAa,CAAE;IAChEY,OAAO,EAAEP;EAAY,CACtB,CAAC;AAEN","ignoreList":[]}
|
|
@@ -1,9 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useId } from
|
|
4
|
-
import Svg, { Defs, Rect, Stop, LinearGradient as SvgLinearGradient } from
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import Svg, { Defs, Rect, Stop, LinearGradient as SvgLinearGradient } from "react-native-svg";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* How far the overlay extends below the bar's bottom edge, in dp.
|
|
8
|
+
*
|
|
9
|
+
* The fade needs more room than the bar alone can give it: confined to the bar,
|
|
10
|
+
* the curve has to be steep enough to read as a band. Overhanging lets the tail
|
|
11
|
+
* finish in open space, so the header releases content instead of cutting it.
|
|
12
|
+
*/
|
|
5
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
14
|
+
export const HEADER_FADE_EXTENT = 22;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Where the fade begins, as a fraction of the overlay's height — the bar plus
|
|
18
|
+
* {@link HEADER_FADE_EXTENT}.
|
|
19
|
+
*
|
|
20
|
+
* Sits inside the bar rather than at its bottom edge, so the tint has already
|
|
21
|
+
* begun thinning before content reaches the boundary. That is the trade this
|
|
22
|
+
* value makes: a longer, gentler ramp, paid for with content being faintly
|
|
23
|
+
* visible through the lower part of the bar.
|
|
24
|
+
*/
|
|
25
|
+
const FADE_START = 0.45;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Stops used to approximate the fade curve. Below ~10 the ramp shows as a series
|
|
29
|
+
* of bands on an 8-bit display; above ~14 the extra stops cost SVG parse time
|
|
30
|
+
* with nothing visible in return.
|
|
31
|
+
*/
|
|
32
|
+
const FADE_STOPS = 12;
|
|
33
|
+
|
|
34
|
+
/** Ceiling on the fade's opacity — see {@link alphaAt}. */
|
|
35
|
+
const MAX_FADE_ALPHA = 0.95;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Raised cosine, capped at {@link MAX_FADE_ALPHA}, reaching 0 at the overlay's
|
|
39
|
+
* bottom.
|
|
40
|
+
*
|
|
41
|
+
* The curve's slope is zero at both ends, so neither the start of the fade nor
|
|
42
|
+
* its finish leaves a seam. A two-stop linear ramp has a constant slope that
|
|
43
|
+
* begins and ends abruptly, and those two hard edges are what read as a line
|
|
44
|
+
* drawn across the content rather than the header letting go of it.
|
|
45
|
+
*
|
|
46
|
+
* The cap holds the ramp just short of solid, so the whole overlay reads as one
|
|
47
|
+
* continuous gradient rather than an opaque plateau with a curve bolted on.
|
|
48
|
+
*/
|
|
49
|
+
const alphaAt = t => Math.min((1 + Math.cos(Math.PI * t)) / 2, MAX_FADE_ALPHA);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Every input is a module constant, so the ramp is built once at load rather
|
|
53
|
+
* than rebuilt per render.
|
|
54
|
+
*
|
|
55
|
+
* The leading stop belongs to this list rather than being a sibling element:
|
|
56
|
+
* `LinearGradient` types its children as a flat `ReactElement[]`, so an element
|
|
57
|
+
* beside a mapped array would nest and fail to type-check.
|
|
58
|
+
*/
|
|
59
|
+
const STOPS = [{
|
|
60
|
+
offset: 0,
|
|
61
|
+
opacity: 1
|
|
62
|
+
}, ...Array.from({
|
|
63
|
+
length: FADE_STOPS
|
|
64
|
+
}, (_, index) => {
|
|
65
|
+
const t = index / (FADE_STOPS - 1);
|
|
66
|
+
return {
|
|
67
|
+
offset: FADE_START + t * (1 - FADE_START),
|
|
68
|
+
opacity: alphaAt(t)
|
|
69
|
+
};
|
|
70
|
+
})];
|
|
71
|
+
/**
|
|
72
|
+
* Vertical fade-out overlay behind header content, shared by header variants.
|
|
73
|
+
*
|
|
74
|
+
* Reaches zero rather than stopping short. An overlay ending at partial opacity
|
|
75
|
+
* leaves a hard step wherever it is clipped, and that step is far more visible
|
|
76
|
+
* than the fade it was meant to hide — it is what cuts content off square as it
|
|
77
|
+
* scrolls under the header.
|
|
78
|
+
*
|
|
79
|
+
* Callers size it to overhang the bar by {@link HEADER_FADE_EXTENT}.
|
|
80
|
+
*/
|
|
7
81
|
export function HeaderGradientOverlay({
|
|
8
82
|
color
|
|
9
83
|
}) {
|
|
@@ -12,21 +86,17 @@ export function HeaderGradientOverlay({
|
|
|
12
86
|
height: "100%",
|
|
13
87
|
width: "100%",
|
|
14
88
|
children: [/*#__PURE__*/_jsx(Defs, {
|
|
15
|
-
children: /*#__PURE__*/
|
|
89
|
+
children: /*#__PURE__*/_jsx(SvgLinearGradient, {
|
|
16
90
|
id: gradientId,
|
|
17
91
|
x1: "0",
|
|
18
92
|
y1: "0",
|
|
19
93
|
x2: "0",
|
|
20
94
|
y2: "1",
|
|
21
|
-
children:
|
|
22
|
-
offset:
|
|
23
|
-
stopColor: color,
|
|
24
|
-
stopOpacity: "1"
|
|
25
|
-
}), /*#__PURE__*/_jsx(Stop, {
|
|
26
|
-
offset: "1",
|
|
95
|
+
children: STOPS.map(stop => /*#__PURE__*/_jsx(Stop, {
|
|
96
|
+
offset: stop.offset,
|
|
27
97
|
stopColor: color,
|
|
28
|
-
stopOpacity:
|
|
29
|
-
})
|
|
98
|
+
stopOpacity: stop.opacity
|
|
99
|
+
}, stop.offset))
|
|
30
100
|
})
|
|
31
101
|
}), /*#__PURE__*/_jsx(Rect, {
|
|
32
102
|
width: "100%",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useId","Svg","Defs","Rect","Stop","LinearGradient","SvgLinearGradient","jsx","_jsx","jsxs","_jsxs","HeaderGradientOverlay","color","gradientId","height","width","children","id","x1","y1","x2","y2","
|
|
1
|
+
{"version":3,"names":["useId","Svg","Defs","Rect","Stop","LinearGradient","SvgLinearGradient","jsx","_jsx","jsxs","_jsxs","HEADER_FADE_EXTENT","FADE_START","FADE_STOPS","MAX_FADE_ALPHA","alphaAt","t","Math","min","cos","PI","STOPS","offset","opacity","Array","from","length","_","index","HeaderGradientOverlay","color","gradientId","height","width","children","id","x1","y1","x2","y2","map","stop","stopColor","stopOpacity","fill"],"sourceRoot":"../../../../../src","sources":["components/header/parts/HeaderGradientOverlay.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,OAAO;AAE7B,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,cAAc,IAAIC,iBAAiB,QAAQ,kBAAkB;;AAE7F;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOA,OAAO,MAAMC,kBAAkB,GAAG,EAAE;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,IAAI;;AAEvB;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,EAAE;;AAErB;AACA,MAAMC,cAAc,GAAG,IAAI;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,CAAS,IAAKC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC,GAAGD,IAAI,CAACE,GAAG,CAACF,IAAI,CAACG,EAAE,GAAGJ,CAAC,CAAC,IAAI,CAAC,EAAEF,cAAc,CAAC;;AAExF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMO,KAAK,GAAG,CACZ;EAAEC,MAAM,EAAE,CAAC;EAAEC,OAAO,EAAE;AAAE,CAAC,EACzB,GAAGC,KAAK,CAACC,IAAI,CAAC;EAAEC,MAAM,EAAEb;AAAW,CAAC,EAAE,CAACc,CAAC,EAAEC,KAAK,KAAK;EAClD,MAAMZ,CAAC,GAAGY,KAAK,IAAIf,UAAU,GAAG,CAAC,CAAC;EAClC,OAAO;IAAES,MAAM,EAAEV,UAAU,GAAGI,CAAC,IAAI,CAAC,GAAGJ,UAAU,CAAC;IAAEW,OAAO,EAAER,OAAO,CAACC,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