sve-ui 0.2.1 → 0.3.1

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 (89) hide show
  1. package/README.md +5 -3
  2. package/dist/components/Accordion/AccordionContent.svelte +25 -0
  3. package/dist/components/Accordion/AccordionContent.svelte.d.ts +10 -0
  4. package/dist/components/Accordion/AccordionContent.svelte.d.ts.map +1 -0
  5. package/dist/components/Accordion/AccordionHeader.svelte +22 -0
  6. package/dist/components/Accordion/AccordionHeader.svelte.d.ts +10 -0
  7. package/dist/components/Accordion/AccordionHeader.svelte.d.ts.map +1 -0
  8. package/dist/components/Accordion/AccordionItem.svelte +22 -0
  9. package/dist/components/Accordion/AccordionItem.svelte.d.ts +10 -0
  10. package/dist/components/Accordion/AccordionItem.svelte.d.ts.map +1 -0
  11. package/dist/components/Accordion/AccordionRoot.svelte +37 -0
  12. package/dist/components/Accordion/AccordionRoot.svelte.d.ts +21 -0
  13. package/dist/components/Accordion/AccordionRoot.svelte.d.ts.map +1 -0
  14. package/dist/components/Accordion/AccordionTrigger.svelte +71 -0
  15. package/dist/components/Accordion/AccordionTrigger.svelte.d.ts +11 -0
  16. package/dist/components/Accordion/AccordionTrigger.svelte.d.ts.map +1 -0
  17. package/dist/components/Accordion/index.d.ts +14 -0
  18. package/dist/components/Accordion/index.d.ts.map +1 -0
  19. package/dist/components/Accordion/index.js +13 -0
  20. package/dist/components/Checkbox/CheckboxRoot.svelte +95 -0
  21. package/dist/components/Checkbox/CheckboxRoot.svelte.d.ts +12 -0
  22. package/dist/components/Checkbox/CheckboxRoot.svelte.d.ts.map +1 -0
  23. package/dist/components/Checkbox/index.d.ts +9 -0
  24. package/dist/components/Checkbox/index.d.ts.map +1 -0
  25. package/dist/components/Checkbox/index.js +8 -0
  26. package/dist/components/Code/Code.svelte +130 -0
  27. package/dist/components/Code/Code.svelte.d.ts +14 -0
  28. package/dist/components/Code/Code.svelte.d.ts.map +1 -0
  29. package/dist/components/Combobox/ComboboxContent.svelte +33 -0
  30. package/dist/components/Combobox/ComboboxContent.svelte.d.ts +10 -0
  31. package/dist/components/Combobox/ComboboxContent.svelte.d.ts.map +1 -0
  32. package/dist/components/Combobox/ComboboxInput.svelte +42 -0
  33. package/dist/components/Combobox/ComboboxInput.svelte.d.ts +10 -0
  34. package/dist/components/Combobox/ComboboxInput.svelte.d.ts.map +1 -0
  35. package/dist/components/Combobox/ComboboxItem.svelte +50 -0
  36. package/dist/components/Combobox/ComboboxItem.svelte.d.ts +10 -0
  37. package/dist/components/Combobox/ComboboxItem.svelte.d.ts.map +1 -0
  38. package/dist/components/Combobox/index.d.ts +17 -0
  39. package/dist/components/Combobox/index.d.ts.map +1 -0
  40. package/dist/components/Combobox/index.js +16 -0
  41. package/dist/components/RadioGroup/RadioGroupItem.svelte +58 -0
  42. package/dist/components/RadioGroup/RadioGroupItem.svelte.d.ts +10 -0
  43. package/dist/components/RadioGroup/RadioGroupItem.svelte.d.ts.map +1 -0
  44. package/dist/components/RadioGroup/RadioGroupRoot.svelte +30 -0
  45. package/dist/components/RadioGroup/RadioGroupRoot.svelte.d.ts +10 -0
  46. package/dist/components/RadioGroup/RadioGroupRoot.svelte.d.ts.map +1 -0
  47. package/dist/components/RadioGroup/index.d.ts +10 -0
  48. package/dist/components/RadioGroup/index.d.ts.map +1 -0
  49. package/dist/components/RadioGroup/index.js +9 -0
  50. package/dist/components/Select/SelectContent.svelte +33 -0
  51. package/dist/components/Select/SelectContent.svelte.d.ts +10 -0
  52. package/dist/components/Select/SelectContent.svelte.d.ts.map +1 -0
  53. package/dist/components/Select/SelectItem.svelte +51 -0
  54. package/dist/components/Select/SelectItem.svelte.d.ts +10 -0
  55. package/dist/components/Select/SelectItem.svelte.d.ts.map +1 -0
  56. package/dist/components/Select/SelectTrigger.svelte +66 -0
  57. package/dist/components/Select/SelectTrigger.svelte.d.ts +11 -0
  58. package/dist/components/Select/SelectTrigger.svelte.d.ts.map +1 -0
  59. package/dist/components/Select/index.d.ts +18 -0
  60. package/dist/components/Select/index.d.ts.map +1 -0
  61. package/dist/components/Select/index.js +17 -0
  62. package/dist/components/Slider/Slider.svelte +101 -0
  63. package/dist/components/Slider/Slider.svelte.d.ts +31 -0
  64. package/dist/components/Slider/Slider.svelte.d.ts.map +1 -0
  65. package/dist/components/Switch/SwitchRoot.svelte +87 -0
  66. package/dist/components/Switch/SwitchRoot.svelte.d.ts +12 -0
  67. package/dist/components/Switch/SwitchRoot.svelte.d.ts.map +1 -0
  68. package/dist/components/Switch/index.d.ts +8 -0
  69. package/dist/components/Switch/index.d.ts.map +1 -0
  70. package/dist/components/Switch/index.js +7 -0
  71. package/dist/components/Tabs/TabsContent.svelte +29 -0
  72. package/dist/components/Tabs/TabsContent.svelte.d.ts +10 -0
  73. package/dist/components/Tabs/TabsContent.svelte.d.ts.map +1 -0
  74. package/dist/components/Tabs/TabsList.svelte +24 -0
  75. package/dist/components/Tabs/TabsList.svelte.d.ts +10 -0
  76. package/dist/components/Tabs/TabsList.svelte.d.ts.map +1 -0
  77. package/dist/components/Tabs/TabsRoot.svelte +29 -0
  78. package/dist/components/Tabs/TabsRoot.svelte.d.ts +10 -0
  79. package/dist/components/Tabs/TabsRoot.svelte.d.ts.map +1 -0
  80. package/dist/components/Tabs/TabsTrigger.svelte +54 -0
  81. package/dist/components/Tabs/TabsTrigger.svelte.d.ts +10 -0
  82. package/dist/components/Tabs/TabsTrigger.svelte.d.ts.map +1 -0
  83. package/dist/components/Tabs/index.d.ts +12 -0
  84. package/dist/components/Tabs/index.d.ts.map +1 -0
  85. package/dist/components/Tabs/index.js +11 -0
  86. package/dist/index.d.ts +9 -0
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +16 -0
  89. package/package.json +4 -2
package/README.md CHANGED
@@ -71,6 +71,8 @@ without it):
71
71
  **Display & form** — `Button`, `Input`, `Card`, `Badge`, `Avatar`, `Spinner`,
72
72
  `Text`, `Heading`, `Alert`.
73
73
 
74
+ **Form controls** (on Bits UI) — `Switch`, `Checkbox`, `RadioGroup`.
75
+
74
76
  **Overlays** (on Bits UI) — `Dialog`, `DropdownMenu`, `Tooltip`, `Popover`.
75
77
 
76
78
  Most components take `variant`, `color` and `size` props, e.g.:
@@ -82,9 +84,9 @@ Most components take `variant`, `color` and `size` props, e.g.:
82
84
  <Input variant="outline" size="md" placeholder="you@example.com" bind:value />
83
85
  ```
84
86
 
85
- Overlays (`Dialog`, `DropdownMenu`, `Tooltip`, `Popover`, plus `Avatar`, `Card`,
86
- `Alert`) are **namespaced** compositions — import the namespace and compose its
87
- parts (`Dialog.Root`, `Dialog.Trigger`, `Dialog.Content`, …).
87
+ `Avatar`, `Card`, `Alert`, the overlays, and the form controls are **namespaced**
88
+ compositions — import the namespace and compose its parts (`Dialog.Root`,
89
+ `Dialog.Trigger`, `Dialog.Content`; `RadioGroup.Root`, `RadioGroup.Item`; …).
88
90
 
89
91
  ## Theming
90
92
 
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import { Accordion } from 'bits-ui';
3
+ import type { ComponentProps } from 'svelte';
4
+
5
+ type BitsContentProps = ComponentProps<typeof Accordion.Content>;
6
+
7
+ interface Props extends Omit<BitsContentProps, 'class'> {
8
+ class?: string;
9
+ }
10
+
11
+ let { class: cls, ...rest }: Props = $props();
12
+
13
+ const className = $derived(['sve-accordion__content', cls].filter(Boolean).join(' '));
14
+ </script>
15
+
16
+ <Accordion.Content class={className} data-slot="accordion-content" {...rest} />
17
+
18
+ <style>
19
+ :global(.sve-accordion__content) {
20
+ padding-bottom: var(--sve-space-4);
21
+ color: var(--sve-color-default-foreground);
22
+ font-size: var(--sve-font-size-sm);
23
+ line-height: var(--sve-line-height-normal);
24
+ }
25
+ </style>
@@ -0,0 +1,10 @@
1
+ import { Accordion } from 'bits-ui';
2
+ import type { ComponentProps } from 'svelte';
3
+ type BitsContentProps = ComponentProps<typeof Accordion.Content>;
4
+ interface Props extends Omit<BitsContentProps, 'class'> {
5
+ class?: string;
6
+ }
7
+ declare const AccordionContent: import("svelte").Component<Props, {}, "">;
8
+ type AccordionContent = ReturnType<typeof AccordionContent>;
9
+ export default AccordionContent;
10
+ //# sourceMappingURL=AccordionContent.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionContent.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Accordion/AccordionContent.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAEjE,UAAU,KAAM,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBH,QAAA,MAAM,gBAAgB,2CAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { Accordion } from 'bits-ui';
3
+ import type { ComponentProps } from 'svelte';
4
+
5
+ type BitsHeaderProps = ComponentProps<typeof Accordion.Header>;
6
+
7
+ interface Props extends Omit<BitsHeaderProps, 'class'> {
8
+ class?: string;
9
+ }
10
+
11
+ let { class: cls, ...rest }: Props = $props();
12
+
13
+ const className = $derived(['sve-accordion__header', cls].filter(Boolean).join(' '));
14
+ </script>
15
+
16
+ <Accordion.Header class={className} data-slot="accordion-header" {...rest} />
17
+
18
+ <style>
19
+ :global(.sve-accordion__header) {
20
+ margin: 0;
21
+ }
22
+ </style>
@@ -0,0 +1,10 @@
1
+ import { Accordion } from 'bits-ui';
2
+ import type { ComponentProps } from 'svelte';
3
+ type BitsHeaderProps = ComponentProps<typeof Accordion.Header>;
4
+ interface Props extends Omit<BitsHeaderProps, 'class'> {
5
+ class?: string;
6
+ }
7
+ declare const AccordionHeader: import("svelte").Component<Props, {}, "">;
8
+ type AccordionHeader = ReturnType<typeof AccordionHeader>;
9
+ export default AccordionHeader;
10
+ //# sourceMappingURL=AccordionHeader.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionHeader.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Accordion/AccordionHeader.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAE/D,UAAU,KAAM,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBH,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { Accordion } from 'bits-ui';
3
+ import type { ComponentProps } from 'svelte';
4
+
5
+ type BitsItemProps = ComponentProps<typeof Accordion.Item>;
6
+
7
+ interface Props extends Omit<BitsItemProps, 'class'> {
8
+ class?: string;
9
+ }
10
+
11
+ let { class: cls, ...rest }: Props = $props();
12
+
13
+ const className = $derived(['sve-accordion__item', cls].filter(Boolean).join(' '));
14
+ </script>
15
+
16
+ <Accordion.Item class={className} data-slot="accordion-item" {...rest} />
17
+
18
+ <style>
19
+ :global(.sve-accordion__item) {
20
+ border-bottom: 1px solid var(--sve-color-default-border);
21
+ }
22
+ </style>
@@ -0,0 +1,10 @@
1
+ import { Accordion } from 'bits-ui';
2
+ import type { ComponentProps } from 'svelte';
3
+ type BitsItemProps = ComponentProps<typeof Accordion.Item>;
4
+ interface Props extends Omit<BitsItemProps, 'class'> {
5
+ class?: string;
6
+ }
7
+ declare const AccordionItem: import("svelte").Component<Props, {}, "">;
8
+ type AccordionItem = ReturnType<typeof AccordionItem>;
9
+ export default AccordionItem;
10
+ //# sourceMappingURL=AccordionItem.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionItem.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Accordion/AccordionItem.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;AAE3D,UAAU,KAAM,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import { Accordion } from 'bits-ui';
3
+ import type { Component, Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ /**
7
+ * Bits' Accordion.Root props are a discriminated union (single vs multiple)
8
+ * over 400+ HTML attributes, which overflows TypeScript's union representation
9
+ * when spread. We expose a flat, non-union surface here and forward it to a
10
+ * loosely-typed view of the Bits root — behavior is unchanged.
11
+ */
12
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
13
+ type?: 'single' | 'multiple';
14
+ value?: string | string[];
15
+ onValueChange?: (value: string & string[]) => void;
16
+ disabled?: boolean;
17
+ loop?: boolean;
18
+ class?: string;
19
+ children?: Snippet;
20
+ }
21
+
22
+ let { type = 'single', class: cls, ...rest }: Props = $props();
23
+
24
+ const className = $derived(['sve-accordion', cls].filter(Boolean).join(' '));
25
+
26
+ const Root = Accordion.Root as unknown as Component<Record<string, unknown>>;
27
+ </script>
28
+
29
+ <Root {type} class={className} data-slot="accordion" {...rest} />
30
+
31
+ <style>
32
+ :global(.sve-accordion) {
33
+ display: block;
34
+ font-family: var(--sve-font-family-sans);
35
+ border-top: 1px solid var(--sve-color-default-border);
36
+ }
37
+ </style>
@@ -0,0 +1,21 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ /**
4
+ * Bits' Accordion.Root props are a discriminated union (single vs multiple)
5
+ * over 400+ HTML attributes, which overflows TypeScript's union representation
6
+ * when spread. We expose a flat, non-union surface here and forward it to a
7
+ * loosely-typed view of the Bits root — behavior is unchanged.
8
+ */
9
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
10
+ type?: 'single' | 'multiple';
11
+ value?: string | string[];
12
+ onValueChange?: (value: string & string[]) => void;
13
+ disabled?: boolean;
14
+ loop?: boolean;
15
+ class?: string;
16
+ children?: Snippet;
17
+ }
18
+ declare const AccordionRoot: Component<Props, {}, "">;
19
+ type AccordionRoot = ReturnType<typeof AccordionRoot>;
20
+ export default AccordionRoot;
21
+ //# sourceMappingURL=AccordionRoot.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionRoot.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Accordion/AccordionRoot.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD;;;;;GAKG;AACH,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACnE,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAoBH,QAAA,MAAM,aAAa,0BAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,71 @@
1
+ <script lang="ts">
2
+ import { Accordion } from 'bits-ui';
3
+ import type { ComponentProps, Snippet } from 'svelte';
4
+
5
+ type BitsTriggerProps = ComponentProps<typeof Accordion.Trigger>;
6
+
7
+ interface Props extends Omit<BitsTriggerProps, 'class' | 'children'> {
8
+ class?: string;
9
+ children?: Snippet;
10
+ }
11
+
12
+ let { class: cls, children, ...rest }: Props = $props();
13
+
14
+ const className = $derived(['sve-accordion__trigger', cls].filter(Boolean).join(' '));
15
+ </script>
16
+
17
+ <Accordion.Trigger class={className} data-slot="accordion-trigger" {...rest}>
18
+ <span class="sve-accordion__label">{@render children?.()}</span>
19
+ <svg class="sve-accordion__chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
20
+ <path d="m6 9 6 6 6-6" />
21
+ </svg>
22
+ </Accordion.Trigger>
23
+
24
+ <style>
25
+ :global(.sve-accordion__trigger) {
26
+ display: flex;
27
+ width: 100%;
28
+ align-items: center;
29
+ justify-content: space-between;
30
+ gap: var(--sve-space-2);
31
+ padding: var(--sve-space-4) 0;
32
+ border: none;
33
+ background-color: transparent;
34
+ color: var(--sve-color-default-foreground);
35
+ font-family: var(--sve-font-family-sans);
36
+ font-size: var(--sve-font-size-md);
37
+ font-weight: var(--sve-font-weight-medium);
38
+ text-align: left;
39
+ cursor: pointer;
40
+ }
41
+
42
+ :global(.sve-accordion__trigger:focus-visible) {
43
+ outline: 2px solid var(--sve-color-primary);
44
+ outline-offset: 2px;
45
+ border-radius: var(--sve-radius-sm);
46
+ }
47
+
48
+ :global(.sve-accordion__trigger:disabled) {
49
+ opacity: 0.5;
50
+ cursor: not-allowed;
51
+ }
52
+
53
+ :global(.sve-accordion__chevron) {
54
+ width: 1.25rem;
55
+ height: 1.25rem;
56
+ flex-shrink: 0;
57
+ color: var(--sve-color-default-foreground);
58
+ opacity: 0.6;
59
+ transition: transform 0.2s ease;
60
+ }
61
+
62
+ :global(.sve-accordion__trigger[data-state='open'] .sve-accordion__chevron) {
63
+ transform: rotate(180deg);
64
+ }
65
+
66
+ @media (prefers-reduced-motion: reduce) {
67
+ :global(.sve-accordion__chevron) {
68
+ transition: none;
69
+ }
70
+ }
71
+ </style>
@@ -0,0 +1,11 @@
1
+ import { Accordion } from 'bits-ui';
2
+ import type { ComponentProps, Snippet } from 'svelte';
3
+ type BitsTriggerProps = ComponentProps<typeof Accordion.Trigger>;
4
+ interface Props extends Omit<BitsTriggerProps, 'class' | 'children'> {
5
+ class?: string;
6
+ children?: Snippet;
7
+ }
8
+ declare const AccordionTrigger: import("svelte").Component<Props, {}, "">;
9
+ type AccordionTrigger = ReturnType<typeof AccordionTrigger>;
10
+ export default AccordionTrigger;
11
+ //# sourceMappingURL=AccordionTrigger.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionTrigger.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Accordion/AccordionTrigger.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAEjE,UAAU,KAAM,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,CAAC;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAuBH,QAAA,MAAM,gBAAgB,2CAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Accordion namespace — sve-ui styled wrappers over bits-ui Accordion.
3
+ *
4
+ * Root: container; requires `type` ("single" | "multiple"); `bind:value` tracks
5
+ * the open item(s) (Bits owns ARIA, keyboard, and open/close state).
6
+ * Item / Header / Trigger / Content: styled parts. Trigger includes a chevron
7
+ * that rotates on open; compose Trigger inside Header.
8
+ */
9
+ export { default as Root } from './AccordionRoot.svelte';
10
+ export { default as Item } from './AccordionItem.svelte';
11
+ export { default as Header } from './AccordionHeader.svelte';
12
+ export { default as Trigger } from './AccordionTrigger.svelte';
13
+ export { default as Content } from './AccordionContent.svelte';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Accordion/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Accordion namespace — sve-ui styled wrappers over bits-ui Accordion.
3
+ *
4
+ * Root: container; requires `type` ("single" | "multiple"); `bind:value` tracks
5
+ * the open item(s) (Bits owns ARIA, keyboard, and open/close state).
6
+ * Item / Header / Trigger / Content: styled parts. Trigger includes a chevron
7
+ * that rotates on open; compose Trigger inside Header.
8
+ */
9
+ export { default as Root } from './AccordionRoot.svelte';
10
+ export { default as Item } from './AccordionItem.svelte';
11
+ export { default as Header } from './AccordionHeader.svelte';
12
+ export { default as Trigger } from './AccordionTrigger.svelte';
13
+ export { default as Content } from './AccordionContent.svelte';
@@ -0,0 +1,95 @@
1
+ <script module lang="ts">
2
+ export type Size = 'sm' | 'md' | 'lg';
3
+ </script>
4
+
5
+ <script lang="ts">
6
+ import { Checkbox } from 'bits-ui';
7
+ import type { ComponentProps } from 'svelte';
8
+
9
+ type BitsRootProps = ComponentProps<typeof Checkbox.Root>;
10
+
11
+ interface Props extends Omit<BitsRootProps, 'class' | 'children'> {
12
+ size?: Size;
13
+ class?: string;
14
+ }
15
+
16
+ let {
17
+ size = 'md',
18
+ checked = $bindable(false),
19
+ indeterminate = $bindable(false),
20
+ class: cls,
21
+ ...rest
22
+ }: Props = $props();
23
+
24
+ const className = $derived(
25
+ ['sve-checkbox', `sve-checkbox--${size}`, cls].filter(Boolean).join(' ')
26
+ );
27
+ </script>
28
+
29
+ <Checkbox.Root
30
+ bind:checked
31
+ bind:indeterminate
32
+ class={className}
33
+ data-slot="checkbox"
34
+ {...rest}
35
+ >
36
+ {#snippet children({ checked, indeterminate })}
37
+ {#if indeterminate}
38
+ <svg class="sve-checkbox__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.2" stroke-linecap="round" aria-hidden="true">
39
+ <path d="M5 12h14" />
40
+ </svg>
41
+ {:else if checked}
42
+ <svg class="sve-checkbox__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
43
+ <path d="M20 6 9 17l-5-5" />
44
+ </svg>
45
+ {/if}
46
+ {/snippet}
47
+ </Checkbox.Root>
48
+
49
+ <style>
50
+ :global(.sve-checkbox) {
51
+ display: inline-flex;
52
+ align-items: center;
53
+ justify-content: center;
54
+ flex-shrink: 0;
55
+ padding: 0;
56
+ border: 1px solid var(--sve-color-default-border);
57
+ border-radius: var(--sve-radius-sm);
58
+ background-color: transparent;
59
+ color: var(--sve-color-primary-foreground);
60
+ cursor: pointer;
61
+ transition: background-color 0.15s ease, border-color 0.15s ease;
62
+ }
63
+
64
+ :global(.sve-checkbox[data-state='checked']),
65
+ :global(.sve-checkbox[data-state='indeterminate']) {
66
+ background-color: var(--sve-color-primary);
67
+ border-color: var(--sve-color-primary);
68
+ }
69
+
70
+ :global(.sve-checkbox:focus-visible) {
71
+ outline: 2px solid var(--sve-color-primary);
72
+ outline-offset: 2px;
73
+ }
74
+
75
+ :global(.sve-checkbox:disabled) {
76
+ opacity: 0.5;
77
+ cursor: not-allowed;
78
+ }
79
+
80
+ :global(.sve-checkbox__icon) {
81
+ width: 80%;
82
+ height: 80%;
83
+ }
84
+
85
+ /* --- Sizes --- */
86
+ :global(.sve-checkbox--sm) { width: 1rem; height: 1rem; }
87
+ :global(.sve-checkbox--md) { width: 1.25rem; height: 1.25rem; }
88
+ :global(.sve-checkbox--lg) { width: 1.5rem; height: 1.5rem; }
89
+
90
+ @media (prefers-reduced-motion: reduce) {
91
+ :global(.sve-checkbox) {
92
+ transition: none;
93
+ }
94
+ }
95
+ </style>
@@ -0,0 +1,12 @@
1
+ export type Size = 'sm' | 'md' | 'lg';
2
+ import { Checkbox } from 'bits-ui';
3
+ import type { ComponentProps } from 'svelte';
4
+ type BitsRootProps = ComponentProps<typeof Checkbox.Root>;
5
+ interface Props extends Omit<BitsRootProps, 'class' | 'children'> {
6
+ size?: Size;
7
+ class?: string;
8
+ }
9
+ declare const CheckboxRoot: import("svelte").Component<Props, {}, "checked" | "indeterminate">;
10
+ type CheckboxRoot = ReturnType<typeof CheckboxRoot>;
11
+ export default CheckboxRoot;
12
+ //# sourceMappingURL=CheckboxRoot.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxRoot.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Checkbox/CheckboxRoot.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAGxC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AAE1D,UAAU,KAAM,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,UAAU,CAAC;IAC/D,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwCH,QAAA,MAAM,YAAY,oEAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Checkbox namespace — sve-ui styled wrapper over the bits-ui Checkbox primitive.
3
+ *
4
+ * Root: styled box + check/indeterminate indicator (Bits owns ARIA
5
+ * role="checkbox", keyboard, and state). `bind:checked` and `bind:indeterminate`
6
+ * are forwarded to the Bits root.
7
+ */
8
+ export { default as Root, type Size as CheckboxSize } from './CheckboxRoot.svelte';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Checkbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Checkbox namespace — sve-ui styled wrapper over the bits-ui Checkbox primitive.
3
+ *
4
+ * Root: styled box + check/indeterminate indicator (Bits owns ARIA
5
+ * role="checkbox", keyboard, and state). `bind:checked` and `bind:indeterminate`
6
+ * are forwarded to the Bits root.
7
+ */
8
+ export { default as Root } from './CheckboxRoot.svelte';
@@ -0,0 +1,130 @@
1
+ <script lang="ts">
2
+ import { onDestroy } from 'svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
6
+ /** The code to display (and copy). Kept as a string so copy is SSR-safe — no DOM scraping. */
7
+ code: string;
8
+ /** Optional header label, e.g. a filename or language. */
9
+ label?: string;
10
+ /** Show the copy-to-clipboard button. */
11
+ copyable?: boolean;
12
+ class?: string;
13
+ }
14
+
15
+ let { code, label, copyable = true, class: cls, ...rest }: Props = $props();
16
+
17
+ const className = $derived(['sve-code', cls].filter(Boolean).join(' '));
18
+
19
+ let copied = $state(false);
20
+ let resetTimer: ReturnType<typeof setTimeout> | undefined;
21
+
22
+ async function copy() {
23
+ // SSR-safe: only touched on click, and guarded for environments without the API.
24
+ if (typeof navigator === 'undefined' || !navigator.clipboard) return;
25
+ try {
26
+ await navigator.clipboard.writeText(code);
27
+ copied = true;
28
+ clearTimeout(resetTimer);
29
+ resetTimer = setTimeout(() => (copied = false), 1500);
30
+ } catch {
31
+ // Clipboard denied/unavailable — silently no-op.
32
+ }
33
+ }
34
+
35
+ onDestroy(() => clearTimeout(resetTimer));
36
+ </script>
37
+
38
+ <div class={className} {...rest}>
39
+ {#if label || copyable}
40
+ <div class="sve-code__bar">
41
+ {#if label}<span class="sve-code__label">{label}</span>{/if}
42
+ {#if copyable}
43
+ <button
44
+ type="button"
45
+ class="sve-code__copy"
46
+ onclick={copy}
47
+ aria-label={copied ? 'Copied' : 'Copy code'}
48
+ >
49
+ {#if copied}
50
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5" /></svg>
51
+ {:else}
52
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2" /><path d="M5 15V5a2 2 0 0 1 2-2h10" /></svg>
53
+ {/if}
54
+ </button>
55
+ {/if}
56
+ </div>
57
+ {/if}
58
+ <pre class="sve-code__pre"><code>{code}</code></pre>
59
+ </div>
60
+
61
+ <style>
62
+ .sve-code {
63
+ position: relative;
64
+ border: 1px solid var(--sve-color-default-border);
65
+ border-radius: var(--sve-radius-md);
66
+ background-color: var(--sve-color-default-surface);
67
+ overflow: hidden;
68
+ font-family: var(--sve-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
69
+ }
70
+
71
+ .sve-code__bar {
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: space-between;
75
+ gap: var(--sve-space-2);
76
+ min-height: 2.25rem;
77
+ padding: 0 var(--sve-space-2) 0 var(--sve-space-3);
78
+ border-bottom: 1px solid var(--sve-color-default-border);
79
+ }
80
+
81
+ .sve-code__label {
82
+ font-size: var(--sve-font-size-xs);
83
+ font-weight: var(--sve-font-weight-medium);
84
+ color: var(--sve-color-default-foreground);
85
+ opacity: 0.7;
86
+ }
87
+
88
+ .sve-code__copy {
89
+ display: inline-flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ margin-left: auto;
93
+ width: 1.75rem;
94
+ height: 1.75rem;
95
+ padding: 0;
96
+ border: none;
97
+ border-radius: var(--sve-radius-sm);
98
+ background-color: transparent;
99
+ color: var(--sve-color-default-foreground);
100
+ cursor: pointer;
101
+ transition: background-color 0.15s ease, color 0.15s ease;
102
+ }
103
+
104
+ .sve-code__copy:hover {
105
+ background-color: var(--sve-color-default);
106
+ }
107
+
108
+ .sve-code__copy:focus-visible {
109
+ outline: 2px solid var(--sve-color-primary);
110
+ outline-offset: 2px;
111
+ }
112
+
113
+ .sve-code__copy svg {
114
+ width: 1rem;
115
+ height: 1rem;
116
+ }
117
+
118
+ .sve-code__pre {
119
+ margin: 0;
120
+ padding: var(--sve-space-4);
121
+ overflow-x: auto;
122
+ font-size: var(--sve-font-size-sm);
123
+ line-height: var(--sve-line-height-relaxed);
124
+ color: var(--sve-color-default-foreground);
125
+ }
126
+
127
+ .sve-code__pre code {
128
+ font-family: inherit;
129
+ }
130
+ </style>
@@ -0,0 +1,14 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
3
+ /** The code to display (and copy). Kept as a string so copy is SSR-safe — no DOM scraping. */
4
+ code: string;
5
+ /** Optional header label, e.g. a filename or language. */
6
+ label?: string;
7
+ /** Show the copy-to-clipboard button. */
8
+ copyable?: boolean;
9
+ class?: string;
10
+ }
11
+ declare const Code: import("svelte").Component<Props, {}, "">;
12
+ type Code = ReturnType<typeof Code>;
13
+ export default Code;
14
+ //# sourceMappingURL=Code.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Code.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Code/Code.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACnE,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmDH,QAAA,MAAM,IAAI,2CAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -0,0 +1,33 @@
1
+ <script lang="ts">
2
+ import { Combobox } from 'bits-ui';
3
+ import type { ComponentProps } from 'svelte';
4
+
5
+ type BitsContentProps = ComponentProps<typeof Combobox.Content>;
6
+
7
+ interface Props extends Omit<BitsContentProps, 'class'> {
8
+ class?: string;
9
+ }
10
+
11
+ let { class: cls, ...rest }: Props = $props();
12
+
13
+ const className = $derived(['sve-combobox__content', cls].filter(Boolean).join(' '));
14
+ </script>
15
+
16
+ <Combobox.Portal>
17
+ <Combobox.Content class={className} data-slot="combobox-content" {...rest} />
18
+ </Combobox.Portal>
19
+
20
+ <style>
21
+ :global(.sve-combobox__content) {
22
+ z-index: 60;
23
+ min-width: var(--bits-combobox-anchor-width, 12rem);
24
+ max-height: 18rem;
25
+ overflow-y: auto;
26
+ padding: var(--sve-space-1);
27
+ border: 1px solid var(--sve-color-default-border);
28
+ border-radius: var(--sve-radius-md);
29
+ background-color: var(--sve-color-default-surface);
30
+ box-shadow: var(--sve-shadow-md);
31
+ font-family: var(--sve-font-family-sans);
32
+ }
33
+ </style>