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.
- package/README.md +16 -11
- package/dist/Checkbox/Checkbox.svelte +2 -11
- package/dist/CheckboxGroup/CheckboxGroup.svelte +2 -11
- package/dist/Collapsible/Collapsible.svelte +69 -0
- package/dist/Collapsible/Collapsible.svelte.d.ts +6 -0
- package/dist/Collapsible/CollapsibleTestWrapper.svelte +17 -0
- package/dist/Collapsible/CollapsibleTestWrapper.svelte.d.ts +4 -0
- package/dist/Collapsible/collapsible.types.d.ts +75 -0
- package/dist/Collapsible/collapsible.types.js +1 -0
- package/dist/Collapsible/collapsible.variants.d.ts +53 -0
- package/dist/Collapsible/collapsible.variants.js +21 -0
- package/dist/Collapsible/index.d.ts +2 -0
- package/dist/Collapsible/index.js +1 -0
- package/dist/Command/Command.svelte +183 -0
- package/dist/Command/Command.svelte.d.ts +6 -0
- package/dist/Command/CommandTestWrapper.svelte +13 -0
- package/dist/Command/CommandTestWrapper.svelte.d.ts +4 -0
- package/dist/Command/command.types.d.ts +98 -0
- package/dist/Command/command.types.js +1 -0
- package/dist/Command/command.variants.d.ts +226 -0
- package/dist/Command/command.variants.js +86 -0
- package/dist/Command/index.d.ts +2 -0
- package/dist/Command/index.js +1 -0
- package/dist/FormField/FormField.svelte +2 -6
- package/dist/Input/Input.svelte +2 -10
- package/dist/PinInput/PinInput.svelte +2 -11
- package/dist/RadioGroup/RadioGroup.svelte +2 -11
- package/dist/Select/Select.svelte +2 -10
- package/dist/Select/select.variants.js +1 -1
- package/dist/SelectMenu/SelectMenu.svelte +2 -10
- package/dist/SelectMenu/select-menu.variants.js +1 -1
- package/dist/Slider/Slider.svelte +2 -11
- package/dist/Switch/Switch.svelte +2 -11
- package/dist/Table/Table.svelte +752 -0
- package/dist/Table/Table.svelte.d.ts +26 -0
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.js +1 -0
- package/dist/Table/table.types.d.ts +199 -0
- package/dist/Table/table.types.js +1 -0
- package/dist/Table/table.utils.d.ts +51 -0
- package/dist/Table/table.utils.js +166 -0
- package/dist/Table/table.variants.d.ts +205 -0
- package/dist/Table/table.variants.js +126 -0
- package/dist/Textarea/Textarea.svelte +2 -10
- package/dist/Toast/Toaster.svelte +618 -0
- package/dist/Toast/Toaster.svelte.d.ts +5 -0
- package/dist/Toast/index.d.ts +4 -0
- package/dist/Toast/index.js +2 -0
- package/dist/Toast/toast.d.ts +38 -0
- package/dist/Toast/toast.js +73 -0
- package/dist/Toast/toast.types.d.ts +19 -0
- package/dist/Toast/toast.types.js +1 -0
- package/dist/Toast/toast.variants.d.ts +7 -0
- package/dist/Toast/toast.variants.js +5 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +5 -1
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/useClickOutside.svelte.d.ts +31 -0
- package/dist/hooks/useClickOutside.svelte.js +37 -0
- package/dist/hooks/useClipboard.svelte.d.ts +30 -0
- package/dist/hooks/useClipboard.svelte.js +45 -0
- package/dist/hooks/useDebounce.svelte.d.ts +36 -0
- package/dist/hooks/useDebounce.svelte.js +56 -0
- package/dist/hooks/useEscapeKeydown.svelte.d.ts +31 -0
- package/dist/hooks/useEscapeKeydown.svelte.js +37 -0
- package/dist/hooks/useFormField.svelte.d.ts +21 -0
- package/dist/hooks/useFormField.svelte.js +17 -0
- package/dist/hooks/useInfiniteScroll.svelte.d.ts +57 -0
- package/dist/hooks/useInfiniteScroll.svelte.js +69 -0
- package/dist/hooks/useMediaQuery.svelte.d.ts +31 -0
- package/dist/hooks/useMediaQuery.svelte.js +38 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/theme.css +36 -0
- 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
|
+
"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"
|