@makolabs/ripple 0.0.1-dev.7 → 0.0.1-dev.8

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 (114) hide show
  1. package/README.md +393 -53
  2. package/dist/button/Button.svelte +5 -3
  3. package/dist/button/Button.svelte.d.ts +1 -1
  4. package/dist/button/button.d.ts +40 -63
  5. package/dist/button/button.js +15 -14
  6. package/dist/charts/Chart.svelte +533 -0
  7. package/dist/charts/Chart.svelte.d.ts +4 -0
  8. package/dist/drawer/Drawer.svelte +13 -2
  9. package/dist/drawer/Drawer.svelte.d.ts +1 -1
  10. package/dist/drawer/drawer.d.ts +0 -17
  11. package/dist/elements/alert/Alert.svelte +53 -0
  12. package/dist/elements/alert/Alert.svelte.d.ts +4 -0
  13. package/dist/elements/badge/Badge.svelte +13 -5
  14. package/dist/elements/badge/Badge.svelte.d.ts +1 -1
  15. package/dist/elements/badge/badge.d.ts +0 -12
  16. package/dist/elements/dropdown/Dropdown.svelte +32 -37
  17. package/dist/elements/dropdown/Dropdown.svelte.d.ts +1 -1
  18. package/dist/elements/dropdown/Select.svelte +143 -59
  19. package/dist/elements/dropdown/Select.svelte.d.ts +1 -1
  20. package/dist/elements/dropdown/dropdown.d.ts +34 -57
  21. package/dist/elements/dropdown/dropdown.js +10 -4
  22. package/dist/elements/dropdown/select.d.ts +34 -54
  23. package/dist/elements/dropdown/select.js +22 -14
  24. package/dist/elements/file-upload/FileUpload.svelte +213 -0
  25. package/dist/elements/file-upload/FileUpload.svelte.d.ts +4 -0
  26. package/dist/elements/progress/Progress.svelte +87 -0
  27. package/dist/elements/progress/Progress.svelte.d.ts +4 -0
  28. package/dist/elements/timeline/Timeline.svelte +92 -0
  29. package/dist/elements/timeline/Timeline.svelte.d.ts +7 -0
  30. package/dist/forms/Checkbox.svelte +54 -0
  31. package/dist/forms/Checkbox.svelte.d.ts +4 -0
  32. package/dist/forms/DateRange.svelte +493 -0
  33. package/dist/forms/DateRange.svelte.d.ts +4 -0
  34. package/dist/forms/Form.svelte +39 -0
  35. package/dist/forms/Form.svelte.d.ts +4 -0
  36. package/dist/forms/Input.svelte +86 -0
  37. package/dist/forms/Input.svelte.d.ts +4 -0
  38. package/dist/forms/NumberInput.svelte +159 -0
  39. package/dist/forms/NumberInput.svelte.d.ts +4 -0
  40. package/dist/forms/RadioInputs.svelte +64 -0
  41. package/dist/forms/RadioInputs.svelte.d.ts +4 -0
  42. package/dist/forms/RadioPill.svelte +66 -0
  43. package/dist/forms/RadioPill.svelte.d.ts +4 -0
  44. package/dist/forms/Slider.svelte +342 -0
  45. package/dist/forms/Slider.svelte.d.ts +4 -0
  46. package/dist/forms/Tags.svelte +181 -0
  47. package/dist/forms/Tags.svelte.d.ts +4 -0
  48. package/dist/forms/Toggle.svelte +132 -0
  49. package/dist/forms/Toggle.svelte.d.ts +4 -0
  50. package/dist/forms/slider.d.ts +143 -0
  51. package/dist/forms/slider.js +62 -0
  52. package/dist/header/Breadcrumbs.svelte +2 -1
  53. package/dist/header/Breadcrumbs.svelte.d.ts +1 -1
  54. package/dist/header/PageHeader.svelte +2 -2
  55. package/dist/header/PageHeader.svelte.d.ts +1 -1
  56. package/dist/header/breadcrumbs.d.ts +20 -14
  57. package/dist/header/breadcrumbs.js +6 -0
  58. package/dist/header/pageheaders.d.ts +1 -1
  59. package/dist/helper/date.d.ts +7 -0
  60. package/dist/helper/date.js +15 -0
  61. package/dist/index.d.ts +742 -9
  62. package/dist/index.js +59 -16
  63. package/dist/layout/card/Card.svelte +5 -8
  64. package/dist/layout/card/Card.svelte.d.ts +1 -1
  65. package/dist/layout/card/StatsCard.svelte +116 -87
  66. package/dist/layout/card/card.d.ts +22 -33
  67. package/dist/layout/card/card.js +9 -8
  68. package/dist/layout/card/stats-card.d.ts +23 -25
  69. package/dist/layout/card/stats-card.js +13 -13
  70. package/dist/layout/navbar/navbar.d.ts +0 -23
  71. package/dist/layout/sidebar/NavGroup.svelte +20 -44
  72. package/dist/layout/sidebar/NavGroup.svelte.d.ts +1 -1
  73. package/dist/layout/sidebar/NavItem.svelte +1 -1
  74. package/dist/layout/sidebar/NavItem.svelte.d.ts +1 -1
  75. package/dist/layout/sidebar/Sidebar.svelte +19 -25
  76. package/dist/layout/sidebar/Sidebar.svelte.d.ts +1 -1
  77. package/dist/layout/table/table.d.ts +1 -1
  78. package/dist/layout/tabs/tabs.d.ts +1 -1
  79. package/dist/modal/Modal.svelte +2 -1
  80. package/dist/modal/Modal.svelte.d.ts +1 -1
  81. package/dist/modal/modal.d.ts +0 -23
  82. package/dist/sonner/sonner.svelte +13 -0
  83. package/dist/sonner/sonner.svelte.d.ts +4 -0
  84. package/dist/types/variants.d.ts +1 -21
  85. package/dist/types/variants.js +1 -19
  86. package/dist/variants.d.ts +20 -0
  87. package/dist/variants.js +19 -0
  88. package/package.json +6 -2
  89. package/dist/button/index.d.ts +0 -1
  90. package/dist/button/index.js +0 -1
  91. package/dist/drawer/index.d.ts +0 -2
  92. package/dist/drawer/index.js +0 -1
  93. package/dist/elements/badge/index.d.ts +0 -2
  94. package/dist/elements/badge/index.js +0 -2
  95. package/dist/elements/dropdown/index.d.ts +0 -3
  96. package/dist/elements/dropdown/index.js +0 -2
  97. package/dist/header/index.d.ts +0 -4
  98. package/dist/header/index.js +0 -2
  99. package/dist/layout/card/index.d.ts +0 -4
  100. package/dist/layout/card/index.js +0 -2
  101. package/dist/layout/index.d.ts +0 -5
  102. package/dist/layout/index.js +0 -5
  103. package/dist/layout/navbar/index.d.ts +0 -2
  104. package/dist/layout/navbar/index.js +0 -2
  105. package/dist/layout/sidebar/index.d.ts +0 -2
  106. package/dist/layout/sidebar/index.js +0 -1
  107. package/dist/layout/sidebar/sidebar.d.ts +0 -46
  108. package/dist/layout/sidebar/sidebar.js +0 -1
  109. package/dist/layout/table/index.d.ts +0 -3
  110. package/dist/layout/table/index.js +0 -2
  111. package/dist/layout/tabs/index.d.ts +0 -3
  112. package/dist/layout/tabs/index.js +0 -3
  113. package/dist/modal/index.d.ts +0 -1
  114. package/dist/modal/index.js +0 -1
@@ -1,6 +1,4 @@
1
- import type { Component, Snippet } from 'svelte';
2
- import type { ClassValue } from 'tailwind-variants';
3
- import { type VariantSizes } from '../../types/variants.js';
1
+ import { Size } from '../../variants.js';
4
2
  export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
5
3
  position: {
6
4
  'top-left': {
@@ -17,7 +15,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
17
15
  };
18
16
  };
19
17
  size: {
20
- xs: {
18
+ [Size.XS]: {
21
19
  trigger: string;
22
20
  item: string;
23
21
  itemIcon: string;
@@ -25,7 +23,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
25
23
  headerTitle: string;
26
24
  headerSubtitle: string;
27
25
  };
28
- sm: {
26
+ [Size.SM]: {
29
27
  trigger: string;
30
28
  item: string;
31
29
  itemIcon: string;
@@ -33,7 +31,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
33
31
  headerTitle: string;
34
32
  headerSubtitle: string;
35
33
  };
36
- base: {
34
+ [Size.BASE]: {
37
35
  trigger: string;
38
36
  item: string;
39
37
  itemIcon: string;
@@ -41,7 +39,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
41
39
  headerTitle: string;
42
40
  headerSubtitle: string;
43
41
  };
44
- lg: {
42
+ [Size.LG]: {
45
43
  trigger: string;
46
44
  item: string;
47
45
  itemIcon: string;
@@ -49,7 +47,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
49
47
  headerTitle: string;
50
48
  headerSubtitle: string;
51
49
  };
52
- xl: {
50
+ [Size.XL]: {
53
51
  trigger: string;
54
52
  item: string;
55
53
  itemIcon: string;
@@ -57,7 +55,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
57
55
  headerTitle: string;
58
56
  headerSubtitle: string;
59
57
  };
60
- "2xl": {
58
+ [Size.XXL]: {
61
59
  trigger: string;
62
60
  item: string;
63
61
  itemIcon: string;
@@ -69,6 +67,11 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
69
67
  isOpen: {
70
68
  true: {};
71
69
  };
70
+ iconOnly: {
71
+ true: {
72
+ trigger: string;
73
+ };
74
+ };
72
75
  }, {
73
76
  base: string;
74
77
  trigger: string;
@@ -95,7 +98,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
95
98
  };
96
99
  };
97
100
  size: {
98
- xs: {
101
+ [Size.XS]: {
99
102
  trigger: string;
100
103
  item: string;
101
104
  itemIcon: string;
@@ -103,7 +106,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
103
106
  headerTitle: string;
104
107
  headerSubtitle: string;
105
108
  };
106
- sm: {
109
+ [Size.SM]: {
107
110
  trigger: string;
108
111
  item: string;
109
112
  itemIcon: string;
@@ -111,7 +114,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
111
114
  headerTitle: string;
112
115
  headerSubtitle: string;
113
116
  };
114
- base: {
117
+ [Size.BASE]: {
115
118
  trigger: string;
116
119
  item: string;
117
120
  itemIcon: string;
@@ -119,7 +122,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
119
122
  headerTitle: string;
120
123
  headerSubtitle: string;
121
124
  };
122
- lg: {
125
+ [Size.LG]: {
123
126
  trigger: string;
124
127
  item: string;
125
128
  itemIcon: string;
@@ -127,7 +130,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
127
130
  headerTitle: string;
128
131
  headerSubtitle: string;
129
132
  };
130
- xl: {
133
+ [Size.XL]: {
131
134
  trigger: string;
132
135
  item: string;
133
136
  itemIcon: string;
@@ -135,7 +138,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
135
138
  headerTitle: string;
136
139
  headerSubtitle: string;
137
140
  };
138
- "2xl": {
141
+ [Size.XXL]: {
139
142
  trigger: string;
140
143
  item: string;
141
144
  itemIcon: string;
@@ -147,6 +150,11 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
147
150
  isOpen: {
148
151
  true: {};
149
152
  };
153
+ iconOnly: {
154
+ true: {
155
+ trigger: string;
156
+ };
157
+ };
150
158
  }, {
151
159
  base: string;
152
160
  trigger: string;
@@ -173,7 +181,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
173
181
  };
174
182
  };
175
183
  size: {
176
- xs: {
184
+ [Size.XS]: {
177
185
  trigger: string;
178
186
  item: string;
179
187
  itemIcon: string;
@@ -181,7 +189,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
181
189
  headerTitle: string;
182
190
  headerSubtitle: string;
183
191
  };
184
- sm: {
192
+ [Size.SM]: {
185
193
  trigger: string;
186
194
  item: string;
187
195
  itemIcon: string;
@@ -189,7 +197,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
189
197
  headerTitle: string;
190
198
  headerSubtitle: string;
191
199
  };
192
- base: {
200
+ [Size.BASE]: {
193
201
  trigger: string;
194
202
  item: string;
195
203
  itemIcon: string;
@@ -197,7 +205,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
197
205
  headerTitle: string;
198
206
  headerSubtitle: string;
199
207
  };
200
- lg: {
208
+ [Size.LG]: {
201
209
  trigger: string;
202
210
  item: string;
203
211
  itemIcon: string;
@@ -205,7 +213,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
205
213
  headerTitle: string;
206
214
  headerSubtitle: string;
207
215
  };
208
- xl: {
216
+ [Size.XL]: {
209
217
  trigger: string;
210
218
  item: string;
211
219
  itemIcon: string;
@@ -213,7 +221,7 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
213
221
  headerTitle: string;
214
222
  headerSubtitle: string;
215
223
  };
216
- "2xl": {
224
+ [Size.XXL]: {
217
225
  trigger: string;
218
226
  item: string;
219
227
  itemIcon: string;
@@ -225,6 +233,11 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
225
233
  isOpen: {
226
234
  true: {};
227
235
  };
236
+ iconOnly: {
237
+ true: {
238
+ trigger: string;
239
+ };
240
+ };
228
241
  }, {
229
242
  base: string;
230
243
  trigger: string;
@@ -236,39 +249,3 @@ export declare const dropdownMenu: import("tailwind-variants").TVReturnType<{
236
249
  item: string;
237
250
  itemIcon: string;
238
251
  }, undefined, unknown, unknown, undefined>>;
239
- export type DropdownItem = {
240
- label: string;
241
- href?: string;
242
- icon?: Component;
243
- onclick?: () => void;
244
- active?: boolean;
245
- disabled?: boolean;
246
- };
247
- export type DropSection = {
248
- items: DropdownItem[];
249
- };
250
- export type DropHeaderConfig = {
251
- title?: string;
252
- subtitle?: string;
253
- content?: Snippet<[]>;
254
- class?: ClassValue;
255
- titleClass?: ClassValue;
256
- subtitleClass?: ClassValue;
257
- onclick?: () => void;
258
- };
259
- export type DropdownMenuProps = {
260
- open?: boolean;
261
- sections: DropSection[];
262
- label?: string;
263
- icon?: Component;
264
- triggerContent?: Snippet<[]>;
265
- triggerClass?: ClassValue;
266
- containerClass?: ClassValue;
267
- itemClass?: ClassValue;
268
- class?: ClassValue;
269
- size?: VariantSizes;
270
- disabled?: boolean;
271
- position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
272
- width?: string;
273
- header?: DropHeaderConfig;
274
- };
@@ -1,15 +1,15 @@
1
1
  import { tv } from '../../helper/cls.js';
2
- import { Size } from '../../types/variants.js';
2
+ import { Size } from '../../variants.js';
3
3
  export const dropdownMenu = tv({
4
4
  slots: {
5
5
  base: 'relative inline-block text-left',
6
- trigger: 'inline-flex w-full justify-center items-center gap-x-1.5 rounded-md bg-white px-3 py-2 text-sm font-semibold text-default-900 shadow-xs ring-1 ring-inset ring-default-300 hover:bg-default-50',
6
+ trigger: 'inline-flex w-full justify-center items-center gap-x-1.5 rounded-md bg-white px-3 py-2 text-sm font-semibold text-default-900 shadow-xs ring-1 ring-inset ring-default-300 hover:bg-default-50 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed',
7
7
  container: 'absolute z-50 mt-2 origin-top-right divide-y divide-default-100 rounded-md bg-white ring-1 ring-black/5 shadow-lg focus:outline-none',
8
8
  section: 'py-1',
9
9
  header: 'flex flex-col px-4 py-2 w-full items-start',
10
10
  headerTitle: 'text-sm font-medium text-default-900',
11
11
  headerSubtitle: 'text-sm text-default-500',
12
- item: 'w-full group flex items-center px-4 py-2 text-sm text-default-700 hover:bg-default-100 hover:text-default-900 data-[active=true]:bg-default-100 data-[active=true]:text-default-900',
12
+ item: 'w-full group flex items-center px-4 py-2 text-sm text-default-700 hover:bg-default-100 hover:text-default-900 data-[active=true]:bg-default-100 data-[active=true]:text-default-900 disabled:opacity-50 disabled:cursor-not-allowed',
13
13
  itemIcon: 'mr-3 size-5 text-default-400 group-hover:text-default-500 group-data-[active=true]:text-default-500'
14
14
  },
15
15
  variants: {
@@ -79,11 +79,17 @@ export const dropdownMenu = tv({
79
79
  },
80
80
  isOpen: {
81
81
  true: {}
82
+ },
83
+ iconOnly: {
84
+ true: {
85
+ trigger: 'inline-flex justify-center items-center cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed bg-transparent shadow-none ring-0 hover:bg-transparent'
86
+ }
82
87
  }
83
88
  },
84
89
  defaultVariants: {
85
90
  position: 'bottom-right',
86
91
  size: Size.BASE,
87
- isOpen: false
92
+ isOpen: false,
93
+ iconOnly: false
88
94
  }
89
95
  });
@@ -1,44 +1,42 @@
1
- import type { ClassValue } from 'tailwind-variants';
2
- import type { VariantSizes } from '../../types/variants.js';
3
- import type { Component, Snippet } from 'svelte';
1
+ import { Size } from '../../variants.js';
4
2
  export declare const selectTV: import("tailwind-variants").TVReturnType<{
5
3
  size: {
6
- xs: {
4
+ [Size.XS]: {
7
5
  trigger: string;
8
6
  triggerIcon: string;
9
7
  container: string;
10
8
  item: string;
11
9
  base: string;
12
10
  };
13
- sm: {
11
+ [Size.SM]: {
14
12
  trigger: string;
15
13
  triggerIcon: string;
16
14
  container: string;
17
15
  item: string;
18
16
  base: string;
19
17
  };
20
- base: {
18
+ [Size.BASE]: {
21
19
  trigger: string;
22
20
  triggerIcon: string;
23
21
  container: string;
24
22
  item: string;
25
23
  base: string;
26
24
  };
27
- lg: {
25
+ [Size.LG]: {
28
26
  trigger: string;
29
27
  triggerIcon: string;
30
28
  container: string;
31
29
  item: string;
32
30
  base: string;
33
31
  };
34
- xl: {
32
+ [Size.XL]: {
35
33
  trigger: string;
36
34
  triggerIcon: string;
37
35
  container: string;
38
36
  item: string;
39
37
  base: string;
40
38
  };
41
- '2xl': {
39
+ [Size.XXL]: {
42
40
  trigger: string;
43
41
  triggerIcon: string;
44
42
  container: string;
@@ -53,6 +51,11 @@ export declare const selectTV: import("tailwind-variants").TVReturnType<{
53
51
  item: string;
54
52
  };
55
53
  };
54
+ multiple: {
55
+ true: {
56
+ trigger: string;
57
+ };
58
+ };
56
59
  }, {
57
60
  base: string;
58
61
  trigger: string;
@@ -64,42 +67,42 @@ export declare const selectTV: import("tailwind-variants").TVReturnType<{
64
67
  emptyMessage: string;
65
68
  }, undefined, {
66
69
  size: {
67
- xs: {
70
+ [Size.XS]: {
68
71
  trigger: string;
69
72
  triggerIcon: string;
70
73
  container: string;
71
74
  item: string;
72
75
  base: string;
73
76
  };
74
- sm: {
77
+ [Size.SM]: {
75
78
  trigger: string;
76
79
  triggerIcon: string;
77
80
  container: string;
78
81
  item: string;
79
82
  base: string;
80
83
  };
81
- base: {
84
+ [Size.BASE]: {
82
85
  trigger: string;
83
86
  triggerIcon: string;
84
87
  container: string;
85
88
  item: string;
86
89
  base: string;
87
90
  };
88
- lg: {
91
+ [Size.LG]: {
89
92
  trigger: string;
90
93
  triggerIcon: string;
91
94
  container: string;
92
95
  item: string;
93
96
  base: string;
94
97
  };
95
- xl: {
98
+ [Size.XL]: {
96
99
  trigger: string;
97
100
  triggerIcon: string;
98
101
  container: string;
99
102
  item: string;
100
103
  base: string;
101
104
  };
102
- '2xl': {
105
+ [Size.XXL]: {
103
106
  trigger: string;
104
107
  triggerIcon: string;
105
108
  container: string;
@@ -114,6 +117,11 @@ export declare const selectTV: import("tailwind-variants").TVReturnType<{
114
117
  item: string;
115
118
  };
116
119
  };
120
+ multiple: {
121
+ true: {
122
+ trigger: string;
123
+ };
124
+ };
117
125
  }, {
118
126
  base: string;
119
127
  trigger: string;
@@ -125,42 +133,42 @@ export declare const selectTV: import("tailwind-variants").TVReturnType<{
125
133
  emptyMessage: string;
126
134
  }, import("tailwind-variants").TVReturnType<{
127
135
  size: {
128
- xs: {
136
+ [Size.XS]: {
129
137
  trigger: string;
130
138
  triggerIcon: string;
131
139
  container: string;
132
140
  item: string;
133
141
  base: string;
134
142
  };
135
- sm: {
143
+ [Size.SM]: {
136
144
  trigger: string;
137
145
  triggerIcon: string;
138
146
  container: string;
139
147
  item: string;
140
148
  base: string;
141
149
  };
142
- base: {
150
+ [Size.BASE]: {
143
151
  trigger: string;
144
152
  triggerIcon: string;
145
153
  container: string;
146
154
  item: string;
147
155
  base: string;
148
156
  };
149
- lg: {
157
+ [Size.LG]: {
150
158
  trigger: string;
151
159
  triggerIcon: string;
152
160
  container: string;
153
161
  item: string;
154
162
  base: string;
155
163
  };
156
- xl: {
164
+ [Size.XL]: {
157
165
  trigger: string;
158
166
  triggerIcon: string;
159
167
  container: string;
160
168
  item: string;
161
169
  base: string;
162
170
  };
163
- '2xl': {
171
+ [Size.XXL]: {
164
172
  trigger: string;
165
173
  triggerIcon: string;
166
174
  container: string;
@@ -175,6 +183,11 @@ export declare const selectTV: import("tailwind-variants").TVReturnType<{
175
183
  item: string;
176
184
  };
177
185
  };
186
+ multiple: {
187
+ true: {
188
+ trigger: string;
189
+ };
190
+ };
178
191
  }, {
179
192
  base: string;
180
193
  trigger: string;
@@ -185,36 +198,3 @@ export declare const selectTV: import("tailwind-variants").TVReturnType<{
185
198
  item: string;
186
199
  emptyMessage: string;
187
200
  }, undefined, unknown, unknown, undefined>>;
188
- export type SelectItem = {
189
- label: string;
190
- value: string;
191
- disabled?: boolean;
192
- icon?: Component;
193
- };
194
- export type SelectProps = {
195
- items: SelectItem[];
196
- value?: string;
197
- placeholder?: string;
198
- searchable?: boolean;
199
- disabled?: boolean;
200
- size?: VariantSizes;
201
- class?: ClassValue;
202
- triggerClass?: ClassValue;
203
- containerClass?: ClassValue;
204
- listClass?: ClassValue;
205
- itemClass?: ClassValue;
206
- searchInputClass?: ClassValue;
207
- emptyMessageText?: string;
208
- clearable?: boolean;
209
- icon?: Component;
210
- iconClass?: ClassValue;
211
- triggerContent?: Snippet<[{
212
- selectedItem?: SelectItem;
213
- open: boolean;
214
- }]>;
215
- onselect?: ({ value }: {
216
- value?: string;
217
- }) => void;
218
- onopen?: () => void;
219
- onclose?: () => void;
220
- };
@@ -1,57 +1,59 @@
1
1
  import { tv } from 'tailwind-variants';
2
+ import { Size } from '../../variants.js';
2
3
  export const selectTV = tv({
3
4
  slots: {
4
5
  base: 'relative inline-block',
5
- trigger: `flex items-center justify-between w-full text-left focus:outline-none bg-white border
6
+ trigger: `flex items-center justify-between w-full text-left bg-white border
6
7
  border-default-200 text-default-700 hover:border-default-300 rounded-md cursor-pointer`,
7
8
  triggerIcon: 'transition-transform duration-200 text-default-500',
8
9
  container: 'absolute z-50 w-full mt-1 bg-white overflow-clip border border-default-200 rounded-md shadow-md',
9
- searchInput: 'w-full outline-none px-2 py-1.5 text-sm h-10 border-b border-b-default-200',
10
- list: 'py-1 max-h-60 overflow-auto h-full',
11
- item: `w-full px-3 py-2 text-sm text-left hover:bg-default-100 focus:bg-default-100
12
- data-[selected=true]:bg-info-100 data-[selected=true]:text-info-500 truncate
13
- data-[selected=true]:font-medium cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed
14
- data-[highlighted=true]:bg-default-100 data-[highlighted=true]:text-default-700`,
10
+ searchInput: 'flex items-center gap-x-3 w-full outline-none px-2 h-10 border-b border-b-default-200',
11
+ list: 'py-1 max-h-60 overflow-x-clip overflow-y-auto h-full',
12
+ item: `w-full px-3 py-2 text-sm text-left
13
+ data-[highlighted=true]:bg-default-100 data-[highlighted=true]:text-default-700
14
+ data-[selected=true]:bg-info-100 data-[selected=true]:text-info-500 data-[selected=true]:font-medium
15
+ data-[selected=true]:data-[highlighted=true]:bg-info-200 data-[selected=true]:data-[highlighted=true]:text-info-500
16
+ cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,
15
17
  emptyMessage: 'px-3 py-2 text-sm text-default-500'
16
18
  },
17
19
  variants: {
18
20
  size: {
19
- xs: {
21
+ [Size.XS]: {
20
22
  trigger: 'h-6 px-2 py-1 text-xs gap-1',
21
23
  triggerIcon: 'h-3 w-3',
22
24
  container: 'max-h-40',
23
25
  item: 'px-2 py-1 text-xs',
24
26
  base: 'w-24'
25
27
  },
26
- sm: {
28
+ [Size.SM]: {
27
29
  trigger: 'h-8 px-2.5 py-1.5 text-xs gap-1.5',
28
30
  triggerIcon: 'h-3.5 w-3.5',
29
31
  container: 'max-h-48',
30
32
  item: 'px-2.5 py-1.5 text-xs',
31
33
  base: 'w-32'
32
34
  },
33
- base: {
35
+ [Size.BASE]: {
34
36
  trigger: 'h-10 px-3 py-2 text-sm gap-2',
35
37
  triggerIcon: 'h-4 w-4',
36
38
  container: 'max-h-60',
37
39
  item: 'px-3 py-2 text-sm',
38
40
  base: 'w-40'
39
41
  },
40
- lg: {
42
+ [Size.LG]: {
41
43
  trigger: 'h-11 px-4 py-2.5 text-base gap-2.5',
42
44
  triggerIcon: 'h-5 w-5',
43
45
  container: 'max-h-72',
44
46
  item: 'px-4 py-2.5 text-base',
45
47
  base: 'w-48'
46
48
  },
47
- xl: {
49
+ [Size.XL]: {
48
50
  trigger: 'h-12 px-5 py-3 text-lg gap-3',
49
51
  triggerIcon: 'h-6 w-6',
50
52
  container: 'max-h-80',
51
53
  item: 'px-5 py-3 text-lg',
52
54
  base: 'w-56'
53
55
  },
54
- '2xl': {
56
+ [Size.XXL]: {
55
57
  trigger: 'h-14 px-6 py-3.5 text-xl gap-4',
56
58
  triggerIcon: 'h-7 w-7',
57
59
  container: 'max-h-96',
@@ -65,10 +67,16 @@ export const selectTV = tv({
65
67
  container: 'pointer-events-none',
66
68
  item: 'disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent'
67
69
  }
70
+ },
71
+ multiple: {
72
+ true: {
73
+ trigger: 'flex-wrap min-h-[2.5rem]'
74
+ }
68
75
  }
69
76
  },
70
77
  defaultVariants: {
71
78
  size: 'base',
72
- disabled: false
79
+ disabled: false,
80
+ multiple: false
73
81
  }
74
82
  });