@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,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 MenuGroup({ 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 === MenuGroupHeader || child.type === MenuGroupFooter) {
|
|
12
|
+
return child;
|
|
13
|
+
}
|
|
14
|
+
const childProps = child.props;
|
|
15
|
+
const isMenuItem = "onPress" in childProps;
|
|
16
|
+
if (!isMenuItem) 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 MenuGroupHeader({ 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 MenuGroupFooter({ 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
|
+
MenuGroup.Header = MenuGroupHeader;
|
|
54
|
+
MenuGroup.Footer = MenuGroupFooter;
|
|
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 { MenuGroup, MenuGroupFooter, MenuGroupHeader };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
2
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
3
|
+
import { mvs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
6
|
+
|
|
7
|
+
var weightMap = {
|
|
8
|
+
normal: "Sohne-Regular",
|
|
9
|
+
medium: "Sohne-Medium",
|
|
10
|
+
semibold: "Sohne-SemiBold",
|
|
11
|
+
bold: "Sohne-Bold"
|
|
12
|
+
};
|
|
13
|
+
function DetailRowBase({
|
|
14
|
+
label,
|
|
15
|
+
value,
|
|
16
|
+
separator = "dotted",
|
|
17
|
+
labelWeight = "normal",
|
|
18
|
+
valueColor,
|
|
19
|
+
leftIcon,
|
|
20
|
+
leftIconName,
|
|
21
|
+
leftIconColor,
|
|
22
|
+
rightIconName,
|
|
23
|
+
rightIconColor,
|
|
24
|
+
style,
|
|
25
|
+
labelStyle,
|
|
26
|
+
valueStyle
|
|
27
|
+
}) {
|
|
28
|
+
const { colors } = useTheme();
|
|
29
|
+
const resolvedLeftIcon = leftIconName ? renderIcon(leftIconName, ms(14), leftIconColor ?? colors.foregroundMuted) : leftIcon;
|
|
30
|
+
const resolvedRightIcon = rightIconName ? renderIcon(rightIconName, ms(14), rightIconColor ?? colors.foregroundMuted) : null;
|
|
31
|
+
const separatorStyle = separator === "none" ? null : {
|
|
32
|
+
flex: 1,
|
|
33
|
+
height: 1,
|
|
34
|
+
borderBottomWidth: 1,
|
|
35
|
+
borderStyle: separator,
|
|
36
|
+
borderColor: "rgba(128,128,128,0.3)",
|
|
37
|
+
marginHorizontal: s(4)
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.row, style] }, /* @__PURE__ */ React.createElement(View, { style: styles.labelSide }, resolvedLeftIcon ? /* @__PURE__ */ React.createElement(View, { style: styles.icon }, resolvedLeftIcon) : null, typeof label === "string" ? /* @__PURE__ */ React.createElement(
|
|
40
|
+
Text,
|
|
41
|
+
{
|
|
42
|
+
style: [styles.labelText, { color: colors.foregroundMuted, fontFamily: weightMap[labelWeight] }, labelStyle],
|
|
43
|
+
allowFontScaling: true
|
|
44
|
+
},
|
|
45
|
+
label
|
|
46
|
+
) : label), separatorStyle ? /* @__PURE__ */ React.createElement(View, { style: separatorStyle }) : /* @__PURE__ */ React.createElement(View, { style: styles.spacer }), /* @__PURE__ */ React.createElement(View, { style: styles.valueSide }, typeof value === "string" ? /* @__PURE__ */ React.createElement(
|
|
47
|
+
Text,
|
|
48
|
+
{
|
|
49
|
+
style: [styles.valueText, { color: valueColor ?? colors.foreground }, valueStyle],
|
|
50
|
+
allowFontScaling: true
|
|
51
|
+
},
|
|
52
|
+
value
|
|
53
|
+
) : value, resolvedRightIcon ? /* @__PURE__ */ React.createElement(View, { style: styles.icon }, resolvedRightIcon) : null));
|
|
54
|
+
}
|
|
55
|
+
var DetailRow = React.memo(DetailRowBase);
|
|
56
|
+
var styles = StyleSheet.create({
|
|
57
|
+
row: {
|
|
58
|
+
flexDirection: "row",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
gap: s(4)
|
|
61
|
+
},
|
|
62
|
+
labelSide: {
|
|
63
|
+
flexDirection: "row",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
gap: s(4),
|
|
66
|
+
flexShrink: 0
|
|
67
|
+
},
|
|
68
|
+
icon: {
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
justifyContent: "center"
|
|
71
|
+
},
|
|
72
|
+
spacer: {
|
|
73
|
+
flex: 1
|
|
74
|
+
},
|
|
75
|
+
labelText: {
|
|
76
|
+
fontSize: ms(13),
|
|
77
|
+
lineHeight: mvs(18)
|
|
78
|
+
},
|
|
79
|
+
valueSide: {
|
|
80
|
+
flexDirection: "row",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
gap: s(4),
|
|
83
|
+
flexShrink: 0
|
|
84
|
+
},
|
|
85
|
+
valueText: {
|
|
86
|
+
fontFamily: "Sohne-SemiBold",
|
|
87
|
+
fontSize: ms(13),
|
|
88
|
+
lineHeight: mvs(18)
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export { DetailRow };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
3
|
+
import { vs, ms } from './chunk-2CE3TQVY.mjs';
|
|
4
|
+
import React, { useRef } from 'react';
|
|
5
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
6
|
+
import RNSlider from '@react-native-community/slider';
|
|
7
|
+
|
|
8
|
+
function Slider({
|
|
9
|
+
value = 0,
|
|
10
|
+
minimumValue = 0,
|
|
11
|
+
maximumValue = 1,
|
|
12
|
+
step = 0,
|
|
13
|
+
onValueChange,
|
|
14
|
+
onSlidingComplete,
|
|
15
|
+
label,
|
|
16
|
+
showValue = false,
|
|
17
|
+
formatValue = (v) => v.toFixed(2),
|
|
18
|
+
accessibilityLabel,
|
|
19
|
+
disabled,
|
|
20
|
+
style
|
|
21
|
+
}) {
|
|
22
|
+
const { colors } = useTheme();
|
|
23
|
+
const lastSteppedValue = useRef(value);
|
|
24
|
+
const handleValueChange = (v) => {
|
|
25
|
+
if (step && v !== lastSteppedValue.current) {
|
|
26
|
+
lastSteppedValue.current = v;
|
|
27
|
+
selectionAsync();
|
|
28
|
+
}
|
|
29
|
+
onValueChange?.(v);
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ React.createElement(
|
|
32
|
+
View,
|
|
33
|
+
{
|
|
34
|
+
style: [styles.wrapper, style],
|
|
35
|
+
accessibilityRole: "adjustable",
|
|
36
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
37
|
+
accessibilityValue: {
|
|
38
|
+
min: minimumValue,
|
|
39
|
+
max: maximumValue,
|
|
40
|
+
now: value,
|
|
41
|
+
text: formatValue(value)
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
label || showValue ? /* @__PURE__ */ React.createElement(View, { style: styles.header }, label ? /* @__PURE__ */ React.createElement(Text, { style: [styles.label, { color: colors.foreground }], allowFontScaling: true }, label) : null, showValue ? /* @__PURE__ */ React.createElement(Text, { style: [styles.valueText, { color: colors.foregroundMuted }], allowFontScaling: true }, formatValue(value)) : null) : null,
|
|
45
|
+
/* @__PURE__ */ React.createElement(View, { style: disabled ? styles.disabled : void 0 }, /* @__PURE__ */ React.createElement(
|
|
46
|
+
RNSlider,
|
|
47
|
+
{
|
|
48
|
+
value,
|
|
49
|
+
minimumValue,
|
|
50
|
+
maximumValue,
|
|
51
|
+
step: step || 0,
|
|
52
|
+
disabled,
|
|
53
|
+
onValueChange: handleValueChange,
|
|
54
|
+
onSlidingComplete,
|
|
55
|
+
minimumTrackTintColor: colors.primary,
|
|
56
|
+
maximumTrackTintColor: colors.surface,
|
|
57
|
+
thumbTintColor: colors.primary,
|
|
58
|
+
style: styles.slider,
|
|
59
|
+
accessibilityLabel
|
|
60
|
+
}
|
|
61
|
+
))
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
var styles = StyleSheet.create({
|
|
65
|
+
wrapper: {
|
|
66
|
+
gap: vs(8)
|
|
67
|
+
},
|
|
68
|
+
header: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
justifyContent: "space-between",
|
|
71
|
+
alignItems: "center"
|
|
72
|
+
},
|
|
73
|
+
label: {
|
|
74
|
+
fontFamily: "Sohne-Medium",
|
|
75
|
+
fontSize: ms(15)
|
|
76
|
+
},
|
|
77
|
+
valueText: {
|
|
78
|
+
fontFamily: "Sohne-Medium",
|
|
79
|
+
fontSize: ms(14)
|
|
80
|
+
},
|
|
81
|
+
slider: {
|
|
82
|
+
width: "100%",
|
|
83
|
+
height: vs(60)
|
|
84
|
+
},
|
|
85
|
+
disabled: {
|
|
86
|
+
opacity: 0.45
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export { Slider };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
2
|
+
import { s, ms } from './chunk-2CE3TQVY.mjs';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { StyleSheet, View, Image, Text } from 'react-native';
|
|
5
|
+
|
|
6
|
+
var sizeMap = {
|
|
7
|
+
sm: s(28),
|
|
8
|
+
md: s(40),
|
|
9
|
+
lg: s(56),
|
|
10
|
+
xl: s(72)
|
|
11
|
+
};
|
|
12
|
+
var fontSizeMap = {
|
|
13
|
+
sm: ms(12),
|
|
14
|
+
md: ms(16),
|
|
15
|
+
lg: ms(22),
|
|
16
|
+
xl: ms(28)
|
|
17
|
+
};
|
|
18
|
+
var statusSizeMap = {
|
|
19
|
+
sm: 8,
|
|
20
|
+
md: 10,
|
|
21
|
+
lg: 13,
|
|
22
|
+
xl: 16
|
|
23
|
+
};
|
|
24
|
+
function getInitials(fallback, fallbackText) {
|
|
25
|
+
if (fallback) return fallback.slice(0, 2).toUpperCase();
|
|
26
|
+
if (fallbackText) {
|
|
27
|
+
const words = fallbackText.trim().split(/\s+/);
|
|
28
|
+
if (words.length === 1) return words[0].slice(0, 2).toUpperCase();
|
|
29
|
+
return (words[0][0] + words[words.length - 1][0]).toUpperCase();
|
|
30
|
+
}
|
|
31
|
+
return "?";
|
|
32
|
+
}
|
|
33
|
+
function AvatarBase({ src, fallback, fallbackText, size = "md", status, style }) {
|
|
34
|
+
const { colors } = useTheme();
|
|
35
|
+
const [imageError, setImageError] = useState(false);
|
|
36
|
+
const dimension = typeof size === "number" ? size : sizeMap[size];
|
|
37
|
+
const fontSize = typeof size === "number" ? size * 0.38 : fontSizeMap[size];
|
|
38
|
+
const showFallback = !src || imageError;
|
|
39
|
+
const statusSize = typeof size === "number" ? size * 0.25 : statusSizeMap[size];
|
|
40
|
+
const statusColor = {
|
|
41
|
+
online: colors.success,
|
|
42
|
+
offline: "transparent",
|
|
43
|
+
busy: colors.destructive,
|
|
44
|
+
away: colors.warning
|
|
45
|
+
};
|
|
46
|
+
const containerStyle = {
|
|
47
|
+
width: dimension,
|
|
48
|
+
height: dimension,
|
|
49
|
+
borderRadius: dimension / 2,
|
|
50
|
+
backgroundColor: colors.surface,
|
|
51
|
+
overflow: "hidden"
|
|
52
|
+
};
|
|
53
|
+
const a11yLabel = fallbackText || fallback || "Avatar";
|
|
54
|
+
return /* @__PURE__ */ React.createElement(
|
|
55
|
+
View,
|
|
56
|
+
{
|
|
57
|
+
style: [styles.wrapper, style],
|
|
58
|
+
accessibilityRole: "image",
|
|
59
|
+
accessibilityLabel: a11yLabel
|
|
60
|
+
},
|
|
61
|
+
/* @__PURE__ */ React.createElement(View, { style: [styles.base, containerStyle] }, !showFallback ? /* @__PURE__ */ React.createElement(
|
|
62
|
+
Image,
|
|
63
|
+
{
|
|
64
|
+
source: { uri: src },
|
|
65
|
+
style: { width: dimension, height: dimension },
|
|
66
|
+
onError: () => setImageError(true)
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ React.createElement(
|
|
69
|
+
Text,
|
|
70
|
+
{
|
|
71
|
+
style: [styles.fallback, { color: colors.foregroundMuted, fontSize }],
|
|
72
|
+
allowFontScaling: true
|
|
73
|
+
},
|
|
74
|
+
getInitials(fallback, fallbackText)
|
|
75
|
+
)),
|
|
76
|
+
status && /* @__PURE__ */ React.createElement(
|
|
77
|
+
View,
|
|
78
|
+
{
|
|
79
|
+
style: [
|
|
80
|
+
styles.statusDot,
|
|
81
|
+
{
|
|
82
|
+
width: statusSize,
|
|
83
|
+
height: statusSize,
|
|
84
|
+
borderRadius: statusSize / 2,
|
|
85
|
+
backgroundColor: statusColor[status],
|
|
86
|
+
borderWidth: status === "offline" ? 2 : 1.5,
|
|
87
|
+
borderColor: status === "offline" ? colors.border : colors.background
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
var Avatar = React.memo(AvatarBase);
|
|
95
|
+
var styles = StyleSheet.create({
|
|
96
|
+
wrapper: {
|
|
97
|
+
alignSelf: "flex-start",
|
|
98
|
+
position: "relative"
|
|
99
|
+
},
|
|
100
|
+
base: {
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
justifyContent: "center"
|
|
103
|
+
},
|
|
104
|
+
fallback: {
|
|
105
|
+
fontFamily: "Sohne-Medium"
|
|
106
|
+
},
|
|
107
|
+
statusDot: {
|
|
108
|
+
position: "absolute",
|
|
109
|
+
bottom: 0,
|
|
110
|
+
right: 0
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export { Avatar };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
+
import { COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
4
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
5
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
|
+
import { vs, s, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
9
|
+
import { EaseView } from 'react-native-ease';
|
|
10
|
+
import { FontAwesome5 } from '@expo/vector-icons';
|
|
11
|
+
|
|
12
|
+
function ToggleIcon({ pressed, iconName, activeIconName, icon, activeIcon, iconColor, activeIconColor, iconSize, primaryColor, mutedColor }) {
|
|
13
|
+
const renderProp = (prop) => {
|
|
14
|
+
if (!prop) return null;
|
|
15
|
+
if (typeof prop === "function") return prop(pressed);
|
|
16
|
+
return prop;
|
|
17
|
+
};
|
|
18
|
+
if (pressed) {
|
|
19
|
+
if (activeIconName) return /* @__PURE__ */ React.createElement(React.Fragment, null, renderIcon(activeIconName, iconSize, activeIconColor ?? primaryColor));
|
|
20
|
+
const active = renderProp(activeIcon);
|
|
21
|
+
if (active) return /* @__PURE__ */ React.createElement(React.Fragment, null, active);
|
|
22
|
+
return /* @__PURE__ */ React.createElement(FontAwesome5, { name: "check-circle", size: iconSize, color: primaryColor });
|
|
23
|
+
}
|
|
24
|
+
if (iconName) return /* @__PURE__ */ React.createElement(React.Fragment, null, renderIcon(iconName, iconSize, iconColor ?? mutedColor));
|
|
25
|
+
const custom = renderProp(icon);
|
|
26
|
+
if (custom) return /* @__PURE__ */ React.createElement(React.Fragment, null, custom);
|
|
27
|
+
return /* @__PURE__ */ React.createElement(FontAwesome5, { name: "circle", size: iconSize, color: mutedColor });
|
|
28
|
+
}
|
|
29
|
+
var sizeStyles = {
|
|
30
|
+
sm: { paddingHorizontal: s(12), paddingVertical: vs(8), minWidth: s(40), minHeight: vs(40) },
|
|
31
|
+
md: { paddingHorizontal: s(16), paddingVertical: vs(12), minWidth: s(44), minHeight: vs(44) },
|
|
32
|
+
lg: { paddingHorizontal: s(20), paddingVertical: vs(14), minWidth: s(48), minHeight: vs(48) }
|
|
33
|
+
};
|
|
34
|
+
var iconSizeMap = { sm: 16, md: 18, lg: 20 };
|
|
35
|
+
function Toggle({
|
|
36
|
+
pressed = false,
|
|
37
|
+
onPressedChange,
|
|
38
|
+
variant = "default",
|
|
39
|
+
size = "md",
|
|
40
|
+
label,
|
|
41
|
+
icon,
|
|
42
|
+
activeIcon,
|
|
43
|
+
iconName,
|
|
44
|
+
activeIconName,
|
|
45
|
+
iconColor,
|
|
46
|
+
activeIconColor,
|
|
47
|
+
disabled,
|
|
48
|
+
style,
|
|
49
|
+
accessibilityLabel
|
|
50
|
+
}) {
|
|
51
|
+
const { colors } = useTheme();
|
|
52
|
+
const inactiveBorder = variant === "outline" ? colors.border : "transparent";
|
|
53
|
+
const iconSize = iconSizeMap[size];
|
|
54
|
+
const handlePress = () => {
|
|
55
|
+
selectionAsync();
|
|
56
|
+
onPressedChange?.(!pressed);
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ React.createElement(View, { style: [disabled && styles.disabled, style] }, /* @__PURE__ */ React.createElement(
|
|
59
|
+
PressableButton,
|
|
60
|
+
{
|
|
61
|
+
onPress: handlePress,
|
|
62
|
+
enabled: !disabled,
|
|
63
|
+
rippleColor: "transparent",
|
|
64
|
+
touchSoundDisabled: true,
|
|
65
|
+
activateOnHover: true,
|
|
66
|
+
accessibilityRole: "button",
|
|
67
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
68
|
+
accessibilityState: { selected: pressed, disabled: !!disabled }
|
|
69
|
+
},
|
|
70
|
+
/* @__PURE__ */ React.createElement(
|
|
71
|
+
EaseView,
|
|
72
|
+
{
|
|
73
|
+
style: [styles.base, sizeStyles[size], { borderWidth: 2 }],
|
|
74
|
+
animate: {
|
|
75
|
+
borderColor: pressed ? colors.primary : inactiveBorder,
|
|
76
|
+
backgroundColor: pressed ? colors.surfaceStrong : "transparent"
|
|
77
|
+
},
|
|
78
|
+
transition: COLOR_TRANSITION
|
|
79
|
+
},
|
|
80
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.inner }, /* @__PURE__ */ React.createElement(
|
|
81
|
+
ToggleIcon,
|
|
82
|
+
{
|
|
83
|
+
pressed,
|
|
84
|
+
iconName,
|
|
85
|
+
activeIconName,
|
|
86
|
+
icon,
|
|
87
|
+
activeIcon,
|
|
88
|
+
iconColor,
|
|
89
|
+
activeIconColor,
|
|
90
|
+
iconSize,
|
|
91
|
+
primaryColor: colors.primary,
|
|
92
|
+
mutedColor: colors.foregroundMuted
|
|
93
|
+
}
|
|
94
|
+
), label ? /* @__PURE__ */ React.createElement(
|
|
95
|
+
Text,
|
|
96
|
+
{
|
|
97
|
+
style: [styles.label, { color: pressed ? colors.primary : colors.foreground }],
|
|
98
|
+
allowFontScaling: true
|
|
99
|
+
},
|
|
100
|
+
label
|
|
101
|
+
) : null)
|
|
102
|
+
)
|
|
103
|
+
));
|
|
104
|
+
}
|
|
105
|
+
var styles = StyleSheet.create({
|
|
106
|
+
base: {
|
|
107
|
+
borderRadius: ms(8)
|
|
108
|
+
},
|
|
109
|
+
inner: {
|
|
110
|
+
flexDirection: "row",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "center",
|
|
113
|
+
gap: s(8)
|
|
114
|
+
},
|
|
115
|
+
disabled: {
|
|
116
|
+
opacity: 0.45
|
|
117
|
+
},
|
|
118
|
+
label: {
|
|
119
|
+
fontFamily: "Sohne-Medium",
|
|
120
|
+
fontSize: ms(14)
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export { Toggle };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
4
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
|
+
import { ms, vs, s, mvs } from './chunk-2CE3TQVY.mjs';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
|
|
8
|
+
|
|
9
|
+
function DefaultErrorFallback({
|
|
10
|
+
error,
|
|
11
|
+
reset,
|
|
12
|
+
title = "Something went wrong",
|
|
13
|
+
message
|
|
14
|
+
}) {
|
|
15
|
+
const { colors } = useTheme();
|
|
16
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.container, { backgroundColor: colors.background }], accessibilityRole: "alert" }, /* @__PURE__ */ React.createElement(View, { style: [styles.iconCircle, { backgroundColor: colors.destructiveTint }] }, renderIcon("alert-triangle", ms(28), colors.destructive)), /* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: colors.foreground }], allowFontScaling: true }, title), /* @__PURE__ */ React.createElement(Text, { style: [styles.message, { color: colors.foregroundMuted }], allowFontScaling: true }, message ?? error.message ?? "An unexpected error occurred."), /* @__PURE__ */ React.createElement(
|
|
17
|
+
TouchableOpacity,
|
|
18
|
+
{
|
|
19
|
+
style: [styles.button, { backgroundColor: colors.primary }],
|
|
20
|
+
onPress: () => {
|
|
21
|
+
impactLight();
|
|
22
|
+
reset();
|
|
23
|
+
},
|
|
24
|
+
activeOpacity: 0.85,
|
|
25
|
+
touchSoundDisabled: true,
|
|
26
|
+
accessibilityRole: "button",
|
|
27
|
+
accessibilityLabel: "Try again"
|
|
28
|
+
},
|
|
29
|
+
/* @__PURE__ */ React.createElement(Text, { style: [styles.buttonLabel, { color: colors.primaryForeground }], allowFontScaling: true }, "Try again")
|
|
30
|
+
));
|
|
31
|
+
}
|
|
32
|
+
var ErrorBoundary = class extends React.Component {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.state = { error: null };
|
|
36
|
+
this.reset = () => {
|
|
37
|
+
this.setState({ error: null });
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static getDerivedStateFromError(error) {
|
|
41
|
+
return { error };
|
|
42
|
+
}
|
|
43
|
+
componentDidCatch(error, info) {
|
|
44
|
+
this.props.onError?.(error, info);
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
const { error } = this.state;
|
|
48
|
+
if (error) {
|
|
49
|
+
const { fallback, title, message } = this.props;
|
|
50
|
+
if (typeof fallback === "function") {
|
|
51
|
+
return fallback({ error, reset: this.reset });
|
|
52
|
+
}
|
|
53
|
+
if (fallback !== void 0) {
|
|
54
|
+
return fallback;
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ React.createElement(DefaultErrorFallback, { error, reset: this.reset, title, message });
|
|
57
|
+
}
|
|
58
|
+
return this.props.children;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var styles = StyleSheet.create({
|
|
62
|
+
container: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
paddingHorizontal: s(32),
|
|
67
|
+
gap: vs(12)
|
|
68
|
+
},
|
|
69
|
+
iconCircle: {
|
|
70
|
+
width: s(64),
|
|
71
|
+
height: s(64),
|
|
72
|
+
borderRadius: RADIUS.full,
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
justifyContent: "center",
|
|
75
|
+
marginBottom: vs(4)
|
|
76
|
+
},
|
|
77
|
+
title: {
|
|
78
|
+
fontFamily: "Sohne-SemiBold",
|
|
79
|
+
fontSize: ms(18),
|
|
80
|
+
lineHeight: mvs(24),
|
|
81
|
+
textAlign: "center"
|
|
82
|
+
},
|
|
83
|
+
message: {
|
|
84
|
+
fontFamily: "Sohne-Regular",
|
|
85
|
+
fontSize: ms(14),
|
|
86
|
+
lineHeight: mvs(20),
|
|
87
|
+
textAlign: "center"
|
|
88
|
+
},
|
|
89
|
+
button: {
|
|
90
|
+
marginTop: vs(8),
|
|
91
|
+
paddingHorizontal: s(20),
|
|
92
|
+
paddingVertical: vs(10),
|
|
93
|
+
borderRadius: RADIUS.md,
|
|
94
|
+
minHeight: vs(44),
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
justifyContent: "center"
|
|
97
|
+
},
|
|
98
|
+
buttonLabel: {
|
|
99
|
+
fontFamily: "Sohne-Medium",
|
|
100
|
+
fontSize: ms(15)
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export { ErrorBoundary };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
2
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
|
+
import { ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
7
|
+
import { FontAwesome5, MaterialIcons, Entypo } from '@expo/vector-icons';
|
|
8
|
+
|
|
9
|
+
function AlertBanner({ title, description, variant = "default", icon, iconName, iconColor, style }) {
|
|
10
|
+
const { colors, colorScheme } = useTheme();
|
|
11
|
+
const isDark = colorScheme === "dark";
|
|
12
|
+
const accentColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : variant === "warning" ? colors.warning : colors.foreground;
|
|
13
|
+
const bgColor = variant === "destructive" ? isDark ? "rgba(239, 83, 80, 0.15)" : "rgba(199, 40, 40, 0.10)" : variant === "success" ? isDark ? "rgba(46, 125, 82, 0.15)" : "rgba(26, 122, 69, 0.10)" : variant === "warning" ? isDark ? "rgba(245, 166, 35, 0.15)" : "rgba(154, 82, 0, 0.10)" : colors.surface;
|
|
14
|
+
const borderColor = variant === "destructive" ? isDark ? "rgba(239, 83, 80, 0.30)" : "rgba(199, 40, 40, 0.25)" : variant === "success" ? isDark ? "rgba(46, 125, 82, 0.30)" : "rgba(26, 122, 69, 0.25)" : variant === "warning" ? isDark ? "rgba(245, 166, 35, 0.30)" : "rgba(154, 82, 0, 0.25)" : colors.border;
|
|
15
|
+
const defaultIcon = variant === "success" ? /* @__PURE__ */ React.createElement(FontAwesome5, { name: "check-circle", size: ms(16), color: accentColor }) : variant === "destructive" ? /* @__PURE__ */ React.createElement(MaterialIcons, { name: "error-outline", size: ms(17), color: accentColor }) : variant === "warning" ? /* @__PURE__ */ React.createElement(MaterialIcons, { name: "warning-amber", size: ms(17), color: accentColor }) : (
|
|
16
|
+
// AUDIT FIX: default variant previously used colors.primary (near-black)
|
|
17
|
+
// as the info icon tint — ambiguous and heavy. accentResolved gives it
|
|
18
|
+
// a meaningful chromatic signal when an accent is defined.
|
|
19
|
+
/* @__PURE__ */ React.createElement(Entypo, { name: "info-with-circle", size: ms(16), color: accentColor })
|
|
20
|
+
);
|
|
21
|
+
const effectiveIcon = iconName ? renderIcon(iconName, ms(16), iconColor ?? accentColor) : icon ?? defaultIcon;
|
|
22
|
+
const a11yLabel = description ? `${title}. ${description}` : title;
|
|
23
|
+
return /* @__PURE__ */ React.createElement(
|
|
24
|
+
View,
|
|
25
|
+
{
|
|
26
|
+
style: [
|
|
27
|
+
styles.container,
|
|
28
|
+
{ backgroundColor: bgColor, borderWidth: 1, borderColor },
|
|
29
|
+
style
|
|
30
|
+
],
|
|
31
|
+
accessibilityRole: "alert",
|
|
32
|
+
accessibilityLabel: a11yLabel
|
|
33
|
+
},
|
|
34
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.iconSlot }, effectiveIcon),
|
|
35
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.content }, /* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: colors.foreground }], allowFontScaling: true }, title), description ? /* @__PURE__ */ React.createElement(Text, { style: [styles.description, { color: colors.foreground, opacity: 0.85 }], allowFontScaling: true }, description) : null)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
var styles = StyleSheet.create({
|
|
39
|
+
container: {
|
|
40
|
+
flexDirection: "row",
|
|
41
|
+
alignItems: "flex-start",
|
|
42
|
+
borderRadius: RADIUS.lg,
|
|
43
|
+
gap: s(8),
|
|
44
|
+
paddingVertical: vs(10),
|
|
45
|
+
paddingHorizontal: s(12)
|
|
46
|
+
},
|
|
47
|
+
iconSlot: {
|
|
48
|
+
marginTop: vs(1)
|
|
49
|
+
},
|
|
50
|
+
content: {
|
|
51
|
+
flex: 1,
|
|
52
|
+
gap: vs(2)
|
|
53
|
+
},
|
|
54
|
+
title: {
|
|
55
|
+
fontFamily: "Sohne-Medium",
|
|
56
|
+
fontSize: ms(13)
|
|
57
|
+
},
|
|
58
|
+
description: {
|
|
59
|
+
fontFamily: "Sohne-Regular",
|
|
60
|
+
fontSize: ms(12)
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export { AlertBanner };
|