@expokit/cli 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +46 -2
- package/bin/expo-kit.js +1266 -0
- package/bin/lib.mjs +343 -0
- package/bin/mcp.mjs +345 -0
- package/package.json +49 -4
- package/registry/_docs/accordion.json +115 -0
- package/registry/_docs/action-sheet.json +138 -0
- package/registry/_docs/alert.json +155 -0
- package/registry/_docs/avatar.json +227 -0
- package/registry/_docs/badge.json +148 -0
- package/registry/_docs/bottom-nav.json +143 -0
- package/registry/_docs/bottom-sheet.json +186 -0
- package/registry/_docs/bullet.json +27 -0
- package/registry/_docs/button-3d.json +138 -0
- package/registry/_docs/button.json +131 -0
- package/registry/_docs/calendar.json +198 -0
- package/registry/_docs/card-stack.json +124 -0
- package/registry/_docs/card.json +131 -0
- package/registry/_docs/carousel.json +122 -0
- package/registry/_docs/chat.json +184 -0
- package/registry/_docs/checkbox.json +109 -0
- package/registry/_docs/checkout.json +105 -0
- package/registry/_docs/chip-group.json +132 -0
- package/registry/_docs/color-swatch.json +82 -0
- package/registry/_docs/confetti.json +102 -0
- package/registry/_docs/coupon.json +192 -0
- package/registry/_docs/cube-pager.json +100 -0
- package/registry/_docs/dashboard.json +123 -0
- package/registry/_docs/date-picker.json +269 -0
- package/registry/_docs/dialog.json +186 -0
- package/registry/_docs/drawer.json +199 -0
- package/registry/_docs/fab.json +144 -0
- package/registry/_docs/flip-card.json +127 -0
- package/registry/_docs/floating-input.json +211 -0
- package/registry/_docs/gift-card.json +124 -0
- package/registry/_docs/glass-button.json +142 -0
- package/registry/_docs/glass-nav-bar.json +102 -0
- package/registry/_docs/glass-search-bar.json +114 -0
- package/registry/_docs/glass-segmented.json +94 -0
- package/registry/_docs/glass-sheet.json +136 -0
- package/registry/_docs/glass-tab-bar.json +100 -0
- package/registry/_docs/glass.json +94 -0
- package/registry/_docs/inbox.json +75 -0
- package/registry/_docs/isometric-bar.json +75 -0
- package/registry/_docs/kit.json +14 -0
- package/registry/_docs/kpi-card.json +14 -0
- package/registry/_docs/like-button.json +92 -0
- package/registry/_docs/liquidglass-tab.json +30 -0
- package/registry/_docs/list-item.json +216 -0
- package/registry/_docs/loyalty-card.json +124 -0
- package/registry/_docs/morph-button.json +128 -0
- package/registry/_docs/number-ticker.json +112 -0
- package/registry/_docs/offers.json +81 -0
- package/registry/_docs/onboarding.json +69 -0
- package/registry/_docs/otp-input.json +158 -0
- package/registry/_docs/pagination-dots.json +108 -0
- package/registry/_docs/parallax-layers.json +104 -0
- package/registry/_docs/parallax-scroll.json +210 -0
- package/registry/_docs/password-input.json +112 -0
- package/registry/_docs/payment-card.json +169 -0
- package/registry/_docs/pixel-bar.json +69 -0
- package/registry/_docs/polar-area.json +81 -0
- package/registry/_docs/profile.json +87 -0
- package/registry/_docs/progress-steps.json +116 -0
- package/registry/_docs/progress.json +152 -0
- package/registry/_docs/radio-group.json +112 -0
- package/registry/_docs/rating.json +114 -0
- package/registry/_docs/ring-carousel.json +122 -0
- package/registry/_docs/scratch-card.json +110 -0
- package/registry/_docs/search-bar.json +160 -0
- package/registry/_docs/search-results.json +123 -0
- package/registry/_docs/segmented-control.json +123 -0
- package/registry/_docs/select.json +277 -0
- package/registry/_docs/settings.json +75 -0
- package/registry/_docs/shimmer-button.json +98 -0
- package/registry/_docs/sign-in.json +201 -0
- package/registry/_docs/skeleton.json +162 -0
- package/registry/_docs/slide-to-confirm.json +108 -0
- package/registry/_docs/slider.json +177 -0
- package/registry/_docs/spin-wheel.json +138 -0
- package/registry/_docs/spinner.json +121 -0
- package/registry/_docs/stateful-button.json +184 -0
- package/registry/_docs/stepper.json +184 -0
- package/registry/_docs/swipe-deck.json +118 -0
- package/registry/_docs/swipeable-row.json +95 -0
- package/registry/_docs/switch.json +124 -0
- package/registry/_docs/tabs.json +129 -0
- package/registry/_docs/tag-input.json +148 -0
- package/registry/_docs/text-animation.json +141 -0
- package/registry/_docs/textarea.json +191 -0
- package/registry/_docs/ticket-card.json +194 -0
- package/registry/_docs/ticket-shape.json +14 -0
- package/registry/_docs/tilt-card.json +157 -0
- package/registry/_docs/time-picker.json +269 -0
- package/registry/_docs/timeline-chart.json +33 -0
- package/registry/_docs/timeline.json +172 -0
- package/registry/_docs/toast.json +185 -0
- package/registry/_docs/treemap.json +33 -0
- package/registry/_docs/waterfall.json +39 -0
- package/registry/_docs/wheel-list.json +122 -0
- package/registry/accordion/files/src/components/ui/accordion.tsx +233 -0
- package/registry/accordion/files/src/lib/kit.tsx +219 -0
- package/registry/accordion.json +17 -0
- package/registry/action-sheet/files/src/components/ui/action-sheet.tsx +580 -0
- package/registry/action-sheet/files/src/lib/kit.tsx +219 -0
- package/registry/action-sheet.json +18 -0
- package/registry/alert/files/src/components/ui/alert.tsx +654 -0
- package/registry/alert/files/src/components/ui/button.tsx +274 -0
- package/registry/alert/files/src/lib/kit.tsx +219 -0
- package/registry/alert.json +20 -0
- package/registry/avatar/files/src/components/ui/avatar.tsx +790 -0
- package/registry/avatar/files/src/lib/kit.tsx +219 -0
- package/registry/avatar.json +18 -0
- package/registry/badge/files/src/components/ui/badge.tsx +626 -0
- package/registry/badge/files/src/lib/kit.tsx +219 -0
- package/registry/badge.json +17 -0
- package/registry/bottom-nav/files/src/components/ui/bottom-nav.tsx +1050 -0
- package/registry/bottom-nav/files/src/lib/kit.tsx +219 -0
- package/registry/bottom-nav.json +18 -0
- package/registry/bottom-sheet/files/src/components/ui/bottom-sheet.tsx +585 -0
- package/registry/bottom-sheet/files/src/lib/kit.tsx +219 -0
- package/registry/bottom-sheet.json +17 -0
- package/registry/bullet.json +14 -0
- package/registry/button/files/src/components/ui/button.tsx +274 -0
- package/registry/button/files/src/lib/kit.tsx +219 -0
- package/registry/button-3d/files/src/components/ui/button-3d.tsx +212 -0
- package/registry/button-3d/files/src/lib/kit.tsx +219 -0
- package/registry/button-3d.json +18 -0
- package/registry/button.json +18 -0
- package/registry/calendar/files/src/components/ui/calendar.tsx +822 -0
- package/registry/calendar/files/src/lib/kit.tsx +219 -0
- package/registry/calendar.json +17 -0
- package/registry/card/files/src/components/ui/card.tsx +300 -0
- package/registry/card/files/src/lib/kit.tsx +219 -0
- package/registry/card-stack.json +15 -0
- package/registry/card.json +17 -0
- package/registry/carousel.json +15 -0
- package/registry/chat.json +18 -0
- package/registry/checkbox/files/src/components/ui/checkbox.tsx +150 -0
- package/registry/checkbox/files/src/lib/kit.tsx +219 -0
- package/registry/checkbox.json +17 -0
- package/registry/checkout.json +26 -0
- package/registry/chip-group/files/src/components/ui/chip-group.tsx +269 -0
- package/registry/chip-group/files/src/lib/kit.tsx +219 -0
- package/registry/chip-group.json +17 -0
- package/registry/color-swatch.json +17 -0
- package/registry/confetti/files/src/components/ui/confetti.tsx +222 -0
- package/registry/confetti/files/src/lib/kit.tsx +219 -0
- package/registry/confetti.json +15 -0
- package/registry/coupon/files/src/components/ui/coupon.tsx +698 -0
- package/registry/coupon/files/src/components/ui/flip-card.tsx +205 -0
- package/registry/coupon/files/src/components/ui/tilt-card.tsx +635 -0
- package/registry/coupon/files/src/lib/kit.tsx +219 -0
- package/registry/coupon/files/src/lib/ticket-shape.tsx +543 -0
- package/registry/coupon.json +23 -0
- package/registry/cube-pager.json +15 -0
- package/registry/dashboard.json +32 -0
- package/registry/date-picker/files/src/components/ui/calendar.tsx +822 -0
- package/registry/date-picker/files/src/components/ui/date-picker.tsx +796 -0
- package/registry/date-picker/files/src/lib/kit.tsx +219 -0
- package/registry/date-picker.json +19 -0
- package/registry/dialog/files/src/components/ui/dialog.tsx +759 -0
- package/registry/dialog/files/src/lib/kit.tsx +219 -0
- package/registry/dialog.json +18 -0
- package/registry/drawer/files/src/components/ui/drawer.tsx +1135 -0
- package/registry/drawer/files/src/lib/kit.tsx +219 -0
- package/registry/drawer.json +18 -0
- package/registry/fab.json +18 -0
- package/registry/flip-card/files/src/components/ui/flip-card.tsx +205 -0
- package/registry/flip-card/files/src/lib/kit.tsx +219 -0
- package/registry/flip-card.json +15 -0
- package/registry/floating-input/files/src/components/ui/floating-input.tsx +528 -0
- package/registry/floating-input/files/src/lib/kit.tsx +219 -0
- package/registry/floating-input.json +17 -0
- package/registry/gift-card.json +21 -0
- package/registry/glass-button.json +22 -0
- package/registry/glass-nav-bar.json +21 -0
- package/registry/glass-search-bar.json +21 -0
- package/registry/glass-segmented.json +22 -0
- package/registry/glass-sheet.json +22 -0
- package/registry/glass-tab-bar.json +22 -0
- package/registry/glass.json +19 -0
- package/registry/inbox.json +30 -0
- package/registry/isometric-bar.json +14 -0
- package/registry/kit/files/src/lib/kit.tsx +219 -0
- package/registry/kit.json +11 -0
- package/registry/kpi-card/files/src/components/charts/kpi-card.tsx +45 -0
- package/registry/kpi-card.json +14 -0
- package/registry/like-button.json +18 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/_layout.tsx +97 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/alerts.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/explore.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/index.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/(tabs)/profile.tsx +5 -0
- package/registry/liquidglass-tab/files/src/app/_layout.tsx +33 -0
- package/registry/liquidglass-tab/files/src/components/GlassTabBar.tsx +259 -0
- package/registry/liquidglass-tab/files/src/components/TabScreen.tsx +122 -0
- package/registry/liquidglass-tab/files/src/lib/tab-bar.ts +61 -0
- package/registry/liquidglass-tab/files/src/lib/tab-icons.ts +130 -0
- package/registry/liquidglass-tab/files/src/lib/tabs.ts +108 -0
- package/registry/liquidglass-tab.json +23 -0
- package/registry/list-item/files/src/components/ui/list-item.tsx +508 -0
- package/registry/list-item/files/src/lib/kit.tsx +219 -0
- package/registry/list-item.json +17 -0
- package/registry/loyalty-card.json +23 -0
- package/registry/morph-button.json +18 -0
- package/registry/number-ticker.json +15 -0
- package/registry/offers.json +24 -0
- package/registry/onboarding.json +17 -0
- package/registry/otp-input/files/src/components/ui/otp-input.tsx +380 -0
- package/registry/otp-input/files/src/lib/kit.tsx +219 -0
- package/registry/otp-input.json +17 -0
- package/registry/pagination-dots/files/src/components/ui/pagination-dots.tsx +262 -0
- package/registry/pagination-dots/files/src/lib/kit.tsx +219 -0
- package/registry/pagination-dots.json +15 -0
- package/registry/parallax-layers.json +15 -0
- package/registry/parallax-scroll.json +17 -0
- package/registry/password-input/files/src/components/ui/floating-input.tsx +528 -0
- package/registry/password-input/files/src/components/ui/password-input.tsx +271 -0
- package/registry/password-input/files/src/lib/kit.tsx +219 -0
- package/registry/password-input.json +19 -0
- package/registry/payment-card/files/src/components/ui/flip-card.tsx +205 -0
- package/registry/payment-card/files/src/components/ui/payment-card.tsx +385 -0
- package/registry/payment-card/files/src/components/ui/tilt-card.tsx +635 -0
- package/registry/payment-card/files/src/lib/kit.tsx +219 -0
- package/registry/payment-card.json +21 -0
- package/registry/pixel-bar.json +14 -0
- package/registry/polar-area.json +14 -0
- package/registry/profile.json +17 -0
- package/registry/progress/files/src/components/ui/progress.tsx +883 -0
- package/registry/progress/files/src/lib/kit.tsx +219 -0
- package/registry/progress-steps/files/src/components/ui/progress-steps.tsx +559 -0
- package/registry/progress-steps/files/src/lib/kit.tsx +219 -0
- package/registry/progress-steps.json +18 -0
- package/registry/progress.json +17 -0
- package/registry/radio-group/files/src/components/ui/radio-group.tsx +327 -0
- package/registry/radio-group/files/src/lib/kit.tsx +219 -0
- package/registry/radio-group.json +18 -0
- package/registry/rating.json +18 -0
- package/registry/ring-carousel.json +15 -0
- package/registry/scratch-card.json +18 -0
- package/registry/search-bar/files/src/components/ui/search-bar.tsx +530 -0
- package/registry/search-bar/files/src/lib/kit.tsx +219 -0
- package/registry/search-bar.json +17 -0
- package/registry/search-results.json +30 -0
- package/registry/segmented-control/files/src/components/ui/segmented-control.tsx +341 -0
- package/registry/segmented-control/files/src/lib/kit.tsx +219 -0
- package/registry/segmented-control.json +18 -0
- package/registry/select/files/src/components/ui/select.tsx +1398 -0
- package/registry/select/files/src/lib/kit.tsx +219 -0
- package/registry/select.json +17 -0
- package/registry/settings.json +26 -0
- package/registry/shimmer-button.json +17 -0
- package/registry/sign-in.json +26 -0
- package/registry/skeleton/files/src/components/ui/skeleton.tsx +799 -0
- package/registry/skeleton/files/src/lib/kit.tsx +219 -0
- package/registry/skeleton.json +17 -0
- package/registry/slide-to-confirm.json +18 -0
- package/registry/slider/files/src/components/ui/slider.tsx +716 -0
- package/registry/slider/files/src/lib/kit.tsx +219 -0
- package/registry/slider.json +17 -0
- package/registry/spin-wheel.json +18 -0
- package/registry/spinner/files/src/components/ui/spinner.tsx +748 -0
- package/registry/spinner/files/src/lib/kit.tsx +219 -0
- package/registry/spinner.json +17 -0
- package/registry/stateful-button/files/src/components/ui/stateful-button.tsx +532 -0
- package/registry/stateful-button/files/src/lib/kit.tsx +219 -0
- package/registry/stateful-button.json +18 -0
- package/registry/stepper/files/src/components/ui/stepper.tsx +646 -0
- package/registry/stepper/files/src/lib/kit.tsx +219 -0
- package/registry/stepper.json +17 -0
- package/registry/swipe-deck.json +15 -0
- package/registry/swipeable-row.json +15 -0
- package/registry/switch/files/src/components/ui/switch.tsx +344 -0
- package/registry/switch/files/src/lib/kit.tsx +219 -0
- package/registry/switch.json +18 -0
- package/registry/tabs/files/src/components/ui/tabs.tsx +539 -0
- package/registry/tabs/files/src/lib/kit.tsx +219 -0
- package/registry/tabs.json +17 -0
- package/registry/tag-input/files/src/components/ui/tag-input.tsx +720 -0
- package/registry/tag-input/files/src/lib/kit.tsx +219 -0
- package/registry/tag-input.json +17 -0
- package/registry/text-animation/files/src/components/ui/text-animation.tsx +650 -0
- package/registry/text-animation/files/src/lib/kit.tsx +219 -0
- package/registry/text-animation.json +15 -0
- package/registry/textarea/files/src/components/ui/textarea.tsx +553 -0
- package/registry/textarea/files/src/lib/kit.tsx +219 -0
- package/registry/textarea.json +17 -0
- package/registry/ticket-card.json +24 -0
- package/registry/ticket-shape/files/src/lib/kit.tsx +219 -0
- package/registry/ticket-shape/files/src/lib/ticket-shape.tsx +543 -0
- package/registry/ticket-shape.json +17 -0
- package/registry/tilt-card/files/src/components/ui/tilt-card.tsx +635 -0
- package/registry/tilt-card/files/src/lib/kit.tsx +219 -0
- package/registry/tilt-card.json +17 -0
- package/registry/time-picker/files/src/components/ui/time-picker.tsx +1159 -0
- package/registry/time-picker/files/src/lib/kit.tsx +219 -0
- package/registry/time-picker.json +17 -0
- package/registry/timeline/files/src/components/ui/avatar.tsx +790 -0
- package/registry/timeline/files/src/components/ui/timeline.tsx +1059 -0
- package/registry/timeline/files/src/lib/kit.tsx +219 -0
- package/registry/timeline-chart.json +14 -0
- package/registry/timeline.json +20 -0
- package/registry/toast/files/src/components/ui/button.tsx +274 -0
- package/registry/toast/files/src/components/ui/toast.tsx +1284 -0
- package/registry/toast/files/src/lib/kit.tsx +219 -0
- package/registry/toast.json +20 -0
- package/registry/treemap.json +14 -0
- package/registry/waterfall.json +14 -0
- package/registry/wheel-list.json +17 -0
- package/schema/components.schema.json +13 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "calendar",
|
|
3
|
+
"category": "Inputs",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Calendar",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/calendar.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "A month calendar where months slide in from the side you travel and ranges draw one band.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"mode",
|
|
13
|
+
"'single' | 'range' | 'multiple'",
|
|
14
|
+
"'single'",
|
|
15
|
+
"Selection model; decides the value type."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"value",
|
|
19
|
+
"Date | { start, end } | Date[] | null",
|
|
20
|
+
"—",
|
|
21
|
+
"Controlled selection (Date for single, DateRange for range, Date[] for multiple)."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"defaultValue",
|
|
25
|
+
"same as value",
|
|
26
|
+
"null",
|
|
27
|
+
"Initial selection when uncontrolled."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"onChange",
|
|
31
|
+
"(value) => void",
|
|
32
|
+
"—",
|
|
33
|
+
"Fires on every tap. Range fires { start, end: null } first, then both ends."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"month",
|
|
37
|
+
"Date",
|
|
38
|
+
"—",
|
|
39
|
+
"Controlled visible month (any date inside it)."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"defaultMonth",
|
|
43
|
+
"Date",
|
|
44
|
+
"selection or today",
|
|
45
|
+
"Month shown first when uncontrolled."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"onMonthChange",
|
|
49
|
+
"(month: Date) => void",
|
|
50
|
+
"—",
|
|
51
|
+
"Called with the first day of the month navigated to."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"weekStartsOn",
|
|
55
|
+
"0 | 1",
|
|
56
|
+
"0",
|
|
57
|
+
"0 = Sunday, 1 = Monday."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"locale",
|
|
61
|
+
"string",
|
|
62
|
+
"device",
|
|
63
|
+
"BCP 47 locale for month and weekday names."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"minDate",
|
|
67
|
+
"Date",
|
|
68
|
+
"—",
|
|
69
|
+
"Earliest selectable day; also limits navigation."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"maxDate",
|
|
73
|
+
"Date",
|
|
74
|
+
"—",
|
|
75
|
+
"Latest selectable day; also limits navigation."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"isDateDisabled",
|
|
79
|
+
"(date: Date) => boolean",
|
|
80
|
+
"—",
|
|
81
|
+
"Disable individual days (booked, holidays, weekends)."
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"markedDates",
|
|
85
|
+
"Record<string, string | string[]>",
|
|
86
|
+
"—",
|
|
87
|
+
"Up to three coloured dots under each day, keyed by toDateKey(date) (YYYY-MM-DD)."
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"highlightedDates",
|
|
91
|
+
"Record<string, string>",
|
|
92
|
+
"—",
|
|
93
|
+
"Fills whole days with a colour (birthdays, shifts, people), keyed by toDateKey(date). Text switches to a readable colour on top."
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"variant",
|
|
97
|
+
"'tiles' | 'minimal'",
|
|
98
|
+
"'tiles'",
|
|
99
|
+
"tiles puts every day of the month on a soft tile; minimal shows bare numbers with a hover / press circle."
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"weekdayFormat",
|
|
103
|
+
"'narrow' | 'short'",
|
|
104
|
+
"'narrow'",
|
|
105
|
+
"Weekday header as single letters (M T W) or short names (Mon Tue Wed), via Intl."
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
"showTodayButton",
|
|
109
|
+
"boolean",
|
|
110
|
+
"true",
|
|
111
|
+
"Shows a Today pill in the header whenever another month is on screen; tapping it jumps back."
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"showOutsideDays",
|
|
115
|
+
"boolean",
|
|
116
|
+
"false",
|
|
117
|
+
"Show faded days of the neighbouring months (tapping one navigates there)."
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
"showToday",
|
|
121
|
+
"boolean",
|
|
122
|
+
"true",
|
|
123
|
+
"Ring and tint today."
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
"fixedWeeks",
|
|
127
|
+
"boolean",
|
|
128
|
+
"false",
|
|
129
|
+
"Always render six week rows so the height never changes."
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
"monthPicker",
|
|
133
|
+
"boolean",
|
|
134
|
+
"true",
|
|
135
|
+
"Tap the title for a month grid, tap again for a year grid."
|
|
136
|
+
],
|
|
137
|
+
[
|
|
138
|
+
"max",
|
|
139
|
+
"number",
|
|
140
|
+
"—",
|
|
141
|
+
"Most dates selectable in multiple mode."
|
|
142
|
+
],
|
|
143
|
+
[
|
|
144
|
+
"accent",
|
|
145
|
+
"string",
|
|
146
|
+
"theme accent",
|
|
147
|
+
"Selection, band and today colour."
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
"style",
|
|
151
|
+
"StyleProp<ViewStyle>",
|
|
152
|
+
"—",
|
|
153
|
+
"Root container style."
|
|
154
|
+
]
|
|
155
|
+
],
|
|
156
|
+
"behavior": [
|
|
157
|
+
[
|
|
158
|
+
"Touch",
|
|
159
|
+
"Tap a day to select it. Swipe sideways or use the chevrons to change month, and tap the title for a month and year grid."
|
|
160
|
+
],
|
|
161
|
+
[
|
|
162
|
+
"Motion",
|
|
163
|
+
"Months slide in with a spring, selected days pop with a bouncy spring and range bands fade in."
|
|
164
|
+
],
|
|
165
|
+
[
|
|
166
|
+
"Screen readers",
|
|
167
|
+
"Days are buttons with selected and disabled state, labelled with the full date plus \"today\" or \"has events\" where they apply."
|
|
168
|
+
]
|
|
169
|
+
],
|
|
170
|
+
"usage": "import { useState } from 'react';\nimport { Calendar } from '@/components/ui/calendar';\n\nconst [date, setDate] = useState(new Date());\n<Calendar value={date} onChange={setDate} minDate={new Date()} />",
|
|
171
|
+
"examples": [
|
|
172
|
+
{
|
|
173
|
+
"name": "Single",
|
|
174
|
+
"title": "Single",
|
|
175
|
+
"code": "import React, { useMemo, useState } from 'react';\nimport { StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { Calendar, addDays, startOfDay, toDateKey, type DateRange } from '@/components/ui/calendar';\nimport { alpha, useKit } from '@/lib/kit';\n\nconst today = startOfDay(new Date());\n\nconst day = (d: Date | null) => (d ? d.toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short' }) : '—');\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 <View style={[s.card, { backgroundColor: colors.card, borderColor: colors.border, borderRadius: radius.xl }, style]} {...rest} />;\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 s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 12 },\n title: { fontSize: 15, fontWeight: '400' },\n summary: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },\n row: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n col: { flex: 1, gap: 2 },\n muted: { fontSize: 13 },\n strong: { fontSize: 15, fontWeight: '400' },\n pill: { paddingHorizontal: 10, paddingVertical: 6 },\n pillText: { fontSize: 13, fontWeight: '400' },\n legend: { flexDirection: 'row', flexWrap: 'wrap', columnGap: 14, rowGap: 6, justifyContent: 'center' },\n legendItem: { flexDirection: 'row', alignItems: 'center', gap: 6 },\n dot: { width: 8, height: 8, borderRadius: 4 },\n});\n\nexport default function Single() {\n const [date, setDate] = useState<Date>(addDays(today, 3));\n return (\n <Card>\n <Ink style={s.title}>Delivery day</Ink>\n <Calendar value={date} onChange={setDate} minDate={today} />\n <View style={s.summary}>\n <Ink tone=\"muted\" style={s.muted}>Arriving</Ink>\n <Ink style={s.strong}>{day(date)}</Ink>\n </View>\n </Card>\n );\n}\n"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "Range",
|
|
179
|
+
"title": "Range",
|
|
180
|
+
"code": "import React, { useMemo, useState } from 'react';\nimport { StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { Calendar, addDays, startOfDay, toDateKey, type DateRange } from '@/components/ui/calendar';\nimport { alpha, useKit } from '@/lib/kit';\n\nconst today = startOfDay(new Date());\n\nconst day = (d: Date | null) => (d ? d.toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short' }) : '—');\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 <View style={[s.card, { backgroundColor: colors.card, borderColor: colors.border, borderRadius: radius.xl }, style]} {...rest} />;\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 s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 12 },\n title: { fontSize: 15, fontWeight: '400' },\n summary: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },\n row: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n col: { flex: 1, gap: 2 },\n muted: { fontSize: 13 },\n strong: { fontSize: 15, fontWeight: '400' },\n pill: { paddingHorizontal: 10, paddingVertical: 6 },\n pillText: { fontSize: 13, fontWeight: '400' },\n legend: { flexDirection: 'row', flexWrap: 'wrap', columnGap: 14, rowGap: 6, justifyContent: 'center' },\n legendItem: { flexDirection: 'row', alignItems: 'center', gap: 6 },\n dot: { width: 8, height: 8, borderRadius: 4 },\n});\n\nexport default function Range() {\n const [stay, setStay] = useState<DateRange>({ start: addDays(today, 4), end: addDays(today, 8) });\n const { colors, radius } = useKit();\n const nights = stay.start && stay.end ? Math.round((stay.end.getTime() - stay.start.getTime()) / 86400000) : 0;\n return (\n <Card>\n <Ink style={s.title}>Your stay · Lisbon</Ink>\n <Calendar mode=\"range\" value={stay} onChange={setStay} minDate={today} />\n <View style={s.row}>\n <View style={s.col}>\n <Ink tone=\"muted\" style={s.muted}>Check-in</Ink>\n <Ink style={s.strong}>{day(stay.start)}</Ink>\n </View>\n <View style={s.col}>\n <Ink tone=\"muted\" style={s.muted}>Check-out</Ink>\n <Ink style={s.strong}>{stay.end ? day(stay.end) : 'Select a date'}</Ink>\n </View>\n <View style={[s.pill, { opacity: nights ? 1 : 0.4, backgroundColor: alpha(colors.accent, 0.14), borderRadius: radius.capsule(30) }]}>\n <Text style={[s.pillText, { color: colors.accent }]}>{nights ? `${nights} night${nights > 1 ? 's' : ''}` : '0 nights'}</Text>\n </View>\n </View>\n </Card>\n );\n}\n"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "Marked",
|
|
184
|
+
"title": "Marked",
|
|
185
|
+
"code": "import React, { useMemo, useState } from 'react';\nimport { StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { Calendar, addDays, startOfDay, toDateKey, type DateRange } from '@/components/ui/calendar';\nimport { alpha, useKit } from '@/lib/kit';\n\nconst today = startOfDay(new Date());\n\nconst day = (d: Date | null) => (d ? d.toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short' }) : '—');\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 <View style={[s.card, { backgroundColor: colors.card, borderColor: colors.border, borderRadius: radius.xl }, style]} {...rest} />;\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 MEETING = '#38bdf8';\n\nconst BIRTHDAY = '#f472b6';\n\nconst TRIP = '#f59e0b';\n\nconst DONE = '#22c55e';\n\nconst DUE = '#ef4444';\n\nconst s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 12 },\n title: { fontSize: 15, fontWeight: '400' },\n summary: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },\n row: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n col: { flex: 1, gap: 2 },\n muted: { fontSize: 13 },\n strong: { fontSize: 15, fontWeight: '400' },\n pill: { paddingHorizontal: 10, paddingVertical: 6 },\n pillText: { fontSize: 13, fontWeight: '400' },\n legend: { flexDirection: 'row', flexWrap: 'wrap', columnGap: 14, rowGap: 6, justifyContent: 'center' },\n legendItem: { flexDirection: 'row', alignItems: 'center', gap: 6 },\n dot: { width: 8, height: 8, borderRadius: 4 },\n});\n\nexport default function Marked() {\n const [date, setDate] = useState<Date>(today);\n const { highlights, marks } = useMemo(() => {\n const y = today.getFullYear();\n const m = today.getMonth();\n const k = (d: number) => toDateKey(new Date(y, m, d));\n return {\n // Whole-day fills: who / what owns the day.\n highlights: { [k(2)]: MEETING, [k(14)]: BIRTHDAY, [k(18)]: TRIP, [k(21)]: MEETING, [k(31)]: BIRTHDAY },\n // Dots underneath: smaller things on that day.\n marks: { [k(3)]: DONE, [k(8)]: DUE, [k(12)]: DONE, [k(17)]: DONE, [k(22)]: [DONE, DUE], [k(26)]: DUE },\n };\n }, []);\n return (\n <Card>\n <Ink style={s.title}>Schedule</Ink>\n <Calendar value={date} onChange={setDate} highlightedDates={highlights} markedDates={marks} weekStartsOn={1} />\n <View style={s.legend}>\n {[\n ['Meeting', MEETING],\n ['Birthday', BIRTHDAY],\n ['Trip', TRIP],\n ['Done', DONE],\n ['Due', DUE],\n ].map(([label, color]) => (\n <View key={label} style={s.legendItem}>\n <View style={[s.dot, { backgroundColor: color }]} />\n <Ink tone=\"muted\" style={s.muted}>{label}</Ink>\n </View>\n ))}\n </View>\n </Card>\n );\n}\n"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "Booking",
|
|
189
|
+
"title": "Booking",
|
|
190
|
+
"code": "import React, { useMemo, useState } from 'react';\nimport { StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { Calendar, addDays, startOfDay, toDateKey, type DateRange } from '@/components/ui/calendar';\nimport { alpha, useKit } from '@/lib/kit';\n\nconst today = startOfDay(new Date());\n\nconst day = (d: Date | null) => (d ? d.toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short' }) : '—');\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 <View style={[s.card, { backgroundColor: colors.card, borderColor: colors.border, borderRadius: radius.xl }, style]} {...rest} />;\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 s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 12 },\n title: { fontSize: 15, fontWeight: '400' },\n summary: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },\n row: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n col: { flex: 1, gap: 2 },\n muted: { fontSize: 13 },\n strong: { fontSize: 15, fontWeight: '400' },\n pill: { paddingHorizontal: 10, paddingVertical: 6 },\n pillText: { fontSize: 13, fontWeight: '400' },\n legend: { flexDirection: 'row', flexWrap: 'wrap', columnGap: 14, rowGap: 6, justifyContent: 'center' },\n legendItem: { flexDirection: 'row', alignItems: 'center', gap: 6 },\n dot: { width: 8, height: 8, borderRadius: 4 },\n});\n\nexport default function Booking() {\n const booked = useMemo(() => new Set([2, 5, 6, 11, 19].map((n) => toDateKey(addDays(today, n)))), []);\n const [date, setDate] = useState<Date | null>(null);\n return (\n <Card>\n <Ink style={s.title}>Book a consultation</Ink>\n <Calendar\n value={date}\n onChange={setDate}\n minDate={today}\n maxDate={addDays(today, 45)}\n isDateDisabled={(d) => d.getDay() === 0 || booked.has(toDateKey(d))}\n showOutsideDays\n fixedWeeks\n />\n <Ink tone=\"muted\" style={s.muted}>\n {date ? `Next: choose a time on ${day(date)}` : 'Faded days are fully booked or closed on Sundays.'}\n </Ink>\n </Card>\n );\n}\n"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "WeekStartsMonday",
|
|
194
|
+
"title": "Week Starts Monday",
|
|
195
|
+
"code": "import React, { useMemo, useState } from 'react';\nimport { StyleSheet, Text, View, type TextProps, type ViewProps } from 'react-native';\nimport { Calendar, addDays, startOfDay, toDateKey, type DateRange } from '@/components/ui/calendar';\nimport { alpha, useKit } from '@/lib/kit';\n\nconst today = startOfDay(new Date());\n\nconst day = (d: Date | null) => (d ? d.toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short' }) : '—');\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 <View style={[s.card, { backgroundColor: colors.card, borderColor: colors.border, borderRadius: radius.xl }, style]} {...rest} />;\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 s = StyleSheet.create({\n card: { padding: 16, borderWidth: StyleSheet.hairlineWidth, gap: 12 },\n title: { fontSize: 15, fontWeight: '400' },\n summary: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },\n row: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n col: { flex: 1, gap: 2 },\n muted: { fontSize: 13 },\n strong: { fontSize: 15, fontWeight: '400' },\n pill: { paddingHorizontal: 10, paddingVertical: 6 },\n pillText: { fontSize: 13, fontWeight: '400' },\n legend: { flexDirection: 'row', flexWrap: 'wrap', columnGap: 14, rowGap: 6, justifyContent: 'center' },\n legendItem: { flexDirection: 'row', alignItems: 'center', gap: 6 },\n dot: { width: 8, height: 8, borderRadius: 4 },\n});\n\nexport default function WeekStartsMonday() {\n const [days, setDays] = useState<Date[]>([addDays(today, 1), addDays(today, 3)]);\n return (\n <Card>\n <Ink style={s.title}>Training days · pick up to 3</Ink>\n <Calendar mode=\"multiple\" value={days} onChange={setDays} max={3} weekStartsOn={1} locale=\"en-GB\" showOutsideDays />\n <Ink tone=\"muted\" style={s.muted}>{days.length ? days.map((d) => day(d)).join(' · ') : 'No sessions planned'}</Ink>\n </Card>\n );\n}\n"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "card-stack",
|
|
3
|
+
"category": "3D",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "CardStack",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/card-stack.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "A Wallet-style stack that fans open on tap and slides the picked card to the front.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"data",
|
|
13
|
+
"T[]",
|
|
14
|
+
"—",
|
|
15
|
+
"Items, one card each."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"renderItem",
|
|
19
|
+
"({ item, index, front }) => ReactNode",
|
|
20
|
+
"—",
|
|
21
|
+
"Render a card. `front` is true for the card in front."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"keyExtractor",
|
|
25
|
+
"(item: T, index: number) => string",
|
|
26
|
+
"index",
|
|
27
|
+
"React key for each card."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"cardHeight",
|
|
31
|
+
"number",
|
|
32
|
+
"190",
|
|
33
|
+
"Card height."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"peek",
|
|
37
|
+
"number",
|
|
38
|
+
"14",
|
|
39
|
+
"How much of each card shows behind the front one when closed."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"spread",
|
|
43
|
+
"number",
|
|
44
|
+
"64",
|
|
45
|
+
"Space between cards when open."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"depth",
|
|
49
|
+
"number",
|
|
50
|
+
"3",
|
|
51
|
+
"Cards visible behind the front one when closed."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"selected",
|
|
55
|
+
"number",
|
|
56
|
+
"—",
|
|
57
|
+
"Controlled front card (index into data)."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"onPressFront",
|
|
61
|
+
"(index) => void",
|
|
62
|
+
"—",
|
|
63
|
+
"Tap on the front card while closed (pay with it); the cards behind still open the stack."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"getAccessibilityLabel",
|
|
67
|
+
"(item, index) => string",
|
|
68
|
+
"\"Card 2 of 4\"",
|
|
69
|
+
"Screen-reader label for each card."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"defaultSelected",
|
|
73
|
+
"number",
|
|
74
|
+
"0",
|
|
75
|
+
"Uncontrolled initial front card."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"onSelect",
|
|
79
|
+
"(index: number) => void",
|
|
80
|
+
"—",
|
|
81
|
+
"Fires when a card is picked."
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"open",
|
|
85
|
+
"boolean",
|
|
86
|
+
"—",
|
|
87
|
+
"Controlled open state."
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"onOpenChange",
|
|
91
|
+
"(open: boolean) => void",
|
|
92
|
+
"—",
|
|
93
|
+
"Fires when the stack opens or closes."
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"radius",
|
|
97
|
+
"number",
|
|
98
|
+
"18",
|
|
99
|
+
"Corner radius of each card."
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"style",
|
|
103
|
+
"StyleProp<ViewStyle>",
|
|
104
|
+
"—",
|
|
105
|
+
"Style for the root view."
|
|
106
|
+
]
|
|
107
|
+
],
|
|
108
|
+
"behavior": [
|
|
109
|
+
[
|
|
110
|
+
"Touch",
|
|
111
|
+
"Tap the closed stack to fan it open, then tap a card to bring it to the front as the stack closes. With onPressFront, a tap on the front card calls it instead."
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"Motion",
|
|
115
|
+
"Cards behind the front one shrink and tilt back in 3D depth. Opening, closing and reordering all run on springs."
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"Screen readers",
|
|
119
|
+
"Each card is a button with selected and expanded state, labelled \"Card 2 of 4\" by default or by getAccessibilityLabel."
|
|
120
|
+
]
|
|
121
|
+
],
|
|
122
|
+
"usage": null,
|
|
123
|
+
"examples": []
|
|
124
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "card",
|
|
3
|
+
"category": "Display",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Card",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/card.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "A composable card that springs down on press, with a spotlight that follows your finger.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"variant",
|
|
13
|
+
"\"default\" | \"outline\" | \"elevated\"",
|
|
14
|
+
"\"default\"",
|
|
15
|
+
"Surface style. Glass is translucent with a light edge — place it over colour or imagery."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"onPress / onLongPress",
|
|
19
|
+
"(e) => void",
|
|
20
|
+
"—",
|
|
21
|
+
"Makes the card a button with a spring press."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"pressable",
|
|
25
|
+
"boolean",
|
|
26
|
+
"false",
|
|
27
|
+
"Spring press without an onPress."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"highlight",
|
|
31
|
+
"\"none\" | \"spotlight\" | \"border\"",
|
|
32
|
+
"\"none\"",
|
|
33
|
+
"Radial glow that tracks the finger, or an accent border that glows in."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"accent",
|
|
37
|
+
"string",
|
|
38
|
+
"theme accent",
|
|
39
|
+
"Highlight colour."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"padding",
|
|
43
|
+
"number",
|
|
44
|
+
"18",
|
|
45
|
+
"Inner padding."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"gap",
|
|
49
|
+
"number",
|
|
50
|
+
"14",
|
|
51
|
+
"Space between sections."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"disabled",
|
|
55
|
+
"boolean",
|
|
56
|
+
"false",
|
|
57
|
+
"Dims and blocks presses."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"Card.Header action",
|
|
61
|
+
"ReactNode",
|
|
62
|
+
"—",
|
|
63
|
+
"Element pinned to the header's top-right."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"Card.Title / Description numberOfLines",
|
|
67
|
+
"number",
|
|
68
|
+
"—",
|
|
69
|
+
"Clamp the text to this many lines with an ellipsis."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"Card.Content / Footer",
|
|
73
|
+
"{ children, style? }",
|
|
74
|
+
"—",
|
|
75
|
+
"Plain section view / bottom row of actions (row, 10pt gap); `style` overrides either."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"Card.Media source / height",
|
|
79
|
+
"ImageSource / number",
|
|
80
|
+
"— / 168",
|
|
81
|
+
"Full-bleed image; place it first."
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"style",
|
|
85
|
+
"StyleProp<ViewStyle>",
|
|
86
|
+
"—",
|
|
87
|
+
"Style for the card surface (merged after the variant background, border and radius)."
|
|
88
|
+
]
|
|
89
|
+
],
|
|
90
|
+
"behavior": [
|
|
91
|
+
[
|
|
92
|
+
"Touch",
|
|
93
|
+
"With onPress, onLongPress or pressable it scales down with a spring and bounces back on release."
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"Motion",
|
|
97
|
+
"highlight=\"spotlight\" springs in a soft glow under your finger; highlight=\"border\" fades in a glowing accent ring."
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"Screen readers",
|
|
101
|
+
"Becomes a button with disabled state when it has onPress or onLongPress. Card.Title is a header."
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"Web",
|
|
105
|
+
"Shows a pointer cursor when it has onPress."
|
|
106
|
+
]
|
|
107
|
+
],
|
|
108
|
+
"usage": "import { Card } from '@/components/ui/card';\n\n<Card variant=\"elevated\" highlight=\"spotlight\" onPress={openGuide}>\n <Card.Header>\n <Card.Title>Kyoto in autumn</Card.Title>\n <Card.Description>Temples, maple-lined paths and the best matcha spots.</Card.Description>\n </Card.Header>\n</Card>",
|
|
109
|
+
"examples": [
|
|
110
|
+
{
|
|
111
|
+
"name": "Default",
|
|
112
|
+
"title": "Default",
|
|
113
|
+
"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"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "Variants",
|
|
117
|
+
"title": "Variants",
|
|
118
|
+
"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"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "Spotlight",
|
|
122
|
+
"title": "Spotlight",
|
|
123
|
+
"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"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "SelectablePlans",
|
|
127
|
+
"title": "Selectable Plans",
|
|
128
|
+
"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"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "carousel",
|
|
3
|
+
"category": "Display",
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"exportName": "Carousel",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/components/ui/carousel.tsx"
|
|
8
|
+
],
|
|
9
|
+
"summary": "A snapping carousel whose neighbouring slides shrink, fade or tilt with the scroll.",
|
|
10
|
+
"props": [
|
|
11
|
+
[
|
|
12
|
+
"data",
|
|
13
|
+
"T[]",
|
|
14
|
+
"—",
|
|
15
|
+
"Items to render, one slide each."
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"renderItem",
|
|
19
|
+
"({ item, index, progress, width }) => ReactNode",
|
|
20
|
+
"—",
|
|
21
|
+
"Render a slide. `progress` runs -1 → 0 → 1 across the centre — use it for parallax."
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"keyExtractor",
|
|
25
|
+
"(item: T, index: number) => string",
|
|
26
|
+
"index",
|
|
27
|
+
"React key for each slide."
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"itemWidth",
|
|
31
|
+
"number",
|
|
32
|
+
"0.82",
|
|
33
|
+
"Fraction of the carousel (≤ 1) or points. Capped at 460pt for tablets."
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"height",
|
|
37
|
+
"number",
|
|
38
|
+
"200",
|
|
39
|
+
"Slide height."
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"gap",
|
|
43
|
+
"number",
|
|
44
|
+
"12",
|
|
45
|
+
"Space between slides."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"effect",
|
|
49
|
+
"\"scale\" | \"coverflow\" | \"flat\"",
|
|
50
|
+
"\"scale\"",
|
|
51
|
+
"How neighbours look."
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"pagination",
|
|
55
|
+
"\"dots\" | \"expanding\" | \"bar\" | \"none\"",
|
|
56
|
+
"\"dots\"",
|
|
57
|
+
"Indicator under the slides; dots are tappable."
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"autoplay",
|
|
61
|
+
"boolean | number",
|
|
62
|
+
"false",
|
|
63
|
+
"Advance every 3.5s (or N ms); pauses while touched."
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"loop",
|
|
67
|
+
"boolean",
|
|
68
|
+
"true",
|
|
69
|
+
"Autoplay wraps to the first slide."
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"index",
|
|
73
|
+
"number",
|
|
74
|
+
"—",
|
|
75
|
+
"Controlled active slide. Pair with onIndexChange so autoplay / swipes update parent state."
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"defaultIndex",
|
|
79
|
+
"number",
|
|
80
|
+
"0",
|
|
81
|
+
"Uncontrolled initial slide (ignored when index is set)."
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"onIndexChange",
|
|
85
|
+
"(index: number) => void",
|
|
86
|
+
"—",
|
|
87
|
+
"Fires when the centred slide changes (swipe, dots, autoplay)."
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"accent",
|
|
91
|
+
"string",
|
|
92
|
+
"theme accent",
|
|
93
|
+
"Active dot / bar colour."
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"style",
|
|
97
|
+
"StyleProp<ViewStyle>",
|
|
98
|
+
"—",
|
|
99
|
+
"Style for the root view wrapping the slides and pagination."
|
|
100
|
+
]
|
|
101
|
+
],
|
|
102
|
+
"behavior": [
|
|
103
|
+
[
|
|
104
|
+
"Touch",
|
|
105
|
+
"Swipe to snap from slide to slide. Autoplay waits while you drag and resumes after."
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
"Motion",
|
|
109
|
+
"Slide effects are interpolated from the scroll position on the native driver. renderItem also gets a progress value for your own parallax."
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
"Screen readers",
|
|
113
|
+
"The scroller is adjustable, reads \"Slide 2 of 5\" and supports increment and decrement. Dots are buttons labelled \"Go to slide N\"."
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
"Web",
|
|
117
|
+
"Settles on the nearest slide once scrolling stops, since the web has no snap momentum."
|
|
118
|
+
]
|
|
119
|
+
],
|
|
120
|
+
"usage": null,
|
|
121
|
+
"examples": []
|
|
122
|
+
}
|