@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.
Files changed (74) hide show
  1. package/README.md +135 -70
  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/datepicker/index.d.ts +1 -0
  8. package/dist/blocks/datepicker/index.js +1 -0
  9. package/dist/blocks/datepicker/time-picker-modal.d.ts +43 -0
  10. package/dist/blocks/datepicker/time-picker-modal.js +187 -0
  11. package/dist/blocks/layout/smart-input.d.ts +3 -2
  12. package/dist/blocks/layout/smart-input.js +33 -18
  13. package/dist/blocks/media/smart-image.d.ts +39 -98
  14. package/dist/blocks/navigation/drawer-menu.js +88 -72
  15. package/dist/components/alert/alert.d.ts +23 -55
  16. package/dist/components/alert/alert.js +1 -1
  17. package/dist/components/alert-dialog/alert-dialog.js +1 -4
  18. package/dist/components/avatar/avatar.d.ts +18 -45
  19. package/dist/components/avatar/avatar.js +1 -1
  20. package/dist/components/badge/badge.d.ts +84 -212
  21. package/dist/components/button/button.d.ts +69 -188
  22. package/dist/components/card/card.d.ts +29 -73
  23. package/dist/components/card/card.js +1 -1
  24. package/dist/components/container/container.d.ts +24 -96
  25. package/dist/components/data-row/data-row.d.ts +18 -38
  26. package/dist/components/data-row/data-row.js +1 -1
  27. package/dist/components/fab/fab.d.ts +87 -0
  28. package/dist/components/fab/fab.js +59 -0
  29. package/dist/components/fab/index.d.ts +1 -0
  30. package/dist/components/fab/index.js +1 -0
  31. package/dist/components/form-field/form-field.d.ts +31 -87
  32. package/dist/components/form-field/form-field.js +1 -1
  33. package/dist/components/hover-card/hover-card.d.ts +3 -2
  34. package/dist/components/input/input.d.ts +18 -31
  35. package/dist/components/input/input.js +20 -8
  36. package/dist/components/label/label.d.ts +3 -3
  37. package/dist/components/labeled-field/labeled-field.d.ts +3 -2
  38. package/dist/components/numeric-input/numeric-input.d.ts +27 -82
  39. package/dist/components/numeric-input/numeric-input.js +79 -80
  40. package/dist/components/otp-input/otp-input.d.ts +21 -65
  41. package/dist/components/popover/popover.d.ts +4 -3
  42. package/dist/components/pressable/pressable.d.ts +3 -3
  43. package/dist/components/progress/progress.d.ts +15 -39
  44. package/dist/components/row/row.d.ts +63 -163
  45. package/dist/components/segmented-control/segmented-control.d.ts +69 -241
  46. package/dist/components/select/select.d.ts +10 -22
  47. package/dist/components/select/select.js +2 -7
  48. package/dist/components/separator/separator.d.ts +3 -3
  49. package/dist/components/skeleton/skeleton.d.ts +9 -29
  50. package/dist/components/spinner/spinner.d.ts +12 -36
  51. package/dist/components/stack/stack.d.ts +63 -163
  52. package/dist/components/tabs/tabs.d.ts +9 -29
  53. package/dist/components/text/text.d.ts +51 -131
  54. package/dist/components/textarea/textarea.d.ts +15 -39
  55. package/dist/components/textarea/textarea.js +3 -3
  56. package/dist/components/toast/toast.d.ts +12 -36
  57. package/dist/components/toggle/toggle.d.ts +42 -138
  58. package/dist/components/toggle-group/toggle-group.d.ts +42 -138
  59. package/dist/components/tooltip/tooltip.d.ts +3 -2
  60. package/dist/components/view/view.d.ts +3 -3
  61. package/dist/index.d.ts +2 -1
  62. package/dist/index.js +2 -1
  63. package/dist/lib/focus-ring.d.ts +10 -0
  64. package/dist/lib/focus-ring.js +10 -0
  65. package/dist/lib/interaction-tokens.d.ts +24 -1
  66. package/dist/lib/interaction-tokens.js +26 -44
  67. package/dist/lib/motion-policy.js +2 -2
  68. package/dist/lib/ref-types.d.ts +3 -0
  69. package/dist/lib/ref-types.js +1 -0
  70. package/dist/lib/theme-bridge.d.ts +4 -2
  71. package/dist/lib/theme-bridge.js +13 -9
  72. package/dist/lib/theme-presets.d.ts +26 -0
  73. package/dist/lib/theme-presets.js +28 -0
  74. package/package.json +29 -28
@@ -2,230 +2,102 @@ import { type ViewProps, type TextProps } from 'react-native';
2
2
  import { type VariantProps } from '../../lib/tv';
3
3
  declare const badgeVariants: import("tailwind-variants").TVReturnType<{
4
4
  variant: {
5
- default: string;
6
- secondary: string;
7
- destructive: string;
8
- outline: string;
9
- success: string;
10
- warning: string;
11
- info: string;
12
- soft: string;
13
- 'soft-secondary': string;
14
- 'soft-destructive': string;
15
- 'soft-success': string;
16
- 'soft-warning': string;
17
- 'soft-info': string;
5
+ default: "bg-primary";
6
+ secondary: "bg-secondary";
7
+ destructive: "bg-destructive";
8
+ outline: "border-border bg-transparent";
9
+ success: "bg-success";
10
+ warning: "bg-warning";
11
+ info: "bg-info";
12
+ soft: "bg-primary-soft";
13
+ 'soft-secondary': "bg-secondary-soft";
14
+ 'soft-destructive': "bg-destructive-soft";
15
+ 'soft-success': "bg-success-soft";
16
+ 'soft-warning': "bg-warning-soft";
17
+ 'soft-info': "bg-info-soft";
18
18
  };
19
- }, undefined, "inline-flex items-center", import("tailwind-variants/dist/config.js").TVConfig<{
19
+ }, undefined, "inline-flex items-center", {
20
20
  variant: {
21
- default: string;
22
- secondary: string;
23
- destructive: string;
24
- outline: string;
25
- success: string;
26
- warning: string;
27
- info: string;
28
- soft: string;
29
- 'soft-secondary': string;
30
- 'soft-destructive': string;
31
- 'soft-success': string;
32
- 'soft-warning': string;
33
- 'soft-info': string;
21
+ default: "bg-primary";
22
+ secondary: "bg-secondary";
23
+ destructive: "bg-destructive";
24
+ outline: "border-border bg-transparent";
25
+ success: "bg-success";
26
+ warning: "bg-warning";
27
+ info: "bg-info";
28
+ soft: "bg-primary-soft";
29
+ 'soft-secondary': "bg-secondary-soft";
30
+ 'soft-destructive': "bg-destructive-soft";
31
+ 'soft-success': "bg-success-soft";
32
+ 'soft-warning': "bg-warning-soft";
33
+ 'soft-info': "bg-info-soft";
34
34
  };
35
- }, {
35
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
36
36
  variant: {
37
- default: string;
38
- secondary: string;
39
- destructive: string;
40
- outline: string;
41
- success: string;
42
- warning: string;
43
- info: string;
44
- soft: string;
45
- 'soft-secondary': string;
46
- 'soft-destructive': string;
47
- 'soft-success': string;
48
- 'soft-warning': string;
49
- 'soft-info': string;
37
+ default: "bg-primary";
38
+ secondary: "bg-secondary";
39
+ destructive: "bg-destructive";
40
+ outline: "border-border bg-transparent";
41
+ success: "bg-success";
42
+ warning: "bg-warning";
43
+ info: "bg-info";
44
+ soft: "bg-primary-soft";
45
+ 'soft-secondary': "bg-secondary-soft";
46
+ 'soft-destructive': "bg-destructive-soft";
47
+ 'soft-success': "bg-success-soft";
48
+ 'soft-warning': "bg-warning-soft";
49
+ 'soft-info': "bg-info-soft";
50
50
  };
51
- }>, {
52
- variant: {
53
- default: string;
54
- secondary: string;
55
- destructive: string;
56
- outline: string;
57
- success: string;
58
- warning: string;
59
- info: string;
60
- soft: string;
61
- 'soft-secondary': string;
62
- 'soft-destructive': string;
63
- 'soft-success': string;
64
- 'soft-warning': string;
65
- 'soft-info': string;
66
- };
67
- }, undefined, import("tailwind-variants").TVReturnType<{
68
- variant: {
69
- default: string;
70
- secondary: string;
71
- destructive: string;
72
- outline: string;
73
- success: string;
74
- warning: string;
75
- info: string;
76
- soft: string;
77
- 'soft-secondary': string;
78
- 'soft-destructive': string;
79
- 'soft-success': string;
80
- 'soft-warning': string;
81
- 'soft-info': string;
82
- };
83
- }, undefined, "inline-flex items-center", import("tailwind-variants/dist/config.js").TVConfig<{
84
- variant: {
85
- default: string;
86
- secondary: string;
87
- destructive: string;
88
- outline: string;
89
- success: string;
90
- warning: string;
91
- info: string;
92
- soft: string;
93
- 'soft-secondary': string;
94
- 'soft-destructive': string;
95
- 'soft-success': string;
96
- 'soft-warning': string;
97
- 'soft-info': string;
98
- };
99
- }, {
100
- variant: {
101
- default: string;
102
- secondary: string;
103
- destructive: string;
104
- outline: string;
105
- success: string;
106
- warning: string;
107
- info: string;
108
- soft: string;
109
- 'soft-secondary': string;
110
- 'soft-destructive': string;
111
- 'soft-success': string;
112
- 'soft-warning': string;
113
- 'soft-info': string;
114
- };
115
- }>, unknown, unknown, undefined>>;
51
+ }, undefined>>;
116
52
  declare const badgeTextVariants: import("tailwind-variants").TVReturnType<{
117
53
  variant: {
118
- default: string;
119
- secondary: string;
120
- destructive: string;
121
- outline: string;
122
- success: string;
123
- warning: string;
124
- info: string;
125
- soft: string;
126
- 'soft-secondary': string;
127
- 'soft-destructive': string;
128
- 'soft-success': string;
129
- 'soft-warning': string;
130
- 'soft-info': string;
131
- };
132
- }, undefined, "font-semibold", import("tailwind-variants/dist/config.js").TVConfig<{
133
- variant: {
134
- default: string;
135
- secondary: string;
136
- destructive: string;
137
- outline: string;
138
- success: string;
139
- warning: string;
140
- info: string;
141
- soft: string;
142
- 'soft-secondary': string;
143
- 'soft-destructive': string;
144
- 'soft-success': string;
145
- 'soft-warning': string;
146
- 'soft-info': string;
147
- };
148
- }, {
149
- variant: {
150
- default: string;
151
- secondary: string;
152
- destructive: string;
153
- outline: string;
154
- success: string;
155
- warning: string;
156
- info: string;
157
- soft: string;
158
- 'soft-secondary': string;
159
- 'soft-destructive': string;
160
- 'soft-success': string;
161
- 'soft-warning': string;
162
- 'soft-info': string;
163
- };
164
- }>, {
165
- variant: {
166
- default: string;
167
- secondary: string;
168
- destructive: string;
169
- outline: string;
170
- success: string;
171
- warning: string;
172
- info: string;
173
- soft: string;
174
- 'soft-secondary': string;
175
- 'soft-destructive': string;
176
- 'soft-success': string;
177
- 'soft-warning': string;
178
- 'soft-info': string;
179
- };
180
- }, undefined, import("tailwind-variants").TVReturnType<{
181
- variant: {
182
- default: string;
183
- secondary: string;
184
- destructive: string;
185
- outline: string;
186
- success: string;
187
- warning: string;
188
- info: string;
189
- soft: string;
190
- 'soft-secondary': string;
191
- 'soft-destructive': string;
192
- 'soft-success': string;
193
- 'soft-warning': string;
194
- 'soft-info': string;
54
+ default: "text-primary-foreground";
55
+ secondary: "text-secondary-foreground";
56
+ destructive: "text-destructive-foreground";
57
+ outline: "text-foreground";
58
+ success: "text-success-foreground";
59
+ warning: "text-warning-foreground";
60
+ info: "text-info-foreground";
61
+ soft: "text-primary";
62
+ 'soft-secondary': "text-secondary-foreground";
63
+ 'soft-destructive': "text-destructive";
64
+ 'soft-success': "text-success";
65
+ 'soft-warning': "text-warning";
66
+ 'soft-info': "text-info";
195
67
  };
196
- }, undefined, "font-semibold", import("tailwind-variants/dist/config.js").TVConfig<{
68
+ }, undefined, "font-semibold", {
197
69
  variant: {
198
- default: string;
199
- secondary: string;
200
- destructive: string;
201
- outline: string;
202
- success: string;
203
- warning: string;
204
- info: string;
205
- soft: string;
206
- 'soft-secondary': string;
207
- 'soft-destructive': string;
208
- 'soft-success': string;
209
- 'soft-warning': string;
210
- 'soft-info': string;
70
+ default: "text-primary-foreground";
71
+ secondary: "text-secondary-foreground";
72
+ destructive: "text-destructive-foreground";
73
+ outline: "text-foreground";
74
+ success: "text-success-foreground";
75
+ warning: "text-warning-foreground";
76
+ info: "text-info-foreground";
77
+ soft: "text-primary";
78
+ 'soft-secondary': "text-secondary-foreground";
79
+ 'soft-destructive': "text-destructive";
80
+ 'soft-success': "text-success";
81
+ 'soft-warning': "text-warning";
82
+ 'soft-info': "text-info";
211
83
  };
212
- }, {
84
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
213
85
  variant: {
214
- default: string;
215
- secondary: string;
216
- destructive: string;
217
- outline: string;
218
- success: string;
219
- warning: string;
220
- info: string;
221
- soft: string;
222
- 'soft-secondary': string;
223
- 'soft-destructive': string;
224
- 'soft-success': string;
225
- 'soft-warning': string;
226
- 'soft-info': string;
86
+ default: "text-primary-foreground";
87
+ secondary: "text-secondary-foreground";
88
+ destructive: "text-destructive-foreground";
89
+ outline: "text-foreground";
90
+ success: "text-success-foreground";
91
+ warning: "text-warning-foreground";
92
+ info: "text-info-foreground";
93
+ soft: "text-primary";
94
+ 'soft-secondary': "text-secondary-foreground";
95
+ 'soft-destructive': "text-destructive";
96
+ 'soft-success': "text-success";
97
+ 'soft-warning': "text-warning";
98
+ 'soft-info': "text-info";
227
99
  };
228
- }>, unknown, unknown, undefined>>;
100
+ }, undefined>>;
229
101
  export interface BadgeProps extends ViewProps, VariantProps<typeof badgeVariants> {
230
102
  }
231
103
  export interface BadgeTextProps extends TextProps, VariantProps<typeof badgeTextVariants> {
@@ -1,219 +1,100 @@
1
1
  import React from 'react';
2
- import { View, type TextProps, type ViewProps } from 'react-native';
2
+ import { type PressableInstance, type TextProps, type ViewProps } from 'react-native';
3
3
  import { type PressableProps } from '../pressable';
4
4
  import { type VariantProps } from '../../lib/tv';
5
+ import type { ForwardRefComponent } from '../../lib/ref-types';
5
6
  declare const buttonVariants: import("tailwind-variants").TVReturnType<{
6
7
  variant: {
7
- default: string;
8
- destructive: string;
9
- outline: string;
10
- secondary: string;
11
- ghost: string;
12
- link: string;
8
+ default: "bg-primary";
9
+ destructive: "bg-destructive";
10
+ outline: "border border-input bg-background";
11
+ secondary: "bg-secondary";
12
+ ghost: "bg-transparent";
13
+ link: "";
13
14
  };
14
15
  size: {
15
- default: string;
16
- sm: string;
17
- lg: string;
18
- icon: string;
16
+ default: "";
17
+ sm: "";
18
+ lg: "";
19
+ icon: "";
19
20
  };
20
- }, undefined, "flex-row items-center justify-center gap-2", import("tailwind-variants/dist/config.js").TVConfig<{
21
+ }, undefined, "flex-row items-center justify-center gap-2", {
21
22
  variant: {
22
- default: string;
23
- destructive: string;
24
- outline: string;
25
- secondary: string;
26
- ghost: string;
27
- link: string;
23
+ default: "bg-primary";
24
+ destructive: "bg-destructive";
25
+ outline: "border border-input bg-background";
26
+ secondary: "bg-secondary";
27
+ ghost: "bg-transparent";
28
+ link: "";
28
29
  };
29
30
  size: {
30
- default: string;
31
- sm: string;
32
- lg: string;
33
- icon: string;
31
+ default: "";
32
+ sm: "";
33
+ lg: "";
34
+ icon: "";
34
35
  };
35
- }, {
36
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
36
37
  variant: {
37
- default: string;
38
- destructive: string;
39
- outline: string;
40
- secondary: string;
41
- ghost: string;
42
- link: string;
38
+ default: "bg-primary";
39
+ destructive: "bg-destructive";
40
+ outline: "border border-input bg-background";
41
+ secondary: "bg-secondary";
42
+ ghost: "bg-transparent";
43
+ link: "";
43
44
  };
44
45
  size: {
45
- default: string;
46
- sm: string;
47
- lg: string;
48
- icon: string;
46
+ default: "";
47
+ sm: "";
48
+ lg: "";
49
+ icon: "";
49
50
  };
50
- }>, {
51
- variant: {
52
- default: string;
53
- destructive: string;
54
- outline: string;
55
- secondary: string;
56
- ghost: string;
57
- link: string;
58
- };
59
- size: {
60
- default: string;
61
- sm: string;
62
- lg: string;
63
- icon: string;
64
- };
65
- }, undefined, import("tailwind-variants").TVReturnType<{
66
- variant: {
67
- default: string;
68
- destructive: string;
69
- outline: string;
70
- secondary: string;
71
- ghost: string;
72
- link: string;
73
- };
74
- size: {
75
- default: string;
76
- sm: string;
77
- lg: string;
78
- icon: string;
79
- };
80
- }, undefined, "flex-row items-center justify-center gap-2", import("tailwind-variants/dist/config.js").TVConfig<{
81
- variant: {
82
- default: string;
83
- destructive: string;
84
- outline: string;
85
- secondary: string;
86
- ghost: string;
87
- link: string;
88
- };
89
- size: {
90
- default: string;
91
- sm: string;
92
- lg: string;
93
- icon: string;
94
- };
95
- }, {
96
- variant: {
97
- default: string;
98
- destructive: string;
99
- outline: string;
100
- secondary: string;
101
- ghost: string;
102
- link: string;
103
- };
104
- size: {
105
- default: string;
106
- sm: string;
107
- lg: string;
108
- icon: string;
109
- };
110
- }>, unknown, unknown, undefined>>;
51
+ }, undefined>>;
111
52
  declare const buttonTextVariants: import("tailwind-variants").TVReturnType<{
112
53
  variant: {
113
- default: string;
114
- destructive: string;
115
- outline: string;
116
- secondary: string;
117
- ghost: string;
118
- link: string;
119
- };
120
- size: {
121
- default: string;
122
- sm: string;
123
- lg: string;
124
- icon: string;
125
- };
126
- }, undefined, "font-medium text-center", import("tailwind-variants/dist/config.js").TVConfig<{
127
- variant: {
128
- default: string;
129
- destructive: string;
130
- outline: string;
131
- secondary: string;
132
- ghost: string;
133
- link: string;
134
- };
135
- size: {
136
- default: string;
137
- sm: string;
138
- lg: string;
139
- icon: string;
140
- };
141
- }, {
142
- variant: {
143
- default: string;
144
- destructive: string;
145
- outline: string;
146
- secondary: string;
147
- ghost: string;
148
- link: string;
149
- };
150
- size: {
151
- default: string;
152
- sm: string;
153
- lg: string;
154
- icon: string;
155
- };
156
- }>, {
157
- variant: {
158
- default: string;
159
- destructive: string;
160
- outline: string;
161
- secondary: string;
162
- ghost: string;
163
- link: string;
164
- };
165
- size: {
166
- default: string;
167
- sm: string;
168
- lg: string;
169
- icon: string;
170
- };
171
- }, undefined, import("tailwind-variants").TVReturnType<{
172
- variant: {
173
- default: string;
174
- destructive: string;
175
- outline: string;
176
- secondary: string;
177
- ghost: string;
178
- link: string;
54
+ default: "text-primary-foreground";
55
+ destructive: "text-destructive-foreground";
56
+ outline: "text-foreground";
57
+ secondary: "text-secondary-foreground";
58
+ ghost: "text-foreground";
59
+ link: "text-primary underline";
179
60
  };
180
61
  size: {
181
- default: string;
182
- sm: string;
183
- lg: string;
184
- icon: string;
62
+ default: "";
63
+ sm: "";
64
+ lg: "";
65
+ icon: "";
185
66
  };
186
- }, undefined, "font-medium text-center", import("tailwind-variants/dist/config.js").TVConfig<{
67
+ }, undefined, "font-medium text-center", {
187
68
  variant: {
188
- default: string;
189
- destructive: string;
190
- outline: string;
191
- secondary: string;
192
- ghost: string;
193
- link: string;
69
+ default: "text-primary-foreground";
70
+ destructive: "text-destructive-foreground";
71
+ outline: "text-foreground";
72
+ secondary: "text-secondary-foreground";
73
+ ghost: "text-foreground";
74
+ link: "text-primary underline";
194
75
  };
195
76
  size: {
196
- default: string;
197
- sm: string;
198
- lg: string;
199
- icon: string;
77
+ default: "";
78
+ sm: "";
79
+ lg: "";
80
+ icon: "";
200
81
  };
201
- }, {
82
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
202
83
  variant: {
203
- default: string;
204
- destructive: string;
205
- outline: string;
206
- secondary: string;
207
- ghost: string;
208
- link: string;
84
+ default: "text-primary-foreground";
85
+ destructive: "text-destructive-foreground";
86
+ outline: "text-foreground";
87
+ secondary: "text-secondary-foreground";
88
+ ghost: "text-foreground";
89
+ link: "text-primary underline";
209
90
  };
210
91
  size: {
211
- default: string;
212
- sm: string;
213
- lg: string;
214
- icon: string;
92
+ default: "";
93
+ sm: "";
94
+ lg: "";
95
+ icon: "";
215
96
  };
216
- }>, unknown, unknown, undefined>>;
97
+ }, undefined>>;
217
98
  export interface ButtonProps extends Omit<PressableProps, 'children' | 'feedback' | 'loading'>, VariantProps<typeof buttonVariants> {
218
99
  children?: React.ReactNode;
219
100
  className?: string;
@@ -229,7 +110,7 @@ export interface ButtonTextProps extends TextProps {
229
110
  export interface ButtonIconProps extends ViewProps {
230
111
  className?: string;
231
112
  }
232
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<View>>;
113
+ declare const Button: ForwardRefComponent<PressableInstance, ButtonProps>;
233
114
  declare function ButtonText({ className, variant: variantProp, size: sizeProp, style, ...props }: ButtonTextProps): React.JSX.Element;
234
115
  declare namespace ButtonText {
235
116
  var displayName: string;