@sentropic/design-system-svelte 0.6.0 → 0.8.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/dist/Accordion.svelte +11 -3
- package/dist/Accordion.svelte.d.ts.map +1 -1
- package/dist/Alert.svelte +1 -1
- package/dist/AreaChart.svelte +414 -0
- package/dist/AreaChart.svelte.d.ts +18 -0
- package/dist/AreaChart.svelte.d.ts.map +1 -0
- package/dist/AspectRatio.svelte +44 -0
- package/dist/AspectRatio.svelte.d.ts +11 -0
- package/dist/AspectRatio.svelte.d.ts.map +1 -0
- package/dist/BarChart.svelte +383 -0
- package/dist/BarChart.svelte.d.ts +18 -0
- package/dist/BarChart.svelte.d.ts.map +1 -0
- package/dist/ChatComposer.svelte +238 -0
- package/dist/ChatComposer.svelte.d.ts +57 -0
- package/dist/ChatComposer.svelte.d.ts.map +1 -0
- package/dist/ChatMessage.svelte +271 -0
- package/dist/ChatMessage.svelte.d.ts +19 -0
- package/dist/ChatMessage.svelte.d.ts.map +1 -0
- package/dist/ChatThread.svelte +120 -0
- package/dist/ChatThread.svelte.d.ts +13 -0
- package/dist/ChatThread.svelte.d.ts.map +1 -0
- package/dist/CodeSnippet.svelte +91 -0
- package/dist/CodeSnippet.svelte.d.ts +13 -0
- package/dist/CodeSnippet.svelte.d.ts.map +1 -0
- package/dist/Combobox.svelte +16 -2
- package/dist/Combobox.svelte.d.ts.map +1 -1
- package/dist/CopyButton.svelte +3 -7
- package/dist/CopyButton.svelte.d.ts.map +1 -1
- package/dist/Drawer.svelte +23 -3
- package/dist/Drawer.svelte.d.ts +1 -1
- package/dist/Drawer.svelte.d.ts.map +1 -1
- package/dist/Dropdown.svelte +38 -2
- package/dist/Dropdown.svelte.d.ts.map +1 -1
- package/dist/FileUploader.svelte +119 -4
- package/dist/FileUploader.svelte.d.ts +1 -0
- package/dist/FileUploader.svelte.d.ts.map +1 -1
- package/dist/IconButton.svelte +103 -0
- package/dist/IconButton.svelte.d.ts +15 -0
- package/dist/IconButton.svelte.d.ts.map +1 -0
- package/dist/InlineLoading.svelte +22 -14
- package/dist/InlineLoading.svelte.d.ts.map +1 -1
- package/dist/LineChart.svelte +397 -0
- package/dist/LineChart.svelte.d.ts +19 -0
- package/dist/LineChart.svelte.d.ts.map +1 -0
- package/dist/Menu.svelte +164 -24
- package/dist/Menu.svelte.d.ts +26 -4
- package/dist/Menu.svelte.d.ts.map +1 -1
- package/dist/MenuPopover.svelte +180 -0
- package/dist/MenuPopover.svelte.d.ts +17 -0
- package/dist/MenuPopover.svelte.d.ts.map +1 -0
- package/dist/MenuTriggerButton.svelte +50 -0
- package/dist/MenuTriggerButton.svelte.d.ts +16 -0
- package/dist/MenuTriggerButton.svelte.d.ts.map +1 -0
- package/dist/MessageActions.svelte +89 -0
- package/dist/MessageActions.svelte.d.ts +22 -0
- package/dist/MessageActions.svelte.d.ts.map +1 -0
- package/dist/MessageStatusBadge.svelte +52 -0
- package/dist/MessageStatusBadge.svelte.d.ts +12 -0
- package/dist/MessageStatusBadge.svelte.d.ts.map +1 -0
- package/dist/Modal.svelte +83 -3
- package/dist/Modal.svelte.d.ts.map +1 -1
- package/dist/MultiSelect.svelte +17 -3
- package/dist/MultiSelect.svelte.d.ts.map +1 -1
- package/dist/OverflowMenu.svelte +111 -24
- package/dist/OverflowMenu.svelte.d.ts +21 -2
- package/dist/OverflowMenu.svelte.d.ts.map +1 -1
- package/dist/PaginationNav.svelte +6 -21
- package/dist/PaginationNav.svelte.d.ts.map +1 -1
- package/dist/PasswordInput.svelte +3 -9
- package/dist/PasswordInput.svelte.d.ts.map +1 -1
- package/dist/ProgressIndicator.svelte +3 -19
- package/dist/ProgressIndicator.svelte.d.ts.map +1 -1
- package/dist/Search.svelte +3 -6
- package/dist/Search.svelte.d.ts.map +1 -1
- package/dist/Sparkline.svelte +123 -0
- package/dist/Sparkline.svelte.d.ts +15 -0
- package/dist/Sparkline.svelte.d.ts.map +1 -0
- package/dist/StreamingMessage.svelte +292 -0
- package/dist/StreamingMessage.svelte.d.ts +51 -0
- package/dist/StreamingMessage.svelte.d.ts.map +1 -0
- package/dist/StructuredList.svelte +86 -0
- package/dist/StructuredList.svelte.d.ts +15 -0
- package/dist/StructuredList.svelte.d.ts.map +1 -0
- package/dist/Tag.svelte +2 -1
- package/dist/Tag.svelte.d.ts.map +1 -1
- package/dist/TileGroup.svelte +179 -0
- package/dist/TileGroup.svelte.d.ts +21 -0
- package/dist/TileGroup.svelte.d.ts.map +1 -0
- package/dist/Toast.svelte +2 -2
- package/dist/UnorderedList.svelte +108 -0
- package/dist/UnorderedList.svelte.d.ts +16 -0
- package/dist/UnorderedList.svelte.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/package.json +3 -2
package/dist/OverflowMenu.svelte
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
|
|
2
|
+
import type { Component } from "svelte";
|
|
3
|
+
|
|
4
|
+
export type OverflowMenuIconProps = {
|
|
5
|
+
size?: number | string;
|
|
6
|
+
strokeWidth?: number | string;
|
|
7
|
+
color?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
} & Record<`data-${string}`, unknown>;
|
|
10
|
+
|
|
11
|
+
export type OverflowMenuIcon = Component<OverflowMenuIconProps>;
|
|
12
|
+
|
|
13
|
+
export interface OverflowMenuActionItem {
|
|
14
|
+
kind?: "item";
|
|
3
15
|
value: string;
|
|
4
16
|
label: string;
|
|
5
17
|
disabled?: boolean;
|
|
6
18
|
danger?: boolean;
|
|
19
|
+
icon?: OverflowMenuIcon;
|
|
7
20
|
onclick?: () => void;
|
|
8
21
|
}
|
|
22
|
+
|
|
23
|
+
export interface OverflowMenuDividerItem {
|
|
24
|
+
kind: "divider";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface OverflowMenuGroupItem {
|
|
28
|
+
kind: "group";
|
|
29
|
+
label: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type OverflowMenuItem =
|
|
33
|
+
| OverflowMenuActionItem
|
|
34
|
+
| OverflowMenuDividerItem
|
|
35
|
+
| OverflowMenuGroupItem;
|
|
9
36
|
</script>
|
|
10
37
|
|
|
11
38
|
<script lang="ts">
|
|
39
|
+
import { Ellipsis } from "@lucide/svelte";
|
|
12
40
|
import type { HTMLAttributes } from "svelte/elements";
|
|
13
41
|
|
|
14
42
|
type OverflowMenuProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onselect"> & {
|
|
@@ -18,6 +46,7 @@
|
|
|
18
46
|
placement?: "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
19
47
|
class?: string;
|
|
20
48
|
triggerLabel?: string;
|
|
49
|
+
dense?: boolean;
|
|
21
50
|
onselect?: (value: string) => void;
|
|
22
51
|
};
|
|
23
52
|
|
|
@@ -28,6 +57,7 @@
|
|
|
28
57
|
placement = "bottom-end",
|
|
29
58
|
class: className,
|
|
30
59
|
triggerLabel = "More actions",
|
|
60
|
+
dense = false,
|
|
31
61
|
onselect,
|
|
32
62
|
...rest
|
|
33
63
|
}: OverflowMenuProps = $props();
|
|
@@ -35,7 +65,14 @@
|
|
|
35
65
|
let host: HTMLDivElement | undefined = $state();
|
|
36
66
|
|
|
37
67
|
const classes = () =>
|
|
38
|
-
[
|
|
68
|
+
[
|
|
69
|
+
"st-overflowMenu",
|
|
70
|
+
`st-overflowMenu--${placement}`,
|
|
71
|
+
dense ? "st-overflowMenu--dense" : null,
|
|
72
|
+
className
|
|
73
|
+
]
|
|
74
|
+
.filter(Boolean)
|
|
75
|
+
.join(" ");
|
|
39
76
|
|
|
40
77
|
function toggle() {
|
|
41
78
|
open = !open;
|
|
@@ -45,13 +82,17 @@
|
|
|
45
82
|
open = false;
|
|
46
83
|
}
|
|
47
84
|
|
|
48
|
-
function selectItem(item:
|
|
85
|
+
function selectItem(item: OverflowMenuActionItem) {
|
|
49
86
|
if (item.disabled) return;
|
|
50
87
|
item.onclick?.();
|
|
51
88
|
onselect?.(item.value);
|
|
52
89
|
close();
|
|
53
90
|
}
|
|
54
91
|
|
|
92
|
+
function isAction(item: OverflowMenuItem): item is OverflowMenuActionItem {
|
|
93
|
+
return item.kind === undefined || item.kind === "item";
|
|
94
|
+
}
|
|
95
|
+
|
|
55
96
|
function onWindowKeydown(event: KeyboardEvent) {
|
|
56
97
|
if (event.key === "Escape" && open) {
|
|
57
98
|
event.preventDefault();
|
|
@@ -77,28 +118,36 @@
|
|
|
77
118
|
aria-label={triggerLabel}
|
|
78
119
|
onclick={toggle}
|
|
79
120
|
>
|
|
80
|
-
<
|
|
81
|
-
<circle cx="3" cy="8" r="1.4" fill="currentColor" />
|
|
82
|
-
<circle cx="8" cy="8" r="1.4" fill="currentColor" />
|
|
83
|
-
<circle cx="13" cy="8" r="1.4" fill="currentColor" />
|
|
84
|
-
</svg>
|
|
121
|
+
<Ellipsis size={18} strokeWidth={2.25} aria-hidden="true" />
|
|
85
122
|
</button>
|
|
86
123
|
{#if open}
|
|
87
124
|
<ul class="st-overflowMenu__list" role="menu" aria-label={label}>
|
|
88
|
-
{#each items as item (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
125
|
+
{#each items as item, index (index)}
|
|
126
|
+
{#if isAction(item)}
|
|
127
|
+
{@const Icon = item.icon}
|
|
128
|
+
<li role="none" class="st-overflowMenu__listItem">
|
|
129
|
+
<button
|
|
130
|
+
type="button"
|
|
131
|
+
class="st-overflowMenu__item"
|
|
132
|
+
class:st-overflowMenu__item--danger={item.danger}
|
|
133
|
+
role="menuitem"
|
|
134
|
+
aria-disabled={item.disabled ? "true" : undefined}
|
|
135
|
+
disabled={item.disabled}
|
|
136
|
+
onclick={() => selectItem(item)}
|
|
137
|
+
>
|
|
138
|
+
{#if Icon}
|
|
139
|
+
<span class="st-overflowMenu__itemIcon" aria-hidden="true">
|
|
140
|
+
<Icon size={16} strokeWidth={2} />
|
|
141
|
+
</span>
|
|
142
|
+
{/if}
|
|
143
|
+
<span class="st-overflowMenu__itemLabel">{item.label}</span>
|
|
144
|
+
</button>
|
|
145
|
+
</li>
|
|
146
|
+
{:else if item.kind === "divider"}
|
|
147
|
+
<li role="separator" aria-hidden="true" class="st-overflowMenu__divider"></li>
|
|
148
|
+
{:else}
|
|
149
|
+
<li role="presentation" class="st-overflowMenu__group">{item.label}</li>
|
|
150
|
+
{/if}
|
|
102
151
|
{/each}
|
|
103
152
|
</ul>
|
|
104
153
|
{/if}
|
|
@@ -152,7 +201,8 @@
|
|
|
152
201
|
display: grid;
|
|
153
202
|
list-style: none;
|
|
154
203
|
margin: 0;
|
|
155
|
-
min-width: 12rem;
|
|
204
|
+
min-width: var(--st-component-menu-minWidth, 12rem);
|
|
205
|
+
max-width: var(--st-component-menu-maxWidth, 18rem);
|
|
156
206
|
padding: var(--st-spacing-1, 0.25rem);
|
|
157
207
|
position: absolute;
|
|
158
208
|
z-index: var(--st-component-popover-zIndex, 80);
|
|
@@ -184,18 +234,24 @@
|
|
|
184
234
|
}
|
|
185
235
|
|
|
186
236
|
.st-overflowMenu__item {
|
|
237
|
+
align-items: center;
|
|
187
238
|
background: transparent;
|
|
188
239
|
border: 0;
|
|
189
240
|
border-radius: var(--st-radius-small, 0.375rem);
|
|
190
241
|
color: var(--st-component-menu-text, var(--st-semantic-text-primary));
|
|
191
242
|
cursor: pointer;
|
|
192
|
-
display:
|
|
243
|
+
display: flex;
|
|
193
244
|
font: inherit;
|
|
245
|
+
gap: var(--st-spacing-2, 0.5rem);
|
|
194
246
|
padding: var(--st-spacing-2, 0.5rem) var(--st-spacing-3, 0.75rem);
|
|
195
247
|
text-align: left;
|
|
196
248
|
width: 100%;
|
|
197
249
|
}
|
|
198
250
|
|
|
251
|
+
.st-overflowMenu--dense .st-overflowMenu__item {
|
|
252
|
+
padding: 0.3rem 0.6rem;
|
|
253
|
+
}
|
|
254
|
+
|
|
199
255
|
.st-overflowMenu__item:hover:not(:disabled),
|
|
200
256
|
.st-overflowMenu__item:focus-visible {
|
|
201
257
|
background: var(--st-component-menu-itemHoverBackground, var(--st-semantic-surface-subtle));
|
|
@@ -219,4 +275,35 @@
|
|
|
219
275
|
);
|
|
220
276
|
color: var(--st-component-overflowMenu-dangerHoverText, var(--st-semantic-action-primaryText));
|
|
221
277
|
}
|
|
278
|
+
|
|
279
|
+
.st-overflowMenu__itemIcon {
|
|
280
|
+
align-items: center;
|
|
281
|
+
display: inline-flex;
|
|
282
|
+
flex: 0 0 auto;
|
|
283
|
+
justify-content: center;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.st-overflowMenu__itemLabel {
|
|
287
|
+
flex: 1 1 auto;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
text-overflow: ellipsis;
|
|
290
|
+
white-space: nowrap;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.st-overflowMenu__divider {
|
|
294
|
+
background: var(--st-component-menu-border, var(--st-semantic-border-subtle));
|
|
295
|
+
height: 1px;
|
|
296
|
+
list-style: none;
|
|
297
|
+
margin: 0.25rem 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.st-overflowMenu__group {
|
|
301
|
+
color: var(--st-component-menu-groupText, var(--st-semantic-text-muted));
|
|
302
|
+
font-size: 0.72rem;
|
|
303
|
+
font-weight: 650;
|
|
304
|
+
letter-spacing: 0.04em;
|
|
305
|
+
padding: 0.45rem 0.75rem 0.25rem;
|
|
306
|
+
text-transform: uppercase;
|
|
307
|
+
list-style: none;
|
|
308
|
+
}
|
|
222
309
|
</style>
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Component } from "svelte";
|
|
2
|
+
export type OverflowMenuIconProps = {
|
|
3
|
+
size?: number | string;
|
|
4
|
+
strokeWidth?: number | string;
|
|
5
|
+
color?: string;
|
|
6
|
+
class?: string;
|
|
7
|
+
} & Record<`data-${string}`, unknown>;
|
|
8
|
+
export type OverflowMenuIcon = Component<OverflowMenuIconProps>;
|
|
9
|
+
export interface OverflowMenuActionItem {
|
|
10
|
+
kind?: "item";
|
|
2
11
|
value: string;
|
|
3
12
|
label: string;
|
|
4
13
|
disabled?: boolean;
|
|
5
14
|
danger?: boolean;
|
|
15
|
+
icon?: OverflowMenuIcon;
|
|
6
16
|
onclick?: () => void;
|
|
7
17
|
}
|
|
18
|
+
export interface OverflowMenuDividerItem {
|
|
19
|
+
kind: "divider";
|
|
20
|
+
}
|
|
21
|
+
export interface OverflowMenuGroupItem {
|
|
22
|
+
kind: "group";
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
export type OverflowMenuItem = OverflowMenuActionItem | OverflowMenuDividerItem | OverflowMenuGroupItem;
|
|
8
26
|
import type { HTMLAttributes } from "svelte/elements";
|
|
9
27
|
type OverflowMenuProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onselect"> & {
|
|
10
28
|
items: OverflowMenuItem[];
|
|
@@ -13,9 +31,10 @@ type OverflowMenuProps = Omit<HTMLAttributes<HTMLDivElement>, "class" | "onselec
|
|
|
13
31
|
placement?: "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
14
32
|
class?: string;
|
|
15
33
|
triggerLabel?: string;
|
|
34
|
+
dense?: boolean;
|
|
16
35
|
onselect?: (value: string) => void;
|
|
17
36
|
};
|
|
18
|
-
declare const OverflowMenu:
|
|
37
|
+
declare const OverflowMenu: Component<OverflowMenuProps, {}, "open">;
|
|
19
38
|
type OverflowMenu = ReturnType<typeof OverflowMenu>;
|
|
20
39
|
export default OverflowMenu;
|
|
21
40
|
//# sourceMappingURL=OverflowMenu.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowMenu.svelte.d.ts","sourceRoot":"","sources":["../src/lib/OverflowMenu.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,WAAW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"OverflowMenu.svelte.d.ts","sourceRoot":"","sources":["../src/lib/OverflowMenu.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;AAEtC,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,gBAAgB,GACxB,sBAAsB,GACtB,uBAAuB,GACvB,qBAAqB,CAAC;AAI5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IACpF,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAoGJ,QAAA,MAAM,YAAY,0CAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import { ChevronLeft, ChevronRight, Ellipsis } from "@lucide/svelte";
|
|
3
4
|
|
|
4
5
|
type PaginationNavProps = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
5
6
|
page: number;
|
|
@@ -89,22 +90,15 @@
|
|
|
89
90
|
disabled={page <= 1 || pageCount <= 0}
|
|
90
91
|
onclick={() => go(page - 1)}
|
|
91
92
|
>
|
|
92
|
-
<
|
|
93
|
-
<path
|
|
94
|
-
d="M10 3 5 8l5 5"
|
|
95
|
-
fill="none"
|
|
96
|
-
stroke="currentColor"
|
|
97
|
-
stroke-width="1.6"
|
|
98
|
-
stroke-linecap="round"
|
|
99
|
-
stroke-linejoin="round"
|
|
100
|
-
/>
|
|
101
|
-
</svg>
|
|
93
|
+
<ChevronLeft size={16} strokeWidth={2} aria-hidden="true" />
|
|
102
94
|
</button>
|
|
103
95
|
</li>
|
|
104
96
|
{#each slots as slot, index (typeof slot === "number" ? `p-${slot}` : `${slot}-${index}`)}
|
|
105
97
|
<li>
|
|
106
98
|
{#if slot === "ellipsis-start" || slot === "ellipsis-end"}
|
|
107
|
-
<span class="st-paginationNav__ellipsis" aria-hidden="true"
|
|
99
|
+
<span class="st-paginationNav__ellipsis" aria-hidden="true">
|
|
100
|
+
<Ellipsis size={16} strokeWidth={2} aria-hidden="true" />
|
|
101
|
+
</span>
|
|
108
102
|
{:else}
|
|
109
103
|
<button
|
|
110
104
|
type="button"
|
|
@@ -127,16 +121,7 @@
|
|
|
127
121
|
disabled={page >= pageCount || pageCount <= 0}
|
|
128
122
|
onclick={() => go(page + 1)}
|
|
129
123
|
>
|
|
130
|
-
<
|
|
131
|
-
<path
|
|
132
|
-
d="M6 3l5 5-5 5"
|
|
133
|
-
fill="none"
|
|
134
|
-
stroke="currentColor"
|
|
135
|
-
stroke-width="1.6"
|
|
136
|
-
stroke-linecap="round"
|
|
137
|
-
stroke-linejoin="round"
|
|
138
|
-
/>
|
|
139
|
-
</svg>
|
|
124
|
+
<ChevronRight size={16} strokeWidth={2} aria-hidden="true" />
|
|
140
125
|
</button>
|
|
141
126
|
</li>
|
|
142
127
|
</ul>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationNav.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PaginationNav.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"PaginationNav.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PaginationNav.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIpD,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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;AA0GJ,QAAA,MAAM,aAAa,4DAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLInputAttributes } from "svelte/elements";
|
|
3
|
+
import { Eye, EyeOff } from "@lucide/svelte";
|
|
3
4
|
|
|
4
5
|
type PasswordInputProps = Omit<HTMLInputAttributes, "class" | "size" | "type" | "value"> & {
|
|
5
6
|
label?: string;
|
|
@@ -60,16 +61,9 @@
|
|
|
60
61
|
onclick={toggle}
|
|
61
62
|
>
|
|
62
63
|
{#if visible}
|
|
63
|
-
<
|
|
64
|
-
<path d="M2 8s2-4 6-4 6 4 6 4-2 4-6 4-6-4-6-4Z" />
|
|
65
|
-
<circle cx="8" cy="8" r="2" />
|
|
66
|
-
<path d="M2 2l12 12" stroke-linecap="round" />
|
|
67
|
-
</svg>
|
|
64
|
+
<EyeOff size={16} strokeWidth={2} aria-hidden="true" />
|
|
68
65
|
{:else}
|
|
69
|
-
<
|
|
70
|
-
<path d="M2 8s2-4 6-4 6 4 6 4-2 4-6 4-6-4-6-4Z" />
|
|
71
|
-
<circle cx="8" cy="8" r="2" />
|
|
72
|
-
</svg>
|
|
66
|
+
<Eye size={16} strokeWidth={2} aria-hidden="true" />
|
|
73
67
|
{/if}
|
|
74
68
|
</button>
|
|
75
69
|
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PasswordInput.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"PasswordInput.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PasswordInput.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,KAAK,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG;IACzF,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,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAuDJ,QAAA,MAAM,aAAa,yEAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
18
|
import type { HTMLAttributes } from "svelte/elements";
|
|
19
|
+
import { Check, X } from "@lucide/svelte";
|
|
19
20
|
|
|
20
21
|
type ProgressIndicatorProps = Omit<HTMLAttributes<HTMLOListElement>, "class"> & {
|
|
21
22
|
items: ProgressIndicatorItem[];
|
|
@@ -56,26 +57,9 @@
|
|
|
56
57
|
<span class="st-progressIndicator__indicator" aria-hidden="true">
|
|
57
58
|
<span class="st-progressIndicator__circle">
|
|
58
59
|
{#if status === "complete"}
|
|
59
|
-
<
|
|
60
|
-
<path
|
|
61
|
-
d="m3 8 3.5 3.5L13 5"
|
|
62
|
-
fill="none"
|
|
63
|
-
stroke="currentColor"
|
|
64
|
-
stroke-width="1.6"
|
|
65
|
-
stroke-linecap="round"
|
|
66
|
-
stroke-linejoin="round"
|
|
67
|
-
/>
|
|
68
|
-
</svg>
|
|
60
|
+
<Check size={14} strokeWidth={2} aria-hidden="true" />
|
|
69
61
|
{:else if status === "invalid"}
|
|
70
|
-
<
|
|
71
|
-
<path
|
|
72
|
-
d="M4 4l8 8M12 4l-8 8"
|
|
73
|
-
fill="none"
|
|
74
|
-
stroke="currentColor"
|
|
75
|
-
stroke-width="1.6"
|
|
76
|
-
stroke-linecap="round"
|
|
77
|
-
/>
|
|
78
|
-
</svg>
|
|
62
|
+
<X size={14} strokeWidth={2} aria-hidden="true" />
|
|
79
63
|
{:else if status === "current"}
|
|
80
64
|
<span class="st-progressIndicator__dot"></span>
|
|
81
65
|
{:else}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressIndicator.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ProgressIndicator.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressIndicator.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ProgressIndicator.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIpD,KAAK,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,GAAG;IAC9E,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgEJ,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
package/dist/Search.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLInputAttributes } from "svelte/elements";
|
|
3
|
+
import { Search as SearchIcon, X } from "@lucide/svelte";
|
|
3
4
|
|
|
4
5
|
type SearchProps = Omit<HTMLInputAttributes, "class" | "size" | "type" | "value"> & {
|
|
5
6
|
label?: string;
|
|
@@ -41,15 +42,11 @@
|
|
|
41
42
|
{#if label}<span class="st-field__label">{label}</span>{/if}
|
|
42
43
|
<span class={groupClasses()}>
|
|
43
44
|
<span class="st-search__icon" aria-hidden="true">
|
|
44
|
-
<
|
|
45
|
-
<circle cx="7" cy="7" r="4.5" />
|
|
46
|
-
<path d="m13 13-2.6-2.6" stroke-linecap="round" />
|
|
47
|
-
</svg>
|
|
45
|
+
<SearchIcon size={16} strokeWidth={2} aria-hidden="true" />
|
|
48
46
|
</span>
|
|
49
47
|
<input
|
|
50
48
|
{...rest}
|
|
51
49
|
type="search"
|
|
52
|
-
role="searchbox"
|
|
53
50
|
class="st-search__control"
|
|
54
51
|
bind:value
|
|
55
52
|
{placeholder}
|
|
@@ -64,7 +61,7 @@
|
|
|
64
61
|
{disabled}
|
|
65
62
|
onclick={clear}
|
|
66
63
|
>
|
|
67
|
-
<
|
|
64
|
+
<X size={16} strokeWidth={2} aria-hidden="true" />
|
|
68
65
|
</button>
|
|
69
66
|
{/if}
|
|
70
67
|
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Search.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Search.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Search.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,KAAK,WAAW,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG;IAClF,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,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAuDJ,QAAA,MAAM,MAAM,sDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
type SparklineTone = "neutral" | "success" | "warning" | "error";
|
|
3
|
+
|
|
4
|
+
type SparklineProps = {
|
|
5
|
+
data: number[];
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
tone?: SparklineTone;
|
|
9
|
+
strokeWidth?: number;
|
|
10
|
+
area?: boolean;
|
|
11
|
+
label?: string;
|
|
12
|
+
class?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
data,
|
|
17
|
+
width = 120,
|
|
18
|
+
height = 28,
|
|
19
|
+
tone = "neutral",
|
|
20
|
+
strokeWidth = 1.5,
|
|
21
|
+
area = false,
|
|
22
|
+
label,
|
|
23
|
+
class: className
|
|
24
|
+
}: SparklineProps = $props();
|
|
25
|
+
|
|
26
|
+
const PADDING = 2;
|
|
27
|
+
|
|
28
|
+
const geometry = $derived.by(() => {
|
|
29
|
+
if (!data || data.length === 0) {
|
|
30
|
+
return { line: "", area: "" };
|
|
31
|
+
}
|
|
32
|
+
const min = Math.min(...data);
|
|
33
|
+
const max = Math.max(...data);
|
|
34
|
+
const span = max - min || 1;
|
|
35
|
+
const innerWidth = Math.max(width - PADDING * 2, 1);
|
|
36
|
+
const innerHeight = Math.max(height - PADDING * 2, 1);
|
|
37
|
+
const step = data.length > 1 ? innerWidth / (data.length - 1) : 0;
|
|
38
|
+
const points = data.map((value, index) => {
|
|
39
|
+
const x = PADDING + step * index;
|
|
40
|
+
const normalised = (value - min) / span;
|
|
41
|
+
const y = PADDING + (1 - normalised) * innerHeight;
|
|
42
|
+
return { x, y };
|
|
43
|
+
});
|
|
44
|
+
const line = points
|
|
45
|
+
.map((p, i) => `${i === 0 ? "M" : "L"}${p.x.toFixed(2)},${p.y.toFixed(2)}`)
|
|
46
|
+
.join(" ");
|
|
47
|
+
const baseline = height - PADDING;
|
|
48
|
+
const first = points[0];
|
|
49
|
+
const last = points[points.length - 1];
|
|
50
|
+
const areaPath = `${line} L${last.x.toFixed(2)},${baseline.toFixed(2)} L${first.x.toFixed(2)},${baseline.toFixed(2)} Z`;
|
|
51
|
+
return { line, area: areaPath };
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const classes = () =>
|
|
55
|
+
["st-sparkline", `st-sparkline--${tone}`, className].filter(Boolean).join(" ");
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<span
|
|
59
|
+
class={classes()}
|
|
60
|
+
role="img"
|
|
61
|
+
aria-label={label}
|
|
62
|
+
>
|
|
63
|
+
<svg
|
|
64
|
+
width={width}
|
|
65
|
+
height={height}
|
|
66
|
+
viewBox="0 0 {width} {height}"
|
|
67
|
+
preserveAspectRatio="none"
|
|
68
|
+
aria-hidden={label ? "true" : undefined}
|
|
69
|
+
focusable="false"
|
|
70
|
+
>
|
|
71
|
+
{#if area && geometry.area}
|
|
72
|
+
<path d={geometry.area} class="st-sparkline__area" />
|
|
73
|
+
{/if}
|
|
74
|
+
{#if geometry.line}
|
|
75
|
+
<path
|
|
76
|
+
d={geometry.line}
|
|
77
|
+
class="st-sparkline__line"
|
|
78
|
+
fill="none"
|
|
79
|
+
stroke-width={strokeWidth}
|
|
80
|
+
stroke-linecap="round"
|
|
81
|
+
stroke-linejoin="round"
|
|
82
|
+
/>
|
|
83
|
+
{/if}
|
|
84
|
+
</svg>
|
|
85
|
+
</span>
|
|
86
|
+
|
|
87
|
+
<style>
|
|
88
|
+
.st-sparkline {
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
line-height: 0;
|
|
91
|
+
vertical-align: middle;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.st-sparkline svg {
|
|
95
|
+
display: block;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.st-sparkline--neutral {
|
|
99
|
+
color: var(--st-component-sparkline-neutralStroke, var(--st-semantic-text-secondary));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.st-sparkline--success {
|
|
103
|
+
color: var(--st-component-sparkline-successStroke, var(--st-semantic-feedback-success));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.st-sparkline--warning {
|
|
107
|
+
color: var(--st-component-sparkline-warningStroke, var(--st-semantic-feedback-warning));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.st-sparkline--error {
|
|
111
|
+
color: var(--st-component-sparkline-errorStroke, var(--st-semantic-feedback-error));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.st-sparkline__line {
|
|
115
|
+
stroke: currentColor;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.st-sparkline__area {
|
|
119
|
+
fill: currentColor;
|
|
120
|
+
opacity: 0.18;
|
|
121
|
+
stroke: none;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type SparklineTone = "neutral" | "success" | "warning" | "error";
|
|
2
|
+
type SparklineProps = {
|
|
3
|
+
data: number[];
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
tone?: SparklineTone;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
area?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const Sparkline: import("svelte").Component<SparklineProps, {}, "">;
|
|
13
|
+
type Sparkline = ReturnType<typeof Sparkline>;
|
|
14
|
+
export default Sparkline;
|
|
15
|
+
//# sourceMappingURL=Sparkline.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Sparkline.svelte.ts"],"names":[],"mappings":"AAGE,KAAK,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjE,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA+DJ,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|