@expokit/cli 0.4.0 → 0.4.2
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 +17 -0
- package/bin/lib.mjs +1 -1
- package/bin/liquidglass.mjs +281 -0
- package/package.json +17 -3
- package/registry/_docs/accordion.json +1 -1
- package/registry/_docs/avatar.json +6 -6
- package/registry/_docs/badge.json +3 -3
- package/registry/_docs/bottom-nav.json +6 -6
- package/registry/_docs/bottom-sheet.json +3 -3
- package/registry/_docs/bullet.json +6 -0
- package/registry/_docs/button-3d.json +2 -2
- package/registry/_docs/button.json +2 -2
- package/registry/_docs/calendar.json +5 -5
- package/registry/_docs/card.json +1 -1
- package/registry/_docs/chip-group.json +1 -1
- package/registry/_docs/confetti.json +3 -3
- package/registry/_docs/date-picker.json +4 -4
- package/registry/_docs/drawer.json +4 -4
- package/registry/_docs/flip-card.json +4 -4
- package/registry/_docs/floating-input.json +1 -1
- package/registry/_docs/grain.json +2 -2
- package/registry/_docs/isometric-bar.json +6 -0
- package/registry/_docs/liquidglass-tab.json +2 -1
- package/registry/_docs/otp-input.json +1 -1
- package/registry/_docs/payment-card.json +3 -3
- package/registry/_docs/pixel-bar.json +6 -0
- package/registry/_docs/polar-area.json +6 -0
- package/registry/_docs/progress-steps.json +4 -4
- package/registry/_docs/progress.json +2 -2
- package/registry/_docs/radio-group.json +1 -1
- package/registry/_docs/search-bar.json +3 -3
- package/registry/_docs/segmented-control.json +1 -1
- package/registry/_docs/select.json +6 -6
- package/registry/_docs/skeleton.json +1 -1
- package/registry/_docs/slider.json +6 -6
- package/registry/_docs/spinner.json +2 -2
- package/registry/_docs/stateful-button.json +1 -1
- package/registry/_docs/stepper.json +3 -3
- package/registry/_docs/tabs.json +2 -2
- package/registry/_docs/text-animation.json +4 -4
- package/registry/_docs/textarea.json +1 -1
- package/registry/_docs/tilt-card.json +3 -3
- package/registry/_docs/time-picker.json +6 -6
- package/registry/_docs/timeline-chart.json +6 -0
- package/registry/_docs/timeline.json +4 -4
- package/registry/_docs/treemap.json +6 -0
- package/registry/_docs/waterfall.json +6 -0
- package/registry/accordion/files/src/components/ui/accordion.tsx +31 -3
- package/registry/action-sheet/files/src/components/ui/action-sheet.tsx +4 -1
- package/registry/alert/files/src/components/ui/alert.tsx +5 -2
- package/registry/alert/files/src/components/ui/button.tsx +32 -4
- package/registry/badge/files/src/components/ui/badge.tsx +2 -2
- package/registry/bottom-nav/files/src/components/ui/bottom-nav.tsx +11 -5
- package/registry/button/files/src/components/ui/button.tsx +32 -4
- package/registry/button-3d/files/src/components/ui/button-3d.tsx +33 -6
- package/registry/calendar/files/src/components/ui/calendar.tsx +62 -17
- package/registry/card/files/src/components/ui/card.tsx +25 -5
- package/registry/checkbox/files/src/components/ui/checkbox.tsx +26 -4
- package/registry/chip-group/files/src/components/ui/chip-group.tsx +35 -5
- package/registry/coupon/files/src/components/ui/coupon.tsx +45 -21
- package/registry/coupon/files/src/components/ui/flip-card.tsx +22 -3
- package/registry/coupon/files/src/components/ui/tilt-card.tsx +57 -16
- package/registry/date-picker/files/src/components/ui/calendar.tsx +62 -17
- package/registry/date-picker/files/src/components/ui/date-picker.tsx +96 -42
- package/registry/dialog/files/src/components/ui/dialog.tsx +9 -5
- package/registry/drawer/files/src/components/ui/drawer.tsx +8 -4
- package/registry/flip-card/files/src/components/ui/flip-card.tsx +22 -3
- package/registry/floating-input/files/src/components/ui/floating-input.tsx +75 -26
- package/registry/liquidglass-tab/files/src/app/(tabs)/_layout.tsx +3 -94
- package/registry/liquidglass-tab/files/src/app/(tabs)/alerts.tsx +2 -1
- package/registry/liquidglass-tab/files/src/app/_layout.tsx +2 -2
- package/registry/liquidglass-tab/files/src/components/GlassTabBar.tsx +2 -1
- package/registry/liquidglass-tab/files/src/components/LiquidGlassTabs.tsx +110 -0
- package/registry/liquidglass-tab/files/src/components/TabScreen.tsx +31 -6
- package/registry/liquidglass-tab/files/src/lib/tab-bar.ts +12 -4
- package/registry/liquidglass-tab/files/src/lib/tab-icons.ts +6 -3
- package/registry/liquidglass-tab/files/src/lib/tabs.ts +4 -2
- package/registry/list-item/files/src/components/ui/list-item.tsx +10 -3
- package/registry/otp-input/files/src/components/ui/otp-input.tsx +50 -19
- package/registry/password-input/files/src/components/ui/floating-input.tsx +75 -26
- package/registry/password-input/files/src/components/ui/password-input.tsx +53 -19
- package/registry/payment-card/files/src/components/ui/flip-card.tsx +22 -3
- package/registry/payment-card/files/src/components/ui/payment-card.tsx +19 -15
- package/registry/payment-card/files/src/components/ui/tilt-card.tsx +57 -16
- package/registry/progress/files/src/components/ui/progress.tsx +9 -2
- package/registry/progress-steps/files/src/components/ui/progress-steps.tsx +11 -4
- package/registry/radio-group/files/src/components/ui/radio-group.tsx +39 -9
- package/registry/search-bar/files/src/components/ui/search-bar.tsx +70 -17
- package/registry/segmented-control/files/src/components/ui/segmented-control.tsx +37 -9
- package/registry/select/files/src/components/ui/select.tsx +158 -83
- package/registry/slider/files/src/components/ui/slider.tsx +53 -25
- package/registry/stateful-button/files/src/components/ui/stateful-button.tsx +12 -4
- package/registry/stepper/files/src/components/ui/stepper.tsx +76 -26
- package/registry/switch/files/src/components/ui/switch.tsx +56 -19
- package/registry/tabs/files/src/components/ui/tabs.tsx +7 -4
- package/registry/text-animation/files/src/components/ui/text-animation.tsx +7 -2
- package/registry/textarea/files/src/components/ui/textarea.tsx +104 -36
- package/registry/tilt-card/files/src/components/ui/tilt-card.tsx +57 -16
- package/registry/time-picker/files/src/components/ui/time-picker.tsx +154 -73
- package/registry/timeline/files/src/components/ui/timeline.tsx +9 -4
- package/registry/toast/files/src/components/ui/button.tsx +32 -4
- package/registry/toast/files/src/components/ui/toast.tsx +15 -6
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Haptics from 'expo-haptics';
|
|
2
|
-
import React, { useId, useRef } from 'react';
|
|
2
|
+
import React, { useEffect, useId, useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
+
AccessibilityInfo,
|
|
4
5
|
ActivityIndicator,
|
|
5
6
|
Animated,
|
|
6
7
|
Pressable,
|
|
@@ -55,6 +56,10 @@ export interface ButtonProps extends Omit<PressableProps, 'style' | 'children'>
|
|
|
55
56
|
textStyle?: StyleProp<TextStyle>;
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
// Controls stop growing at iOS's largest standard text size (xxxL ≈ 1.35×) so they keep their shape;
|
|
60
|
+
// content text scales all the way.
|
|
61
|
+
const FONT_CAP = 1.35;
|
|
62
|
+
|
|
58
63
|
const SIZES: Record<ButtonSize, { h: number; px: number; font: number; gap: number }> = {
|
|
59
64
|
sm: { h: 36, px: 14, font: 14, gap: 6 },
|
|
60
65
|
md: { h: 46, px: 18, font: 15.5, gap: 8 },
|
|
@@ -119,6 +124,7 @@ export function Button({
|
|
|
119
124
|
const { colors, radius, dark, font } = useKit();
|
|
120
125
|
const ff = font.family ? { fontFamily: font.family } : null;
|
|
121
126
|
const gid = 'btn' + useId().replace(/[^a-zA-Z0-9]/g, '');
|
|
127
|
+
const reduce = useReduceMotion();
|
|
122
128
|
const scale = useRef(new Animated.Value(1)).current;
|
|
123
129
|
const isDisabled = disabled || loading;
|
|
124
130
|
const tint = color ?? colors.accent;
|
|
@@ -145,11 +151,16 @@ export function Button({
|
|
|
145
151
|
const solid = bg !== 'transparent';
|
|
146
152
|
const quiet = variant === 'ghost' || variant === 'outline' || variant === 'link';
|
|
147
153
|
|
|
148
|
-
|
|
154
|
+
// Reduce Motion: no squish; the pressed wash / opacity still marks the press.
|
|
155
|
+
const spring = (to: number) => {
|
|
156
|
+
if (reduce) return scale.setValue(1);
|
|
157
|
+
Animated.spring(scale, { toValue: to, useNativeDriver: true, ...motion.bouncy }).start();
|
|
158
|
+
};
|
|
149
159
|
|
|
150
160
|
const label = isTextNode(children) ? (
|
|
151
161
|
<Text
|
|
152
162
|
numberOfLines={1}
|
|
163
|
+
maxFontSizeMultiplier={FONT_CAP}
|
|
153
164
|
style={[styles.label, ff, { color: fg, fontSize: s.font }, variant === 'link' && styles.link, textStyle]}
|
|
154
165
|
>
|
|
155
166
|
{children}
|
|
@@ -185,7 +196,8 @@ export function Button({
|
|
|
185
196
|
style={({ pressed }) => [
|
|
186
197
|
styles.base,
|
|
187
198
|
{
|
|
188
|
-
|
|
199
|
+
minHeight: s.h,
|
|
200
|
+
height: size === 'icon' ? s.h : undefined,
|
|
189
201
|
width: size === 'icon' ? s.h : undefined,
|
|
190
202
|
paddingHorizontal: variant === 'link' ? 0 : s.px,
|
|
191
203
|
gap: s.gap,
|
|
@@ -236,7 +248,7 @@ export function Button({
|
|
|
236
248
|
<View style={styles.row}>
|
|
237
249
|
<ActivityIndicator size="small" color={fg} />
|
|
238
250
|
{size !== 'icon' && isTextNode(children) ? (
|
|
239
|
-
<Text style={[styles.label, ff, { color: fg, fontSize: s.font, opacity: 0.85 }]}>{children}</Text>
|
|
251
|
+
<Text maxFontSizeMultiplier={FONT_CAP} style={[styles.label, ff, { color: fg, fontSize: s.font, opacity: 0.85 }]}>{children}</Text>
|
|
240
252
|
) : null}
|
|
241
253
|
</View>
|
|
242
254
|
) : (
|
|
@@ -253,6 +265,22 @@ export function Button({
|
|
|
253
265
|
);
|
|
254
266
|
}
|
|
255
267
|
|
|
268
|
+
function useReduceMotion() {
|
|
269
|
+
const [reduce, setReduce] = useState(false);
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
let alive = true;
|
|
272
|
+
AccessibilityInfo.isReduceMotionEnabled()
|
|
273
|
+
.then((r) => alive && setReduce(r))
|
|
274
|
+
.catch(() => {});
|
|
275
|
+
const sub = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduce);
|
|
276
|
+
return () => {
|
|
277
|
+
alive = false;
|
|
278
|
+
sub.remove();
|
|
279
|
+
};
|
|
280
|
+
}, []);
|
|
281
|
+
return reduce;
|
|
282
|
+
}
|
|
283
|
+
|
|
256
284
|
const styles = StyleSheet.create({
|
|
257
285
|
base: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center' },
|
|
258
286
|
row: { flexDirection: 'row', alignItems: 'center', gap: 8 },
|
|
@@ -271,6 +271,9 @@ export interface ToasterProps {
|
|
|
271
271
|
|
|
272
272
|
const PEEK = 12;
|
|
273
273
|
const GUESS_HEIGHT = 64;
|
|
274
|
+
// Controls stop growing at iOS's largest standard text size (xxxL ≈ 1.35×) so they keep their shape;
|
|
275
|
+
// content text scales all the way.
|
|
276
|
+
const FONT_CAP = 1.35;
|
|
274
277
|
|
|
275
278
|
/**
|
|
276
279
|
* Hosts the toasts. It fills its parent absolutely (touches pass through), so drop it at the
|
|
@@ -595,7 +598,9 @@ function ToastItem({
|
|
|
595
598
|
{ borderRadius: radius.capsule(32), backgroundColor: look.actionBg, opacity: pressed ? 0.7 : 1 },
|
|
596
599
|
]}
|
|
597
600
|
>
|
|
598
|
-
<Text style={[styles.actionText, ff, { color: look.actionFg }]}>
|
|
601
|
+
<Text maxFontSizeMultiplier={FONT_CAP} style={[styles.actionText, ff, { color: look.actionFg }]}>
|
|
602
|
+
{data.action.label}
|
|
603
|
+
</Text>
|
|
599
604
|
</Pressable>
|
|
600
605
|
) : null}
|
|
601
606
|
{closeButton ? (
|
|
@@ -906,7 +911,9 @@ function IslandToaster({ store, toasts, duration, offset, haptics, reduceMotion,
|
|
|
906
911
|
</View>
|
|
907
912
|
{!expanded && shown.action ? (
|
|
908
913
|
<View style={[styles.islandChip, { borderRadius: radius.capsule(24), backgroundColor: alpha(fg, 0.14) }]}>
|
|
909
|
-
<Text style={[styles.islandChipText, ff, { color: fg }]}>
|
|
914
|
+
<Text maxFontSizeMultiplier={FONT_CAP} style={[styles.islandChipText, ff, { color: fg }]}>
|
|
915
|
+
{shown.action.label}
|
|
916
|
+
</Text>
|
|
910
917
|
</View>
|
|
911
918
|
) : null}
|
|
912
919
|
</Pressable>
|
|
@@ -923,7 +930,9 @@ function IslandToaster({ store, toasts, duration, offset, haptics, reduceMotion,
|
|
|
923
930
|
{ borderRadius: radius.capsule(44), backgroundColor: alpha(fg, pressed ? 0.24 : 0.16) },
|
|
924
931
|
]}
|
|
925
932
|
>
|
|
926
|
-
<Text style={[styles.title, ff, { color: fg }]}>
|
|
933
|
+
<Text maxFontSizeMultiplier={FONT_CAP} style={[styles.title, ff, { color: fg }]}>
|
|
934
|
+
{shown.action.label}
|
|
935
|
+
</Text>
|
|
927
936
|
</Pressable>
|
|
928
937
|
</View>
|
|
929
938
|
) : null}
|
|
@@ -1267,7 +1276,7 @@ const styles = StyleSheet.create({
|
|
|
1267
1276
|
title: { fontSize: 14.5, fontWeight: '400', lineHeight: 20, letterSpacing: -0.1 },
|
|
1268
1277
|
desc: { fontSize: 13.5, fontWeight: '400', lineHeight: 19 },
|
|
1269
1278
|
descMinimal: { fontSize: 13, lineHeight: 17 },
|
|
1270
|
-
action: { paddingHorizontal: 12,
|
|
1279
|
+
action: { paddingHorizontal: 12, minHeight: 32, alignItems: 'center', justifyContent: 'center' },
|
|
1271
1280
|
actionText: { fontSize: 13, fontWeight: '400' },
|
|
1272
1281
|
close: { alignSelf: 'flex-start', padding: 2, marginRight: -4 },
|
|
1273
1282
|
bar: { position: 'absolute', left: 0, right: 0, bottom: 0, height: 2, transformOrigin: 'left' },
|
|
@@ -1277,10 +1286,10 @@ const styles = StyleSheet.create({
|
|
|
1277
1286
|
islandPlace: { position: 'absolute', top: 0 },
|
|
1278
1287
|
islandPad: { paddingVertical: 14, paddingHorizontal: 20 },
|
|
1279
1288
|
islandPadIcon: { paddingTop: 13, paddingBottom: 15, paddingLeft: 14, paddingRight: 18 },
|
|
1280
|
-
islandChip: { paddingHorizontal: 10,
|
|
1289
|
+
islandChip: { paddingHorizontal: 10, minHeight: 24, justifyContent: 'center' },
|
|
1281
1290
|
islandChipText: { fontSize: 12.5, fontWeight: '400' },
|
|
1282
1291
|
islandActions: { paddingHorizontal: 14, paddingBottom: 16, marginTop: -2 },
|
|
1283
|
-
islandAction: {
|
|
1292
|
+
islandAction: { minHeight: 44, alignItems: 'center', justifyContent: 'center' },
|
|
1284
1293
|
islandTrack: { position: 'absolute', left: 28, right: 28, bottom: 6, height: 2, borderRadius: 1, overflow: 'hidden' },
|
|
1285
1294
|
islandFill: { flex: 1, transformOrigin: 'left' },
|
|
1286
1295
|
});
|