@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,7 +1,7 @@
1
- import React from 'react';
2
- import { View, type ViewProps } from 'react-native';
1
+ import { type ViewInstance, type ViewProps } from 'react-native';
2
+ import type { ForwardRefComponent } from '../../lib/ref-types';
3
3
  export interface SeparatorProps extends ViewProps {
4
4
  orientation?: 'horizontal' | 'vertical';
5
5
  }
6
- declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<View>>;
6
+ declare const Separator: ForwardRefComponent<ViewInstance, SeparatorProps>;
7
7
  export { Separator };
@@ -2,40 +2,20 @@ import { type ViewProps } from 'react-native';
2
2
  import { type VariantProps } from '../../lib/tv';
3
3
  declare const skeletonVariants: import("tailwind-variants").TVReturnType<{
4
4
  variant: {
5
- pulse: string;
6
- shimmer: string;
5
+ pulse: "";
6
+ shimmer: "";
7
7
  };
8
- }, undefined, "bg-muted", import("tailwind-variants/dist/config.js").TVConfig<{
8
+ }, undefined, "bg-muted", {
9
9
  variant: {
10
- pulse: string;
11
- shimmer: string;
10
+ pulse: "";
11
+ shimmer: "";
12
12
  };
13
- }, {
13
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
14
14
  variant: {
15
- pulse: string;
16
- shimmer: string;
15
+ pulse: "";
16
+ shimmer: "";
17
17
  };
18
- }>, {
19
- variant: {
20
- pulse: string;
21
- shimmer: string;
22
- };
23
- }, undefined, import("tailwind-variants").TVReturnType<{
24
- variant: {
25
- pulse: string;
26
- shimmer: string;
27
- };
28
- }, undefined, "bg-muted", import("tailwind-variants/dist/config.js").TVConfig<{
29
- variant: {
30
- pulse: string;
31
- shimmer: string;
32
- };
33
- }, {
34
- variant: {
35
- pulse: string;
36
- shimmer: string;
37
- };
38
- }>, unknown, unknown, undefined>>;
18
+ }, undefined>>;
39
19
  export interface SkeletonProps extends ViewProps, VariantProps<typeof skeletonVariants> {
40
20
  className?: string;
41
21
  }
@@ -2,47 +2,23 @@ import { type ActivityIndicatorProps } from 'react-native';
2
2
  import { type VariantProps } from '../../lib/tv';
3
3
  declare const spinnerVariants: import("tailwind-variants").TVReturnType<{
4
4
  size: {
5
- sm: string;
6
- default: string;
7
- lg: string;
5
+ sm: "";
6
+ default: "";
7
+ lg: "";
8
8
  };
9
- }, undefined, "", import("tailwind-variants/dist/config.js").TVConfig<{
9
+ }, undefined, "", {
10
10
  size: {
11
- sm: string;
12
- default: string;
13
- lg: string;
11
+ sm: "";
12
+ default: "";
13
+ lg: "";
14
14
  };
15
- }, {
15
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
16
16
  size: {
17
- sm: string;
18
- default: string;
19
- lg: string;
17
+ sm: "";
18
+ default: "";
19
+ lg: "";
20
20
  };
21
- }>, {
22
- size: {
23
- sm: string;
24
- default: string;
25
- lg: string;
26
- };
27
- }, undefined, import("tailwind-variants").TVReturnType<{
28
- size: {
29
- sm: string;
30
- default: string;
31
- lg: string;
32
- };
33
- }, undefined, "", import("tailwind-variants/dist/config.js").TVConfig<{
34
- size: {
35
- sm: string;
36
- default: string;
37
- lg: string;
38
- };
39
- }, {
40
- size: {
41
- sm: string;
42
- default: string;
43
- lg: string;
44
- };
45
- }>, unknown, unknown, undefined>>;
21
+ }, undefined>>;
46
22
  export interface SpinnerProps extends Omit<ActivityIndicatorProps, 'size'>, VariantProps<typeof spinnerVariants> {
47
23
  className?: string;
48
24
  }
@@ -1,184 +1,84 @@
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 stackVariants: import("tailwind-variants").TVReturnType<{
5
5
  gap: {
6
- none: string;
7
- xs: string;
8
- sm: string;
9
- md: string;
10
- lg: string;
11
- xl: string;
12
- '2xl': string;
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: string;
16
- center: string;
17
- end: string;
18
- stretch: string;
19
- baseline: string;
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: string;
23
- center: string;
24
- end: string;
25
- between: string;
26
- around: string;
27
- evenly: string;
28
- };
29
- }, undefined, "flex-col", import("tailwind-variants/dist/config.js").TVConfig<{
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-col", {
55
30
  gap: {
56
- none: string;
57
- xs: string;
58
- sm: string;
59
- md: string;
60
- lg: string;
61
- xl: string;
62
- '2xl': string;
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: string;
66
- center: string;
67
- end: string;
68
- stretch: string;
69
- baseline: string;
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: string;
73
- center: string;
74
- end: string;
75
- between: string;
76
- around: string;
77
- evenly: string;
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: string;
107
- xs: string;
108
- sm: string;
109
- md: string;
110
- lg: string;
111
- xl: string;
112
- '2xl': string;
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: string;
116
- center: string;
117
- end: string;
118
- stretch: string;
119
- baseline: string;
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: string;
123
- center: string;
124
- end: string;
125
- between: string;
126
- around: string;
127
- evenly: string;
128
- };
129
- }, undefined, "flex-col", import("tailwind-variants/dist/config.js").TVConfig<{
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 StackProps extends Omit<ViewProps, 'className'>, VariantProps<typeof stackVariants> {
181
81
  className?: string;
182
82
  }
183
- declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<View>>;
83
+ declare const Stack: ForwardRefComponent<ViewInstance, StackProps>;
184
84
  export { Stack, stackVariants };
@@ -2,40 +2,20 @@ import { type ReactNode } from 'react';
2
2
  import { type ViewProps, type PressableProps } from 'react-native';
3
3
  declare const tabsTriggerVariants: import("tailwind-variants").TVReturnType<{
4
4
  state: {
5
- active: string;
6
- inactive: string;
5
+ active: "text-foreground";
6
+ inactive: "text-muted-foreground";
7
7
  };
8
- }, undefined, "inline-flex items-center justify-center whitespace-nowrap font-medium", import("tailwind-variants/dist/config.js").TVConfig<{
8
+ }, undefined, "inline-flex items-center justify-center whitespace-nowrap font-medium", {
9
9
  state: {
10
- active: string;
11
- inactive: string;
10
+ active: "text-foreground";
11
+ inactive: "text-muted-foreground";
12
12
  };
13
- }, {
13
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
14
14
  state: {
15
- active: string;
16
- inactive: string;
15
+ active: "text-foreground";
16
+ inactive: "text-muted-foreground";
17
17
  };
18
- }>, {
19
- state: {
20
- active: string;
21
- inactive: string;
22
- };
23
- }, undefined, import("tailwind-variants").TVReturnType<{
24
- state: {
25
- active: string;
26
- inactive: string;
27
- };
28
- }, undefined, "inline-flex items-center justify-center whitespace-nowrap font-medium", import("tailwind-variants/dist/config.js").TVConfig<{
29
- state: {
30
- active: string;
31
- inactive: string;
32
- };
33
- }, {
34
- state: {
35
- active: string;
36
- inactive: string;
37
- };
38
- }>, unknown, unknown, undefined>>;
18
+ }, undefined>>;
39
19
  export interface TabsProps extends ViewProps {
40
20
  defaultValue: string;
41
21
  value?: string;
@@ -1,148 +1,68 @@
1
- import React from 'react';
2
- import { Text as RNText, type TextProps as RNTextProps } from 'react-native';
1
+ import { type TextInstance, type TextProps as RNTextProps } from 'react-native';
3
2
  import { type VariantProps } from '../../lib/tv';
3
+ import type { ForwardRefComponent } from '../../lib/ref-types';
4
4
  declare const textVariants: import("tailwind-variants").TVReturnType<{
5
5
  variant: {
6
- default: string;
7
- heading: string;
8
- title: string;
9
- subtitle: string;
10
- body: string;
11
- caption: string;
12
- label: string;
13
- code: string;
6
+ default: "font-normal";
7
+ heading: "text-2xl font-bold tracking-tight";
8
+ title: "text-xl font-semibold";
9
+ subtitle: "text-lg font-medium";
10
+ body: "text-base font-normal";
11
+ caption: "text-sm text-muted-foreground font-normal";
12
+ label: "text-sm font-medium leading-tight";
13
+ code: "font-mono text-sm bg-muted rounded px-1 py-0.5";
14
14
  };
15
15
  size: {
16
- xs: string;
17
- sm: string;
18
- base: string;
19
- lg: string;
20
- xl: string;
21
- '2xl': string;
22
- '3xl': string;
16
+ xs: "text-xs";
17
+ sm: "text-sm";
18
+ base: "text-base";
19
+ lg: "text-lg";
20
+ xl: "text-xl";
21
+ '2xl': "text-2xl";
22
+ '3xl': "text-3xl";
23
23
  };
24
- }, undefined, "text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
24
+ }, undefined, "text-foreground", {
25
25
  variant: {
26
- default: string;
27
- heading: string;
28
- title: string;
29
- subtitle: string;
30
- body: string;
31
- caption: string;
32
- label: string;
33
- code: string;
26
+ default: "font-normal";
27
+ heading: "text-2xl font-bold tracking-tight";
28
+ title: "text-xl font-semibold";
29
+ subtitle: "text-lg font-medium";
30
+ body: "text-base font-normal";
31
+ caption: "text-sm text-muted-foreground font-normal";
32
+ label: "text-sm font-medium leading-tight";
33
+ code: "font-mono text-sm bg-muted rounded px-1 py-0.5";
34
34
  };
35
35
  size: {
36
- xs: string;
37
- sm: string;
38
- base: string;
39
- lg: string;
40
- xl: string;
41
- '2xl': string;
42
- '3xl': string;
36
+ xs: "text-xs";
37
+ sm: "text-sm";
38
+ base: "text-base";
39
+ lg: "text-lg";
40
+ xl: "text-xl";
41
+ '2xl': "text-2xl";
42
+ '3xl': "text-3xl";
43
43
  };
44
- }, {
44
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
45
45
  variant: {
46
- default: string;
47
- heading: string;
48
- title: string;
49
- subtitle: string;
50
- body: string;
51
- caption: string;
52
- label: string;
53
- code: string;
46
+ default: "font-normal";
47
+ heading: "text-2xl font-bold tracking-tight";
48
+ title: "text-xl font-semibold";
49
+ subtitle: "text-lg font-medium";
50
+ body: "text-base font-normal";
51
+ caption: "text-sm text-muted-foreground font-normal";
52
+ label: "text-sm font-medium leading-tight";
53
+ code: "font-mono text-sm bg-muted rounded px-1 py-0.5";
54
54
  };
55
55
  size: {
56
- xs: string;
57
- sm: string;
58
- base: string;
59
- lg: string;
60
- xl: string;
61
- '2xl': string;
62
- '3xl': string;
56
+ xs: "text-xs";
57
+ sm: "text-sm";
58
+ base: "text-base";
59
+ lg: "text-lg";
60
+ xl: "text-xl";
61
+ '2xl': "text-2xl";
62
+ '3xl': "text-3xl";
63
63
  };
64
- }>, {
65
- variant: {
66
- default: string;
67
- heading: string;
68
- title: string;
69
- subtitle: string;
70
- body: string;
71
- caption: string;
72
- label: string;
73
- code: string;
74
- };
75
- size: {
76
- xs: string;
77
- sm: string;
78
- base: string;
79
- lg: string;
80
- xl: string;
81
- '2xl': string;
82
- '3xl': string;
83
- };
84
- }, undefined, import("tailwind-variants").TVReturnType<{
85
- variant: {
86
- default: string;
87
- heading: string;
88
- title: string;
89
- subtitle: string;
90
- body: string;
91
- caption: string;
92
- label: string;
93
- code: string;
94
- };
95
- size: {
96
- xs: string;
97
- sm: string;
98
- base: string;
99
- lg: string;
100
- xl: string;
101
- '2xl': string;
102
- '3xl': string;
103
- };
104
- }, undefined, "text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
105
- variant: {
106
- default: string;
107
- heading: string;
108
- title: string;
109
- subtitle: string;
110
- body: string;
111
- caption: string;
112
- label: string;
113
- code: string;
114
- };
115
- size: {
116
- xs: string;
117
- sm: string;
118
- base: string;
119
- lg: string;
120
- xl: string;
121
- '2xl': string;
122
- '3xl': string;
123
- };
124
- }, {
125
- variant: {
126
- default: string;
127
- heading: string;
128
- title: string;
129
- subtitle: string;
130
- body: string;
131
- caption: string;
132
- label: string;
133
- code: string;
134
- };
135
- size: {
136
- xs: string;
137
- sm: string;
138
- base: string;
139
- lg: string;
140
- xl: string;
141
- '2xl': string;
142
- '3xl': string;
143
- };
144
- }>, unknown, unknown, undefined>>;
64
+ }, undefined>>;
145
65
  export interface TextProps extends RNTextProps, VariantProps<typeof textVariants> {
146
66
  }
147
- declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<RNText>>;
67
+ declare const Text: ForwardRefComponent<TextInstance, TextProps>;
148
68
  export { Text, textVariants };
@@ -1,51 +1,27 @@
1
- import React from 'react';
2
- import { TextInput, type TextInputProps } from 'react-native';
1
+ import { type TextInputInstance, type TextInputProps } from 'react-native';
3
2
  import { type VariantProps } from '../../lib/tv';
3
+ import type { ForwardRefComponent } from '../../lib/ref-types';
4
4
  declare const textareaVariants: import("tailwind-variants").TVReturnType<{
5
5
  size: {
6
- default: string;
7
- sm: string;
8
- lg: string;
6
+ default: "";
7
+ sm: "";
8
+ lg: "";
9
9
  };
10
- }, undefined, "w-full border-border bg-muted text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
10
+ }, undefined, "w-full border-border bg-muted text-foreground", {
11
11
  size: {
12
- default: string;
13
- sm: string;
14
- lg: string;
12
+ default: "";
13
+ sm: "";
14
+ lg: "";
15
15
  };
16
- }, {
16
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
17
17
  size: {
18
- default: string;
19
- sm: string;
20
- lg: string;
18
+ default: "";
19
+ sm: "";
20
+ lg: "";
21
21
  };
22
- }>, {
23
- size: {
24
- default: string;
25
- sm: string;
26
- lg: string;
27
- };
28
- }, undefined, import("tailwind-variants").TVReturnType<{
29
- size: {
30
- default: string;
31
- sm: string;
32
- lg: string;
33
- };
34
- }, undefined, "w-full border-border bg-muted text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
35
- size: {
36
- default: string;
37
- sm: string;
38
- lg: string;
39
- };
40
- }, {
41
- size: {
42
- default: string;
43
- sm: string;
44
- lg: string;
45
- };
46
- }>, unknown, unknown, undefined>>;
22
+ }, undefined>>;
47
23
  export interface TextareaProps extends Omit<TextInputProps, 'style'>, VariantProps<typeof textareaVariants> {
48
24
  className?: string;
49
25
  }
50
- declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<TextInput>>;
26
+ declare const Textarea: ForwardRefComponent<TextInputInstance, TextareaProps>;
51
27
  export { Textarea, textareaVariants };