svelte-multistyle-ui 0.0.6-alpha → 0.0.9-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/cli/bin.js +3 -0
- package/cli/emit.js +3 -5
- package/cli/fixtures/sample.expected.svelte +229 -56
- package/cli/fixtures/sample.yaml +254 -128
- package/cli/generate.js +438 -7
- package/dist/components/Accordion.svelte +3 -1
- package/dist/components/Accordion.svelte.d.ts +2 -0
- package/dist/components/Alert.svelte +5 -3
- package/dist/components/Alert.svelte.d.ts +4 -2
- package/dist/components/Avatar.svelte +3 -1
- package/dist/components/Avatar.svelte.d.ts +2 -0
- package/dist/components/Breadcrumb.svelte +3 -2
- package/dist/components/Breadcrumb.svelte.d.ts +2 -0
- package/dist/components/Button.svelte +3 -1
- package/dist/components/Button.svelte.d.ts +2 -0
- package/dist/components/ButtonGroup.svelte +3 -1
- package/dist/components/ButtonGroup.svelte.d.ts +2 -0
- package/dist/components/Card.svelte +2 -1
- package/dist/components/Carousel.svelte +3 -1
- package/dist/components/Carousel.svelte.d.ts +2 -0
- package/dist/components/Checkbox.svelte +3 -1
- package/dist/components/Checkbox.svelte.d.ts +2 -0
- package/dist/components/Chip.svelte +3 -1
- package/dist/components/Chip.svelte.d.ts +2 -0
- package/dist/components/Column.svelte +2 -1
- package/dist/components/CommandPalette.svelte +3 -1
- package/dist/components/CommandPalette.svelte.d.ts +2 -0
- package/dist/components/DatePicker.svelte +3 -1
- package/dist/components/DatePicker.svelte.d.ts +2 -0
- package/dist/components/Divider.svelte +3 -1
- package/dist/components/Divider.svelte.d.ts +2 -0
- package/dist/components/Drawer.svelte +3 -1
- package/dist/components/Drawer.svelte.d.ts +2 -0
- package/dist/components/DropdownMenu.svelte +3 -1
- package/dist/components/DropdownMenu.svelte.d.ts +2 -0
- package/dist/components/FAB.svelte +3 -1
- package/dist/components/FAB.svelte.d.ts +2 -0
- package/dist/components/FileUpload.svelte +3 -1
- package/dist/components/FileUpload.svelte.d.ts +2 -0
- package/dist/components/Grid.svelte +2 -1
- package/dist/components/IconButton.svelte +3 -1
- package/dist/components/IconButton.svelte.d.ts +2 -0
- package/dist/components/Input.svelte +3 -1
- package/dist/components/Input.svelte.d.ts +2 -0
- package/dist/components/Modal.svelte +3 -1
- package/dist/components/Modal.svelte.d.ts +2 -0
- package/dist/components/MultiSelect.svelte +41 -3
- package/dist/components/MultiSelect.svelte.d.ts +2 -0
- package/dist/components/Pagination.svelte +3 -1
- package/dist/components/Pagination.svelte.d.ts +2 -0
- package/dist/components/Popover.svelte +3 -1
- package/dist/components/Popover.svelte.d.ts +2 -0
- package/dist/components/ProgressBar.svelte +3 -1
- package/dist/components/ProgressBar.svelte.d.ts +2 -0
- package/dist/components/Radio.svelte +3 -1
- package/dist/components/Radio.svelte.d.ts +2 -0
- package/dist/components/Rating.svelte +3 -1
- package/dist/components/Rating.svelte.d.ts +2 -0
- package/dist/components/Row.svelte +2 -1
- package/dist/components/Select.svelte +178 -81
- package/dist/components/Select.svelte.d.ts +2 -0
- package/dist/components/Skeleton.svelte +3 -1
- package/dist/components/Skeleton.svelte.d.ts +2 -0
- package/dist/components/Slider.svelte +3 -1
- package/dist/components/Slider.svelte.d.ts +2 -0
- package/dist/components/SortableList.svelte +3 -1
- package/dist/components/SortableList.svelte.d.ts +2 -0
- package/dist/components/Spinner.svelte +3 -1
- package/dist/components/Spinner.svelte.d.ts +2 -0
- package/dist/components/Stepper.svelte +3 -1
- package/dist/components/Stepper.svelte.d.ts +2 -0
- package/dist/components/Table.svelte +3 -1
- package/dist/components/Table.svelte.d.ts +2 -0
- package/dist/components/Tabs.svelte +3 -1
- package/dist/components/Tabs.svelte.d.ts +2 -0
- package/dist/components/Textarea.svelte +3 -1
- package/dist/components/Textarea.svelte.d.ts +2 -0
- package/dist/components/Toast.svelte +7 -5
- package/dist/components/Toast.svelte.d.ts +2 -0
- package/dist/components/Toggle.svelte +3 -1
- package/dist/components/Toggle.svelte.d.ts +2 -0
- package/dist/components/Tooltip.svelte +3 -1
- package/dist/components/Tooltip.svelte.d.ts +2 -0
- package/dist/components/charts/BarChart.svelte +2 -2
- package/dist/components/charts/BarChart.svelte.d.ts +2 -0
- package/dist/components/charts/BubbleChart.svelte +2 -2
- package/dist/components/charts/BubbleChart.svelte.d.ts +2 -0
- package/dist/components/charts/Chart.svelte +3 -1
- package/dist/components/charts/Chart.svelte.d.ts +2 -0
- package/dist/components/charts/ComboChart.svelte +2 -2
- package/dist/components/charts/ComboChart.svelte.d.ts +2 -0
- package/dist/components/charts/DoughnutChart.svelte +2 -2
- package/dist/components/charts/DoughnutChart.svelte.d.ts +2 -0
- package/dist/components/charts/LineChart.svelte +2 -2
- package/dist/components/charts/LineChart.svelte.d.ts +2 -0
- package/dist/components/charts/PieChart.svelte +2 -2
- package/dist/components/charts/PieChart.svelte.d.ts +2 -0
- package/dist/components/charts/PolarAreaChart.svelte +2 -2
- package/dist/components/charts/PolarAreaChart.svelte.d.ts +2 -0
- package/dist/components/charts/RadarChart.svelte +2 -2
- package/dist/components/charts/RadarChart.svelte.d.ts +2 -0
- package/dist/components/charts/ScatterChart.svelte +2 -2
- package/dist/components/charts/ScatterChart.svelte.d.ts +2 -0
- package/dist/components/charts/StackedBarChart.svelte +2 -2
- package/dist/components/charts/StackedBarChart.svelte.d.ts +2 -0
- package/dist/components/charts/StackedLineChart.svelte +2 -2
- package/dist/components/charts/StackedLineChart.svelte.d.ts +2 -0
- package/dist/components/input-styles.css +1 -0
- package/dist/components/multiselect-styles.css +335 -338
- package/dist/components/select-styles.css +309 -247
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/utils/cn.d.ts +1 -0
- package/dist/utils/cn.js +9 -0
- package/package.json +4 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./pagination-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -8,6 +9,7 @@
|
|
|
8
9
|
total = 0,
|
|
9
10
|
perPage = 10,
|
|
10
11
|
current = $bindable(1),
|
|
12
|
+
class: className = "",
|
|
11
13
|
...rest
|
|
12
14
|
} = $props();
|
|
13
15
|
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
</script>
|
|
27
29
|
|
|
28
30
|
<nav
|
|
29
|
-
class="s-pagination
|
|
31
|
+
class={cn("s-pagination", styleClass, themeClass, className)}
|
|
30
32
|
aria-label="Pagination"
|
|
31
33
|
{...rest}
|
|
32
34
|
>
|
|
@@ -9,6 +9,7 @@ declare const Pagination: import("svelte").Component<{
|
|
|
9
9
|
total?: number;
|
|
10
10
|
perPage?: number;
|
|
11
11
|
current?: number;
|
|
12
|
+
class?: string;
|
|
12
13
|
} & Record<string, any>, {}, "current">;
|
|
13
14
|
type $$ComponentProps = {
|
|
14
15
|
style: any;
|
|
@@ -16,4 +17,5 @@ type $$ComponentProps = {
|
|
|
16
17
|
total?: number;
|
|
17
18
|
perPage?: number;
|
|
18
19
|
current?: number;
|
|
20
|
+
class?: string;
|
|
19
21
|
} & Record<string, any>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import "./popover-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
4
|
import { fly } from "svelte/transition";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
5
6
|
|
|
6
7
|
let {
|
|
7
8
|
style: styleProp,
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
position = "top",
|
|
12
13
|
open = $bindable(false),
|
|
13
14
|
trigger = "click",
|
|
15
|
+
class: className = "",
|
|
14
16
|
...rest
|
|
15
17
|
} = $props();
|
|
16
18
|
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
</script>
|
|
73
75
|
|
|
74
76
|
<div
|
|
75
|
-
class="s-popover-wrapper
|
|
77
|
+
class={cn("s-popover-wrapper", styleClass, themeClass, className)}
|
|
76
78
|
onmouseenter={trigger === "hover" ? show : undefined}
|
|
77
79
|
onmouseleave={trigger === "hover" ? hide : undefined}
|
|
78
80
|
{...rest}
|
|
@@ -11,6 +11,7 @@ declare const Popover: import("svelte").Component<{
|
|
|
11
11
|
position?: string;
|
|
12
12
|
open?: boolean;
|
|
13
13
|
trigger?: string;
|
|
14
|
+
class?: string;
|
|
14
15
|
} & Record<string, any>, {}, "open">;
|
|
15
16
|
type $$ComponentProps = {
|
|
16
17
|
style: any;
|
|
@@ -20,4 +21,5 @@ type $$ComponentProps = {
|
|
|
20
21
|
position?: string;
|
|
21
22
|
open?: boolean;
|
|
22
23
|
trigger?: string;
|
|
24
|
+
class?: string;
|
|
23
25
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./progressbar-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
size = "md",
|
|
10
11
|
animated = false,
|
|
11
12
|
label = false,
|
|
13
|
+
class: className = "",
|
|
12
14
|
...rest
|
|
13
15
|
} = $props();
|
|
14
16
|
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
</script>
|
|
44
46
|
|
|
45
47
|
<div
|
|
46
|
-
class="s-progressbar
|
|
48
|
+
class={cn("s-progressbar", styleClass, themeClass, sizeClass, className)}
|
|
47
49
|
role="progressbar"
|
|
48
50
|
aria-valuenow={isIndeterminate ? undefined : clampedValue}
|
|
49
51
|
aria-valuemin="0"
|
|
@@ -10,6 +10,7 @@ declare const ProgressBar: import("svelte").Component<{
|
|
|
10
10
|
size?: string;
|
|
11
11
|
animated?: boolean;
|
|
12
12
|
label?: boolean;
|
|
13
|
+
class?: string;
|
|
13
14
|
} & Record<string, any>, {}, "">;
|
|
14
15
|
type $$ComponentProps = {
|
|
15
16
|
style: any;
|
|
@@ -18,4 +19,5 @@ type $$ComponentProps = {
|
|
|
18
19
|
size?: string;
|
|
19
20
|
animated?: boolean;
|
|
20
21
|
label?: boolean;
|
|
22
|
+
class?: string;
|
|
21
23
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./radio-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
group = $bindable(""),
|
|
10
11
|
label = "",
|
|
11
12
|
disabled = false,
|
|
13
|
+
class: className = "",
|
|
12
14
|
...rest
|
|
13
15
|
} = $props();
|
|
14
16
|
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
</script>
|
|
25
27
|
|
|
26
28
|
<label
|
|
27
|
-
class="s-radio
|
|
29
|
+
class={cn("s-radio", styleClass, themeClass, className)}
|
|
28
30
|
class:disabled
|
|
29
31
|
class:selected={isSelected}
|
|
30
32
|
for={internalId}
|
|
@@ -10,6 +10,7 @@ declare const Radio: import("svelte").Component<{
|
|
|
10
10
|
group?: string;
|
|
11
11
|
label?: string;
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
class?: string;
|
|
13
14
|
} & Record<string, any>, {}, "group">;
|
|
14
15
|
type $$ComponentProps = {
|
|
15
16
|
style: any;
|
|
@@ -18,4 +19,5 @@ type $$ComponentProps = {
|
|
|
18
19
|
group?: string;
|
|
19
20
|
label?: string;
|
|
20
21
|
disabled?: boolean;
|
|
22
|
+
class?: string;
|
|
21
23
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./rating-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
size = "md",
|
|
12
13
|
readonly = false,
|
|
13
14
|
showValue = false,
|
|
15
|
+
class: className = "",
|
|
14
16
|
...rest
|
|
15
17
|
} = $props();
|
|
16
18
|
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
</script>
|
|
65
67
|
|
|
66
68
|
<div
|
|
67
|
-
class="s-rating
|
|
69
|
+
class={cn("s-rating", styleClass, themeClass, `rating-${size}`, className)}
|
|
68
70
|
role="radiogroup"
|
|
69
71
|
aria-label="Rating"
|
|
70
72
|
{...rest}
|
|
@@ -12,6 +12,7 @@ declare const Rating: import("svelte").Component<{
|
|
|
12
12
|
size?: string;
|
|
13
13
|
readonly?: boolean;
|
|
14
14
|
showValue?: boolean;
|
|
15
|
+
class?: string;
|
|
15
16
|
} & Record<string, any>, {}, "value">;
|
|
16
17
|
type $$ComponentProps = {
|
|
17
18
|
style: any;
|
|
@@ -22,4 +23,5 @@ type $$ComponentProps = {
|
|
|
22
23
|
size?: string;
|
|
23
24
|
readonly?: boolean;
|
|
24
25
|
showValue?: boolean;
|
|
26
|
+
class?: string;
|
|
25
27
|
} & Record<string, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./row-styles.css";
|
|
3
|
+
import { cn } from "../utils/cn.js";
|
|
3
4
|
|
|
4
5
|
let {
|
|
5
6
|
gap = "8px",
|
|
@@ -34,6 +35,6 @@
|
|
|
34
35
|
);
|
|
35
36
|
</script>
|
|
36
37
|
|
|
37
|
-
<div class="s-row
|
|
38
|
+
<div class={cn("s-row", className)} style={styleStr} {...rest}>
|
|
38
39
|
{@render children?.()}
|
|
39
40
|
</div>
|
|
@@ -1,81 +1,178 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import "./select-styles.css";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import "./select-styles.css";
|
|
3
|
+
import { portal } from "../actions/portal.js";
|
|
4
|
+
import { defaults } from "../config.js";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
style: styleProp,
|
|
9
|
+
theme: themeProp,
|
|
10
|
+
value = $bindable(""),
|
|
11
|
+
options = [],
|
|
12
|
+
placeholder = "Select...",
|
|
13
|
+
label = "",
|
|
14
|
+
disabled = false,
|
|
15
|
+
class: className = "",
|
|
16
|
+
...rest
|
|
17
|
+
} = $props();
|
|
18
|
+
|
|
19
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
20
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
21
|
+
|
|
22
|
+
let open = $state(false);
|
|
23
|
+
let focused = $state(false);
|
|
24
|
+
let wrapperEl;
|
|
25
|
+
let dropdownEl;
|
|
26
|
+
let hasValue = $derived(
|
|
27
|
+
value !== "" && value !== null && value !== undefined,
|
|
28
|
+
);
|
|
29
|
+
let floated = $derived(focused || hasValue);
|
|
30
|
+
|
|
31
|
+
const styleClass = $derived(`s-select-${style}`);
|
|
32
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
33
|
+
|
|
34
|
+
const floatingStyles = [
|
|
35
|
+
"material",
|
|
36
|
+
"material3",
|
|
37
|
+
"fluent",
|
|
38
|
+
"carbon",
|
|
39
|
+
"bootstrap",
|
|
40
|
+
];
|
|
41
|
+
const hasFloatingLabel = $derived(
|
|
42
|
+
floatingStyles.includes(style) && (label || placeholder),
|
|
43
|
+
);
|
|
44
|
+
const displayLabel = $derived(label || placeholder);
|
|
45
|
+
|
|
46
|
+
function getLabel(val) {
|
|
47
|
+
const opt = options.find((o) => o.value === val);
|
|
48
|
+
return opt ? opt.label : val;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function selectOption(val) {
|
|
52
|
+
value = val;
|
|
53
|
+
open = false;
|
|
54
|
+
focused = false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function handleBlur() {
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
open = false;
|
|
60
|
+
focused = false;
|
|
61
|
+
}, 150);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function handleKeydown(e) {
|
|
65
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
open = !open;
|
|
68
|
+
focused = true;
|
|
69
|
+
} else if (e.key === "Escape") {
|
|
70
|
+
open = false;
|
|
71
|
+
focused = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function positionDropdown() {
|
|
76
|
+
if (!wrapperEl || !dropdownEl) return;
|
|
77
|
+
const rect = wrapperEl.getBoundingClientRect();
|
|
78
|
+
const ddHeight = dropdownEl.offsetHeight || 200;
|
|
79
|
+
let top = rect.bottom + 4;
|
|
80
|
+
// Flip above the field if it would overflow the bottom of the viewport.
|
|
81
|
+
if (top + ddHeight > window.innerHeight - 8 && rect.top - ddHeight - 4 > 8) {
|
|
82
|
+
top = rect.top - ddHeight - 4;
|
|
83
|
+
}
|
|
84
|
+
dropdownEl.style.left = `${rect.left}px`;
|
|
85
|
+
dropdownEl.style.top = `${top}px`;
|
|
86
|
+
dropdownEl.style.width = `${rect.width}px`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
$effect(() => {
|
|
90
|
+
if (open) {
|
|
91
|
+
const handler = (e) => {
|
|
92
|
+
if (
|
|
93
|
+
wrapperEl && !wrapperEl.contains(e.target) &&
|
|
94
|
+
!(dropdownEl && dropdownEl.contains(e.target))
|
|
95
|
+
) {
|
|
96
|
+
open = false;
|
|
97
|
+
focused = false;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
document.addEventListener("pointerdown", handler);
|
|
101
|
+
const reposition = () => positionDropdown();
|
|
102
|
+
window.addEventListener("scroll", reposition, true);
|
|
103
|
+
window.addEventListener("resize", reposition);
|
|
104
|
+
queueMicrotask(reposition);
|
|
105
|
+
return () => {
|
|
106
|
+
document.removeEventListener("pointerdown", handler);
|
|
107
|
+
window.removeEventListener("scroll", reposition, true);
|
|
108
|
+
window.removeEventListener("resize", reposition);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<div
|
|
115
|
+
bind:this={wrapperEl}
|
|
116
|
+
class={cn("s-select-wrapper", styleClass, themeClass, className)}
|
|
117
|
+
class:disabled
|
|
118
|
+
class:focused
|
|
119
|
+
class:has-value={hasValue}
|
|
120
|
+
class:floated
|
|
121
|
+
class:open
|
|
122
|
+
tabindex="-1"
|
|
123
|
+
role="listbox"
|
|
124
|
+
aria-label={displayLabel}
|
|
125
|
+
onfocusin={() => (focused = true)}
|
|
126
|
+
onfocusout={handleBlur}
|
|
127
|
+
{...rest}
|
|
128
|
+
>
|
|
129
|
+
{#if hasFloatingLabel}
|
|
130
|
+
<label class="s-select-floating-label"
|
|
131
|
+
>{displayLabel}</label
|
|
132
|
+
>
|
|
133
|
+
{/if}
|
|
134
|
+
<div
|
|
135
|
+
class="s-select-control"
|
|
136
|
+
role="button"
|
|
137
|
+
tabindex="0"
|
|
138
|
+
onclick={() => (open = !open)}
|
|
139
|
+
onkeydown={handleKeydown}
|
|
140
|
+
>
|
|
141
|
+
{#if hasValue && !hasFloatingLabel}
|
|
142
|
+
<span class="s-select-value">{getLabel(value)}</span>
|
|
143
|
+
{:else if !hasFloatingLabel}
|
|
144
|
+
<span class="s-select-placeholder">{placeholder}</span>
|
|
145
|
+
{/if}
|
|
146
|
+
{#if hasFloatingLabel && hasValue}
|
|
147
|
+
<span class="s-select-value">{getLabel(value)}</span>
|
|
148
|
+
{/if}
|
|
149
|
+
<span class="s-select-arrow">
|
|
150
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none">
|
|
151
|
+
<path
|
|
152
|
+
d="M2.5 4.5L6 8L9.5 4.5"
|
|
153
|
+
stroke="currentColor"
|
|
154
|
+
stroke-width="1.5"
|
|
155
|
+
stroke-linecap="round"
|
|
156
|
+
stroke-linejoin="round"
|
|
157
|
+
/>
|
|
158
|
+
</svg>
|
|
159
|
+
</span>
|
|
160
|
+
</div>
|
|
161
|
+
{#if open}
|
|
162
|
+
<div
|
|
163
|
+
class="s-select-dropdown {styleClass} {themeClass}"
|
|
164
|
+
bind:this={dropdownEl}
|
|
165
|
+
use:portal
|
|
166
|
+
>
|
|
167
|
+
{#each options as opt}
|
|
168
|
+
<div
|
|
169
|
+
class="s-select-option"
|
|
170
|
+
class:selected={value === opt.value}
|
|
171
|
+
onclick={() => selectOption(opt.value)}
|
|
172
|
+
>
|
|
173
|
+
{opt.label}
|
|
174
|
+
</div>
|
|
175
|
+
{/each}
|
|
176
|
+
</div>
|
|
177
|
+
{/if}
|
|
178
|
+
</div>
|
|
@@ -11,6 +11,7 @@ declare const Select: import("svelte").Component<{
|
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
label?: string;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
class?: string;
|
|
14
15
|
} & Record<string, any>, {}, "value">;
|
|
15
16
|
type $$ComponentProps = {
|
|
16
17
|
style: any;
|
|
@@ -20,4 +21,5 @@ type $$ComponentProps = {
|
|
|
20
21
|
placeholder?: string;
|
|
21
22
|
label?: string;
|
|
22
23
|
disabled?: boolean;
|
|
24
|
+
class?: string;
|
|
23
25
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./skeleton-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -8,6 +9,7 @@
|
|
|
8
9
|
variant = "text",
|
|
9
10
|
width = "100%",
|
|
10
11
|
height = "",
|
|
12
|
+
class: className = "",
|
|
11
13
|
...rest
|
|
12
14
|
} = $props();
|
|
13
15
|
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
23
|
<div
|
|
22
|
-
class="s-skeleton
|
|
24
|
+
class={cn("s-skeleton", styleClass, themeClass, `skeleton-${variant}`, className)}
|
|
23
25
|
style="width: {width}; {height ? `height: ${height}` : ''}"
|
|
24
26
|
aria-hidden="true"
|
|
25
27
|
{...rest}
|
|
@@ -9,6 +9,7 @@ declare const Skeleton: import("svelte").Component<{
|
|
|
9
9
|
variant?: string;
|
|
10
10
|
width?: string;
|
|
11
11
|
height?: string;
|
|
12
|
+
class?: string;
|
|
12
13
|
} & Record<string, any>, {}, "">;
|
|
13
14
|
type $$ComponentProps = {
|
|
14
15
|
style: any;
|
|
@@ -16,4 +17,5 @@ type $$ComponentProps = {
|
|
|
16
17
|
variant?: string;
|
|
17
18
|
width?: string;
|
|
18
19
|
height?: string;
|
|
20
|
+
class?: string;
|
|
19
21
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./slider-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
step = 1,
|
|
12
13
|
disabled = false,
|
|
13
14
|
label = "",
|
|
15
|
+
class: className = "",
|
|
14
16
|
...rest
|
|
15
17
|
} = $props();
|
|
16
18
|
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
</script>
|
|
24
26
|
|
|
25
27
|
<div
|
|
26
|
-
class="s-slider-wrapper
|
|
28
|
+
class={cn("s-slider-wrapper", styleClass, themeClass, className)}
|
|
27
29
|
class:disabled
|
|
28
30
|
{...rest}
|
|
29
31
|
>
|
|
@@ -12,6 +12,7 @@ declare const Slider: import("svelte").Component<{
|
|
|
12
12
|
step?: number;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
label?: string;
|
|
15
|
+
class?: string;
|
|
15
16
|
} & Record<string, any>, {}, "value">;
|
|
16
17
|
type $$ComponentProps = {
|
|
17
18
|
style: any;
|
|
@@ -22,4 +23,5 @@ type $$ComponentProps = {
|
|
|
22
23
|
step?: number;
|
|
23
24
|
disabled?: boolean;
|
|
24
25
|
label?: string;
|
|
26
|
+
class?: string;
|
|
25
27
|
} & Record<string, any>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { draggable, droppable } from '@thisux/sveltednd';
|
|
3
3
|
import "./sortablelist-styles.css";
|
|
4
4
|
import { defaults } from "../config.js";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
5
6
|
|
|
6
7
|
let {
|
|
7
8
|
style: styleProp,
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
onUpdate,
|
|
11
12
|
type = 'item',
|
|
12
13
|
direction = 'vertical',
|
|
14
|
+
class: className = "",
|
|
13
15
|
children
|
|
14
16
|
} = $props();
|
|
15
17
|
|
|
@@ -95,7 +97,7 @@
|
|
|
95
97
|
}
|
|
96
98
|
</script>
|
|
97
99
|
|
|
98
|
-
<div class="s-sortablelist
|
|
100
|
+
<div class={cn("s-sortablelist", directionClass, styleClass, themeClass, className)} use:isolateEvents>
|
|
99
101
|
{#each items as item, index (item.id)}
|
|
100
102
|
<div
|
|
101
103
|
use:droppable={{
|
|
@@ -10,6 +10,7 @@ declare const SortableList: import("svelte").Component<{
|
|
|
10
10
|
onUpdate: any;
|
|
11
11
|
type?: string;
|
|
12
12
|
direction?: string;
|
|
13
|
+
class?: string;
|
|
13
14
|
children: any;
|
|
14
15
|
}, {}, "items">;
|
|
15
16
|
type $$ComponentProps = {
|
|
@@ -19,5 +20,6 @@ type $$ComponentProps = {
|
|
|
19
20
|
onUpdate: any;
|
|
20
21
|
type?: string;
|
|
21
22
|
direction?: string;
|
|
23
|
+
class?: string;
|
|
22
24
|
children: any;
|
|
23
25
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./spinner-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
7
8
|
theme: themeProp,
|
|
8
9
|
size = "md",
|
|
10
|
+
class: className = "",
|
|
9
11
|
...rest
|
|
10
12
|
} = $props();
|
|
11
13
|
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
</script>
|
|
19
21
|
|
|
20
22
|
<div
|
|
21
|
-
class="s-spinner
|
|
23
|
+
class={cn("s-spinner", styleClass, themeClass, sizeClass, className)}
|
|
22
24
|
role="status"
|
|
23
25
|
aria-label="Loading"
|
|
24
26
|
{...rest}
|
|
@@ -7,9 +7,11 @@ declare const Spinner: import("svelte").Component<{
|
|
|
7
7
|
style: any;
|
|
8
8
|
theme: any;
|
|
9
9
|
size?: string;
|
|
10
|
+
class?: string;
|
|
10
11
|
} & Record<string, any>, {}, "">;
|
|
11
12
|
type $$ComponentProps = {
|
|
12
13
|
style: any;
|
|
13
14
|
theme: any;
|
|
14
15
|
size?: string;
|
|
16
|
+
class?: string;
|
|
15
17
|
} & Record<string, any>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./stepper-styles.css";
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
7
8
|
theme: themeProp,
|
|
8
9
|
steps = [],
|
|
9
10
|
current = 0,
|
|
11
|
+
class: className = "",
|
|
10
12
|
...rest
|
|
11
13
|
} = $props();
|
|
12
14
|
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
});
|
|
58
60
|
</script>
|
|
59
61
|
|
|
60
|
-
<div class="s-stepper-wrap">
|
|
62
|
+
<div class={cn("s-stepper-wrap", className)}>
|
|
61
63
|
<div class="s-stepper {styleClass} {themeClass}" bind:this={el} {...rest}>
|
|
62
64
|
{#each steps as step, i}
|
|
63
65
|
<div
|