@expokit/cli 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +46 -2
- package/bin/expo-kit.js +1266 -0
- package/bin/lib.mjs +343 -0
- package/bin/mcp.mjs +345 -0
- package/package.json +49 -4
- package/registry/_docs/accordion.json +115 -0
- package/registry/_docs/action-sheet.json +138 -0
- package/registry/_docs/alert.json +155 -0
- package/registry/_docs/avatar.json +227 -0
- package/registry/_docs/badge.json +148 -0
- package/registry/_docs/bottom-nav.json +143 -0
- package/registry/_docs/bottom-sheet.json +186 -0
- package/registry/_docs/bullet.json +27 -0
- package/registry/_docs/button-3d.json +138 -0
- package/registry/_docs/button.json +131 -0
- package/registry/_docs/calendar.json +198 -0
- package/registry/_docs/card-stack.json +124 -0
- package/registry/_docs/card.json +131 -0
- package/registry/_docs/carousel.json +122 -0
- package/registry/_docs/chat.json +184 -0
- package/registry/_docs/checkbox.json +109 -0
- package/registry/_docs/checkout.json +105 -0
- package/registry/_docs/chip-group.json +132 -0
- package/registry/_docs/color-swatch.json +82 -0
- package/registry/_docs/confetti.json +102 -0
- package/registry/_docs/coupon.json +192 -0
- package/registry/_docs/cube-pager.json +100 -0
- package/registry/_docs/dashboard.json +123 -0
- package/registry/_docs/date-picker.json +269 -0
- package/registry/_docs/dialog.json +186 -0
- package/registry/_docs/drawer.json +199 -0
- package/registry/_docs/fab.json +144 -0
- package/registry/_docs/flip-card.json +127 -0
- package/registry/_docs/floating-input.json +211 -0
- package/registry/_docs/gift-card.json +124 -0
- package/registry/_docs/glass-button.json +142 -0
- package/registry/_docs/glass-nav-bar.json +102 -0
- package/registry/_docs/glass-search-bar.json +114 -0
- package/registry/_docs/glass-segmented.json +94 -0
- package/registry/_docs/glass-sheet.json +136 -0
- package/registry/_docs/glass-tab-bar.json +100 -0
- package/registry/_docs/glass.json +94 -0
- package/registry/_docs/inbox.json +75 -0
- package/registry/_docs/isometric-bar.json +75 -0
- package/registry/_docs/kit.json +14 -0
- package/registry/_docs/kpi-card.json +14 -0
- package/registry/_docs/like-button.json +92 -0
- package/registry/_docs/liquidglass-tab.json +30 -0
- package/registry/_docs/list-item.json +216 -0
- package/registry/_docs/loyalty-card.json +124 -0
- package/registry/_docs/morph-button.json +128 -0
- package/registry/_docs/number-ticker.json +112 -0
- package/registry/_docs/offers.json +81 -0
- package/registry/_docs/onboarding.json +69 -0
- package/registry/_docs/otp-input.json +158 -0
- package/registry/_docs/pagination-dots.json +108 -0
- package/registry/_docs/parallax-layers.json +104 -0
- package/registry/_docs/parallax-scroll.json +210 -0
- package/registry/_docs/password-input.json +112 -0
- package/registry/_docs/payment-card.json +169 -0
- package/registry/_docs/pixel-bar.json +69 -0
- package/registry/_docs/polar-area.json +81 -0
- package/registry/_docs/profile.json +87 -0
- package/registry/_docs/progress-steps.json +116 -0
- package/registry/_docs/progress.json +152 -0
- package/registry/_docs/radio-group.json +112 -0
- package/registry/_docs/rating.json +114 -0
- package/registry/_docs/ring-carousel.json +122 -0
- package/registry/_docs/scratch-card.json +110 -0
- package/registry/_docs/search-bar.json +160 -0
- package/registry/_docs/search-results.json +123 -0
- package/registry/_docs/segmented-control.json +123 -0
- package/registry/_docs/select.json +277 -0
- package/registry/_docs/settings.json +75 -0
- package/registry/_docs/shimmer-button.json +98 -0
- package/registry/_docs/sign-in.json +201 -0
- package/registry/_docs/skeleton.json +162 -0
- package/registry/_docs/slide-to-confirm.json +108 -0
- package/registry/_docs/slider.json +177 -0
- package/registry/_docs/spin-wheel.json +138 -0
- package/registry/_docs/spinner.json +121 -0
- package/registry/_docs/stateful-button.json +184 -0
- package/registry/_docs/stepper.json +184 -0
- package/registry/_docs/swipe-deck.json +118 -0
- package/registry/_docs/swipeable-row.json +95 -0
- package/registry/_docs/switch.json +124 -0
- package/registry/_docs/tabs.json +129 -0
- package/registry/_docs/tag-input.json +148 -0
- package/registry/_docs/text-animation.json +141 -0
- package/registry/_docs/textarea.json +191 -0
- package/registry/_docs/ticket-card.json +194 -0
- package/registry/_docs/ticket-shape.json +14 -0
- package/registry/_docs/tilt-card.json +157 -0
- package/registry/_docs/time-picker.json +269 -0
- package/registry/_docs/timeline-chart.json +33 -0
- package/registry/_docs/timeline.json +172 -0
- package/registry/_docs/toast.json +185 -0
- package/registry/_docs/treemap.json +33 -0
- package/registry/_docs/waterfall.json +39 -0
- package/registry/_docs/wheel-list.json +122 -0
- package/registry/accordion/files/src/components/ui/accordion.tsx +233 -0
- package/registry/accordion/files/src/lib/kit.tsx +219 -0
- package/registry/accordion.json +17 -0
- package/registry/action-sheet/files/src/components/ui/action-sheet.tsx +580 -0
- package/registry/action-sheet/files/src/lib/kit.tsx +219 -0
- package/registry/action-sheet.json +18 -0
- package/registry/alert/files/src/components/ui/alert.tsx +654 -0
- package/registry/alert/files/src/components/ui/button.tsx +274 -0
- package/registry/alert/files/src/lib/kit.tsx +219 -0
- package/registry/alert.json +20 -0
- package/registry/avatar/files/src/components/ui/avatar.tsx +790 -0
- package/registry/avatar/files/src/lib/kit.tsx +219 -0
- package/registry/avatar.json +18 -0
- package/registry/badge/files/src/components/ui/badge.tsx +626 -0
- package/registry/badge/files/src/lib/kit.tsx +219 -0
- package/registry/badge.json +17 -0
- package/registry/bottom-nav/files/src/components/ui/bottom-nav.tsx +1050 -0
- package/registry/bottom-nav/files/src/lib/kit.tsx +219 -0
- package/registry/bottom-nav.json +18 -0
- package/registry/bottom-sheet/files/src/components/ui/bottom-sheet.tsx +585 -0
- package/registry/bottom-sheet/files/src/lib/kit.tsx +219 -0
- package/registry/bottom-sheet.json +17 -0
- package/registry/bullet.json +14 -0
- package/registry/button/files/src/components/ui/button.tsx +274 -0
- package/registry/button/files/src/lib/kit.tsx +219 -0
- package/registry/button-3d/files/src/components/ui/button-3d.tsx +212 -0
- package/registry/button-3d/files/src/lib/kit.tsx +219 -0
- package/registry/button-3d.json +18 -0
- package/registry/button.json +18 -0
- package/registry/calendar/files/src/components/ui/calendar.tsx +822 -0
- package/registry/calendar/files/src/lib/kit.tsx +219 -0
- package/registry/calendar.json +17 -0
- package/registry/card/files/src/components/ui/card.tsx +300 -0
- package/registry/card/files/src/lib/kit.tsx +219 -0
- package/registry/card-stack.json +15 -0
- package/registry/card.json +17 -0
- package/registry/carousel.json +15 -0
- package/registry/chat.json +18 -0
- package/registry/checkbox/files/src/components/ui/checkbox.tsx +150 -0
- package/registry/checkbox/files/src/lib/kit.tsx +219 -0
- package/registry/checkbox.json +17 -0
- package/registry/checkout.json +26 -0
- package/registry/chip-group/files/src/components/ui/chip-group.tsx +269 -0
- package/registry/chip-group/files/src/lib/kit.tsx +219 -0
- package/registry/chip-group.json +17 -0
- package/registry/color-swatch.json +17 -0
- package/registry/confetti/files/src/components/ui/confetti.tsx +222 -0
- package/registry/confetti/files/src/lib/kit.tsx +219 -0
- package/registry/confetti.json +15 -0
- package/registry/coupon/files/src/components/ui/coupon.tsx +698 -0
- package/registry/coupon/files/src/components/ui/flip-card.tsx +205 -0
- package/registry/coupon/files/src/components/ui/tilt-card.tsx +635 -0
- package/registry/coupon/files/src/lib/kit.tsx +219 -0
- package/registry/coupon/files/src/lib/ticket-shape.tsx +543 -0
- package/registry/coupon.json +23 -0
- package/registry/cube-pager.json +15 -0
- package/registry/dashboard.json +32 -0
- package/registry/date-picker/files/src/components/ui/calendar.tsx +822 -0
- package/registry/date-picker/files/src/components/ui/date-picker.tsx +796 -0
- package/registry/date-picker/files/src/lib/kit.tsx +219 -0
- package/registry/date-picker.json +19 -0
- package/registry/dialog/files/src/components/ui/dialog.tsx +759 -0
- package/registry/dialog/files/src/lib/kit.tsx +219 -0
- package/registry/dialog.json +18 -0
- package/registry/drawer/files/src/components/ui/drawer.tsx +1135 -0
- package/registry/drawer/files/src/lib/kit.tsx +219 -0
- package/registry/drawer.json +18 -0
- package/registry/fab.json +18 -0
- package/registry/flip-card/files/src/components/ui/flip-card.tsx +205 -0
- package/registry/flip-card/files/src/lib/kit.tsx +219 -0
- package/registry/flip-card.json +15 -0
- package/registry/floating-input/files/src/components/ui/floating-input.tsx +528 -0
- package/registry/floating-input/files/src/lib/kit.tsx +219 -0
- package/registry/floating-input.json +17 -0
- package/registry/gift-card.json +21 -0
- package/registry/glass-button.json +22 -0
- package/registry/glass-nav-bar.json +21 -0
- package/registry/glass-search-bar.json +21 -0
- package/registry/glass-segmented.json +22 -0
- package/registry/glass-sheet.json +22 -0
- package/registry/glass-tab-bar.json +22 -0
- package/registry/glass.json +19 -0
- package/registry/inbox.json +30 -0
- package/registry/isometric-bar.json +14 -0
- package/registry/kit/files/src/lib/kit.tsx +219 -0
- package/registry/kit.json +11 -0
- package/registry/kpi-card/files/src/components/charts/kpi-card.tsx +45 -0
- package/registry/kpi-card.json +14 -0
- package/registry/like-button.json +18 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/_layout.tsx +97 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/alerts.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/explore.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/index.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/profile.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/_layout.tsx +33 -0
- package/registry/liquidglass-tab/files/src/components/GlassTabBar.tsx +259 -0
- package/registry/liquidglass-tab/files/src/components/TabScreen.tsx +122 -0
- package/registry/liquidglass-tab/files/src/lib/tab-bar.ts +61 -0
- package/registry/liquidglass-tab/files/src/lib/tab-icons.ts +130 -0
- package/registry/liquidglass-tab/files/src/lib/tabs.ts +108 -0
- package/registry/liquidglass-tab.json +23 -0
- package/registry/list-item/files/src/components/ui/list-item.tsx +508 -0
- package/registry/list-item/files/src/lib/kit.tsx +219 -0
- package/registry/list-item.json +17 -0
- package/registry/loyalty-card.json +23 -0
- package/registry/morph-button.json +18 -0
- package/registry/number-ticker.json +15 -0
- package/registry/offers.json +24 -0
- package/registry/onboarding.json +17 -0
- package/registry/otp-input/files/src/components/ui/otp-input.tsx +380 -0
- package/registry/otp-input/files/src/lib/kit.tsx +219 -0
- package/registry/otp-input.json +17 -0
- package/registry/pagination-dots/files/src/components/ui/pagination-dots.tsx +262 -0
- package/registry/pagination-dots/files/src/lib/kit.tsx +219 -0
- package/registry/pagination-dots.json +15 -0
- package/registry/parallax-layers.json +15 -0
- package/registry/parallax-scroll.json +17 -0
- package/registry/password-input/files/src/components/ui/floating-input.tsx +528 -0
- package/registry/password-input/files/src/components/ui/password-input.tsx +271 -0
- package/registry/password-input/files/src/lib/kit.tsx +219 -0
- package/registry/password-input.json +19 -0
- package/registry/payment-card/files/src/components/ui/flip-card.tsx +205 -0
- package/registry/payment-card/files/src/components/ui/payment-card.tsx +385 -0
- package/registry/payment-card/files/src/components/ui/tilt-card.tsx +635 -0
- package/registry/payment-card/files/src/lib/kit.tsx +219 -0
- package/registry/payment-card.json +21 -0
- package/registry/pixel-bar.json +14 -0
- package/registry/polar-area.json +14 -0
- package/registry/profile.json +17 -0
- package/registry/progress/files/src/components/ui/progress.tsx +883 -0
- package/registry/progress/files/src/lib/kit.tsx +219 -0
- package/registry/progress-steps/files/src/components/ui/progress-steps.tsx +559 -0
- package/registry/progress-steps/files/src/lib/kit.tsx +219 -0
- package/registry/progress-steps.json +18 -0
- package/registry/progress.json +17 -0
- package/registry/radio-group/files/src/components/ui/radio-group.tsx +327 -0
- package/registry/radio-group/files/src/lib/kit.tsx +219 -0
- package/registry/radio-group.json +18 -0
- package/registry/rating.json +18 -0
- package/registry/ring-carousel.json +15 -0
- package/registry/scratch-card.json +18 -0
- package/registry/search-bar/files/src/components/ui/search-bar.tsx +530 -0
- package/registry/search-bar/files/src/lib/kit.tsx +219 -0
- package/registry/search-bar.json +17 -0
- package/registry/search-results.json +30 -0
- package/registry/segmented-control/files/src/components/ui/segmented-control.tsx +341 -0
- package/registry/segmented-control/files/src/lib/kit.tsx +219 -0
- package/registry/segmented-control.json +18 -0
- package/registry/select/files/src/components/ui/select.tsx +1398 -0
- package/registry/select/files/src/lib/kit.tsx +219 -0
- package/registry/select.json +17 -0
- package/registry/settings.json +26 -0
- package/registry/shimmer-button.json +17 -0
- package/registry/sign-in.json +26 -0
- package/registry/skeleton/files/src/components/ui/skeleton.tsx +799 -0
- package/registry/skeleton/files/src/lib/kit.tsx +219 -0
- package/registry/skeleton.json +17 -0
- package/registry/slide-to-confirm.json +18 -0
- package/registry/slider/files/src/components/ui/slider.tsx +716 -0
- package/registry/slider/files/src/lib/kit.tsx +219 -0
- package/registry/slider.json +17 -0
- package/registry/spin-wheel.json +18 -0
- package/registry/spinner/files/src/components/ui/spinner.tsx +748 -0
- package/registry/spinner/files/src/lib/kit.tsx +219 -0
- package/registry/spinner.json +17 -0
- package/registry/stateful-button/files/src/components/ui/stateful-button.tsx +532 -0
- package/registry/stateful-button/files/src/lib/kit.tsx +219 -0
- package/registry/stateful-button.json +18 -0
- package/registry/stepper/files/src/components/ui/stepper.tsx +646 -0
- package/registry/stepper/files/src/lib/kit.tsx +219 -0
- package/registry/stepper.json +17 -0
- package/registry/swipe-deck.json +15 -0
- package/registry/swipeable-row.json +15 -0
- package/registry/switch/files/src/components/ui/switch.tsx +344 -0
- package/registry/switch/files/src/lib/kit.tsx +219 -0
- package/registry/switch.json +18 -0
- package/registry/tabs/files/src/components/ui/tabs.tsx +539 -0
- package/registry/tabs/files/src/lib/kit.tsx +219 -0
- package/registry/tabs.json +17 -0
- package/registry/tag-input/files/src/components/ui/tag-input.tsx +720 -0
- package/registry/tag-input/files/src/lib/kit.tsx +219 -0
- package/registry/tag-input.json +17 -0
- package/registry/text-animation/files/src/components/ui/text-animation.tsx +650 -0
- package/registry/text-animation/files/src/lib/kit.tsx +219 -0
- package/registry/text-animation.json +15 -0
- package/registry/textarea/files/src/components/ui/textarea.tsx +553 -0
- package/registry/textarea/files/src/lib/kit.tsx +219 -0
- package/registry/textarea.json +17 -0
- package/registry/ticket-card.json +24 -0
- package/registry/ticket-shape/files/src/lib/kit.tsx +219 -0
- package/registry/ticket-shape/files/src/lib/ticket-shape.tsx +543 -0
- package/registry/ticket-shape.json +17 -0
- package/registry/tilt-card/files/src/components/ui/tilt-card.tsx +635 -0
- package/registry/tilt-card/files/src/lib/kit.tsx +219 -0
- package/registry/tilt-card.json +17 -0
- package/registry/time-picker/files/src/components/ui/time-picker.tsx +1159 -0
- package/registry/time-picker/files/src/lib/kit.tsx +219 -0
- package/registry/time-picker.json +17 -0
- package/registry/timeline/files/src/components/ui/avatar.tsx +790 -0
- package/registry/timeline/files/src/components/ui/timeline.tsx +1059 -0
- package/registry/timeline/files/src/lib/kit.tsx +219 -0
- package/registry/timeline-chart.json +14 -0
- package/registry/timeline.json +20 -0
- package/registry/toast/files/src/components/ui/button.tsx +274 -0
- package/registry/toast/files/src/components/ui/toast.tsx +1284 -0
- package/registry/toast/files/src/lib/kit.tsx +219 -0
- package/registry/toast.json +20 -0
- package/registry/treemap.json +14 -0
- package/registry/waterfall.json +14 -0
- package/registry/wheel-list.json +17 -0
- package/schema/components.schema.json +13 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "number-ticker",
|
|
3
|
+
"category": "Motion",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "NumberTicker",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/number-ticker.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Each digit rolls like an odometer, flashing green or red as it changes.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"value",
|
|
13
|
+
"number",
|
|
14
|
+
"—",
|
|
15
|
+
"The number to show."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"decimals",
|
|
19
|
+
"number",
|
|
20
|
+
"0",
|
|
21
|
+
"Digits after the decimal point."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"prefix / suffix",
|
|
25
|
+
"string",
|
|
26
|
+
"—",
|
|
27
|
+
"Static text around the number (\"₹\", \"%\")."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"separator",
|
|
31
|
+
"string | false",
|
|
32
|
+
"\",\"",
|
|
33
|
+
"Thousands separator."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"grouping",
|
|
37
|
+
"'thousands' | 'indian'",
|
|
38
|
+
"'thousands'",
|
|
39
|
+
"Digit grouping: 1,234,567 or lakh / crore style 12,34,567."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"decimalSeparator",
|
|
43
|
+
"string",
|
|
44
|
+
"\".\"",
|
|
45
|
+
"Decimal point."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"size",
|
|
49
|
+
"\"sm\" | \"md\" | \"lg\" | \"xl\" | number",
|
|
50
|
+
"\"md\"",
|
|
51
|
+
"18 / 28 / 40 / 56pt, or a font size."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"fontWeight",
|
|
55
|
+
"TextStyle['fontWeight']",
|
|
56
|
+
"\"500\"",
|
|
57
|
+
"Weight of the digits."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"color",
|
|
61
|
+
"string",
|
|
62
|
+
"theme foreground",
|
|
63
|
+
"Text colour."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"flash",
|
|
67
|
+
"boolean",
|
|
68
|
+
"true",
|
|
69
|
+
"Tint green on increase, red on decrease."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"animateOnMount",
|
|
73
|
+
"boolean",
|
|
74
|
+
"true",
|
|
75
|
+
"Roll up from zero on first render."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"stagger",
|
|
79
|
+
"number",
|
|
80
|
+
"35",
|
|
81
|
+
"Delay between columns in ms."
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"textStyle",
|
|
85
|
+
"StyleProp<TextStyle>",
|
|
86
|
+
"—",
|
|
87
|
+
"Extra glyph styles."
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"style",
|
|
91
|
+
"StyleProp<ViewStyle>",
|
|
92
|
+
"—",
|
|
93
|
+
"Style for the row of digits."
|
|
94
|
+
]
|
|
95
|
+
],
|
|
96
|
+
"behavior": [
|
|
97
|
+
[
|
|
98
|
+
"Motion",
|
|
99
|
+
"Each digit springs along its own 0–9 strip, up when the value grows and down when it shrinks, staggered right to left. The text briefly tints green or red on every change."
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"Screen readers",
|
|
103
|
+
"The whole number is one text element, read with its prefix and suffix instead of digit by digit."
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"Platforms",
|
|
107
|
+
"Plain Animated views on iOS, Android and web. The digit rolls use the native driver; only the colour flash runs in JS."
|
|
108
|
+
]
|
|
109
|
+
],
|
|
110
|
+
"usage": null,
|
|
111
|
+
"examples": []
|
|
112
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "offers",
|
|
3
|
+
"category": "Blocks",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Offers",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/blocks/offers.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": null,
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"offers",
|
|
13
|
+
"Offer[]",
|
|
14
|
+
"sample food-delivery offers",
|
|
15
|
+
"Coupon props plus { id, category?, minOrder?, saves? } — saves is an amount or (total) => amount."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"featuredId",
|
|
19
|
+
"string | null",
|
|
20
|
+
"first offer",
|
|
21
|
+
"The offer shown big at the top in 3D; null hides it."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"cartTotal",
|
|
25
|
+
"number",
|
|
26
|
+
"549",
|
|
27
|
+
"Decides which coupons are locked and what you save."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"appliedId / defaultAppliedId / onApply",
|
|
31
|
+
"string | null / string | null / (offer | null) => void",
|
|
32
|
+
"— / null / —",
|
|
33
|
+
"Controlled or uncontrolled applied coupon; null means removed."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"onRedeemCode",
|
|
37
|
+
"(code) => Offer | null | Promise<…>",
|
|
38
|
+
"match by code",
|
|
39
|
+
"Look up a typed code (e.g. on your server)."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"onCopy",
|
|
43
|
+
"(code) => void",
|
|
44
|
+
"—",
|
|
45
|
+
"Code chips — wire to expo-clipboard."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"onBack",
|
|
49
|
+
"() => void",
|
|
50
|
+
"—",
|
|
51
|
+
"Shows the back button."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"onDone",
|
|
55
|
+
"(offer | null) => void",
|
|
56
|
+
"—",
|
|
57
|
+
"Shows the To pay footer with a Done button."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"currency / formatPrice",
|
|
61
|
+
"string / (amount) => string",
|
|
62
|
+
"'₹' / Indian grouping",
|
|
63
|
+
"Money formatting."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"labels",
|
|
67
|
+
"Partial<OffersLabels>",
|
|
68
|
+
"English",
|
|
69
|
+
"Every string, with {code} and {amount} placeholders."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"style",
|
|
73
|
+
"StyleProp<ViewStyle>",
|
|
74
|
+
"—",
|
|
75
|
+
"Root style."
|
|
76
|
+
]
|
|
77
|
+
],
|
|
78
|
+
"behavior": [],
|
|
79
|
+
"usage": null,
|
|
80
|
+
"examples": []
|
|
81
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "onboarding",
|
|
3
|
+
"category": "Blocks",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Onboarding",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/blocks/onboarding.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": null,
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"steps",
|
|
13
|
+
"{ title, body, illustration?, color? }[]",
|
|
14
|
+
"3 product steps",
|
|
15
|
+
"Pages to show. illustration is a node or 'capture' | 'insights' | 'together'."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"onDone",
|
|
19
|
+
"() => void",
|
|
20
|
+
"—",
|
|
21
|
+
"Pressed the final button."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"onSkip",
|
|
25
|
+
"() => void",
|
|
26
|
+
"onDone",
|
|
27
|
+
"Pressed Skip."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"onIndexChange",
|
|
31
|
+
"(index: number) => void",
|
|
32
|
+
"—",
|
|
33
|
+
"The visible step changed."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"skipLabel",
|
|
37
|
+
"string",
|
|
38
|
+
"'Skip'",
|
|
39
|
+
"Skip button text."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"nextLabel",
|
|
43
|
+
"string",
|
|
44
|
+
"'Next'",
|
|
45
|
+
"Accessibility label of the round next button."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"doneLabel",
|
|
49
|
+
"string",
|
|
50
|
+
"'Get started'",
|
|
51
|
+
"Button text on the last step."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"accent",
|
|
55
|
+
"string",
|
|
56
|
+
"theme accent",
|
|
57
|
+
"Active dot, primary button and built-in illustration colour."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"style",
|
|
61
|
+
"StyleProp<ViewStyle>",
|
|
62
|
+
"—",
|
|
63
|
+
"Root style."
|
|
64
|
+
]
|
|
65
|
+
],
|
|
66
|
+
"behavior": [],
|
|
67
|
+
"usage": null,
|
|
68
|
+
"examples": []
|
|
69
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "otp-input",
|
|
3
|
+
"category": "Inputs",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "OtpInput",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/otp-input.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Digits pop into cells that size themselves, with SMS autofill and paste.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"length",
|
|
13
|
+
"number",
|
|
14
|
+
"6",
|
|
15
|
+
"Number of cells."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"value / onChangeText",
|
|
19
|
+
"string",
|
|
20
|
+
"—",
|
|
21
|
+
"Controlled code (digits only). Pasting a longer string fills every cell."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"onComplete",
|
|
25
|
+
"(code) => void",
|
|
26
|
+
"—",
|
|
27
|
+
"Called when every cell is filled."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"variant",
|
|
31
|
+
"\"box\" | \"underline\" | \"pill\"",
|
|
32
|
+
"\"box\"",
|
|
33
|
+
"Rounded box cells, underline bars, or round pill cells."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"error",
|
|
37
|
+
"boolean",
|
|
38
|
+
"false",
|
|
39
|
+
"Shakes the row and turns it the danger colour."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"errorText",
|
|
43
|
+
"string",
|
|
44
|
+
"—",
|
|
45
|
+
"Message (with icon) shown under the cells while `error` is set."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"success",
|
|
49
|
+
"boolean",
|
|
50
|
+
"false",
|
|
51
|
+
"Success colour with a staggered pulse across the cells."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"successText",
|
|
55
|
+
"string",
|
|
56
|
+
"—",
|
|
57
|
+
"Message with an animated check shown while `success` is set."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"helperText",
|
|
61
|
+
"string",
|
|
62
|
+
"—",
|
|
63
|
+
"Hint shown under the cells otherwise."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"separatorAfter",
|
|
67
|
+
"number",
|
|
68
|
+
"—",
|
|
69
|
+
"Draw a dash after this many cells, e.g. 3 → 123 – 456."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"maxCellSize",
|
|
73
|
+
"number",
|
|
74
|
+
"52",
|
|
75
|
+
"Largest cell width; cells shrink to fit the row and never overflow."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"secure",
|
|
79
|
+
"boolean",
|
|
80
|
+
"false",
|
|
81
|
+
"Dots instead of digits."
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"disabled",
|
|
85
|
+
"boolean",
|
|
86
|
+
"false",
|
|
87
|
+
"Dims and blocks input."
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"autoFocus",
|
|
91
|
+
"boolean",
|
|
92
|
+
"false",
|
|
93
|
+
"Focus on mount."
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"accent",
|
|
97
|
+
"string",
|
|
98
|
+
"theme accent",
|
|
99
|
+
"Active cell colour."
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"style",
|
|
103
|
+
"StyleProp<ViewStyle>",
|
|
104
|
+
"—",
|
|
105
|
+
"Style for the root view around the cells and message."
|
|
106
|
+
]
|
|
107
|
+
],
|
|
108
|
+
"behavior": [
|
|
109
|
+
[
|
|
110
|
+
"Touch",
|
|
111
|
+
"Tapping the row focuses one hidden number-pad input. Pasting a code like 123-456 strips the non-digits and fills every cell."
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"Motion",
|
|
115
|
+
"Digits pop in on a bouncy spring and the active cell glows with a halo and a blinking caret. Errors shake the row; success pulses across the cells."
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"Platforms",
|
|
119
|
+
"Sets textContentType 'oneTimeCode' and autoComplete 'one-time-code', so codes from SMS can autofill."
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
"Screen readers",
|
|
123
|
+
"The cells are hidden; the input is labelled 'One-time code, 6 digits' with a hint. Helper, error and success messages are a polite live region."
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
"Web",
|
|
127
|
+
"The browser focus outline is removed; the border and halo show focus instead."
|
|
128
|
+
]
|
|
129
|
+
],
|
|
130
|
+
"usage": "import { useState } from 'react';\nimport { OtpInput } from '@/components/ui/otp-input';\n\nconst [code, setCode] = useState('');\n<OtpInput value={code} onChangeText={setCode} helperText=\"Sent to +1 415 555 0132\" />",
|
|
131
|
+
"examples": [
|
|
132
|
+
{
|
|
133
|
+
"name": "VerifyPhone",
|
|
134
|
+
"title": "Verify Phone",
|
|
135
|
+
"code": "import React, { useEffect, useState } from 'react';\nimport { Pressable, StyleSheet, Text, View, type ViewProps } from 'react-native';\nimport { OtpInput } from '@/components/ui/otp-input';\nimport { useKit } from '@/lib/kit';\n\n/** Demo card that follows the kit theme, so the docs radius / accent picker reshapes it too. */\nfunction Card({ style, ...rest }: ViewProps) {\n const { colors, radius } = useKit();\n return (\n <View\n style={[\n { padding: 16, gap: 12, borderRadius: radius.xl, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nfunction Header({ title, body }: { title: string; body: string }) {\n const { colors } = useKit();\n return (\n <View style={{ gap: 4, alignItems: 'center' }}>\n <Text style={{ fontSize: 16, fontWeight: '400', color: colors.foreground, textAlign: 'center' }}>{title}</Text>\n <Text style={{ fontSize: 13, color: colors.mutedForeground, textAlign: 'center' }}>{body}</Text>\n </View>\n );\n}\n\nexport default function VerifyPhone() {\n const { colors } = useKit();\n const [code, setCode] = useState('');\n const [left, setLeft] = useState(24);\n useEffect(() => {\n if (left <= 0) return;\n const id = setTimeout(() => setLeft((s) => s - 1), 1000);\n return () => clearTimeout(id);\n }, [left]);\n const done = code.length === 6;\n return (\n <Card>\n <Header title=\"Verify your number\" body=\"Enter the code sent to +91 98•••• 4210\" />\n <OtpInput\n value={code}\n onChangeText={setCode}\n success={code === '123456'}\n error={done && code !== '123456'}\n successText=\"Number verified\"\n errorText=\"That code didn't match. Try 123456.\"\n helperText=\"Tip: the demo code is 123456\"\n />\n <View style={{ flexDirection: 'row', justifyContent: 'center', gap: 16 }}>\n <Pressable disabled={left > 0} onPress={() => { setLeft(24); setCode(''); }} hitSlop={10}>\n <Text style={{ fontSize: 13, fontWeight: '400', color: left > 0 ? colors.mutedForeground : colors.accent }}>\n {left > 0 ? `Resend in 0:${String(left).padStart(2, '0')}` : 'Resend code'}\n </Text>\n </Pressable>\n <Pressable hitSlop={10} accessibilityRole=\"button\">\n <Text style={{ fontSize: 13, fontWeight: '400', color: colors.accent }}>Change number</Text>\n </Pressable>\n </View>\n </Card>\n );\n}\n"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "Pin",
|
|
139
|
+
"title": "Pin",
|
|
140
|
+
"code": "import React, { useEffect, useState } from 'react';\nimport { Pressable, StyleSheet, Text, View, type ViewProps } from 'react-native';\nimport { OtpInput } from '@/components/ui/otp-input';\nimport { useKit } from '@/lib/kit';\n\n/** Demo card that follows the kit theme, so the docs radius / accent picker reshapes it too. */\nfunction Card({ style, ...rest }: ViewProps) {\n const { colors, radius } = useKit();\n return (\n <View\n style={[\n { padding: 16, gap: 12, borderRadius: radius.xl, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nfunction Header({ title, body }: { title: string; body: string }) {\n const { colors } = useKit();\n return (\n <View style={{ gap: 4, alignItems: 'center' }}>\n <Text style={{ fontSize: 16, fontWeight: '400', color: colors.foreground, textAlign: 'center' }}>{title}</Text>\n <Text style={{ fontSize: 13, color: colors.mutedForeground, textAlign: 'center' }}>{body}</Text>\n </View>\n );\n}\n\nexport default function Pin() {\n const [pin, setPin] = useState('');\n return (\n <Card>\n <Header title=\"Enter your PIN\" body=\"Confirm the transfer of ₹2,400 to Ananya\" />\n <OtpInput variant=\"pill\" length={4} secure value={pin} onChangeText={setPin} maxCellSize={56} />\n </Card>\n );\n}\n"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "Underline",
|
|
144
|
+
"title": "Underline",
|
|
145
|
+
"code": "import { Pressable, StyleSheet, Text, View, type ViewProps } from 'react-native';\nimport { OtpInput } from '@/components/ui/otp-input';\nimport { useKit } from '@/lib/kit';\n\n/** Demo card that follows the kit theme, so the docs radius / accent picker reshapes it too. */\nfunction Card({ style, ...rest }: ViewProps) {\n const { colors, radius } = useKit();\n return (\n <View\n style={[\n { padding: 16, gap: 12, borderRadius: radius.xl, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nfunction Header({ title, body }: { title: string; body: string }) {\n const { colors } = useKit();\n return (\n <View style={{ gap: 4, alignItems: 'center' }}>\n <Text style={{ fontSize: 16, fontWeight: '400', color: colors.foreground, textAlign: 'center' }}>{title}</Text>\n <Text style={{ fontSize: 13, color: colors.mutedForeground, textAlign: 'center' }}>{body}</Text>\n </View>\n );\n}\n\nexport default function Underline() {\n return (\n <Card>\n <Header title=\"Check your inbox\" body=\"We emailed a 6-digit code to karan@…\" />\n <OtpInput variant=\"underline\" helperText=\"Code expires in 10 minutes\" />\n </Card>\n );\n}\n"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "WithSeparator",
|
|
149
|
+
"title": "With Separator",
|
|
150
|
+
"code": "import { Pressable, StyleSheet, Text, View, type ViewProps } from 'react-native';\nimport { OtpInput } from '@/components/ui/otp-input';\nimport { useKit } from '@/lib/kit';\n\n/** Demo card that follows the kit theme, so the docs radius / accent picker reshapes it too. */\nfunction Card({ style, ...rest }: ViewProps) {\n const { colors, radius } = useKit();\n return (\n <View\n style={[\n { padding: 16, gap: 12, borderRadius: radius.xl, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nfunction Header({ title, body }: { title: string; body: string }) {\n const { colors } = useKit();\n return (\n <View style={{ gap: 4, alignItems: 'center' }}>\n <Text style={{ fontSize: 16, fontWeight: '400', color: colors.foreground, textAlign: 'center' }}>{title}</Text>\n <Text style={{ fontSize: 13, color: colors.mutedForeground, textAlign: 'center' }}>{body}</Text>\n </View>\n );\n}\n\nexport default function WithSeparator() {\n return (\n <Card>\n <Header title=\"Two-factor authentication\" body=\"Open your authenticator app\" />\n <OtpInput separatorAfter={3} maxCellSize={46} />\n </Card>\n );\n}\n"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "States",
|
|
154
|
+
"title": "States",
|
|
155
|
+
"code": "import { Pressable, StyleSheet, Text, View, type ViewProps } from 'react-native';\nimport { OtpInput } from '@/components/ui/otp-input';\n\nexport default function States() {\n return (\n <View style={{ gap: 18 }}>\n <OtpInput length={4} value=\"4821\" success successText=\"Verified\" />\n <OtpInput length={4} value=\"1093\" error errorText=\"Incorrect code\" />\n <OtpInput length={4} value=\"72\" disabled helperText=\"Too many attempts — try again in 5 min\" />\n </View>\n );\n}\n"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pagination-dots",
|
|
3
|
+
"category": "Display",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "PaginationDots",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/pagination-dots.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "The active dot stretches into a pill that follows your swipe live.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"count",
|
|
13
|
+
"number",
|
|
14
|
+
"—",
|
|
15
|
+
"Number of pages."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"index",
|
|
19
|
+
"number",
|
|
20
|
+
"0",
|
|
21
|
+
"Active page; changes spring the indicator across."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"progress",
|
|
25
|
+
"Animated.Value | AnimatedInterpolation | number",
|
|
26
|
+
"—",
|
|
27
|
+
"Live page position (e.g. Animated.divide(scrollX, width)) for smooth tracking while swiping. Use useNativeDriver: false for the 'dots' variant."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"variant",
|
|
31
|
+
"\"dots\" | \"scale\" | \"line\" | \"numbers\"",
|
|
32
|
+
"\"dots\"",
|
|
33
|
+
"Stretching pill · growing dot · filling segments · rolling \"2 / 5\"."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"size",
|
|
37
|
+
"\"sm\" | \"md\" | \"lg\"",
|
|
38
|
+
"\"md\"",
|
|
39
|
+
"6 / 8 / 10pt dots."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"onPress",
|
|
43
|
+
"(index: number) => void",
|
|
44
|
+
"—",
|
|
45
|
+
"Makes dots tappable (44pt hit area) and enables accessibility increment / decrement."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"accent",
|
|
49
|
+
"string",
|
|
50
|
+
"theme accent",
|
|
51
|
+
"Active colour."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"inactiveColor",
|
|
55
|
+
"string",
|
|
56
|
+
"18% foreground",
|
|
57
|
+
"Inactive dot colour."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"accessibilityLabel",
|
|
61
|
+
"string",
|
|
62
|
+
"\"Page\"",
|
|
63
|
+
"Announced with \"2 of 5\"."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"style",
|
|
67
|
+
"StyleProp<ViewStyle>",
|
|
68
|
+
"—",
|
|
69
|
+
"Style for the row of dots (the numbers pill or line track in those variants)."
|
|
70
|
+
]
|
|
71
|
+
],
|
|
72
|
+
"behavior": [
|
|
73
|
+
[
|
|
74
|
+
"Motion",
|
|
75
|
+
"Pass a live progress value (scroll offset ÷ page width) and the indicator tracks the finger; with index alone it springs across. Variants stretch a pill, scale a dot, fill line segments or roll the page number."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"Touch",
|
|
79
|
+
"With onPress, each dot becomes a button with an enlarged hit area that reports its page."
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"Screen readers",
|
|
83
|
+
"Read as one element with 'N of M'. With onPress it is adjustable, so swiping up or down changes the page."
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
"Platforms",
|
|
87
|
+
"The 'dots' variant animates widths, so drive its progress with useNativeDriver: false. The other variants work with either driver."
|
|
88
|
+
]
|
|
89
|
+
],
|
|
90
|
+
"usage": "import { useState } from 'react';\nimport { PaginationDots } from '@/components/ui/pagination-dots';\n\nconst [page, setPage] = useState(0);\n<PaginationDots count={4} index={page} onPress={setPage} />",
|
|
91
|
+
"examples": [
|
|
92
|
+
{
|
|
93
|
+
"name": "Onboarding",
|
|
94
|
+
"title": "Onboarding",
|
|
95
|
+
"code": "import React, { useMemo, useRef, useState } from 'react';\nimport { Animated, Pressable, ScrollView, Text, View } from 'react-native';\nimport { PaginationDots } from '@/components/ui/pagination-dots';\nimport { useKit } from '@/lib/kit';\n\nconst PAGES: { color?: string; kicker: string; title: string; body: string }[] = [\n { kicker: 'PLAN', title: 'Plan your week in minutes', body: 'Drag tasks onto your calendar and we block the time for you.' },\n { color: '#0ea5e9', kicker: 'FOCUS', title: 'Stay in the zone', body: 'Focus sessions silence notifications until your block ends.' },\n { color: '#10b981', kicker: 'REVIEW', title: 'See what moved', body: 'A Friday recap shows what you shipped and what slipped.' },\n { color: '#f59e0b', kicker: 'SHARE', title: 'Bring your team along', body: 'Shared boards keep everyone on the same page.' },\n];\n\nexport default function Onboarding() {\n const { colors, radius } = useKit();\n const [width, setWidth] = useState(0);\n const [page, setPage] = useState(0);\n const scrollX = useRef(new Animated.Value(0)).current;\n const ref = useRef<ScrollView>(null);\n const progress = useMemo(() => (width ? Animated.divide(scrollX, width) : 0), [scrollX, width]);\n const go = (i: number) => ref.current?.scrollTo({ x: i * width, animated: true });\n\n return (\n <View style={{ gap: 18 }} onLayout={(e) => setWidth(e.nativeEvent.layout.width)}>\n <Animated.ScrollView\n ref={ref}\n horizontal\n pagingEnabled\n showsHorizontalScrollIndicator={false}\n scrollEventThrottle={16}\n onScroll={Animated.event([{ nativeEvent: { contentOffset: { x: scrollX } } }], { useNativeDriver: false })}\n onMomentumScrollEnd={(e) => width && setPage(Math.round(e.nativeEvent.contentOffset.x / width))}\n >\n {PAGES.map((p) => (\n <View key={p.title} style={{ width: width || 1, paddingHorizontal: 2 }}>\n <View style={{ height: 210, borderRadius: radius.scale(24), backgroundColor: p.color ?? colors.accent, padding: 22, justifyContent: 'flex-end' }}>\n <Text style={{ color: 'rgba(255,255,255,0.75)', fontSize: 12, fontWeight: '400', letterSpacing: 1.2 }}>{p.kicker}</Text>\n <Text style={{ color: '#fff', fontSize: 24, fontWeight: '400', letterSpacing: -0.5, marginTop: 6 }}>{p.title}</Text>\n <Text style={{ color: 'rgba(255,255,255,0.85)', fontSize: 14, lineHeight: 20, marginTop: 6 }}>{p.body}</Text>\n </View>\n </View>\n ))}\n </Animated.ScrollView>\n <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>\n <Pressable onPress={() => go(PAGES.length - 1)} hitSlop={12} accessibilityRole=\"button\">\n <Text style={{ fontSize: 15, fontWeight: '400', color: colors.mutedForeground }}>Skip</Text>\n </Pressable>\n <PaginationDots count={PAGES.length} progress={progress} onPress={go} accessibilityLabel=\"Onboarding page\" />\n <Pressable\n onPress={() => go(Math.min(PAGES.length - 1, page + 1))}\n accessibilityRole=\"button\"\n style={{ height: 44, paddingHorizontal: 18, borderRadius: radius.capsule(44), backgroundColor: colors.accent, justifyContent: 'center' }}\n >\n <Text style={{ fontSize: 15, fontWeight: '400', color: colors.accentForeground }}>{page === PAGES.length - 1 ? 'Done' : 'Next'}</Text>\n </Pressable>\n </View>\n </View>\n );\n}\n"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "Variants",
|
|
99
|
+
"title": "Variants",
|
|
100
|
+
"code": "import React, { useMemo, useRef, useState } from 'react';\nimport { Animated, Pressable, ScrollView, Text, View } from 'react-native';\nimport { PaginationDots } from '@/components/ui/pagination-dots';\nimport { useKit } from '@/lib/kit';\n\nfunction Label({ children }: { children: string }) {\n const { colors } = useKit();\n return <Text style={{ fontSize: 12, fontWeight: '400', letterSpacing: 0.4, color: colors.mutedForeground }}>{children}</Text>;\n}\n\nexport default function Variants() {\n const { colors, radius } = useKit();\n const [i, setI] = useState(1);\n return (\n <View style={{ gap: 22 }}>\n {(['dots', 'scale', 'line', 'numbers'] as const).map((variant) => (\n <View key={variant} style={{ gap: 10 }}>\n <Label>{variant.toUpperCase()}</Label>\n <PaginationDots variant={variant} count={5} index={i} onPress={setI} />\n </View>\n ))}\n <View style={{ flexDirection: 'row', gap: 10, justifyContent: 'center' }}>\n {['Previous', 'Next'].map((t, k) => (\n <Pressable\n key={t}\n onPress={() => setI((v) => Math.max(0, Math.min(4, v + (k ? 1 : -1))))}\n accessibilityRole=\"button\"\n style={{ height: 44, paddingHorizontal: 18, borderRadius: radius.md, borderWidth: 1, borderColor: colors.border, justifyContent: 'center' }}\n >\n <Text style={{ fontSize: 14, fontWeight: '400', color: colors.foreground }}>{t}</Text>\n </Pressable>\n ))}\n </View>\n </View>\n );\n}\n"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "Sizes",
|
|
104
|
+
"title": "Sizes",
|
|
105
|
+
"code": "import { Animated, Pressable, ScrollView, Text, View } from 'react-native';\nimport { PaginationDots } from '@/components/ui/pagination-dots';\n\nexport default function Sizes() {\n return (\n <View style={{ gap: 18, alignItems: 'center' }}>\n <PaginationDots size=\"sm\" count={6} index={2} />\n <PaginationDots size=\"md\" count={6} index={2} />\n <PaginationDots size=\"lg\" count={6} index={2} />\n </View>\n );\n}\n"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "parallax-layers",
|
|
3
|
+
"category": "3D",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "ParallaxLayers",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/parallax-layers.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "Drag across a layered scene: near layers slide further while it tilts in 3D.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"children",
|
|
13
|
+
"ParallaxLayer[]",
|
|
14
|
+
"—",
|
|
15
|
+
"Layers, back to front."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"height",
|
|
19
|
+
"number",
|
|
20
|
+
"260",
|
|
21
|
+
"Scene height."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"travel",
|
|
25
|
+
"number",
|
|
26
|
+
"22",
|
|
27
|
+
"How far a depth-1 layer moves, in points."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"tilt",
|
|
31
|
+
"number",
|
|
32
|
+
"8",
|
|
33
|
+
"Scene tilt in degrees; 0 for flat parallax."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"idle",
|
|
37
|
+
"boolean",
|
|
38
|
+
"true",
|
|
39
|
+
"Drift on its own while untouched."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"clip",
|
|
43
|
+
"boolean",
|
|
44
|
+
"true",
|
|
45
|
+
"Clip layers to the scene's rounded box."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"accessibilityLabel",
|
|
49
|
+
"string",
|
|
50
|
+
"—",
|
|
51
|
+
"Describes the scene for screen readers."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"radius",
|
|
55
|
+
"number",
|
|
56
|
+
"24",
|
|
57
|
+
"Corner radius of the scene."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"style",
|
|
61
|
+
"StyleProp<ViewStyle>",
|
|
62
|
+
"—",
|
|
63
|
+
"Style for the scene."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"ParallaxLayer.depth",
|
|
67
|
+
"number",
|
|
68
|
+
"0.5",
|
|
69
|
+
"0 stays put, 1 moves the full travel, negative moves the other way."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"ParallaxLayer.scale",
|
|
73
|
+
"number",
|
|
74
|
+
"far layers grow slightly",
|
|
75
|
+
"Extra scale; far layers (depth ≤ 0.35) grow just enough to hide their edges."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"ParallaxLayer.style",
|
|
79
|
+
"StyleProp<ViewStyle>",
|
|
80
|
+
"—",
|
|
81
|
+
"Style for the layer (it fills the scene)."
|
|
82
|
+
]
|
|
83
|
+
],
|
|
84
|
+
"behavior": [
|
|
85
|
+
[
|
|
86
|
+
"Touch",
|
|
87
|
+
"The finger position steers the scene and release springs it back to centre. A parent ScrollView can still take over a scroll that starts on it."
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"Motion",
|
|
91
|
+
"Each layer moves by its depth times travel while the whole scene tilts in perspective. Left alone, it drifts slowly on a loop."
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
"Screen readers",
|
|
95
|
+
"With accessibilityLabel the scene is one image element with that label; without it, it is not exposed."
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
"Platforms",
|
|
99
|
+
"Transforms run on the native driver with PanResponder, so it works on iOS, Android and web with no native modules."
|
|
100
|
+
]
|
|
101
|
+
],
|
|
102
|
+
"usage": null,
|
|
103
|
+
"examples": []
|
|
104
|
+
}
|