@sentropic/design-system-svelte 0.3.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 (82) hide show
  1. package/dist/Alert.svelte +92 -0
  2. package/dist/Alert.svelte.d.ts +14 -0
  3. package/dist/Alert.svelte.d.ts.map +1 -0
  4. package/dist/Badge.svelte +55 -0
  5. package/dist/Badge.svelte.d.ts +11 -0
  6. package/dist/Badge.svelte.d.ts.map +1 -0
  7. package/dist/Breadcrumb.svelte +67 -0
  8. package/dist/Breadcrumb.svelte.d.ts +15 -0
  9. package/dist/Breadcrumb.svelte.d.ts.map +1 -0
  10. package/dist/Button.svelte +99 -0
  11. package/dist/Button.svelte.d.ts +14 -0
  12. package/dist/Button.svelte.d.ts.map +1 -0
  13. package/dist/Card.svelte +42 -0
  14. package/dist/Card.svelte.d.ts +11 -0
  15. package/dist/Card.svelte.d.ts.map +1 -0
  16. package/dist/Checkbox.svelte +56 -0
  17. package/dist/Checkbox.svelte.d.ts +11 -0
  18. package/dist/Checkbox.svelte.d.ts.map +1 -0
  19. package/dist/Drawer.svelte +135 -0
  20. package/dist/Drawer.svelte.d.ts +17 -0
  21. package/dist/Drawer.svelte.d.ts.map +1 -0
  22. package/dist/Dropdown.svelte +158 -0
  23. package/dist/Dropdown.svelte.d.ts +19 -0
  24. package/dist/Dropdown.svelte.d.ts.map +1 -0
  25. package/dist/EmptyState.svelte +65 -0
  26. package/dist/EmptyState.svelte.d.ts +13 -0
  27. package/dist/EmptyState.svelte.d.ts.map +1 -0
  28. package/dist/Input.svelte +121 -0
  29. package/dist/Input.svelte.d.ts +13 -0
  30. package/dist/Input.svelte.d.ts.map +1 -0
  31. package/dist/Link.svelte +90 -0
  32. package/dist/Link.svelte.d.ts +17 -0
  33. package/dist/Link.svelte.d.ts.map +1 -0
  34. package/dist/LoadingState.svelte +77 -0
  35. package/dist/LoadingState.svelte.d.ts +10 -0
  36. package/dist/LoadingState.svelte.d.ts.map +1 -0
  37. package/dist/Menu.svelte +72 -0
  38. package/dist/Menu.svelte.d.ts +16 -0
  39. package/dist/Menu.svelte.d.ts.map +1 -0
  40. package/dist/Modal.svelte +123 -0
  41. package/dist/Modal.svelte.d.ts +16 -0
  42. package/dist/Modal.svelte.d.ts.map +1 -0
  43. package/dist/Pagination.svelte +75 -0
  44. package/dist/Pagination.svelte.d.ts +13 -0
  45. package/dist/Pagination.svelte.d.ts.map +1 -0
  46. package/dist/Popover.svelte +74 -0
  47. package/dist/Popover.svelte.d.ts +14 -0
  48. package/dist/Popover.svelte.d.ts.map +1 -0
  49. package/dist/Radio.svelte +51 -0
  50. package/dist/Radio.svelte.d.ts +11 -0
  51. package/dist/Radio.svelte.d.ts.map +1 -0
  52. package/dist/Select.svelte +109 -0
  53. package/dist/Select.svelte.d.ts +15 -0
  54. package/dist/Select.svelte.d.ts.map +1 -0
  55. package/dist/SideNav.svelte +63 -0
  56. package/dist/SideNav.svelte.d.ts +15 -0
  57. package/dist/SideNav.svelte.d.ts.map +1 -0
  58. package/dist/Switch.svelte +88 -0
  59. package/dist/Switch.svelte.d.ts +10 -0
  60. package/dist/Switch.svelte.d.ts.map +1 -0
  61. package/dist/Table.svelte +104 -0
  62. package/dist/Table.svelte.d.ts +17 -0
  63. package/dist/Table.svelte.d.ts.map +1 -0
  64. package/dist/Tabs.svelte +102 -0
  65. package/dist/Tabs.svelte.d.ts +18 -0
  66. package/dist/Tabs.svelte.d.ts.map +1 -0
  67. package/dist/Textarea.svelte +97 -0
  68. package/dist/Textarea.svelte.d.ts +12 -0
  69. package/dist/Textarea.svelte.d.ts.map +1 -0
  70. package/dist/ThemeProvider.svelte +22 -0
  71. package/dist/ThemeProvider.svelte.d.ts +11 -0
  72. package/dist/ThemeProvider.svelte.d.ts.map +1 -0
  73. package/dist/Toast.svelte +84 -0
  74. package/dist/Toast.svelte.d.ts +13 -0
  75. package/dist/Toast.svelte.d.ts.map +1 -0
  76. package/dist/Tooltip.svelte +66 -0
  77. package/dist/Tooltip.svelte.d.ts +12 -0
  78. package/dist/Tooltip.svelte.d.ts.map +1 -0
  79. package/dist/index.d.ts +33 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +26 -0
  82. package/package.json +47 -0
@@ -0,0 +1,16 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ export type MenuItem = {
3
+ label: string;
4
+ value: string;
5
+ disabled?: boolean;
6
+ };
7
+ type MenuProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onselect"> & {
8
+ label: string;
9
+ items: MenuItem[];
10
+ class?: string;
11
+ onselect?: (value: string) => void;
12
+ };
13
+ declare const Menu: import("svelte").Component<MenuProps, {}, "">;
14
+ type Menu = ReturnType<typeof Menu>;
15
+ export default Menu;
16
+ //# sourceMappingURL=Menu.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Menu.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAyBJ,QAAA,MAAM,IAAI,+CAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -0,0 +1,123 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type ModalProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
6
+ open?: boolean;
7
+ title: string;
8
+ description?: string;
9
+ closeLabel?: string;
10
+ class?: string;
11
+ children?: Snippet;
12
+ footer?: Snippet;
13
+ onclose?: () => void;
14
+ };
15
+
16
+ let {
17
+ open = false,
18
+ title,
19
+ description,
20
+ closeLabel = "Close",
21
+ class: className,
22
+ children,
23
+ footer,
24
+ onclose,
25
+ ...rest
26
+ }: ModalProps = $props();
27
+
28
+ const classes = () => ["st-modal", className].filter(Boolean).join(" ");
29
+ </script>
30
+
31
+ {#if open}
32
+ <div class="st-modal__backdrop">
33
+ <section {...rest} class={classes()} role="dialog" aria-modal="true" aria-label={title}>
34
+ <header class="st-modal__header">
35
+ <div>
36
+ <h2 class="st-modal__title">{title}</h2>
37
+ {#if description}<p class="st-modal__description">{description}</p>{/if}
38
+ </div>
39
+ <button class="st-modal__close" type="button" aria-label={closeLabel} onclick={onclose}>
40
+ <span aria-hidden="true">x</span>
41
+ </button>
42
+ </header>
43
+ <div class="st-modal__body">
44
+ {@render children?.()}
45
+ </div>
46
+ {#if footer}
47
+ <footer class="st-modal__footer">
48
+ {@render footer()}
49
+ </footer>
50
+ {/if}
51
+ </section>
52
+ </div>
53
+ {/if}
54
+
55
+ <style>
56
+ .st-modal__backdrop {
57
+ align-items: center;
58
+ background: var(--st-component-overlay-backdrop, var(--st-semantic-surface-overlay));
59
+ display: grid;
60
+ inset: 0;
61
+ justify-items: center;
62
+ padding: var(--st-spacing-4, 1rem);
63
+ position: fixed;
64
+ z-index: var(--st-component-overlay-zIndex, 90);
65
+ }
66
+
67
+ .st-modal {
68
+ background: var(--st-component-overlay-surface, var(--st-semantic-surface-raised));
69
+ border: 1px solid var(--st-component-overlay-border, var(--st-semantic-border-subtle));
70
+ border-radius: var(--st-component-overlay-radius, 0.5rem);
71
+ box-shadow: var(--st-component-overlay-shadow, 0 18px 45px rgb(15 23 42 / 0.18));
72
+ color: var(--st-semantic-text-primary);
73
+ display: grid;
74
+ gap: var(--st-spacing-4, 1rem);
75
+ max-height: min(42rem, calc(100vh - 2rem));
76
+ max-width: 36rem;
77
+ overflow: auto;
78
+ padding: var(--st-spacing-4, 1rem);
79
+ width: min(100%, 36rem);
80
+ }
81
+
82
+ .st-modal__header {
83
+ align-items: start;
84
+ display: flex;
85
+ gap: var(--st-spacing-4, 1rem);
86
+ justify-content: space-between;
87
+ }
88
+
89
+ .st-modal__title {
90
+ font-size: 1.25rem;
91
+ line-height: 1.2;
92
+ margin: 0;
93
+ }
94
+
95
+ .st-modal__description {
96
+ color: var(--st-semantic-text-secondary);
97
+ line-height: 1.5;
98
+ margin: 0.5rem 0 0;
99
+ }
100
+
101
+ .st-modal__close {
102
+ align-items: center;
103
+ background: transparent;
104
+ border: 1px solid var(--st-semantic-border-subtle);
105
+ border-radius: var(--st-radius-small, 0.375rem);
106
+ color: var(--st-semantic-text-primary);
107
+ cursor: pointer;
108
+ display: inline-flex;
109
+ height: 2rem;
110
+ justify-content: center;
111
+ width: 2rem;
112
+ }
113
+
114
+ .st-modal__body {
115
+ line-height: 1.5;
116
+ }
117
+
118
+ .st-modal__footer {
119
+ display: flex;
120
+ gap: var(--st-spacing-2, 0.5rem);
121
+ justify-content: flex-end;
122
+ }
123
+ </style>
@@ -0,0 +1,16 @@
1
+ import type { Snippet } from "svelte";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ type ModalProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
4
+ open?: boolean;
5
+ title: string;
6
+ description?: string;
7
+ closeLabel?: string;
8
+ class?: string;
9
+ children?: Snippet;
10
+ footer?: Snippet;
11
+ onclose?: () => void;
12
+ };
13
+ declare const Modal: import("svelte").Component<ModalProps, {}, "">;
14
+ type Modal = ReturnType<typeof Modal>;
15
+ export default Modal;
16
+ //# sourceMappingURL=Modal.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Modal.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IAC7D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAiDJ,QAAA,MAAM,KAAK,gDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,75 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+
4
+ type PaginationProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
5
+ page: number;
6
+ pageCount: number;
7
+ previousLabel?: string;
8
+ nextLabel?: string;
9
+ class?: string;
10
+ onpagechange?: (page: number) => void;
11
+ };
12
+
13
+ let {
14
+ page,
15
+ pageCount,
16
+ previousLabel = "Previous",
17
+ nextLabel = "Next",
18
+ class: className,
19
+ onpagechange,
20
+ ...rest
21
+ }: PaginationProps = $props();
22
+
23
+ const classes = () => ["st-pagination", className].filter(Boolean).join(" ");
24
+ const pages = () => Array.from({ length: pageCount }, (_, index) => index + 1);
25
+ const go = (target: number) => {
26
+ if (target >= 1 && target <= pageCount && target !== page) onpagechange?.(target);
27
+ };
28
+ </script>
29
+
30
+ <nav {...rest} class={classes()} aria-label="Pagination">
31
+ <button type="button" disabled={page <= 1} onclick={() => go(page - 1)}>{previousLabel}</button>
32
+ {#each pages() as item}
33
+ <button
34
+ type="button"
35
+ class:st-pagination__page--active={item === page}
36
+ aria-label={`Page ${item}`}
37
+ aria-current={item === page ? "page" : undefined}
38
+ onclick={() => go(item)}
39
+ >
40
+ {item}
41
+ </button>
42
+ {/each}
43
+ <button type="button" disabled={page >= pageCount} onclick={() => go(page + 1)}>{nextLabel}</button>
44
+ </nav>
45
+
46
+ <style>
47
+ .st-pagination {
48
+ display: flex;
49
+ flex-wrap: wrap;
50
+ gap: var(--st-spacing-2, 0.5rem);
51
+ }
52
+
53
+ .st-pagination button {
54
+ background: var(--st-component-pagination-background, var(--st-semantic-surface-default));
55
+ border: 1px solid var(--st-component-pagination-border, var(--st-semantic-border-subtle));
56
+ border-radius: var(--st-component-pagination-radius, 0.375rem);
57
+ color: var(--st-component-pagination-text, var(--st-semantic-text-primary));
58
+ cursor: pointer;
59
+ font: inherit;
60
+ min-height: 2.25rem;
61
+ min-width: 2.25rem;
62
+ padding: 0 0.75rem;
63
+ }
64
+
65
+ .st-pagination__page--active {
66
+ background: var(--st-component-pagination-activeBackground, var(--st-semantic-action-primary));
67
+ color: var(--st-component-pagination-activeText, var(--st-semantic-action-primaryText));
68
+ }
69
+
70
+ .st-pagination button:disabled {
71
+ color: var(--st-component-pagination-disabledText, var(--st-semantic-text-muted));
72
+ cursor: not-allowed;
73
+ opacity: 0.65;
74
+ }
75
+ </style>
@@ -0,0 +1,13 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ type PaginationProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
3
+ page: number;
4
+ pageCount: number;
5
+ previousLabel?: string;
6
+ nextLabel?: string;
7
+ class?: string;
8
+ onpagechange?: (page: number) => void;
9
+ };
10
+ declare const Pagination: import("svelte").Component<PaginationProps, {}, "">;
11
+ type Pagination = ReturnType<typeof Pagination>;
12
+ export default Pagination;
13
+ //# sourceMappingURL=Pagination.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pagination.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Pagination.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAoCJ,QAAA,MAAM,UAAU,qDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -0,0 +1,74 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type PopoverProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
6
+ open?: boolean;
7
+ label: string;
8
+ placement?: "top" | "right" | "bottom" | "left";
9
+ class?: string;
10
+ trigger?: Snippet;
11
+ children?: Snippet;
12
+ };
13
+
14
+ let {
15
+ open = false,
16
+ label,
17
+ placement = "bottom",
18
+ class: className,
19
+ trigger,
20
+ children,
21
+ ...rest
22
+ }: PopoverProps = $props();
23
+
24
+ const classes = () =>
25
+ ["st-popover", `st-popover--${placement}`, className].filter(Boolean).join(" ");
26
+ </script>
27
+
28
+ <span class="st-popover-host">
29
+ {@render trigger?.()}
30
+ {#if open}
31
+ <section {...rest} class={classes()} role="dialog" aria-label={label}>
32
+ {@render children?.()}
33
+ </section>
34
+ {/if}
35
+ </span>
36
+
37
+ <style>
38
+ .st-popover-host {
39
+ display: inline-block;
40
+ position: relative;
41
+ }
42
+
43
+ .st-popover {
44
+ background: var(--st-component-popover-background, var(--st-semantic-surface-raised));
45
+ border: 1px solid var(--st-component-popover-border, var(--st-semantic-border-subtle));
46
+ border-radius: var(--st-component-popover-radius, 0.5rem);
47
+ box-shadow: var(--st-component-popover-shadow, 0 18px 45px rgb(15 23 42 / 0.18));
48
+ color: var(--st-component-popover-text, var(--st-semantic-text-primary));
49
+ min-width: 16rem;
50
+ padding: var(--st-spacing-4, 1rem);
51
+ position: absolute;
52
+ z-index: var(--st-component-popover-zIndex, 80);
53
+ }
54
+
55
+ .st-popover--bottom {
56
+ left: 0;
57
+ top: calc(100% + var(--st-spacing-2, 0.5rem));
58
+ }
59
+
60
+ .st-popover--top {
61
+ bottom: calc(100% + var(--st-spacing-2, 0.5rem));
62
+ left: 0;
63
+ }
64
+
65
+ .st-popover--right {
66
+ left: calc(100% + var(--st-spacing-2, 0.5rem));
67
+ top: 0;
68
+ }
69
+
70
+ .st-popover--left {
71
+ right: calc(100% + var(--st-spacing-2, 0.5rem));
72
+ top: 0;
73
+ }
74
+ </style>
@@ -0,0 +1,14 @@
1
+ import type { Snippet } from "svelte";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ type PopoverProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
4
+ open?: boolean;
5
+ label: string;
6
+ placement?: "top" | "right" | "bottom" | "left";
7
+ class?: string;
8
+ trigger?: Snippet;
9
+ children?: Snippet;
10
+ };
11
+ declare const Popover: import("svelte").Component<PopoverProps, {}, "">;
12
+ type Popover = ReturnType<typeof Popover>;
13
+ export default Popover;
14
+ //# sourceMappingURL=Popover.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Popover.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IAC/D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAiCJ,QAAA,MAAM,OAAO,kDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
@@ -0,0 +1,51 @@
1
+ <script lang="ts">
2
+ import type { HTMLInputAttributes } from "svelte/elements";
3
+
4
+ type RadioProps = Omit<HTMLInputAttributes, "class" | "type"> & {
5
+ label: string;
6
+ helperText?: string;
7
+ invalid?: boolean;
8
+ class?: string;
9
+ };
10
+
11
+ let { label, helperText, invalid = false, class: className, ...rest }: RadioProps = $props();
12
+ const classes = () => ["st-choice", className].filter(Boolean).join(" ");
13
+ </script>
14
+
15
+ <label class={classes()}>
16
+ <input {...rest} class="st-choice__input" type="radio" data-invalid={invalid ? "true" : undefined} />
17
+ <span class="st-choice__content">
18
+ <span class="st-choice__label">{label}</span>
19
+ {#if helperText}<span class="st-choice__help">{helperText}</span>{/if}
20
+ </span>
21
+ </label>
22
+
23
+ <style>
24
+ .st-choice {
25
+ align-items: start;
26
+ color: var(--st-component-field-labelText, var(--st-semantic-text-primary));
27
+ display: inline-grid;
28
+ gap: 0.625rem;
29
+ grid-template-columns: auto 1fr;
30
+ }
31
+
32
+ .st-choice__input {
33
+ height: 1rem;
34
+ margin: 0.125rem 0 0;
35
+ width: 1rem;
36
+ }
37
+
38
+ .st-choice__content {
39
+ display: grid;
40
+ gap: 0.25rem;
41
+ }
42
+
43
+ .st-choice__label {
44
+ font-size: 0.9375rem;
45
+ }
46
+
47
+ .st-choice__help {
48
+ color: var(--st-component-field-helpText, var(--st-semantic-text-secondary));
49
+ font-size: 0.8125rem;
50
+ }
51
+ </style>
@@ -0,0 +1,11 @@
1
+ import type { HTMLInputAttributes } from "svelte/elements";
2
+ type RadioProps = Omit<HTMLInputAttributes, "class" | "type"> & {
3
+ label: string;
4
+ helperText?: string;
5
+ invalid?: boolean;
6
+ class?: string;
7
+ };
8
+ declare const Radio: import("svelte").Component<RadioProps, {}, "">;
9
+ type Radio = ReturnType<typeof Radio>;
10
+ export default Radio;
11
+ //# sourceMappingURL=Radio.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Radio.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Radio.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAqBJ,QAAA,MAAM,KAAK,gDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,109 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLSelectAttributes } from "svelte/elements";
4
+
5
+ type SelectProps = Omit<HTMLSelectAttributes, "class" | "size"> & {
6
+ label?: string;
7
+ helperText?: string;
8
+ errorText?: string;
9
+ invalid?: boolean;
10
+ size?: "sm" | "md" | "lg";
11
+ class?: string;
12
+ children?: Snippet;
13
+ };
14
+
15
+ let {
16
+ label,
17
+ helperText,
18
+ errorText,
19
+ invalid = false,
20
+ size = "md",
21
+ class: className,
22
+ children,
23
+ ...rest
24
+ }: SelectProps = $props();
25
+
26
+ const fieldClasses = () => ["st-field", className].filter(Boolean).join(" ");
27
+ const controlClasses = () => ["st-select", `st-select--${size}`].join(" ");
28
+ const isInvalid = () => invalid || Boolean(errorText);
29
+ </script>
30
+
31
+ <div class={fieldClasses()}>
32
+ <label class="st-field__control">
33
+ {#if label}<span class="st-field__label">{label}</span>{/if}
34
+ <select {...rest} class={controlClasses()} aria-invalid={isInvalid() ? "true" : undefined}>
35
+ {@render children?.()}
36
+ </select>
37
+ </label>
38
+ {#if errorText}
39
+ <span class="st-field__error">{errorText}</span>
40
+ {:else if helperText}
41
+ <span class="st-field__help">{helperText}</span>
42
+ {/if}
43
+ </div>
44
+
45
+ <style>
46
+ .st-field {
47
+ color: var(--st-component-field-labelText, var(--st-semantic-text-primary));
48
+ display: grid;
49
+ gap: var(--st-component-field-gap, 0.5rem);
50
+ max-width: var(--st-component-field-maxWidth, 28rem);
51
+ }
52
+
53
+ .st-field__control {
54
+ display: grid;
55
+ gap: var(--st-component-field-gap, 0.5rem);
56
+ }
57
+
58
+ .st-field__label {
59
+ font-size: 0.875rem;
60
+ font-weight: 600;
61
+ }
62
+
63
+ .st-field__help,
64
+ .st-field__error {
65
+ font-size: 0.8125rem;
66
+ line-height: 1.4;
67
+ }
68
+
69
+ .st-field__help {
70
+ color: var(--st-component-field-helpText, var(--st-semantic-text-secondary));
71
+ }
72
+
73
+ .st-field__error {
74
+ color: var(--st-component-field-errorText, var(--st-semantic-feedback-error));
75
+ }
76
+
77
+ .st-select {
78
+ background: var(--st-component-control-background, var(--st-semantic-surface-default));
79
+ border: 1px solid var(--st-component-control-border, var(--st-semantic-border-subtle));
80
+ border-radius: var(--st-component-control-radius, 0.375rem);
81
+ color: var(--st-component-control-text, var(--st-semantic-text-primary));
82
+ font: inherit;
83
+ min-width: 0;
84
+ padding: 0 2rem 0 0.75rem;
85
+ width: 100%;
86
+ }
87
+
88
+ .st-select--sm {
89
+ min-height: var(--st-component-control-smHeight, 2rem);
90
+ }
91
+
92
+ .st-select--md {
93
+ min-height: var(--st-component-control-mdHeight, 2.5rem);
94
+ }
95
+
96
+ .st-select--lg {
97
+ min-height: var(--st-component-control-lgHeight, 3rem);
98
+ }
99
+
100
+ .st-select:focus-visible {
101
+ border-color: var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
102
+ box-shadow: 0 0 0 2px var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
103
+ outline: none;
104
+ }
105
+
106
+ .st-select[aria-invalid="true"] {
107
+ border-color: var(--st-component-control-invalidBorder, var(--st-semantic-feedback-error));
108
+ }
109
+ </style>
@@ -0,0 +1,15 @@
1
+ import type { Snippet } from "svelte";
2
+ import type { HTMLSelectAttributes } from "svelte/elements";
3
+ type SelectProps = Omit<HTMLSelectAttributes, "class" | "size"> & {
4
+ label?: string;
5
+ helperText?: string;
6
+ errorText?: string;
7
+ invalid?: boolean;
8
+ size?: "sm" | "md" | "lg";
9
+ class?: string;
10
+ children?: Snippet;
11
+ };
12
+ declare const Select: import("svelte").Component<SelectProps, {}, "">;
13
+ type Select = ReturnType<typeof Select>;
14
+ export default Select;
15
+ //# sourceMappingURL=Select.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Select.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,KAAK,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAwCJ,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
@@ -0,0 +1,63 @@
1
+ <script lang="ts" module>
2
+ export interface SideNavItem {
3
+ label: string;
4
+ href: string;
5
+ active?: boolean;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import type { HTMLAttributes } from "svelte/elements";
11
+
12
+ type SideNavProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
13
+ items: SideNavItem[];
14
+ label?: string;
15
+ class?: string;
16
+ };
17
+
18
+ let { items, label = "Navigation", class: className, ...rest }: SideNavProps = $props();
19
+ const classes = () => ["st-sidenav", className].filter(Boolean).join(" ");
20
+ </script>
21
+
22
+ <nav {...rest} class={classes()} aria-label={label}>
23
+ <ul>
24
+ {#each items as item}
25
+ <li>
26
+ <a class:st-sidenav__link--active={item.active} href={item.href} aria-current={item.active ? "page" : undefined}>
27
+ {item.label}
28
+ </a>
29
+ </li>
30
+ {/each}
31
+ </ul>
32
+ </nav>
33
+
34
+ <style>
35
+ .st-sidenav {
36
+ background: var(--st-component-sideNav-background, var(--st-semantic-surface-default));
37
+ border-right: 1px solid var(--st-component-sideNav-border, var(--st-semantic-border-subtle));
38
+ padding: var(--st-spacing-3, 0.75rem);
39
+ width: var(--st-component-sideNav-width, 16rem);
40
+ }
41
+
42
+ .st-sidenav ul {
43
+ display: grid;
44
+ gap: 0.25rem;
45
+ list-style: none;
46
+ margin: 0;
47
+ padding: 0;
48
+ }
49
+
50
+ .st-sidenav a {
51
+ border-radius: var(--st-radius-small, 0.375rem);
52
+ color: var(--st-component-sideNav-itemText, var(--st-semantic-text-secondary));
53
+ display: block;
54
+ padding: 0.625rem 0.75rem;
55
+ text-decoration: none;
56
+ }
57
+
58
+ .st-sidenav__link--active {
59
+ background: var(--st-component-sideNav-activeBackground, var(--st-semantic-surface-subtle));
60
+ color: var(--st-component-sideNav-activeText, var(--st-semantic-text-primary));
61
+ font-weight: 650;
62
+ }
63
+ </style>
@@ -0,0 +1,15 @@
1
+ export interface SideNavItem {
2
+ label: string;
3
+ href: string;
4
+ active?: boolean;
5
+ }
6
+ import type { HTMLAttributes } from "svelte/elements";
7
+ type SideNavProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
8
+ items: SideNavItem[];
9
+ label?: string;
10
+ class?: string;
11
+ };
12
+ declare const SideNav: import("svelte").Component<SideNavProps, {}, "">;
13
+ type SideNav = ReturnType<typeof SideNav>;
14
+ export default SideNav;
15
+ //# sourceMappingURL=SideNav.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideNav.svelte.d.ts","sourceRoot":"","sources":["../src/lib/SideNav.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IAC/D,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA2BJ,QAAA,MAAM,OAAO,kDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}