@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,88 @@
1
+ <script lang="ts">
2
+ import type { HTMLInputAttributes } from "svelte/elements";
3
+
4
+ type SwitchProps = Omit<HTMLInputAttributes, "class" | "role" | "type"> & {
5
+ label: string;
6
+ helperText?: string;
7
+ class?: string;
8
+ };
9
+
10
+ let { label, helperText, checked = false, class: className, ...rest }: SwitchProps = $props();
11
+ const classes = () => ["st-switch", className].filter(Boolean).join(" ");
12
+ </script>
13
+
14
+ <label class={classes()}>
15
+ <input {...rest} class="st-switch__input" type="checkbox" role="switch" {checked} aria-checked={checked ? "true" : "false"} />
16
+ <span class="st-switch__track" aria-hidden="true">
17
+ <span class="st-switch__thumb"></span>
18
+ </span>
19
+ <span class="st-switch__content">
20
+ <span class="st-switch__label">{label}</span>
21
+ {#if helperText}<span class="st-switch__help">{helperText}</span>{/if}
22
+ </span>
23
+ </label>
24
+
25
+ <style>
26
+ .st-switch {
27
+ align-items: center;
28
+ color: var(--st-component-field-labelText, var(--st-semantic-text-primary));
29
+ display: inline-grid;
30
+ gap: 0.75rem;
31
+ grid-template-columns: auto 1fr;
32
+ position: relative;
33
+ }
34
+
35
+ .st-switch__input {
36
+ height: 1.25rem;
37
+ margin: 0;
38
+ opacity: 0;
39
+ position: absolute;
40
+ width: 2.25rem;
41
+ }
42
+
43
+ .st-switch__track {
44
+ align-items: center;
45
+ background: var(--st-component-selection-switchTrack, var(--st-semantic-border-strong));
46
+ border-radius: var(--st-radius-pill, 999px);
47
+ display: inline-flex;
48
+ height: 1.25rem;
49
+ padding: 0.125rem;
50
+ transition: background var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
51
+ width: 2.25rem;
52
+ }
53
+
54
+ .st-switch__thumb {
55
+ background: var(--st-component-selection-switchThumb, var(--st-semantic-surface-default));
56
+ border-radius: var(--st-radius-pill, 999px);
57
+ height: 1rem;
58
+ transform: translateX(0);
59
+ transition: transform var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
60
+ width: 1rem;
61
+ }
62
+
63
+ .st-switch__input:checked + .st-switch__track {
64
+ background: var(--st-component-selection-switchTrackChecked, var(--st-semantic-action-primary));
65
+ }
66
+
67
+ .st-switch__input:checked + .st-switch__track .st-switch__thumb {
68
+ transform: translateX(1rem);
69
+ }
70
+
71
+ .st-switch__input:focus-visible + .st-switch__track {
72
+ box-shadow: 0 0 0 2px var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
73
+ }
74
+
75
+ .st-switch__content {
76
+ display: grid;
77
+ gap: 0.25rem;
78
+ }
79
+
80
+ .st-switch__label {
81
+ font-size: 0.9375rem;
82
+ }
83
+
84
+ .st-switch__help {
85
+ color: var(--st-component-field-helpText, var(--st-semantic-text-secondary));
86
+ font-size: 0.8125rem;
87
+ }
88
+ </style>
@@ -0,0 +1,10 @@
1
+ import type { HTMLInputAttributes } from "svelte/elements";
2
+ type SwitchProps = Omit<HTMLInputAttributes, "class" | "role" | "type"> & {
3
+ label: string;
4
+ helperText?: string;
5
+ class?: string;
6
+ };
7
+ declare const Switch: import("svelte").Component<SwitchProps, {}, "">;
8
+ type Switch = ReturnType<typeof Switch>;
9
+ export default Switch;
10
+ //# sourceMappingURL=Switch.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Switch.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,WAAW,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAwBJ,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
@@ -0,0 +1,104 @@
1
+ <script lang="ts" module>
2
+ export interface TableColumn {
3
+ key: string;
4
+ label: string;
5
+ align?: "left" | "right" | "center";
6
+ }
7
+
8
+ export type TableRow = Record<string, unknown>;
9
+ </script>
10
+
11
+ <script lang="ts">
12
+ import type { HTMLTableAttributes } from "svelte/elements";
13
+
14
+ type TableProps = Omit<HTMLTableAttributes, "class"> & {
15
+ columns: TableColumn[];
16
+ rows: TableRow[];
17
+ caption?: string;
18
+ class?: string;
19
+ };
20
+
21
+ let { columns, rows, caption, class: className, ...rest }: TableProps = $props();
22
+
23
+ const classes = () => ["st-table", className].filter(Boolean).join(" ");
24
+ const cellValue = (row: TableRow, key: string) => String(row[key] ?? "");
25
+ </script>
26
+
27
+ <div class="st-table-wrap">
28
+ <table {...rest} class={classes()}>
29
+ {#if caption}<caption>{caption}</caption>{/if}
30
+ <thead>
31
+ <tr>
32
+ {#each columns as column}
33
+ <th class:st-table__cell--right={column.align === "right"} class:st-table__cell--center={column.align === "center"} scope="col">
34
+ {column.label}
35
+ </th>
36
+ {/each}
37
+ </tr>
38
+ </thead>
39
+ <tbody>
40
+ {#each rows as row}
41
+ <tr>
42
+ {#each columns as column}
43
+ <td class:st-table__cell--right={column.align === "right"} class:st-table__cell--center={column.align === "center"}>
44
+ {cellValue(row, column.key)}
45
+ </td>
46
+ {/each}
47
+ </tr>
48
+ {/each}
49
+ </tbody>
50
+ </table>
51
+ </div>
52
+
53
+ <style>
54
+ .st-table-wrap {
55
+ overflow-x: auto;
56
+ }
57
+
58
+ .st-table {
59
+ background: var(--st-component-dataTable-rowBackground, var(--st-semantic-surface-default));
60
+ border: 1px solid var(--st-component-dataTable-border, var(--st-semantic-border-subtle));
61
+ border-collapse: separate;
62
+ border-radius: var(--st-component-dataTable-radius, 0.5rem);
63
+ border-spacing: 0;
64
+ color: var(--st-component-dataTable-text, var(--st-semantic-text-primary));
65
+ min-width: 100%;
66
+ }
67
+
68
+ .st-table caption {
69
+ color: var(--st-component-dataTable-captionText, var(--st-semantic-text-secondary));
70
+ font-weight: 600;
71
+ padding: 0.75rem;
72
+ text-align: left;
73
+ }
74
+
75
+ .st-table th,
76
+ .st-table td {
77
+ border-bottom: 1px solid var(--st-component-dataTable-border, var(--st-semantic-border-subtle));
78
+ padding: 0.75rem;
79
+ text-align: left;
80
+ vertical-align: top;
81
+ }
82
+
83
+ .st-table th {
84
+ background: var(--st-component-dataTable-headerBackground, var(--st-semantic-surface-subtle));
85
+ font-size: 0.875rem;
86
+ font-weight: 650;
87
+ }
88
+
89
+ .st-table tbody tr:hover {
90
+ background: var(--st-component-dataTable-rowHoverBackground, var(--st-semantic-surface-subtle));
91
+ }
92
+
93
+ .st-table tbody tr:last-child td {
94
+ border-bottom: 0;
95
+ }
96
+
97
+ .st-table__cell--right {
98
+ text-align: right;
99
+ }
100
+
101
+ .st-table__cell--center {
102
+ text-align: center;
103
+ }
104
+ </style>
@@ -0,0 +1,17 @@
1
+ export interface TableColumn {
2
+ key: string;
3
+ label: string;
4
+ align?: "left" | "right" | "center";
5
+ }
6
+ export type TableRow = Record<string, unknown>;
7
+ import type { HTMLTableAttributes } from "svelte/elements";
8
+ type TableProps = Omit<HTMLTableAttributes, "class"> & {
9
+ columns: TableColumn[];
10
+ rows: TableRow[];
11
+ caption?: string;
12
+ class?: string;
13
+ };
14
+ declare const Table: import("svelte").Component<TableProps, {}, "">;
15
+ type Table = ReturnType<typeof Table>;
16
+ export default Table;
17
+ //# sourceMappingURL=Table.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Table.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CACrC;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,GAAG;IACrD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA2CJ,QAAA,MAAM,KAAK,gDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,102 @@
1
+ <script lang="ts" module>
2
+ export interface TabItem {
3
+ value: string;
4
+ label: string;
5
+ content: string;
6
+ disabled?: boolean;
7
+ }
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import type { HTMLAttributes } from "svelte/elements";
12
+
13
+ type TabsProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
14
+ items: TabItem[];
15
+ activeValue?: string;
16
+ label?: string;
17
+ class?: string;
18
+ onchange?: (value: string) => void;
19
+ };
20
+
21
+ let {
22
+ items,
23
+ activeValue,
24
+ label = "Tabs",
25
+ class: className,
26
+ onchange,
27
+ ...rest
28
+ }: TabsProps = $props();
29
+
30
+ let selected = $state<string | undefined>(undefined);
31
+ let current = $derived(
32
+ selected ?? activeValue ?? items.find((item) => !item.disabled)?.value ?? items[0]?.value
33
+ );
34
+ const classes = () => ["st-tabs", className].filter(Boolean).join(" ");
35
+ const activeItem = () => items.find((item) => item.value === current) ?? items[0];
36
+
37
+ function select(value: string): void {
38
+ selected = value;
39
+ onchange?.(value);
40
+ }
41
+ </script>
42
+
43
+ <section {...rest} class={classes()}>
44
+ <div class="st-tabs__list" role="tablist" aria-label={label}>
45
+ {#each items as item}
46
+ <button
47
+ class="st-tabs__tab"
48
+ class:st-tabs__tab--active={item.value === current}
49
+ type="button"
50
+ role="tab"
51
+ disabled={item.disabled}
52
+ aria-selected={item.value === current ? "true" : "false"}
53
+ onclick={() => select(item.value)}
54
+ >
55
+ {item.label}
56
+ </button>
57
+ {/each}
58
+ </div>
59
+ <div class="st-tabs__panel" role="tabpanel">
60
+ {activeItem()?.content}
61
+ </div>
62
+ </section>
63
+
64
+ <style>
65
+ .st-tabs {
66
+ color: var(--st-component-tabs-activeText, var(--st-semantic-text-primary));
67
+ display: grid;
68
+ gap: var(--st-spacing-4, 1rem);
69
+ }
70
+
71
+ .st-tabs__list {
72
+ border-bottom: 1px solid var(--st-component-tabs-border, var(--st-semantic-border-subtle));
73
+ display: flex;
74
+ gap: var(--st-spacing-2, 0.5rem);
75
+ }
76
+
77
+ .st-tabs__tab {
78
+ background: transparent;
79
+ border: 0;
80
+ border-bottom: 2px solid transparent;
81
+ color: var(--st-component-tabs-inactiveText, var(--st-semantic-text-secondary));
82
+ cursor: pointer;
83
+ font: inherit;
84
+ font-weight: 600;
85
+ padding: 0.75rem 0.25rem;
86
+ }
87
+
88
+ .st-tabs__tab--active {
89
+ border-bottom-color: var(--st-component-tabs-indicator, var(--st-semantic-action-primary));
90
+ color: var(--st-component-tabs-activeText, var(--st-semantic-text-primary));
91
+ }
92
+
93
+ .st-tabs__tab:disabled {
94
+ cursor: not-allowed;
95
+ opacity: 0.55;
96
+ }
97
+
98
+ .st-tabs__panel {
99
+ background: var(--st-component-tabs-panelBackground, var(--st-semantic-surface-default));
100
+ line-height: 1.5;
101
+ }
102
+ </style>
@@ -0,0 +1,18 @@
1
+ export interface TabItem {
2
+ value: string;
3
+ label: string;
4
+ content: string;
5
+ disabled?: boolean;
6
+ }
7
+ import type { HTMLAttributes } from "svelte/elements";
8
+ type TabsProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
9
+ items: TabItem[];
10
+ activeValue?: string;
11
+ label?: string;
12
+ class?: string;
13
+ onchange?: (value: string) => void;
14
+ };
15
+ declare const Tabs: import("svelte").Component<TabsProps, {}, "">;
16
+ type Tabs = ReturnType<typeof Tabs>;
17
+ export default Tabs;
18
+ //# sourceMappingURL=Tabs.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Tabs.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IAC5D,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AA8CJ,QAAA,MAAM,IAAI,+CAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -0,0 +1,97 @@
1
+ <script lang="ts">
2
+ import type { HTMLTextareaAttributes } from "svelte/elements";
3
+
4
+ type TextareaProps = Omit<HTMLTextareaAttributes, "class"> & {
5
+ label?: string;
6
+ helperText?: string;
7
+ errorText?: string;
8
+ invalid?: boolean;
9
+ class?: string;
10
+ };
11
+
12
+ let {
13
+ label,
14
+ helperText,
15
+ errorText,
16
+ invalid = false,
17
+ class: className,
18
+ ...rest
19
+ }: TextareaProps = $props();
20
+
21
+ const fieldClasses = () => ["st-field", className].filter(Boolean).join(" ");
22
+ const isInvalid = () => invalid || Boolean(errorText);
23
+ </script>
24
+
25
+ <div class={fieldClasses()}>
26
+ <label class="st-field__control">
27
+ {#if label}<span class="st-field__label">{label}</span>{/if}
28
+ <textarea {...rest} class="st-textarea" aria-invalid={isInvalid() ? "true" : undefined}></textarea>
29
+ </label>
30
+ {#if errorText}
31
+ <span class="st-field__error">{errorText}</span>
32
+ {:else if helperText}
33
+ <span class="st-field__help">{helperText}</span>
34
+ {/if}
35
+ </div>
36
+
37
+ <style>
38
+ .st-field {
39
+ color: var(--st-component-field-labelText, var(--st-semantic-text-primary));
40
+ display: grid;
41
+ gap: var(--st-component-field-gap, 0.5rem);
42
+ max-width: var(--st-component-field-maxWidth, 28rem);
43
+ }
44
+
45
+ .st-field__control {
46
+ display: grid;
47
+ gap: var(--st-component-field-gap, 0.5rem);
48
+ }
49
+
50
+ .st-field__label {
51
+ font-size: 0.875rem;
52
+ font-weight: 600;
53
+ }
54
+
55
+ .st-field__help,
56
+ .st-field__error {
57
+ font-size: 0.8125rem;
58
+ line-height: 1.4;
59
+ }
60
+
61
+ .st-field__help {
62
+ color: var(--st-component-field-helpText, var(--st-semantic-text-secondary));
63
+ }
64
+
65
+ .st-field__error {
66
+ color: var(--st-component-field-errorText, var(--st-semantic-feedback-error));
67
+ }
68
+
69
+ .st-textarea {
70
+ background: var(--st-component-control-background, var(--st-semantic-surface-default));
71
+ border: 1px solid var(--st-component-control-border, var(--st-semantic-border-subtle));
72
+ border-radius: var(--st-component-control-radius, 0.375rem);
73
+ color: var(--st-component-control-text, var(--st-semantic-text-primary));
74
+ font: inherit;
75
+ min-height: 6rem;
76
+ min-width: 0;
77
+ padding: 0.625rem 0.75rem;
78
+ resize: vertical;
79
+ width: 100%;
80
+ }
81
+
82
+ .st-textarea:focus-visible {
83
+ border-color: var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
84
+ box-shadow: 0 0 0 2px var(--st-component-control-focusRing, var(--st-semantic-border-interactive));
85
+ outline: none;
86
+ }
87
+
88
+ .st-textarea[aria-invalid="true"] {
89
+ border-color: var(--st-component-control-invalidBorder, var(--st-semantic-feedback-error));
90
+ }
91
+
92
+ .st-textarea:disabled {
93
+ background: var(--st-component-control-disabledBackground, var(--st-semantic-surface-subtle));
94
+ color: var(--st-component-control-disabledText, var(--st-semantic-text-muted));
95
+ cursor: not-allowed;
96
+ }
97
+ </style>
@@ -0,0 +1,12 @@
1
+ import type { HTMLTextareaAttributes } from "svelte/elements";
2
+ type TextareaProps = Omit<HTMLTextareaAttributes, "class"> & {
3
+ label?: string;
4
+ helperText?: string;
5
+ errorText?: string;
6
+ invalid?: boolean;
7
+ class?: string;
8
+ };
9
+ declare const Textarea: import("svelte").Component<TextareaProps, {}, "">;
10
+ type Textarea = ReturnType<typeof Textarea>;
11
+ export default Textarea;
12
+ //# sourceMappingURL=Textarea.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Textarea.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAG5D,KAAK,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAkCJ,QAAA,MAAM,QAAQ,mDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+ import { compileTheme, sentTechTheme, type TenantTheme } from "@sentropic/design-system-themes";
4
+
5
+ type ThemeProviderProps = {
6
+ theme?: TenantTheme;
7
+ namespace?: string;
8
+ children?: Snippet;
9
+ };
10
+
11
+ let { theme = sentTechTheme, namespace = "st", children }: ThemeProviderProps = $props();
12
+
13
+ let css = $derived(compileTheme(theme, { selector: `[data-st-theme="${theme.id}"]`, namespace }));
14
+ </script>
15
+
16
+ <svelte:head>
17
+ {@html `<style data-st-theme-provider="${theme.id}">${css}</style>`}
18
+ </svelte:head>
19
+
20
+ <div data-st-theme={theme.id}>
21
+ {@render children?.()}
22
+ </div>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from "svelte";
2
+ import { type TenantTheme } from "@sentropic/design-system-themes";
3
+ type ThemeProviderProps = {
4
+ theme?: TenantTheme;
5
+ namespace?: string;
6
+ children?: Snippet;
7
+ };
8
+ declare const ThemeProvider: import("svelte").Component<ThemeProviderProps, {}, "">;
9
+ type ThemeProvider = ReturnType<typeof ThemeProvider>;
10
+ export default ThemeProvider;
11
+ //# sourceMappingURL=ThemeProvider.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeProvider.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ThemeProvider.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAA+B,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9F,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAqBJ,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,84 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type ToastProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
6
+ tone?: "info" | "success" | "warning" | "error";
7
+ title: string;
8
+ message?: string;
9
+ class?: string;
10
+ actions?: Snippet;
11
+ };
12
+
13
+ let { tone = "info", title, message, class: className, actions, ...rest }: ToastProps = $props();
14
+ const classes = () => ["st-toast", `st-toast--${tone}`, className].filter(Boolean).join(" ");
15
+ const role = () => (tone === "error" ? "alert" : "status");
16
+ </script>
17
+
18
+ <section {...rest} class={classes()} role={role()}>
19
+ <div class="st-toast__content">
20
+ <h2 class="st-toast__title">{title}</h2>
21
+ {#if message}<p class="st-toast__message">{message}</p>{/if}
22
+ </div>
23
+ {#if actions}
24
+ <div class="st-toast__actions">
25
+ {@render actions()}
26
+ </div>
27
+ {/if}
28
+ </section>
29
+
30
+ <style>
31
+ .st-toast {
32
+ background: var(--st-component-toast-background, var(--st-semantic-surface-raised));
33
+ border: 1px solid var(--st-component-toast-border, var(--st-semantic-border-subtle));
34
+ border-left-width: 0.25rem;
35
+ border-radius: var(--st-component-toast-radius, 0.5rem);
36
+ box-shadow: var(--st-component-toast-shadow, 0 18px 45px rgb(15 23 42 / 0.18));
37
+ color: var(--st-component-toast-text, var(--st-semantic-text-primary));
38
+ display: flex;
39
+ gap: var(--st-spacing-4, 1rem);
40
+ justify-content: space-between;
41
+ padding: var(--st-spacing-4, 1rem);
42
+ width: min(100%, 28rem);
43
+ z-index: var(--st-component-toast-zIndex, 100);
44
+ }
45
+
46
+ .st-toast--info {
47
+ border-left-color: var(--st-component-toast-infoBorder, var(--st-semantic-feedback-info));
48
+ }
49
+
50
+ .st-toast--success {
51
+ border-left-color: var(--st-component-toast-successBorder, var(--st-semantic-feedback-success));
52
+ }
53
+
54
+ .st-toast--warning {
55
+ border-left-color: var(--st-component-toast-warningBorder, var(--st-semantic-feedback-warning));
56
+ }
57
+
58
+ .st-toast--error {
59
+ border-left-color: var(--st-component-toast-errorBorder, var(--st-semantic-feedback-error));
60
+ }
61
+
62
+ .st-toast__content {
63
+ display: grid;
64
+ gap: 0.25rem;
65
+ }
66
+
67
+ .st-toast__title {
68
+ font-size: 0.9375rem;
69
+ margin: 0;
70
+ }
71
+
72
+ .st-toast__message {
73
+ color: var(--st-semantic-text-secondary);
74
+ font-size: 0.875rem;
75
+ line-height: 1.5;
76
+ margin: 0;
77
+ }
78
+
79
+ .st-toast__actions {
80
+ align-items: start;
81
+ display: flex;
82
+ gap: var(--st-spacing-2, 0.5rem);
83
+ }
84
+ </style>
@@ -0,0 +1,13 @@
1
+ import type { Snippet } from "svelte";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ type ToastProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
4
+ tone?: "info" | "success" | "warning" | "error";
5
+ title: string;
6
+ message?: string;
7
+ class?: string;
8
+ actions?: Snippet;
9
+ };
10
+ declare const Toast: import("svelte").Component<ToastProps, {}, "">;
11
+ type Toast = ReturnType<typeof Toast>;
12
+ export default Toast;
13
+ //# sourceMappingURL=Toast.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Toast.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,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA2BJ,QAAA,MAAM,KAAK,gDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,66 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type TooltipProps = Omit<HTMLAttributes<HTMLSpanElement>, "class"> & {
6
+ content: string;
7
+ placement?: "top" | "bottom";
8
+ class?: string;
9
+ children?: Snippet;
10
+ };
11
+
12
+ let { content, placement = "top", class: className, children, ...rest }: TooltipProps = $props();
13
+ const classes = () => ["st-tooltip", `st-tooltip--${placement}`, className].filter(Boolean).join(" ");
14
+ </script>
15
+
16
+ <span {...rest} class={classes()}>
17
+ <span class="st-tooltip__trigger">
18
+ {@render children?.()}
19
+ </span>
20
+ <span class="st-tooltip__content" role="tooltip">{content}</span>
21
+ </span>
22
+
23
+ <style>
24
+ .st-tooltip {
25
+ display: inline-flex;
26
+ position: relative;
27
+ }
28
+
29
+ .st-tooltip__trigger {
30
+ display: inline-flex;
31
+ }
32
+
33
+ .st-tooltip__content {
34
+ background: var(--st-component-tooltip-background, var(--st-semantic-surface-inverse));
35
+ border-radius: var(--st-component-tooltip-radius, 0.375rem);
36
+ box-shadow: var(--st-component-tooltip-shadow, 0 8px 24px rgb(15 23 42 / 0.12));
37
+ color: var(--st-component-tooltip-text, var(--st-semantic-text-inverse));
38
+ font-size: 0.8125rem;
39
+ line-height: 1.4;
40
+ max-width: 16rem;
41
+ opacity: 0;
42
+ padding: 0.375rem 0.5rem;
43
+ pointer-events: none;
44
+ position: absolute;
45
+ transition: opacity var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
46
+ width: max-content;
47
+ z-index: var(--st-component-tooltip-zIndex, 80);
48
+ }
49
+
50
+ .st-tooltip--top .st-tooltip__content {
51
+ bottom: calc(100% + 0.5rem);
52
+ left: 50%;
53
+ transform: translateX(-50%);
54
+ }
55
+
56
+ .st-tooltip--bottom .st-tooltip__content {
57
+ left: 50%;
58
+ top: calc(100% + 0.5rem);
59
+ transform: translateX(-50%);
60
+ }
61
+
62
+ .st-tooltip:hover .st-tooltip__content,
63
+ .st-tooltip:focus-within .st-tooltip__content {
64
+ opacity: 1;
65
+ }
66
+ </style>