odj-svelte-ui 0.2.0 → 0.2.2

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 (38) hide show
  1. package/README.md +10 -1
  2. package/dist/avatar/Avatar.svelte +43 -5
  3. package/dist/avatar/Avatar.svelte.d.ts +3 -1
  4. package/dist/avatar/index.d.ts +2 -2
  5. package/dist/avatar/index.js +2 -2
  6. package/dist/avatar/theme.d.ts +144 -3
  7. package/dist/avatar/theme.js +34 -4
  8. package/dist/avatar/type.d.ts +2 -0
  9. package/dist/dropdown/Dropdown.svelte +61 -12
  10. package/dist/dropdown/Dropdown.svelte.d.ts +6 -5
  11. package/dist/dropdown/DropdownLi.svelte +9 -3
  12. package/dist/dropdown/DropdownLi.svelte.d.ts +1 -0
  13. package/dist/dropdown/theme.d.ts +4 -12
  14. package/dist/dropdown/theme.js +7 -8
  15. package/dist/dropdown/type.d.ts +11 -5
  16. package/dist/forms/checkbox/Checkbox.svelte +34 -5
  17. package/dist/forms/checkbox/theme.js +26 -24
  18. package/dist/forms/checkbox/type.d.ts +1 -0
  19. package/dist/forms/toggle/theme.js +22 -22
  20. package/dist/nav/Navbar.svelte +13 -11
  21. package/dist/nav/theme.d.ts +6 -6
  22. package/dist/nav/theme.js +20 -20
  23. package/dist/sidebar/Sidebar.svelte +9 -54
  24. package/dist/sidebar/Sidebar.svelte.d.ts +0 -7
  25. package/dist/sidebar/SidebarGroup.svelte +8 -5
  26. package/dist/sidebar/SidebarGroup.svelte.d.ts +1 -2
  27. package/dist/sidebar/SidebarItem.svelte +1 -1
  28. package/dist/sidebar/index.d.ts +3 -4
  29. package/dist/sidebar/index.js +2 -3
  30. package/dist/sidebar/theme.d.ts +223 -108
  31. package/dist/sidebar/theme.js +27 -28
  32. package/dist/sidebar/type.d.ts +4 -15
  33. package/dist/theme/Theme.svelte +0 -2
  34. package/dist/tooltip/Tooltip.svelte +25 -34
  35. package/dist/tooltip/Tooltip.svelte.d.ts +1 -1
  36. package/package.json +1 -5
  37. package/dist/sidebar/SidebarButton.svelte +0 -21
  38. package/dist/sidebar/SidebarButton.svelte.d.ts +0 -10
@@ -3,16 +3,9 @@ import { type SidebarProps as Props } from ".";
3
3
  * [Go to docs](https://svelte-5-ui-lib.codewithshin.com/)
4
4
  * ## Props
5
5
  * @props: children: any;
6
- * @props:isOpen: any = false;
7
- * @props:closeSidebar: any;
8
6
  * @props:isSingle: any = true;
9
7
  * @props:breakpoint: any = "md";
10
8
  * @props:position: any = "fixed";
11
- * @props:activateClickOutside: any = true;
12
- * @props:backdrop: any = true;
13
- * @props:backdropClass: any;
14
- * @props:transition: any = fly;
15
- * @props:params: any;
16
9
  * @props:divClass: any;
17
10
  * @props:ariaLabel: any;
18
11
  * @props:nonActiveClass: any;
@@ -1,10 +1,14 @@
1
1
  <script lang="ts">
2
- import { type SidebarGroupProps as Props } from ".";
2
+ import { type SidebarGroupProps as Props, sidebargroup, type SidebarCtxType } from ".";
3
+ import { getContext } from "svelte";
3
4
 
4
- let { children, class: className = "space-y-2", borderClass = "pt-4 mt-4 border-t border-gray-200 dark:border-gray-700", border = false, ...restProps }: Props = $props();
5
+ const context = getContext<SidebarCtxType>("sidebarContext") ?? {};
6
+
7
+ let { children, class: className, border = false, ...restProps }: Props = $props();
8
+ const { base } = $derived(sidebargroup({ breakpoint: context.breakpoint, border }));
5
9
  </script>
6
10
 
7
- <ul {...restProps} class={border ? borderClass : className}>
11
+ <ul {...restProps} class={base({ className })}>
8
12
  {@render children()}
9
13
  </ul>
10
14
 
@@ -14,6 +18,5 @@
14
18
  ## Props
15
19
  @props: children: any;
16
20
  @props:class: string = "space-y-2";
17
- @props:borderClass: any = "pt-4 mt-4 border-t border-gray-200 dark:border-gray-700";
18
- @props:border: any = false;
21
+ @props:border:boolean = false;
19
22
  -->
@@ -4,8 +4,7 @@ import { type SidebarGroupProps as Props } from ".";
4
4
  * ## Props
5
5
  * @props: children: any;
6
6
  * @props:class: string = "space-y-2";
7
- * @props:borderClass: any = "pt-4 mt-4 border-t border-gray-200 dark:border-gray-700";
8
- * @props:border: any = false;
7
+ * @props:border:boolean = false;
9
8
  */
10
9
  declare const SidebarGroup: import("svelte").Component<Props, {}, "">;
11
10
  type SidebarGroup = ReturnType<typeof SidebarGroup>;
@@ -27,7 +27,7 @@
27
27
  </script>
28
28
 
29
29
  <li class={className}>
30
- <a onclick={context.closeSidebar} {...restProps} {href} aria-current={(activeItem ?? sidebarUrl === href) ? "page" : undefined} class={twMerge(aCls, aClass)}>
30
+ <a {...restProps} {href} aria-current={(activeItem ?? sidebarUrl === href) ? "page" : undefined} class={twMerge(aCls, aClass)}>
31
31
  {#if iconSlot}
32
32
  {@render iconSlot()}
33
33
  {/if}
@@ -1,10 +1,9 @@
1
- import type { SidebarProps, SidebarDropdownWrapperProps, SidebarGroupProps, SidebarItemProps, SidebarButtonProps, SidebarCtaProps, SidebarBrandProps, SidebarCtxType, PosisionType, BreakpointType } from "./type";
1
+ import type { SidebarProps, SidebarDropdownWrapperProps, SidebarGroupProps, SidebarItemProps, SidebarCtaProps, SidebarBrandProps, SidebarCtxType, PosisionType, BreakpointType } from "./type";
2
2
  import Sidebar from "./Sidebar.svelte";
3
3
  import SidebarDropdownWrapper from "./SidebarDropdownWrapper.svelte";
4
4
  import SidebarGroup from "./SidebarGroup.svelte";
5
5
  import SidebarItem from "./SidebarItem.svelte";
6
- import SidebarButton from "./SidebarButton.svelte";
7
6
  import SidebarCta from "./SidebarCta.svelte";
8
7
  import SidebarBrand from "./SidebarBrand.svelte";
9
- import { sidebar, sidebarbutton, sidebarcta, sitebarbrand, sidebardropdownwrapper } from "./theme";
10
- export { Sidebar, sidebar, type SidebarProps, SidebarDropdownWrapper, sidebardropdownwrapper, type SidebarDropdownWrapperProps, SidebarGroup, type SidebarGroupProps, SidebarItem, type SidebarItemProps, type SidebarCtxType, SidebarButton, sidebarbutton, type SidebarButtonProps, SidebarCta, sidebarcta, type SidebarCtaProps, SidebarBrand, sitebarbrand, type SidebarBrandProps, type BreakpointType, type PosisionType };
8
+ import { sidebar, sidebarcta, sitebarbrand, sidebargroup, sidebardropdownwrapper } from "./theme";
9
+ export { Sidebar, sidebar, type SidebarProps, SidebarDropdownWrapper, sidebardropdownwrapper, type SidebarDropdownWrapperProps, SidebarGroup, sidebargroup, type SidebarGroupProps, SidebarItem, type SidebarItemProps, type SidebarCtxType, SidebarCta, sidebarcta, type SidebarCtaProps, SidebarBrand, sitebarbrand, type SidebarBrandProps, type BreakpointType, type PosisionType };
@@ -2,8 +2,7 @@ import Sidebar from "./Sidebar.svelte";
2
2
  import SidebarDropdownWrapper from "./SidebarDropdownWrapper.svelte";
3
3
  import SidebarGroup from "./SidebarGroup.svelte";
4
4
  import SidebarItem from "./SidebarItem.svelte";
5
- import SidebarButton from "./SidebarButton.svelte";
6
5
  import SidebarCta from "./SidebarCta.svelte";
7
6
  import SidebarBrand from "./SidebarBrand.svelte";
8
- import { sidebar, sidebarbutton, sidebarcta, sitebarbrand, sidebardropdownwrapper } from "./theme";
9
- export { Sidebar, sidebar, SidebarDropdownWrapper, sidebardropdownwrapper, SidebarGroup, SidebarItem, SidebarButton, sidebarbutton, SidebarCta, sidebarcta, SidebarBrand, sitebarbrand };
7
+ import { sidebar, sidebarcta, sitebarbrand, sidebargroup, sidebardropdownwrapper } from "./theme";
8
+ export { Sidebar, sidebar, SidebarDropdownWrapper, sidebardropdownwrapper, SidebarGroup, sidebargroup, SidebarItem, SidebarCta, sidebarcta, SidebarBrand, sitebarbrand };
@@ -10,38 +10,37 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
10
10
  base: string;
11
11
  };
12
12
  };
13
- isOpen: {
14
- true: string;
15
- false: string;
16
- };
17
13
  breakpoint: {
14
+ none: {
15
+ base: string;
16
+ div: string;
17
+ };
18
18
  sm: {
19
19
  base: string;
20
+ div: string;
20
21
  };
21
22
  md: {
22
23
  base: string;
24
+ div: string;
23
25
  };
24
26
  lg: {
25
27
  base: string;
28
+ div: string;
26
29
  };
27
30
  xl: {
28
31
  base: string;
32
+ div: string;
29
33
  };
30
34
  "2xl": {
31
35
  base: string;
32
- };
33
- };
34
- backdrop: {
35
- true: {
36
- backdrop: string;
36
+ div: string;
37
37
  };
38
38
  };
39
39
  }, {
40
40
  base: string;
41
+ div: string;
41
42
  active: string;
42
43
  nonactive: string;
43
- div: string;
44
- backdrop: string;
45
44
  }, undefined, import("tailwind-variants/dist/config").TVConfig<{
46
45
  position: {
47
46
  fixed: {
@@ -54,30 +53,30 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
54
53
  base: string;
55
54
  };
56
55
  };
57
- isOpen: {
58
- true: string;
59
- false: string;
60
- };
61
56
  breakpoint: {
57
+ none: {
58
+ base: string;
59
+ div: string;
60
+ };
62
61
  sm: {
63
62
  base: string;
63
+ div: string;
64
64
  };
65
65
  md: {
66
66
  base: string;
67
+ div: string;
67
68
  };
68
69
  lg: {
69
70
  base: string;
71
+ div: string;
70
72
  };
71
73
  xl: {
72
74
  base: string;
75
+ div: string;
73
76
  };
74
77
  "2xl": {
75
78
  base: string;
76
- };
77
- };
78
- backdrop: {
79
- true: {
80
- backdrop: string;
79
+ div: string;
81
80
  };
82
81
  };
83
82
  }, {
@@ -92,30 +91,30 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
92
91
  base: string;
93
92
  };
94
93
  };
95
- isOpen: {
96
- true: string;
97
- false: string;
98
- };
99
94
  breakpoint: {
95
+ none: {
96
+ base: string;
97
+ div: string;
98
+ };
100
99
  sm: {
101
100
  base: string;
101
+ div: string;
102
102
  };
103
103
  md: {
104
104
  base: string;
105
+ div: string;
105
106
  };
106
107
  lg: {
107
108
  base: string;
109
+ div: string;
108
110
  };
109
111
  xl: {
110
112
  base: string;
113
+ div: string;
111
114
  };
112
115
  "2xl": {
113
116
  base: string;
114
- };
115
- };
116
- backdrop: {
117
- true: {
118
- backdrop: string;
117
+ div: string;
119
118
  };
120
119
  };
121
120
  }>, {
@@ -130,38 +129,37 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
130
129
  base: string;
131
130
  };
132
131
  };
133
- isOpen: {
134
- true: string;
135
- false: string;
136
- };
137
132
  breakpoint: {
133
+ none: {
134
+ base: string;
135
+ div: string;
136
+ };
138
137
  sm: {
139
138
  base: string;
139
+ div: string;
140
140
  };
141
141
  md: {
142
142
  base: string;
143
+ div: string;
143
144
  };
144
145
  lg: {
145
146
  base: string;
147
+ div: string;
146
148
  };
147
149
  xl: {
148
150
  base: string;
151
+ div: string;
149
152
  };
150
153
  "2xl": {
151
154
  base: string;
152
- };
153
- };
154
- backdrop: {
155
- true: {
156
- backdrop: string;
155
+ div: string;
157
156
  };
158
157
  };
159
158
  }, {
160
159
  base: string;
160
+ div: string;
161
161
  active: string;
162
162
  nonactive: string;
163
- div: string;
164
- backdrop: string;
165
163
  }, import("tailwind-variants").TVReturnType<{
166
164
  position: {
167
165
  fixed: {
@@ -174,38 +172,37 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
174
172
  base: string;
175
173
  };
176
174
  };
177
- isOpen: {
178
- true: string;
179
- false: string;
180
- };
181
175
  breakpoint: {
176
+ none: {
177
+ base: string;
178
+ div: string;
179
+ };
182
180
  sm: {
183
181
  base: string;
182
+ div: string;
184
183
  };
185
184
  md: {
186
185
  base: string;
186
+ div: string;
187
187
  };
188
188
  lg: {
189
189
  base: string;
190
+ div: string;
190
191
  };
191
192
  xl: {
192
193
  base: string;
194
+ div: string;
193
195
  };
194
196
  "2xl": {
195
197
  base: string;
196
- };
197
- };
198
- backdrop: {
199
- true: {
200
- backdrop: string;
198
+ div: string;
201
199
  };
202
200
  };
203
201
  }, {
204
202
  base: string;
203
+ div: string;
205
204
  active: string;
206
205
  nonactive: string;
207
- div: string;
208
- backdrop: string;
209
206
  }, undefined, import("tailwind-variants/dist/config").TVConfig<{
210
207
  position: {
211
208
  fixed: {
@@ -218,30 +215,30 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
218
215
  base: string;
219
216
  };
220
217
  };
221
- isOpen: {
222
- true: string;
223
- false: string;
224
- };
225
218
  breakpoint: {
219
+ none: {
220
+ base: string;
221
+ div: string;
222
+ };
226
223
  sm: {
227
224
  base: string;
225
+ div: string;
228
226
  };
229
227
  md: {
230
228
  base: string;
229
+ div: string;
231
230
  };
232
231
  lg: {
233
232
  base: string;
233
+ div: string;
234
234
  };
235
235
  xl: {
236
236
  base: string;
237
+ div: string;
237
238
  };
238
239
  "2xl": {
239
240
  base: string;
240
- };
241
- };
242
- backdrop: {
243
- true: {
244
- backdrop: string;
241
+ div: string;
245
242
  };
246
243
  };
247
244
  }, {
@@ -256,88 +253,206 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
256
253
  base: string;
257
254
  };
258
255
  };
259
- isOpen: {
260
- true: string;
261
- false: string;
262
- };
263
256
  breakpoint: {
257
+ none: {
258
+ base: string;
259
+ div: string;
260
+ };
264
261
  sm: {
265
262
  base: string;
263
+ div: string;
266
264
  };
267
265
  md: {
268
266
  base: string;
267
+ div: string;
269
268
  };
270
269
  lg: {
271
270
  base: string;
271
+ div: string;
272
272
  };
273
273
  xl: {
274
274
  base: string;
275
+ div: string;
275
276
  };
276
277
  "2xl": {
277
278
  base: string;
278
- };
279
- };
280
- backdrop: {
281
- true: {
282
- backdrop: string;
279
+ div: string;
283
280
  };
284
281
  };
285
282
  }>, unknown, unknown, undefined>>;
286
- export declare const sidebarbutton: import("tailwind-variants").TVReturnType<{
283
+ export declare const sidebargroup: import("tailwind-variants").TVReturnType<{
287
284
  breakpoint: {
288
- sm: string;
289
- md: string;
290
- lg: string;
291
- xl: string;
292
- "2xl": string;
285
+ none: {
286
+ base: string;
287
+ };
288
+ sm: {
289
+ base: string;
290
+ };
291
+ md: {
292
+ base: string;
293
+ };
294
+ lg: {
295
+ base: string;
296
+ };
297
+ xl: {
298
+ base: string;
299
+ };
300
+ "2xl": {
301
+ base: string;
302
+ };
303
+ };
304
+ border: {
305
+ true: string;
293
306
  };
294
- }, undefined, "inline-flex items-center p-2 mt-2 ms-3 text-sm text-gray-500 rounded-lg hover:bg-gray-100 focus:outline-hidden focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600", import("tailwind-variants/dist/config").TVConfig<{
307
+ }, {
308
+ base: string;
309
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
295
310
  breakpoint: {
296
- sm: string;
297
- md: string;
298
- lg: string;
299
- xl: string;
300
- "2xl": string;
311
+ none: {
312
+ base: string;
313
+ };
314
+ sm: {
315
+ base: string;
316
+ };
317
+ md: {
318
+ base: string;
319
+ };
320
+ lg: {
321
+ base: string;
322
+ };
323
+ xl: {
324
+ base: string;
325
+ };
326
+ "2xl": {
327
+ base: string;
328
+ };
329
+ };
330
+ border: {
331
+ true: string;
301
332
  };
302
333
  }, {
303
334
  breakpoint: {
304
- sm: string;
305
- md: string;
306
- lg: string;
307
- xl: string;
308
- "2xl": string;
335
+ none: {
336
+ base: string;
337
+ };
338
+ sm: {
339
+ base: string;
340
+ };
341
+ md: {
342
+ base: string;
343
+ };
344
+ lg: {
345
+ base: string;
346
+ };
347
+ xl: {
348
+ base: string;
349
+ };
350
+ "2xl": {
351
+ base: string;
352
+ };
353
+ };
354
+ border: {
355
+ true: string;
309
356
  };
310
357
  }>, {
311
358
  breakpoint: {
312
- sm: string;
313
- md: string;
314
- lg: string;
315
- xl: string;
316
- "2xl": string;
359
+ none: {
360
+ base: string;
361
+ };
362
+ sm: {
363
+ base: string;
364
+ };
365
+ md: {
366
+ base: string;
367
+ };
368
+ lg: {
369
+ base: string;
370
+ };
371
+ xl: {
372
+ base: string;
373
+ };
374
+ "2xl": {
375
+ base: string;
376
+ };
317
377
  };
318
- }, undefined, import("tailwind-variants").TVReturnType<{
378
+ border: {
379
+ true: string;
380
+ };
381
+ }, {
382
+ base: string;
383
+ }, import("tailwind-variants").TVReturnType<{
319
384
  breakpoint: {
320
- sm: string;
321
- md: string;
322
- lg: string;
323
- xl: string;
324
- "2xl": string;
385
+ none: {
386
+ base: string;
387
+ };
388
+ sm: {
389
+ base: string;
390
+ };
391
+ md: {
392
+ base: string;
393
+ };
394
+ lg: {
395
+ base: string;
396
+ };
397
+ xl: {
398
+ base: string;
399
+ };
400
+ "2xl": {
401
+ base: string;
402
+ };
403
+ };
404
+ border: {
405
+ true: string;
325
406
  };
326
- }, undefined, "inline-flex items-center p-2 mt-2 ms-3 text-sm text-gray-500 rounded-lg hover:bg-gray-100 focus:outline-hidden focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600", import("tailwind-variants/dist/config").TVConfig<{
407
+ }, {
408
+ base: string;
409
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
327
410
  breakpoint: {
328
- sm: string;
329
- md: string;
330
- lg: string;
331
- xl: string;
332
- "2xl": string;
411
+ none: {
412
+ base: string;
413
+ };
414
+ sm: {
415
+ base: string;
416
+ };
417
+ md: {
418
+ base: string;
419
+ };
420
+ lg: {
421
+ base: string;
422
+ };
423
+ xl: {
424
+ base: string;
425
+ };
426
+ "2xl": {
427
+ base: string;
428
+ };
429
+ };
430
+ border: {
431
+ true: string;
333
432
  };
334
433
  }, {
335
434
  breakpoint: {
336
- sm: string;
337
- md: string;
338
- lg: string;
339
- xl: string;
340
- "2xl": string;
435
+ none: {
436
+ base: string;
437
+ };
438
+ sm: {
439
+ base: string;
440
+ };
441
+ md: {
442
+ base: string;
443
+ };
444
+ lg: {
445
+ base: string;
446
+ };
447
+ xl: {
448
+ base: string;
449
+ };
450
+ "2xl": {
451
+ base: string;
452
+ };
453
+ };
454
+ border: {
455
+ true: string;
341
456
  };
342
457
  }>, unknown, unknown, undefined>>;
343
458
  export declare const sidebarcta: import("tailwind-variants").TVReturnType<{