@thewhileloop/whileui 2.0.0 → 4.0.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 +135 -70
- package/dist/blocks/commerce/metric-card.d.ts +9 -29
- package/dist/blocks/datepicker/date-range-picker-modal.d.ts +1 -1
- package/dist/blocks/datepicker/date-range-picker-modal.js +6 -14
- package/dist/blocks/datepicker/datepicker-modal.d.ts +1 -1
- package/dist/blocks/datepicker/datepicker-modal.js +6 -12
- package/dist/blocks/datepicker/index.d.ts +1 -0
- package/dist/blocks/datepicker/index.js +1 -0
- package/dist/blocks/datepicker/time-picker-modal.d.ts +43 -0
- package/dist/blocks/datepicker/time-picker-modal.js +187 -0
- package/dist/blocks/layout/smart-input.d.ts +3 -2
- package/dist/blocks/layout/smart-input.js +33 -18
- package/dist/blocks/media/smart-image.d.ts +39 -98
- package/dist/blocks/navigation/drawer-menu.js +88 -72
- package/dist/components/alert/alert.d.ts +23 -55
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +1 -4
- package/dist/components/avatar/avatar.d.ts +18 -45
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/badge/badge.d.ts +84 -212
- package/dist/components/button/button.d.ts +69 -188
- package/dist/components/card/card.d.ts +29 -73
- package/dist/components/card/card.js +1 -1
- package/dist/components/container/container.d.ts +24 -96
- package/dist/components/data-row/data-row.d.ts +18 -38
- package/dist/components/data-row/data-row.js +1 -1
- package/dist/components/fab/fab.d.ts +87 -0
- package/dist/components/fab/fab.js +59 -0
- package/dist/components/fab/index.d.ts +1 -0
- package/dist/components/fab/index.js +1 -0
- package/dist/components/form-field/form-field.d.ts +31 -87
- package/dist/components/form-field/form-field.js +1 -1
- package/dist/components/hover-card/hover-card.d.ts +3 -2
- package/dist/components/input/input.d.ts +18 -31
- package/dist/components/input/input.js +20 -8
- package/dist/components/label/label.d.ts +3 -3
- package/dist/components/labeled-field/labeled-field.d.ts +3 -2
- package/dist/components/numeric-input/numeric-input.d.ts +27 -82
- package/dist/components/numeric-input/numeric-input.js +79 -80
- package/dist/components/otp-input/otp-input.d.ts +21 -65
- package/dist/components/popover/popover.d.ts +4 -3
- package/dist/components/pressable/pressable.d.ts +3 -3
- package/dist/components/progress/progress.d.ts +15 -39
- package/dist/components/row/row.d.ts +63 -163
- package/dist/components/segmented-control/segmented-control.d.ts +69 -241
- package/dist/components/select/select.d.ts +10 -22
- package/dist/components/select/select.js +2 -7
- package/dist/components/separator/separator.d.ts +3 -3
- package/dist/components/skeleton/skeleton.d.ts +9 -29
- package/dist/components/spinner/spinner.d.ts +12 -36
- package/dist/components/stack/stack.d.ts +63 -163
- package/dist/components/tabs/tabs.d.ts +9 -29
- package/dist/components/text/text.d.ts +51 -131
- package/dist/components/textarea/textarea.d.ts +15 -39
- package/dist/components/textarea/textarea.js +3 -3
- package/dist/components/toast/toast.d.ts +12 -36
- package/dist/components/toggle/toggle.d.ts +42 -138
- package/dist/components/toggle-group/toggle-group.d.ts +42 -138
- package/dist/components/tooltip/tooltip.d.ts +3 -2
- package/dist/components/view/view.d.ts +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/lib/focus-ring.d.ts +10 -0
- package/dist/lib/focus-ring.js +10 -0
- package/dist/lib/interaction-tokens.d.ts +24 -1
- package/dist/lib/interaction-tokens.js +26 -44
- package/dist/lib/motion-policy.js +2 -2
- package/dist/lib/ref-types.d.ts +3 -0
- package/dist/lib/ref-types.js +1 -0
- package/dist/lib/theme-bridge.d.ts +4 -2
- package/dist/lib/theme-bridge.js +13 -9
- package/dist/lib/theme-presets.d.ts +26 -0
- package/dist/lib/theme-presets.js +28 -0
- package/package.json +29 -28
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
3
|
-
import { Platform, Pressable, Text, TextInput, View } from 'react-native';
|
|
3
|
+
import { Platform, Pressable, Text, TextInput, View, } from 'react-native';
|
|
4
4
|
import { cn } from '../../lib/cn';
|
|
5
|
-
import {
|
|
5
|
+
import { focusFieldWrapper } from '../../lib/focus-ring';
|
|
6
6
|
import { tv } from '../../lib/tv';
|
|
7
7
|
import { useThemeColors } from '../../lib/theme-colors';
|
|
8
8
|
import { useInteractionTokens, withInteractivePressableStyle } from '../../lib/interaction-tokens';
|
|
@@ -66,76 +66,97 @@ function roundToStepPrecision(value, step) {
|
|
|
66
66
|
const decimals = step >= 1 ? 0 : (step.toString().split('.')[1]?.length ?? 2);
|
|
67
67
|
return Number(value.toFixed(decimals));
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
const colors = useThemeColors();
|
|
71
|
-
const interaction = useInteractionTokens();
|
|
72
|
-
const visual = useVisualTokens();
|
|
69
|
+
function useNumericInputModel({ value, defaultValue, min, max, step, editable, onValueChange, onBlur, }) {
|
|
73
70
|
const [internalText, setInternalText] = useState(() => toInputText(defaultValue));
|
|
74
71
|
const isControlled = value !== undefined;
|
|
75
72
|
const textValue = isControlled ? toInputText(value) : internalText;
|
|
76
73
|
const currentValue = useMemo(() => parseNumericText(textValue), [textValue]);
|
|
77
|
-
const setTextAndValue = useCallback((nextText) => {
|
|
78
|
-
if (!isControlled) {
|
|
79
|
-
setInternalText(nextText);
|
|
80
|
-
}
|
|
81
|
-
onValueChange?.(parseNumericText(nextText));
|
|
82
|
-
}, [isControlled, onValueChange]);
|
|
83
74
|
const applyNumericValue = useCallback((nextValue) => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
setInternalText('');
|
|
87
|
-
}
|
|
88
|
-
onValueChange?.(null);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const clamped = clampValue(nextValue, min, max);
|
|
92
|
-
if (!isControlled) {
|
|
75
|
+
const clamped = nextValue === null ? null : clampValue(nextValue, min, max);
|
|
76
|
+
if (!isControlled)
|
|
93
77
|
setInternalText(toInputText(clamped));
|
|
94
|
-
}
|
|
95
78
|
onValueChange?.(clamped);
|
|
96
79
|
}, [isControlled, max, min, onValueChange]);
|
|
97
|
-
const handleTextChange = (nextText) => {
|
|
98
|
-
|
|
99
|
-
if (!isNumericLike) {
|
|
80
|
+
const handleTextChange = useCallback((nextText) => {
|
|
81
|
+
if (!/^-?\d*(?:[.,]\d*)?$/.test(nextText))
|
|
100
82
|
return;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
83
|
+
if (!isControlled)
|
|
84
|
+
setInternalText(nextText);
|
|
85
|
+
onValueChange?.(parseNumericText(nextText));
|
|
86
|
+
}, [isControlled, onValueChange]);
|
|
87
|
+
const handleBlur = useCallback((event) => {
|
|
105
88
|
const parsed = parseNumericText(textValue);
|
|
106
|
-
if (parsed !== null)
|
|
107
|
-
|
|
108
|
-
const clamped = clampValue(rounded, min, max);
|
|
109
|
-
if (!isControlled) {
|
|
110
|
-
setInternalText(toInputText(clamped));
|
|
111
|
-
}
|
|
112
|
-
onValueChange?.(clamped);
|
|
113
|
-
}
|
|
89
|
+
if (parsed !== null)
|
|
90
|
+
applyNumericValue(roundToStepPrecision(parsed, step));
|
|
114
91
|
onBlur?.(event);
|
|
92
|
+
}, [applyNumericValue, onBlur, step, textValue]);
|
|
93
|
+
const nudge = useCallback((delta) => {
|
|
94
|
+
const baseline = currentValue ?? min ?? 0;
|
|
95
|
+
applyNumericValue(roundToStepPrecision(baseline + delta * step, step));
|
|
96
|
+
}, [applyNumericValue, currentValue, min, step]);
|
|
97
|
+
return {
|
|
98
|
+
textValue,
|
|
99
|
+
handleTextChange,
|
|
100
|
+
handleBlur,
|
|
101
|
+
nudge,
|
|
102
|
+
canDecrease: editable && (min === undefined || currentValue === null || currentValue > min),
|
|
103
|
+
canIncrease: editable && (max === undefined || currentValue === null || currentValue < max),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function numericInputTextStyle(visual, size, unstyled, style) {
|
|
107
|
+
const base = {
|
|
108
|
+
...typographyStyle(visual, size === 'compact' ? 'caption' : 'label'),
|
|
109
|
+
paddingVertical: size === 'compact' ? visual.controlPaddingYSm : visual.controlPaddingYDefault,
|
|
110
|
+
paddingHorizontal: unstyled ? 0 : visual.controlPaddingXDefault,
|
|
115
111
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
return Platform.OS === 'web'
|
|
113
|
+
? [{ ...base, width: '100%', minWidth: 0 }, style]
|
|
114
|
+
: [base, style];
|
|
115
|
+
}
|
|
116
|
+
function NumericAffix({ side, visual, children, }) {
|
|
117
|
+
if (!children)
|
|
118
|
+
return null;
|
|
119
|
+
const spacing = Math.max(8, Math.round(visual.controlPaddingXDefault * 0.5));
|
|
120
|
+
return (_jsx(View, { style: side === 'prefix' ? { paddingRight: spacing } : { paddingLeft: spacing }, children: children }));
|
|
121
|
+
}
|
|
122
|
+
function NumericStepperButton({ delta, enabled, label, symbol, size, radius, model, interaction, visual, }) {
|
|
123
|
+
const feedbackStyle = withInteractivePressableStyle(undefined, interaction, {
|
|
124
|
+
disabled: !enabled,
|
|
120
125
|
disabledVariant: 'subtle',
|
|
121
126
|
pressedVariant: 'default',
|
|
122
127
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
return (_jsx(Pressable, { className: "shrink-0 items-center justify-center bg-secondary", style: (state) => {
|
|
129
|
+
const baseStyle = typeof feedbackStyle === 'function' ? feedbackStyle(state) : feedbackStyle;
|
|
130
|
+
return [baseStyle, { width: size, height: size, borderRadius: radius }];
|
|
131
|
+
}, onPress: () => model.nudge(delta), disabled: !enabled, hitSlop: 4, accessibilityRole: "button", accessibilityLabel: label, children: _jsx(Text, { className: "font-medium text-foreground", style: typographyStyle(visual, 'body'), children: symbol }) }));
|
|
132
|
+
}
|
|
133
|
+
function NumericSteppers({ visible, inset, size, radius, model, interaction, visual, }) {
|
|
134
|
+
if (!visible)
|
|
135
|
+
return null;
|
|
136
|
+
return (_jsxs(View, { className: "shrink-0 flex-row items-center", style: { gap: inset, paddingLeft: Math.max(6, inset) }, children: [_jsx(NumericStepperButton, { delta: -1, enabled: model.canDecrease, label: "Decrease value", symbol: "\u2212", size: size, radius: radius, model: model, interaction: interaction, visual: visual }), _jsx(NumericStepperButton, { delta: 1, enabled: model.canIncrease, label: "Increase value", symbol: "+", size: size, radius: radius, model: model, interaction: interaction, visual: visual })] }));
|
|
137
|
+
}
|
|
138
|
+
const NumericInput = React.forwardRef(({ className, inputClassName, prefix, suffix, value, defaultValue, onValueChange, min, max, step = 1, showSteppers = false, unstyled = false, variant = 'default', size = 'default', editable = true, placeholderTextColor, onFocus, onBlur, style: styleProp, ...props }, ref) => {
|
|
139
|
+
const colors = useThemeColors();
|
|
140
|
+
const interaction = useInteractionTokens();
|
|
141
|
+
const visual = useVisualTokens();
|
|
142
|
+
// The border is on the wrapper and the focus on the field inside it.
|
|
143
|
+
const [focused, setFocused] = useState(false);
|
|
144
|
+
const model = useNumericInputModel({
|
|
145
|
+
value,
|
|
146
|
+
defaultValue,
|
|
147
|
+
min,
|
|
148
|
+
max,
|
|
149
|
+
step,
|
|
150
|
+
editable,
|
|
151
|
+
onValueChange,
|
|
152
|
+
onBlur,
|
|
127
153
|
});
|
|
128
|
-
const nudge = (delta) => {
|
|
129
|
-
const baseline = currentValue ?? min ?? 0;
|
|
130
|
-
const raw = baseline + delta * step;
|
|
131
|
-
applyNumericValue(roundToStepPrecision(raw, step));
|
|
132
|
-
};
|
|
133
154
|
const controlHeight = size === 'compact' ? visual.controlHeightSm : visual.controlHeightDefault;
|
|
134
155
|
// Steppers render as inset soft buttons, centered inside the field shell.
|
|
135
156
|
const stepInset = Math.max(3, Math.round(controlHeight * 0.1));
|
|
136
157
|
const stepSize = controlHeight - stepInset * 2;
|
|
137
158
|
const stepRadius = Math.max(3, Math.min(visual.radiusMd, Math.round(stepSize / 3)));
|
|
138
|
-
return (_jsxs(View, { className: cn(numericInputVariants({ variant, size }), unstyled && 'bg-transparent', className), style: [
|
|
159
|
+
return (_jsxs(View, { className: cn(numericInputVariants({ variant, size }), unstyled && 'bg-transparent', focused && !unstyled && focusFieldWrapper, className), style: [
|
|
139
160
|
{
|
|
140
161
|
// Definite height (not minHeight) so inner elements can center reliably.
|
|
141
162
|
height: controlHeight,
|
|
@@ -145,35 +166,13 @@ const NumericInput = React.forwardRef(({ className, inputClassName, prefix, suff
|
|
|
145
166
|
paddingRight: unstyled ? 0 : showSteppers ? stepInset : 0,
|
|
146
167
|
},
|
|
147
168
|
!editable ? { opacity: interaction.disabledOpacity } : undefined,
|
|
148
|
-
], children: [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
? visual.controlPaddingYSm
|
|
156
|
-
: visual.controlPaddingYDefault,
|
|
157
|
-
paddingHorizontal: unstyled ? 0 : visual.controlPaddingXDefault,
|
|
158
|
-
},
|
|
159
|
-
styleProp,
|
|
160
|
-
]
|
|
161
|
-
: [
|
|
162
|
-
{
|
|
163
|
-
...typographyStyle(visual, size === 'compact' ? 'caption' : 'label'),
|
|
164
|
-
paddingVertical: size === 'compact'
|
|
165
|
-
? visual.controlPaddingYSm
|
|
166
|
-
: visual.controlPaddingYDefault,
|
|
167
|
-
paddingHorizontal: unstyled ? 0 : visual.controlPaddingXDefault,
|
|
168
|
-
},
|
|
169
|
-
styleProp,
|
|
170
|
-
], value: textValue, onChangeText: handleTextChange, onBlur: handleBlur, keyboardType: "decimal-pad", editable: editable, placeholderTextColor: placeholderTextColor ?? colors.placeholder, ...props }) }), suffix ? (_jsx(View, { style: { paddingLeft: Math.max(8, Math.round(visual.controlPaddingXDefault * 0.5)) }, children: suffix })) : null, showSteppers ? (_jsxs(View, { className: "shrink-0 flex-row items-center", style: { gap: stepInset, paddingLeft: Math.max(6, stepInset) }, children: [_jsx(Pressable, { className: "shrink-0 items-center justify-center bg-secondary", style: (state) => {
|
|
171
|
-
const baseStyle = typeof stepDownStyle === 'function' ? stepDownStyle(state) : stepDownStyle;
|
|
172
|
-
return [baseStyle, { width: stepSize, height: stepSize, borderRadius: stepRadius }];
|
|
173
|
-
}, onPress: () => nudge(-1), disabled: !canDecrease, hitSlop: 4, accessibilityRole: "button", accessibilityLabel: "Decrease value", children: _jsx(Text, { className: "font-medium text-foreground", style: typographyStyle(visual, 'body'), children: "\u2212" }) }), _jsx(Pressable, { className: "shrink-0 items-center justify-center bg-secondary", style: (state) => {
|
|
174
|
-
const baseStyle = typeof stepUpStyle === 'function' ? stepUpStyle(state) : stepUpStyle;
|
|
175
|
-
return [baseStyle, { width: stepSize, height: stepSize, borderRadius: stepRadius }];
|
|
176
|
-
}, onPress: () => nudge(1), disabled: !canIncrease, hitSlop: 4, accessibilityRole: "button", accessibilityLabel: "Increase value", children: _jsx(Text, { className: "font-medium text-foreground", style: typographyStyle(visual, 'body'), children: "+" }) })] })) : null] }));
|
|
169
|
+
], children: [_jsx(NumericAffix, { side: "prefix", visual: visual, children: prefix }), _jsx(View, { className: "min-w-0 flex-1", style: Platform.OS === 'web' ? { minWidth: 0, flex: 1 } : undefined, children: _jsx(TextInput, { ref: ref, className: cn(numericInputTextVariants({ size }), 'w-full web:outline-none', inputClassName), style: numericInputTextStyle(visual, size, unstyled, styleProp), value: model.textValue, onChangeText: model.handleTextChange, onFocus: (event) => {
|
|
170
|
+
setFocused(true);
|
|
171
|
+
onFocus?.(event);
|
|
172
|
+
}, onBlur: (event) => {
|
|
173
|
+
setFocused(false);
|
|
174
|
+
model.handleBlur(event);
|
|
175
|
+
}, keyboardType: "decimal-pad", editable: editable, placeholderTextColor: placeholderTextColor ?? colors.placeholder, ...props }) }), _jsx(NumericAffix, { side: "suffix", visual: visual, children: suffix }), _jsx(NumericSteppers, { visible: showSteppers, inset: stepInset, size: stepSize, radius: stepRadius, model: model, interaction: interaction, visual: visual })] }));
|
|
177
176
|
});
|
|
178
177
|
NumericInput.displayName = 'NumericInput';
|
|
179
178
|
export { NumericInput, numericInputVariants, numericInputTextVariants };
|
|
@@ -1,82 +1,38 @@
|
|
|
1
1
|
import { type ViewProps } from 'react-native';
|
|
2
2
|
declare const otpCellVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
size: {
|
|
4
|
-
default:
|
|
5
|
-
compact:
|
|
4
|
+
default: "w-11";
|
|
5
|
+
compact: "w-9";
|
|
6
6
|
};
|
|
7
7
|
state: {
|
|
8
|
-
idle:
|
|
9
|
-
focused:
|
|
10
|
-
error:
|
|
11
|
-
errorFocused:
|
|
8
|
+
idle: "border-border";
|
|
9
|
+
focused: "border-primary";
|
|
10
|
+
error: "border-destructive";
|
|
11
|
+
errorFocused: "border-destructive";
|
|
12
12
|
};
|
|
13
|
-
}, undefined, "items-center justify-center border bg-muted",
|
|
13
|
+
}, undefined, "items-center justify-center border bg-muted", {
|
|
14
14
|
size: {
|
|
15
|
-
default:
|
|
16
|
-
compact:
|
|
15
|
+
default: "w-11";
|
|
16
|
+
compact: "w-9";
|
|
17
17
|
};
|
|
18
18
|
state: {
|
|
19
|
-
idle:
|
|
20
|
-
focused:
|
|
21
|
-
error:
|
|
22
|
-
errorFocused:
|
|
19
|
+
idle: "border-border";
|
|
20
|
+
focused: "border-primary";
|
|
21
|
+
error: "border-destructive";
|
|
22
|
+
errorFocused: "border-destructive";
|
|
23
23
|
};
|
|
24
|
-
}, {
|
|
24
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
25
25
|
size: {
|
|
26
|
-
default:
|
|
27
|
-
compact:
|
|
26
|
+
default: "w-11";
|
|
27
|
+
compact: "w-9";
|
|
28
28
|
};
|
|
29
29
|
state: {
|
|
30
|
-
idle:
|
|
31
|
-
focused:
|
|
32
|
-
error:
|
|
33
|
-
errorFocused:
|
|
30
|
+
idle: "border-border";
|
|
31
|
+
focused: "border-primary";
|
|
32
|
+
error: "border-destructive";
|
|
33
|
+
errorFocused: "border-destructive";
|
|
34
34
|
};
|
|
35
|
-
}
|
|
36
|
-
size: {
|
|
37
|
-
default: string;
|
|
38
|
-
compact: string;
|
|
39
|
-
};
|
|
40
|
-
state: {
|
|
41
|
-
idle: string;
|
|
42
|
-
focused: string;
|
|
43
|
-
error: string;
|
|
44
|
-
errorFocused: string;
|
|
45
|
-
};
|
|
46
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
47
|
-
size: {
|
|
48
|
-
default: string;
|
|
49
|
-
compact: string;
|
|
50
|
-
};
|
|
51
|
-
state: {
|
|
52
|
-
idle: string;
|
|
53
|
-
focused: string;
|
|
54
|
-
error: string;
|
|
55
|
-
errorFocused: string;
|
|
56
|
-
};
|
|
57
|
-
}, undefined, "items-center justify-center border bg-muted", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
58
|
-
size: {
|
|
59
|
-
default: string;
|
|
60
|
-
compact: string;
|
|
61
|
-
};
|
|
62
|
-
state: {
|
|
63
|
-
idle: string;
|
|
64
|
-
focused: string;
|
|
65
|
-
error: string;
|
|
66
|
-
errorFocused: string;
|
|
67
|
-
};
|
|
68
|
-
}, {
|
|
69
|
-
size: {
|
|
70
|
-
default: string;
|
|
71
|
-
compact: string;
|
|
72
|
-
};
|
|
73
|
-
state: {
|
|
74
|
-
idle: string;
|
|
75
|
-
focused: string;
|
|
76
|
-
error: string;
|
|
77
|
-
errorFocused: string;
|
|
78
|
-
};
|
|
79
|
-
}>, unknown, unknown, undefined>>;
|
|
35
|
+
}, undefined>>;
|
|
80
36
|
export interface OTPInputProps extends Omit<ViewProps, 'children'> {
|
|
81
37
|
length?: number;
|
|
82
38
|
value?: string;
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import * as PopoverPrimitive from '@rn-primitives/popover';
|
|
3
3
|
import { type FrostedSurfaceProps } from '../../lib/frosted-surface';
|
|
4
4
|
import { type OverlayInsets } from '../../lib/overlay-insets';
|
|
5
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
5
6
|
export interface PopoverProps {
|
|
6
7
|
onOpenChange?: (open: boolean) => void;
|
|
7
8
|
children: React.ReactNode;
|
|
@@ -19,7 +20,7 @@ export interface PopoverCloseProps extends React.ComponentPropsWithoutRef<typeof
|
|
|
19
20
|
className?: string;
|
|
20
21
|
}
|
|
21
22
|
declare function Popover({ onOpenChange, children }: PopoverProps): React.JSX.Element;
|
|
22
|
-
declare const PopoverTrigger:
|
|
23
|
-
declare const PopoverContent:
|
|
24
|
-
declare const PopoverClose:
|
|
23
|
+
declare const PopoverTrigger: ForwardRefComponent<PopoverPrimitive.TriggerRef, PopoverTriggerProps>;
|
|
24
|
+
declare const PopoverContent: ForwardRefComponent<PopoverPrimitive.ContentRef, PopoverContentProps>;
|
|
25
|
+
declare const PopoverClose: ForwardRefComponent<PopoverPrimitive.CloseRef, PopoverCloseProps>;
|
|
25
26
|
export { Popover, PopoverTrigger, PopoverContent, PopoverClose };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type PressableProps as RNPressableProps } from 'react-native';
|
|
1
|
+
import { type PressableInstance, type PressableProps as RNPressableProps } from 'react-native';
|
|
3
2
|
import { type DisabledVariant, type PressedVariant } from '../../lib/interaction-tokens';
|
|
3
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
4
4
|
export interface PressableProps extends RNPressableProps {
|
|
5
5
|
className?: string;
|
|
6
6
|
/** Semantic press feedback. `none` preserves a plain React Native Pressable. */
|
|
@@ -10,5 +10,5 @@ export interface PressableProps extends RNPressableProps {
|
|
|
10
10
|
/** Loading controls are busy and non-interactive, just like disabled controls. */
|
|
11
11
|
loading?: boolean;
|
|
12
12
|
}
|
|
13
|
-
declare const Pressable:
|
|
13
|
+
declare const Pressable: ForwardRefComponent<PressableInstance, PressableProps>;
|
|
14
14
|
export { Pressable };
|
|
@@ -1,52 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { View, type ViewProps } from 'react-native';
|
|
1
|
+
import { type ViewInstance, type ViewProps } from 'react-native';
|
|
3
2
|
import { type VariantProps } from '../../lib/tv';
|
|
3
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
4
4
|
declare const progressVariants: import("tailwind-variants").TVReturnType<{
|
|
5
5
|
size: {
|
|
6
|
-
sm:
|
|
7
|
-
default:
|
|
8
|
-
lg:
|
|
6
|
+
sm: "h-1.5";
|
|
7
|
+
default: "h-3";
|
|
8
|
+
lg: "h-5";
|
|
9
9
|
};
|
|
10
|
-
}, undefined, "h-3 w-full overflow-hidden rounded-full bg-secondary",
|
|
10
|
+
}, undefined, "h-3 w-full overflow-hidden rounded-full bg-secondary", {
|
|
11
11
|
size: {
|
|
12
|
-
sm:
|
|
13
|
-
default:
|
|
14
|
-
lg:
|
|
12
|
+
sm: "h-1.5";
|
|
13
|
+
default: "h-3";
|
|
14
|
+
lg: "h-5";
|
|
15
15
|
};
|
|
16
|
-
}, {
|
|
16
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
17
17
|
size: {
|
|
18
|
-
sm:
|
|
19
|
-
default:
|
|
20
|
-
lg:
|
|
18
|
+
sm: "h-1.5";
|
|
19
|
+
default: "h-3";
|
|
20
|
+
lg: "h-5";
|
|
21
21
|
};
|
|
22
|
-
}
|
|
23
|
-
size: {
|
|
24
|
-
sm: string;
|
|
25
|
-
default: string;
|
|
26
|
-
lg: string;
|
|
27
|
-
};
|
|
28
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
29
|
-
size: {
|
|
30
|
-
sm: string;
|
|
31
|
-
default: string;
|
|
32
|
-
lg: string;
|
|
33
|
-
};
|
|
34
|
-
}, undefined, "h-3 w-full overflow-hidden rounded-full bg-secondary", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
35
|
-
size: {
|
|
36
|
-
sm: string;
|
|
37
|
-
default: string;
|
|
38
|
-
lg: string;
|
|
39
|
-
};
|
|
40
|
-
}, {
|
|
41
|
-
size: {
|
|
42
|
-
sm: string;
|
|
43
|
-
default: string;
|
|
44
|
-
lg: string;
|
|
45
|
-
};
|
|
46
|
-
}>, unknown, unknown, undefined>>;
|
|
22
|
+
}, undefined>>;
|
|
47
23
|
export interface ProgressProps extends ViewProps, VariantProps<typeof progressVariants> {
|
|
48
24
|
value?: number;
|
|
49
25
|
indicatorClassName?: string;
|
|
50
26
|
}
|
|
51
|
-
declare const Progress:
|
|
27
|
+
declare const Progress: ForwardRefComponent<ViewInstance, ProgressProps>;
|
|
52
28
|
export { Progress, progressVariants };
|
|
@@ -1,184 +1,84 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { View, type ViewProps } from 'react-native';
|
|
1
|
+
import { type ViewInstance, type ViewProps } from 'react-native';
|
|
3
2
|
import { type VariantProps } from '../../lib/tv';
|
|
3
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
4
4
|
declare const rowVariants: import("tailwind-variants").TVReturnType<{
|
|
5
5
|
gap: {
|
|
6
|
-
none:
|
|
7
|
-
xs:
|
|
8
|
-
sm:
|
|
9
|
-
md:
|
|
10
|
-
lg:
|
|
11
|
-
xl:
|
|
12
|
-
'2xl':
|
|
6
|
+
none: "gap-0";
|
|
7
|
+
xs: "gap-1";
|
|
8
|
+
sm: "gap-2";
|
|
9
|
+
md: "gap-3";
|
|
10
|
+
lg: "gap-4";
|
|
11
|
+
xl: "gap-6";
|
|
12
|
+
'2xl': "gap-8";
|
|
13
13
|
};
|
|
14
14
|
align: {
|
|
15
|
-
start:
|
|
16
|
-
center:
|
|
17
|
-
end:
|
|
18
|
-
stretch:
|
|
19
|
-
baseline:
|
|
15
|
+
start: "items-start";
|
|
16
|
+
center: "items-center";
|
|
17
|
+
end: "items-end";
|
|
18
|
+
stretch: "items-stretch";
|
|
19
|
+
baseline: "items-baseline";
|
|
20
20
|
};
|
|
21
21
|
justify: {
|
|
22
|
-
start:
|
|
23
|
-
center:
|
|
24
|
-
end:
|
|
25
|
-
between:
|
|
26
|
-
around:
|
|
27
|
-
evenly:
|
|
28
|
-
};
|
|
29
|
-
}, undefined, "flex-row",
|
|
30
|
-
gap: {
|
|
31
|
-
none: string;
|
|
32
|
-
xs: string;
|
|
33
|
-
sm: string;
|
|
34
|
-
md: string;
|
|
35
|
-
lg: string;
|
|
36
|
-
xl: string;
|
|
37
|
-
'2xl': string;
|
|
38
|
-
};
|
|
39
|
-
align: {
|
|
40
|
-
start: string;
|
|
41
|
-
center: string;
|
|
42
|
-
end: string;
|
|
43
|
-
stretch: string;
|
|
44
|
-
baseline: string;
|
|
45
|
-
};
|
|
46
|
-
justify: {
|
|
47
|
-
start: string;
|
|
48
|
-
center: string;
|
|
49
|
-
end: string;
|
|
50
|
-
between: string;
|
|
51
|
-
around: string;
|
|
52
|
-
evenly: string;
|
|
53
|
-
};
|
|
54
|
-
}, {
|
|
22
|
+
start: "justify-start";
|
|
23
|
+
center: "justify-center";
|
|
24
|
+
end: "justify-end";
|
|
25
|
+
between: "justify-between";
|
|
26
|
+
around: "justify-around";
|
|
27
|
+
evenly: "justify-evenly";
|
|
28
|
+
};
|
|
29
|
+
}, undefined, "flex-row", {
|
|
55
30
|
gap: {
|
|
56
|
-
none:
|
|
57
|
-
xs:
|
|
58
|
-
sm:
|
|
59
|
-
md:
|
|
60
|
-
lg:
|
|
61
|
-
xl:
|
|
62
|
-
'2xl':
|
|
31
|
+
none: "gap-0";
|
|
32
|
+
xs: "gap-1";
|
|
33
|
+
sm: "gap-2";
|
|
34
|
+
md: "gap-3";
|
|
35
|
+
lg: "gap-4";
|
|
36
|
+
xl: "gap-6";
|
|
37
|
+
'2xl': "gap-8";
|
|
63
38
|
};
|
|
64
39
|
align: {
|
|
65
|
-
start:
|
|
66
|
-
center:
|
|
67
|
-
end:
|
|
68
|
-
stretch:
|
|
69
|
-
baseline:
|
|
40
|
+
start: "items-start";
|
|
41
|
+
center: "items-center";
|
|
42
|
+
end: "items-end";
|
|
43
|
+
stretch: "items-stretch";
|
|
44
|
+
baseline: "items-baseline";
|
|
70
45
|
};
|
|
71
46
|
justify: {
|
|
72
|
-
start:
|
|
73
|
-
center:
|
|
74
|
-
end:
|
|
75
|
-
between:
|
|
76
|
-
around:
|
|
77
|
-
evenly:
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
gap: {
|
|
81
|
-
none: string;
|
|
82
|
-
xs: string;
|
|
83
|
-
sm: string;
|
|
84
|
-
md: string;
|
|
85
|
-
lg: string;
|
|
86
|
-
xl: string;
|
|
87
|
-
'2xl': string;
|
|
88
|
-
};
|
|
89
|
-
align: {
|
|
90
|
-
start: string;
|
|
91
|
-
center: string;
|
|
92
|
-
end: string;
|
|
93
|
-
stretch: string;
|
|
94
|
-
baseline: string;
|
|
95
|
-
};
|
|
96
|
-
justify: {
|
|
97
|
-
start: string;
|
|
98
|
-
center: string;
|
|
99
|
-
end: string;
|
|
100
|
-
between: string;
|
|
101
|
-
around: string;
|
|
102
|
-
evenly: string;
|
|
103
|
-
};
|
|
104
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
47
|
+
start: "justify-start";
|
|
48
|
+
center: "justify-center";
|
|
49
|
+
end: "justify-end";
|
|
50
|
+
between: "justify-between";
|
|
51
|
+
around: "justify-around";
|
|
52
|
+
evenly: "justify-evenly";
|
|
53
|
+
};
|
|
54
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
105
55
|
gap: {
|
|
106
|
-
none:
|
|
107
|
-
xs:
|
|
108
|
-
sm:
|
|
109
|
-
md:
|
|
110
|
-
lg:
|
|
111
|
-
xl:
|
|
112
|
-
'2xl':
|
|
56
|
+
none: "gap-0";
|
|
57
|
+
xs: "gap-1";
|
|
58
|
+
sm: "gap-2";
|
|
59
|
+
md: "gap-3";
|
|
60
|
+
lg: "gap-4";
|
|
61
|
+
xl: "gap-6";
|
|
62
|
+
'2xl': "gap-8";
|
|
113
63
|
};
|
|
114
64
|
align: {
|
|
115
|
-
start:
|
|
116
|
-
center:
|
|
117
|
-
end:
|
|
118
|
-
stretch:
|
|
119
|
-
baseline:
|
|
65
|
+
start: "items-start";
|
|
66
|
+
center: "items-center";
|
|
67
|
+
end: "items-end";
|
|
68
|
+
stretch: "items-stretch";
|
|
69
|
+
baseline: "items-baseline";
|
|
120
70
|
};
|
|
121
71
|
justify: {
|
|
122
|
-
start:
|
|
123
|
-
center:
|
|
124
|
-
end:
|
|
125
|
-
between:
|
|
126
|
-
around:
|
|
127
|
-
evenly:
|
|
128
|
-
};
|
|
129
|
-
}, undefined
|
|
130
|
-
gap: {
|
|
131
|
-
none: string;
|
|
132
|
-
xs: string;
|
|
133
|
-
sm: string;
|
|
134
|
-
md: string;
|
|
135
|
-
lg: string;
|
|
136
|
-
xl: string;
|
|
137
|
-
'2xl': string;
|
|
138
|
-
};
|
|
139
|
-
align: {
|
|
140
|
-
start: string;
|
|
141
|
-
center: string;
|
|
142
|
-
end: string;
|
|
143
|
-
stretch: string;
|
|
144
|
-
baseline: string;
|
|
145
|
-
};
|
|
146
|
-
justify: {
|
|
147
|
-
start: string;
|
|
148
|
-
center: string;
|
|
149
|
-
end: string;
|
|
150
|
-
between: string;
|
|
151
|
-
around: string;
|
|
152
|
-
evenly: string;
|
|
153
|
-
};
|
|
154
|
-
}, {
|
|
155
|
-
gap: {
|
|
156
|
-
none: string;
|
|
157
|
-
xs: string;
|
|
158
|
-
sm: string;
|
|
159
|
-
md: string;
|
|
160
|
-
lg: string;
|
|
161
|
-
xl: string;
|
|
162
|
-
'2xl': string;
|
|
163
|
-
};
|
|
164
|
-
align: {
|
|
165
|
-
start: string;
|
|
166
|
-
center: string;
|
|
167
|
-
end: string;
|
|
168
|
-
stretch: string;
|
|
169
|
-
baseline: string;
|
|
170
|
-
};
|
|
171
|
-
justify: {
|
|
172
|
-
start: string;
|
|
173
|
-
center: string;
|
|
174
|
-
end: string;
|
|
175
|
-
between: string;
|
|
176
|
-
around: string;
|
|
177
|
-
evenly: string;
|
|
178
|
-
};
|
|
179
|
-
}>, unknown, unknown, undefined>>;
|
|
72
|
+
start: "justify-start";
|
|
73
|
+
center: "justify-center";
|
|
74
|
+
end: "justify-end";
|
|
75
|
+
between: "justify-between";
|
|
76
|
+
around: "justify-around";
|
|
77
|
+
evenly: "justify-evenly";
|
|
78
|
+
};
|
|
79
|
+
}, undefined>>;
|
|
180
80
|
export interface RowProps extends Omit<ViewProps, 'className'>, VariantProps<typeof rowVariants> {
|
|
181
81
|
className?: string;
|
|
182
82
|
}
|
|
183
|
-
declare const Row:
|
|
83
|
+
declare const Row: ForwardRefComponent<ViewInstance, RowProps>;
|
|
184
84
|
export { Row, rowVariants };
|