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
|
@@ -11,6 +11,7 @@ declare const ButtonGroup: import("svelte").Component<{
|
|
|
11
11
|
items?: any[];
|
|
12
12
|
value?: string;
|
|
13
13
|
orientation?: string;
|
|
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
|
items?: any[];
|
|
21
22
|
value?: string;
|
|
22
23
|
orientation?: string;
|
|
24
|
+
class?: string;
|
|
23
25
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./card-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,
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
</script>
|
|
22
23
|
|
|
23
24
|
<div
|
|
24
|
-
class="s-card
|
|
25
|
+
class={cn("s-card", styleClass, themeClass, padClass, className)}
|
|
25
26
|
class:elevated
|
|
26
27
|
{...rest}
|
|
27
28
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./carousel-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,
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
interval = 4000,
|
|
11
12
|
showArrows = true,
|
|
12
13
|
showIndicators = true,
|
|
14
|
+
class: className = "",
|
|
13
15
|
...rest
|
|
14
16
|
} = $props();
|
|
15
17
|
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
</script>
|
|
49
51
|
|
|
50
52
|
<div
|
|
51
|
-
class="s-carousel
|
|
53
|
+
class={cn("s-carousel", styleClass, themeClass, className)}
|
|
52
54
|
onmouseenter={() => { isHovering = true; }}
|
|
53
55
|
onmouseleave={() => { isHovering = false; }}
|
|
54
56
|
role="region"
|
|
@@ -11,6 +11,7 @@ declare const Carousel: import("svelte").Component<{
|
|
|
11
11
|
interval?: number;
|
|
12
12
|
showArrows?: boolean;
|
|
13
13
|
showIndicators?: boolean;
|
|
14
|
+
class?: string;
|
|
14
15
|
} & Record<string, any>, {}, "">;
|
|
15
16
|
type $$ComponentProps = {
|
|
16
17
|
style: any;
|
|
@@ -20,4 +21,5 @@ type $$ComponentProps = {
|
|
|
20
21
|
interval?: number;
|
|
21
22
|
showArrows?: boolean;
|
|
22
23
|
showIndicators?: boolean;
|
|
24
|
+
class?: string;
|
|
23
25
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./checkbox-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
|
label = "",
|
|
10
11
|
disabled = false,
|
|
11
12
|
indeterminate = false,
|
|
13
|
+
class: className = "",
|
|
12
14
|
...rest
|
|
13
15
|
} = $props();
|
|
14
16
|
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
</script>
|
|
23
25
|
|
|
24
26
|
<label
|
|
25
|
-
class="s-checkbox
|
|
27
|
+
class={cn("s-checkbox", styleClass, themeClass, className)}
|
|
26
28
|
class:disabled
|
|
27
29
|
class:checked
|
|
28
30
|
class:indeterminate
|
|
@@ -10,6 +10,7 @@ declare const Checkbox: import("svelte").Component<{
|
|
|
10
10
|
label?: string;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
indeterminate?: boolean;
|
|
13
|
+
class?: string;
|
|
13
14
|
} & Record<string, any>, {}, "checked">;
|
|
14
15
|
type $$ComponentProps = {
|
|
15
16
|
style: any;
|
|
@@ -18,4 +19,5 @@ type $$ComponentProps = {
|
|
|
18
19
|
label?: string;
|
|
19
20
|
disabled?: boolean;
|
|
20
21
|
indeterminate?: boolean;
|
|
22
|
+
class?: string;
|
|
21
23
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./chip-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,
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
dismissible = false,
|
|
13
14
|
icon = "",
|
|
14
15
|
ondismiss,
|
|
16
|
+
class: className = "",
|
|
15
17
|
...rest
|
|
16
18
|
} = $props();
|
|
17
19
|
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
|
|
26
28
|
{#if visible}
|
|
27
29
|
<span
|
|
28
|
-
class="s-chip
|
|
30
|
+
class={cn("s-chip", styleClass, themeClass, `chip-${variant}`, `chip-${color}`, `chip-${size}`, className)}
|
|
29
31
|
{...rest}
|
|
30
32
|
>
|
|
31
33
|
{#if icon}
|
|
@@ -13,6 +13,7 @@ declare const Chip: import("svelte").Component<{
|
|
|
13
13
|
dismissible?: boolean;
|
|
14
14
|
icon?: string;
|
|
15
15
|
ondismiss: any;
|
|
16
|
+
class?: string;
|
|
16
17
|
} & Record<string, any>, {}, "">;
|
|
17
18
|
type $$ComponentProps = {
|
|
18
19
|
style: any;
|
|
@@ -24,4 +25,5 @@ type $$ComponentProps = {
|
|
|
24
25
|
dismissible?: boolean;
|
|
25
26
|
icon?: string;
|
|
26
27
|
ondismiss: any;
|
|
28
|
+
class?: string;
|
|
27
29
|
} & Record<string, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./column-styles.css";
|
|
3
|
+
import { cn } from "../utils/cn.js";
|
|
3
4
|
|
|
4
5
|
let {
|
|
5
6
|
gap = "8px",
|
|
@@ -33,6 +34,6 @@
|
|
|
33
34
|
);
|
|
34
35
|
</script>
|
|
35
36
|
|
|
36
|
-
<div class="s-column
|
|
37
|
+
<div class={cn("s-column", className)} style={styleStr} {...rest}>
|
|
37
38
|
{@render children?.()}
|
|
38
39
|
</div>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
4
|
import { fade } from "svelte/transition";
|
|
5
5
|
import { portal } from "../actions/portal.js";
|
|
6
|
+
import { cn } from "../utils/cn.js";
|
|
6
7
|
|
|
7
8
|
let {
|
|
8
9
|
style: styleProp,
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
open = $bindable(false),
|
|
11
12
|
groups = [],
|
|
12
13
|
placeholder = "Type a command...",
|
|
14
|
+
class: className = "",
|
|
13
15
|
...rest
|
|
14
16
|
} = $props();
|
|
15
17
|
|
|
@@ -150,7 +152,7 @@
|
|
|
150
152
|
{#if open}
|
|
151
153
|
<div
|
|
152
154
|
use:portal
|
|
153
|
-
class="s-cmdk-overlay"
|
|
155
|
+
class={cn("s-cmdk-overlay", className)}
|
|
154
156
|
transition:fade={{ duration: 150 }}
|
|
155
157
|
onclick={(e) => { if (e.target === e.currentTarget) handleClose(); }}
|
|
156
158
|
role="dialog"
|
|
@@ -9,6 +9,7 @@ declare const CommandPalette: import("svelte").Component<{
|
|
|
9
9
|
open?: boolean;
|
|
10
10
|
groups?: any[];
|
|
11
11
|
placeholder?: string;
|
|
12
|
+
class?: string;
|
|
12
13
|
} & Record<string, any>, {}, "open">;
|
|
13
14
|
type $$ComponentProps = {
|
|
14
15
|
style: any;
|
|
@@ -16,4 +17,5 @@ type $$ComponentProps = {
|
|
|
16
17
|
open?: boolean;
|
|
17
18
|
groups?: any[];
|
|
18
19
|
placeholder?: string;
|
|
20
|
+
class?: string;
|
|
19
21
|
} & Record<string, any>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import "./datepicker-styles.css";
|
|
3
3
|
import { defaults, iconClass } from "../config.js";
|
|
4
4
|
import { portal } from "../actions/portal.js";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
5
6
|
import dayjs from "dayjs";
|
|
6
7
|
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
7
8
|
dayjs.extend(customParseFormat);
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
min = undefined,
|
|
19
20
|
max = undefined,
|
|
20
21
|
locale = "en-US",
|
|
22
|
+
class: className = "",
|
|
21
23
|
...rest
|
|
22
24
|
} = $props();
|
|
23
25
|
|
|
@@ -286,7 +288,7 @@
|
|
|
286
288
|
</script>
|
|
287
289
|
|
|
288
290
|
<div
|
|
289
|
-
class="s-datepicker-wrapper
|
|
291
|
+
class={cn("s-datepicker-wrapper", styleClass, themeClass, className)}
|
|
290
292
|
class:s-datepicker-open={open}
|
|
291
293
|
class:focused={open}
|
|
292
294
|
class:floated
|
|
@@ -15,6 +15,7 @@ declare const DatePicker: import("svelte").Component<{
|
|
|
15
15
|
min?: any;
|
|
16
16
|
max?: any;
|
|
17
17
|
locale?: string;
|
|
18
|
+
class?: string;
|
|
18
19
|
} & Record<string, any>, {}, "value">;
|
|
19
20
|
type $$ComponentProps = {
|
|
20
21
|
style: any;
|
|
@@ -28,4 +29,5 @@ type $$ComponentProps = {
|
|
|
28
29
|
min?: any;
|
|
29
30
|
max?: any;
|
|
30
31
|
locale?: string;
|
|
32
|
+
class?: string;
|
|
31
33
|
} & Record<string, any>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./divider-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
|
orientation = "horizontal",
|
|
9
10
|
label = "",
|
|
11
|
+
class: className = "",
|
|
10
12
|
...rest
|
|
11
13
|
} = $props();
|
|
12
14
|
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
</script>
|
|
19
21
|
|
|
20
22
|
<div
|
|
21
|
-
class="s-divider
|
|
23
|
+
class={cn("s-divider", styleClass, themeClass, className)}
|
|
22
24
|
class:vertical={orientation === "vertical"}
|
|
23
25
|
role="separator"
|
|
24
26
|
aria-orientation={orientation}
|
|
@@ -8,10 +8,12 @@ declare const Divider: import("svelte").Component<{
|
|
|
8
8
|
theme: any;
|
|
9
9
|
orientation?: string;
|
|
10
10
|
label?: string;
|
|
11
|
+
class?: string;
|
|
11
12
|
} & Record<string, any>, {}, "">;
|
|
12
13
|
type $$ComponentProps = {
|
|
13
14
|
style: any;
|
|
14
15
|
theme: any;
|
|
15
16
|
orientation?: string;
|
|
16
17
|
label?: string;
|
|
18
|
+
class?: string;
|
|
17
19
|
} & Record<string, any>;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
4
|
import { fade } from "svelte/transition";
|
|
5
5
|
import { portal } from "../actions/portal.js";
|
|
6
|
+
import { cn } from "../utils/cn.js";
|
|
6
7
|
|
|
7
8
|
let {
|
|
8
9
|
style: styleProp,
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
open = $bindable(false),
|
|
12
13
|
children,
|
|
13
14
|
onclose,
|
|
15
|
+
class: className = "",
|
|
14
16
|
...rest
|
|
15
17
|
} = $props();
|
|
16
18
|
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
{#if open}
|
|
52
54
|
<div
|
|
53
55
|
use:portal
|
|
54
|
-
class="s-drawer-overlay"
|
|
56
|
+
class={cn("s-drawer-overlay", className)}
|
|
55
57
|
transition:fade={{ duration: 200 }}
|
|
56
58
|
onclick={handleBackdrop}
|
|
57
59
|
role="presentation"
|
|
@@ -10,6 +10,7 @@ declare const Drawer: import("svelte").Component<{
|
|
|
10
10
|
open?: boolean;
|
|
11
11
|
children: any;
|
|
12
12
|
onclose: any;
|
|
13
|
+
class?: string;
|
|
13
14
|
} & Record<string, any>, {}, "open">;
|
|
14
15
|
type $$ComponentProps = {
|
|
15
16
|
style: any;
|
|
@@ -18,4 +19,5 @@ type $$ComponentProps = {
|
|
|
18
19
|
open?: boolean;
|
|
19
20
|
children: any;
|
|
20
21
|
onclose: any;
|
|
22
|
+
class?: string;
|
|
21
23
|
} & Record<string, any>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import "./dropdown-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,
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
items = [],
|
|
13
14
|
position = "bottom",
|
|
14
15
|
align = "left",
|
|
16
|
+
class: className = "",
|
|
15
17
|
...rest
|
|
16
18
|
} = $props();
|
|
17
19
|
|
|
@@ -60,7 +62,7 @@
|
|
|
60
62
|
</script>
|
|
61
63
|
|
|
62
64
|
<div
|
|
63
|
-
class="s-dropdown
|
|
65
|
+
class={cn("s-dropdown", styleClass, themeClass, `dropdown-${align}`, className)}
|
|
64
66
|
class:open
|
|
65
67
|
{...rest}
|
|
66
68
|
>
|
|
@@ -12,6 +12,7 @@ declare const DropdownMenu: import("svelte").Component<{
|
|
|
12
12
|
items?: any[];
|
|
13
13
|
position?: string;
|
|
14
14
|
align?: string;
|
|
15
|
+
class?: string;
|
|
15
16
|
} & Record<string, any>, {}, "">;
|
|
16
17
|
type $$ComponentProps = {
|
|
17
18
|
style: any;
|
|
@@ -22,4 +23,5 @@ type $$ComponentProps = {
|
|
|
22
23
|
items?: any[];
|
|
23
24
|
position?: string;
|
|
24
25
|
align?: string;
|
|
26
|
+
class?: string;
|
|
25
27
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./fab-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
|
children,
|
|
10
11
|
position = "bottom-right",
|
|
11
12
|
onclick,
|
|
13
|
+
class: className = "",
|
|
12
14
|
...rest
|
|
13
15
|
} = $props();
|
|
14
16
|
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
</script>
|
|
22
24
|
|
|
23
25
|
<button
|
|
24
|
-
class="s-fab
|
|
26
|
+
class={cn("s-fab", styleClass, themeClass, presetClass, `fab-${position}`, className)}
|
|
25
27
|
{onclick}
|
|
26
28
|
{...rest}
|
|
27
29
|
>
|
|
@@ -10,6 +10,7 @@ declare const FAB: import("svelte").Component<{
|
|
|
10
10
|
children: any;
|
|
11
11
|
position?: string;
|
|
12
12
|
onclick: any;
|
|
13
|
+
class?: string;
|
|
13
14
|
} & Record<string, any>, {}, "">;
|
|
14
15
|
type $$ComponentProps = {
|
|
15
16
|
style: any;
|
|
@@ -18,4 +19,5 @@ type $$ComponentProps = {
|
|
|
18
19
|
children: any;
|
|
19
20
|
position?: string;
|
|
20
21
|
onclick: any;
|
|
22
|
+
class?: string;
|
|
21
23
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./fileupload-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
|
multiple = false,
|
|
10
11
|
disabled = false,
|
|
11
12
|
label = "Drop files or click to upload",
|
|
13
|
+
class: className = "",
|
|
12
14
|
...rest
|
|
13
15
|
} = $props();
|
|
14
16
|
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
</script>
|
|
34
36
|
|
|
35
37
|
<div
|
|
36
|
-
class="s-fileupload
|
|
38
|
+
class={cn("s-fileupload", styleClass, themeClass, className)}
|
|
37
39
|
class:dragging
|
|
38
40
|
class:disabled
|
|
39
41
|
ondragover={(e) => {
|
|
@@ -10,6 +10,7 @@ declare const FileUpload: import("svelte").Component<{
|
|
|
10
10
|
multiple?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
label?: string;
|
|
13
|
+
class?: string;
|
|
13
14
|
} & Record<string, any>, {}, "">;
|
|
14
15
|
type $$ComponentProps = {
|
|
15
16
|
style: any;
|
|
@@ -18,4 +19,5 @@ type $$ComponentProps = {
|
|
|
18
19
|
multiple?: boolean;
|
|
19
20
|
disabled?: boolean;
|
|
20
21
|
label?: string;
|
|
22
|
+
class?: string;
|
|
21
23
|
} & Record<string, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./grid-styles.css";
|
|
3
|
+
import { cn } from "../utils/cn.js";
|
|
3
4
|
|
|
4
5
|
let {
|
|
5
6
|
columns = 1,
|
|
@@ -46,6 +47,6 @@
|
|
|
46
47
|
);
|
|
47
48
|
</script>
|
|
48
49
|
|
|
49
|
-
<div class="s-grid
|
|
50
|
+
<div class={cn("s-grid", className)} style={styleStr} {...rest}>
|
|
50
51
|
{@render children?.()}
|
|
51
52
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./iconbutton-styles.css";
|
|
3
3
|
import { defaults, iconClass } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
children,
|
|
14
15
|
onclick,
|
|
15
16
|
ariaLabel = "",
|
|
17
|
+
class: className = "",
|
|
16
18
|
...rest
|
|
17
19
|
} = $props();
|
|
18
20
|
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
</script>
|
|
28
30
|
|
|
29
31
|
<button
|
|
30
|
-
class="s-iconbtn
|
|
32
|
+
class={cn("s-iconbtn", styleClass, themeClass, variantClass, presetClass, sizeClass, className)}
|
|
31
33
|
{disabled}
|
|
32
34
|
{onclick}
|
|
33
35
|
aria-label={ariaLabel}
|
|
@@ -14,6 +14,7 @@ declare const IconButton: import("svelte").Component<{
|
|
|
14
14
|
children: any;
|
|
15
15
|
onclick: any;
|
|
16
16
|
ariaLabel?: string;
|
|
17
|
+
class?: string;
|
|
17
18
|
} & Record<string, any>, {}, "">;
|
|
18
19
|
type $$ComponentProps = {
|
|
19
20
|
style: any;
|
|
@@ -26,4 +27,5 @@ type $$ComponentProps = {
|
|
|
26
27
|
children: any;
|
|
27
28
|
onclick: any;
|
|
28
29
|
ariaLabel?: string;
|
|
30
|
+
class?: string;
|
|
29
31
|
} & Record<string, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./input-styles.css";
|
|
3
3
|
import { defaults, iconClass } from "../config.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
style: styleProp,
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
form = undefined,
|
|
34
35
|
inputmode = undefined,
|
|
35
36
|
spellcheck = undefined,
|
|
37
|
+
class: className = "",
|
|
36
38
|
...rest
|
|
37
39
|
} = $props();
|
|
38
40
|
|
|
@@ -67,7 +69,7 @@
|
|
|
67
69
|
</script>
|
|
68
70
|
|
|
69
71
|
<div
|
|
70
|
-
class="s-input-wrapper
|
|
72
|
+
class={cn("s-input-wrapper", styleClass, themeClass, className)}
|
|
71
73
|
class:disabled
|
|
72
74
|
class:focused
|
|
73
75
|
class:has-value={hasValue}
|
|
@@ -34,6 +34,7 @@ declare const Input: import("svelte").Component<{
|
|
|
34
34
|
form?: any;
|
|
35
35
|
inputmode?: any;
|
|
36
36
|
spellcheck?: any;
|
|
37
|
+
class?: string;
|
|
37
38
|
} & Record<string, any>, {}, "value">;
|
|
38
39
|
type $$ComponentProps = {
|
|
39
40
|
style: any;
|
|
@@ -66,4 +67,5 @@ type $$ComponentProps = {
|
|
|
66
67
|
form?: any;
|
|
67
68
|
inputmode?: any;
|
|
68
69
|
spellcheck?: any;
|
|
70
|
+
class?: string;
|
|
69
71
|
} & Record<string, any>;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { defaults } from "../config.js";
|
|
4
4
|
import { fade, scale } from "svelte/transition";
|
|
5
5
|
import { portal } from "../actions/portal.js";
|
|
6
|
+
import { cn } from "../utils/cn.js";
|
|
6
7
|
|
|
7
8
|
let {
|
|
8
9
|
style: styleProp,
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
size = "medium",
|
|
13
14
|
children,
|
|
14
15
|
onclose,
|
|
16
|
+
class: className = "",
|
|
15
17
|
...rest
|
|
16
18
|
} = $props();
|
|
17
19
|
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
{#if open}
|
|
36
38
|
<div
|
|
37
39
|
use:portal
|
|
38
|
-
class="s-modal-overlay
|
|
40
|
+
class={cn("s-modal-overlay", styleClass, themeClass, className)}
|
|
39
41
|
transition:fade={{ duration: 200 }}
|
|
40
42
|
onclick={handleBackdrop}
|
|
41
43
|
role="dialog"
|
|
@@ -11,6 +11,7 @@ declare const Modal: import("svelte").Component<{
|
|
|
11
11
|
size?: string;
|
|
12
12
|
children: any;
|
|
13
13
|
onclose: any;
|
|
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
|
size?: string;
|
|
21
22
|
children: any;
|
|
22
23
|
onclose: any;
|
|
24
|
+
class?: string;
|
|
23
25
|
} & Record<string, any>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./multiselect-styles.css";
|
|
3
|
+
import { portal } from "../actions/portal.js";
|
|
3
4
|
import { defaults } from "../config.js";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
4
6
|
|
|
5
7
|
let {
|
|
6
8
|
style: styleProp,
|
|
@@ -10,6 +12,7 @@
|
|
|
10
12
|
placeholder = "Select...",
|
|
11
13
|
label = "",
|
|
12
14
|
disabled = false,
|
|
15
|
+
class: className = "",
|
|
13
16
|
...rest
|
|
14
17
|
} = $props();
|
|
15
18
|
|
|
@@ -18,6 +21,8 @@
|
|
|
18
21
|
|
|
19
22
|
let open = $state(false);
|
|
20
23
|
let focused = $state(false);
|
|
24
|
+
let wrapperEl;
|
|
25
|
+
let dropdownEl;
|
|
21
26
|
let hasValue = $derived(selected.length > 0);
|
|
22
27
|
let floated = $derived(focused || hasValue);
|
|
23
28
|
|
|
@@ -53,16 +58,45 @@
|
|
|
53
58
|
return opt ? opt.label : val;
|
|
54
59
|
}
|
|
55
60
|
|
|
61
|
+
function positionDropdown() {
|
|
62
|
+
if (!wrapperEl || !dropdownEl) return;
|
|
63
|
+
const rect = wrapperEl.getBoundingClientRect();
|
|
64
|
+
const ddHeight = dropdownEl.offsetHeight || 200;
|
|
65
|
+
let top = rect.bottom + 4;
|
|
66
|
+
if (top + ddHeight > window.innerHeight - 8 && rect.top - ddHeight - 4 > 8) {
|
|
67
|
+
top = rect.top - ddHeight - 4;
|
|
68
|
+
}
|
|
69
|
+
dropdownEl.style.left = `${rect.left}px`;
|
|
70
|
+
dropdownEl.style.top = `${top}px`;
|
|
71
|
+
dropdownEl.style.width = `${rect.width}px`;
|
|
72
|
+
}
|
|
73
|
+
|
|
56
74
|
function handleBlur(e) {
|
|
57
|
-
if (
|
|
75
|
+
if (
|
|
76
|
+
wrapperEl && !wrapperEl.contains(e.relatedTarget) &&
|
|
77
|
+
!(dropdownEl && dropdownEl.contains(e.relatedTarget))
|
|
78
|
+
) {
|
|
58
79
|
open = false;
|
|
59
80
|
focused = false;
|
|
60
81
|
}
|
|
61
82
|
}
|
|
83
|
+
|
|
84
|
+
$effect(() => {
|
|
85
|
+
if (!open) return;
|
|
86
|
+
const reposition = () => positionDropdown();
|
|
87
|
+
window.addEventListener("scroll", reposition, true);
|
|
88
|
+
window.addEventListener("resize", reposition);
|
|
89
|
+
queueMicrotask(reposition);
|
|
90
|
+
return () => {
|
|
91
|
+
window.removeEventListener("scroll", reposition, true);
|
|
92
|
+
window.removeEventListener("resize", reposition);
|
|
93
|
+
};
|
|
94
|
+
});
|
|
62
95
|
</script>
|
|
63
96
|
|
|
64
97
|
<div
|
|
65
|
-
|
|
98
|
+
bind:this={wrapperEl}
|
|
99
|
+
class={cn("s-mselect-wrapper", styleClass, themeClass, className)}
|
|
66
100
|
class:disabled
|
|
67
101
|
class:focused
|
|
68
102
|
class:open
|
|
@@ -123,7 +157,11 @@
|
|
|
123
157
|
</span>
|
|
124
158
|
</div>
|
|
125
159
|
{#if open}
|
|
126
|
-
<div
|
|
160
|
+
<div
|
|
161
|
+
class="mselect-dropdown {styleClass} {themeClass}"
|
|
162
|
+
bind:this={dropdownEl}
|
|
163
|
+
use:portal
|
|
164
|
+
>
|
|
127
165
|
{#each options as opt}
|
|
128
166
|
<label
|
|
129
167
|
class="mselect-option"
|
|
@@ -11,6 +11,7 @@ declare const MultiSelect: import("svelte").Component<{
|
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
label?: string;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
class?: string;
|
|
14
15
|
} & Record<string, any>, {}, "selected">;
|
|
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>;
|