react-native-terra-ui 0.1.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/README.md +70 -0
- package/lib/module/components/avatar/Avatar.js +121 -0
- package/lib/module/components/avatar/Avatar.js.map +1 -0
- package/lib/module/components/avatar/index.js +4 -0
- package/lib/module/components/avatar/index.js.map +1 -0
- package/lib/module/components/avatar/types.js +4 -0
- package/lib/module/components/avatar/types.js.map +1 -0
- package/lib/module/components/box/Box.js +49 -0
- package/lib/module/components/box/Box.js.map +1 -0
- package/lib/module/components/box/index.js +4 -0
- package/lib/module/components/box/index.js.map +1 -0
- package/lib/module/components/box/utils.js +95 -0
- package/lib/module/components/box/utils.js.map +1 -0
- package/lib/module/components/button/Button.js +281 -0
- package/lib/module/components/button/Button.js.map +1 -0
- package/lib/module/components/button/index.js +4 -0
- package/lib/module/components/button/index.js.map +1 -0
- package/lib/module/components/header/Header.js +25 -0
- package/lib/module/components/header/Header.js.map +1 -0
- package/lib/module/components/header/header-buttons.js +65 -0
- package/lib/module/components/header/header-buttons.js.map +1 -0
- package/lib/module/components/header/index.js +7 -0
- package/lib/module/components/header/index.js.map +1 -0
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +335 -0
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -0
- package/lib/module/components/header/variants/TitleHeader/index.js +184 -0
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -0
- package/lib/module/components/icon/Icon.js +53 -0
- package/lib/module/components/icon/Icon.js.map +1 -0
- package/lib/module/components/icon/index.js +4 -0
- package/lib/module/components/icon/index.js.map +1 -0
- package/lib/module/components/icon/utils.js +188 -0
- package/lib/module/components/icon/utils.js.map +1 -0
- package/lib/module/components/index.js +16 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/page-indicator/PageIndicator.js +49 -0
- package/lib/module/components/page-indicator/PageIndicator.js.map +1 -0
- package/lib/module/components/page-indicator/PageIndicatorRoot.js +24 -0
- package/lib/module/components/page-indicator/PageIndicatorRoot.js.map +1 -0
- package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +24 -0
- package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js.map +1 -0
- package/lib/module/components/page-indicator/hooks/use-page-indicator-core.js +20 -0
- package/lib/module/components/page-indicator/hooks/use-page-indicator-core.js.map +1 -0
- package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js +68 -0
- package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js.map +1 -0
- package/lib/module/components/page-indicator/index.js +5 -0
- package/lib/module/components/page-indicator/index.js.map +1 -0
- package/lib/module/components/page-indicator/utils.js +127 -0
- package/lib/module/components/page-indicator/utils.js.map +1 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js +50 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js.map +1 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js +165 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js.map +1 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js +60 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js.map +1 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/index.js +87 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/index.js.map +1 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/utils.js +28 -0
- package/lib/module/components/page-indicator/variants/DotIndicator/utils.js.map +1 -0
- package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js +53 -0
- package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js.map +1 -0
- package/lib/module/components/page-indicator/variants/PillIndicator/index.js +76 -0
- package/lib/module/components/page-indicator/variants/PillIndicator/index.js.map +1 -0
- package/lib/module/components/page-indicator/variants/PillIndicator/utils.js +47 -0
- package/lib/module/components/page-indicator/variants/PillIndicator/utils.js.map +1 -0
- package/lib/module/components/portal/PortalContext.js +20 -0
- package/lib/module/components/portal/PortalContext.js.map +1 -0
- package/lib/module/components/portal/PortalHost.js +23 -0
- package/lib/module/components/portal/PortalHost.js.map +1 -0
- package/lib/module/components/portal/PortalProvider.js +40 -0
- package/lib/module/components/portal/PortalProvider.js.map +1 -0
- package/lib/module/components/portal/index.js +6 -0
- package/lib/module/components/portal/index.js.map +1 -0
- package/lib/module/components/screen/Screen.js +100 -0
- package/lib/module/components/screen/Screen.js.map +1 -0
- package/lib/module/components/screen/ScreenContext.js +66 -0
- package/lib/module/components/screen/ScreenContext.js.map +1 -0
- package/lib/module/components/screen/ScreenFlatList.js +75 -0
- package/lib/module/components/screen/ScreenFlatList.js.map +1 -0
- package/lib/module/components/screen/ScreenScrollView.js +82 -0
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -0
- package/lib/module/components/screen/index.js +7 -0
- package/lib/module/components/screen/index.js.map +1 -0
- package/lib/module/components/screen/utils.js +13 -0
- package/lib/module/components/screen/utils.js.map +1 -0
- package/lib/module/components/slot/Slot.js +38 -0
- package/lib/module/components/slot/Slot.js.map +1 -0
- package/lib/module/components/slot/index.js +10 -0
- package/lib/module/components/slot/index.js.map +1 -0
- package/lib/module/components/slot/utils.js +55 -0
- package/lib/module/components/slot/utils.js.map +1 -0
- package/lib/module/components/spinner/Spinner.js +132 -0
- package/lib/module/components/spinner/Spinner.js.map +1 -0
- package/lib/module/components/spinner/index.js +4 -0
- package/lib/module/components/spinner/index.js.map +1 -0
- package/lib/module/components/surface/Surface.js +74 -0
- package/lib/module/components/surface/Surface.js.map +1 -0
- package/lib/module/components/surface/index.js +4 -0
- package/lib/module/components/surface/index.js.map +1 -0
- package/lib/module/components/text/Text.js +67 -0
- package/lib/module/components/text/Text.js.map +1 -0
- package/lib/module/components/text/index.js +4 -0
- package/lib/module/components/text/index.js.map +1 -0
- package/lib/module/components/toast/Toast.js +350 -0
- package/lib/module/components/toast/Toast.js.map +1 -0
- package/lib/module/components/toast/ToastProvider.js +272 -0
- package/lib/module/components/toast/ToastProvider.js.map +1 -0
- package/lib/module/components/toast/index.js +5 -0
- package/lib/module/components/toast/index.js.map +1 -0
- package/lib/module/components/toast/parts/ToastAnimatedItem.js +168 -0
- package/lib/module/components/toast/parts/ToastAnimatedItem.js.map +1 -0
- package/lib/module/components/toast/types.js +4 -0
- package/lib/module/components/toast/types.js.map +1 -0
- package/lib/module/components/toast/utils/controller.js +19 -0
- package/lib/module/components/toast/utils/controller.js.map +1 -0
- package/lib/module/context/ThemeProvider.js +66 -0
- package/lib/module/context/ThemeProvider.js.map +1 -0
- package/lib/module/context/index.js +4 -0
- package/lib/module/context/index.js.map +1 -0
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/theme/configure.js +152 -0
- package/lib/module/theme/configure.js.map +1 -0
- package/lib/module/theme/index.js +22 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/runtime.js +25 -0
- package/lib/module/theme/runtime.js.map +1 -0
- package/lib/module/theme/theme.js +121 -0
- package/lib/module/theme/theme.js.map +1 -0
- package/lib/module/theme/tokens/dark.js +109 -0
- package/lib/module/theme/tokens/dark.js.map +1 -0
- package/lib/module/theme/tokens/light.js +115 -0
- package/lib/module/theme/tokens/light.js.map +1 -0
- package/lib/module/theme/tokens/primitives.js +228 -0
- package/lib/module/theme/tokens/primitives.js.map +1 -0
- package/lib/module/theme/types.js +4 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/accent-utils.js +52 -0
- package/lib/module/utils/accent-utils.js.map +1 -0
- package/lib/module/utils/color-utils.js +53 -0
- package/lib/module/utils/color-utils.js.map +1 -0
- package/lib/module/utils/deep-merge.js +28 -0
- package/lib/module/utils/deep-merge.js.map +1 -0
- package/lib/module/utils/resolve-theme-color.js +20 -0
- package/lib/module/utils/resolve-theme-color.js.map +1 -0
- package/lib/module/utils/typography.js +13 -0
- package/lib/module/utils/typography.js.map +1 -0
- package/lib/module/utils/unflatten.js +35 -0
- package/lib/module/utils/unflatten.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/avatar/Avatar.d.ts +3 -0
- package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/src/components/avatar/index.d.ts +3 -0
- package/lib/typescript/src/components/avatar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/avatar/types.d.ts +30 -0
- package/lib/typescript/src/components/avatar/types.d.ts.map +1 -0
- package/lib/typescript/src/components/box/Box.d.ts +12 -0
- package/lib/typescript/src/components/box/Box.d.ts.map +1 -0
- package/lib/typescript/src/components/box/index.d.ts +4 -0
- package/lib/typescript/src/components/box/index.d.ts.map +1 -0
- package/lib/typescript/src/components/box/utils.d.ts +39 -0
- package/lib/typescript/src/components/box/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/button/Button.d.ts +46 -0
- package/lib/typescript/src/components/button/Button.d.ts.map +1 -0
- package/lib/typescript/src/components/button/index.d.ts +3 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -0
- package/lib/typescript/src/components/header/Header.d.ts +22 -0
- package/lib/typescript/src/components/header/Header.d.ts.map +1 -0
- package/lib/typescript/src/components/header/header-buttons.d.ts +16 -0
- package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -0
- package/lib/typescript/src/components/header/index.d.ts +7 -0
- package/lib/typescript/src/components/header/index.d.ts.map +1 -0
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +25 -0
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -0
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +28 -0
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -0
- package/lib/typescript/src/components/icon/Icon.d.ts +22 -0
- package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -0
- package/lib/typescript/src/components/icon/index.d.ts +3 -0
- package/lib/typescript/src/components/icon/index.d.ts.map +1 -0
- package/lib/typescript/src/components/icon/utils.d.ts +4 -0
- package/lib/typescript/src/components/icon/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +14 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts +48 -0
- package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts +13 -0
- package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts +14 -0
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts +11 -0
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts +19 -0
- package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/index.d.ts +4 -0
- package/lib/typescript/src/components/page-indicator/index.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/utils.d.ts +36 -0
- package/lib/typescript/src/components/page-indicator/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts +14 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts +11 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts +15 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts +32 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/utils.d.ts +14 -0
- package/lib/typescript/src/components/page-indicator/variants/DotIndicator/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts +16 -0
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts +28 -0
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts.map +1 -0
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/utils.d.ts +21 -0
- package/lib/typescript/src/components/page-indicator/variants/PillIndicator/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/portal/PortalContext.d.ts +19 -0
- package/lib/typescript/src/components/portal/PortalContext.d.ts.map +1 -0
- package/lib/typescript/src/components/portal/PortalHost.d.ts +7 -0
- package/lib/typescript/src/components/portal/PortalHost.d.ts.map +1 -0
- package/lib/typescript/src/components/portal/PortalProvider.d.ts +11 -0
- package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -0
- package/lib/typescript/src/components/portal/index.d.ts +6 -0
- package/lib/typescript/src/components/portal/index.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/Screen.d.ts +53 -0
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/ScreenContext.d.ts +64 -0
- package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +26 -0
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +36 -0
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/index.d.ts +9 -0
- package/lib/typescript/src/components/screen/index.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/utils.d.ts +10 -0
- package/lib/typescript/src/components/screen/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/slot/Slot.d.ts +17 -0
- package/lib/typescript/src/components/slot/Slot.d.ts.map +1 -0
- package/lib/typescript/src/components/slot/index.d.ts +8 -0
- package/lib/typescript/src/components/slot/index.d.ts.map +1 -0
- package/lib/typescript/src/components/slot/utils.d.ts +17 -0
- package/lib/typescript/src/components/slot/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/spinner/Spinner.d.ts +18 -0
- package/lib/typescript/src/components/spinner/Spinner.d.ts.map +1 -0
- package/lib/typescript/src/components/spinner/index.d.ts +3 -0
- package/lib/typescript/src/components/spinner/index.d.ts.map +1 -0
- package/lib/typescript/src/components/surface/Surface.d.ts +31 -0
- package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -0
- package/lib/typescript/src/components/surface/index.d.ts +3 -0
- package/lib/typescript/src/components/surface/index.d.ts.map +1 -0
- package/lib/typescript/src/components/text/Text.d.ts +23 -0
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -0
- package/lib/typescript/src/components/text/index.d.ts +3 -0
- package/lib/typescript/src/components/text/index.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/Toast.d.ts +71 -0
- package/lib/typescript/src/components/toast/Toast.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/ToastProvider.d.ts +4 -0
- package/lib/typescript/src/components/toast/ToastProvider.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/index.d.ts +5 -0
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts +18 -0
- package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/types.d.ts +62 -0
- package/lib/typescript/src/components/toast/types.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/utils/controller.d.ts +5 -0
- package/lib/typescript/src/components/toast/utils/controller.d.ts.map +1 -0
- package/lib/typescript/src/context/ThemeProvider.d.ts +29 -0
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/src/context/index.d.ts +3 -0
- package/lib/typescript/src/context/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/configure.d.ts +47 -0
- package/lib/typescript/src/theme/configure.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +11 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/runtime.d.ts +7 -0
- package/lib/typescript/src/theme/runtime.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme.d.ts +22 -0
- package/lib/typescript/src/theme/theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens/dark.d.ts +100 -0
- package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens/light.d.ts +106 -0
- package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens/primitives.d.ts +212 -0
- package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -0
- package/lib/typescript/src/theme/types.d.ts +273 -0
- package/lib/typescript/src/theme/types.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +4 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/accent-utils.d.ts +4 -0
- package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -0
- package/lib/typescript/src/utils/color-utils.d.ts +11 -0
- package/lib/typescript/src/utils/color-utils.d.ts.map +1 -0
- package/lib/typescript/src/utils/deep-merge.d.ts +11 -0
- package/lib/typescript/src/utils/deep-merge.d.ts.map +1 -0
- package/lib/typescript/src/utils/resolve-theme-color.d.ts +12 -0
- package/lib/typescript/src/utils/resolve-theme-color.d.ts.map +1 -0
- package/lib/typescript/src/utils/typography.d.ts +6 -0
- package/lib/typescript/src/utils/typography.d.ts.map +1 -0
- package/lib/typescript/src/utils/unflatten.d.ts +12 -0
- package/lib/typescript/src/utils/unflatten.d.ts.map +1 -0
- package/package.json +137 -0
- package/src/components/avatar/Avatar.tsx +146 -0
- package/src/components/avatar/index.ts +8 -0
- package/src/components/avatar/types.ts +35 -0
- package/src/components/box/Box.tsx +59 -0
- package/src/components/box/index.ts +8 -0
- package/src/components/box/utils.ts +181 -0
- package/src/components/button/Button.tsx +313 -0
- package/src/components/button/index.ts +8 -0
- package/src/components/header/Header.ts +22 -0
- package/src/components/header/header-buttons.tsx +103 -0
- package/src/components/header/index.ts +11 -0
- package/src/components/header/variants/LargeTitleHeader/index.tsx +390 -0
- package/src/components/header/variants/TitleHeader/index.tsx +194 -0
- package/src/components/icon/Icon.tsx +74 -0
- package/src/components/icon/index.ts +2 -0
- package/src/components/icon/utils.tsx +147 -0
- package/src/components/index.ts +13 -0
- package/src/components/page-indicator/PageIndicator.tsx +100 -0
- package/src/components/page-indicator/PageIndicatorRoot.tsx +41 -0
- package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +65 -0
- package/src/components/page-indicator/hooks/use-page-indicator-core.ts +34 -0
- package/src/components/page-indicator/hooks/use-page-indicator-progress.ts +122 -0
- package/src/components/page-indicator/index.ts +13 -0
- package/src/components/page-indicator/utils.ts +208 -0
- package/src/components/page-indicator/variants/DotIndicator/InactiveDot.tsx +70 -0
- package/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.tsx +201 -0
- package/src/components/page-indicator/variants/DotIndicator/TravelingPill.tsx +80 -0
- package/src/components/page-indicator/variants/DotIndicator/index.tsx +145 -0
- package/src/components/page-indicator/variants/DotIndicator/utils.ts +28 -0
- package/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.tsx +107 -0
- package/src/components/page-indicator/variants/PillIndicator/index.tsx +149 -0
- package/src/components/page-indicator/variants/PillIndicator/utils.ts +63 -0
- package/src/components/portal/PortalContext.tsx +27 -0
- package/src/components/portal/PortalHost.tsx +20 -0
- package/src/components/portal/PortalProvider.tsx +44 -0
- package/src/components/portal/index.ts +5 -0
- package/src/components/screen/Screen.tsx +163 -0
- package/src/components/screen/ScreenContext.tsx +144 -0
- package/src/components/screen/ScreenFlatList.tsx +121 -0
- package/src/components/screen/ScreenScrollView.tsx +130 -0
- package/src/components/screen/index.ts +8 -0
- package/src/components/screen/utils.ts +17 -0
- package/src/components/slot/Slot.tsx +56 -0
- package/src/components/slot/index.ts +8 -0
- package/src/components/slot/utils.ts +61 -0
- package/src/components/spinner/Spinner.tsx +153 -0
- package/src/components/spinner/index.ts +2 -0
- package/src/components/surface/Surface.tsx +100 -0
- package/src/components/surface/index.ts +2 -0
- package/src/components/text/Text.tsx +115 -0
- package/src/components/text/index.ts +2 -0
- package/src/components/toast/Toast.tsx +477 -0
- package/src/components/toast/ToastProvider.tsx +403 -0
- package/src/components/toast/index.ts +26 -0
- package/src/components/toast/parts/ToastAnimatedItem.tsx +184 -0
- package/src/components/toast/types.ts +75 -0
- package/src/components/toast/utils/controller.ts +23 -0
- package/src/context/ThemeProvider.tsx +97 -0
- package/src/context/index.ts +2 -0
- package/src/index.tsx +6 -0
- package/src/theme/configure.ts +215 -0
- package/src/theme/index.ts +72 -0
- package/src/theme/runtime.ts +27 -0
- package/src/theme/theme.ts +152 -0
- package/src/theme/tokens/dark.ts +117 -0
- package/src/theme/tokens/light.ts +123 -0
- package/src/theme/tokens/primitives.ts +232 -0
- package/src/theme/types.ts +384 -0
- package/src/types.ts +1 -0
- package/src/utils/accent-utils.ts +58 -0
- package/src/utils/color-utils.ts +51 -0
- package/src/utils/deep-merge.ts +36 -0
- package/src/utils/resolve-theme-color.ts +27 -0
- package/src/utils/typography.ts +15 -0
- package/src/utils/unflatten.ts +36 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo } from 'react';
|
|
4
|
+
import { cancelAnimation, Easing, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
5
|
+
import { PAGE_INDICATOR_SINGLE_PAGE_DURATION, pageIndicatorPageJumpDistance, pageIndicatorPageJumpDuration } from "../utils.js";
|
|
6
|
+
function clampPageIndex(page, count) {
|
|
7
|
+
if (count <= 0) return 0;
|
|
8
|
+
return Math.min(Math.max(page, 0), count - 1);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Returns scroll-linked `progress` when provided; otherwise owns a shared value
|
|
12
|
+
* that animates toward the discrete page index.
|
|
13
|
+
*
|
|
14
|
+
* Single-step pill changes animate `progress` continuously. Multi-step pill
|
|
15
|
+
* jumps cross-fade only the source and target dots — intermediates stay idle.
|
|
16
|
+
*/
|
|
17
|
+
export function usePageIndicatorProgress(count, progress, page, variant = 'pill', duration = PAGE_INDICATOR_SINGLE_PAGE_DURATION) {
|
|
18
|
+
const internalProgress = useSharedValue(page !== undefined ? clampPageIndex(page, count) : 0);
|
|
19
|
+
const pillJumpActive = useSharedValue(false);
|
|
20
|
+
const pillJumpFrom = useSharedValue(0);
|
|
21
|
+
const pillJumpTo = useSharedValue(0);
|
|
22
|
+
const pillJumpT = useSharedValue(0);
|
|
23
|
+
const pillJump = useMemo(() => ({
|
|
24
|
+
active: pillJumpActive,
|
|
25
|
+
from: pillJumpFrom,
|
|
26
|
+
to: pillJumpTo,
|
|
27
|
+
t: pillJumpT
|
|
28
|
+
}), [pillJumpActive, pillJumpFrom, pillJumpTo, pillJumpT]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (page === undefined) return;
|
|
31
|
+
const target = clampPageIndex(page, count);
|
|
32
|
+
const from = internalProgress.value;
|
|
33
|
+
const distance = pageIndicatorPageJumpDistance(from, target);
|
|
34
|
+
if (distance === 0) return;
|
|
35
|
+
cancelAnimation(internalProgress);
|
|
36
|
+
cancelAnimation(pillJumpT);
|
|
37
|
+
pillJumpActive.value = false;
|
|
38
|
+
if (variant === 'pill' && distance > 1) {
|
|
39
|
+
const jumpDuration = pageIndicatorPageJumpDuration(from, target);
|
|
40
|
+
internalProgress.value = from;
|
|
41
|
+
pillJumpFrom.value = from;
|
|
42
|
+
pillJumpTo.value = target;
|
|
43
|
+
pillJumpActive.value = true;
|
|
44
|
+
pillJumpT.value = 0;
|
|
45
|
+
pillJumpT.value = withTiming(1, {
|
|
46
|
+
duration: jumpDuration,
|
|
47
|
+
easing: Easing.bezier(0.33, 0, 0.15, 1)
|
|
48
|
+
}, finished => {
|
|
49
|
+
'worklet';
|
|
50
|
+
|
|
51
|
+
if (finished) {
|
|
52
|
+
internalProgress.value = target;
|
|
53
|
+
pillJumpActive.value = false;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
internalProgress.value = withTiming(target, {
|
|
59
|
+
duration: variant === 'dot' ? duration : pageIndicatorPageJumpDuration(from, target),
|
|
60
|
+
easing: Easing.bezier(0.33, 0, 0.15, 1)
|
|
61
|
+
});
|
|
62
|
+
}, [count, duration, internalProgress, page, pillJumpActive, pillJumpFrom, pillJumpT, pillJumpTo, variant]);
|
|
63
|
+
return {
|
|
64
|
+
progress: progress ?? internalProgress,
|
|
65
|
+
pillJump
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=use-page-indicator-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","cancelAnimation","Easing","useSharedValue","withTiming","PAGE_INDICATOR_SINGLE_PAGE_DURATION","pageIndicatorPageJumpDistance","pageIndicatorPageJumpDuration","clampPageIndex","page","count","Math","min","max","usePageIndicatorProgress","progress","variant","duration","internalProgress","undefined","pillJumpActive","pillJumpFrom","pillJumpTo","pillJumpT","pillJump","active","from","to","t","target","value","distance","jumpDuration","easing","bezier","finished"],"sourceRoot":"../../../../../src","sources":["components/page-indicator/hooks/use-page-indicator-progress.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAG1C,SACEC,eAAe,EACfC,MAAM,EAC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RC,gBAAgB,EAChBT,IAAI,EACJW,cAAc,EACdC,YAAY,EACZE,SAAS,EACTD,UAAU,EACVN,OAAO,CACR,CAAC;EAEF,OAAO;IACLD,QAAQ,EAAEA,QAAQ,IAAIG,gBAAgB;IACtCM;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DotIndicator","PageIndicator","PillIndicator","DEFAULT_PAGE_INDICATOR_MAX_VISIBLE","PAGE_INDICATOR_SINGLE_PAGE_DURATION"],"sourceRoot":"../../../../src","sources":["components/page-indicator/index.ts"],"mappings":";;AAQA,SAASA,YAAY,EAAEC,aAAa,EAAEC,aAAa,QAAQ,oBAAiB;AAC5E,SACEC,kCAAkC,EAClCC,mCAAmC,QAC9B,YAAS","ignoreList":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Duration for a single-page `current` transition. */
|
|
4
|
+
export const PAGE_INDICATOR_SINGLE_PAGE_DURATION = 600;
|
|
5
|
+
|
|
6
|
+
/** Extra duration per additional page when jumping more than one step. */
|
|
7
|
+
export const PAGE_INDICATOR_MULTI_PAGE_DURATION_STEP = 100;
|
|
8
|
+
|
|
9
|
+
/** Upper bound for multi-page `current` transitions. */
|
|
10
|
+
export const PAGE_INDICATOR_MULTI_PAGE_DURATION_MAX = 600;
|
|
11
|
+
|
|
12
|
+
/** Default max dots visible before scrolling and edge scaling kick in. */
|
|
13
|
+
export const DEFAULT_PAGE_INDICATOR_MAX_VISIBLE = 5;
|
|
14
|
+
const EDGE_OUTWARD_SCALE = [1, 0.9, 0.9, 0.65, 0.5];
|
|
15
|
+
const CENTERED_SCALE = [1, 0.9, 0.65, 0.5];
|
|
16
|
+
const WINDOW_TAIL_SCALE = 0.5;
|
|
17
|
+
|
|
18
|
+
/** Absolute page delta between two indices. */
|
|
19
|
+
export function pageIndicatorPageJumpDistance(from, to) {
|
|
20
|
+
return Math.abs(to - from);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Scales transition time for discrete `current` changes. Single-step jumps stay
|
|
25
|
+
* snappy; longer jumps get more time (capped) so the pill does not blur
|
|
26
|
+
* through intermediate dots.
|
|
27
|
+
*/
|
|
28
|
+
export function pageIndicatorPageJumpDuration(from, to) {
|
|
29
|
+
const distance = pageIndicatorPageJumpDistance(from, to);
|
|
30
|
+
if (distance <= 1) return PAGE_INDICATOR_SINGLE_PAGE_DURATION;
|
|
31
|
+
return Math.min(PAGE_INDICATOR_SINGLE_PAGE_DURATION + PAGE_INDICATOR_MULTI_PAGE_DURATION_STEP * (distance - 1), PAGE_INDICATOR_MULTI_PAGE_DURATION_MAX);
|
|
32
|
+
}
|
|
33
|
+
export function isPageIndicatorSharedValue(value) {
|
|
34
|
+
return typeof value === 'object' && value !== null && 'value' in value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Transform style for overflow track scrolling along the main axis. */
|
|
38
|
+
export function pageIndicatorAxisTranslateStyle(vertical, translate) {
|
|
39
|
+
'worklet';
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
transform: vertical ? [{
|
|
43
|
+
translateY: translate
|
|
44
|
+
}] : [{
|
|
45
|
+
translateX: translate
|
|
46
|
+
}]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Clips an overflowing track to the visible viewport along the main axis. */
|
|
51
|
+
export function pageIndicatorViewportClipStyle(vertical, viewportMainSize, crossSize) {
|
|
52
|
+
if (vertical) {
|
|
53
|
+
return {
|
|
54
|
+
height: viewportMainSize,
|
|
55
|
+
...(crossSize !== undefined ? {
|
|
56
|
+
width: crossSize
|
|
57
|
+
} : {}),
|
|
58
|
+
overflow: 'hidden'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
width: viewportMainSize,
|
|
63
|
+
...(crossSize !== undefined ? {
|
|
64
|
+
height: crossSize
|
|
65
|
+
} : {}),
|
|
66
|
+
overflow: 'hidden'
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function scaleCurveValue(curve, distance, tailScale) {
|
|
70
|
+
'worklet';
|
|
71
|
+
|
|
72
|
+
if (distance < curve.length) return curve[distance] ?? tailScale;
|
|
73
|
+
return tailScale;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Scale for a slot inside the window given the active slot. */
|
|
77
|
+
export function pageIndicatorWindowSlotScale(positionInWindow, activeSlot, maxVisible) {
|
|
78
|
+
'worklet';
|
|
79
|
+
|
|
80
|
+
if (positionInWindow === activeSlot) return 1;
|
|
81
|
+
const dist = Math.abs(positionInWindow - activeSlot);
|
|
82
|
+
if (activeSlot === 0 || activeSlot === maxVisible - 1) {
|
|
83
|
+
return scaleCurveValue(EDGE_OUTWARD_SCALE, dist, WINDOW_TAIL_SCALE);
|
|
84
|
+
}
|
|
85
|
+
const centerSlot = Math.floor((maxVisible - 1) / 2);
|
|
86
|
+
if (activeSlot === centerSlot) {
|
|
87
|
+
return scaleCurveValue(CENTERED_SCALE, dist, WINDOW_TAIL_SCALE);
|
|
88
|
+
}
|
|
89
|
+
if (positionInWindow < activeSlot) {
|
|
90
|
+
if (activeSlot <= 1) {
|
|
91
|
+
return scaleCurveValue(EDGE_OUTWARD_SCALE, dist, WINDOW_TAIL_SCALE);
|
|
92
|
+
}
|
|
93
|
+
return scaleCurveValue(CENTERED_SCALE, dist, WINDOW_TAIL_SCALE);
|
|
94
|
+
}
|
|
95
|
+
if (activeSlot >= maxVisible - 2) {
|
|
96
|
+
return scaleCurveValue(EDGE_OUTWARD_SCALE, dist, WINDOW_TAIL_SCALE);
|
|
97
|
+
}
|
|
98
|
+
return scaleCurveValue(CENTERED_SCALE, dist, WINDOW_TAIL_SCALE);
|
|
99
|
+
}
|
|
100
|
+
export function pageIndicatorTrackMainSize(count, slot, dotSize, activeMainSize = dotSize) {
|
|
101
|
+
return Math.max(dotSize, (count - 1) * slot + activeMainSize);
|
|
102
|
+
}
|
|
103
|
+
export function pageIndicatorViewportMainSize(count, slot, dotSize, maxVisible, activeMainSize = dotSize) {
|
|
104
|
+
const visible = Math.min(count, maxVisible);
|
|
105
|
+
return Math.max(dotSize, (visible - 1) * slot + activeMainSize);
|
|
106
|
+
}
|
|
107
|
+
export function computePageIndicatorWindowTranslate(count, progress, slot, dotSize, maxVisible, activeMainSize = dotSize) {
|
|
108
|
+
'worklet';
|
|
109
|
+
|
|
110
|
+
if (count <= maxVisible) return 0;
|
|
111
|
+
const viewportMainSize = Math.max(dotSize, (maxVisible - 1) * slot + activeMainSize);
|
|
112
|
+
const trackMainSize = Math.max(dotSize, (count - 1) * slot + activeMainSize);
|
|
113
|
+
const activeCenter = progress * slot + activeMainSize / 2;
|
|
114
|
+
const offset = Math.min(Math.max(activeCenter - viewportMainSize / 2, 0), trackMainSize - viewportMainSize);
|
|
115
|
+
return -offset;
|
|
116
|
+
}
|
|
117
|
+
export function pageIndicatorWindowScale(index, displayProgress, count, slot, dotSize, maxVisible, activeMainSize = dotSize) {
|
|
118
|
+
'worklet';
|
|
119
|
+
|
|
120
|
+
if (count <= maxVisible) return 1;
|
|
121
|
+
const translate = computePageIndicatorWindowTranslate(count, displayProgress, slot, dotSize, maxVisible, activeMainSize);
|
|
122
|
+
const visibleStart = -translate / slot;
|
|
123
|
+
const activeSlot = Math.min(Math.max(Math.round(displayProgress - visibleStart), 0), maxVisible - 1);
|
|
124
|
+
const positionInWindow = Math.min(Math.max(Math.round(index - visibleStart), 0), maxVisible - 1);
|
|
125
|
+
return pageIndicatorWindowSlotScale(positionInWindow, activeSlot, maxVisible);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PAGE_INDICATOR_SINGLE_PAGE_DURATION","PAGE_INDICATOR_MULTI_PAGE_DURATION_STEP","PAGE_INDICATOR_MULTI_PAGE_DURATION_MAX","DEFAULT_PAGE_INDICATOR_MAX_VISIBLE","EDGE_OUTWARD_SCALE","CENTERED_SCALE","WINDOW_TAIL_SCALE","pageIndicatorPageJumpDistance","from","to","Math","abs","pageIndicatorPageJumpDuration","distance","min","isPageIndicatorSharedValue","value","pageIndicatorAxisTranslateStyle","vertical","translate","transform","translateY","translateX","pageIndicatorViewportClipStyle","viewportMainSize","crossSize","height","undefined","width","overflow","scaleCurveValue","curve","tailScale","length","pageIndicatorWindowSlotScale","positionInWindow","activeSlot","maxVisible","dist","centerSlot","floor","pageIndicatorTrackMainSize","count","slot","dotSize","activeMainSize","max","pageIndicatorViewportMainSize","visible","computePageIndicatorWindowTranslate","progress","trackMainSize","activeCenter","offset","pageIndicatorWindowScale","index","displayProgress","visibleStart","round"],"sourceRoot":"../../../../src","sources":["components/page-indicator/utils.ts"],"mappings":";;AAIA;AACA,OAAO,MAAMA,mCAAmC,GAAG,GAAG;;AAEtD;AACA,OAAO,MAAMC,uCAAuC,GAAG,GAAG;;AAE1D;AACA,OAAO,MAAMC,sCAAsC,GAAG,GAAG;;AAEzD;AACA,OAAO,MAAMC,kCAAkC,GAAG,CAAC;AAEnD,MAAMC,kBAAkB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAU;AAC5D,MAAMC,cAAc,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAU;AACnD,MAAMC,iBAAiB,GAAG,GAAG;;AAE7B;AACA,OAAO,SAASC,6BAA6BA,CAC3CC,IAAY,EACZC,EAAU,EACF;EACR,OAAOC,IAAI,CAACC,GAAG,CAACF,EAAE,GAAGD,IAAI,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,6BAA6BA,CAC3CJ,IAAY,EACZC,EAAU,EACF;EACR,MAAMI,QAAQ,GAAGN,6BAA6B,CAACC,IAAI,EAAEC,EAAE,CAAC;EACxD,IAAII,QAAQ,IAAI,CAAC,EAAE,OAAO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ACfb,IAAI,EACJC,OAAO,EACPP,UAAU,EACVQ,cACF,CAAC;EACD,MAAMY,YAAY,GAAG,CAACtC,SAAS,GAAGwB,IAAI;EACtC,MAAMP,UAAU,GAAG1B,IAAI,CAACI,GAAG,CACzBJ,IAAI,CAACoC,GAAG,CAACpC,IAAI,CAACgD,KAAK,CAACF,eAAe,GAAGC,YAAY,CAAC,EAAE,CAAC,CAAC,EACvDpB,UAAU,GAAG,CACf,CAAC;EACD,MAAMF,gBAAgB,GAAGzB,IAAI,CAACI,GAAG,CAC/BJ,IAAI,CAACoC,GAAG,CAACpC,IAAI,CAACgD,KAAK,CAACH,KAAK,GAAGE,YAAY,CAAC,EAAE,CAAC,CAAC,EAC7CpB,UAAU,GAAG,CACf,CAAC;EAED,OAAOH,4BAA4B,CAACC,gBAAgB,EAAEC,UAAU,EAAEC,UAAU,CAAC;AAC/E","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
|
|
4
|
+
import { pageIndicatorWindowScale } from "../../utils.js";
|
|
5
|
+
import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from "./utils.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export function InactiveDot({
|
|
8
|
+
color,
|
|
9
|
+
count,
|
|
10
|
+
index,
|
|
11
|
+
maxVisible,
|
|
12
|
+
opacity,
|
|
13
|
+
overflows,
|
|
14
|
+
progress,
|
|
15
|
+
vertical
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
dotSize,
|
|
19
|
+
slot,
|
|
20
|
+
crossSize
|
|
21
|
+
} = DOT_INDICATOR_GEOMETRY;
|
|
22
|
+
const crossOffset = (crossSize - dotSize) / 2;
|
|
23
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
24
|
+
const center = pageIndicatorDotCenter(index, slot, dotSize);
|
|
25
|
+
const windowScale = overflows ? pageIndicatorWindowScale(index, progress.value, count, slot, dotSize, maxVisible) : 1;
|
|
26
|
+
return {
|
|
27
|
+
...(vertical ? {
|
|
28
|
+
top: center - dotSize / 2,
|
|
29
|
+
left: crossOffset
|
|
30
|
+
} : {
|
|
31
|
+
left: center - dotSize / 2,
|
|
32
|
+
top: crossOffset
|
|
33
|
+
}),
|
|
34
|
+
transform: [{
|
|
35
|
+
scale: windowScale
|
|
36
|
+
}]
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
40
|
+
style: [{
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
width: dotSize,
|
|
43
|
+
height: dotSize,
|
|
44
|
+
borderRadius: 999,
|
|
45
|
+
backgroundColor: color,
|
|
46
|
+
opacity
|
|
47
|
+
}, animatedStyle]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=InactiveDot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Animated","useAnimatedStyle","pageIndicatorWindowScale","DOT_INDICATOR_GEOMETRY","pageIndicatorDotCenter","jsx","_jsx","InactiveDot","color","count","index","maxVisible","opacity","overflows","progress","vertical","dotSize","slot","crossSize","crossOffset","animatedStyle","center","windowScale","value","top","left","transform","scale","View","style","position","width","height","borderRadius","backgroundColor"],"sourceRoot":"../../../../../../src","sources":["components/page-indicator/variants/DotIndicator/InactiveDot.tsx"],"mappings":";;AAAA,OAAOA,QAAQ,IAEbC,gBAAgB,QACX,yBAAyB;AAEhC,SAASC,wBAAwB,QAAQ,gBAAa;AAEtD,SAASC,sBAAsB,EAAEC,sBAAsB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAazE,OAAO,SAASC,WAAWA,CAAC;EAC1BC,KAAK;EACLC,KAAK;EACLC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPC,SAAS;EACTC,QAAQ;EACRC;AACgB,CAAC,EAAE;EACnB,MAAM;IAAEC,OAAO;IAAEC,IAAI;IAAEC;EAAU,CAAC,GAAGf,sBAAsB;EAC3D,MAAMgB,WAAW,GAAG,CAACD,SAAS,GAAGF,OAAO,IAAI,CAAC;EAE7C,MAAMI,aAAa,GAAGnB,gBAAgB,CAAC,MAAM;IAC3C,MAAMoB,MAAM,GAAGjB,sBAAsB,CAACM,KAAK,EAAEO,IAAI,EAAED,OAAO,CAAC;IAC3D,MAAMM,WAAW,GAAGT,SAAS,GACzBX,wBAAwB,CACtBQ,KAAK,EACLI,QAAQ,CAACS,KAAK,EACdd,KAAK,EACLQ,IAAI,EACJD,OAAO,EACPL,UACF,CAAC,GACD,CAAC;IAEL,OAAO;MACL,IAAII,QAAQ,GACR;QAAES,GAAG,EAAEH,MAAM,GAAGL,OAAO,GAAG,CAAC;QAAES,IAAI,EAAEN;MAAY,CAAC,GAChD;QAAEM,IAAI,EAAEJ,MAAM,GAAGL,OAAO,GAAG,CAAC;QAAEQ,GAAG,EAAEL;MAAY,CAAC,CAAC;MACrDO,SAAS,EAAE,CAAC;QAAEC,KAAK,EAAEL;MAAY,CAAC;IACpC,CAAC;EACH,CAAC,CAAC;EAEF,oBACEhB,IAAA,CAACN,QAAQ,CAAC4B,IAAI;IACZC,KAAK,EAAE,CACL;MACEC,QAAQ,EAAE,UAAU;MACpBC,KAAK,EAAEf,OAAO;MACdgB,MAAM,EAAEhB,OAAO;MACfiB,YAAY,EAAE,GAAG;MACjBC,eAAe,EAAE1B,KAAK;MACtBI;IACF,CAAC,EACDQ,aAAa;EACb,CACH,CAAC;AAEN","ignoreList":[]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import Animated, { Extrapolation, interpolate, useAnimatedProps, useAnimatedStyle, useFrameCallback, useSharedValue } from 'react-native-reanimated';
|
|
5
|
+
import Svg, { Circle } from 'react-native-svg';
|
|
6
|
+
import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from "./utils.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const ORBIT_ARCS = [{
|
|
9
|
+
id: 'arc-1',
|
|
10
|
+
arcDegrees: 120,
|
|
11
|
+
duration: 800,
|
|
12
|
+
delay: 0
|
|
13
|
+
}, {
|
|
14
|
+
id: 'arc-2',
|
|
15
|
+
arcDegrees: 60,
|
|
16
|
+
duration: 1200,
|
|
17
|
+
delay: 50
|
|
18
|
+
}, {
|
|
19
|
+
id: 'arc-3',
|
|
20
|
+
arcDegrees: 30,
|
|
21
|
+
duration: 1600,
|
|
22
|
+
delay: 200
|
|
23
|
+
}];
|
|
24
|
+
const ORBIT_LOOP_DURATION = Math.max(...ORBIT_ARCS.map(arc => arc.delay + arc.duration));
|
|
25
|
+
const ORBIT_SETTLE_THRESHOLD = 0.04;
|
|
26
|
+
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
27
|
+
function computeSweepArcState(clock, delay, duration, arcDegrees) {
|
|
28
|
+
'worklet';
|
|
29
|
+
|
|
30
|
+
const elapsed = clock * ORBIT_LOOP_DURATION;
|
|
31
|
+
const localProgress = Math.min(Math.max((elapsed - delay) / duration, 0), 1);
|
|
32
|
+
const leadTravel = 360 + arcDegrees;
|
|
33
|
+
const lead = leadTravel * localProgress;
|
|
34
|
+
const tailVisible = Math.min(Math.max(lead - arcDegrees, 0), 360);
|
|
35
|
+
const headVisible = Math.min(Math.max(lead, 0), 360);
|
|
36
|
+
const visibleDegrees = Math.max(0, headVisible - tailVisible);
|
|
37
|
+
return {
|
|
38
|
+
tailVisible,
|
|
39
|
+
visibleDegrees
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function SweepArc({
|
|
43
|
+
color,
|
|
44
|
+
arcDegrees,
|
|
45
|
+
duration,
|
|
46
|
+
delay,
|
|
47
|
+
clock
|
|
48
|
+
}) {
|
|
49
|
+
const {
|
|
50
|
+
ringSize,
|
|
51
|
+
ringStroke,
|
|
52
|
+
ringRadius,
|
|
53
|
+
ringCircumference
|
|
54
|
+
} = DOT_INDICATOR_GEOMETRY;
|
|
55
|
+
const containerStyle = useAnimatedStyle(() => {
|
|
56
|
+
const {
|
|
57
|
+
tailVisible,
|
|
58
|
+
visibleDegrees
|
|
59
|
+
} = computeSweepArcState(clock.value, delay, duration, arcDegrees);
|
|
60
|
+
return {
|
|
61
|
+
opacity: visibleDegrees > 0.01 ? 1 : 0,
|
|
62
|
+
transform: [{
|
|
63
|
+
rotate: `${90 + tailVisible}deg`
|
|
64
|
+
}]
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const animatedProps = useAnimatedProps(() => {
|
|
68
|
+
const {
|
|
69
|
+
visibleDegrees
|
|
70
|
+
} = computeSweepArcState(clock.value, delay, duration, arcDegrees);
|
|
71
|
+
const dash = ringCircumference * visibleDegrees / 360;
|
|
72
|
+
return {
|
|
73
|
+
strokeDasharray: [dash, ringCircumference]
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
77
|
+
pointerEvents: "none",
|
|
78
|
+
style: [{
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
width: ringSize,
|
|
81
|
+
height: ringSize
|
|
82
|
+
}, containerStyle],
|
|
83
|
+
children: /*#__PURE__*/_jsx(Svg, {
|
|
84
|
+
width: ringSize,
|
|
85
|
+
height: ringSize,
|
|
86
|
+
children: /*#__PURE__*/_jsx(AnimatedCircle, {
|
|
87
|
+
cx: ringSize / 2,
|
|
88
|
+
cy: ringSize / 2,
|
|
89
|
+
r: ringRadius,
|
|
90
|
+
stroke: color,
|
|
91
|
+
strokeWidth: ringStroke,
|
|
92
|
+
strokeLinecap: "round",
|
|
93
|
+
fill: "none",
|
|
94
|
+
animatedProps: animatedProps
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export function LoadingOrbit({
|
|
100
|
+
color,
|
|
101
|
+
count,
|
|
102
|
+
loading,
|
|
103
|
+
progress,
|
|
104
|
+
vertical
|
|
105
|
+
}) {
|
|
106
|
+
const {
|
|
107
|
+
dotSize,
|
|
108
|
+
slot,
|
|
109
|
+
crossSize,
|
|
110
|
+
ringSize
|
|
111
|
+
} = DOT_INDICATOR_GEOMETRY;
|
|
112
|
+
const crossOffset = (crossSize - ringSize) / 2;
|
|
113
|
+
const clock = useSharedValue(0);
|
|
114
|
+
const loadingActive = useSharedValue(loading);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
loadingActive.value = loading;
|
|
117
|
+
}, [loading, loadingActive]);
|
|
118
|
+
const frameCallback = useFrameCallback(frame => {
|
|
119
|
+
if (!loadingActive.value) return;
|
|
120
|
+
const activeIndex = Math.min(Math.max(Math.round(progress.value), 0), count - 1);
|
|
121
|
+
const settleDistance = Math.abs(progress.value - activeIndex);
|
|
122
|
+
if (settleDistance >= ORBIT_SETTLE_THRESHOLD) return;
|
|
123
|
+
const dt = frame.timeSincePreviousFrame ?? 0;
|
|
124
|
+
clock.value = (clock.value + dt / ORBIT_LOOP_DURATION) % 1;
|
|
125
|
+
});
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
frameCallback.setActive(loading);
|
|
128
|
+
}, [frameCallback, loading]);
|
|
129
|
+
const containerStyle = useAnimatedStyle(() => {
|
|
130
|
+
const activeIndex = Math.min(Math.max(Math.round(progress.value), 0), count - 1);
|
|
131
|
+
const settleDistance = Math.abs(progress.value - activeIndex);
|
|
132
|
+
const mainOffset = pageIndicatorDotCenter(activeIndex, slot, dotSize) - ringSize / 2;
|
|
133
|
+
return {
|
|
134
|
+
...(vertical ? {
|
|
135
|
+
top: mainOffset
|
|
136
|
+
} : {
|
|
137
|
+
left: mainOffset
|
|
138
|
+
}),
|
|
139
|
+
opacity: loadingActive.value ? interpolate(settleDistance, [0, 0.12], [1, 0], Extrapolation.CLAMP) : 0
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
143
|
+
pointerEvents: "none",
|
|
144
|
+
style: [{
|
|
145
|
+
position: 'absolute',
|
|
146
|
+
...(vertical ? {
|
|
147
|
+
left: crossOffset,
|
|
148
|
+
width: ringSize,
|
|
149
|
+
height: ringSize
|
|
150
|
+
} : {
|
|
151
|
+
top: crossOffset,
|
|
152
|
+
width: ringSize,
|
|
153
|
+
height: ringSize
|
|
154
|
+
})
|
|
155
|
+
}, containerStyle],
|
|
156
|
+
children: ORBIT_ARCS.map(arc => /*#__PURE__*/_jsx(SweepArc, {
|
|
157
|
+
color: color,
|
|
158
|
+
arcDegrees: arc.arcDegrees,
|
|
159
|
+
duration: arc.duration,
|
|
160
|
+
delay: arc.delay,
|
|
161
|
+
clock: clock
|
|
162
|
+
}, arc.id))
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=LoadingOrbit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","Animated","Extrapolation","interpolate","useAnimatedProps","useAnimatedStyle","useFrameCallback","useSharedValue","Svg","Circle","DOT_INDICATOR_GEOMETRY","pageIndicatorDotCenter","jsx","_jsx","ORBIT_ARCS","id","arcDegrees","duration","delay","ORBIT_LOOP_DURATION","Math","max","map","arc","ORBIT_SETTLE_THRESHOLD","AnimatedCircle","createAnimatedComponent","computeSweepArcState","clock","elapsed","localProgress","min","leadTravel","lead","tailVisible","headVisible","visibleDegrees","SweepArc","color","ringSize","ringStroke","ringRadius","ringCircumference","containerStyle","value","opacity","transform","rotate","animatedProps","dash","strokeDasharray","View","pointerEvents","style","position","width","height","children","cx","cy","r","stroke","strokeWidth","strokeLinecap","fill","LoadingOrbit","count","loading","progress","vertical","dotSize","slot","crossSize","crossOffset","loadingActive","frameCallback","frame","activeIndex","round","settleDistance","abs","dt","timeSincePreviousFrame","setActive","mainOffset","top","left","CLAMP"],"sourceRoot":"../../../../../../src","sources":["components/page-indicator/variants/DotIndic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I8B,QAAQ,GAAG;QAAEgB,GAAG,EAAED;MAAW,CAAC,GAAG;QAAEE,IAAI,EAAEF;MAAW,CAAC,CAAC;MAC1DvC,OAAO,EAAE6B,aAAa,CAAC9B,KAAK,GACxBzC,WAAW,CAAC4E,cAAc,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE7E,aAAa,CAACqF,KAAK,CAAC,GACnE;IACN,CAAC;EACH,CAAC,CAAC;EAEF,oBACE1E,IAAA,CAACZ,QAAQ,CAACkD,IAAI;IACZC,aAAa,EAAC,MAAM;IACpBC,KAAK,EAAE,CACL;MACEC,QAAQ,EAAE,UAAU;MACpB,IAAIe,QAAQ,GACR;QAAEiB,IAAI,EAAEb,WAAW;QAAElB,KAAK,EAAEhB,QAAQ;QAAEiB,MAAM,EAAEjB;MAAS,CAAC,GACxD;QAAE8C,GAAG,EAAEZ,WAAW;QAAElB,KAAK,EAAEhB,QAAQ;QAAEiB,MAAM,EAAEjB;MAAS,CAAC;IAC7D,CAAC,EACDI,cAAc,CACd;IAAAc,QAAA,EAED3C,UAAU,CAACQ,GAAG,CAAEC,GAAG,iBAClBV,IAAA,CAACwB,QAAQ;MAEPC,KAAK,EAAEA,KAAM;MACbtB,UAAU,EAAEO,GAAG,CAACP,UAAW;MAC3BC,QAAQ,EAAEM,GAAG,CAACN,QAAS;MACvBC,KAAK,EAAEK,GAAG,CAACL,KAAM;MACjBU,KAAK,EAAEA;IAAM,GALRL,GAAG,CAACR,EAMV,CACF;EAAC,CACW,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated';
|
|
4
|
+
import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from "./utils.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* A single pill on top of the resting dots. As `progress` moves between pages
|
|
8
|
+
* its leading edge advances first (stretch), then its trailing edge catches up
|
|
9
|
+
* (collapse).
|
|
10
|
+
*/
|
|
11
|
+
export function TravelingPill({
|
|
12
|
+
activeColor,
|
|
13
|
+
count,
|
|
14
|
+
progress,
|
|
15
|
+
vertical
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
dotSize,
|
|
19
|
+
slot,
|
|
20
|
+
crossSize
|
|
21
|
+
} = DOT_INDICATOR_GEOMETRY;
|
|
22
|
+
const crossOffset = (crossSize - dotSize) / 2;
|
|
23
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
24
|
+
const maxSegment = Math.max(0, count - 2);
|
|
25
|
+
const segment = Math.min(Math.max(Math.floor(progress.value), 0), maxSegment);
|
|
26
|
+
const frac = progress.value - segment;
|
|
27
|
+
const from = pageIndicatorDotCenter(segment, slot, dotSize);
|
|
28
|
+
const to = pageIndicatorDotCenter(segment + 1, slot, dotSize);
|
|
29
|
+
const leading = interpolate(frac, [0, 0.5, 1], [from - dotSize / 2, from - dotSize / 2, to - dotSize / 2], Extrapolation.CLAMP);
|
|
30
|
+
const trailing = interpolate(frac, [0, 0.5, 1], [from + dotSize / 2, to + dotSize / 2, to + dotSize / 2], Extrapolation.CLAMP);
|
|
31
|
+
const mainSize = Math.max(dotSize, trailing - leading);
|
|
32
|
+
if (vertical) {
|
|
33
|
+
return {
|
|
34
|
+
top: leading,
|
|
35
|
+
height: mainSize
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
left: leading,
|
|
40
|
+
width: mainSize
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
44
|
+
pointerEvents: "none",
|
|
45
|
+
style: [{
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
...(vertical ? {
|
|
48
|
+
left: crossOffset,
|
|
49
|
+
width: dotSize
|
|
50
|
+
} : {
|
|
51
|
+
top: crossOffset,
|
|
52
|
+
height: dotSize
|
|
53
|
+
}),
|
|
54
|
+
borderRadius: 999,
|
|
55
|
+
backgroundColor: activeColor,
|
|
56
|
+
zIndex: 2
|
|
57
|
+
}, animatedStyle]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=TravelingPill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Animated","Extrapolation","interpolate","useAnimatedStyle","DOT_INDICATOR_GEOMETRY","pageIndicatorDotCenter","jsx","_jsx","TravelingPill","activeColor","count","progress","vertical","dotSize","slot","crossSize","crossOffset","animatedStyle","maxSegment","Math","max","segment","min","floor","value","frac","from","to","leading","CLAMP","trailing","mainSize","top","height","left","width","View","pointerEvents","style","position","borderRadius","backgroundColor","zIndex"],"sourceRoot":"../../../../../../src","sources":["components/page-indicator/variants/DotIndicator/TravelingPill.tsx"],"mappings":";;AAAA,OAAOA,QAAQ,IACbC,aAAa,EACbC,WAAW,EAEXC,gBAAgB,QACX,yBAAyB;AAEhC,SAASC,sBAAsB,EAAEC,sBAAsB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASzE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAC;EAC5BC,WAAW;EACXC,KAAK;EACLC,QAAQ;EACRC;AACkB,CAAC,EAAE;EACrB,MAAM;IAAEC,OAAO;IAAEC,IAAI;IAAEC;EAAU,CAAC,GAAGX,sBAAsB;EAC3D,MAAMY,WAAW,GAAG,CAACD,SAAS,GAAGF,OAAO,IAAI,CAAC;EAE7C,MAAMI,aAAa,GAAGd,gBAAgB,CAAC,MAAM;IAC3C,MAAMe,UAAU,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,KAAK,GAAG,CAAC,CAAC;IACzC,MAAMW,OAAO,GAAGF,IAAI,CAACG,GAAG,CACtBH,IAAI,CAACC,GAAG,CAACD,IAAI,CAACI,KAAK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pB,IAAI3B,QAAQ,GACR;QAAEsB,IAAI,EAAElB,WAAW;QAAEmB,KAAK,EAAEtB;MAAQ,CAAC,GACrC;QAAEmB,GAAG,EAAEhB,WAAW;QAAEiB,MAAM,EAAEpB;MAAQ,CAAC,CAAC;MAC1C2B,YAAY,EAAE,GAAG;MACjBC,eAAe,EAAEhC,WAAW;MAC5BiC,MAAM,EAAE;IACV,CAAC,EACDzB,aAAa;EACb,CACH,CAAC;AAEN","ignoreList":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
|
|
5
|
+
import { usePageIndicatorCore } from "../../hooks/use-page-indicator-core.js";
|
|
6
|
+
import { PageIndicatorRoot } from "../../PageIndicatorRoot.js";
|
|
7
|
+
import { computePageIndicatorWindowTranslate, DEFAULT_PAGE_INDICATOR_MAX_VISIBLE, PAGE_INDICATOR_SINGLE_PAGE_DURATION, pageIndicatorAxisTranslateStyle, pageIndicatorTrackMainSize, pageIndicatorViewportMainSize } from "../../utils.js";
|
|
8
|
+
import { InactiveDot } from "./InactiveDot.js";
|
|
9
|
+
import { LoadingOrbit } from "./LoadingOrbit.js";
|
|
10
|
+
import { TravelingPill } from "./TravelingPill.js";
|
|
11
|
+
import { DOT_INDICATOR_GEOMETRY } from "./utils.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export function DotIndicator({
|
|
14
|
+
count,
|
|
15
|
+
current = 0,
|
|
16
|
+
duration = PAGE_INDICATOR_SINGLE_PAGE_DURATION,
|
|
17
|
+
activeColor,
|
|
18
|
+
inactiveColor,
|
|
19
|
+
loadingColor,
|
|
20
|
+
loading = false,
|
|
21
|
+
vertical = false,
|
|
22
|
+
maxVisible = DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
|
|
23
|
+
style
|
|
24
|
+
}) {
|
|
25
|
+
const {
|
|
26
|
+
colors,
|
|
27
|
+
progress
|
|
28
|
+
} = usePageIndicatorCore(count, current, 'dot', duration, {
|
|
29
|
+
activeColor,
|
|
30
|
+
inactiveColor,
|
|
31
|
+
loadingColor
|
|
32
|
+
});
|
|
33
|
+
const {
|
|
34
|
+
dotSize,
|
|
35
|
+
slot,
|
|
36
|
+
crossSize,
|
|
37
|
+
inactiveOpacity
|
|
38
|
+
} = DOT_INDICATOR_GEOMETRY;
|
|
39
|
+
const viewportMainSize = pageIndicatorViewportMainSize(count, slot, dotSize, maxVisible);
|
|
40
|
+
const fullTrackMainSize = pageIndicatorTrackMainSize(count, slot, dotSize);
|
|
41
|
+
const overflows = count > maxVisible;
|
|
42
|
+
const indices = useMemo(() => Array.from({
|
|
43
|
+
length: count
|
|
44
|
+
}, (_, index) => index), [count]);
|
|
45
|
+
const trackStyle = useAnimatedStyle(() => {
|
|
46
|
+
const translate = computePageIndicatorWindowTranslate(count, progress.value, slot, dotSize, maxVisible);
|
|
47
|
+
return pageIndicatorAxisTranslateStyle(vertical, translate);
|
|
48
|
+
});
|
|
49
|
+
return /*#__PURE__*/_jsx(PageIndicatorRoot, {
|
|
50
|
+
crossSize: crossSize,
|
|
51
|
+
overflows: overflows,
|
|
52
|
+
style: style,
|
|
53
|
+
vertical: vertical,
|
|
54
|
+
viewportMainSize: viewportMainSize,
|
|
55
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
56
|
+
style: [vertical ? {
|
|
57
|
+
width: crossSize,
|
|
58
|
+
height: fullTrackMainSize
|
|
59
|
+
} : {
|
|
60
|
+
width: fullTrackMainSize,
|
|
61
|
+
height: crossSize
|
|
62
|
+
}, overflows ? trackStyle : null],
|
|
63
|
+
children: [indices.map(index => /*#__PURE__*/_jsx(InactiveDot, {
|
|
64
|
+
color: colors.inactiveColor,
|
|
65
|
+
count: count,
|
|
66
|
+
index: index,
|
|
67
|
+
maxVisible: maxVisible,
|
|
68
|
+
opacity: inactiveOpacity,
|
|
69
|
+
overflows: overflows,
|
|
70
|
+
progress: progress,
|
|
71
|
+
vertical: vertical
|
|
72
|
+
}, index)), /*#__PURE__*/_jsx(TravelingPill, {
|
|
73
|
+
activeColor: colors.activeColor,
|
|
74
|
+
count: count,
|
|
75
|
+
progress: progress,
|
|
76
|
+
vertical: vertical
|
|
77
|
+
}), /*#__PURE__*/_jsx(LoadingOrbit, {
|
|
78
|
+
color: colors.loadingColor,
|
|
79
|
+
count: count,
|
|
80
|
+
loading: loading,
|
|
81
|
+
progress: progress,
|
|
82
|
+
vertical: vertical
|
|
83
|
+
})]
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","Animated","useAnimatedStyle","usePageIndicatorCore","PageIndicatorRoot","computePageIndicatorWindowTranslate","DEFAULT_PAGE_INDICATOR_MAX_VISIBLE","PAGE_INDICATOR_SINGLE_PAGE_DURATION","pageIndicatorAxisTranslateStyle","pageIndicatorTrackMainSize","pageIndicatorViewportMainSize","InactiveDot","LoadingOrbit","TravelingPill","DOT_INDICATOR_GEOMETRY","jsx","_jsx","jsxs","_jsxs","DotIndicator","count","current","duration","activeColor","inactiveColor","loadingColor","loading","vertical","maxVisible","style","colors","progress","dotSize","slot","crossSize","inactiveOpacity","viewportMainSize","fullTrackMainSize","overflows","indices","Array","from","length","_","index","trackStyle","translate","value","children","View","width","height","map","color","opacity"],"sourceRoot":"../../../../../../src","sources":["components/page-indicator/variants/DotIndicator/index.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAI/B,OAAOC,QAAQ,IAAIC,gBAAgB,QAAQ,yBAAyB;AAIpE,SAASC,oBAAoB,QAAQ,wCAAqC;AAC1E,SAASC,iBAAiB,QAAQ,4BAAyB;AAC3D,SACEC,mCAAmC,EACnCC,kCAAkC,EAClCC,mCAAmC,EACnCC,+BAA+B,EAC/BC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ACjBK,QAAQ,EAAEA,QAAS;QACnBJ,QAAQ,EAAEA;MAAS,CACpB,CAAC;IAAA,CACW;EAAC,CACC,CAAC;AAExB","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Fixed geometry for the dot indicator variant. */
|
|
4
|
+
const DOT_SIZE = 8;
|
|
5
|
+
const GAP = 8;
|
|
6
|
+
const RING_SIZE = 14;
|
|
7
|
+
const RING_STROKE = 1.5;
|
|
8
|
+
const RING_RADIUS = (RING_SIZE - RING_STROKE) / 2;
|
|
9
|
+
|
|
10
|
+
/** Precomputed geometry shared by DotIndicator sub-components. */
|
|
11
|
+
export const DOT_INDICATOR_GEOMETRY = {
|
|
12
|
+
dotSize: DOT_SIZE,
|
|
13
|
+
slot: DOT_SIZE + GAP,
|
|
14
|
+
crossSize: Math.max(RING_SIZE, DOT_SIZE),
|
|
15
|
+
ringSize: RING_SIZE,
|
|
16
|
+
ringStroke: RING_STROKE,
|
|
17
|
+
ringRadius: RING_RADIUS,
|
|
18
|
+
ringCircumference: 2 * Math.PI * RING_RADIUS,
|
|
19
|
+
inactiveOpacity: 0.42
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Main-axis center of dot `index` within the track. */
|
|
23
|
+
export function pageIndicatorDotCenter(index, slot, dotSize) {
|
|
24
|
+
'worklet';
|
|
25
|
+
|
|
26
|
+
return index * slot + dotSize / 2;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=utils.js.map
|