@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,131 @@
|
|
|
1
|
+
import { PressableRow } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
4
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
5
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
|
+
import { vs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
9
|
+
import { Entypo } from '@expo/vector-icons';
|
|
10
|
+
|
|
11
|
+
function MenuItemBase({
|
|
12
|
+
label,
|
|
13
|
+
subtitle,
|
|
14
|
+
iconName,
|
|
15
|
+
icon,
|
|
16
|
+
iconColor,
|
|
17
|
+
rightRender,
|
|
18
|
+
showChevron = true,
|
|
19
|
+
onPress,
|
|
20
|
+
disabled = false,
|
|
21
|
+
variant = "plain",
|
|
22
|
+
showSeparator = false,
|
|
23
|
+
style,
|
|
24
|
+
labelStyle,
|
|
25
|
+
accessibilityLabel
|
|
26
|
+
}) {
|
|
27
|
+
const { colors } = useTheme();
|
|
28
|
+
const handlePress = () => {
|
|
29
|
+
selectionAsync();
|
|
30
|
+
onPress();
|
|
31
|
+
};
|
|
32
|
+
const resolvedIcon = iconName ? renderIcon(iconName, 22, iconColor ?? colors.foreground) : icon;
|
|
33
|
+
const cardStyle = variant === "card" ? {
|
|
34
|
+
backgroundColor: colors.card,
|
|
35
|
+
borderRadius: RADIUS.md,
|
|
36
|
+
borderWidth: 1,
|
|
37
|
+
borderColor: colors.border,
|
|
38
|
+
shadowColor: "#000",
|
|
39
|
+
shadowOffset: { width: 0, height: 2 },
|
|
40
|
+
shadowOpacity: 0.06,
|
|
41
|
+
shadowRadius: 6,
|
|
42
|
+
elevation: 2
|
|
43
|
+
} : {};
|
|
44
|
+
const a11yLabel = accessibilityLabel ?? (subtitle ? `${label}. ${subtitle}` : label);
|
|
45
|
+
return /* @__PURE__ */ React.createElement(View, { style: disabled && styles.disabled }, /* @__PURE__ */ React.createElement(
|
|
46
|
+
PressableRow,
|
|
47
|
+
{
|
|
48
|
+
style: [styles.container, cardStyle, style],
|
|
49
|
+
onPress: handlePress,
|
|
50
|
+
enabled: !disabled,
|
|
51
|
+
rippleColor: "transparent",
|
|
52
|
+
touchSoundDisabled: true,
|
|
53
|
+
activateOnHover: true,
|
|
54
|
+
accessibilityRole: "button",
|
|
55
|
+
accessibilityLabel: a11yLabel,
|
|
56
|
+
accessibilityState: { disabled }
|
|
57
|
+
},
|
|
58
|
+
resolvedIcon ? /* @__PURE__ */ React.createElement(View, { style: styles.iconContainer }, resolvedIcon) : null,
|
|
59
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.labelContainer }, /* @__PURE__ */ React.createElement(
|
|
60
|
+
Text,
|
|
61
|
+
{
|
|
62
|
+
style: [styles.label, { color: colors.foreground }, labelStyle],
|
|
63
|
+
numberOfLines: 1,
|
|
64
|
+
allowFontScaling: true
|
|
65
|
+
},
|
|
66
|
+
label
|
|
67
|
+
), subtitle ? /* @__PURE__ */ React.createElement(
|
|
68
|
+
Text,
|
|
69
|
+
{
|
|
70
|
+
style: [styles.subtitle, { color: colors.foregroundMuted }],
|
|
71
|
+
numberOfLines: 1,
|
|
72
|
+
allowFontScaling: true
|
|
73
|
+
},
|
|
74
|
+
subtitle
|
|
75
|
+
) : null),
|
|
76
|
+
rightRender !== void 0 ? /* @__PURE__ */ React.createElement(
|
|
77
|
+
View,
|
|
78
|
+
{
|
|
79
|
+
style: styles.rightContainer,
|
|
80
|
+
onStartShouldSetResponder: () => true,
|
|
81
|
+
onResponderRelease: () => {
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
rightRender
|
|
85
|
+
) : showChevron ? /* @__PURE__ */ React.createElement(Entypo, { name: "chevron-right", size: 18, color: colors.foregroundMuted }) : null
|
|
86
|
+
), showSeparator ? /* @__PURE__ */ React.createElement(View, { style: [styles.separator, { backgroundColor: colors.separator }] }) : null);
|
|
87
|
+
}
|
|
88
|
+
var MenuItem = React.memo(MenuItemBase);
|
|
89
|
+
var styles = StyleSheet.create({
|
|
90
|
+
container: {
|
|
91
|
+
flexDirection: "row",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
paddingHorizontal: s(16),
|
|
94
|
+
paddingVertical: vs(16),
|
|
95
|
+
minHeight: vs(54),
|
|
96
|
+
gap: s(12)
|
|
97
|
+
},
|
|
98
|
+
iconContainer: {
|
|
99
|
+
width: s(22),
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: "center",
|
|
102
|
+
flexShrink: 0
|
|
103
|
+
},
|
|
104
|
+
labelContainer: {
|
|
105
|
+
flex: 1,
|
|
106
|
+
justifyContent: "center"
|
|
107
|
+
},
|
|
108
|
+
label: {
|
|
109
|
+
fontFamily: "Sohne-Medium",
|
|
110
|
+
fontSize: ms(15)
|
|
111
|
+
},
|
|
112
|
+
subtitle: {
|
|
113
|
+
fontFamily: "Sohne-Regular",
|
|
114
|
+
fontSize: ms(12),
|
|
115
|
+
marginTop: vs(1)
|
|
116
|
+
},
|
|
117
|
+
rightContainer: {
|
|
118
|
+
alignItems: "flex-end",
|
|
119
|
+
justifyContent: "center",
|
|
120
|
+
flexShrink: 0
|
|
121
|
+
},
|
|
122
|
+
separator: {
|
|
123
|
+
height: StyleSheet.hairlineWidth,
|
|
124
|
+
marginRight: 0
|
|
125
|
+
},
|
|
126
|
+
disabled: {
|
|
127
|
+
opacity: 0.45
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export { MenuItem };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type ThemeColors = {
|
|
4
|
+
background: string;
|
|
5
|
+
foreground: string;
|
|
6
|
+
card: string;
|
|
7
|
+
primary: string;
|
|
8
|
+
primaryForeground: string;
|
|
9
|
+
border: string;
|
|
10
|
+
destructive: string;
|
|
11
|
+
destructiveForeground: string;
|
|
12
|
+
success: string;
|
|
13
|
+
successForeground: string;
|
|
14
|
+
warning: string;
|
|
15
|
+
warningForeground: string;
|
|
16
|
+
/** Backdrop/overlay color. Default: 'rgba(0,0,0,0.45)' */
|
|
17
|
+
overlay?: string;
|
|
18
|
+
/** Color accent (e.g. Airbnb coral). Default: same as primary */
|
|
19
|
+
accent?: string;
|
|
20
|
+
/** Text color on accent background. Default: same as primaryForeground */
|
|
21
|
+
accentForeground?: string;
|
|
22
|
+
};
|
|
23
|
+
type ResolvedColors = ThemeColors & {
|
|
24
|
+
foregroundSubtle: string;
|
|
25
|
+
foregroundMuted: string;
|
|
26
|
+
surface: string;
|
|
27
|
+
surfaceStrong: string;
|
|
28
|
+
destructiveTint: string;
|
|
29
|
+
destructiveBorder: string;
|
|
30
|
+
successTint: string;
|
|
31
|
+
successBorder: string;
|
|
32
|
+
warningTint: string;
|
|
33
|
+
warningBorder: string;
|
|
34
|
+
overlay: string;
|
|
35
|
+
accentResolved: string;
|
|
36
|
+
accentForegroundResolved: string;
|
|
37
|
+
ring: string;
|
|
38
|
+
input: string;
|
|
39
|
+
separator: string;
|
|
40
|
+
};
|
|
41
|
+
type Theme = {
|
|
42
|
+
light?: Partial<ThemeColors>;
|
|
43
|
+
dark?: Partial<ThemeColors>;
|
|
44
|
+
};
|
|
45
|
+
type ColorScheme = 'light' | 'dark' | 'system';
|
|
46
|
+
type ThemeContextValue = {
|
|
47
|
+
colors: ResolvedColors;
|
|
48
|
+
colorScheme: 'light' | 'dark';
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
interface RetrayProviderProps {
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
/** Optional per-scheme token overrides — forwarded to `ThemeProvider`. */
|
|
54
|
+
theme?: Theme;
|
|
55
|
+
/**
|
|
56
|
+
* - `'system'` (default): auto-detects device setting.
|
|
57
|
+
* - `'light'` / `'dark'`: forces a specific scheme.
|
|
58
|
+
*/
|
|
59
|
+
colorScheme?: ColorScheme;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* All-in-one provider that wires every provider the UI kit needs, in the one
|
|
63
|
+
* correct order:
|
|
64
|
+
*
|
|
65
|
+
* `SafeAreaProvider` → `GestureHandlerRootView` → `ThemeProvider` →
|
|
66
|
+
* `BottomSheetModalProvider` → `ToastProvider`
|
|
67
|
+
*
|
|
68
|
+
* Use this at your app root instead of nesting the five providers by hand — it
|
|
69
|
+
* removes an entire class of provider-order bugs. The individual providers stay
|
|
70
|
+
* exported for consumers who need a custom tree.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* import { RetrayProvider } from '@retray-dev/ui-kit'
|
|
74
|
+
*
|
|
75
|
+
* export default function App() {
|
|
76
|
+
* return (
|
|
77
|
+
* <RetrayProvider colorScheme="system">
|
|
78
|
+
* <RootNavigator />
|
|
79
|
+
* </RetrayProvider>
|
|
80
|
+
* )
|
|
81
|
+
* }
|
|
82
|
+
*/
|
|
83
|
+
declare function RetrayProvider({ children, theme, colorScheme }: RetrayProviderProps): React.JSX.Element;
|
|
84
|
+
|
|
85
|
+
export { type ColorScheme as C, type ResolvedColors as R, type Theme as T, type ThemeContextValue as a, type ThemeColors as b, RetrayProvider as c, type RetrayProviderProps as d };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type ThemeColors = {
|
|
4
|
+
background: string;
|
|
5
|
+
foreground: string;
|
|
6
|
+
card: string;
|
|
7
|
+
primary: string;
|
|
8
|
+
primaryForeground: string;
|
|
9
|
+
border: string;
|
|
10
|
+
destructive: string;
|
|
11
|
+
destructiveForeground: string;
|
|
12
|
+
success: string;
|
|
13
|
+
successForeground: string;
|
|
14
|
+
warning: string;
|
|
15
|
+
warningForeground: string;
|
|
16
|
+
/** Backdrop/overlay color. Default: 'rgba(0,0,0,0.45)' */
|
|
17
|
+
overlay?: string;
|
|
18
|
+
/** Color accent (e.g. Airbnb coral). Default: same as primary */
|
|
19
|
+
accent?: string;
|
|
20
|
+
/** Text color on accent background. Default: same as primaryForeground */
|
|
21
|
+
accentForeground?: string;
|
|
22
|
+
};
|
|
23
|
+
type ResolvedColors = ThemeColors & {
|
|
24
|
+
foregroundSubtle: string;
|
|
25
|
+
foregroundMuted: string;
|
|
26
|
+
surface: string;
|
|
27
|
+
surfaceStrong: string;
|
|
28
|
+
destructiveTint: string;
|
|
29
|
+
destructiveBorder: string;
|
|
30
|
+
successTint: string;
|
|
31
|
+
successBorder: string;
|
|
32
|
+
warningTint: string;
|
|
33
|
+
warningBorder: string;
|
|
34
|
+
overlay: string;
|
|
35
|
+
accentResolved: string;
|
|
36
|
+
accentForegroundResolved: string;
|
|
37
|
+
ring: string;
|
|
38
|
+
input: string;
|
|
39
|
+
separator: string;
|
|
40
|
+
};
|
|
41
|
+
type Theme = {
|
|
42
|
+
light?: Partial<ThemeColors>;
|
|
43
|
+
dark?: Partial<ThemeColors>;
|
|
44
|
+
};
|
|
45
|
+
type ColorScheme = 'light' | 'dark' | 'system';
|
|
46
|
+
type ThemeContextValue = {
|
|
47
|
+
colors: ResolvedColors;
|
|
48
|
+
colorScheme: 'light' | 'dark';
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
interface RetrayProviderProps {
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
/** Optional per-scheme token overrides — forwarded to `ThemeProvider`. */
|
|
54
|
+
theme?: Theme;
|
|
55
|
+
/**
|
|
56
|
+
* - `'system'` (default): auto-detects device setting.
|
|
57
|
+
* - `'light'` / `'dark'`: forces a specific scheme.
|
|
58
|
+
*/
|
|
59
|
+
colorScheme?: ColorScheme;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* All-in-one provider that wires every provider the UI kit needs, in the one
|
|
63
|
+
* correct order:
|
|
64
|
+
*
|
|
65
|
+
* `SafeAreaProvider` → `GestureHandlerRootView` → `ThemeProvider` →
|
|
66
|
+
* `BottomSheetModalProvider` → `ToastProvider`
|
|
67
|
+
*
|
|
68
|
+
* Use this at your app root instead of nesting the five providers by hand — it
|
|
69
|
+
* removes an entire class of provider-order bugs. The individual providers stay
|
|
70
|
+
* exported for consumers who need a custom tree.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* import { RetrayProvider } from '@retray-dev/ui-kit'
|
|
74
|
+
*
|
|
75
|
+
* export default function App() {
|
|
76
|
+
* return (
|
|
77
|
+
* <RetrayProvider colorScheme="system">
|
|
78
|
+
* <RootNavigator />
|
|
79
|
+
* </RetrayProvider>
|
|
80
|
+
* )
|
|
81
|
+
* }
|
|
82
|
+
*/
|
|
83
|
+
declare function RetrayProvider({ children, theme, colorScheme }: RetrayProviderProps): React.JSX.Element;
|
|
84
|
+
|
|
85
|
+
export { type ColorScheme as C, type ResolvedColors as R, type Theme as T, type ThemeContextValue as a, type ThemeColors as b, RetrayProvider as c, type RetrayProviderProps as d };
|