@expokit/cli 0.2.0 → 0.4.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/README.md +20 -2
- package/bin/expo-kit.js +219 -44
- package/bin/lib.mjs +110 -1
- package/bin/mcp.mjs +48 -19
- package/package.json +9 -4
- package/registry/_docs/accordion.json +16 -0
- package/registry/_docs/action-sheet.json +28 -0
- package/registry/_docs/alert.json +28 -0
- package/registry/_docs/assistant-app.json +47 -0
- package/registry/_docs/avatar.json +25 -1
- package/registry/_docs/badge.json +36 -5
- package/registry/_docs/bottom-nav.json +30 -6
- package/registry/_docs/bottom-sheet.json +28 -0
- package/registry/_docs/bullet.json +3 -0
- package/registry/_docs/button-3d.json +18 -2
- package/registry/_docs/button.json +16 -0
- package/registry/_docs/calendar.json +21 -5
- package/registry/_docs/card-stack.json +16 -0
- package/registry/_docs/card.json +20 -0
- package/registry/_docs/carousel.json +20 -0
- package/registry/_docs/chat.json +184 -0
- package/registry/_docs/checkbox.json +16 -0
- package/registry/_docs/checkout.json +10 -1
- package/registry/_docs/chip-group.json +16 -0
- package/registry/_docs/confetti.json +23 -3
- package/registry/_docs/coupon.json +16 -0
- package/registry/_docs/cube-pager.json +16 -0
- package/registry/_docs/dashboard.json +3 -0
- package/registry/_docs/date-picker.json +24 -4
- package/registry/_docs/dialog.json +24 -0
- package/registry/_docs/donut-shop.json +88 -0
- package/registry/_docs/drawer.json +32 -4
- package/registry/_docs/fab.json +24 -0
- package/registry/_docs/fintech-app.json +49 -0
- package/registry/_docs/flip-card.json +16 -0
- package/registry/_docs/floating-input.json +25 -5
- package/registry/_docs/food-app.json +47 -0
- package/registry/_docs/gift-card.json +16 -0
- package/registry/_docs/glass-button.json +24 -0
- package/registry/_docs/glass-nav-bar.json +24 -0
- package/registry/_docs/glass-search-bar.json +24 -0
- package/registry/_docs/glass-segmented.json +28 -0
- package/registry/_docs/glass-sheet.json +28 -0
- package/registry/_docs/glass-tab-bar.json +24 -0
- package/registry/_docs/glass.json +17 -1
- package/registry/_docs/grain.json +80 -0
- package/registry/_docs/inbox.json +3 -0
- package/registry/_docs/isometric-bar.json +3 -0
- package/registry/_docs/kit.json +3 -0
- package/registry/_docs/liquidglass-tab.json +3 -0
- package/registry/_docs/list-item.json +16 -0
- package/registry/_docs/loyalty-card.json +16 -0
- package/registry/_docs/morphing-button-group.json +96 -0
- package/registry/_docs/number-ticker.json +16 -0
- package/registry/_docs/offers.json +3 -0
- package/registry/_docs/onboarding.json +3 -0
- package/registry/_docs/orb-reveal.json +132 -0
- package/registry/_docs/otp-input.json +28 -4
- package/registry/_docs/parallax-layers.json +20 -0
- package/registry/_docs/parallax-scroll.json +24 -0
- package/registry/_docs/password-input.json +23 -3
- package/registry/_docs/payment-card.json +16 -0
- package/registry/_docs/pixel-bar.json +3 -0
- package/registry/_docs/polar-area.json +3 -0
- package/registry/_docs/profile.json +3 -0
- package/registry/_docs/progress-steps.json +24 -0
- package/registry/_docs/progress.json +20 -0
- package/registry/_docs/qr-code-button.json +122 -0
- package/registry/_docs/radio-group.json +20 -0
- package/registry/_docs/rating.json +24 -0
- package/registry/_docs/ring-carousel.json +20 -0
- package/registry/_docs/scratch-card.json +20 -0
- package/registry/_docs/search-bar.json +23 -3
- package/registry/_docs/search-results.json +3 -0
- package/registry/_docs/segmented-control.json +20 -0
- package/registry/_docs/select.json +33 -8
- package/registry/_docs/settings.json +9 -0
- package/registry/_docs/sign-in.json +3 -0
- package/registry/_docs/skeleton.json +22 -2
- package/registry/_docs/slide-to-confirm.json +24 -0
- package/registry/_docs/slider.json +27 -7
- package/registry/_docs/spin-wheel.json +24 -0
- package/registry/_docs/spinner.json +41 -11
- package/registry/_docs/stateful-button.json +184 -0
- package/registry/_docs/stepper.json +23 -7
- package/registry/_docs/swipe-deck.json +16 -0
- package/registry/_docs/swipeable-row.json +24 -1
- package/registry/_docs/switch.json +20 -0
- package/registry/_docs/tabs.json +24 -0
- package/registry/_docs/text-animation.json +141 -0
- package/registry/_docs/textarea.json +18 -2
- package/registry/_docs/ticket-card.json +20 -0
- package/registry/_docs/ticket-shape.json +4 -1
- package/registry/_docs/tilt-card.json +20 -4
- package/registry/_docs/time-picker.json +22 -6
- package/registry/_docs/timeline-chart.json +3 -0
- package/registry/_docs/timeline.json +18 -2
- package/registry/_docs/toast.json +32 -8
- package/registry/_docs/treemap.json +3 -0
- package/registry/_docs/waterfall.json +3 -0
- package/registry/_docs/wheel-list.json +20 -0
- package/registry/accordion/files/src/components/ui/accordion.tsx +5 -4
- package/registry/accordion/files/src/lib/kit.tsx +8 -5
- package/registry/action-sheet/files/src/components/ui/action-sheet.tsx +9 -8
- package/registry/action-sheet/files/src/lib/kit.tsx +8 -5
- package/registry/alert/files/src/components/ui/alert.tsx +7 -4
- package/registry/alert/files/src/components/ui/button.tsx +4 -3
- package/registry/alert/files/src/lib/kit.tsx +8 -5
- package/registry/assistant-app.json +49 -0
- package/registry/avatar/files/src/components/ui/avatar.tsx +7 -4
- package/registry/avatar/files/src/lib/kit.tsx +8 -5
- package/registry/badge/files/src/components/ui/badge.tsx +345 -21
- package/registry/badge/files/src/lib/kit.tsx +8 -5
- package/registry/badge.json +1 -1
- package/registry/bottom-nav/files/src/components/ui/bottom-nav.tsx +14 -7
- package/registry/bottom-nav/files/src/lib/kit.tsx +8 -5
- package/registry/bottom-sheet/files/src/components/ui/bottom-sheet.tsx +7 -6
- package/registry/bottom-sheet/files/src/lib/kit.tsx +8 -5
- package/registry/button/files/src/components/ui/button.tsx +4 -3
- package/registry/button/files/src/lib/kit.tsx +8 -5
- package/registry/button-3d/files/src/components/ui/button-3d.tsx +3 -2
- package/registry/button-3d/files/src/lib/kit.tsx +8 -5
- package/registry/calendar/files/src/components/ui/calendar.tsx +9 -5
- package/registry/calendar/files/src/lib/kit.tsx +8 -5
- package/registry/card/files/src/components/ui/card.tsx +8 -6
- package/registry/card/files/src/lib/kit.tsx +8 -5
- package/registry/chat.json +18 -0
- package/registry/checkbox/files/src/components/ui/checkbox.tsx +6 -5
- package/registry/checkbox/files/src/lib/kit.tsx +8 -5
- package/registry/chip-group/files/src/components/ui/chip-group.tsx +4 -2
- package/registry/chip-group/files/src/lib/kit.tsx +8 -5
- package/registry/confetti/files/src/lib/kit.tsx +8 -5
- package/registry/coupon/files/src/components/ui/coupon.tsx +23 -20
- package/registry/coupon/files/src/components/ui/flip-card.tsx +1 -1
- package/registry/coupon/files/src/components/ui/tilt-card.tsx +2 -2
- package/registry/coupon/files/src/lib/kit.tsx +8 -5
- package/registry/date-picker/files/src/components/ui/calendar.tsx +9 -5
- package/registry/date-picker/files/src/components/ui/date-picker.tsx +2 -2
- package/registry/date-picker/files/src/lib/kit.tsx +8 -5
- package/registry/dialog/files/src/components/ui/dialog.tsx +12 -6
- package/registry/dialog/files/src/lib/kit.tsx +8 -5
- package/registry/donut-shop.json +18 -0
- package/registry/drawer/files/src/components/ui/drawer.tsx +25 -19
- package/registry/drawer/files/src/lib/kit.tsx +8 -5
- package/registry/fintech-app.json +57 -0
- package/registry/flip-card/files/src/components/ui/flip-card.tsx +1 -1
- package/registry/flip-card/files/src/lib/kit.tsx +8 -5
- package/registry/floating-input/files/src/components/ui/floating-input.tsx +16 -6
- package/registry/floating-input/files/src/lib/kit.tsx +8 -5
- package/registry/food-app.json +55 -0
- package/registry/grain/files/src/components/ui/grain.tsx +113 -0
- package/registry/{tag-input → grain}/files/src/lib/kit.tsx +8 -5
- package/registry/grain.json +17 -0
- package/registry/kit/files/src/lib/kit.tsx +8 -5
- package/registry/liquidglass-tab/files/src/components/GlassTabBar.tsx +1 -1
- package/registry/liquidglass-tab/files/src/lib/tab-bar.ts +1 -1
- package/registry/list-item/files/src/components/ui/list-item.tsx +20 -16
- package/registry/list-item/files/src/lib/kit.tsx +8 -5
- package/registry/morphing-button-group.json +18 -0
- package/registry/orb-reveal.json +20 -0
- package/registry/otp-input/files/src/components/ui/otp-input.tsx +8 -6
- package/registry/otp-input/files/src/lib/kit.tsx +8 -5
- package/registry/password-input/files/src/components/ui/floating-input.tsx +16 -6
- package/registry/password-input/files/src/components/ui/password-input.tsx +2 -2
- package/registry/password-input/files/src/lib/kit.tsx +8 -5
- package/registry/payment-card/files/src/components/ui/flip-card.tsx +1 -1
- package/registry/payment-card/files/src/components/ui/payment-card.tsx +27 -14
- package/registry/payment-card/files/src/components/ui/tilt-card.tsx +2 -2
- package/registry/payment-card/files/src/lib/kit.tsx +8 -5
- package/registry/progress/files/src/components/ui/progress.tsx +8 -5
- package/registry/progress/files/src/lib/kit.tsx +8 -5
- package/registry/progress-steps/files/src/components/ui/progress-steps.tsx +15 -11
- package/registry/progress-steps/files/src/lib/kit.tsx +8 -5
- package/registry/qr-code-button.json +18 -0
- package/registry/radio-group/files/src/components/ui/radio-group.tsx +10 -9
- package/registry/radio-group/files/src/lib/kit.tsx +8 -5
- package/registry/search-bar/files/src/components/ui/search-bar.tsx +13 -11
- package/registry/search-bar/files/src/lib/kit.tsx +8 -5
- package/registry/segmented-control/files/src/components/ui/segmented-control.tsx +4 -2
- package/registry/segmented-control/files/src/lib/kit.tsx +8 -5
- package/registry/select/files/src/components/ui/select.tsx +3 -3
- package/registry/select/files/src/lib/kit.tsx +8 -5
- package/registry/skeleton/files/src/components/ui/skeleton.tsx +4 -4
- package/registry/skeleton/files/src/lib/kit.tsx +8 -5
- package/registry/slider/files/src/components/ui/slider.tsx +5 -4
- package/registry/slider/files/src/lib/kit.tsx +8 -5
- package/registry/spinner/files/src/components/ui/spinner.tsx +452 -34
- package/registry/spinner/files/src/lib/kit.tsx +8 -5
- package/registry/spinner.json +1 -1
- package/registry/stateful-button/files/src/components/ui/stateful-button.tsx +532 -0
- package/registry/{pagination-dots → stateful-button}/files/src/lib/kit.tsx +8 -5
- package/registry/stateful-button.json +18 -0
- package/registry/stepper/files/src/components/ui/stepper.tsx +8 -4
- package/registry/stepper/files/src/lib/kit.tsx +8 -5
- package/registry/switch/files/src/components/ui/switch.tsx +4 -3
- package/registry/switch/files/src/lib/kit.tsx +8 -5
- package/registry/tabs/files/src/components/ui/tabs.tsx +10 -8
- package/registry/tabs/files/src/lib/kit.tsx +8 -5
- package/registry/text-animation/files/src/components/ui/text-animation.tsx +650 -0
- package/registry/text-animation/files/src/lib/kit.tsx +222 -0
- package/registry/text-animation.json +15 -0
- package/registry/textarea/files/src/components/ui/textarea.tsx +11 -9
- package/registry/textarea/files/src/lib/kit.tsx +8 -5
- package/registry/ticket-shape/files/src/lib/kit.tsx +8 -5
- package/registry/tilt-card/files/src/components/ui/tilt-card.tsx +2 -2
- package/registry/tilt-card/files/src/lib/kit.tsx +8 -5
- package/registry/time-picker/files/src/components/ui/time-picker.tsx +2 -2
- package/registry/time-picker/files/src/lib/kit.tsx +8 -5
- package/registry/timeline/files/src/components/ui/avatar.tsx +7 -4
- package/registry/timeline/files/src/components/ui/timeline.tsx +12 -10
- package/registry/timeline/files/src/lib/kit.tsx +8 -5
- package/registry/toast/files/src/components/ui/button.tsx +4 -3
- package/registry/toast/files/src/components/ui/toast.tsx +13 -11
- package/registry/toast/files/src/lib/kit.tsx +8 -5
- package/schema/components.schema.json +1 -1
- package/registry/_docs/color-swatch.json +0 -66
- package/registry/_docs/kpi-card.json +0 -11
- package/registry/_docs/like-button.json +0 -72
- package/registry/_docs/morph-button.json +0 -108
- package/registry/_docs/pagination-dots.json +0 -88
- package/registry/_docs/shimmer-button.json +0 -78
- package/registry/_docs/tag-input.json +0 -128
- package/registry/color-swatch.json +0 -17
- package/registry/kpi-card/files/src/components/charts/kpi-card.tsx +0 -45
- package/registry/kpi-card.json +0 -14
- package/registry/like-button.json +0 -18
- package/registry/morph-button.json +0 -18
- package/registry/pagination-dots/files/src/components/ui/pagination-dots.tsx +0 -262
- package/registry/pagination-dots.json +0 -15
- package/registry/shimmer-button.json +0 -17
- package/registry/tag-input/files/src/components/ui/tag-input.tsx +0 -720
- package/registry/tag-input.json +0 -17
|
@@ -417,7 +417,8 @@ function ToastItem({
|
|
|
417
417
|
onRemoved,
|
|
418
418
|
}: ToastItemProps) {
|
|
419
419
|
const toast = useToast();
|
|
420
|
-
const { colors, radius, dark } = useKit();
|
|
420
|
+
const { colors, radius, dark, font } = useKit();
|
|
421
|
+
const ff = font.family ? { fontFamily: font.family } : null;
|
|
421
422
|
const toward = edge === 'bottom' ? 1 : -1; // swipe direction that dismisses toward the edge
|
|
422
423
|
const last = useRef(layout ?? { y: 0, scale: 1, hidden: false, faded: false });
|
|
423
424
|
if (layout) last.current = layout;
|
|
@@ -505,8 +506,8 @@ function ToastItem({
|
|
|
505
506
|
},
|
|
506
507
|
onPanResponderTerminate: () => {
|
|
507
508
|
setTouching(false);
|
|
508
|
-
Animated.spring(dragX, { toValue: 0, useNativeDriver: true }).start();
|
|
509
|
-
Animated.spring(dragY, { toValue: 0, useNativeDriver: true }).start();
|
|
509
|
+
Animated.spring(dragX, { toValue: 0, ...motion.snappy, useNativeDriver: true }).start();
|
|
510
|
+
Animated.spring(dragY, { toValue: 0, ...motion.snappy, useNativeDriver: true }).start();
|
|
510
511
|
},
|
|
511
512
|
});
|
|
512
513
|
})(),
|
|
@@ -572,11 +573,11 @@ function ToastItem({
|
|
|
572
573
|
<Animated.View style={[styles.row, minimal ? styles.padMinimal : icon ? styles.padIcon : styles.pad, { opacity: content }]}>
|
|
573
574
|
{icon ? <View style={!minimal && data.description ? styles.iconTop : null}>{icon}</View> : null}
|
|
574
575
|
<View style={minimal ? styles.textMinimal : styles.text}>
|
|
575
|
-
<Text numberOfLines={minimal ? 1 : 3} style={[styles.title, { color: look.title }]}>
|
|
576
|
+
<Text numberOfLines={minimal ? 1 : 3} style={[styles.title, ff, { color: look.title }]}>
|
|
576
577
|
{data.title}
|
|
577
578
|
</Text>
|
|
578
579
|
{data.description ? (
|
|
579
|
-
<Text numberOfLines={minimal ? 2 : 4} style={[styles.desc, minimal && styles.descMinimal, { color: look.desc }]}>
|
|
580
|
+
<Text numberOfLines={minimal ? 2 : 4} style={[styles.desc, minimal && styles.descMinimal, ff, { color: look.desc }]}>
|
|
580
581
|
{data.description}
|
|
581
582
|
</Text>
|
|
582
583
|
) : null}
|
|
@@ -594,7 +595,7 @@ function ToastItem({
|
|
|
594
595
|
{ borderRadius: radius.capsule(32), backgroundColor: look.actionBg, opacity: pressed ? 0.7 : 1 },
|
|
595
596
|
]}
|
|
596
597
|
>
|
|
597
|
-
<Text style={[styles.actionText, { color: look.actionFg }]}>{data.action.label}</Text>
|
|
598
|
+
<Text style={[styles.actionText, ff, { color: look.actionFg }]}>{data.action.label}</Text>
|
|
598
599
|
</Pressable>
|
|
599
600
|
) : null}
|
|
600
601
|
{closeButton ? (
|
|
@@ -648,7 +649,8 @@ interface IslandToasterProps {
|
|
|
648
649
|
* fade are native-driven on their own wrapper views.
|
|
649
650
|
*/
|
|
650
651
|
function IslandToaster({ store, toasts, duration, offset, haptics, reduceMotion, style }: IslandToasterProps) {
|
|
651
|
-
const { colors, radius, dark } = useKit();
|
|
652
|
+
const { colors, radius, dark, font } = useKit();
|
|
653
|
+
const ff = font.family ? { fontFamily: font.family } : null;
|
|
652
654
|
const active = toasts.filter((t) => !t.dismissed);
|
|
653
655
|
const front = active[0];
|
|
654
656
|
|
|
@@ -893,18 +895,18 @@ function IslandToaster({ store, toasts, duration, offset, haptics, reduceMotion,
|
|
|
893
895
|
>
|
|
894
896
|
{icon ? <View style={expanded && shown.description ? styles.iconTop : null}>{icon}</View> : null}
|
|
895
897
|
<View style={styles.text}>
|
|
896
|
-
<Text numberOfLines={expanded ? 3 : 1} style={[styles.title, { color: fg }]}>
|
|
898
|
+
<Text numberOfLines={expanded ? 3 : 1} style={[styles.title, ff, { color: fg }]}>
|
|
897
899
|
{shown.title}
|
|
898
900
|
</Text>
|
|
899
901
|
{shown.description ? (
|
|
900
|
-
<Text numberOfLines={expanded ? undefined : 1} style={[styles.desc, { color: alpha(fg, 0.62) }]}>
|
|
902
|
+
<Text numberOfLines={expanded ? undefined : 1} style={[styles.desc, ff, { color: alpha(fg, 0.62) }]}>
|
|
901
903
|
{shown.description}
|
|
902
904
|
</Text>
|
|
903
905
|
) : null}
|
|
904
906
|
</View>
|
|
905
907
|
{!expanded && shown.action ? (
|
|
906
908
|
<View style={[styles.islandChip, { borderRadius: radius.capsule(24), backgroundColor: alpha(fg, 0.14) }]}>
|
|
907
|
-
<Text style={[styles.islandChipText, { color: fg }]}>{shown.action.label}</Text>
|
|
909
|
+
<Text style={[styles.islandChipText, ff, { color: fg }]}>{shown.action.label}</Text>
|
|
908
910
|
</View>
|
|
909
911
|
) : null}
|
|
910
912
|
</Pressable>
|
|
@@ -921,7 +923,7 @@ function IslandToaster({ store, toasts, duration, offset, haptics, reduceMotion,
|
|
|
921
923
|
{ borderRadius: radius.capsule(44), backgroundColor: alpha(fg, pressed ? 0.24 : 0.16) },
|
|
922
924
|
]}
|
|
923
925
|
>
|
|
924
|
-
<Text style={[styles.title, { color: fg }]}>{shown.action.label}</Text>
|
|
926
|
+
<Text style={[styles.title, ff, { color: fg }]}>{shown.action.label}</Text>
|
|
925
927
|
</Pressable>
|
|
926
928
|
</View>
|
|
927
929
|
) : null}
|
|
@@ -181,14 +181,17 @@ export function useKit(): Theme {
|
|
|
181
181
|
return useMemo(() => build(scheme, ctx?.overrides), [scheme, ctx?.overrides]);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Shared motion presets so the whole kit moves the same way. Every spring is critically damped
|
|
186
|
+
* (damping ≥ 2·√(stiffness·mass)): it settles smoothly with no overshoot or wobble.
|
|
187
|
+
*/
|
|
185
188
|
export const motion = {
|
|
186
189
|
/** Toggles, selection indicators. */
|
|
187
|
-
snappy: { damping:
|
|
188
|
-
/** Press feedback, pops. */
|
|
189
|
-
bouncy: { damping:
|
|
190
|
+
snappy: { damping: 30, stiffness: 260, mass: 0.8 },
|
|
191
|
+
/** Press feedback, pops. (Kept under its old name; it no longer bounces.) */
|
|
192
|
+
bouncy: { damping: 26, stiffness: 220, mass: 0.7 },
|
|
190
193
|
/** Sheets, layout changes. */
|
|
191
|
-
gentle: { damping:
|
|
194
|
+
gentle: { damping: 27, stiffness: 160, mass: 1 },
|
|
192
195
|
fast: 160,
|
|
193
196
|
normal: 240,
|
|
194
197
|
};
|
|
@@ -1,66 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "like-button",
|
|
3
|
-
"category": "Buttons",
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"exportName": "LikeButton",
|
|
6
|
-
"files": [
|
|
7
|
-
"src/components/ui/like-button.tsx"
|
|
8
|
-
],
|
|
9
|
-
"props": [
|
|
10
|
-
[
|
|
11
|
-
"liked / onChange",
|
|
12
|
-
"boolean",
|
|
13
|
-
"—",
|
|
14
|
-
"Controlled state (or use defaultLiked)."
|
|
15
|
-
],
|
|
16
|
-
[
|
|
17
|
-
"defaultLiked",
|
|
18
|
-
"boolean",
|
|
19
|
-
"false",
|
|
20
|
-
"Initial state when uncontrolled; `count` is the count for this state."
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
"variant",
|
|
24
|
-
"\"heart\" | \"star\" | \"bookmark\"",
|
|
25
|
-
"\"heart\"",
|
|
26
|
-
"Heart, star or bookmark icon; also picks the default liked colour and label."
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
"count",
|
|
30
|
-
"number",
|
|
31
|
-
"—",
|
|
32
|
-
"Shows a rolling counter (1.2K formatting). Uncontrolled: the count for defaultLiked; the component adds the user's like."
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
"size",
|
|
36
|
-
"number",
|
|
37
|
-
"26",
|
|
38
|
-
"Icon size."
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
"color",
|
|
42
|
-
"string",
|
|
43
|
-
"danger / warning / accent",
|
|
44
|
-
"Liked colour (per variant default)."
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
"particleColors",
|
|
48
|
-
"string[]",
|
|
49
|
-
"liked colour + theme",
|
|
50
|
-
"Colours of the burst dots."
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
"haptics",
|
|
54
|
-
"boolean",
|
|
55
|
-
"true",
|
|
56
|
-
"Tap when liking."
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
"disabled",
|
|
60
|
-
"boolean",
|
|
61
|
-
"false",
|
|
62
|
-
"Blocks presses."
|
|
63
|
-
],
|
|
64
|
-
[
|
|
65
|
-
"style",
|
|
66
|
-
"StyleProp<ViewStyle>",
|
|
67
|
-
"—",
|
|
68
|
-
"Style for the pressable row holding the icon and counter."
|
|
69
|
-
]
|
|
70
|
-
],
|
|
71
|
-
"examples": []
|
|
72
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "morph-button",
|
|
3
|
-
"category": "Buttons",
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"exportName": "MorphButton",
|
|
6
|
-
"files": [
|
|
7
|
-
"src/components/ui/morph-button.tsx"
|
|
8
|
-
],
|
|
9
|
-
"props": [
|
|
10
|
-
[
|
|
11
|
-
"onPress",
|
|
12
|
-
"() => Promise<unknown>",
|
|
13
|
-
"—",
|
|
14
|
-
"Async work. Resolve → tick, reject → cross + shake."
|
|
15
|
-
],
|
|
16
|
-
[
|
|
17
|
-
"variant",
|
|
18
|
-
"\"primary\" | \"accent\" | \"soft\" | \"outline\"",
|
|
19
|
-
"\"primary\"",
|
|
20
|
-
"Look while idle."
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
"size",
|
|
24
|
-
"\"sm\" | \"md\" | \"lg\"",
|
|
25
|
-
"\"md\"",
|
|
26
|
-
"40 / 48 / 56pt tall."
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
"color",
|
|
30
|
-
"string",
|
|
31
|
-
"theme accent",
|
|
32
|
-
"Brand colour for accent, soft and outline."
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
"successColor / errorColor",
|
|
36
|
-
"string",
|
|
37
|
-
"theme success / danger",
|
|
38
|
-
"Colours of the result circle."
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
"resetAfter",
|
|
42
|
-
"number",
|
|
43
|
-
"1300",
|
|
44
|
-
"ms the result stays before morphing back."
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
"minLoading",
|
|
48
|
-
"number",
|
|
49
|
-
"600",
|
|
50
|
-
"Minimum ms the spinner is shown."
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
"onSuccess / onError",
|
|
54
|
-
"(value) => void",
|
|
55
|
-
"—",
|
|
56
|
-
"Called with the resolved value or the thrown error."
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
"onStatusChange",
|
|
60
|
-
"(status) => void",
|
|
61
|
-
"—",
|
|
62
|
-
"\"idle\" | \"loading\" | \"success\" | \"error\"."
|
|
63
|
-
],
|
|
64
|
-
[
|
|
65
|
-
"pill",
|
|
66
|
-
"boolean",
|
|
67
|
-
"true",
|
|
68
|
-
"Fully rounded ends while idle."
|
|
69
|
-
],
|
|
70
|
-
[
|
|
71
|
-
"block",
|
|
72
|
-
"boolean",
|
|
73
|
-
"false",
|
|
74
|
-
"Full width; shrinks to the centre while busy."
|
|
75
|
-
],
|
|
76
|
-
[
|
|
77
|
-
"left",
|
|
78
|
-
"ReactNode",
|
|
79
|
-
"—",
|
|
80
|
-
"Icon before the label."
|
|
81
|
-
],
|
|
82
|
-
[
|
|
83
|
-
"haptics",
|
|
84
|
-
"boolean",
|
|
85
|
-
"true",
|
|
86
|
-
"Taps on start, success and error."
|
|
87
|
-
],
|
|
88
|
-
[
|
|
89
|
-
"disabled",
|
|
90
|
-
"boolean",
|
|
91
|
-
"false",
|
|
92
|
-
"Blocks presses."
|
|
93
|
-
],
|
|
94
|
-
[
|
|
95
|
-
"textStyle",
|
|
96
|
-
"StyleProp<TextStyle>",
|
|
97
|
-
"—",
|
|
98
|
-
"Style for the idle label text."
|
|
99
|
-
],
|
|
100
|
-
[
|
|
101
|
-
"style",
|
|
102
|
-
"StyleProp<ViewStyle>",
|
|
103
|
-
"—",
|
|
104
|
-
"Style for the outer animated wrapper (margins, alignment)."
|
|
105
|
-
]
|
|
106
|
-
],
|
|
107
|
-
"examples": []
|
|
108
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pagination-dots",
|
|
3
|
-
"category": "Display",
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"exportName": "PaginationDots",
|
|
6
|
-
"files": [
|
|
7
|
-
"src/components/ui/pagination-dots.tsx"
|
|
8
|
-
],
|
|
9
|
-
"props": [
|
|
10
|
-
[
|
|
11
|
-
"count",
|
|
12
|
-
"number",
|
|
13
|
-
"—",
|
|
14
|
-
"Number of pages."
|
|
15
|
-
],
|
|
16
|
-
[
|
|
17
|
-
"index",
|
|
18
|
-
"number",
|
|
19
|
-
"0",
|
|
20
|
-
"Active page; changes spring the indicator across."
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
"progress",
|
|
24
|
-
"Animated.Value | AnimatedInterpolation | number",
|
|
25
|
-
"—",
|
|
26
|
-
"Live page position (e.g. Animated.divide(scrollX, width)) for smooth tracking while swiping. Use useNativeDriver: false for the 'dots' variant."
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
"variant",
|
|
30
|
-
"\"dots\" | \"scale\" | \"line\" | \"numbers\"",
|
|
31
|
-
"\"dots\"",
|
|
32
|
-
"Stretching pill · growing dot · filling segments · rolling \"2 / 5\"."
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
"size",
|
|
36
|
-
"\"sm\" | \"md\" | \"lg\"",
|
|
37
|
-
"\"md\"",
|
|
38
|
-
"6 / 8 / 10pt dots."
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
"onPress",
|
|
42
|
-
"(index: number) => void",
|
|
43
|
-
"—",
|
|
44
|
-
"Makes dots tappable (44pt hit area) and enables accessibility increment / decrement."
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
"accent",
|
|
48
|
-
"string",
|
|
49
|
-
"theme accent",
|
|
50
|
-
"Active colour."
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
"inactiveColor",
|
|
54
|
-
"string",
|
|
55
|
-
"18% foreground",
|
|
56
|
-
"Inactive dot colour."
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
"accessibilityLabel",
|
|
60
|
-
"string",
|
|
61
|
-
"\"Page\"",
|
|
62
|
-
"Announced with \"2 of 5\"."
|
|
63
|
-
],
|
|
64
|
-
[
|
|
65
|
-
"style",
|
|
66
|
-
"StyleProp<ViewStyle>",
|
|
67
|
-
"—",
|
|
68
|
-
"Style for the row of dots (the numbers pill or line track in those variants)."
|
|
69
|
-
]
|
|
70
|
-
],
|
|
71
|
-
"examples": [
|
|
72
|
-
{
|
|
73
|
-
"name": "Onboarding",
|
|
74
|
-
"title": "Onboarding",
|
|
75
|
-
"code": "import React, { useMemo, useRef, useState } from 'react';\nimport { Animated, Pressable, ScrollView, Text, View } from 'react-native';\nimport { PaginationDots } from '@/components/ui/pagination-dots';\nimport { useKit } from '@/lib/kit';\n\nconst PAGES: { color?: string; kicker: string; title: string; body: string }[] = [\n { kicker: 'PLAN', title: 'Plan your week in minutes', body: 'Drag tasks onto your calendar and we block the time for you.' },\n { color: '#0ea5e9', kicker: 'FOCUS', title: 'Stay in the zone', body: 'Focus sessions silence notifications until your block ends.' },\n { color: '#10b981', kicker: 'REVIEW', title: 'See what moved', body: 'A Friday recap shows what you shipped and what slipped.' },\n { color: '#f59e0b', kicker: 'SHARE', title: 'Bring your team along', body: 'Shared boards keep everyone on the same page.' },\n];\n\nexport default function Onboarding() {\n const { colors, radius } = useKit();\n const [width, setWidth] = useState(0);\n const [page, setPage] = useState(0);\n const scrollX = useRef(new Animated.Value(0)).current;\n const ref = useRef<ScrollView>(null);\n const progress = useMemo(() => (width ? Animated.divide(scrollX, width) : 0), [scrollX, width]);\n const go = (i: number) => ref.current?.scrollTo({ x: i * width, animated: true });\n\n return (\n <View style={{ gap: 18 }} onLayout={(e) => setWidth(e.nativeEvent.layout.width)}>\n <Animated.ScrollView\n ref={ref}\n horizontal\n pagingEnabled\n showsHorizontalScrollIndicator={false}\n scrollEventThrottle={16}\n onScroll={Animated.event([{ nativeEvent: { contentOffset: { x: scrollX } } }], { useNativeDriver: false })}\n onMomentumScrollEnd={(e) => width && setPage(Math.round(e.nativeEvent.contentOffset.x / width))}\n >\n {PAGES.map((p) => (\n <View key={p.title} style={{ width: width || 1, paddingHorizontal: 2 }}>\n <View style={{ height: 210, borderRadius: radius.scale(24), backgroundColor: p.color ?? colors.accent, padding: 22, justifyContent: 'flex-end' }}>\n <Text style={{ color: 'rgba(255,255,255,0.75)', fontSize: 12, fontWeight: '400', letterSpacing: 1.2 }}>{p.kicker}</Text>\n <Text style={{ color: '#fff', fontSize: 24, fontWeight: '400', letterSpacing: -0.5, marginTop: 6 }}>{p.title}</Text>\n <Text style={{ color: 'rgba(255,255,255,0.85)', fontSize: 14, lineHeight: 20, marginTop: 6 }}>{p.body}</Text>\n </View>\n </View>\n ))}\n </Animated.ScrollView>\n <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>\n <Pressable onPress={() => go(PAGES.length - 1)} hitSlop={12} accessibilityRole=\"button\">\n <Text style={{ fontSize: 15, fontWeight: '400', color: colors.mutedForeground }}>Skip</Text>\n </Pressable>\n <PaginationDots count={PAGES.length} progress={progress} onPress={go} accessibilityLabel=\"Onboarding page\" />\n <Pressable\n onPress={() => go(Math.min(PAGES.length - 1, page + 1))}\n accessibilityRole=\"button\"\n style={{ height: 44, paddingHorizontal: 18, borderRadius: radius.capsule(44), backgroundColor: colors.accent, justifyContent: 'center' }}\n >\n <Text style={{ fontSize: 15, fontWeight: '400', color: colors.accentForeground }}>{page === PAGES.length - 1 ? 'Done' : 'Next'}</Text>\n </Pressable>\n </View>\n </View>\n );\n}\n"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"name": "Variants",
|
|
79
|
-
"title": "Variants",
|
|
80
|
-
"code": "import React, { useMemo, useRef, useState } from 'react';\nimport { Animated, Pressable, ScrollView, Text, View } from 'react-native';\nimport { PaginationDots } from '@/components/ui/pagination-dots';\nimport { useKit } from '@/lib/kit';\n\nfunction Label({ children }: { children: string }) {\n const { colors } = useKit();\n return <Text style={{ fontSize: 12, fontWeight: '400', letterSpacing: 0.4, color: colors.mutedForeground }}>{children}</Text>;\n}\n\nexport default function Variants() {\n const { colors, radius } = useKit();\n const [i, setI] = useState(1);\n return (\n <View style={{ gap: 22 }}>\n {(['dots', 'scale', 'line', 'numbers'] as const).map((variant) => (\n <View key={variant} style={{ gap: 10 }}>\n <Label>{variant.toUpperCase()}</Label>\n <PaginationDots variant={variant} count={5} index={i} onPress={setI} />\n </View>\n ))}\n <View style={{ flexDirection: 'row', gap: 10, justifyContent: 'center' }}>\n {['Previous', 'Next'].map((t, k) => (\n <Pressable\n key={t}\n onPress={() => setI((v) => Math.max(0, Math.min(4, v + (k ? 1 : -1))))}\n accessibilityRole=\"button\"\n style={{ height: 44, paddingHorizontal: 18, borderRadius: radius.md, borderWidth: 1, borderColor: colors.border, justifyContent: 'center' }}\n >\n <Text style={{ fontSize: 14, fontWeight: '400', color: colors.foreground }}>{t}</Text>\n </Pressable>\n ))}\n </View>\n </View>\n );\n}\n"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"name": "Sizes",
|
|
84
|
-
"title": "Sizes",
|
|
85
|
-
"code": "import { Animated, Pressable, ScrollView, Text, View } from 'react-native';\nimport { PaginationDots } from '@/components/ui/pagination-dots';\n\nexport default function Sizes() {\n return (\n <View style={{ gap: 18, alignItems: 'center' }}>\n <PaginationDots size=\"sm\" count={6} index={2} />\n <PaginationDots size=\"md\" count={6} index={2} />\n <PaginationDots size=\"lg\" count={6} index={2} />\n </View>\n );\n}\n"
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "shimmer-button",
|
|
3
|
-
"category": "Buttons",
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"exportName": "ShimmerButton",
|
|
6
|
-
"files": [
|
|
7
|
-
"src/components/ui/shimmer-button.tsx"
|
|
8
|
-
],
|
|
9
|
-
"props": [
|
|
10
|
-
[
|
|
11
|
-
"variant",
|
|
12
|
-
"\"shimmer\" | \"glow\" | \"border-beam\"",
|
|
13
|
-
"\"shimmer\"",
|
|
14
|
-
"Light sweep, breathing halo or orbiting border beam."
|
|
15
|
-
],
|
|
16
|
-
[
|
|
17
|
-
"size",
|
|
18
|
-
"\"sm\" | \"md\" | \"lg\"",
|
|
19
|
-
"\"md\"",
|
|
20
|
-
"40 / 50 / 58pt tall."
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
"color",
|
|
24
|
-
"string",
|
|
25
|
-
"primary / accent",
|
|
26
|
-
"Button colour (beam colour for border-beam)."
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
"textColor",
|
|
30
|
-
"string",
|
|
31
|
-
"readable on color",
|
|
32
|
-
"Label colour."
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
"speed",
|
|
36
|
-
"number",
|
|
37
|
-
"2600 / 2400 / 3200",
|
|
38
|
-
"Loop length in ms."
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
"pill",
|
|
42
|
-
"boolean",
|
|
43
|
-
"true",
|
|
44
|
-
"Fully rounded ends."
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
"block",
|
|
48
|
-
"boolean",
|
|
49
|
-
"false",
|
|
50
|
-
"Stretches to the parent's width (alignSelf: stretch)."
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
"left / right",
|
|
54
|
-
"ReactNode",
|
|
55
|
-
"—",
|
|
56
|
-
"Icons beside the label."
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
"textStyle",
|
|
60
|
-
"StyleProp<TextStyle>",
|
|
61
|
-
"—",
|
|
62
|
-
"Style for the label text."
|
|
63
|
-
],
|
|
64
|
-
[
|
|
65
|
-
"style",
|
|
66
|
-
"StyleProp<ViewStyle>",
|
|
67
|
-
"—",
|
|
68
|
-
"Style for the outer animated wrapper (margins, alignment)."
|
|
69
|
-
],
|
|
70
|
-
[
|
|
71
|
-
"…PressableProps",
|
|
72
|
-
"",
|
|
73
|
-
"",
|
|
74
|
-
"onPress, disabled, …"
|
|
75
|
-
]
|
|
76
|
-
],
|
|
77
|
-
"examples": []
|
|
78
|
-
}
|