sv5ui 1.3.0 → 1.5.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 (76) hide show
  1. package/README.md +16 -11
  2. package/dist/Checkbox/Checkbox.svelte +2 -11
  3. package/dist/CheckboxGroup/CheckboxGroup.svelte +2 -11
  4. package/dist/Collapsible/Collapsible.svelte +69 -0
  5. package/dist/Collapsible/Collapsible.svelte.d.ts +6 -0
  6. package/dist/Collapsible/CollapsibleTestWrapper.svelte +17 -0
  7. package/dist/Collapsible/CollapsibleTestWrapper.svelte.d.ts +4 -0
  8. package/dist/Collapsible/collapsible.types.d.ts +75 -0
  9. package/dist/Collapsible/collapsible.types.js +1 -0
  10. package/dist/Collapsible/collapsible.variants.d.ts +53 -0
  11. package/dist/Collapsible/collapsible.variants.js +21 -0
  12. package/dist/Collapsible/index.d.ts +2 -0
  13. package/dist/Collapsible/index.js +1 -0
  14. package/dist/Command/Command.svelte +183 -0
  15. package/dist/Command/Command.svelte.d.ts +6 -0
  16. package/dist/Command/CommandTestWrapper.svelte +13 -0
  17. package/dist/Command/CommandTestWrapper.svelte.d.ts +4 -0
  18. package/dist/Command/command.types.d.ts +98 -0
  19. package/dist/Command/command.types.js +1 -0
  20. package/dist/Command/command.variants.d.ts +226 -0
  21. package/dist/Command/command.variants.js +86 -0
  22. package/dist/Command/index.d.ts +2 -0
  23. package/dist/Command/index.js +1 -0
  24. package/dist/FormField/FormField.svelte +2 -6
  25. package/dist/Input/Input.svelte +2 -10
  26. package/dist/PinInput/PinInput.svelte +2 -11
  27. package/dist/RadioGroup/RadioGroup.svelte +2 -11
  28. package/dist/Select/Select.svelte +2 -10
  29. package/dist/Select/select.variants.js +1 -1
  30. package/dist/SelectMenu/SelectMenu.svelte +2 -10
  31. package/dist/SelectMenu/select-menu.variants.js +1 -1
  32. package/dist/Slider/Slider.svelte +2 -11
  33. package/dist/Switch/Switch.svelte +2 -11
  34. package/dist/Table/Table.svelte +752 -0
  35. package/dist/Table/Table.svelte.d.ts +26 -0
  36. package/dist/Table/index.d.ts +2 -0
  37. package/dist/Table/index.js +1 -0
  38. package/dist/Table/table.types.d.ts +199 -0
  39. package/dist/Table/table.types.js +1 -0
  40. package/dist/Table/table.utils.d.ts +51 -0
  41. package/dist/Table/table.utils.js +166 -0
  42. package/dist/Table/table.variants.d.ts +205 -0
  43. package/dist/Table/table.variants.js +126 -0
  44. package/dist/Textarea/Textarea.svelte +2 -10
  45. package/dist/Toast/Toaster.svelte +618 -0
  46. package/dist/Toast/Toaster.svelte.d.ts +5 -0
  47. package/dist/Toast/index.d.ts +4 -0
  48. package/dist/Toast/index.js +2 -0
  49. package/dist/Toast/toast.d.ts +38 -0
  50. package/dist/Toast/toast.js +73 -0
  51. package/dist/Toast/toast.types.d.ts +19 -0
  52. package/dist/Toast/toast.types.js +1 -0
  53. package/dist/Toast/toast.variants.d.ts +7 -0
  54. package/dist/Toast/toast.variants.js +5 -0
  55. package/dist/config.d.ts +4 -0
  56. package/dist/config.js +5 -1
  57. package/dist/hooks/index.d.ts +14 -0
  58. package/dist/hooks/index.js +7 -0
  59. package/dist/hooks/useClickOutside.svelte.d.ts +31 -0
  60. package/dist/hooks/useClickOutside.svelte.js +37 -0
  61. package/dist/hooks/useClipboard.svelte.d.ts +30 -0
  62. package/dist/hooks/useClipboard.svelte.js +45 -0
  63. package/dist/hooks/useDebounce.svelte.d.ts +36 -0
  64. package/dist/hooks/useDebounce.svelte.js +56 -0
  65. package/dist/hooks/useEscapeKeydown.svelte.d.ts +31 -0
  66. package/dist/hooks/useEscapeKeydown.svelte.js +37 -0
  67. package/dist/hooks/useFormField.svelte.d.ts +21 -0
  68. package/dist/hooks/useFormField.svelte.js +17 -0
  69. package/dist/hooks/useInfiniteScroll.svelte.d.ts +57 -0
  70. package/dist/hooks/useInfiniteScroll.svelte.js +69 -0
  71. package/dist/hooks/useMediaQuery.svelte.d.ts +31 -0
  72. package/dist/hooks/useMediaQuery.svelte.js +38 -0
  73. package/dist/index.d.ts +5 -0
  74. package/dist/index.js +6 -0
  75. package/dist/theme.css +36 -0
  76. package/package.json +2 -1
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Reactive media query hook. Tracks whether a CSS media query matches.
3
+ *
4
+ * @example
5
+ * ```svelte
6
+ * <script>
7
+ * import { useMediaQuery } from 'sv5ui'
8
+ *
9
+ * const isMobile = useMediaQuery('(max-width: 640px)')
10
+ * const prefersDark = useMediaQuery('(prefers-color-scheme: dark)')
11
+ * </script>
12
+ *
13
+ * {#if isMobile.matches}
14
+ * <MobileLayout />
15
+ * {:else}
16
+ * <DesktopLayout />
17
+ * {/if}
18
+ * ```
19
+ */
20
+ export function useMediaQuery(query, options = {}) {
21
+ const { initialValue = false } = options;
22
+ const resolveQuery = typeof query === 'function' ? query : () => query;
23
+ let matches = $state(initialValue);
24
+ $effect(() => {
25
+ const mediaQuery = window.matchMedia(resolveQuery());
26
+ matches = mediaQuery.matches;
27
+ function handler(event) {
28
+ matches = event.matches;
29
+ }
30
+ mediaQuery.addEventListener('change', handler);
31
+ return () => mediaQuery.removeEventListener('change', handler);
32
+ });
33
+ return {
34
+ get matches() {
35
+ return matches;
36
+ }
37
+ };
38
+ }
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export * from './Drawer/index.js';
19
19
  export * from './Tooltip/index.js';
20
20
  export * from './Modal/index.js';
21
21
  export * from './Accordion/index.js';
22
+ export * from './Collapsible/index.js';
23
+ export * from './Command/index.js';
22
24
  export * from './Slideover/index.js';
23
25
  export * from './Popover/index.js';
24
26
  export * from './Breadcrumb/index.js';
@@ -41,5 +43,8 @@ export * from './FileUpload/index.js';
41
43
  export * from './Slider/index.js';
42
44
  export * from './PinInput/index.js';
43
45
  export * from './ThemeModeButton/index.js';
46
+ export * from './Table/index.js';
47
+ export * from './Toast/index.js';
48
+ export * from './hooks/index.js';
44
49
  export { defineConfig } from './config.js';
45
50
  export type { UIConfig } from './config.js';
package/dist/index.js CHANGED
@@ -20,6 +20,8 @@ export * from './Drawer/index.js';
20
20
  export * from './Tooltip/index.js';
21
21
  export * from './Modal/index.js';
22
22
  export * from './Accordion/index.js';
23
+ export * from './Collapsible/index.js';
24
+ export * from './Command/index.js';
23
25
  export * from './Slideover/index.js';
24
26
  export * from './Popover/index.js';
25
27
  export * from './Breadcrumb/index.js';
@@ -42,5 +44,9 @@ export * from './FileUpload/index.js';
42
44
  export * from './Slider/index.js';
43
45
  export * from './PinInput/index.js';
44
46
  export * from './ThemeModeButton/index.js';
47
+ export * from './Table/index.js';
48
+ export * from './Toast/index.js';
49
+ // Composables
50
+ export * from './hooks/index.js';
45
51
  // Configuration
46
52
  export { defineConfig } from './config.js';
package/dist/theme.css CHANGED
@@ -597,3 +597,39 @@
597
597
  scale: 0.95;
598
598
  }
599
599
  }
600
+
601
+ /* ==================== Scrollbar ==================== */
602
+
603
+ @utility scrollbar-thin {
604
+ scrollbar-width: thin;
605
+ scrollbar-color: var(--color-outline-variant) transparent;
606
+
607
+ &::-webkit-scrollbar {
608
+ width: 6px;
609
+ }
610
+ &::-webkit-scrollbar-track {
611
+ background: transparent;
612
+ }
613
+ &::-webkit-scrollbar-thumb {
614
+ background-color: var(--color-outline-variant);
615
+ border-radius: 3px;
616
+ }
617
+ }
618
+
619
+ @keyframes collapsible-down {
620
+ 0% {
621
+ height: 0;
622
+ }
623
+ to {
624
+ height: var(--bits-collapsible-content-height);
625
+ }
626
+ }
627
+
628
+ @keyframes collapsible-up {
629
+ 0% {
630
+ height: var(--bits-collapsible-content-height);
631
+ }
632
+ to {
633
+ height: 0;
634
+ }
635
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv5ui",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "A modern Svelte 5 UI component library with Tailwind CSS",
5
5
  "author": "ndlabdev",
6
6
  "license": "MIT",
@@ -99,6 +99,7 @@
99
99
  "@iconify/svelte": "^5.2.1",
100
100
  "@internationalized/date": "^3.11.0",
101
101
  "bits-ui": "^2.15.4",
102
+ "svelte-sonner": "^1.1.0",
102
103
  "tailwind-merge": "^3.4.0",
103
104
  "tailwind-variants": "^3.2.2",
104
105
  "vaul-svelte": "1.0.0-next.7"