@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
package/EXAMPLES.md
CHANGED
|
@@ -541,6 +541,254 @@ const styles = StyleSheet.create({
|
|
|
541
541
|
|
|
542
542
|
---
|
|
543
543
|
|
|
544
|
+
## Example 4: Settings Screen with Compound Components
|
|
545
|
+
|
|
546
|
+
**Use case:** App settings screen demonstrating MenuGroup, ListGroup, and Form compound components for standardized layouts.
|
|
547
|
+
|
|
548
|
+
**Components used:** MenuGroup, ListGroup, Form, MenuItem, ListItem, Input, Textarea, Select, Switch, Avatar, Badge, Button
|
|
549
|
+
|
|
550
|
+
**Features:**
|
|
551
|
+
- MenuGroup with auto-separators for settings navigation
|
|
552
|
+
- ListGroup for account info display
|
|
553
|
+
- Form with sections for structured input
|
|
554
|
+
- Compound component headers and footers
|
|
555
|
+
- Mixed card and plain variants
|
|
556
|
+
|
|
557
|
+
### State Setup
|
|
558
|
+
|
|
559
|
+
```tsx
|
|
560
|
+
const [name, setName] = useState('Julian Cruz')
|
|
561
|
+
const [email, setEmail] = useState('julian@email.com')
|
|
562
|
+
const [bio, setBio] = useState('')
|
|
563
|
+
const [notifications, setNotifications] = useState(true)
|
|
564
|
+
const [darkMode, setDarkMode] = useState(false)
|
|
565
|
+
const [language, setLanguage] = useState('es')
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Implementation
|
|
569
|
+
|
|
570
|
+
```tsx
|
|
571
|
+
import { View, ScrollView, StyleSheet } from 'react-native'
|
|
572
|
+
import {
|
|
573
|
+
MenuGroup,
|
|
574
|
+
MenuItem,
|
|
575
|
+
ListGroup,
|
|
576
|
+
ListItem,
|
|
577
|
+
Form,
|
|
578
|
+
Input,
|
|
579
|
+
Textarea,
|
|
580
|
+
Select,
|
|
581
|
+
Switch,
|
|
582
|
+
Avatar,
|
|
583
|
+
Badge,
|
|
584
|
+
Button,
|
|
585
|
+
Card,
|
|
586
|
+
Text,
|
|
587
|
+
useTheme,
|
|
588
|
+
useToast,
|
|
589
|
+
} from '@retray-dev/ui-kit'
|
|
590
|
+
|
|
591
|
+
function SettingsScreen() {
|
|
592
|
+
const { colors } = useTheme()
|
|
593
|
+
const { toast } = useToast()
|
|
594
|
+
|
|
595
|
+
return (
|
|
596
|
+
<ScrollView contentContainerStyle={styles.content}>
|
|
597
|
+
{/* Profile Section with ListGroup */}
|
|
598
|
+
<Text variant="caption" style={{ marginBottom: 8, paddingHorizontal: 4 }}>
|
|
599
|
+
Profile
|
|
600
|
+
</Text>
|
|
601
|
+
<ListGroup variant="card">
|
|
602
|
+
<ListGroup.Header>Account Overview</ListGroup.Header>
|
|
603
|
+
<ListItem
|
|
604
|
+
leftRender={<Avatar fallbackText={name} size={40} status="online" />}
|
|
605
|
+
title={name}
|
|
606
|
+
subtitle={email}
|
|
607
|
+
rightRender={<Badge label="Pro" variant="success" size="sm" />}
|
|
608
|
+
onPress={() => toast.success('Profile tapped')}
|
|
609
|
+
/>
|
|
610
|
+
<ListItem
|
|
611
|
+
leftIcon="calendar"
|
|
612
|
+
title="Member since"
|
|
613
|
+
subtitle="Jan 2022"
|
|
614
|
+
rightRender="2 years"
|
|
615
|
+
/>
|
|
616
|
+
<ListItem
|
|
617
|
+
leftIcon="star"
|
|
618
|
+
title="Reviews"
|
|
619
|
+
subtitle="Total written"
|
|
620
|
+
rightRender="24"
|
|
621
|
+
/>
|
|
622
|
+
<ListGroup.Footer>Last updated today</ListGroup.Footer>
|
|
623
|
+
</ListGroup>
|
|
624
|
+
|
|
625
|
+
<View style={{ height: 24 }} />
|
|
626
|
+
|
|
627
|
+
{/* Settings Menu with MenuGroup */}
|
|
628
|
+
<Text variant="caption" style={{ marginBottom: 8, paddingHorizontal: 4 }}>
|
|
629
|
+
Account Settings
|
|
630
|
+
</Text>
|
|
631
|
+
<MenuGroup variant="card">
|
|
632
|
+
<MenuGroup.Header>Personal</MenuGroup.Header>
|
|
633
|
+
<MenuItem
|
|
634
|
+
label="Personal Information"
|
|
635
|
+
subtitle="Name, email, phone"
|
|
636
|
+
iconName="user"
|
|
637
|
+
onPress={() => toast('Personal Info')}
|
|
638
|
+
/>
|
|
639
|
+
<MenuItem
|
|
640
|
+
label="Security & Privacy"
|
|
641
|
+
iconName="shield"
|
|
642
|
+
onPress={() => toast('Security')}
|
|
643
|
+
/>
|
|
644
|
+
<MenuItem
|
|
645
|
+
label="Payments & Payouts"
|
|
646
|
+
iconName="credit-card"
|
|
647
|
+
rightRender={<Badge label="2" variant="warning" size="sm" />}
|
|
648
|
+
onPress={() => toast('Payments')}
|
|
649
|
+
/>
|
|
650
|
+
</MenuGroup>
|
|
651
|
+
|
|
652
|
+
<View style={{ height: 16 }} />
|
|
653
|
+
|
|
654
|
+
{/* Preferences with switches */}
|
|
655
|
+
<MenuGroup variant="card">
|
|
656
|
+
<MenuGroup.Header>Preferences</MenuGroup.Header>
|
|
657
|
+
<MenuItem
|
|
658
|
+
label="Notifications"
|
|
659
|
+
subtitle="Push, email, and SMS"
|
|
660
|
+
iconName="bell"
|
|
661
|
+
rightRender={
|
|
662
|
+
<Switch checked={notifications} onCheckedChange={setNotifications} />
|
|
663
|
+
}
|
|
664
|
+
onPress={() => {}}
|
|
665
|
+
/>
|
|
666
|
+
<MenuItem
|
|
667
|
+
label="Dark Mode"
|
|
668
|
+
iconName="moon"
|
|
669
|
+
rightRender={<Switch checked={darkMode} onCheckedChange={setDarkMode} />}
|
|
670
|
+
onPress={() => {}}
|
|
671
|
+
/>
|
|
672
|
+
<MenuItem
|
|
673
|
+
label="Language"
|
|
674
|
+
iconName="globe"
|
|
675
|
+
rightRender={<Text color={colors.foregroundMuted}>English</Text>}
|
|
676
|
+
onPress={() => toast('Language')}
|
|
677
|
+
/>
|
|
678
|
+
</MenuGroup>
|
|
679
|
+
|
|
680
|
+
<View style={{ height: 24 }} />
|
|
681
|
+
|
|
682
|
+
{/* Edit Profile Form */}
|
|
683
|
+
<Card>
|
|
684
|
+
<Form>
|
|
685
|
+
<Form.Section
|
|
686
|
+
title="Edit Profile"
|
|
687
|
+
description="Update your personal information"
|
|
688
|
+
>
|
|
689
|
+
<Form.Field label="Full Name" required>
|
|
690
|
+
<Input
|
|
691
|
+
value={name}
|
|
692
|
+
onChangeText={setName}
|
|
693
|
+
placeholder="Your name"
|
|
694
|
+
prefixIcon="user"
|
|
695
|
+
/>
|
|
696
|
+
</Form.Field>
|
|
697
|
+
|
|
698
|
+
<Form.Field label="Email" required>
|
|
699
|
+
<Input
|
|
700
|
+
value={email}
|
|
701
|
+
onChangeText={setEmail}
|
|
702
|
+
placeholder="you@example.com"
|
|
703
|
+
keyboardType="email-address"
|
|
704
|
+
prefixIcon="mail"
|
|
705
|
+
/>
|
|
706
|
+
</Form.Field>
|
|
707
|
+
|
|
708
|
+
<Form.Field label="Bio">
|
|
709
|
+
<Textarea
|
|
710
|
+
value={bio}
|
|
711
|
+
onChangeText={setBio}
|
|
712
|
+
placeholder="Tell us about yourself"
|
|
713
|
+
rows={3}
|
|
714
|
+
/>
|
|
715
|
+
</Form.Field>
|
|
716
|
+
|
|
717
|
+
<Form.Field label="Language">
|
|
718
|
+
<Select
|
|
719
|
+
value={language}
|
|
720
|
+
onValueChange={setLanguage}
|
|
721
|
+
options={[
|
|
722
|
+
{ label: 'English', value: 'en' },
|
|
723
|
+
{ label: 'Español', value: 'es' },
|
|
724
|
+
{ label: 'Français', value: 'fr' },
|
|
725
|
+
]}
|
|
726
|
+
/>
|
|
727
|
+
</Form.Field>
|
|
728
|
+
</Form.Section>
|
|
729
|
+
|
|
730
|
+
<Form.Footer>
|
|
731
|
+
<Button
|
|
732
|
+
label="Cancel"
|
|
733
|
+
variant="secondary"
|
|
734
|
+
onPress={() => toast('Cancelled')}
|
|
735
|
+
/>
|
|
736
|
+
<Button
|
|
737
|
+
label="Save Changes"
|
|
738
|
+
onPress={() => toast.success('Profile updated')}
|
|
739
|
+
/>
|
|
740
|
+
</Form.Footer>
|
|
741
|
+
</Form>
|
|
742
|
+
</Card>
|
|
743
|
+
|
|
744
|
+
<View style={{ height: 24 }} />
|
|
745
|
+
|
|
746
|
+
{/* Support MenuGroup */}
|
|
747
|
+
<Text variant="caption" style={{ marginBottom: 8, paddingHorizontal: 4 }}>
|
|
748
|
+
Support
|
|
749
|
+
</Text>
|
|
750
|
+
<MenuGroup variant="card">
|
|
751
|
+
<MenuItem
|
|
752
|
+
label="Help Center"
|
|
753
|
+
iconName="help-circle"
|
|
754
|
+
onPress={() => toast('Help')}
|
|
755
|
+
/>
|
|
756
|
+
<MenuItem
|
|
757
|
+
label="Report an Issue"
|
|
758
|
+
iconName="alert-triangle"
|
|
759
|
+
onPress={() => toast('Report')}
|
|
760
|
+
/>
|
|
761
|
+
<MenuItem
|
|
762
|
+
label="Terms of Service"
|
|
763
|
+
iconName="file-text"
|
|
764
|
+
onPress={() => toast('Terms')}
|
|
765
|
+
/>
|
|
766
|
+
</MenuGroup>
|
|
767
|
+
|
|
768
|
+
<View style={{ height: 32 }} />
|
|
769
|
+
</ScrollView>
|
|
770
|
+
)
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
const styles = StyleSheet.create({
|
|
774
|
+
content: {
|
|
775
|
+
padding: 16,
|
|
776
|
+
paddingBottom: 48,
|
|
777
|
+
},
|
|
778
|
+
})
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
**Key patterns demonstrated:**
|
|
782
|
+
|
|
783
|
+
1. **MenuGroup auto-separators** — No need to add `showSeparator` to each MenuItem
|
|
784
|
+
2. **ListGroup with header/footer** — Compound components for structured lists
|
|
785
|
+
3. **Form.Section** — Grouped fields with title and description
|
|
786
|
+
4. **Form.Footer** — Button row with automatic spacing
|
|
787
|
+
5. **Mixed variants** — `variant="card"` for standalone groups, `variant="plain"` inside Card
|
|
788
|
+
6. **rightRender flexibility** — Switch, Badge, Text, or custom content
|
|
789
|
+
|
|
790
|
+
---
|
|
791
|
+
|
|
544
792
|
## Common Patterns
|
|
545
793
|
|
|
546
794
|
### Full-Screen Overlay Pattern
|
|
@@ -644,7 +892,7 @@ These examples are live in the `example/` app included with the source. To run t
|
|
|
644
892
|
|
|
645
893
|
```bash
|
|
646
894
|
# Clone the repo
|
|
647
|
-
git clone https://github.com/
|
|
895
|
+
git clone https://github.com/retray-dev/retray-ui-kit
|
|
648
896
|
cd retray-ui-kit
|
|
649
897
|
|
|
650
898
|
# Install dependencies
|
|
@@ -659,7 +907,7 @@ pnpm start
|
|
|
659
907
|
# Or: pnpm ios / pnpm android
|
|
660
908
|
```
|
|
661
909
|
|
|
662
|
-
Inside the example app,
|
|
910
|
+
Inside the example app, open the **Compose** tab in the bottom tab bar to browse the composed screen patterns alongside the per-category component showcases (Display, Form, Surfaces, Data, Demos, Theme).
|
|
663
911
|
|
|
664
912
|
---
|
|
665
913
|
|
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A personal React Native / Expo UI component library with a built-in design system, dark mode support, haptic feedback, and smooth animations.
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- Light/dark theme with 12 public tokens (
|
|
5
|
+
- 49 components across 9 categories (plus the deep-import `HolographicCard`)
|
|
6
|
+
- Light/dark theme with 12 public tokens (25 resolved) and full customization
|
|
7
7
|
- Apple HIG–compliant touch targets and haptic feedback
|
|
8
8
|
- Animated interactions: spring press, sliding tabs, accordion easing, animated progress
|
|
9
9
|
- Built with TypeScript — full type declarations included
|
|
@@ -23,11 +23,15 @@ pnpm add @retray-dev/ui-kit
|
|
|
23
23
|
Install these in your app if not already present:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
pnpm add expo-font expo-haptics expo-linear-gradient react-native-safe-area-context @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-worklets @react-native-picker/picker @react-native-community/slider @expo/vector-icons
|
|
26
|
+
pnpm add expo-font expo-haptics expo-linear-gradient react-native-safe-area-context @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-worklets @react-native-picker/picker @react-native-community/slider @expo/vector-icons react-native-size-matters react-native-svg react-native-screens sonner-native pressto
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
For Expo projects, run `npx expo install` instead to get SDK-compatible versions.
|
|
30
30
|
|
|
31
|
+
`pressto` is **required** — it powers the press animations on every interactive component. Omitting it crashes the import. `sonner-native` is **required** for `Toast`.
|
|
32
|
+
|
|
33
|
+
**Optional:** for richer haptics in a custom dev build (not Expo Go), also `pnpm add react-native-pulsar`. The kit falls back to `expo-haptics` automatically when it is absent. For the deep-import `HolographicCard`, add `@shopify/react-native-skia expo-sensors`.
|
|
34
|
+
|
|
31
35
|
Add the Worklets Babel plugin to `babel.config.js` (required by `@gorhom/bottom-sheet`):
|
|
32
36
|
|
|
33
37
|
```js
|
|
@@ -42,14 +46,14 @@ module.exports = function (api) {
|
|
|
42
46
|
|
|
43
47
|
## Typography
|
|
44
48
|
|
|
45
|
-
All components use **
|
|
49
|
+
All components use **Sohne** font family. You must load the fonts at app root before rendering any component:
|
|
46
50
|
|
|
47
51
|
```tsx
|
|
48
52
|
import { useFonts } from 'expo-font'
|
|
49
|
-
import {
|
|
53
|
+
import { SohneFonts } from '@retray-dev/ui-kit/fonts'
|
|
50
54
|
|
|
51
55
|
export default function App() {
|
|
52
|
-
const [fontsLoaded] = useFonts(
|
|
56
|
+
const [fontsLoaded] = useFonts(SohneFonts)
|
|
53
57
|
if (!fontsLoaded) return null
|
|
54
58
|
|
|
55
59
|
return (
|
|
@@ -58,7 +62,7 @@ export default function App() {
|
|
|
58
62
|
}
|
|
59
63
|
```
|
|
60
64
|
|
|
61
|
-
The library ships
|
|
65
|
+
The library ships 28 font files (14 Sohne base + 14 SohneMono, each with 7 weights + italic variants) as raw `.otf` files. Metro resolves them at bundle time.
|
|
62
66
|
|
|
63
67
|
## Setup
|
|
64
68
|
|
|
@@ -113,9 +117,9 @@ import { useTheme } from '@retray-dev/ui-kit'
|
|
|
113
117
|
const { colors, colorScheme } = useTheme()
|
|
114
118
|
```
|
|
115
119
|
|
|
116
|
-
**Public tokens (12 — override these):** `background`, `foreground`, `card`, `primary`, `primaryForeground`, `border`, `destructive`, `destructiveForeground`, `success`, `successForeground`, `warning`, `warningForeground`
|
|
120
|
+
**Public tokens (12 — override these):** `background`, `foreground`, `card`, `primary`, `primaryForeground`, `border`, `destructive`, `destructiveForeground`, `success`, `successForeground`, `warning`, `warningForeground`. Optional: `overlay`, `accent`, `accentForeground`.
|
|
117
121
|
|
|
118
|
-
**Derived tokens (read-only via `useTheme()`):** `foregroundSubtle`, `foregroundMuted`, `surface`, `surfaceStrong`, `destructiveTint`, `destructiveBorder`, `successTint`, `successBorder`, `warningTint`, `warningBorder`, `ring`, `input`
|
|
122
|
+
**Derived tokens (read-only via `useTheme()`):** `foregroundSubtle`, `foregroundMuted`, `surface`, `surfaceStrong`, `destructiveTint`, `destructiveBorder`, `successTint`, `successBorder`, `warningTint`, `warningBorder`, `ring`, `input`, `separator`, `overlay`, `accentResolved`, `accentForegroundResolved`
|
|
119
123
|
|
|
120
124
|
## Design Tokens
|
|
121
125
|
|
|
@@ -141,13 +145,16 @@ import { SPACING, ICON_SIZES, RADIUS, SHADOWS, BREAKPOINTS, TYPOGRAPHY } from '@
|
|
|
141
145
|
| Category | Components |
|
|
142
146
|
| ----------- | ----------------------------------------------------------------------------------------------- |
|
|
143
147
|
| Display | `Text`, `Badge`, `Avatar`, `Separator`, `Spinner`, `Skeleton`, `Progress`, `CurrencyDisplay` |
|
|
144
|
-
| Surfaces | `Card`, `AlertBanner`, `EmptyState`, `MediaCard`
|
|
145
|
-
| Form | `Button`, `ButtonGroup`, `IconButton`, `Input`, `CurrencyInput`, `Textarea`, `Checkbox`, `Switch`, `Toggle`, `RadioGroup`, `Select`, `Slider` |
|
|
148
|
+
| Surfaces | `Card`, `AlertBanner`, `EmptyState`, `MediaCard`, `PricingCard` |
|
|
149
|
+
| Form | `Form` (+ `Form.Field` / `Form.Section` / `Form.Footer`), `Button`, `ButtonGroup`, `IconButton`, `Input`, `CurrencyInput`, `Textarea`, `Checkbox`, `Switch`, `Toggle`, `RadioGroup`, `Select`, `Slider`, `SelectableGrid` |
|
|
146
150
|
| Composition | `Tabs`, `Accordion` |
|
|
147
|
-
|
|
|
151
|
+
| Navigation | `AppHeader`, `TabBar`, `PagerDots` |
|
|
152
|
+
| Overlays | `Sheet`, `ConfirmDialog`, `ImageViewer` |
|
|
148
153
|
| Feedback | `Toast` / `ToastProvider` / `useToast` |
|
|
149
|
-
| Data | `ListItem`, `Chip` / `ChipGroup`, `LabelValue`, `MonthPicker`, `CategoryStrip`, `DetailRow`
|
|
150
|
-
| Utilities | `Pressable`
|
|
154
|
+
| Data | `ListItem`, `ListGroup` (+ `.Header` / `.Footer`), `MenuItem`, `MenuGroup` (+ `.Header` / `.Footer`), `VirtualList`, `Chip` / `ChipGroup`, `LabelValue`, `MonthPicker`, `CategoryStrip`, `DetailRow` |
|
|
155
|
+
| Utilities | `Pressable`, `Icon`, `RetrayProvider`, `ErrorBoundary` |
|
|
156
|
+
|
|
157
|
+
Deep-import only: `HolographicCard` — `import { HolographicCard } from '@retray-dev/ui-kit/HolographicCard'`.
|
|
151
158
|
|
|
152
159
|
### Quick examples
|
|
153
160
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface AccordionItem {
|
|
5
|
+
value: string;
|
|
6
|
+
trigger: string;
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
/** Icon name from @expo/vector-icons rendered left of trigger. */
|
|
9
|
+
iconName?: string;
|
|
10
|
+
/** Custom icon node rendered left of trigger. */
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/** Override icon color. Defaults to foregroundMuted. */
|
|
13
|
+
iconColor?: string;
|
|
14
|
+
}
|
|
15
|
+
interface AccordionProps {
|
|
16
|
+
items: AccordionItem[];
|
|
17
|
+
/**
|
|
18
|
+
* - `'single'` (default): only one item can be open at a time. Opening another closes the current one.
|
|
19
|
+
* - `'multiple'`: any number of items can be open simultaneously.
|
|
20
|
+
*/
|
|
21
|
+
type?: 'single' | 'multiple';
|
|
22
|
+
/** Item value(s) that should be open on first render. */
|
|
23
|
+
defaultValue?: string | string[];
|
|
24
|
+
style?: ViewStyle;
|
|
25
|
+
}
|
|
26
|
+
declare function Accordion({ items, type, defaultValue, style }: AccordionProps): React.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { Accordion, type AccordionItem, type AccordionProps };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface AccordionItem {
|
|
5
|
+
value: string;
|
|
6
|
+
trigger: string;
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
/** Icon name from @expo/vector-icons rendered left of trigger. */
|
|
9
|
+
iconName?: string;
|
|
10
|
+
/** Custom icon node rendered left of trigger. */
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/** Override icon color. Defaults to foregroundMuted. */
|
|
13
|
+
iconColor?: string;
|
|
14
|
+
}
|
|
15
|
+
interface AccordionProps {
|
|
16
|
+
items: AccordionItem[];
|
|
17
|
+
/**
|
|
18
|
+
* - `'single'` (default): only one item can be open at a time. Opening another closes the current one.
|
|
19
|
+
* - `'multiple'`: any number of items can be open simultaneously.
|
|
20
|
+
*/
|
|
21
|
+
type?: 'single' | 'multiple';
|
|
22
|
+
/** Item value(s) that should be open on first render. */
|
|
23
|
+
defaultValue?: string | string[];
|
|
24
|
+
style?: ViewStyle;
|
|
25
|
+
}
|
|
26
|
+
declare function Accordion({ items, type, defaultValue, style }: AccordionProps): React.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { Accordion, type AccordionItem, type AccordionProps };
|