@thewhileloop/whileui 2.0.0 → 3.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.
Files changed (56) hide show
  1. package/README.md +18 -5
  2. package/dist/blocks/commerce/metric-card.d.ts +9 -29
  3. package/dist/blocks/datepicker/date-range-picker-modal.d.ts +1 -1
  4. package/dist/blocks/datepicker/date-range-picker-modal.js +6 -14
  5. package/dist/blocks/datepicker/datepicker-modal.d.ts +1 -1
  6. package/dist/blocks/datepicker/datepicker-modal.js +6 -12
  7. package/dist/blocks/layout/smart-input.d.ts +3 -2
  8. package/dist/blocks/layout/smart-input.js +33 -18
  9. package/dist/blocks/media/smart-image.d.ts +39 -98
  10. package/dist/blocks/navigation/drawer-menu.js +88 -72
  11. package/dist/components/alert/alert.d.ts +23 -55
  12. package/dist/components/alert/alert.js +1 -1
  13. package/dist/components/alert-dialog/alert-dialog.js +1 -4
  14. package/dist/components/avatar/avatar.d.ts +18 -45
  15. package/dist/components/avatar/avatar.js +1 -1
  16. package/dist/components/badge/badge.d.ts +84 -212
  17. package/dist/components/button/button.d.ts +69 -188
  18. package/dist/components/card/card.d.ts +29 -73
  19. package/dist/components/card/card.js +1 -1
  20. package/dist/components/container/container.d.ts +24 -96
  21. package/dist/components/data-row/data-row.d.ts +18 -38
  22. package/dist/components/data-row/data-row.js +1 -1
  23. package/dist/components/form-field/form-field.d.ts +31 -87
  24. package/dist/components/form-field/form-field.js +1 -1
  25. package/dist/components/hover-card/hover-card.d.ts +3 -2
  26. package/dist/components/input/input.d.ts +12 -31
  27. package/dist/components/label/label.d.ts +3 -3
  28. package/dist/components/labeled-field/labeled-field.d.ts +3 -2
  29. package/dist/components/numeric-input/numeric-input.d.ts +27 -82
  30. package/dist/components/numeric-input/numeric-input.js +69 -78
  31. package/dist/components/otp-input/otp-input.d.ts +21 -65
  32. package/dist/components/popover/popover.d.ts +4 -3
  33. package/dist/components/pressable/pressable.d.ts +3 -3
  34. package/dist/components/progress/progress.d.ts +15 -39
  35. package/dist/components/row/row.d.ts +63 -163
  36. package/dist/components/segmented-control/segmented-control.d.ts +69 -241
  37. package/dist/components/select/select.d.ts +10 -22
  38. package/dist/components/select/select.js +2 -2
  39. package/dist/components/separator/separator.d.ts +3 -3
  40. package/dist/components/skeleton/skeleton.d.ts +9 -29
  41. package/dist/components/spinner/spinner.d.ts +12 -36
  42. package/dist/components/stack/stack.d.ts +63 -163
  43. package/dist/components/tabs/tabs.d.ts +9 -29
  44. package/dist/components/text/text.d.ts +51 -131
  45. package/dist/components/textarea/textarea.d.ts +15 -39
  46. package/dist/components/textarea/textarea.js +1 -1
  47. package/dist/components/toast/toast.d.ts +12 -36
  48. package/dist/components/toggle/toggle.d.ts +42 -138
  49. package/dist/components/toggle-group/toggle-group.d.ts +42 -138
  50. package/dist/components/tooltip/tooltip.d.ts +3 -2
  51. package/dist/components/view/view.d.ts +3 -3
  52. package/dist/lib/ref-types.d.ts +3 -0
  53. package/dist/lib/ref-types.js +1 -0
  54. package/dist/lib/theme-bridge.d.ts +4 -2
  55. package/dist/lib/theme-bridge.js +13 -9
  56. package/package.json +29 -28
@@ -1,106 +1,51 @@
1
1
  import React from 'react';
2
- import { TextInput, type TextInputProps } from 'react-native';
2
+ import { type TextInputInstance, type TextInputProps } from 'react-native';
3
3
  import { type VariantProps } from '../../lib/tv';
4
+ import type { ForwardRefComponent } from '../../lib/ref-types';
4
5
  declare const numericInputVariants: import("tailwind-variants").TVReturnType<{
5
6
  variant: {
6
- default: string;
7
- error: string;
7
+ default: "border-border";
8
+ error: "border-destructive";
8
9
  };
9
10
  size: {
10
- default: string;
11
- compact: string;
11
+ default: "";
12
+ compact: "";
12
13
  };
13
- }, undefined, "w-full flex-row items-center border-border bg-muted", import("tailwind-variants/dist/config.js").TVConfig<{
14
+ }, undefined, "w-full flex-row items-center border-border bg-muted", {
14
15
  variant: {
15
- default: string;
16
- error: string;
16
+ default: "border-border";
17
+ error: "border-destructive";
17
18
  };
18
19
  size: {
19
- default: string;
20
- compact: string;
20
+ default: "";
21
+ compact: "";
21
22
  };
22
- }, {
23
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
23
24
  variant: {
24
- default: string;
25
- error: string;
25
+ default: "border-border";
26
+ error: "border-destructive";
26
27
  };
27
28
  size: {
28
- default: string;
29
- compact: string;
29
+ default: "";
30
+ compact: "";
30
31
  };
31
- }>, {
32
- variant: {
33
- default: string;
34
- error: string;
35
- };
36
- size: {
37
- default: string;
38
- compact: string;
39
- };
40
- }, undefined, import("tailwind-variants").TVReturnType<{
41
- variant: {
42
- default: string;
43
- error: string;
44
- };
45
- size: {
46
- default: string;
47
- compact: string;
48
- };
49
- }, undefined, "w-full flex-row items-center border-border bg-muted", import("tailwind-variants/dist/config.js").TVConfig<{
50
- variant: {
51
- default: string;
52
- error: string;
53
- };
54
- size: {
55
- default: string;
56
- compact: string;
57
- };
58
- }, {
59
- variant: {
60
- default: string;
61
- error: string;
62
- };
63
- size: {
64
- default: string;
65
- compact: string;
66
- };
67
- }>, unknown, unknown, undefined>>;
32
+ }, undefined>>;
68
33
  declare const numericInputTextVariants: import("tailwind-variants").TVReturnType<{
69
34
  size: {
70
- default: string;
71
- compact: string;
72
- };
73
- }, undefined, "text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
74
- size: {
75
- default: string;
76
- compact: string;
77
- };
78
- }, {
79
- size: {
80
- default: string;
81
- compact: string;
82
- };
83
- }>, {
84
- size: {
85
- default: string;
86
- compact: string;
87
- };
88
- }, undefined, import("tailwind-variants").TVReturnType<{
89
- size: {
90
- default: string;
91
- compact: string;
35
+ default: "";
36
+ compact: "";
92
37
  };
93
- }, undefined, "text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
38
+ }, undefined, "text-foreground", {
94
39
  size: {
95
- default: string;
96
- compact: string;
40
+ default: "";
41
+ compact: "";
97
42
  };
98
- }, {
43
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
99
44
  size: {
100
- default: string;
101
- compact: string;
45
+ default: "";
46
+ compact: "";
102
47
  };
103
- }>, unknown, unknown, undefined>>;
48
+ }, undefined>>;
104
49
  export interface NumericInputProps extends Omit<TextInputProps, 'value' | 'defaultValue' | 'onChangeText' | 'keyboardType'>, VariantProps<typeof numericInputVariants> {
105
50
  className?: string;
106
51
  inputClassName?: string;
@@ -116,5 +61,5 @@ export interface NumericInputProps extends Omit<TextInputProps, 'value' | 'defau
116
61
  /** Drop the field shell (border, background, radius, padding) for embedding inside another field shell like LabeledField. */
117
62
  unstyled?: boolean;
118
63
  }
119
- declare const NumericInput: React.ForwardRefExoticComponent<NumericInputProps & React.RefAttributes<TextInput>>;
64
+ declare const NumericInput: ForwardRefComponent<TextInputInstance, NumericInputProps>;
120
65
  export { NumericInput, numericInputVariants, numericInputTextVariants };
@@ -1,6 +1,6 @@
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
5
  import { focusRing } from '../../lib/focus-ring';
6
6
  import { tv } from '../../lib/tv';
@@ -66,70 +66,89 @@ 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
- 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, onBlur, style: styleProp, ...props }, ref) => {
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
- if (nextValue === null) {
85
- if (!isControlled) {
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
- const isNumericLike = /^-?\d*(?:[.,]\d*)?$/.test(nextText);
99
- if (!isNumericLike) {
80
+ const handleTextChange = useCallback((nextText) => {
81
+ if (!/^-?\d*(?:[.,]\d*)?$/.test(nextText))
100
82
  return;
101
- }
102
- setTextAndValue(nextText);
103
- };
104
- const handleBlur = (event) => {
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
- const rounded = roundToStepPrecision(parsed, step);
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
- const canDecrease = editable && (min === undefined || currentValue === null || currentValue > min);
117
- const canIncrease = editable && (max === undefined || currentValue === null || currentValue < max);
118
- const stepDownStyle = withInteractivePressableStyle(undefined, interaction, {
119
- disabled: !canDecrease,
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
- const stepUpStyle = withInteractivePressableStyle(undefined, interaction, {
124
- disabled: !canIncrease,
125
- disabledVariant: 'subtle',
126
- pressedVariant: 'default',
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, onBlur, style: styleProp, ...props }, ref) => {
139
+ const colors = useThemeColors();
140
+ const interaction = useInteractionTokens();
141
+ const visual = useVisualTokens();
142
+ const model = useNumericInputModel({
143
+ value,
144
+ defaultValue,
145
+ min,
146
+ max,
147
+ step,
148
+ editable,
149
+ onValueChange,
150
+ onBlur,
127
151
  });
128
- const nudge = (delta) => {
129
- const baseline = currentValue ?? min ?? 0;
130
- const raw = baseline + delta * step;
131
- applyNumericValue(roundToStepPrecision(raw, step));
132
- };
133
152
  const controlHeight = size === 'compact' ? visual.controlHeightSm : visual.controlHeightDefault;
134
153
  // Steppers render as inset soft buttons, centered inside the field shell.
135
154
  const stepInset = Math.max(3, Math.round(controlHeight * 0.1));
@@ -145,35 +164,7 @@ const NumericInput = React.forwardRef(({ className, inputClassName, prefix, suff
145
164
  paddingRight: unstyled ? 0 : showSteppers ? stepInset : 0,
146
165
  },
147
166
  !editable ? { opacity: interaction.disabledOpacity } : undefined,
148
- ], children: [prefix ? (_jsx(View, { style: { paddingRight: Math.max(8, Math.round(visual.controlPaddingXDefault * 0.5)) }, children: prefix })) : null, _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', focusRing, inputClassName), style: Platform.OS === 'web'
149
- ? [
150
- {
151
- ...typographyStyle(visual, size === 'compact' ? 'caption' : 'label'),
152
- width: '100%',
153
- minWidth: 0,
154
- paddingVertical: size === 'compact'
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] }));
167
+ ], 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', focusRing, inputClassName), style: numericInputTextStyle(visual, size, unstyled, styleProp), value: model.textValue, onChangeText: model.handleTextChange, onBlur: model.handleBlur, 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
168
  });
178
169
  NumericInput.displayName = 'NumericInput';
179
170
  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: string;
5
- compact: string;
4
+ default: "w-11";
5
+ compact: "w-9";
6
6
  };
7
7
  state: {
8
- idle: string;
9
- focused: string;
10
- error: string;
11
- errorFocused: string;
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", import("tailwind-variants/dist/config.js").TVConfig<{
13
+ }, undefined, "items-center justify-center border bg-muted", {
14
14
  size: {
15
- default: string;
16
- compact: string;
15
+ default: "w-11";
16
+ compact: "w-9";
17
17
  };
18
18
  state: {
19
- idle: string;
20
- focused: string;
21
- error: string;
22
- errorFocused: string;
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: string;
27
- compact: string;
26
+ default: "w-11";
27
+ compact: "w-9";
28
28
  };
29
29
  state: {
30
- idle: string;
31
- focused: string;
32
- error: string;
33
- errorFocused: string;
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: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<import("@rn-primitives/popover").TriggerRef>>;
23
- declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<import("react-native").View>>;
24
- declare const PopoverClose: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<import("react-native").View>>;
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 React from 'react';
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: React.ForwardRefExoticComponent<PressableProps & React.RefAttributes<import("react-native").View>>;
13
+ declare const Pressable: ForwardRefComponent<PressableInstance, PressableProps>;
14
14
  export { Pressable };
@@ -1,52 +1,28 @@
1
- import React from 'react';
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: string;
7
- default: string;
8
- lg: string;
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", import("tailwind-variants/dist/config.js").TVConfig<{
10
+ }, undefined, "h-3 w-full overflow-hidden rounded-full bg-secondary", {
11
11
  size: {
12
- sm: string;
13
- default: string;
14
- lg: string;
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: string;
19
- default: string;
20
- lg: string;
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: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<View>>;
27
+ declare const Progress: ForwardRefComponent<ViewInstance, ProgressProps>;
52
28
  export { Progress, progressVariants };