@expokit/cli 0.0.0-stage → 0.2.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 +32 -2
- package/bin/expo-kit.js +1204 -0
- package/bin/lib.mjs +343 -0
- package/bin/mcp.mjs +338 -0
- package/package.json +44 -4
- package/registry/_docs/accordion.json +99 -0
- package/registry/_docs/action-sheet.json +110 -0
- package/registry/_docs/alert.json +127 -0
- package/registry/_docs/avatar.json +203 -0
- package/registry/_docs/badge.json +117 -0
- package/registry/_docs/bottom-nav.json +119 -0
- package/registry/_docs/bottom-sheet.json +158 -0
- package/registry/_docs/bullet.json +24 -0
- package/registry/_docs/button-3d.json +122 -0
- package/registry/_docs/button.json +115 -0
- package/registry/_docs/calendar.json +182 -0
- package/registry/_docs/card-stack.json +108 -0
- package/registry/_docs/card.json +111 -0
- package/registry/_docs/carousel.json +102 -0
- package/registry/_docs/checkbox.json +93 -0
- package/registry/_docs/checkout.json +102 -0
- package/registry/_docs/chip-group.json +116 -0
- package/registry/_docs/color-swatch.json +66 -0
- package/registry/_docs/confetti.json +82 -0
- package/registry/_docs/coupon.json +176 -0
- package/registry/_docs/cube-pager.json +84 -0
- package/registry/_docs/dashboard.json +120 -0
- package/registry/_docs/date-picker.json +249 -0
- package/registry/_docs/dialog.json +162 -0
- package/registry/_docs/drawer.json +171 -0
- package/registry/_docs/fab.json +120 -0
- package/registry/_docs/flip-card.json +111 -0
- package/registry/_docs/floating-input.json +191 -0
- package/registry/_docs/gift-card.json +108 -0
- package/registry/_docs/glass-button.json +118 -0
- package/registry/_docs/glass-nav-bar.json +78 -0
- package/registry/_docs/glass-search-bar.json +90 -0
- package/registry/_docs/glass-segmented.json +66 -0
- package/registry/_docs/glass-sheet.json +108 -0
- package/registry/_docs/glass-tab-bar.json +76 -0
- package/registry/_docs/glass.json +78 -0
- package/registry/_docs/inbox.json +72 -0
- package/registry/_docs/isometric-bar.json +72 -0
- package/registry/_docs/kit.json +11 -0
- package/registry/_docs/kpi-card.json +11 -0
- package/registry/_docs/like-button.json +72 -0
- package/registry/_docs/liquidglass-tab.json +27 -0
- package/registry/_docs/list-item.json +200 -0
- package/registry/_docs/loyalty-card.json +108 -0
- package/registry/_docs/morph-button.json +108 -0
- package/registry/_docs/number-ticker.json +96 -0
- package/registry/_docs/offers.json +78 -0
- package/registry/_docs/onboarding.json +66 -0
- package/registry/_docs/otp-input.json +134 -0
- package/registry/_docs/pagination-dots.json +88 -0
- package/registry/_docs/parallax-layers.json +84 -0
- package/registry/_docs/parallax-scroll.json +186 -0
- package/registry/_docs/password-input.json +92 -0
- package/registry/_docs/payment-card.json +153 -0
- package/registry/_docs/pixel-bar.json +66 -0
- package/registry/_docs/polar-area.json +78 -0
- package/registry/_docs/profile.json +84 -0
- package/registry/_docs/progress-steps.json +92 -0
- package/registry/_docs/progress.json +132 -0
- package/registry/_docs/radio-group.json +92 -0
- package/registry/_docs/rating.json +90 -0
- package/registry/_docs/ring-carousel.json +102 -0
- package/registry/_docs/scratch-card.json +90 -0
- package/registry/_docs/search-bar.json +140 -0
- package/registry/_docs/search-results.json +120 -0
- package/registry/_docs/segmented-control.json +103 -0
- package/registry/_docs/select.json +252 -0
- package/registry/_docs/settings.json +72 -0
- package/registry/_docs/shimmer-button.json +78 -0
- package/registry/_docs/sign-in.json +198 -0
- package/registry/_docs/skeleton.json +142 -0
- package/registry/_docs/slide-to-confirm.json +84 -0
- package/registry/_docs/slider.json +157 -0
- package/registry/_docs/spin-wheel.json +114 -0
- package/registry/_docs/spinner.json +91 -0
- package/registry/_docs/stepper.json +168 -0
- package/registry/_docs/swipe-deck.json +102 -0
- package/registry/_docs/swipeable-row.json +72 -0
- package/registry/_docs/switch.json +104 -0
- package/registry/_docs/tabs.json +105 -0
- package/registry/_docs/tag-input.json +128 -0
- package/registry/_docs/textarea.json +175 -0
- package/registry/_docs/ticket-card.json +174 -0
- package/registry/_docs/ticket-shape.json +11 -0
- package/registry/_docs/tilt-card.json +141 -0
- package/registry/_docs/time-picker.json +253 -0
- package/registry/_docs/timeline-chart.json +30 -0
- package/registry/_docs/timeline.json +156 -0
- package/registry/_docs/toast.json +161 -0
- package/registry/_docs/treemap.json +30 -0
- package/registry/_docs/waterfall.json +36 -0
- package/registry/_docs/wheel-list.json +102 -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 +316 -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/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 +335 -0
- package/registry/spinner/files/src/lib/kit.tsx +219 -0
- package/registry/spinner.json +17 -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/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,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "coupon",
|
|
3
|
+
"category": "Coupons",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Coupon",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/coupon.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"value",
|
|
12
|
+
"string",
|
|
13
|
+
"—",
|
|
14
|
+
"The headline: \"50%\", \"₹200\", \"FREE\", \"BOGO\"."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"unit / prefix",
|
|
18
|
+
"string",
|
|
19
|
+
"—",
|
|
20
|
+
"Under / above the value: \"OFF\", \"FLAT\", \"UP TO\"."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"title / description",
|
|
24
|
+
"string",
|
|
25
|
+
"—",
|
|
26
|
+
"What the offer is and its conditions."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"code",
|
|
30
|
+
"string",
|
|
31
|
+
"—",
|
|
32
|
+
"Promo code in a dashed chip — tap to copy when onCopy is set."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"brand / logo",
|
|
36
|
+
"string / ReactNode",
|
|
37
|
+
"—",
|
|
38
|
+
"Who it's from."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"expires",
|
|
42
|
+
"string",
|
|
43
|
+
"—",
|
|
44
|
+
"Expiry line (\"Valid till 31 Dec\")."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"expiresAt",
|
|
48
|
+
"Date | number",
|
|
49
|
+
"—",
|
|
50
|
+
"Live countdown (\"Ends in 05:42:10\"); turns expired when it passes."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"terms",
|
|
54
|
+
"string[]",
|
|
55
|
+
"—",
|
|
56
|
+
"Shown on the back — the T&C link turns the coupon over."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"status",
|
|
60
|
+
"\"available\" | \"applied\" | \"used\" | \"expired\" | \"locked\"",
|
|
61
|
+
"\"available\"",
|
|
62
|
+
"Applied shows a green ring; used / expired dim with a stamp; locked goes grey."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"lockedHint",
|
|
66
|
+
"string",
|
|
67
|
+
"—",
|
|
68
|
+
"Why it's locked (\"Add ₹120 more to unlock\")."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"theme",
|
|
72
|
+
"\"sunset\" | \"candy\" | \"ocean\" | \"lime\" | \"gold\" | \"fire\" | \"neon\" | \"ink\" | \"paper\" | \"holo\" | CouponTheme",
|
|
73
|
+
"\"sunset\"",
|
|
74
|
+
"Preset, or { fill, ink, accent?, body?, bodyInk?, pattern? } — fill can be a gradient."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"pattern",
|
|
78
|
+
"\"none\" | \"dots\" | \"stripes\" | \"grid\" | \"waves\" | \"sunburst\" | \"confetti\"",
|
|
79
|
+
"theme's",
|
|
80
|
+
"Texture on the value panel."
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"layout",
|
|
84
|
+
"\"horizontal\" | \"vertical\"",
|
|
85
|
+
"\"horizontal\"",
|
|
86
|
+
"Value panel on the left, or on top."
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"variant",
|
|
90
|
+
"\"ticket\" | \"stamp\" | \"receipt\" | \"scallop\" | \"cutout\"",
|
|
91
|
+
"\"ticket\"",
|
|
92
|
+
"Outline: notches, perforations, torn zigzag ends, wavy edges, or a dashed cut-here line."
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"size",
|
|
96
|
+
"\"sm\" | \"md\" | \"lg\"",
|
|
97
|
+
"\"md\"",
|
|
98
|
+
"Compact for long lists, large for a hero."
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
"shine",
|
|
102
|
+
"boolean",
|
|
103
|
+
"false",
|
|
104
|
+
"A light sweep across the value panel every few seconds."
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"tilt / holo / idle",
|
|
108
|
+
"boolean",
|
|
109
|
+
"false",
|
|
110
|
+
"3D tilt toward the finger; rainbow foil sheen; slow sway at rest."
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
"onCopy",
|
|
114
|
+
"(code) => void",
|
|
115
|
+
"—",
|
|
116
|
+
"Called from the code chip — wire it to expo-clipboard."
|
|
117
|
+
],
|
|
118
|
+
[
|
|
119
|
+
"onApply",
|
|
120
|
+
"() => void",
|
|
121
|
+
"—",
|
|
122
|
+
"Shows the Apply button."
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
"onPress",
|
|
126
|
+
"() => void",
|
|
127
|
+
"—",
|
|
128
|
+
"Tap on the coupon itself (open details, select it)."
|
|
129
|
+
],
|
|
130
|
+
[
|
|
131
|
+
"flipped / defaultFlipped / onFlip",
|
|
132
|
+
"boolean / boolean / (flipped) => void",
|
|
133
|
+
"— / false / —",
|
|
134
|
+
"Controlled or uncontrolled side."
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
"labels",
|
|
138
|
+
"{ copy?, copied?, apply?, applied?, used?, expired?, locked?, endsIn?, terms?, termsTitle?, back? }",
|
|
139
|
+
"English",
|
|
140
|
+
"Every built-in string, for translation."
|
|
141
|
+
],
|
|
142
|
+
[
|
|
143
|
+
"style",
|
|
144
|
+
"StyleProp<ViewStyle>",
|
|
145
|
+
"—",
|
|
146
|
+
"Width, margins."
|
|
147
|
+
]
|
|
148
|
+
],
|
|
149
|
+
"examples": [
|
|
150
|
+
{
|
|
151
|
+
"name": "Hero",
|
|
152
|
+
"title": "Hero",
|
|
153
|
+
"code": "import React, { useRef, useState } from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport { Confetti, type ConfettiHandle } from '@/components/ui/confetti';\nimport { Coupon } from '@/components/ui/coupon';\nimport { useKit } from '@/lib/kit';\n\nconst logo = (id: number) => <Image alt=\"\" source={{ uri: `https://picsum.photos/id/${id}/64/64` }} style={{ width: 18, height: 18, borderRadius: 5 }} />;\n\nexport default function Hero() {\n const { colors } = useKit();\n const [applied, setApplied] = useState(false);\n const confetti = useRef<ConfettiHandle>(null);\n return (\n <View style={{ gap: 14, paddingVertical: 8 }}>\n <View>\n <Text style={{ color: colors.foreground, fontSize: 22, fontWeight: '800', letterSpacing: -0.5 }}>Just for you</Text>\n <Text style={{ color: colors.mutedForeground, fontSize: 13 }}>Tilt the coupon · tap T&C to flip it</Text>\n </View>\n <Coupon\n tilt\n holo\n idle\n shine\n theme=\"candy\"\n size=\"lg\"\n brand=\"Glow Beauty\"\n logo={logo(64)}\n prefix=\"Flat\"\n value=\"50%\"\n unit=\"Off\"\n title=\"Your first order, on us\"\n description=\"Up to ₹300 off on skincare & makeup\"\n code=\"GLOW50\"\n expires=\"Valid till 31 Dec\"\n terms={['Min. order ₹699', 'Once per account', 'Not valid on gift cards', 'Can’t be combined with other offers']}\n status={applied ? 'applied' : 'available'}\n onCopy={() => {}}\n onApply={() => {\n setApplied(true);\n confetti.current?.burst();\n }}\n />\n {applied ? (\n <Pressable onPress={() => setApplied(false)} accessibilityRole=\"button\" style={{ alignSelf: 'center', padding: 8 }}>\n <Text style={{ color: colors.mutedForeground, fontSize: 13, fontWeight: '600' }}>Remove coupon</Text>\n </Pressable>\n ) : null}\n <Confetti ref={confetti} />\n </View>\n );\n}\n"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "OffersList",
|
|
157
|
+
"title": "Offers List",
|
|
158
|
+
"code": "import React, { useRef, useState } from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport { Coupon } from '@/components/ui/coupon';\nimport { useKit } from '@/lib/kit';\n\nconst logo = (id: number) => <Image alt=\"\" source={{ uri: `https://picsum.photos/id/${id}/64/64` }} style={{ width: 18, height: 18, borderRadius: 5 }} />;\n\nexport default function OffersList() {\n const { colors } = useKit();\n const [applied, setApplied] = useState<string | null>('SWIGGY60');\n const [soon] = useState(() => Date.now() + 2 * 3600_000 + 14 * 60_000);\n return (\n <View style={{ gap: 14 }}>\n <Text style={{ color: colors.foreground, fontSize: 18, fontWeight: '800' }}>Offers for you</Text>\n <Coupon\n theme=\"fire\"\n brand=\"Swiggy\"\n logo={logo(292)}\n value=\"60%\"\n unit=\"Off\"\n title=\"Up to ₹120 on your next meal\"\n code=\"SWIGGY60\"\n expiresAt={soon}\n status={applied === 'SWIGGY60' ? 'applied' : 'available'}\n onCopy={() => {}}\n onApply={() => setApplied('SWIGGY60')}\n />\n <Coupon\n theme=\"ocean\"\n variant=\"stamp\"\n brand=\"HDFC Bank\"\n prefix=\"Instant\"\n value=\"₹250\"\n unit=\"Off\"\n title=\"On HDFC credit cards\"\n description=\"Orders above ₹1,500\"\n code=\"HDFC250\"\n status={applied === 'HDFC250' ? 'applied' : 'available'}\n onCopy={() => {}}\n onApply={() => setApplied('HDFC250')}\n />\n <Coupon\n theme=\"lime\"\n variant=\"receipt\"\n brand=\"BigBasket\"\n value=\"FREE\"\n unit=\"Delivery\"\n title=\"Free delivery on groceries\"\n code=\"FREEDEL\"\n status=\"locked\"\n lockedHint=\"Add ₹120 more to unlock\"\n onApply={() => {}}\n />\n <Coupon theme=\"ink\" variant=\"scallop\" brand=\"Myntra\" value=\"BOGO\" unit=\"Deal\" title=\"Buy 1 get 1 on tees\" code=\"BOGOTEE\" status=\"expired\" onApply={() => {}} />\n </View>\n );\n}\n"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "Shapes",
|
|
162
|
+
"title": "Shapes",
|
|
163
|
+
"code": "import { Image, Pressable, Text, View } from 'react-native';\nimport { Coupon } from '@/components/ui/coupon';\n\nexport default function Shapes() {\n return (\n <View style={{ gap: 14 }}>\n <Coupon size=\"sm\" theme=\"sunset\" variant=\"ticket\" value=\"30%\" unit=\"Off\" title=\"Ticket — classic notches\" code=\"TICKET30\" onCopy={() => {}} />\n <Coupon size=\"sm\" theme=\"ocean\" variant=\"stamp\" value=\"₹99\" unit=\"Off\" title=\"Stamp — perforated edges\" code=\"STAMP99\" onCopy={() => {}} />\n <Coupon size=\"sm\" theme=\"gold\" variant=\"receipt\" value=\"2X\" unit=\"Points\" title=\"Receipt — torn zigzag ends\" code=\"RECEIPT2X\" onCopy={() => {}} />\n <Coupon size=\"sm\" theme=\"candy\" variant=\"scallop\" value=\"FREE\" unit=\"Gift\" title=\"Scallop — wavy edges\" code=\"SCALLOP\" onCopy={() => {}} />\n <Coupon size=\"sm\" theme=\"paper\" variant=\"cutout\" value=\"25%\" unit=\"Off\" title=\"Cut-out — clip along the line\" code=\"CLIPME25\" onCopy={() => {}} />\n </View>\n );\n}\n"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "Grid",
|
|
167
|
+
"title": "Grid",
|
|
168
|
+
"code": "import { Image, Pressable, Text, View } from 'react-native';\nimport { Coupon } from '@/components/ui/coupon';\n\nexport default function Grid() {\n const offers = [\n { theme: 'neon' as const, brand: 'Paytm', value: '₹100', unit: 'Cashback', title: 'On UPI payments', code: 'PAYTM100' },\n { theme: 'gold' as const, brand: 'Amex', value: '10%', unit: 'Off', title: 'Weekend dining', code: 'AMEX10' },\n { theme: 'sunset' as const, brand: 'Zomato', value: '₹75', unit: 'Off', title: 'Orders above ₹299', code: 'ZOMATO75' },\n { theme: 'holo' as const, brand: 'Nykaa', value: '3X', unit: 'Points', title: 'This weekend only', code: 'NYKAA3X' },\n ];\n return (\n <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 12 }}>\n {offers.map((o) => (\n <Coupon key={o.code} {...o} layout=\"vertical\" size=\"sm\" variant={o.theme === 'gold' ? 'stamp' : 'ticket'} onCopy={() => {}} style={{ width: '47%', flexGrow: 1 }} />\n ))}\n </View>\n );\n}\n"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "FlashSale",
|
|
172
|
+
"title": "Flash Sale",
|
|
173
|
+
"code": "import React, { useRef, useState } from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport { Coupon } from '@/components/ui/coupon';\nimport { useKit } from '@/lib/kit';\n\nexport default function FlashSale() {\n const { colors } = useKit();\n const [ends, setEnds] = useState(() => Date.now() + 47_000);\n return (\n <View style={{ gap: 14 }}>\n <Coupon\n theme=\"sunset\"\n layout=\"vertical\"\n size=\"lg\"\n shine\n brand=\"Flash sale\"\n prefix=\"Extra\"\n value=\"70%\"\n unit=\"Off\"\n title=\"Sneakers · next 47 seconds\"\n description=\"Ends when the timer does — no extensions\"\n code=\"FLASH70\"\n expiresAt={ends}\n onCopy={() => {}}\n onApply={() => {}}\n />\n <Pressable onPress={() => setEnds(Date.now() + 47_000)} accessibilityRole=\"button\" style={{ alignSelf: 'center', padding: 8 }}>\n <Text style={{ color: colors.mutedForeground, fontSize: 13, fontWeight: '600' }}>Restart timer</Text>\n </Pressable>\n </View>\n );\n}\n"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cube-pager",
|
|
3
|
+
"category": "3D",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "CubePager",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/cube-pager.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"children",
|
|
12
|
+
"ReactNode",
|
|
13
|
+
"—",
|
|
14
|
+
"One child per page."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"height",
|
|
18
|
+
"number",
|
|
19
|
+
"260",
|
|
20
|
+
"Page height."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"effect",
|
|
24
|
+
"\"cube\" | \"inside\" | \"flip\"",
|
|
25
|
+
"\"cube\"",
|
|
26
|
+
"Outside of a cube, its inner walls, or each page spinning in place."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"index",
|
|
30
|
+
"number",
|
|
31
|
+
"—",
|
|
32
|
+
"Controlled page."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"defaultIndex",
|
|
36
|
+
"number",
|
|
37
|
+
"0",
|
|
38
|
+
"Uncontrolled initial page."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"onIndexChange",
|
|
42
|
+
"(index: number) => void",
|
|
43
|
+
"—",
|
|
44
|
+
"Fires when the page changes."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"pagination",
|
|
48
|
+
"boolean",
|
|
49
|
+
"true",
|
|
50
|
+
"Dots under the pager."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"shade",
|
|
54
|
+
"boolean",
|
|
55
|
+
"true",
|
|
56
|
+
"Darken faces as they turn away."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"accent",
|
|
60
|
+
"string",
|
|
61
|
+
"theme foreground",
|
|
62
|
+
"Active dot colour."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"radius",
|
|
66
|
+
"number",
|
|
67
|
+
"20",
|
|
68
|
+
"Corner radius of the pages."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"disabled",
|
|
72
|
+
"boolean",
|
|
73
|
+
"false",
|
|
74
|
+
"Turn swiping off (dots and a controlled index still work)."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"style",
|
|
78
|
+
"StyleProp<ViewStyle>",
|
|
79
|
+
"—",
|
|
80
|
+
"Style for the root view."
|
|
81
|
+
]
|
|
82
|
+
],
|
|
83
|
+
"examples": []
|
|
84
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dashboard",
|
|
3
|
+
"category": "Blocks",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Dashboard",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/blocks/dashboard.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"data",
|
|
12
|
+
"{ userName?, avatar?, periods: Record<'day' | 'week' | 'month', { revenue, delta, series, labels?, kpis }>, transactions }",
|
|
13
|
+
"sample merchant",
|
|
14
|
+
"Everything the screen shows. KPIs: { id, label, value, format?: 'money' | 'count' | 'percent', delta?, trend?, invert? }. Transactions: { id, title, subtitle?, amount (signed), category?, pending? }."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"currency",
|
|
18
|
+
"string",
|
|
19
|
+
"'₹'",
|
|
20
|
+
"Symbol placed before money values."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"formatMoney",
|
|
24
|
+
"(value: number) => string",
|
|
25
|
+
"—",
|
|
26
|
+
"Custom money formatter (overrides currency), e.g. Intl.NumberFormat or en-IN grouping."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"title",
|
|
30
|
+
"string",
|
|
31
|
+
"'Overview'",
|
|
32
|
+
"Large title."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"defaultPeriod / period",
|
|
36
|
+
"'day' | 'week' | 'month'",
|
|
37
|
+
"'week'",
|
|
38
|
+
"Uncontrolled initial period, or controlled period."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"onPeriodChange",
|
|
42
|
+
"(period) => void",
|
|
43
|
+
"—",
|
|
44
|
+
"Segmented control changed."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"loading",
|
|
48
|
+
"boolean",
|
|
49
|
+
"false",
|
|
50
|
+
"Shows skeleton placeholders for the chart, KPIs, actions and transactions."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"onRefresh",
|
|
54
|
+
"() => void | Promise",
|
|
55
|
+
"—",
|
|
56
|
+
"Enables pull-to-refresh; a returned promise keeps the spinner until it settles."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"refreshing",
|
|
60
|
+
"boolean",
|
|
61
|
+
"—",
|
|
62
|
+
"Controlled refreshing flag."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"quickActions",
|
|
66
|
+
"{ id, label, icon: 'send' | 'request' | 'topup' | 'cards' | 'more' }[]",
|
|
67
|
+
"Send · Request · Top up · Cards",
|
|
68
|
+
"Round shortcut buttons under the KPIs."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"onQuickAction",
|
|
72
|
+
"(action) => void",
|
|
73
|
+
"—",
|
|
74
|
+
"A quick action was tapped."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"onSelectTransaction",
|
|
78
|
+
"(transaction) => void",
|
|
79
|
+
"—",
|
|
80
|
+
"Makes transaction rows pressable."
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"onSeeAllTransactions",
|
|
84
|
+
"() => void",
|
|
85
|
+
"—",
|
|
86
|
+
"Shows a “See all” link beside the section heading."
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"onSelectKpi",
|
|
90
|
+
"(kpi) => void",
|
|
91
|
+
"—",
|
|
92
|
+
"Makes KPI tiles pressable."
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"onPressAvatar / onPressNotifications",
|
|
96
|
+
"() => void",
|
|
97
|
+
"—",
|
|
98
|
+
"Header avatar and bell."
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
"notificationBadge",
|
|
102
|
+
"boolean | number",
|
|
103
|
+
"—",
|
|
104
|
+
"Red dot on the bell."
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"accent",
|
|
108
|
+
"string",
|
|
109
|
+
"theme accent",
|
|
110
|
+
"Chart, quick action and refresh colour."
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
"style",
|
|
114
|
+
"StyleProp<ViewStyle>",
|
|
115
|
+
"—",
|
|
116
|
+
"Root style."
|
|
117
|
+
]
|
|
118
|
+
],
|
|
119
|
+
"examples": []
|
|
120
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "date-picker",
|
|
3
|
+
"category": "Inputs",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "DatePicker",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/date-picker.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"label",
|
|
12
|
+
"string",
|
|
13
|
+
"—",
|
|
14
|
+
"Rests in the field, floats onto the border when open or filled."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"floatingLabel",
|
|
18
|
+
"boolean",
|
|
19
|
+
"true",
|
|
20
|
+
"Set to false to put the label above the field as static text (no notch) and show placeholder inside."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"mode",
|
|
24
|
+
"'single' | 'range'",
|
|
25
|
+
"'single'",
|
|
26
|
+
"One date or a start / end range."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"value",
|
|
30
|
+
"Date | { start, end } | null",
|
|
31
|
+
"—",
|
|
32
|
+
"Controlled value."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"defaultValue",
|
|
36
|
+
"Date | { start, end } | null",
|
|
37
|
+
"null",
|
|
38
|
+
"Initial value when uncontrolled."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"onChange",
|
|
42
|
+
"(value) => void",
|
|
43
|
+
"—",
|
|
44
|
+
"Called with the committed date / range, or null when cleared."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"presentation",
|
|
48
|
+
"'auto' | 'sheet' | 'dialog' | 'popover'",
|
|
49
|
+
"'auto'",
|
|
50
|
+
"auto: bottom sheet on phones, centred dialog from 640pt wide · sheet: always a bottom sheet with drag-to-dismiss · dialog: always a centred modal · popover: drops under the field."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"presets",
|
|
54
|
+
"boolean | { label, value | () => value }[]",
|
|
55
|
+
"—",
|
|
56
|
+
"true adds built-in shortcuts (Today, Next 7 days, Next weekend, This month…); or pass your own."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"confirm",
|
|
60
|
+
"boolean",
|
|
61
|
+
"false",
|
|
62
|
+
"Stage picks behind Clear / Done; otherwise picking (or finishing a range) closes the picker."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"clearable",
|
|
66
|
+
"boolean",
|
|
67
|
+
"false",
|
|
68
|
+
"Show an × in the field that clears the value."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"format",
|
|
72
|
+
"(date: Date) => string",
|
|
73
|
+
"—",
|
|
74
|
+
"Custom formatter for each date shown in the field."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"formatOptions",
|
|
78
|
+
"Intl.DateTimeFormatOptions",
|
|
79
|
+
"{ day, month: 'short', year }",
|
|
80
|
+
"Intl options for the field text."
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"locale",
|
|
84
|
+
"string",
|
|
85
|
+
"device",
|
|
86
|
+
"Locale for the field and the calendar."
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"size",
|
|
90
|
+
"'sm' | 'md' | 'lg'",
|
|
91
|
+
"'md'",
|
|
92
|
+
"Field height 46 / 56 / 66 and type size."
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"placeholder",
|
|
96
|
+
"string",
|
|
97
|
+
"—",
|
|
98
|
+
"Shown in the field while open with nothing picked, and in the sheet header."
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
"title",
|
|
102
|
+
"string",
|
|
103
|
+
"label",
|
|
104
|
+
"Sheet heading."
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"minDate / maxDate",
|
|
108
|
+
"Date",
|
|
109
|
+
"—",
|
|
110
|
+
"Selectable bounds; presets outside them are disabled."
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
"isDateDisabled",
|
|
114
|
+
"(date: Date) => boolean",
|
|
115
|
+
"—",
|
|
116
|
+
"Disable individual days."
|
|
117
|
+
],
|
|
118
|
+
[
|
|
119
|
+
"markedDates",
|
|
120
|
+
"Record<string, string | string[]>",
|
|
121
|
+
"—",
|
|
122
|
+
"Event dots, passed to Calendar."
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
"weekStartsOn",
|
|
126
|
+
"0 | 1",
|
|
127
|
+
"0",
|
|
128
|
+
"First day of the week."
|
|
129
|
+
],
|
|
130
|
+
[
|
|
131
|
+
"showOutsideDays",
|
|
132
|
+
"boolean",
|
|
133
|
+
"false",
|
|
134
|
+
"Show neighbouring-month days in the grid."
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
"error",
|
|
138
|
+
"string",
|
|
139
|
+
"—",
|
|
140
|
+
"Red border, icon message and one shake."
|
|
141
|
+
],
|
|
142
|
+
[
|
|
143
|
+
"success",
|
|
144
|
+
"boolean | string",
|
|
145
|
+
"—",
|
|
146
|
+
"Success border and check; a string is shown under the field."
|
|
147
|
+
],
|
|
148
|
+
[
|
|
149
|
+
"helper",
|
|
150
|
+
"string",
|
|
151
|
+
"—",
|
|
152
|
+
"Hint under the field."
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
"disabled",
|
|
156
|
+
"boolean",
|
|
157
|
+
"false",
|
|
158
|
+
"Dims the field and blocks opening."
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
"accent",
|
|
162
|
+
"string",
|
|
163
|
+
"theme accent",
|
|
164
|
+
"Focus, halo and selection colour."
|
|
165
|
+
],
|
|
166
|
+
[
|
|
167
|
+
"surface",
|
|
168
|
+
"string",
|
|
169
|
+
"theme background",
|
|
170
|
+
"Background behind the field (the label notch uses it)."
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
"onOpenChange",
|
|
174
|
+
"(open: boolean) => void",
|
|
175
|
+
"—",
|
|
176
|
+
"Called when the picker opens or closes."
|
|
177
|
+
],
|
|
178
|
+
[
|
|
179
|
+
"style",
|
|
180
|
+
"StyleProp<ViewStyle>",
|
|
181
|
+
"—",
|
|
182
|
+
"Root container style."
|
|
183
|
+
],
|
|
184
|
+
[
|
|
185
|
+
"fieldStyle",
|
|
186
|
+
"StyleProp<ViewStyle>",
|
|
187
|
+
"—",
|
|
188
|
+
"The bordered box: background, border width / colour, radius, height, padding. Wins over the computed style; a borderColor replaces the resting border only (focus, error and success colours still show). A numeric height / borderRadius re-centres the label and resizes the halo."
|
|
189
|
+
],
|
|
190
|
+
[
|
|
191
|
+
"inputStyle",
|
|
192
|
+
"StyleProp<TextStyle>",
|
|
193
|
+
"—",
|
|
194
|
+
"The formatted date text in the trigger."
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
"labelStyle",
|
|
198
|
+
"StyleProp<TextStyle>",
|
|
199
|
+
"—",
|
|
200
|
+
"Label in both modes (floating and above). color is the resting colour — focus (accent), error and success still take over; fontSize sets the resting size, it floats at the same ratio and the notch follows its width."
|
|
201
|
+
],
|
|
202
|
+
[
|
|
203
|
+
"messageStyle",
|
|
204
|
+
"StyleProp<TextStyle>",
|
|
205
|
+
"—",
|
|
206
|
+
"Helper / error / success text. color applies to the helper; error and success keep their tone colour."
|
|
207
|
+
],
|
|
208
|
+
[
|
|
209
|
+
"placeholderTextColor",
|
|
210
|
+
"string",
|
|
211
|
+
"theme mutedForeground",
|
|
212
|
+
"Placeholder colour in the trigger."
|
|
213
|
+
],
|
|
214
|
+
[
|
|
215
|
+
"iconColor",
|
|
216
|
+
"string",
|
|
217
|
+
"theme mutedForeground",
|
|
218
|
+
"Calendar icon and clear × colour at rest (calendar turns accent while open)."
|
|
219
|
+
],
|
|
220
|
+
[
|
|
221
|
+
"menuStyle",
|
|
222
|
+
"StyleProp<ViewStyle>",
|
|
223
|
+
"—",
|
|
224
|
+
"Sheet / dialog / popover panel — background, border, radius, padding, shadow (transform and opacity are animated)."
|
|
225
|
+
]
|
|
226
|
+
],
|
|
227
|
+
"examples": [
|
|
228
|
+
{
|
|
229
|
+
"name": "Birthday",
|
|
230
|
+
"title": "Birthday",
|
|
231
|
+
"code": "import React, { useState } from 'react';\nimport { Pressable, StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { DatePicker, type DatePickerPresentation, type DateRange } from '@/components/ui/date-picker';\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 s.card,\n { borderRadius: radius.xl, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nconst today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());\n\ntype Opens = Exclude<DatePickerPresentation, 'auto'>;\n\nconst OPENS: { key: Opens; label: string }[] = [\n { key: 'sheet', label: 'Sheet' },\n { key: 'dialog', label: 'Modal' },\n { key: 'popover', label: 'Popover' },\n];\n\n/** Card header with a compact switch for how the picker opens. */\nfunction Header({ title, opens, onOpens }: { title: string; opens: Opens; onOpens: (o: Opens) => void }) {\n const { colors, radius } = useKit();\n return (\n <View style={s.header}>\n <Text style={[s.title, { color: colors.foreground }]} numberOfLines={1}>\n {title}\n </Text>\n <View style={[s.switch, { backgroundColor: colors.muted, borderRadius: radius.md }]} accessibilityRole=\"radiogroup\">\n {OPENS.map((o) => {\n const on = o.key === opens;\n return (\n <Pressable\n key={o.key}\n onPress={() => onOpens(o.key)}\n accessibilityRole=\"radio\"\n accessibilityState={{ checked: on }}\n accessibilityLabel={`Open as ${o.label}`}\n style={[s.switchItem, { borderRadius: Math.max(0, radius.md - 3) }, on && { backgroundColor: colors.background }]}\n >\n <Text style={[s.switchText, { color: on ? colors.foreground : colors.mutedForeground }]}>{o.label}</Text>\n </Pressable>\n );\n })}\n </View>\n </View>\n );\n}\n\nconst s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 14 },\n header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 10 },\n title: { flexShrink: 1, fontSize: 15, fontWeight: '400' },\n switch: { flexDirection: 'row', padding: 3 },\n switchItem: { height: 28, paddingHorizontal: 10, alignItems: 'center', justifyContent: 'center' },\n switchText: { fontSize: 12.5, fontWeight: '400' },\n label: { fontSize: 12, fontWeight: '400', letterSpacing: 0.4, textTransform: 'uppercase', marginBottom: -6 },\n button: { height: 46, alignItems: 'center', justifyContent: 'center' },\n buttonText: { fontSize: 15, fontWeight: '400' },\n});\n\nexport default function Birthday() {\n const [date, setDate] = useState<Date | null>(new Date(1994, 5, 12));\n const age = date ? Math.floor((today.getTime() - date.getTime()) / (365.25 * 86400000)) : null;\n const [opens, setOpens] = useState<Opens>('sheet');\n return (\n <Card>\n <Header title=\"Profile\" opens={opens} onOpens={setOpens} />\n <DatePicker\n key={opens}\n presentation={opens}\n label=\"Date of birth\"\n value={date}\n onChange={setDate}\n maxDate={today}\n formatOptions={{ day: 'numeric', month: 'long', year: 'numeric' }}\n helper={age !== null ? `You're ${age}. Tap the month title to jump years.` : 'Used to personalise your plan.'}\n />\n </Card>\n );\n}\n"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "TripDates",
|
|
235
|
+
"title": "Trip Dates",
|
|
236
|
+
"code": "import React, { useState } from 'react';\nimport { Pressable, StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { DatePicker, type DatePickerPresentation, type DateRange } from '@/components/ui/date-picker';\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 s.card,\n { borderRadius: radius.xl, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nconst today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());\n\ntype Opens = Exclude<DatePickerPresentation, 'auto'>;\n\nconst OPENS: { key: Opens; label: string }[] = [\n { key: 'sheet', label: 'Sheet' },\n { key: 'dialog', label: 'Modal' },\n { key: 'popover', label: 'Popover' },\n];\n\n/** Card header with a compact switch for how the picker opens. */\nfunction Header({ title, opens, onOpens }: { title: string; opens: Opens; onOpens: (o: Opens) => void }) {\n const { colors, radius } = useKit();\n return (\n <View style={s.header}>\n <Text style={[s.title, { color: colors.foreground }]} numberOfLines={1}>\n {title}\n </Text>\n <View style={[s.switch, { backgroundColor: colors.muted, borderRadius: radius.md }]} accessibilityRole=\"radiogroup\">\n {OPENS.map((o) => {\n const on = o.key === opens;\n return (\n <Pressable\n key={o.key}\n onPress={() => onOpens(o.key)}\n accessibilityRole=\"radio\"\n accessibilityState={{ checked: on }}\n accessibilityLabel={`Open as ${o.label}`}\n style={[s.switchItem, { borderRadius: Math.max(0, radius.md - 3) }, on && { backgroundColor: colors.background }]}\n >\n <Text style={[s.switchText, { color: on ? colors.foreground : colors.mutedForeground }]}>{o.label}</Text>\n </Pressable>\n );\n })}\n </View>\n </View>\n );\n}\n\nconst s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 14 },\n header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 10 },\n title: { flexShrink: 1, fontSize: 15, fontWeight: '400' },\n switch: { flexDirection: 'row', padding: 3 },\n switchItem: { height: 28, paddingHorizontal: 10, alignItems: 'center', justifyContent: 'center' },\n switchText: { fontSize: 12.5, fontWeight: '400' },\n label: { fontSize: 12, fontWeight: '400', letterSpacing: 0.4, textTransform: 'uppercase', marginBottom: -6 },\n button: { height: 46, alignItems: 'center', justifyContent: 'center' },\n buttonText: { fontSize: 15, fontWeight: '400' },\n});\n\nexport default function TripDates() {\n const [trip, setTrip] = useState<DateRange | null>(null);\n const nights = trip?.start && trip.end ? Math.round((trip.end.getTime() - trip.start.getTime()) / 86400000) : 0;\n const [opens, setOpens] = useState<Opens>('dialog');\n return (\n <Card>\n <Header title=\"Trip · Kyoto\" opens={opens} onOpens={setOpens} />\n <DatePicker\n key={opens}\n presentation={opens}\n mode=\"range\"\n label=\"Check-in – Check-out\"\n title=\"When are you travelling?\"\n placeholder=\"Add dates\"\n value={trip}\n onChange={setTrip}\n presets\n confirm\n clearable\n minDate={today}\n success={nights ? `${nights} night${nights > 1 ? 's' : ''} · free cancellation until 48h before` : undefined}\n />\n </Card>\n );\n}\n"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "Deadline",
|
|
240
|
+
"title": "Deadline",
|
|
241
|
+
"code": "import React, { useState } from 'react';\nimport { Pressable, StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { DatePicker, type DatePickerPresentation, type DateRange } from '@/components/ui/date-picker';\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 s.card,\n { borderRadius: radius.xl, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nconst today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());\n\ntype Opens = Exclude<DatePickerPresentation, 'auto'>;\n\nconst OPENS: { key: Opens; label: string }[] = [\n { key: 'sheet', label: 'Sheet' },\n { key: 'dialog', label: 'Modal' },\n { key: 'popover', label: 'Popover' },\n];\n\n/** Card header with a compact switch for how the picker opens. */\nfunction Header({ title, opens, onOpens }: { title: string; opens: Opens; onOpens: (o: Opens) => void }) {\n const { colors, radius } = useKit();\n return (\n <View style={s.header}>\n <Text style={[s.title, { color: colors.foreground }]} numberOfLines={1}>\n {title}\n </Text>\n <View style={[s.switch, { backgroundColor: colors.muted, borderRadius: radius.md }]} accessibilityRole=\"radiogroup\">\n {OPENS.map((o) => {\n const on = o.key === opens;\n return (\n <Pressable\n key={o.key}\n onPress={() => onOpens(o.key)}\n accessibilityRole=\"radio\"\n accessibilityState={{ checked: on }}\n accessibilityLabel={`Open as ${o.label}`}\n style={[s.switchItem, { borderRadius: Math.max(0, radius.md - 3) }, on && { backgroundColor: colors.background }]}\n >\n <Text style={[s.switchText, { color: on ? colors.foreground : colors.mutedForeground }]}>{o.label}</Text>\n </Pressable>\n );\n })}\n </View>\n </View>\n );\n}\n\nconst s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 14 },\n header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 10 },\n title: { flexShrink: 1, fontSize: 15, fontWeight: '400' },\n switch: { flexDirection: 'row', padding: 3 },\n switchItem: { height: 28, paddingHorizontal: 10, alignItems: 'center', justifyContent: 'center' },\n switchText: { fontSize: 12.5, fontWeight: '400' },\n label: { fontSize: 12, fontWeight: '400', letterSpacing: 0.4, textTransform: 'uppercase', marginBottom: -6 },\n button: { height: 46, alignItems: 'center', justifyContent: 'center' },\n buttonText: { fontSize: 15, fontWeight: '400' },\n});\n\nexport default function Deadline() {\n const { colors, radius } = useKit();\n const [due, setDue] = useState<Date | null>(null);\n const [submitted, setSubmitted] = useState(false);\n const [opens, setOpens] = useState<Opens>('popover');\n return (\n <Card>\n <Header title=\"New task\" opens={opens} onOpens={setOpens} />\n <DatePicker\n key={opens}\n presentation={opens}\n label=\"Due date\"\n value={due}\n onChange={setDue}\n minDate={today}\n isDateDisabled={(d) => d.getDay() === 0 || d.getDay() === 6}\n presets={[\n { label: 'Tomorrow', value: () => new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1) },\n { label: 'End of month', value: () => new Date(today.getFullYear(), today.getMonth() + 1, 0) },\n ]}\n error={submitted && !due ? 'Pick a due date so the team can plan around it' : undefined}\n helper=\"Weekdays only.\"\n />\n <Pressable\n onPress={() => setSubmitted(true)}\n style={({ pressed }) => [s.button, { backgroundColor: colors.accent, borderRadius: radius.md, opacity: pressed ? 0.85 : 1 }]}\n accessibilityRole=\"button\"\n >\n <Text style={[s.buttonText, { color: colors.accentForeground }]}>Create task</Text>\n </Pressable>\n </Card>\n );\n}\n"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "Sizes",
|
|
245
|
+
"title": "Sizes",
|
|
246
|
+
"code": "import { Pressable, StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { DatePicker, type DatePickerPresentation, type DateRange } from '@/components/ui/date-picker';\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 s.card,\n { borderRadius: radius.xl, borderColor: colors.border, backgroundColor: colors.card },\n style,\n ]}\n {...rest}\n />\n );\n}\n\n/** Text in the kit's ink: `tone=\"muted\"` for secondary copy. */\nfunction Ink({ tone, style, ...rest }: TextProps & { tone?: 'muted' }) {\n const { colors } = useKit();\n return <Text style={[{ color: tone === 'muted' ? colors.mutedForeground : colors.foreground }, style]} {...rest} />;\n}\n\nconst today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());\n\nconst s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 14 },\n header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 10 },\n title: { flexShrink: 1, fontSize: 15, fontWeight: '400' },\n switch: { flexDirection: 'row', padding: 3 },\n switchItem: { height: 28, paddingHorizontal: 10, alignItems: 'center', justifyContent: 'center' },\n switchText: { fontSize: 12.5, fontWeight: '400' },\n label: { fontSize: 12, fontWeight: '400', letterSpacing: 0.4, textTransform: 'uppercase', marginBottom: -6 },\n button: { height: 46, alignItems: 'center', justifyContent: 'center' },\n buttonText: { fontSize: 15, fontWeight: '400' },\n});\n\nexport default function Sizes() {\n const d = new Date(today.getFullYear(), today.getMonth(), 24);\n return (\n <Card>\n <Ink tone=\"muted\" style={s.label}>Small</Ink>\n <DatePicker size=\"sm\" label=\"Invoice date\" defaultValue={d} />\n <Ink tone=\"muted\" style={s.label}>Medium</Ink>\n <DatePicker size=\"md\" label=\"Invoice date\" defaultValue={d} />\n <Ink tone=\"muted\" style={s.label}>Large</Ink>\n <DatePicker size=\"lg\" label=\"Invoice date\" defaultValue={d} />\n <Ink tone=\"muted\" style={s.label}>Disabled</Ink>\n <DatePicker disabled label=\"Invoice date\" defaultValue={d} />\n </Card>\n );\n}\n"
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|