@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,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "card",
|
|
3
|
+
"category": "Display",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Card",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/card.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"variant",
|
|
12
|
+
"\"default\" | \"outline\" | \"elevated\"",
|
|
13
|
+
"\"default\"",
|
|
14
|
+
"Surface style. Glass is translucent with a light edge — place it over colour or imagery."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"onPress / onLongPress",
|
|
18
|
+
"(e) => void",
|
|
19
|
+
"—",
|
|
20
|
+
"Makes the card a button with a spring press."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"pressable",
|
|
24
|
+
"boolean",
|
|
25
|
+
"false",
|
|
26
|
+
"Spring press without an onPress."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"highlight",
|
|
30
|
+
"\"none\" | \"spotlight\" | \"border\"",
|
|
31
|
+
"\"none\"",
|
|
32
|
+
"Radial glow that tracks the finger, or an accent border that glows in."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"accent",
|
|
36
|
+
"string",
|
|
37
|
+
"theme accent",
|
|
38
|
+
"Highlight colour."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"padding",
|
|
42
|
+
"number",
|
|
43
|
+
"18",
|
|
44
|
+
"Inner padding."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"gap",
|
|
48
|
+
"number",
|
|
49
|
+
"14",
|
|
50
|
+
"Space between sections."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"disabled",
|
|
54
|
+
"boolean",
|
|
55
|
+
"false",
|
|
56
|
+
"Dims and blocks presses."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"Card.Header action",
|
|
60
|
+
"ReactNode",
|
|
61
|
+
"—",
|
|
62
|
+
"Element pinned to the header's top-right."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"Card.Title / Description numberOfLines",
|
|
66
|
+
"number",
|
|
67
|
+
"—",
|
|
68
|
+
"Clamp the text to this many lines with an ellipsis."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"Card.Content / Footer",
|
|
72
|
+
"{ children, style? }",
|
|
73
|
+
"—",
|
|
74
|
+
"Plain section view / bottom row of actions (row, 10pt gap); `style` overrides either."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"Card.Media source / height",
|
|
78
|
+
"ImageSource / number",
|
|
79
|
+
"— / 168",
|
|
80
|
+
"Full-bleed image; place it first."
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"style",
|
|
84
|
+
"StyleProp<ViewStyle>",
|
|
85
|
+
"—",
|
|
86
|
+
"Style for the card surface (merged after the variant background, border and radius)."
|
|
87
|
+
]
|
|
88
|
+
],
|
|
89
|
+
"examples": [
|
|
90
|
+
{
|
|
91
|
+
"name": "Default",
|
|
92
|
+
"title": "Default",
|
|
93
|
+
"code": "import { Text, View } from 'react-native';\nimport { Card } from '@/components/ui/card';\nimport { Button } from '@/components/ui/button';\nimport { useKit } from '@/lib/kit';\n\nexport default function Default() {\n const { colors } = useKit();\n return (\n <Card>\n <Card.Header action={<Text style={{ fontSize: 18, color: colors.mutedForeground }}>⋯</Text>}>\n <Card.Title>Invite your team</Card.Title>\n <Card.Description>Collaborators can edit boards, leave comments and see version history.</Card.Description>\n </Card.Header>\n <Card.Content>\n <Text style={{ fontSize: 13, color: colors.mutedForeground }}>3 of 10 seats used on the Starter plan</Text>\n </Card.Content>\n <Card.Footer>\n <Button variant=\"outline\" size=\"sm\">Copy link</Button>\n <Button variant=\"accent\" size=\"sm\">Send invites</Button>\n </Card.Footer>\n </Card>\n );\n}\n"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "Variants",
|
|
97
|
+
"title": "Variants",
|
|
98
|
+
"code": "import { Text, View } from 'react-native';\nimport { Card } from '@/components/ui/card';\n\nexport default function Variants() {\n return (\n <View style={{ gap: 12 }}>\n {(['default', 'outline', 'elevated'] as const).map((variant) => (\n <Card key={variant} variant={variant} padding={16}>\n <Card.Header>\n <Card.Title>{variant[0].toUpperCase() + variant.slice(1)}</Card.Title>\n <Card.Description>variant="{variant}"</Card.Description>\n </Card.Header>\n </Card>\n ))}\n </View>\n );\n}\n"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "Spotlight",
|
|
102
|
+
"title": "Spotlight",
|
|
103
|
+
"code": "import React, { useState } from 'react';\nimport { Text, View } from 'react-native';\nimport { Card } from '@/components/ui/card';\nimport { useKit } from '@/lib/kit';\n\nexport default function Spotlight() {\n const { colors } = useKit();\n const [opened, setOpened] = useState(0);\n return (\n <Card variant=\"elevated\" highlight=\"spotlight\" onPress={() => setOpened((n) => n + 1)} accessibilityLabel=\"Open Kyoto guide\">\n <Card.Media source={{ uri: 'https://picsum.photos/seed/kyoto/600/400' }} height={150} />\n <Card.Header>\n <Card.Title>Kyoto in autumn</Card.Title>\n <Card.Description numberOfLines={2}>Temples, maple-lined paths and the best matcha spots — a 4-day walking guide.</Card.Description>\n </Card.Header>\n <Card.Footer>\n <Text style={{ fontSize: 13, color: colors.mutedForeground }}>12 min read · opened {opened}×</Text>\n </Card.Footer>\n </Card>\n );\n}\n"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "SelectablePlans",
|
|
107
|
+
"title": "Selectable Plans",
|
|
108
|
+
"code": "import React, { useState } from 'react';\nimport { Text, View } from 'react-native';\nimport { Card } from '@/components/ui/card';\nimport { useKit } from '@/lib/kit';\n\nexport default function SelectablePlans() {\n const { colors } = useKit();\n const [plan, setPlan] = useState('pro');\n const plans = [\n { id: 'starter', name: 'Starter', price: 'Free', note: 'For side projects' },\n { id: 'pro', name: 'Pro', price: '₹499/mo', note: 'Unlimited boards and history' },\n { id: 'team', name: 'Team', price: '₹1,499/mo', note: 'Roles, SSO and audit log' },\n ];\n return (\n <View style={{ gap: 10 }}>\n {plans.map((p) => (\n <Card\n key={p.id}\n variant=\"outline\"\n padding={16}\n highlight=\"border\"\n onPress={() => setPlan(p.id)}\n accessibilityLabel={`${p.name} plan`}\n style={plan === p.id ? { borderColor: colors.accent, borderWidth: 1.5 } : undefined}\n >\n <Card.Header action={<Text style={{ fontWeight: '400', color: plan === p.id ? colors.accent : colors.mutedForeground }}>{p.price}</Text>}>\n <Card.Title>{p.name}</Card.Title>\n <Card.Description>{p.note}</Card.Description>\n </Card.Header>\n </Card>\n ))}\n </View>\n );\n}\n"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "carousel",
|
|
3
|
+
"category": "Display",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Carousel",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/carousel.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"data",
|
|
12
|
+
"T[]",
|
|
13
|
+
"—",
|
|
14
|
+
"Items to render, one slide each."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"renderItem",
|
|
18
|
+
"({ item, index, progress, width }) => ReactNode",
|
|
19
|
+
"—",
|
|
20
|
+
"Render a slide. `progress` runs -1 → 0 → 1 across the centre — use it for parallax."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"keyExtractor",
|
|
24
|
+
"(item: T, index: number) => string",
|
|
25
|
+
"index",
|
|
26
|
+
"React key for each slide."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"itemWidth",
|
|
30
|
+
"number",
|
|
31
|
+
"0.82",
|
|
32
|
+
"Fraction of the carousel (≤ 1) or points. Capped at 460pt for tablets."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"height",
|
|
36
|
+
"number",
|
|
37
|
+
"200",
|
|
38
|
+
"Slide height."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"gap",
|
|
42
|
+
"number",
|
|
43
|
+
"12",
|
|
44
|
+
"Space between slides."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"effect",
|
|
48
|
+
"\"scale\" | \"coverflow\" | \"flat\"",
|
|
49
|
+
"\"scale\"",
|
|
50
|
+
"How neighbours look."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"pagination",
|
|
54
|
+
"\"dots\" | \"expanding\" | \"bar\" | \"none\"",
|
|
55
|
+
"\"dots\"",
|
|
56
|
+
"Indicator under the slides; dots are tappable."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"autoplay",
|
|
60
|
+
"boolean | number",
|
|
61
|
+
"false",
|
|
62
|
+
"Advance every 3.5s (or N ms); pauses while touched."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"loop",
|
|
66
|
+
"boolean",
|
|
67
|
+
"true",
|
|
68
|
+
"Autoplay wraps to the first slide."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"index",
|
|
72
|
+
"number",
|
|
73
|
+
"—",
|
|
74
|
+
"Controlled active slide. Pair with onIndexChange so autoplay / swipes update parent state."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"defaultIndex",
|
|
78
|
+
"number",
|
|
79
|
+
"0",
|
|
80
|
+
"Uncontrolled initial slide (ignored when index is set)."
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"onIndexChange",
|
|
84
|
+
"(index: number) => void",
|
|
85
|
+
"—",
|
|
86
|
+
"Fires when the centred slide changes (swipe, dots, autoplay)."
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"accent",
|
|
90
|
+
"string",
|
|
91
|
+
"theme accent",
|
|
92
|
+
"Active dot / bar colour."
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"style",
|
|
96
|
+
"StyleProp<ViewStyle>",
|
|
97
|
+
"—",
|
|
98
|
+
"Style for the root view wrapping the slides and pagination."
|
|
99
|
+
]
|
|
100
|
+
],
|
|
101
|
+
"examples": []
|
|
102
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "checkbox",
|
|
3
|
+
"category": "Selection",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Checkbox",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/checkbox.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"checked / onChange",
|
|
12
|
+
"boolean",
|
|
13
|
+
"—",
|
|
14
|
+
"Controlled state (or use defaultChecked)."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"defaultChecked",
|
|
18
|
+
"boolean",
|
|
19
|
+
"false",
|
|
20
|
+
"Initial state when uncontrolled."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"label",
|
|
24
|
+
"string",
|
|
25
|
+
"—",
|
|
26
|
+
"Text next to the box."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"description",
|
|
30
|
+
"string",
|
|
31
|
+
"—",
|
|
32
|
+
"Secondary line."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"strike",
|
|
36
|
+
"boolean",
|
|
37
|
+
"false",
|
|
38
|
+
"Strike the label through when checked."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"shape",
|
|
42
|
+
"\"square\" | \"circle\"",
|
|
43
|
+
"\"square\"",
|
|
44
|
+
"Rounded square (corner = size / 3.4) or full circle."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"size",
|
|
48
|
+
"number",
|
|
49
|
+
"24",
|
|
50
|
+
"Box width and height in points; the tick is 80% of it."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"accent",
|
|
54
|
+
"string",
|
|
55
|
+
"theme accent",
|
|
56
|
+
"Checked colour."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"disabled",
|
|
60
|
+
"boolean",
|
|
61
|
+
"false",
|
|
62
|
+
"Dims to 50% and blocks presses."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"style",
|
|
66
|
+
"StyleProp<ViewStyle>",
|
|
67
|
+
"—",
|
|
68
|
+
"Style for the pressable row holding the box and label."
|
|
69
|
+
]
|
|
70
|
+
],
|
|
71
|
+
"examples": [
|
|
72
|
+
{
|
|
73
|
+
"name": "Default",
|
|
74
|
+
"title": "Default",
|
|
75
|
+
"code": "import { Checkbox } from '@/components/ui/checkbox';\n\nexport default function Default() {\n return <Checkbox label=\"Accept terms and conditions\" defaultChecked />;\n}\n"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "WithDescription",
|
|
79
|
+
"title": "With Description",
|
|
80
|
+
"code": "import { Checkbox } from '@/components/ui/checkbox';\n\nexport default function WithDescription() {\n return (\n <Checkbox\n label=\"Marketing emails\"\n description=\"Product news and offers, about once a month.\"\n />\n );\n}\n"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "TodoList",
|
|
84
|
+
"title": "Todo List",
|
|
85
|
+
"code": "import { View } from 'react-native';\nimport { Checkbox } from '@/components/ui/checkbox';\n\nexport default function TodoList() {\n return (\n <View style={{ gap: 16 }}>\n <Checkbox shape=\"circle\" strike label=\"Design the onboarding flow\" defaultChecked />\n <Checkbox shape=\"circle\" strike label=\"Ship floating inputs\" />\n <Checkbox shape=\"circle\" strike label=\"Write the docs\" />\n </View>\n );\n}\n"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "Colors",
|
|
89
|
+
"title": "Colors",
|
|
90
|
+
"code": "import { View } from 'react-native';\nimport { Checkbox } from '@/components/ui/checkbox';\n\nexport default function Colors() {\n return (\n <View style={{ flexDirection: 'row', gap: 18 }}>\n {['#6366f1', '#10b981', '#f59e0b', '#ef4444', '#ec4899'].map((c) => (\n <Checkbox key={c} accent={c} defaultChecked size={28} />\n ))}\n </View>\n );\n}\n"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "checkout",
|
|
3
|
+
"category": "Blocks",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Checkout",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/blocks/checkout.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"items",
|
|
12
|
+
"{ id, name, variant?, price, quantity, image? }[]",
|
|
13
|
+
"3 sample products",
|
|
14
|
+
"Initial bag. Quantities and removals are kept in state."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"onItemsChange",
|
|
18
|
+
"(items) => void",
|
|
19
|
+
"—",
|
|
20
|
+
"Quantity changed or an item was removed."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"shippingOptions",
|
|
24
|
+
"{ value, label, description?, price, icon? }[]",
|
|
25
|
+
"Standard / Express",
|
|
26
|
+
"Delivery cards. price 0 shows 'Free'; icon is 'standard' | 'express' | 'pickup'."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"defaultShipping",
|
|
30
|
+
"string",
|
|
31
|
+
"first option",
|
|
32
|
+
"Initially selected delivery option."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"paymentMethod",
|
|
36
|
+
"{ brand, last4, expiry? }",
|
|
37
|
+
"Visa •••• 4242",
|
|
38
|
+
"Card shown in the Payment row."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"onChangePayment",
|
|
42
|
+
"() => void",
|
|
43
|
+
"—",
|
|
44
|
+
"Shows a Change link on the payment row."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"onApplyPromo",
|
|
48
|
+
"(code) => number | null | Promise<…>",
|
|
49
|
+
"—",
|
|
50
|
+
"Return the discount fraction (0.1 = 10%) or null. Omit to hide the promo row."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"taxRate",
|
|
54
|
+
"number",
|
|
55
|
+
"0.08",
|
|
56
|
+
"Tax on the discounted subtotal."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"onPay",
|
|
60
|
+
"(summary) => void | Promise",
|
|
61
|
+
"—",
|
|
62
|
+
"Slider completed. Resolve to show the order-placed screen; reject to slide back."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"orderNumber",
|
|
66
|
+
"string",
|
|
67
|
+
"'EK-48213'",
|
|
68
|
+
"Shown on the success screen."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"onBack / onDone",
|
|
72
|
+
"() => void",
|
|
73
|
+
"—",
|
|
74
|
+
"Header back button / success and empty-bag buttons."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"currency",
|
|
78
|
+
"string",
|
|
79
|
+
"'₹'",
|
|
80
|
+
"Symbol placed before amounts by the default formatter (Indian digit grouping, decimals only when non-zero)."
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"formatPrice",
|
|
84
|
+
"(amount) => string",
|
|
85
|
+
"'₹1,23,456'",
|
|
86
|
+
"Money formatter. Overrides currency — use for Intl, other grouping or suffix symbols like '12,50 €'."
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"accent",
|
|
90
|
+
"string",
|
|
91
|
+
"theme accent",
|
|
92
|
+
"Selection, steppers and the pay slider."
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"style",
|
|
96
|
+
"StyleProp<ViewStyle>",
|
|
97
|
+
"—",
|
|
98
|
+
"Root style."
|
|
99
|
+
]
|
|
100
|
+
],
|
|
101
|
+
"examples": []
|
|
102
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chip-group",
|
|
3
|
+
"category": "Selection",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "ChipGroup",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/chip-group.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"options",
|
|
12
|
+
"(string | { value, label?, icon?, count?, disabled? })[]",
|
|
13
|
+
"—",
|
|
14
|
+
"Plain strings or objects with label, icon, count and per-chip disabled."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"multiple",
|
|
18
|
+
"boolean",
|
|
19
|
+
"false",
|
|
20
|
+
"Allow several selected chips."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"value / onValueChange",
|
|
24
|
+
"string[]",
|
|
25
|
+
"—",
|
|
26
|
+
"Controlled selection (or use defaultValue). Single mode reports [] or [value]."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"defaultValue",
|
|
30
|
+
"string[]",
|
|
31
|
+
"[]",
|
|
32
|
+
"Initial selection when uncontrolled."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"deselectable",
|
|
36
|
+
"boolean",
|
|
37
|
+
"true",
|
|
38
|
+
"Single mode: tapping the selected chip clears it."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"variant",
|
|
42
|
+
"\"solid\" | \"outline\" | \"soft\"",
|
|
43
|
+
"\"solid\"",
|
|
44
|
+
"Selected look: filled accent, accent border with a faint tint, or soft accent tint."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"size",
|
|
48
|
+
"\"sm\" | \"md\" | \"lg\"",
|
|
49
|
+
"\"md\"",
|
|
50
|
+
"30 / 36 / 42pt tall."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"scrollable",
|
|
54
|
+
"boolean",
|
|
55
|
+
"false",
|
|
56
|
+
"One horizontally scrolling row instead of wrapping."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"contentInset",
|
|
60
|
+
"number",
|
|
61
|
+
"0",
|
|
62
|
+
"Scroll-row edge padding that bleeds into your screen gutter."
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"showCheck",
|
|
66
|
+
"boolean",
|
|
67
|
+
"true",
|
|
68
|
+
"Morph a check in front of the label when selected."
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"accent",
|
|
72
|
+
"string",
|
|
73
|
+
"theme accent",
|
|
74
|
+
"Selected colour."
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"disabled",
|
|
78
|
+
"boolean",
|
|
79
|
+
"false",
|
|
80
|
+
"Dims every chip and blocks presses (or set disabled per option)."
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"style",
|
|
84
|
+
"StyleProp<ViewStyle>",
|
|
85
|
+
"—",
|
|
86
|
+
"Style for the wrapping row (the ScrollView when scrollable)."
|
|
87
|
+
]
|
|
88
|
+
],
|
|
89
|
+
"examples": [
|
|
90
|
+
{
|
|
91
|
+
"name": "Solid",
|
|
92
|
+
"title": "Solid",
|
|
93
|
+
"code": "import { ChipGroup } from '@/components/ui/chip-group';\n\nexport default function Solid() {\n return (\n <ChipGroup\n multiple\n defaultValue={['Vegan', 'Gluten-free']}\n options={['Vegan', 'Vegetarian', 'Gluten-free', 'Dairy-free', 'Nut-free', 'Halal']}\n />\n );\n}\n"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "Outline",
|
|
97
|
+
"title": "Outline",
|
|
98
|
+
"code": "import { ChipGroup } from '@/components/ui/chip-group';\n\nexport default function Outline() {\n return (\n <ChipGroup\n variant=\"outline\"\n defaultValue={['Remote']}\n options={['Remote', 'Hybrid', 'On-site']}\n />\n );\n}\n"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "Soft",
|
|
102
|
+
"title": "Soft",
|
|
103
|
+
"code": "import { ChipGroup } from '@/components/ui/chip-group';\n\nexport default function Soft() {\n return (\n <ChipGroup\n variant=\"soft\"\n multiple\n defaultValue={['open']}\n options={[\n { value: 'open', label: 'Open', count: 24 },\n { value: 'review', label: 'In review', count: 7 },\n { value: 'merged', label: 'Merged', count: 112 },\n { value: 'closed', label: 'Closed', count: 3 },\n ]}\n />\n );\n}\n"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "Scrollable",
|
|
107
|
+
"title": "Scrollable",
|
|
108
|
+
"code": "import React, { useState } from 'react';\nimport { Text, View } from 'react-native';\nimport { ChipGroup } from '@/components/ui/chip-group';\n\nexport default function Scrollable() {\n const [picked, setPicked] = useState<string[]>(['all']);\n return (\n <ChipGroup\n scrollable\n deselectable={false}\n value={picked}\n onValueChange={setPicked}\n options={[\n { value: 'all', label: 'All' },\n { value: 'coffee', label: 'Coffee', icon: <Text>☕️</Text> },\n { value: 'bakery', label: 'Bakery', icon: <Text>🥐</Text> },\n { value: 'brunch', label: 'Brunch', icon: <Text>🍳</Text> },\n { value: 'pizza', label: 'Pizza', icon: <Text>🍕</Text> },\n { value: 'sushi', label: 'Sushi', icon: <Text>🍣</Text> },\n ]}\n />\n );\n}\n"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "Sizes",
|
|
112
|
+
"title": "Sizes",
|
|
113
|
+
"code": "import { Text, View } from 'react-native';\nimport { ChipGroup } from '@/components/ui/chip-group';\n\nexport default function Sizes() {\n return (\n <View style={{ gap: 12 }}>\n <ChipGroup size=\"sm\" multiple defaultValue={['S']} options={['XS', 'S', 'M', 'L']} />\n <ChipGroup size=\"md\" multiple defaultValue={['M']} options={['XS', 'S', 'M', 'L']} />\n <ChipGroup size=\"lg\" multiple defaultValue={['L']} options={['XS', 'S', 'M', 'L']} />\n </View>\n );\n}\n"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "color-swatch",
|
|
3
|
+
"category": "Selection",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "ColorSwatch",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/color-swatch.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"colors",
|
|
12
|
+
"(string | { color, label? })[]",
|
|
13
|
+
"10-colour palette",
|
|
14
|
+
"Your swatches (hex)."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"value / onValueChange",
|
|
18
|
+
"string",
|
|
19
|
+
"—",
|
|
20
|
+
"Controlled selection (or use defaultValue)."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"defaultValue",
|
|
24
|
+
"string",
|
|
25
|
+
"—",
|
|
26
|
+
"Initial selection when uncontrolled."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"variant",
|
|
30
|
+
"\"circle\" | \"square\" | \"pill\"",
|
|
31
|
+
"\"circle\"",
|
|
32
|
+
"Swatch shape."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"size",
|
|
36
|
+
"\"sm\" | \"md\" | \"lg\"",
|
|
37
|
+
"\"md\"",
|
|
38
|
+
"28 / 36 / 44pt swatches."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"scrollable",
|
|
42
|
+
"boolean",
|
|
43
|
+
"false",
|
|
44
|
+
"One horizontally scrolling row instead of a wrapping grid."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"showLabels",
|
|
48
|
+
"boolean",
|
|
49
|
+
"false",
|
|
50
|
+
"Colour names under each swatch."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"disabled",
|
|
54
|
+
"boolean",
|
|
55
|
+
"false",
|
|
56
|
+
"Dims and blocks presses."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"style",
|
|
60
|
+
"StyleProp<ViewStyle>",
|
|
61
|
+
"—",
|
|
62
|
+
"Style for the wrapping grid (the ScrollView when scrollable)."
|
|
63
|
+
]
|
|
64
|
+
],
|
|
65
|
+
"examples": []
|
|
66
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "confetti",
|
|
3
|
+
"category": "Coupons",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Confetti",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/confetti.tsx"
|
|
8
|
+
],
|
|
9
|
+
"props": [
|
|
10
|
+
[
|
|
11
|
+
"count",
|
|
12
|
+
"number",
|
|
13
|
+
"80",
|
|
14
|
+
"Pieces per burst (max 160)."
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"colors",
|
|
18
|
+
"string[]",
|
|
19
|
+
"vivid mix",
|
|
20
|
+
"Piece colours."
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"origin",
|
|
24
|
+
"\"top\" | \"center\" | \"bottom\"",
|
|
25
|
+
"\"bottom\"",
|
|
26
|
+
"Rain from the top, pop outward, or two cannons from the bottom corners."
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"duration",
|
|
30
|
+
"number",
|
|
31
|
+
"2600",
|
|
32
|
+
"How long a burst lasts, in ms."
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"trigger",
|
|
36
|
+
"unknown",
|
|
37
|
+
"—",
|
|
38
|
+
"Fire a burst whenever this value changes — no ref needed."
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"autoplay",
|
|
42
|
+
"boolean",
|
|
43
|
+
"false",
|
|
44
|
+
"Fire once on mount."
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"onDone",
|
|
48
|
+
"() => void",
|
|
49
|
+
"—",
|
|
50
|
+
"A burst finished."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"ref.burst(options?)",
|
|
54
|
+
"{ origin?, x?, y?, count?, colors? }",
|
|
55
|
+
"—",
|
|
56
|
+
"Fire a burst (they can overlap); x / y place a center burst."
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"style",
|
|
60
|
+
"StyleProp<ViewStyle>",
|
|
61
|
+
"fills its parent",
|
|
62
|
+
"The overlay never takes touches."
|
|
63
|
+
]
|
|
64
|
+
],
|
|
65
|
+
"examples": [
|
|
66
|
+
{
|
|
67
|
+
"name": "Celebrate",
|
|
68
|
+
"title": "Celebrate",
|
|
69
|
+
"code": "import React, { useRef, useState } from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport { Confetti, type ConfettiHandle } from '@/components/ui/confetti';\nimport { useKit } from '@/lib/kit';\n\nexport default function Celebrate() {\n const { colors, radius } = useKit();\n const confetti = useRef<ConfettiHandle>(null);\n return (\n <View style={{ height: 420, borderRadius: radius.xl, backgroundColor: colors.muted, overflow: 'hidden', alignItems: 'center', justifyContent: 'center', gap: 10, padding: 24 }}>\n <Text style={{ fontSize: 44 }}>🎉</Text>\n <Text style={{ color: colors.foreground, fontSize: 24, fontWeight: '800', letterSpacing: -0.5 }}>Order placed!</Text>\n <Text style={{ color: colors.mutedForeground, fontSize: 14, textAlign: 'center' }}>You saved ₹240 with coupon GLOW50. Arriving Thursday.</Text>\n <Pressable\n onPress={() => confetti.current?.burst()}\n accessibilityRole=\"button\"\n style={{ marginTop: 12, paddingHorizontal: 22, paddingVertical: 13, borderRadius: 999, backgroundColor: colors.primary }}\n >\n <Text style={{ color: colors.primaryForeground, fontSize: 15, fontWeight: '700' }}>Celebrate again</Text>\n </Pressable>\n <Confetti ref={confetti} autoplay />\n </View>\n );\n}\n"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "Rain",
|
|
73
|
+
"title": "Rain",
|
|
74
|
+
"code": "import React, { useRef, useState } from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport { Confetti, type ConfettiHandle } from '@/components/ui/confetti';\nimport { useKit } from '@/lib/kit';\n\nexport default function Rain() {\n const { colors, radius } = useKit();\n const [shower, setShower] = useState(0);\n return (\n <View style={{ height: 360, borderRadius: radius.xl, backgroundColor: colors.muted, overflow: 'hidden', alignItems: 'center', justifyContent: 'center' }}>\n <Pressable onPress={() => setShower((n) => n + 1)} accessibilityRole=\"button\" style={{ paddingHorizontal: 22, paddingVertical: 13, borderRadius: 999, borderWidth: 1.5, borderColor: colors.foreground }}>\n <Text style={{ color: colors.foreground, fontSize: 15, fontWeight: '700' }}>Make it rain</Text>\n </Pressable>\n <Confetti origin=\"top\" count={120} trigger={shower} colors={['#ffd23f', '#ffb000', '#fff3b0', '#ffffff']} />\n </View>\n );\n}\n"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "TapToPop",
|
|
78
|
+
"title": "Tap To Pop",
|
|
79
|
+
"code": "import React, { useRef, useState } from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport { Confetti, type ConfettiHandle } from '@/components/ui/confetti';\nimport { useKit } from '@/lib/kit';\n\nexport default function TapToPop() {\n const { colors, radius } = useKit();\n const confetti = useRef<ConfettiHandle>(null);\n return (\n <Pressable\n onPress={(e) => confetti.current?.burst({ origin: 'center', x: e.nativeEvent.locationX, y: e.nativeEvent.locationY, count: 50 })}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Tap to pop confetti\"\n style={{ height: 360, borderRadius: radius.xl, backgroundColor: colors.muted, overflow: 'hidden', alignItems: 'center', justifyContent: 'center' }}\n >\n {/* Not touchable, so locationX/Y are always relative to the panel. */}\n <View pointerEvents=\"none\">\n <Text style={{ color: colors.mutedForeground, fontSize: 15, fontWeight: '600' }}>Tap anywhere</Text>\n </View>\n <Confetti ref={confetti} />\n </Pressable>\n );\n}\n"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|