@retray-dev/ui-kit 6.2.0 → 9.0.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/COMPONENTS.md +997 -20
- package/EXAMPLES.md +250 -2
- package/README.md +21 -14
- package/dist/Accordion.d.mts +28 -0
- package/dist/Accordion.d.ts +28 -0
- package/dist/Accordion.js +392 -0
- package/dist/Accordion.mjs +7 -0
- package/dist/AlertBanner.d.mts +16 -0
- package/dist/AlertBanner.d.ts +16 -0
- package/dist/AlertBanner.js +250 -0
- package/dist/AlertBanner.mjs +6 -0
- package/dist/AppHeader.d.mts +40 -0
- package/dist/AppHeader.d.ts +40 -0
- package/dist/AppHeader.js +515 -0
- package/dist/AppHeader.mjs +10 -0
- package/dist/Avatar.d.mts +20 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +244 -0
- package/dist/Avatar.mjs +4 -0
- package/dist/Badge.d.mts +26 -0
- package/dist/Badge.d.ts +26 -0
- package/dist/Badge.js +257 -0
- package/dist/Badge.mjs +5 -0
- package/dist/Button.d.mts +30 -0
- package/dist/Button.d.ts +30 -0
- package/dist/Button.js +432 -0
- package/dist/Button.mjs +9 -0
- package/dist/ButtonGroup.d.mts +26 -0
- package/dist/ButtonGroup.d.ts +26 -0
- package/dist/ButtonGroup.js +52 -0
- package/dist/ButtonGroup.mjs +3 -0
- package/dist/Card.d.mts +39 -0
- package/dist/Card.d.ts +39 -0
- package/dist/Card.js +349 -0
- package/dist/Card.mjs +8 -0
- package/dist/CategoryStrip.d.mts +26 -0
- package/dist/CategoryStrip.d.ts +26 -0
- package/dist/CategoryStrip.js +453 -0
- package/dist/CategoryStrip.mjs +9 -0
- package/dist/Checkbox.d.mts +14 -0
- package/dist/Checkbox.d.ts +14 -0
- package/dist/Checkbox.js +336 -0
- package/dist/Checkbox.mjs +7 -0
- package/dist/Chip.d.mts +31 -0
- package/dist/Chip.d.ts +31 -0
- package/dist/Chip.js +403 -0
- package/dist/Chip.mjs +8 -0
- package/dist/ConfirmDialog.d.mts +15 -0
- package/dist/ConfirmDialog.d.ts +15 -0
- package/dist/ConfirmDialog.js +560 -0
- package/dist/ConfirmDialog.mjs +10 -0
- package/dist/CurrencyDisplay.d.mts +24 -0
- package/dist/CurrencyDisplay.d.ts +24 -0
- package/dist/CurrencyDisplay.js +189 -0
- package/dist/CurrencyDisplay.mjs +4 -0
- package/dist/CurrencyInput.d.mts +26 -0
- package/dist/CurrencyInput.d.ts +26 -0
- package/dist/CurrencyInput.js +408 -0
- package/dist/CurrencyInput.mjs +8 -0
- package/dist/DetailRow.d.mts +32 -0
- package/dist/DetailRow.d.ts +32 -0
- package/dist/DetailRow.js +275 -0
- package/dist/DetailRow.mjs +5 -0
- package/dist/EmptyState.d.mts +27 -0
- package/dist/EmptyState.d.ts +27 -0
- package/dist/EmptyState.js +523 -0
- package/dist/EmptyState.mjs +10 -0
- package/dist/ErrorBoundary.d.mts +42 -0
- package/dist/ErrorBoundary.d.ts +42 -0
- package/dist/ErrorBoundary.js +351 -0
- package/dist/ErrorBoundary.mjs +7 -0
- package/dist/Form.d.mts +52 -0
- package/dist/Form.d.ts +52 -0
- package/dist/Form.js +204 -0
- package/dist/Form.mjs +4 -0
- package/dist/HolographicCard.d.mts +55 -0
- package/dist/HolographicCard.d.ts +55 -0
- package/dist/HolographicCard.js +316 -0
- package/dist/HolographicCard.mjs +191 -0
- package/dist/IconButton.d.mts +27 -0
- package/dist/IconButton.d.ts +27 -0
- package/dist/IconButton.js +400 -0
- package/dist/IconButton.mjs +8 -0
- package/dist/ImageViewer.d.mts +23 -0
- package/dist/ImageViewer.d.ts +23 -0
- package/dist/ImageViewer.js +582 -0
- package/dist/ImageViewer.mjs +8 -0
- package/dist/Input.d.mts +23 -0
- package/dist/Input.d.ts +23 -0
- package/dist/Input.js +351 -0
- package/dist/Input.mjs +7 -0
- package/dist/LabelValue.d.mts +16 -0
- package/dist/LabelValue.d.ts +16 -0
- package/dist/LabelValue.js +225 -0
- package/dist/LabelValue.mjs +5 -0
- package/dist/ListGroup.d.mts +34 -0
- package/dist/ListGroup.d.ts +34 -0
- package/dist/ListGroup.js +217 -0
- package/dist/ListGroup.mjs +5 -0
- package/dist/ListItem.d.mts +64 -0
- package/dist/ListItem.d.ts +64 -0
- package/dist/ListItem.js +444 -0
- package/dist/ListItem.mjs +9 -0
- package/dist/MediaCard.d.mts +39 -0
- package/dist/MediaCard.d.ts +39 -0
- package/dist/MediaCard.js +475 -0
- package/dist/MediaCard.mjs +9 -0
- package/dist/MenuGroup.d.mts +34 -0
- package/dist/MenuGroup.d.ts +34 -0
- package/dist/MenuGroup.js +217 -0
- package/dist/MenuGroup.mjs +5 -0
- package/dist/MenuItem.d.mts +48 -0
- package/dist/MenuItem.d.ts +48 -0
- package/dist/MenuItem.js +415 -0
- package/dist/MenuItem.mjs +9 -0
- package/dist/MonthPicker.d.mts +28 -0
- package/dist/MonthPicker.d.ts +28 -0
- package/dist/MonthPicker.js +297 -0
- package/dist/MonthPicker.mjs +5 -0
- package/dist/PagerDots.d.mts +35 -0
- package/dist/PagerDots.d.ts +35 -0
- package/dist/PagerDots.js +392 -0
- package/dist/PagerDots.mjs +7 -0
- package/dist/Pressable.d.mts +34 -0
- package/dist/Pressable.d.ts +34 -0
- package/dist/Pressable.js +143 -0
- package/dist/Pressable.mjs +5 -0
- package/dist/PricingCard.d.mts +50 -0
- package/dist/PricingCard.d.ts +50 -0
- package/dist/PricingCard.js +636 -0
- package/dist/PricingCard.mjs +11 -0
- package/dist/Progress.d.mts +14 -0
- package/dist/Progress.d.ts +14 -0
- package/dist/Progress.js +191 -0
- package/dist/Progress.mjs +5 -0
- package/dist/RadioGroup.d.mts +19 -0
- package/dist/RadioGroup.d.ts +19 -0
- package/dist/RadioGroup.js +392 -0
- package/dist/RadioGroup.mjs +7 -0
- package/dist/RetrayProvider.d.mts +2 -0
- package/dist/RetrayProvider.d.ts +2 -0
- package/dist/RetrayProvider.js +214 -0
- package/dist/RetrayProvider.mjs +5 -0
- package/dist/Select.d.mts +22 -0
- package/dist/Select.d.ts +22 -0
- package/dist/Select.js +488 -0
- package/dist/Select.mjs +7 -0
- package/dist/SelectableGrid.d.mts +44 -0
- package/dist/SelectableGrid.d.ts +44 -0
- package/dist/SelectableGrid.js +448 -0
- package/dist/SelectableGrid.mjs +9 -0
- package/dist/Separator.d.mts +10 -0
- package/dist/Separator.d.ts +10 -0
- package/dist/Separator.js +156 -0
- package/dist/Separator.mjs +3 -0
- package/dist/Sheet.d.mts +93 -0
- package/dist/Sheet.d.ts +93 -0
- package/dist/Sheet.js +450 -0
- package/dist/Sheet.mjs +6 -0
- package/dist/Skeleton.d.mts +67 -0
- package/dist/Skeleton.d.ts +67 -0
- package/dist/Skeleton.js +266 -0
- package/dist/Skeleton.mjs +6 -0
- package/dist/Slider.d.mts +20 -0
- package/dist/Slider.d.ts +20 -0
- package/dist/Slider.js +279 -0
- package/dist/Slider.mjs +5 -0
- package/dist/Spinner.d.mts +12 -0
- package/dist/Spinner.d.ts +12 -0
- package/dist/Spinner.js +193 -0
- package/dist/Spinner.mjs +4 -0
- package/dist/Switch.d.mts +13 -0
- package/dist/Switch.d.ts +13 -0
- package/dist/Switch.js +311 -0
- package/dist/Switch.mjs +6 -0
- package/dist/TabBar.d.mts +42 -0
- package/dist/TabBar.d.ts +42 -0
- package/dist/TabBar.js +361 -0
- package/dist/TabBar.mjs +6 -0
- package/dist/Tabs.d.mts +27 -0
- package/dist/Tabs.d.ts +27 -0
- package/dist/Tabs.js +419 -0
- package/dist/Tabs.mjs +7 -0
- package/dist/Text.d.mts +12 -0
- package/dist/Text.d.ts +12 -0
- package/dist/Text.js +327 -0
- package/dist/Text.mjs +5 -0
- package/dist/Textarea.d.mts +16 -0
- package/dist/Textarea.d.ts +16 -0
- package/dist/Textarea.js +333 -0
- package/dist/Textarea.mjs +7 -0
- package/dist/Toast.d.mts +47 -0
- package/dist/Toast.d.ts +47 -0
- package/dist/Toast.js +185 -0
- package/dist/Toast.mjs +4 -0
- package/dist/Toggle.d.mts +36 -0
- package/dist/Toggle.d.ts +36 -0
- package/dist/Toggle.js +412 -0
- package/dist/Toggle.mjs +8 -0
- package/dist/VirtualList.d.mts +19 -0
- package/dist/VirtualList.d.ts +19 -0
- package/dist/VirtualList.js +38 -0
- package/dist/VirtualList.mjs +2 -0
- package/dist/chunk-26BCI223.mjs +14 -0
- package/dist/chunk-2CE3TQVY.mjs +11 -0
- package/dist/chunk-2TFTAWVJ.mjs +131 -0
- package/dist/chunk-2UYENBLV.mjs +49 -0
- package/dist/chunk-3BBOZ3OQ.mjs +41 -0
- package/dist/chunk-3DKJ2GIC.mjs +30 -0
- package/dist/chunk-3U4SSNWP.mjs +120 -0
- package/dist/chunk-4I7D47FH.mjs +139 -0
- package/dist/chunk-4K625MVM.mjs +142 -0
- package/dist/chunk-6OAZJ577.mjs +98 -0
- package/dist/chunk-6Q64UFIA.mjs +71 -0
- package/dist/chunk-756RAKE4.mjs +145 -0
- package/dist/chunk-7QHVVCB3.mjs +115 -0
- package/dist/chunk-A3A6KNQN.mjs +245 -0
- package/dist/chunk-A4MDAP7G.mjs +42 -0
- package/dist/chunk-AJ7ZDNBT.mjs +120 -0
- package/dist/chunk-AV4EMIRH.mjs +94 -0
- package/dist/chunk-AZJF2BLK.mjs +115 -0
- package/dist/chunk-BNP626TY.mjs +159 -0
- package/dist/chunk-BRKYVJVV.mjs +60 -0
- package/dist/chunk-DVK4G2GT.mjs +59 -0
- package/dist/chunk-EH745HE5.mjs +127 -0
- package/dist/chunk-EJ7ZPXOH.mjs +163 -0
- package/dist/chunk-GD6KXMG5.mjs +106 -0
- package/dist/chunk-GQYFLP3D.mjs +187 -0
- package/dist/chunk-ID72TK46.mjs +111 -0
- package/dist/chunk-IRRY3CRZ.mjs +82 -0
- package/dist/chunk-JB67UOB5.mjs +92 -0
- package/dist/chunk-JMOZEC77.mjs +90 -0
- package/dist/chunk-JT7HKXRB.mjs +114 -0
- package/dist/chunk-KIHCWCWL.mjs +124 -0
- package/dist/chunk-LXJIIOYQ.mjs +104 -0
- package/dist/chunk-M6ZXVBTK.mjs +64 -0
- package/dist/chunk-MAC465BB.mjs +61 -0
- package/dist/chunk-MBMXYJJV.mjs +36 -0
- package/dist/chunk-MLF3EZFW.mjs +119 -0
- package/dist/chunk-MX6HRKMI.mjs +29 -0
- package/dist/chunk-NA7PARID.mjs +147 -0
- package/dist/chunk-NC5ZTR2Y.mjs +32 -0
- package/dist/chunk-O3HA6TYM.mjs +139 -0
- package/dist/chunk-OB4JUQ3O.mjs +51 -0
- package/dist/chunk-PFZTM6D5.mjs +238 -0
- package/dist/chunk-QKH5ZOD5.mjs +97 -0
- package/dist/chunk-QY3X2UYR.mjs +191 -0
- package/dist/chunk-SOA2Z4RB.mjs +82 -0
- package/dist/chunk-SOYNZDVY.mjs +151 -0
- package/dist/chunk-T7XZ7H7Y.mjs +57 -0
- package/dist/chunk-TERDKCLE.mjs +74 -0
- package/dist/chunk-UREA2GYY.mjs +113 -0
- package/dist/chunk-VGTDN7SW.mjs +164 -0
- package/dist/chunk-VQ57HWPL.mjs +144 -0
- package/dist/chunk-WBOOUHSS.mjs +62 -0
- package/dist/chunk-WJLKJMKR.mjs +78 -0
- package/dist/chunk-X4G6APW6.mjs +134 -0
- package/dist/chunk-Y6FXYEAI.mjs +8 -0
- package/dist/chunk-YFZ3ELX5.mjs +16 -0
- package/dist/chunk-YNROWHQJ.mjs +46 -0
- package/dist/chunk-Z4BVUWW6.mjs +196 -0
- package/dist/chunk-ZJKGQMYH.mjs +131 -0
- package/dist/index-wt-orHUi.d.mts +85 -0
- package/dist/index-wt-orHUi.d.ts +85 -0
- package/dist/index.d.mts +149 -920
- package/dist/index.d.ts +149 -920
- package/dist/index.js +2560 -970
- package/dist/index.mjs +60 -3895
- package/package.json +55 -16
- package/src/assets/fonts/Sohne-Bold.otf +0 -0
- package/src/assets/fonts/Sohne-BoldItalic.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraBold.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraBoldItalic.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraLight.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraLightItalic.otf +0 -0
- package/src/assets/fonts/Sohne-Italic.otf +0 -0
- package/src/assets/fonts/Sohne-Light.otf +0 -0
- package/src/assets/fonts/Sohne-LightItalic.otf +0 -0
- package/src/assets/fonts/Sohne-Medium.otf +0 -0
- package/src/assets/fonts/Sohne-MediumItalic.otf +0 -0
- package/src/assets/fonts/Sohne-Regular.otf +0 -0
- package/src/assets/fonts/Sohne-SemiBold.otf +0 -0
- package/src/assets/fonts/Sohne-SemiBoldItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Bold.otf +0 -0
- package/src/assets/fonts/SohneMono-BoldItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraBold.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraBoldItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraLight.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraLightItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Italic.otf +0 -0
- package/src/assets/fonts/SohneMono-Light.otf +0 -0
- package/src/assets/fonts/SohneMono-LightItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Medium.otf +0 -0
- package/src/assets/fonts/SohneMono-MediumItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Regular.otf +0 -0
- package/src/assets/fonts/SohneMono-SemiBold.otf +0 -0
- package/src/assets/fonts/SohneMono-SemiBoldItalic.otf +0 -0
- package/src/components/Accordion/Accordion.tsx +15 -4
- package/src/components/AlertBanner/AlertBanner.tsx +38 -12
- package/src/components/AppHeader/AppHeader.tsx +172 -0
- package/src/components/AppHeader/index.ts +1 -0
- package/src/components/Avatar/Avatar.tsx +14 -4
- package/src/components/Badge/Badge.tsx +12 -3
- package/src/components/Button/Button.tsx +30 -38
- package/src/components/ButtonGroup/ButtonGroup.tsx +13 -10
- package/src/components/Card/Card.tsx +29 -57
- package/src/components/CategoryStrip/CategoryStrip.tsx +41 -42
- package/src/components/Checkbox/Checkbox.tsx +36 -45
- package/src/components/Chip/Chip.tsx +41 -48
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +2 -2
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +4 -2
- package/src/components/CurrencyInput/CurrencyInput.tsx +12 -10
- package/src/components/DetailRow/DetailRow.tsx +9 -7
- package/src/components/EmptyState/EmptyState.tsx +4 -3
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +153 -0
- package/src/components/ErrorBoundary/index.ts +1 -0
- package/src/components/Form/Form.tsx +149 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/HolographicCard/HolographicCard.tsx +315 -0
- package/src/components/HolographicCard/index.ts +1 -0
- package/src/components/IconButton/IconButton.tsx +23 -29
- package/src/components/ImageViewer/ImageViewer.tsx +290 -0
- package/src/components/ImageViewer/index.ts +1 -0
- package/src/components/Input/Input.tsx +27 -31
- package/src/components/LabelValue/LabelValue.tsx +6 -4
- package/src/components/ListGroup/ListGroup.tsx +145 -0
- package/src/components/ListGroup/index.ts +1 -0
- package/src/components/ListItem/ListItem.tsx +78 -76
- package/src/components/MediaCard/MediaCard.tsx +15 -7
- package/src/components/MenuGroup/MenuGroup.tsx +145 -0
- package/src/components/MenuGroup/index.ts +1 -0
- package/src/components/MenuItem/MenuItem.tsx +16 -33
- package/src/components/MonthPicker/MonthPicker.tsx +41 -15
- package/src/components/MonthPicker/index.ts +1 -1
- package/src/components/PagerDots/PagerDots.tsx +200 -0
- package/src/components/PagerDots/index.ts +1 -0
- package/src/components/Pressable/Pressable.tsx +19 -35
- package/src/components/PricingCard/PricingCard.tsx +220 -0
- package/src/components/PricingCard/index.ts +1 -0
- package/src/components/RadioGroup/RadioGroup.tsx +23 -39
- package/src/components/RetrayProvider/RetrayProvider.tsx +59 -0
- package/src/components/RetrayProvider/index.ts +1 -0
- package/src/components/Select/Select.tsx +6 -6
- package/src/components/SelectableGrid/SelectableGrid.tsx +205 -0
- package/src/components/SelectableGrid/index.ts +1 -0
- package/src/components/Separator/Separator.tsx +1 -3
- package/src/components/Sheet/Sheet.tsx +146 -18
- package/src/components/Skeleton/Skeleton.tsx +143 -2
- package/src/components/Slider/Slider.tsx +2 -2
- package/src/components/Spinner/Spinner.tsx +18 -3
- package/src/components/Switch/Switch.tsx +44 -49
- package/src/components/TabBar/TabBar.tsx +169 -0
- package/src/components/TabBar/index.ts +1 -0
- package/src/components/Tabs/Tabs.tsx +45 -44
- package/src/components/Text/Text.tsx +5 -1
- package/src/components/Textarea/Textarea.tsx +18 -14
- package/src/components/Toast/Toast.tsx +6 -6
- package/src/components/Toggle/Toggle.tsx +80 -72
- package/src/components/VirtualList/VirtualList.tsx +60 -0
- package/src/components/VirtualList/index.ts +1 -0
- package/src/fonts.ts +41 -20
- package/src/index.ts +28 -3
- package/src/theme/colors.ts +53 -39
- package/src/theme/types.ts +3 -0
- package/src/tokens.ts +49 -39
- package/src/utils/animations.ts +29 -1
- package/src/utils/fontGuard.ts +34 -0
- package/src/utils/haptics.ts +211 -9
- package/src/utils/icons.ts +47 -20
- package/src/utils/pressable.ts +66 -0
- package/src/utils/usePressScale.ts +2 -0
- package/src/assets/fonts/Poppins-Black.ttf +0 -0
- package/src/assets/fonts/Poppins-BlackItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Bold.ttf +0 -0
- package/src/assets/fonts/Poppins-BoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraBoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraLightItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Italic.ttf +0 -0
- package/src/assets/fonts/Poppins-Light.ttf +0 -0
- package/src/assets/fonts/Poppins-LightItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Medium.ttf +0 -0
- package/src/assets/fonts/Poppins-MediumItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Regular.ttf +0 -0
- package/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/src/assets/fonts/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Thin.ttf +0 -0
- package/src/assets/fonts/Poppins-ThinItalic.ttf +0 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { impactMedium } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
+
import { SHADOWS, RADIUS, BREAKPOINTS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
|
+
import { vs, s, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
5
|
+
import React, { useRef, useEffect, useCallback } from 'react';
|
|
6
|
+
import { Dimensions, Platform, StyleSheet, useWindowDimensions, View, Text, TouchableOpacity, Modal, Pressable, ScrollView } from 'react-native';
|
|
7
|
+
import { BottomSheetBackdrop, BottomSheetFooter, BottomSheetModal, BottomSheetScrollView, BottomSheetView } from '@gorhom/bottom-sheet';
|
|
8
|
+
export { BottomSheetModalProvider, BottomSheetTextInput } from '@gorhom/bottom-sheet';
|
|
9
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
10
|
+
import { AntDesign } from '@expo/vector-icons';
|
|
11
|
+
|
|
12
|
+
var SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
13
|
+
var DEFAULT_MAX_HEIGHT = SCREEN_HEIGHT * 0.85;
|
|
14
|
+
var isAndroid = Platform.OS === "android";
|
|
15
|
+
function SheetHeader({ children, style }) {
|
|
16
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.header, style] }, children);
|
|
17
|
+
}
|
|
18
|
+
function SheetContent({ children, style }) {
|
|
19
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.sheetContent, style] }, children);
|
|
20
|
+
}
|
|
21
|
+
function SheetFooter({ children, style }) {
|
|
22
|
+
const { colors } = useTheme();
|
|
23
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.sheetFooter, { backgroundColor: colors.card, borderTopColor: colors.border }, style] }, children);
|
|
24
|
+
}
|
|
25
|
+
function Sheet({
|
|
26
|
+
open,
|
|
27
|
+
onClose,
|
|
28
|
+
title,
|
|
29
|
+
subtitle,
|
|
30
|
+
description,
|
|
31
|
+
showCloseButton = false,
|
|
32
|
+
children,
|
|
33
|
+
style,
|
|
34
|
+
contentStyle,
|
|
35
|
+
scrollable,
|
|
36
|
+
maxHeight,
|
|
37
|
+
keyboardBehavior,
|
|
38
|
+
keyboardBlurBehavior = "restore",
|
|
39
|
+
enableBlurKeyboardOnGesture = true,
|
|
40
|
+
android_keyboardInputMode = "adjustPan",
|
|
41
|
+
footer,
|
|
42
|
+
snapPoints,
|
|
43
|
+
responsive = false,
|
|
44
|
+
dialogMaxWidth = 480
|
|
45
|
+
}) {
|
|
46
|
+
const { colors } = useTheme();
|
|
47
|
+
const insets = useSafeAreaInsets();
|
|
48
|
+
const { width: windowWidth } = useWindowDimensions();
|
|
49
|
+
const ref = useRef(null);
|
|
50
|
+
const asDialog = responsive && windowWidth >= BREAKPOINTS.wide;
|
|
51
|
+
const effectiveKeyboardBehavior = keyboardBehavior ?? "interactive";
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (open) {
|
|
54
|
+
impactMedium();
|
|
55
|
+
ref.current?.present();
|
|
56
|
+
} else {
|
|
57
|
+
ref.current?.dismiss();
|
|
58
|
+
}
|
|
59
|
+
}, [open]);
|
|
60
|
+
const renderBackdrop = useCallback((props) => /* @__PURE__ */ React.createElement(
|
|
61
|
+
BottomSheetBackdrop,
|
|
62
|
+
{
|
|
63
|
+
...props,
|
|
64
|
+
disappearsOnIndex: -1,
|
|
65
|
+
appearsOnIndex: 0,
|
|
66
|
+
pressBehavior: "close"
|
|
67
|
+
}
|
|
68
|
+
), []);
|
|
69
|
+
const childArray = React.Children.toArray(children);
|
|
70
|
+
const customHeader = childArray.find((child) => React.isValidElement(child) && child.type === SheetHeader);
|
|
71
|
+
const customContent = childArray.find((child) => React.isValidElement(child) && child.type === SheetContent);
|
|
72
|
+
const customFooter = childArray.find((child) => React.isValidElement(child) && child.type === SheetFooter);
|
|
73
|
+
const filteredChildren = customHeader || customContent || customFooter ? childArray.filter(
|
|
74
|
+
(child) => !React.isValidElement(child) || child.type !== SheetHeader && child.type !== SheetContent && child.type !== SheetFooter
|
|
75
|
+
) : children;
|
|
76
|
+
const effectiveSubtitle = subtitle ?? description;
|
|
77
|
+
const showHeader = !!(title || effectiveSubtitle || showCloseButton) && !customHeader;
|
|
78
|
+
const headerNode = customHeader ? customHeader : showHeader ? /* @__PURE__ */ React.createElement(View, { style: styles.header, accessibilityRole: "header" }, /* @__PURE__ */ React.createElement(View, { style: styles.headerRow }, title ? /* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: colors.foreground }], allowFontScaling: true }, title) : /* @__PURE__ */ React.createElement(View, { style: { flex: 1 } }), showCloseButton ? /* @__PURE__ */ React.createElement(
|
|
79
|
+
TouchableOpacity,
|
|
80
|
+
{
|
|
81
|
+
onPress: onClose,
|
|
82
|
+
style: styles.closeButton,
|
|
83
|
+
activeOpacity: 0.6,
|
|
84
|
+
touchSoundDisabled: true,
|
|
85
|
+
accessibilityRole: "button",
|
|
86
|
+
accessibilityLabel: "Close",
|
|
87
|
+
hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }
|
|
88
|
+
},
|
|
89
|
+
/* @__PURE__ */ React.createElement(AntDesign, { name: "close", size: ms(18), color: colors.foregroundMuted })
|
|
90
|
+
) : null), effectiveSubtitle ? /* @__PURE__ */ React.createElement(Text, { style: [styles.subtitle, { color: colors.foregroundMuted }], allowFontScaling: true }, effectiveSubtitle) : null) : null;
|
|
91
|
+
const contentNode = customContent ? customContent : filteredChildren;
|
|
92
|
+
const effectiveFooter = customFooter ? customFooter : footer;
|
|
93
|
+
const renderFooter = useCallback((props) => {
|
|
94
|
+
if (!effectiveFooter) return null;
|
|
95
|
+
return /* @__PURE__ */ React.createElement(BottomSheetFooter, { ...props }, effectiveFooter);
|
|
96
|
+
}, [effectiveFooter]);
|
|
97
|
+
if (asDialog) {
|
|
98
|
+
return /* @__PURE__ */ React.createElement(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: onClose }, /* @__PURE__ */ React.createElement(Pressable, { style: styles.dialogBackdrop, onPress: onClose, accessibilityRole: "button", accessibilityLabel: "Close" }, /* @__PURE__ */ React.createElement(
|
|
99
|
+
Pressable,
|
|
100
|
+
{
|
|
101
|
+
style: [
|
|
102
|
+
styles.dialogCard,
|
|
103
|
+
{ backgroundColor: colors.card, maxWidth: dialogMaxWidth, maxHeight: SCREEN_HEIGHT * 0.85 }
|
|
104
|
+
],
|
|
105
|
+
onPress: () => {
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
headerNode,
|
|
109
|
+
/* @__PURE__ */ React.createElement(
|
|
110
|
+
ScrollView,
|
|
111
|
+
{
|
|
112
|
+
contentContainerStyle: [styles.dialogContent, style],
|
|
113
|
+
style: contentStyle,
|
|
114
|
+
showsVerticalScrollIndicator: true,
|
|
115
|
+
bounces: false
|
|
116
|
+
},
|
|
117
|
+
contentNode
|
|
118
|
+
),
|
|
119
|
+
effectiveFooter
|
|
120
|
+
)));
|
|
121
|
+
}
|
|
122
|
+
const useScroll = scrollable || !!maxHeight;
|
|
123
|
+
const effectiveMaxHeight = maxHeight ?? DEFAULT_MAX_HEIGHT;
|
|
124
|
+
const useDynamicSizing = !snapPoints;
|
|
125
|
+
return /* @__PURE__ */ React.createElement(
|
|
126
|
+
BottomSheetModal,
|
|
127
|
+
{
|
|
128
|
+
ref,
|
|
129
|
+
enableDynamicSizing: useDynamicSizing,
|
|
130
|
+
snapPoints,
|
|
131
|
+
maxDynamicContentSize: useDynamicSizing ? effectiveMaxHeight : void 0,
|
|
132
|
+
onDismiss: onClose,
|
|
133
|
+
backdropComponent: renderBackdrop,
|
|
134
|
+
footerComponent: effectiveFooter ? renderFooter : void 0,
|
|
135
|
+
backgroundStyle: [styles.background, { backgroundColor: colors.card }],
|
|
136
|
+
handleIndicatorStyle: [styles.handle, { backgroundColor: colors.border }],
|
|
137
|
+
enablePanDownToClose: true,
|
|
138
|
+
topInset: insets.top,
|
|
139
|
+
keyboardBehavior: effectiveKeyboardBehavior,
|
|
140
|
+
keyboardBlurBehavior,
|
|
141
|
+
android_keyboardInputMode,
|
|
142
|
+
enableBlurKeyboardOnGesture
|
|
143
|
+
},
|
|
144
|
+
useScroll ? /* @__PURE__ */ React.createElement(
|
|
145
|
+
BottomSheetScrollView,
|
|
146
|
+
{
|
|
147
|
+
contentContainerStyle: [
|
|
148
|
+
styles.scrollContent,
|
|
149
|
+
style
|
|
150
|
+
],
|
|
151
|
+
style: contentStyle,
|
|
152
|
+
showsVerticalScrollIndicator: true,
|
|
153
|
+
indicatorStyle: "black",
|
|
154
|
+
persistentScrollbar: isAndroid
|
|
155
|
+
},
|
|
156
|
+
headerNode,
|
|
157
|
+
contentNode
|
|
158
|
+
) : /* @__PURE__ */ React.createElement(BottomSheetView, { style: [styles.content, contentStyle, style] }, headerNode, contentNode)
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
Sheet.Header = SheetHeader;
|
|
162
|
+
Sheet.Content = SheetContent;
|
|
163
|
+
Sheet.Footer = SheetFooter;
|
|
164
|
+
var styles = StyleSheet.create({
|
|
165
|
+
background: {
|
|
166
|
+
borderTopLeftRadius: ms(16),
|
|
167
|
+
borderTopRightRadius: ms(16)
|
|
168
|
+
},
|
|
169
|
+
handle: {
|
|
170
|
+
width: s(36),
|
|
171
|
+
height: vs(4),
|
|
172
|
+
borderRadius: ms(2)
|
|
173
|
+
},
|
|
174
|
+
header: {
|
|
175
|
+
paddingHorizontal: s(16),
|
|
176
|
+
paddingTop: vs(4),
|
|
177
|
+
paddingBottom: vs(12),
|
|
178
|
+
gap: vs(4)
|
|
179
|
+
},
|
|
180
|
+
headerRow: {
|
|
181
|
+
flexDirection: "row",
|
|
182
|
+
alignItems: "center",
|
|
183
|
+
justifyContent: "space-between"
|
|
184
|
+
},
|
|
185
|
+
title: {
|
|
186
|
+
fontFamily: "Sohne-SemiBold",
|
|
187
|
+
fontSize: ms(18),
|
|
188
|
+
flex: 1
|
|
189
|
+
},
|
|
190
|
+
subtitle: {
|
|
191
|
+
fontFamily: "Sohne-Regular",
|
|
192
|
+
fontSize: ms(14),
|
|
193
|
+
lineHeight: mvs(20)
|
|
194
|
+
},
|
|
195
|
+
closeButton: {
|
|
196
|
+
padding: s(4),
|
|
197
|
+
marginLeft: s(8)
|
|
198
|
+
},
|
|
199
|
+
content: {
|
|
200
|
+
paddingHorizontal: s(16),
|
|
201
|
+
paddingBottom: vs(32)
|
|
202
|
+
},
|
|
203
|
+
scrollContent: {
|
|
204
|
+
paddingHorizontal: s(16),
|
|
205
|
+
paddingBottom: vs(32),
|
|
206
|
+
paddingRight: s(16)
|
|
207
|
+
},
|
|
208
|
+
sheetContent: {
|
|
209
|
+
gap: vs(16)
|
|
210
|
+
},
|
|
211
|
+
sheetFooter: {
|
|
212
|
+
paddingHorizontal: s(16),
|
|
213
|
+
paddingVertical: vs(16),
|
|
214
|
+
borderTopWidth: 1,
|
|
215
|
+
flexDirection: "row",
|
|
216
|
+
gap: s(12)
|
|
217
|
+
},
|
|
218
|
+
dialogBackdrop: {
|
|
219
|
+
flex: 1,
|
|
220
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
|
221
|
+
alignItems: "center",
|
|
222
|
+
justifyContent: "center",
|
|
223
|
+
padding: s(24)
|
|
224
|
+
},
|
|
225
|
+
dialogCard: {
|
|
226
|
+
width: "100%",
|
|
227
|
+
borderRadius: RADIUS.lg,
|
|
228
|
+
paddingTop: vs(16),
|
|
229
|
+
overflow: "hidden",
|
|
230
|
+
...SHADOWS.xl
|
|
231
|
+
},
|
|
232
|
+
dialogContent: {
|
|
233
|
+
paddingHorizontal: s(16),
|
|
234
|
+
paddingBottom: vs(16)
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
export { Sheet };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
+
import { COLOR_TRANSITION, SPRING_ELASTIC, OPACITY_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
3
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
|
+
import { s } from './chunk-2CE3TQVY.mjs';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
7
|
+
import { EaseView } from 'react-native-ease';
|
|
8
|
+
import { Feather } from '@expo/vector-icons';
|
|
9
|
+
|
|
10
|
+
var TRACK_WIDTH = s(52);
|
|
11
|
+
var TRACK_HEIGHT = s(30);
|
|
12
|
+
var THUMB_SIZE = s(24);
|
|
13
|
+
var THUMB_OFFSET = s(3);
|
|
14
|
+
var THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
15
|
+
var ICON_SIZE = s(13);
|
|
16
|
+
function Switch({ checked = false, onCheckedChange, disabled, style, accessibilityLabel }) {
|
|
17
|
+
const { colors } = useTheme();
|
|
18
|
+
return /* @__PURE__ */ React.createElement(View, { style: [{ opacity: disabled ? 0.45 : 1, alignSelf: "flex-start" }, style] }, /* @__PURE__ */ React.createElement(
|
|
19
|
+
TouchableOpacity,
|
|
20
|
+
{
|
|
21
|
+
onPress: () => {
|
|
22
|
+
selectionAsync();
|
|
23
|
+
onCheckedChange?.(!checked);
|
|
24
|
+
},
|
|
25
|
+
disabled,
|
|
26
|
+
activeOpacity: 0.8,
|
|
27
|
+
touchSoundDisabled: true,
|
|
28
|
+
accessibilityRole: "switch",
|
|
29
|
+
accessibilityLabel,
|
|
30
|
+
accessibilityState: { checked, disabled: !!disabled },
|
|
31
|
+
style: styles.touchable
|
|
32
|
+
},
|
|
33
|
+
/* @__PURE__ */ React.createElement(
|
|
34
|
+
EaseView,
|
|
35
|
+
{
|
|
36
|
+
style: styles.track,
|
|
37
|
+
animate: { backgroundColor: checked ? colors.primary : colors.surfaceStrong },
|
|
38
|
+
transition: COLOR_TRANSITION
|
|
39
|
+
},
|
|
40
|
+
/* @__PURE__ */ React.createElement(
|
|
41
|
+
EaseView,
|
|
42
|
+
{
|
|
43
|
+
style: [styles.trackBorder, { borderWidth: 1.5 }],
|
|
44
|
+
pointerEvents: "none",
|
|
45
|
+
animate: { borderColor: checked ? "transparent" : colors.border },
|
|
46
|
+
transition: COLOR_TRANSITION
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ React.createElement(
|
|
50
|
+
EaseView,
|
|
51
|
+
{
|
|
52
|
+
style: [styles.thumb, { backgroundColor: colors.primaryForeground }],
|
|
53
|
+
animate: { translateX: checked ? THUMB_TRAVEL : 0 },
|
|
54
|
+
transition: SPRING_ELASTIC
|
|
55
|
+
},
|
|
56
|
+
/* @__PURE__ */ React.createElement(EaseView, { style: styles.iconWrapper, animate: { opacity: checked ? 1 : 0 }, transition: OPACITY_TRANSITION }, /* @__PURE__ */ React.createElement(Feather, { name: "check", size: ICON_SIZE, color: colors.primary })),
|
|
57
|
+
/* @__PURE__ */ React.createElement(EaseView, { style: styles.iconWrapper, animate: { opacity: checked ? 0 : 1 }, transition: OPACITY_TRANSITION }, /* @__PURE__ */ React.createElement(Feather, { name: "x", size: ICON_SIZE, color: colors.foregroundMuted }))
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
var styles = StyleSheet.create({
|
|
63
|
+
touchable: {
|
|
64
|
+
alignSelf: "flex-start"
|
|
65
|
+
},
|
|
66
|
+
track: {
|
|
67
|
+
width: TRACK_WIDTH,
|
|
68
|
+
height: TRACK_HEIGHT,
|
|
69
|
+
borderRadius: TRACK_HEIGHT / 2
|
|
70
|
+
},
|
|
71
|
+
trackBorder: {
|
|
72
|
+
...StyleSheet.absoluteFillObject,
|
|
73
|
+
borderRadius: TRACK_HEIGHT / 2
|
|
74
|
+
},
|
|
75
|
+
thumb: {
|
|
76
|
+
position: "absolute",
|
|
77
|
+
top: THUMB_OFFSET,
|
|
78
|
+
left: THUMB_OFFSET,
|
|
79
|
+
width: THUMB_SIZE,
|
|
80
|
+
height: THUMB_SIZE,
|
|
81
|
+
borderRadius: THUMB_SIZE / 2,
|
|
82
|
+
shadowColor: "#000",
|
|
83
|
+
shadowOffset: { width: 0, height: 1 },
|
|
84
|
+
shadowOpacity: 0.15,
|
|
85
|
+
shadowRadius: 2,
|
|
86
|
+
elevation: 2,
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
justifyContent: "center"
|
|
89
|
+
},
|
|
90
|
+
iconWrapper: {
|
|
91
|
+
position: "absolute",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
justifyContent: "center"
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export { Switch };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// src/tokens.ts
|
|
2
|
+
var SPACING = {
|
|
3
|
+
xxs: 2,
|
|
4
|
+
xs: 4,
|
|
5
|
+
sm: 8,
|
|
6
|
+
md: 12,
|
|
7
|
+
base: 16,
|
|
8
|
+
lg: 24,
|
|
9
|
+
xl: 32,
|
|
10
|
+
xxl: 48,
|
|
11
|
+
section: 64
|
|
12
|
+
};
|
|
13
|
+
var ICON_SIZES = {
|
|
14
|
+
sm: 14,
|
|
15
|
+
md: 18,
|
|
16
|
+
lg: 22,
|
|
17
|
+
xl: 28,
|
|
18
|
+
"2xl": 32
|
|
19
|
+
};
|
|
20
|
+
var RADIUS = {
|
|
21
|
+
none: 0,
|
|
22
|
+
xs: 4,
|
|
23
|
+
sm: 8,
|
|
24
|
+
md: 14,
|
|
25
|
+
lg: 20,
|
|
26
|
+
xl: 32,
|
|
27
|
+
full: 9999
|
|
28
|
+
};
|
|
29
|
+
var SHADOWS = {
|
|
30
|
+
sm: {
|
|
31
|
+
shadowColor: "#000",
|
|
32
|
+
shadowOffset: { width: 0, height: 1 },
|
|
33
|
+
shadowOpacity: 0.06,
|
|
34
|
+
shadowRadius: 4,
|
|
35
|
+
elevation: 2
|
|
36
|
+
},
|
|
37
|
+
md: {
|
|
38
|
+
shadowColor: "#000",
|
|
39
|
+
shadowOffset: { width: 0, height: 2 },
|
|
40
|
+
shadowOpacity: 0.1,
|
|
41
|
+
shadowRadius: 8,
|
|
42
|
+
elevation: 5
|
|
43
|
+
},
|
|
44
|
+
lg: {
|
|
45
|
+
shadowColor: "#000",
|
|
46
|
+
shadowOffset: { width: 0, height: 6 },
|
|
47
|
+
shadowOpacity: 0.16,
|
|
48
|
+
shadowRadius: 16,
|
|
49
|
+
elevation: 10
|
|
50
|
+
},
|
|
51
|
+
xl: {
|
|
52
|
+
shadowColor: "#000",
|
|
53
|
+
shadowOffset: { width: 0, height: 12 },
|
|
54
|
+
shadowOpacity: 0.24,
|
|
55
|
+
shadowRadius: 24,
|
|
56
|
+
elevation: 18
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var BREAKPOINTS = {
|
|
60
|
+
wide: 700
|
|
61
|
+
};
|
|
62
|
+
var TYPOGRAPHY = {
|
|
63
|
+
"display-hero": {
|
|
64
|
+
fontFamily: "Sohne-Bold",
|
|
65
|
+
fontSize: 64,
|
|
66
|
+
fontWeight: "700",
|
|
67
|
+
lineHeight: 70,
|
|
68
|
+
letterSpacing: -1
|
|
69
|
+
},
|
|
70
|
+
"display-xl": {
|
|
71
|
+
fontFamily: "Sohne-Bold",
|
|
72
|
+
fontSize: 28,
|
|
73
|
+
fontWeight: "700",
|
|
74
|
+
lineHeight: 40,
|
|
75
|
+
letterSpacing: 0
|
|
76
|
+
},
|
|
77
|
+
// AUDIT FIX: was 22px/500 — raised to 24px/600; removes weight inversion vs display-md
|
|
78
|
+
"display-lg": {
|
|
79
|
+
fontFamily: "Sohne-SemiBold",
|
|
80
|
+
fontSize: 24,
|
|
81
|
+
fontWeight: "600",
|
|
82
|
+
lineHeight: 32,
|
|
83
|
+
letterSpacing: -0.3
|
|
84
|
+
},
|
|
85
|
+
// AUDIT FIX: was 21px/700 — lowered to 20px/600; weight normalised, 4px gap preserved
|
|
86
|
+
"display-md": {
|
|
87
|
+
fontFamily: "Sohne-SemiBold",
|
|
88
|
+
fontSize: 20,
|
|
89
|
+
fontWeight: "600",
|
|
90
|
+
lineHeight: 28,
|
|
91
|
+
letterSpacing: 0
|
|
92
|
+
},
|
|
93
|
+
"display-sm": {
|
|
94
|
+
fontFamily: "Sohne-SemiBold",
|
|
95
|
+
fontSize: 18,
|
|
96
|
+
fontWeight: "600",
|
|
97
|
+
lineHeight: 24,
|
|
98
|
+
letterSpacing: -0.18
|
|
99
|
+
},
|
|
100
|
+
// AUDIT FIX: was 16px — raised to 17px so title-md > title-sm is size-visible
|
|
101
|
+
"title-md": {
|
|
102
|
+
fontFamily: "Sohne-SemiBold",
|
|
103
|
+
fontSize: 17,
|
|
104
|
+
fontWeight: "600",
|
|
105
|
+
lineHeight: 22,
|
|
106
|
+
letterSpacing: 0
|
|
107
|
+
},
|
|
108
|
+
// AUDIT FIX: was 16px — lowered to 15px; now distinct from title-md
|
|
109
|
+
"title-sm": {
|
|
110
|
+
fontFamily: "Sohne-Medium",
|
|
111
|
+
fontSize: 15,
|
|
112
|
+
fontWeight: "500",
|
|
113
|
+
lineHeight: 20,
|
|
114
|
+
letterSpacing: 0
|
|
115
|
+
},
|
|
116
|
+
"body-md": {
|
|
117
|
+
fontFamily: "Sohne-Regular",
|
|
118
|
+
fontSize: 16,
|
|
119
|
+
fontWeight: "400",
|
|
120
|
+
lineHeight: 24,
|
|
121
|
+
letterSpacing: 0
|
|
122
|
+
},
|
|
123
|
+
"body-sm": {
|
|
124
|
+
fontFamily: "Sohne-Regular",
|
|
125
|
+
fontSize: 14,
|
|
126
|
+
fontWeight: "400",
|
|
127
|
+
lineHeight: 20,
|
|
128
|
+
letterSpacing: 0
|
|
129
|
+
},
|
|
130
|
+
"caption": {
|
|
131
|
+
fontFamily: "Sohne-Medium",
|
|
132
|
+
fontSize: 14,
|
|
133
|
+
fontWeight: "500",
|
|
134
|
+
lineHeight: 18,
|
|
135
|
+
letterSpacing: 0
|
|
136
|
+
},
|
|
137
|
+
"caption-sm": {
|
|
138
|
+
fontFamily: "Sohne-Regular",
|
|
139
|
+
fontSize: 13,
|
|
140
|
+
fontWeight: "400",
|
|
141
|
+
lineHeight: 16,
|
|
142
|
+
letterSpacing: 0
|
|
143
|
+
},
|
|
144
|
+
"badge-text": {
|
|
145
|
+
fontFamily: "Sohne-SemiBold",
|
|
146
|
+
fontSize: 11,
|
|
147
|
+
fontWeight: "600",
|
|
148
|
+
lineHeight: 14,
|
|
149
|
+
letterSpacing: 0
|
|
150
|
+
},
|
|
151
|
+
// AUDIT FIX: added badge-text-md so Badge md size has a canonical token
|
|
152
|
+
"badge-text-md": {
|
|
153
|
+
fontFamily: "Sohne-SemiBold",
|
|
154
|
+
fontSize: 13,
|
|
155
|
+
fontWeight: "600",
|
|
156
|
+
lineHeight: 16,
|
|
157
|
+
letterSpacing: 0
|
|
158
|
+
},
|
|
159
|
+
"micro-label": {
|
|
160
|
+
fontFamily: "Sohne-Bold",
|
|
161
|
+
fontSize: 12,
|
|
162
|
+
fontWeight: "700",
|
|
163
|
+
lineHeight: 16,
|
|
164
|
+
letterSpacing: 0
|
|
165
|
+
},
|
|
166
|
+
// AUDIT FIX: was 10px/0.8 letterSpacing — raised to 11px/0.6; minimum mobile readability
|
|
167
|
+
"uppercase-tag": {
|
|
168
|
+
fontFamily: "Sohne-Bold",
|
|
169
|
+
fontSize: 11,
|
|
170
|
+
fontWeight: "700",
|
|
171
|
+
lineHeight: 14,
|
|
172
|
+
letterSpacing: 0.6,
|
|
173
|
+
textTransform: "uppercase"
|
|
174
|
+
},
|
|
175
|
+
"button-lg": {
|
|
176
|
+
fontFamily: "Sohne-Medium",
|
|
177
|
+
fontSize: 16,
|
|
178
|
+
fontWeight: "500",
|
|
179
|
+
lineHeight: 22,
|
|
180
|
+
letterSpacing: 0
|
|
181
|
+
},
|
|
182
|
+
"button-sm": {
|
|
183
|
+
fontFamily: "Sohne-Medium",
|
|
184
|
+
fontSize: 14,
|
|
185
|
+
fontWeight: "500",
|
|
186
|
+
lineHeight: 18,
|
|
187
|
+
letterSpacing: 0
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export { BREAKPOINTS, ICON_SIZES, RADIUS, SHADOWS, SPACING, TYPOGRAPHY };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
2
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
3
|
+
import { vs, s } from './chunk-2CE3TQVY.mjs';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
6
|
+
|
|
7
|
+
function ListGroup({ children, variant = "plain", style }) {
|
|
8
|
+
const { colors } = useTheme();
|
|
9
|
+
const processedChildren = React.Children.map(children, (child, index) => {
|
|
10
|
+
if (!React.isValidElement(child)) return child;
|
|
11
|
+
if (child.type === ListGroupHeader || child.type === ListGroupFooter) {
|
|
12
|
+
return child;
|
|
13
|
+
}
|
|
14
|
+
const childProps = child.props;
|
|
15
|
+
const isListItem = "title" in childProps;
|
|
16
|
+
if (!isListItem) return child;
|
|
17
|
+
const isLast = index === React.Children.count(children) - 1;
|
|
18
|
+
if (childProps["showSeparator"] === void 0 && !isLast) {
|
|
19
|
+
return React.cloneElement(child, {
|
|
20
|
+
showSeparator: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return child;
|
|
24
|
+
});
|
|
25
|
+
const cardStyle = variant === "card" ? {
|
|
26
|
+
backgroundColor: colors.card,
|
|
27
|
+
borderRadius: RADIUS.md,
|
|
28
|
+
borderWidth: 1,
|
|
29
|
+
borderColor: colors.border,
|
|
30
|
+
shadowColor: "#000",
|
|
31
|
+
shadowOffset: { width: 0, height: 2 },
|
|
32
|
+
shadowOpacity: 0.06,
|
|
33
|
+
shadowRadius: 6,
|
|
34
|
+
elevation: 2,
|
|
35
|
+
paddingVertical: vs(4)
|
|
36
|
+
} : {};
|
|
37
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.container, cardStyle, style] }, processedChildren);
|
|
38
|
+
}
|
|
39
|
+
function ListGroupHeader({ children, style }) {
|
|
40
|
+
const { colors } = useTheme();
|
|
41
|
+
if (typeof children === "string") {
|
|
42
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.header, { borderBottomColor: colors.separator }, style] }, /* @__PURE__ */ React.createElement(Text, { style: [styles.headerText, { color: colors.foregroundMuted }], allowFontScaling: true }, children));
|
|
43
|
+
}
|
|
44
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.header, { borderBottomColor: colors.separator }, style] }, children);
|
|
45
|
+
}
|
|
46
|
+
function ListGroupFooter({ children, style }) {
|
|
47
|
+
const { colors } = useTheme();
|
|
48
|
+
if (typeof children === "string") {
|
|
49
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.footer, style] }, /* @__PURE__ */ React.createElement(Text, { style: [styles.footerText, { color: colors.foregroundMuted }], allowFontScaling: true }, children));
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.footer, style] }, children);
|
|
52
|
+
}
|
|
53
|
+
ListGroup.Header = ListGroupHeader;
|
|
54
|
+
ListGroup.Footer = ListGroupFooter;
|
|
55
|
+
var styles = StyleSheet.create({
|
|
56
|
+
container: {
|
|
57
|
+
overflow: "hidden"
|
|
58
|
+
},
|
|
59
|
+
header: {
|
|
60
|
+
paddingHorizontal: s(16),
|
|
61
|
+
paddingTop: vs(12),
|
|
62
|
+
paddingBottom: vs(8),
|
|
63
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
64
|
+
},
|
|
65
|
+
headerText: {
|
|
66
|
+
fontFamily: "Sohne-SemiBold",
|
|
67
|
+
fontSize: 13,
|
|
68
|
+
letterSpacing: 0.32,
|
|
69
|
+
textTransform: "uppercase"
|
|
70
|
+
},
|
|
71
|
+
footer: {
|
|
72
|
+
paddingHorizontal: s(16),
|
|
73
|
+
paddingTop: vs(8),
|
|
74
|
+
paddingBottom: vs(12)
|
|
75
|
+
},
|
|
76
|
+
footerText: {
|
|
77
|
+
fontFamily: "Sohne-Regular",
|
|
78
|
+
fontSize: 12
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export { ListGroup, ListGroupFooter, ListGroupHeader };
|