@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.
- package/README.md +18 -5
- 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/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/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 +12 -31
- 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 +69 -78
- 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 -2
- 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 +1 -1
- 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/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/package.json +29 -28
|
@@ -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 };
|
|
@@ -2,308 +2,136 @@ import React from 'react';
|
|
|
2
2
|
import { type PressableProps, type TextProps, type ViewProps } from 'react-native';
|
|
3
3
|
declare const segmentedControlVariants: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
variant: {
|
|
5
|
-
default:
|
|
6
|
-
pill:
|
|
5
|
+
default: "";
|
|
6
|
+
pill: "";
|
|
7
7
|
};
|
|
8
8
|
wrap: {
|
|
9
|
-
true:
|
|
10
|
-
false:
|
|
9
|
+
true: "flex-wrap justify-center gap-1";
|
|
10
|
+
false: "flex-nowrap gap-1";
|
|
11
11
|
};
|
|
12
12
|
size: {
|
|
13
|
-
default:
|
|
14
|
-
compact:
|
|
13
|
+
default: "";
|
|
14
|
+
compact: "";
|
|
15
15
|
};
|
|
16
|
-
}, undefined, "w-full flex-row items-center",
|
|
16
|
+
}, undefined, "w-full flex-row items-center", {
|
|
17
17
|
variant: {
|
|
18
|
-
default:
|
|
19
|
-
pill:
|
|
18
|
+
default: "";
|
|
19
|
+
pill: "";
|
|
20
20
|
};
|
|
21
21
|
wrap: {
|
|
22
|
-
true:
|
|
23
|
-
false:
|
|
22
|
+
true: "flex-wrap justify-center gap-1";
|
|
23
|
+
false: "flex-nowrap gap-1";
|
|
24
24
|
};
|
|
25
25
|
size: {
|
|
26
|
-
default:
|
|
27
|
-
compact:
|
|
26
|
+
default: "";
|
|
27
|
+
compact: "";
|
|
28
28
|
};
|
|
29
|
-
}, {
|
|
29
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
30
30
|
variant: {
|
|
31
|
-
default:
|
|
32
|
-
pill:
|
|
31
|
+
default: "";
|
|
32
|
+
pill: "";
|
|
33
33
|
};
|
|
34
34
|
wrap: {
|
|
35
|
-
true:
|
|
36
|
-
false:
|
|
35
|
+
true: "flex-wrap justify-center gap-1";
|
|
36
|
+
false: "flex-nowrap gap-1";
|
|
37
37
|
};
|
|
38
38
|
size: {
|
|
39
|
-
default:
|
|
40
|
-
compact:
|
|
39
|
+
default: "";
|
|
40
|
+
compact: "";
|
|
41
41
|
};
|
|
42
|
-
}
|
|
43
|
-
variant: {
|
|
44
|
-
default: string;
|
|
45
|
-
pill: string;
|
|
46
|
-
};
|
|
47
|
-
wrap: {
|
|
48
|
-
true: string;
|
|
49
|
-
false: string;
|
|
50
|
-
};
|
|
51
|
-
size: {
|
|
52
|
-
default: string;
|
|
53
|
-
compact: string;
|
|
54
|
-
};
|
|
55
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
56
|
-
variant: {
|
|
57
|
-
default: string;
|
|
58
|
-
pill: string;
|
|
59
|
-
};
|
|
60
|
-
wrap: {
|
|
61
|
-
true: string;
|
|
62
|
-
false: string;
|
|
63
|
-
};
|
|
64
|
-
size: {
|
|
65
|
-
default: string;
|
|
66
|
-
compact: string;
|
|
67
|
-
};
|
|
68
|
-
}, undefined, "w-full flex-row items-center", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
69
|
-
variant: {
|
|
70
|
-
default: string;
|
|
71
|
-
pill: string;
|
|
72
|
-
};
|
|
73
|
-
wrap: {
|
|
74
|
-
true: string;
|
|
75
|
-
false: string;
|
|
76
|
-
};
|
|
77
|
-
size: {
|
|
78
|
-
default: string;
|
|
79
|
-
compact: string;
|
|
80
|
-
};
|
|
81
|
-
}, {
|
|
82
|
-
variant: {
|
|
83
|
-
default: string;
|
|
84
|
-
pill: string;
|
|
85
|
-
};
|
|
86
|
-
wrap: {
|
|
87
|
-
true: string;
|
|
88
|
-
false: string;
|
|
89
|
-
};
|
|
90
|
-
size: {
|
|
91
|
-
default: string;
|
|
92
|
-
compact: string;
|
|
93
|
-
};
|
|
94
|
-
}>, unknown, unknown, undefined>>;
|
|
42
|
+
}, undefined>>;
|
|
95
43
|
declare const segmentedControlItemVariants: import("tailwind-variants").TVReturnType<{
|
|
96
44
|
variant: {
|
|
97
|
-
default:
|
|
98
|
-
pill:
|
|
99
|
-
};
|
|
100
|
-
selected: {
|
|
101
|
-
true: string;
|
|
102
|
-
false: string;
|
|
103
|
-
};
|
|
104
|
-
size: {
|
|
105
|
-
default: string;
|
|
106
|
-
compact: string;
|
|
107
|
-
};
|
|
108
|
-
disabled: {
|
|
109
|
-
true: string;
|
|
110
|
-
false: string;
|
|
111
|
-
};
|
|
112
|
-
wrap: {
|
|
113
|
-
true: string;
|
|
114
|
-
false: string;
|
|
115
|
-
};
|
|
116
|
-
}, undefined, "min-w-0 flex-row items-center justify-center", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
117
|
-
variant: {
|
|
118
|
-
default: string;
|
|
119
|
-
pill: string;
|
|
120
|
-
};
|
|
121
|
-
selected: {
|
|
122
|
-
true: string;
|
|
123
|
-
false: string;
|
|
124
|
-
};
|
|
125
|
-
size: {
|
|
126
|
-
default: string;
|
|
127
|
-
compact: string;
|
|
128
|
-
};
|
|
129
|
-
disabled: {
|
|
130
|
-
true: string;
|
|
131
|
-
false: string;
|
|
132
|
-
};
|
|
133
|
-
wrap: {
|
|
134
|
-
true: string;
|
|
135
|
-
false: string;
|
|
136
|
-
};
|
|
137
|
-
}, {
|
|
138
|
-
variant: {
|
|
139
|
-
default: string;
|
|
140
|
-
pill: string;
|
|
141
|
-
};
|
|
142
|
-
selected: {
|
|
143
|
-
true: string;
|
|
144
|
-
false: string;
|
|
145
|
-
};
|
|
146
|
-
size: {
|
|
147
|
-
default: string;
|
|
148
|
-
compact: string;
|
|
149
|
-
};
|
|
150
|
-
disabled: {
|
|
151
|
-
true: string;
|
|
152
|
-
false: string;
|
|
153
|
-
};
|
|
154
|
-
wrap: {
|
|
155
|
-
true: string;
|
|
156
|
-
false: string;
|
|
157
|
-
};
|
|
158
|
-
}>, {
|
|
159
|
-
variant: {
|
|
160
|
-
default: string;
|
|
161
|
-
pill: string;
|
|
162
|
-
};
|
|
163
|
-
selected: {
|
|
164
|
-
true: string;
|
|
165
|
-
false: string;
|
|
166
|
-
};
|
|
167
|
-
size: {
|
|
168
|
-
default: string;
|
|
169
|
-
compact: string;
|
|
170
|
-
};
|
|
171
|
-
disabled: {
|
|
172
|
-
true: string;
|
|
173
|
-
false: string;
|
|
174
|
-
};
|
|
175
|
-
wrap: {
|
|
176
|
-
true: string;
|
|
177
|
-
false: string;
|
|
178
|
-
};
|
|
179
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
180
|
-
variant: {
|
|
181
|
-
default: string;
|
|
182
|
-
pill: string;
|
|
45
|
+
default: "";
|
|
46
|
+
pill: "";
|
|
183
47
|
};
|
|
184
48
|
selected: {
|
|
185
|
-
true:
|
|
186
|
-
false:
|
|
49
|
+
true: "";
|
|
50
|
+
false: "";
|
|
187
51
|
};
|
|
188
52
|
size: {
|
|
189
|
-
default:
|
|
190
|
-
compact:
|
|
53
|
+
default: "";
|
|
54
|
+
compact: "";
|
|
191
55
|
};
|
|
192
56
|
disabled: {
|
|
193
|
-
true:
|
|
194
|
-
false:
|
|
57
|
+
true: "";
|
|
58
|
+
false: "";
|
|
195
59
|
};
|
|
196
60
|
wrap: {
|
|
197
|
-
true:
|
|
198
|
-
false:
|
|
61
|
+
true: "grow-0";
|
|
62
|
+
false: "flex-1";
|
|
199
63
|
};
|
|
200
|
-
}, undefined, "min-w-0 flex-row items-center justify-center",
|
|
64
|
+
}, undefined, "min-w-0 flex-row items-center justify-center", {
|
|
201
65
|
variant: {
|
|
202
|
-
default:
|
|
203
|
-
pill:
|
|
66
|
+
default: "";
|
|
67
|
+
pill: "";
|
|
204
68
|
};
|
|
205
69
|
selected: {
|
|
206
|
-
true:
|
|
207
|
-
false:
|
|
70
|
+
true: "";
|
|
71
|
+
false: "";
|
|
208
72
|
};
|
|
209
73
|
size: {
|
|
210
|
-
default:
|
|
211
|
-
compact:
|
|
74
|
+
default: "";
|
|
75
|
+
compact: "";
|
|
212
76
|
};
|
|
213
77
|
disabled: {
|
|
214
|
-
true:
|
|
215
|
-
false:
|
|
78
|
+
true: "";
|
|
79
|
+
false: "";
|
|
216
80
|
};
|
|
217
81
|
wrap: {
|
|
218
|
-
true:
|
|
219
|
-
false:
|
|
82
|
+
true: "grow-0";
|
|
83
|
+
false: "flex-1";
|
|
220
84
|
};
|
|
221
|
-
}, {
|
|
85
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
222
86
|
variant: {
|
|
223
|
-
default:
|
|
224
|
-
pill:
|
|
87
|
+
default: "";
|
|
88
|
+
pill: "";
|
|
225
89
|
};
|
|
226
90
|
selected: {
|
|
227
|
-
true:
|
|
228
|
-
false:
|
|
91
|
+
true: "";
|
|
92
|
+
false: "";
|
|
229
93
|
};
|
|
230
94
|
size: {
|
|
231
|
-
default:
|
|
232
|
-
compact:
|
|
95
|
+
default: "";
|
|
96
|
+
compact: "";
|
|
233
97
|
};
|
|
234
98
|
disabled: {
|
|
235
|
-
true:
|
|
236
|
-
false:
|
|
99
|
+
true: "";
|
|
100
|
+
false: "";
|
|
237
101
|
};
|
|
238
102
|
wrap: {
|
|
239
|
-
true:
|
|
240
|
-
false:
|
|
103
|
+
true: "grow-0";
|
|
104
|
+
false: "flex-1";
|
|
241
105
|
};
|
|
242
|
-
}
|
|
106
|
+
}, undefined>>;
|
|
243
107
|
declare const segmentedControlItemTextVariants: import("tailwind-variants").TVReturnType<{
|
|
244
108
|
selected: {
|
|
245
|
-
true:
|
|
246
|
-
false:
|
|
247
|
-
};
|
|
248
|
-
size: {
|
|
249
|
-
default: string;
|
|
250
|
-
compact: string;
|
|
251
|
-
};
|
|
252
|
-
}, undefined, "font-medium", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
253
|
-
selected: {
|
|
254
|
-
true: string;
|
|
255
|
-
false: string;
|
|
256
|
-
};
|
|
257
|
-
size: {
|
|
258
|
-
default: string;
|
|
259
|
-
compact: string;
|
|
260
|
-
};
|
|
261
|
-
}, {
|
|
262
|
-
selected: {
|
|
263
|
-
true: string;
|
|
264
|
-
false: string;
|
|
265
|
-
};
|
|
266
|
-
size: {
|
|
267
|
-
default: string;
|
|
268
|
-
compact: string;
|
|
269
|
-
};
|
|
270
|
-
}>, {
|
|
271
|
-
selected: {
|
|
272
|
-
true: string;
|
|
273
|
-
false: string;
|
|
274
|
-
};
|
|
275
|
-
size: {
|
|
276
|
-
default: string;
|
|
277
|
-
compact: string;
|
|
278
|
-
};
|
|
279
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
280
|
-
selected: {
|
|
281
|
-
true: string;
|
|
282
|
-
false: string;
|
|
109
|
+
true: "text-foreground";
|
|
110
|
+
false: "text-muted-foreground";
|
|
283
111
|
};
|
|
284
112
|
size: {
|
|
285
|
-
default:
|
|
286
|
-
compact:
|
|
113
|
+
default: "";
|
|
114
|
+
compact: "";
|
|
287
115
|
};
|
|
288
|
-
}, undefined, "font-medium",
|
|
116
|
+
}, undefined, "font-medium", {
|
|
289
117
|
selected: {
|
|
290
|
-
true:
|
|
291
|
-
false:
|
|
118
|
+
true: "text-foreground";
|
|
119
|
+
false: "text-muted-foreground";
|
|
292
120
|
};
|
|
293
121
|
size: {
|
|
294
|
-
default:
|
|
295
|
-
compact:
|
|
122
|
+
default: "";
|
|
123
|
+
compact: "";
|
|
296
124
|
};
|
|
297
|
-
}, {
|
|
125
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
298
126
|
selected: {
|
|
299
|
-
true:
|
|
300
|
-
false:
|
|
127
|
+
true: "text-foreground";
|
|
128
|
+
false: "text-muted-foreground";
|
|
301
129
|
};
|
|
302
130
|
size: {
|
|
303
|
-
default:
|
|
304
|
-
compact:
|
|
131
|
+
default: "";
|
|
132
|
+
compact: "";
|
|
305
133
|
};
|
|
306
|
-
}
|
|
134
|
+
}, undefined>>;
|
|
307
135
|
export interface SegmentedControlProps extends ViewProps {
|
|
308
136
|
value?: string;
|
|
309
137
|
defaultValue?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScrollView,
|
|
2
|
+
import { ScrollView, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
import * as SelectPrimitive from '@rn-primitives/select';
|
|
4
4
|
import { type FrostedSurfaceProps } from '../../lib/frosted-surface';
|
|
5
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
5
6
|
export type SelectOption = SelectPrimitive.Option;
|
|
6
7
|
export type SelectTriggerRef = SelectPrimitive.TriggerRef;
|
|
7
8
|
export interface SelectProps {
|
|
@@ -55,31 +56,18 @@ export interface SelectLabelProps extends React.ComponentPropsWithoutRef<typeof
|
|
|
55
56
|
export interface SelectSeparatorProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator> {
|
|
56
57
|
className?: string;
|
|
57
58
|
}
|
|
58
|
-
declare const Select:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
onOpenChange?: (open: boolean) => void;
|
|
65
|
-
disabled?: boolean;
|
|
66
|
-
dir?: "ltr" | "rtl";
|
|
67
|
-
name?: string;
|
|
68
|
-
required?: boolean;
|
|
69
|
-
} & React.RefAttributes<View>>;
|
|
70
|
-
declare const SelectGroup: React.ForwardRefExoticComponent<import("react-native").ViewProps & {
|
|
71
|
-
asChild?: boolean;
|
|
72
|
-
} & React.RefAttributes<View>>;
|
|
73
|
-
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<SelectPrimitive.TriggerRef>>;
|
|
74
|
-
declare function SelectValue({ className, placeholder, ...props }: SelectValueProps & React.RefAttributes<SelectPrimitive.ValueRef>): React.JSX.Element;
|
|
75
|
-
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<View>>;
|
|
76
|
-
declare const SelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<View>>;
|
|
59
|
+
declare const Select: typeof SelectPrimitive.Root;
|
|
60
|
+
declare const SelectGroup: typeof SelectPrimitive.Group;
|
|
61
|
+
declare const SelectTrigger: ForwardRefComponent<SelectTriggerRef, SelectTriggerProps>;
|
|
62
|
+
declare function SelectValue({ className, placeholder }: SelectValueProps): React.JSX.Element;
|
|
63
|
+
declare const SelectContent: ForwardRefComponent<SelectPrimitive.ContentRef, SelectContentProps>;
|
|
64
|
+
declare const SelectItem: ForwardRefComponent<SelectPrimitive.ItemRef, SelectItemProps>;
|
|
77
65
|
declare function SelectItemIcon({ className, children }: SelectItemIconProps): React.JSX.Element;
|
|
78
66
|
declare namespace SelectItemIcon {
|
|
79
67
|
var displayName: string;
|
|
80
68
|
}
|
|
81
|
-
declare const SelectLabel:
|
|
82
|
-
declare const SelectSeparator:
|
|
69
|
+
declare const SelectLabel: ForwardRefComponent<SelectPrimitive.LabelRef, SelectLabelProps>;
|
|
70
|
+
declare const SelectSeparator: ForwardRefComponent<SelectPrimitive.SeparatorRef, SelectSeparatorProps>;
|
|
83
71
|
/**
|
|
84
72
|
* @platform Native only
|
|
85
73
|
* Returns the children on web
|
|
@@ -35,7 +35,7 @@ const SelectTrigger = React.forwardRef(({ className, children, style: styleProp,
|
|
|
35
35
|
]), ...props, children: [_jsx(_Fragment, { children: children }), _jsx(View, { className: "border-muted-foreground h-2 w-2 rotate-45 border-b-2 border-r-2" })] }));
|
|
36
36
|
});
|
|
37
37
|
SelectTrigger.displayName = 'SelectTrigger';
|
|
38
|
-
function SelectValue({ className, placeholder = 'Select...'
|
|
38
|
+
function SelectValue({ className, placeholder = 'Select...' }) {
|
|
39
39
|
const { value } = SelectPrimitive.useRootContext();
|
|
40
40
|
const visual = useVisualTokens();
|
|
41
41
|
// The colour is set on a wrapper and inherited, rather than on the primitive itself.
|
|
@@ -44,7 +44,7 @@ function SelectValue({ className, placeholder = 'Select...', ...props }) {
|
|
|
44
44
|
// user-agent default black — 1.2:1 on a dark surface. Rendering the label ourselves
|
|
45
45
|
// instead would fix the colour and lose the value: Radix owns the selection on web,
|
|
46
46
|
// and `useRootContext().value` is not populated there.
|
|
47
|
-
return (_jsx(Text, { className: cn('text-foreground', !value && 'text-muted-foreground', className), style: typographyStyle(visual, 'body'), numberOfLines: 1, children: _jsx(SelectPrimitive.Value, { placeholder: placeholder
|
|
47
|
+
return (_jsx(Text, { className: cn('text-foreground', !value && 'text-muted-foreground', className), style: typographyStyle(visual, 'body'), numberOfLines: 1, children: _jsx(SelectPrimitive.Value, { placeholder: placeholder }) }));
|
|
48
48
|
}
|
|
49
49
|
const SelectContent = React.forwardRef(({ className, children, portalHost, position = 'popper', insets, style: styleProp, frosted = false, blurIntensity, blurTintToken, ...props }, ref) => {
|
|
50
50
|
const frostedSurface = useFrostedSurface({
|