svelte-multistyle-ui 0.0.15-alpha → 0.1.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/README.md +55 -3
- package/cli/bin.js +94 -92
- package/cli/emit.js +242 -225
- package/cli/fixtures/sample.expected.svelte +2 -1
- package/cli/generate.js +507 -499
- package/cli/registry.js +105 -100
- package/cli/schema.js +16 -0
- package/dist/actions/dialog.d.ts +11 -0
- package/dist/actions/dialog.js +118 -0
- package/dist/components/Accordion.svelte +11 -5
- package/dist/components/Accordion.svelte.d.ts +8 -12
- package/dist/components/Alert.svelte +11 -5
- package/dist/components/Alert.svelte.d.ts +8 -16
- package/dist/components/Avatar.svelte +13 -3
- package/dist/components/Avatar.svelte.d.ts +8 -14
- package/dist/components/Breadcrumb.svelte +9 -3
- package/dist/components/Breadcrumb.svelte.d.ts +8 -8
- package/dist/components/Button.svelte +11 -3
- package/dist/components/Button.svelte.d.ts +8 -20
- package/dist/components/ButtonGroup.svelte +10 -4
- package/dist/components/ButtonGroup.svelte.d.ts +8 -16
- package/dist/components/Card.svelte +9 -3
- package/dist/components/Card.svelte.d.ts +8 -12
- package/dist/components/Carousel.svelte +17 -9
- package/dist/components/Carousel.svelte.d.ts +8 -16
- package/dist/components/Checkbox.svelte +10 -4
- package/dist/components/Checkbox.svelte.d.ts +8 -14
- package/dist/components/Chip.svelte +10 -4
- package/dist/components/Chip.svelte.d.ts +8 -20
- package/dist/components/CodeEditor.svelte +139 -129
- package/dist/components/CodeEditor.svelte.d.ts +8 -16
- package/dist/components/Column.svelte +48 -38
- package/dist/components/Column.svelte.d.ts +8 -12
- package/dist/components/CommandPalette.svelte +14 -5
- package/dist/components/CommandPalette.svelte.d.ts +8 -12
- package/dist/components/CrudView.svelte +1604 -0
- package/dist/components/CrudView.svelte.d.ts +17 -0
- package/dist/components/DatePicker.svelte +42 -10
- package/dist/components/DatePicker.svelte.d.ts +8 -24
- package/dist/components/Divider.svelte +9 -3
- package/dist/components/Divider.svelte.d.ts +8 -10
- package/dist/components/Drawer.svelte +19 -3
- package/dist/components/Drawer.svelte.d.ts +8 -14
- package/dist/components/DropdownMenu.svelte +32 -5
- package/dist/components/DropdownMenu.svelte.d.ts +8 -18
- package/dist/components/FAB.svelte +10 -4
- package/dist/components/FAB.svelte.d.ts +8 -14
- package/dist/components/FileUpload.svelte +47 -8
- package/dist/components/FileUpload.svelte.d.ts +8 -14
- package/dist/components/FilterBar.svelte +768 -0
- package/dist/components/FilterBar.svelte.d.ts +17 -0
- package/dist/components/GraphEditor.svelte +725 -723
- package/dist/components/GraphEditor.svelte.d.ts +8 -8
- package/dist/components/Grid.svelte +61 -51
- package/dist/components/Grid.svelte.d.ts +8 -18
- package/dist/components/IconButton.svelte +12 -4
- package/dist/components/IconButton.svelte.d.ts +8 -22
- package/dist/components/InlineEdit.svelte +6 -3
- package/dist/components/InlineEdit.svelte.d.ts +10 -10
- package/dist/components/Input.svelte +18 -4
- package/dist/components/Input.svelte.d.ts +8 -62
- package/dist/components/Modal.svelte +14 -5
- package/dist/components/Modal.svelte.d.ts +8 -16
- package/dist/components/MultiSelect.svelte +22 -204
- package/dist/components/MultiSelect.svelte.d.ts +8 -16
- package/dist/components/Pagination.svelte +19 -4
- package/dist/components/Pagination.svelte.d.ts +8 -12
- package/dist/components/Popover.svelte +15 -4
- package/dist/components/Popover.svelte.d.ts +8 -16
- package/dist/components/ProgressBar.svelte +79 -73
- package/dist/components/ProgressBar.svelte.d.ts +8 -14
- package/dist/components/Radio.svelte +10 -4
- package/dist/components/Radio.svelte.d.ts +8 -14
- package/dist/components/Rating.svelte +30 -6
- package/dist/components/Rating.svelte.d.ts +8 -18
- package/dist/components/Row.svelte +49 -39
- package/dist/components/Row.svelte.d.ts +8 -14
- package/dist/components/Select.svelte +252 -32
- package/dist/components/Select.svelte.d.ts +8 -16
- package/dist/components/Skeleton.svelte +9 -3
- package/dist/components/Skeleton.svelte.d.ts +8 -12
- package/dist/components/Slider.svelte +14 -6
- package/dist/components/Slider.svelte.d.ts +8 -18
- package/dist/components/SortableList.svelte +136 -130
- package/dist/components/SortableList.svelte.d.ts +6 -14
- package/dist/components/Spinner.svelte +9 -3
- package/dist/components/Spinner.svelte.d.ts +8 -8
- package/dist/components/Stepper.svelte +101 -93
- package/dist/components/Stepper.svelte.d.ts +8 -10
- package/dist/components/Table.svelte +9 -3
- package/dist/components/Table.svelte.d.ts +8 -12
- package/dist/components/Tabs.svelte +29 -5
- package/dist/components/Tabs.svelte.d.ts +8 -10
- package/dist/components/TextEditor.svelte +191 -182
- package/dist/components/TextEditor.svelte.d.ts +8 -18
- package/dist/components/Textarea.svelte +24 -7
- package/dist/components/Textarea.svelte.d.ts +8 -24
- package/dist/components/Toast.svelte +52 -16
- package/dist/components/Toast.svelte.d.ts +8 -12
- package/dist/components/Toggle.svelte +10 -4
- package/dist/components/Toggle.svelte.d.ts +8 -14
- package/dist/components/Tooltip.svelte +14 -4
- package/dist/components/Tooltip.svelte.d.ts +8 -12
- package/dist/components/charts/BarChart.svelte +7 -5
- package/dist/components/charts/BarChart.svelte.d.ts +8 -22
- package/dist/components/charts/BubbleChart.svelte +7 -5
- package/dist/components/charts/BubbleChart.svelte.d.ts +8 -22
- package/dist/components/charts/Chart.svelte +273 -248
- package/dist/components/charts/Chart.svelte.d.ts +8 -30
- package/dist/components/charts/ComboChart.svelte +7 -5
- package/dist/components/charts/ComboChart.svelte.d.ts +8 -22
- package/dist/components/charts/DoughnutChart.svelte +7 -5
- package/dist/components/charts/DoughnutChart.svelte.d.ts +8 -22
- package/dist/components/charts/LineChart.svelte +7 -5
- package/dist/components/charts/LineChart.svelte.d.ts +8 -22
- package/dist/components/charts/MermaidChart.svelte +106 -0
- package/dist/components/charts/MermaidChart.svelte.d.ts +20 -0
- package/dist/components/charts/PieChart.svelte +7 -5
- package/dist/components/charts/PieChart.svelte.d.ts +8 -22
- package/dist/components/charts/PolarAreaChart.svelte +7 -5
- package/dist/components/charts/PolarAreaChart.svelte.d.ts +8 -22
- package/dist/components/charts/RadarChart.svelte +7 -5
- package/dist/components/charts/RadarChart.svelte.d.ts +8 -22
- package/dist/components/charts/ScatterChart.svelte +7 -5
- package/dist/components/charts/ScatterChart.svelte.d.ts +8 -22
- package/dist/components/charts/StackedBarChart.svelte +20 -18
- package/dist/components/charts/StackedBarChart.svelte.d.ts +8 -22
- package/dist/components/charts/StackedLineChart.svelte +23 -21
- package/dist/components/charts/StackedLineChart.svelte.d.ts +8 -22
- package/dist/components/charts/chart-config.d.ts +5 -5
- package/dist/components/charts/chart-config.js +722 -733
- package/dist/components/charts/index.d.ts +12 -0
- package/dist/components/charts/index.js +12 -0
- package/dist/components/charts/mermaid-chart-styles.css +27 -0
- package/dist/components/checkbox-styles.css +122 -117
- package/dist/components/crudview-styles.css +1057 -0
- package/dist/components/fileupload-styles.css +121 -117
- package/dist/components/filterbar-styles.css +655 -0
- package/dist/components/graph/FlowNode.svelte +82 -79
- package/dist/components/graph/FlowNode.svelte.d.ts +8 -28
- package/dist/components/graph/GraphNode.svelte +72 -69
- package/dist/components/graph/GraphNode.svelte.d.ts +8 -22
- package/dist/components/prism-manual.d.ts +0 -0
- package/dist/components/prism-manual.js +4 -0
- package/dist/components/radio-styles.css +118 -113
- package/dist/components/rating-styles.css +70 -65
- package/dist/components/select-styles.css +239 -11
- package/dist/components/slider-styles.css +85 -81
- package/dist/components/text-editor-core/dom-utils.d.ts +1 -1
- package/dist/components/text-editor-core/editor-core.d.ts +9 -9
- package/dist/components/text-editor-core/editor-core.js +854 -808
- package/dist/components/text-editor-core/sanitizer.d.ts +4 -1
- package/dist/components/text-editor-core/sanitizer.js +236 -161
- package/dist/components/text-editor-core/selection-engine.d.ts +3 -3
- package/dist/components/theme.css +59 -49
- package/dist/components/toast-styles.css +8 -8
- package/dist/components/toggle-styles.css +126 -121
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/config.svelte.d.ts +5 -4
- package/dist/config.svelte.js +124 -81
- package/dist/graph/geometry.d.ts +1 -1
- package/dist/graph/node-types.d.ts +1 -1
- package/dist/index.d.ts +4 -11
- package/dist/index.js +9 -12
- package/dist/themes/generator.js +175 -173
- package/dist/themes/presets.d.ts +21 -21
- package/dist/themes/presets.js +6 -6
- package/dist/utils/dbmr.d.ts +27 -0
- package/dist/utils/dbmr.js +381 -0
- package/dist/utils/filter.d.ts +103 -0
- package/dist/utils/filter.js +621 -0
- package/package.json +114 -85
- package/dist/components/multiselect-styles.css +0 -364
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./button-styles.css";
|
|
3
|
-
import {
|
|
3
|
+
import { getMultistyleDefaults, iconClass } from "../config.js";
|
|
4
4
|
import { cn } from "../utils/cn.js";
|
|
5
5
|
|
|
6
|
+
/** @type {{ style?: string, theme?: string, class?: string, [key: string]: any }} */
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
let {
|
|
7
10
|
style: styleProp,
|
|
8
11
|
theme: themeProp,
|
|
9
12
|
variant = "filled",
|
|
10
13
|
preset = "primary",
|
|
11
14
|
size = "md",
|
|
15
|
+
type = "button",
|
|
12
16
|
disabled = false,
|
|
13
17
|
icon,
|
|
14
18
|
children,
|
|
@@ -17,8 +21,11 @@
|
|
|
17
21
|
...rest
|
|
18
22
|
} = $props();
|
|
19
23
|
|
|
20
|
-
const
|
|
21
|
-
|
|
24
|
+
const _cfg = getMultistyleDefaults();
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const style = $derived(styleProp ?? _cfg.style);
|
|
28
|
+
const theme = $derived(themeProp ?? _cfg.theme);
|
|
22
29
|
|
|
23
30
|
const styleClass = $derived(`s-button-${style}`);
|
|
24
31
|
const themeClass = $derived(`theme-${theme}`);
|
|
@@ -28,6 +35,7 @@
|
|
|
28
35
|
</script>
|
|
29
36
|
|
|
30
37
|
<button
|
|
38
|
+
{type}
|
|
31
39
|
class={cn("s-button", styleClass, themeClass, variantClass, presetClass, sizeClass, className)}
|
|
32
40
|
{disabled}
|
|
33
41
|
{onclick}
|
|
@@ -4,26 +4,14 @@ type Button = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const Button: import("svelte").Component<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
preset?: string;
|
|
11
|
-
size?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
icon: any;
|
|
14
|
-
children: any;
|
|
15
|
-
onclick: any;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
style?: string;
|
|
9
|
+
theme?: string;
|
|
16
10
|
class?: string;
|
|
17
|
-
}
|
|
11
|
+
}, {}, "">;
|
|
18
12
|
type $$ComponentProps = {
|
|
19
|
-
style
|
|
20
|
-
theme
|
|
21
|
-
variant?: string;
|
|
22
|
-
preset?: string;
|
|
23
|
-
size?: string;
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
icon: any;
|
|
26
|
-
children: any;
|
|
27
|
-
onclick: any;
|
|
13
|
+
style?: string;
|
|
14
|
+
theme?: string;
|
|
28
15
|
class?: string;
|
|
29
|
-
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./buttongroup-styles.css";
|
|
3
|
-
import {
|
|
3
|
+
import { getMultistyleDefaults } from "../config.js";
|
|
4
4
|
import { cn } from "../utils/cn.js";
|
|
5
5
|
|
|
6
|
+
/** @type {{ style?: string, theme?: string, class?: string, [key: string]: any }} */
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
let {
|
|
7
10
|
style: styleProp,
|
|
8
11
|
theme: themeProp,
|
|
@@ -15,8 +18,11 @@
|
|
|
15
18
|
...rest
|
|
16
19
|
} = $props();
|
|
17
20
|
|
|
18
|
-
const
|
|
19
|
-
|
|
21
|
+
const _cfg = getMultistyleDefaults();
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const style = $derived(styleProp ?? _cfg.style);
|
|
25
|
+
const theme = $derived(themeProp ?? _cfg.theme);
|
|
20
26
|
const styleClass = $derived(`s-btn-group-${style}`);
|
|
21
27
|
const themeClass = $derived(`theme-${theme}`);
|
|
22
28
|
|
|
@@ -32,7 +38,7 @@
|
|
|
32
38
|
{...rest}
|
|
33
39
|
>
|
|
34
40
|
{#each items as item}
|
|
35
|
-
<button
|
|
41
|
+
<button type="button"
|
|
36
42
|
class="s-btn-group-item"
|
|
37
43
|
class:active={value === item.value}
|
|
38
44
|
onclick={() => handleClick(item)}
|
|
@@ -4,22 +4,14 @@ type ButtonGroup = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const ButtonGroup: import("svelte").Component<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
size?: string;
|
|
11
|
-
items?: any[];
|
|
12
|
-
value?: string;
|
|
13
|
-
orientation?: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
style?: string;
|
|
9
|
+
theme?: string;
|
|
14
10
|
class?: string;
|
|
15
|
-
}
|
|
11
|
+
}, {}, "value">;
|
|
16
12
|
type $$ComponentProps = {
|
|
17
|
-
style
|
|
18
|
-
theme
|
|
19
|
-
variant?: string;
|
|
20
|
-
size?: string;
|
|
21
|
-
items?: any[];
|
|
22
|
-
value?: string;
|
|
23
|
-
orientation?: string;
|
|
13
|
+
style?: string;
|
|
14
|
+
theme?: string;
|
|
24
15
|
class?: string;
|
|
25
|
-
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./card-styles.css";
|
|
3
|
-
import {
|
|
3
|
+
import { getMultistyleDefaults } from "../config.js";
|
|
4
4
|
import { cn } from "../utils/cn.js";
|
|
5
5
|
|
|
6
|
+
/** @type {{ style?: string, theme?: string, class?: string, [key: string]: any }} */
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
let {
|
|
7
10
|
style: styleProp,
|
|
8
11
|
theme: themeProp,
|
|
@@ -13,8 +16,11 @@
|
|
|
13
16
|
...rest
|
|
14
17
|
} = $props();
|
|
15
18
|
|
|
16
|
-
const
|
|
17
|
-
|
|
19
|
+
const _cfg = getMultistyleDefaults();
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const style = $derived(styleProp ?? _cfg.style);
|
|
23
|
+
const theme = $derived(themeProp ?? _cfg.theme);
|
|
18
24
|
|
|
19
25
|
const styleClass = $derived(`s-card-${style}`);
|
|
20
26
|
const themeClass = $derived(`theme-${theme}`);
|
|
@@ -4,18 +4,14 @@ type Card = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const Card: import("svelte").Component<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
padding?: string;
|
|
11
|
-
elevated?: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
style?: string;
|
|
9
|
+
theme?: string;
|
|
12
10
|
class?: string;
|
|
13
|
-
}
|
|
11
|
+
}, {}, "">;
|
|
14
12
|
type $$ComponentProps = {
|
|
15
|
-
style
|
|
16
|
-
theme
|
|
17
|
-
children: any;
|
|
18
|
-
padding?: string;
|
|
19
|
-
elevated?: boolean;
|
|
13
|
+
style?: string;
|
|
14
|
+
theme?: string;
|
|
20
15
|
class?: string;
|
|
21
|
-
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./carousel-styles.css";
|
|
3
|
-
import {
|
|
3
|
+
import { getMultistyleDefaults } from "../config.js";
|
|
4
4
|
import { cn } from "../utils/cn.js";
|
|
5
5
|
|
|
6
|
+
/** @type {{ style?: string, theme?: string, class?: string, [key: string]: any }} */
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
let {
|
|
7
10
|
style: styleProp,
|
|
8
11
|
theme: themeProp,
|
|
@@ -15,8 +18,11 @@
|
|
|
15
18
|
...rest
|
|
16
19
|
} = $props();
|
|
17
20
|
|
|
18
|
-
const
|
|
19
|
-
|
|
21
|
+
const _cfg = getMultistyleDefaults();
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const style = $derived(styleProp ?? _cfg.style);
|
|
25
|
+
const theme = $derived(themeProp ?? _cfg.theme);
|
|
20
26
|
const styleClass = $derived(`s-carousel-${style}`);
|
|
21
27
|
const themeClass = $derived(`theme-${theme}`);
|
|
22
28
|
let current = $state(0);
|
|
@@ -24,14 +30,15 @@
|
|
|
24
30
|
let isHovering = $state(false);
|
|
25
31
|
const total = $derived(slides.length);
|
|
26
32
|
|
|
27
|
-
function goTo(index) {
|
|
33
|
+
function goTo(index, explicitDirection = null) {
|
|
34
|
+
if (total === 0) return;
|
|
28
35
|
const next = ((index % total) + total) % total;
|
|
29
|
-
direction = next > current ? 1 : -1;
|
|
36
|
+
direction = explicitDirection ?? (next > current ? 1 : -1);
|
|
30
37
|
current = next;
|
|
31
38
|
}
|
|
32
39
|
|
|
33
|
-
function next() { goTo(current + 1); }
|
|
34
|
-
function prev() { goTo(current - 1); }
|
|
40
|
+
function next() { goTo(current + 1, 1); }
|
|
41
|
+
function prev() { goTo(current - 1, -1); }
|
|
35
42
|
|
|
36
43
|
// Auto-play with proper cleanup
|
|
37
44
|
$effect(() => {
|
|
@@ -92,14 +99,15 @@
|
|
|
92
99
|
</div>
|
|
93
100
|
|
|
94
101
|
{#if showArrows && total > 1}
|
|
95
|
-
<button class="s-carousel-arrow s-carousel-prev" onclick={prev} aria-label="Previous slide">❮</button>
|
|
96
|
-
<button class="s-carousel-arrow s-carousel-next" onclick={next} aria-label="Next slide">❯</button>
|
|
102
|
+
<button type="button" class="s-carousel-arrow s-carousel-prev" onclick={prev} aria-label="Previous slide">❮</button>
|
|
103
|
+
<button type="button" class="s-carousel-arrow s-carousel-next" onclick={next} aria-label="Next slide">❯</button>
|
|
97
104
|
{/if}
|
|
98
105
|
|
|
99
106
|
{#if showIndicators && total > 1}
|
|
100
107
|
<div class="s-carousel-indicators" role="tablist">
|
|
101
108
|
{#each slides as _, i}
|
|
102
109
|
<button
|
|
110
|
+
type="button"
|
|
103
111
|
class="s-carousel-dot"
|
|
104
112
|
class:active={i === current}
|
|
105
113
|
onclick={() => goTo(i)}
|
|
@@ -4,22 +4,14 @@ type Carousel = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const Carousel: import("svelte").Component<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
autoPlay?: boolean;
|
|
11
|
-
interval?: number;
|
|
12
|
-
showArrows?: boolean;
|
|
13
|
-
showIndicators?: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
style?: string;
|
|
9
|
+
theme?: string;
|
|
14
10
|
class?: string;
|
|
15
|
-
}
|
|
11
|
+
}, {}, "">;
|
|
16
12
|
type $$ComponentProps = {
|
|
17
|
-
style
|
|
18
|
-
theme
|
|
19
|
-
slides?: any[];
|
|
20
|
-
autoPlay?: boolean;
|
|
21
|
-
interval?: number;
|
|
22
|
-
showArrows?: boolean;
|
|
23
|
-
showIndicators?: boolean;
|
|
13
|
+
style?: string;
|
|
14
|
+
theme?: string;
|
|
24
15
|
class?: string;
|
|
25
|
-
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./checkbox-styles.css";
|
|
3
|
-
import {
|
|
3
|
+
import { getMultistyleDefaults } from "../config.js";
|
|
4
4
|
import { cn } from "../utils/cn.js";
|
|
5
5
|
|
|
6
|
+
/** @type {{ style?: string, theme?: string, class?: string, [key: string]: any }} */
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
let {
|
|
7
10
|
style: styleProp,
|
|
8
11
|
theme: themeProp,
|
|
@@ -14,12 +17,15 @@
|
|
|
14
17
|
...rest
|
|
15
18
|
} = $props();
|
|
16
19
|
|
|
17
|
-
const
|
|
18
|
-
|
|
20
|
+
const _cfg = getMultistyleDefaults();
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const style = $derived(styleProp ?? _cfg.style);
|
|
24
|
+
const theme = $derived(themeProp ?? _cfg.theme);
|
|
19
25
|
|
|
20
26
|
const styleClass = $derived(`s-checkbox-${style}`);
|
|
21
27
|
const themeClass = $derived(`theme-${theme}`);
|
|
22
|
-
const uid =
|
|
28
|
+
const uid = $props.id();
|
|
23
29
|
const internalId = `checkbox-${uid}`;
|
|
24
30
|
</script>
|
|
25
31
|
|
|
@@ -4,20 +4,14 @@ type Checkbox = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const Checkbox: import("svelte").Component<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
label?: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
indeterminate?: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
style?: string;
|
|
9
|
+
theme?: string;
|
|
13
10
|
class?: string;
|
|
14
|
-
}
|
|
11
|
+
}, {}, "checked">;
|
|
15
12
|
type $$ComponentProps = {
|
|
16
|
-
style
|
|
17
|
-
theme
|
|
18
|
-
checked?: boolean;
|
|
19
|
-
label?: string;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
indeterminate?: boolean;
|
|
13
|
+
style?: string;
|
|
14
|
+
theme?: string;
|
|
22
15
|
class?: string;
|
|
23
|
-
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import "./chip-styles.css";
|
|
3
|
-
import {
|
|
3
|
+
import { getMultistyleDefaults } from "../config.js";
|
|
4
4
|
import { cn } from "../utils/cn.js";
|
|
5
5
|
|
|
6
|
+
/** @type {{ style?: string, theme?: string, class?: string, [key: string]: any }} */
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
let {
|
|
7
10
|
style: styleProp,
|
|
8
11
|
theme: themeProp,
|
|
@@ -17,8 +20,11 @@
|
|
|
17
20
|
...rest
|
|
18
21
|
} = $props();
|
|
19
22
|
|
|
20
|
-
const
|
|
21
|
-
|
|
23
|
+
const _cfg = getMultistyleDefaults();
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const style = $derived(styleProp ?? _cfg.style);
|
|
27
|
+
const theme = $derived(themeProp ?? _cfg.theme);
|
|
22
28
|
const styleClass = $derived(`s-chip-${style}`);
|
|
23
29
|
const themeClass = $derived(`theme-${theme}`);
|
|
24
30
|
|
|
@@ -35,7 +41,7 @@
|
|
|
35
41
|
{/if}
|
|
36
42
|
<span class="s-chip-label">{@render children?.()}</span>
|
|
37
43
|
{#if dismissible}
|
|
38
|
-
<button
|
|
44
|
+
<button type="button"
|
|
39
45
|
class="s-chip-dismiss"
|
|
40
46
|
onclick={() => { visible = false; ondismiss?.(); }}
|
|
41
47
|
aria-label="Remove"
|
|
@@ -4,26 +4,14 @@ type Chip = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const Chip: import("svelte").Component<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
color?: string;
|
|
11
|
-
size?: string;
|
|
12
|
-
children: any;
|
|
13
|
-
dismissible?: boolean;
|
|
14
|
-
icon?: string;
|
|
15
|
-
ondismiss: any;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
style?: string;
|
|
9
|
+
theme?: string;
|
|
16
10
|
class?: string;
|
|
17
|
-
}
|
|
11
|
+
}, {}, "">;
|
|
18
12
|
type $$ComponentProps = {
|
|
19
|
-
style
|
|
20
|
-
theme
|
|
21
|
-
variant?: string;
|
|
22
|
-
color?: string;
|
|
23
|
-
size?: string;
|
|
24
|
-
children: any;
|
|
25
|
-
dismissible?: boolean;
|
|
26
|
-
icon?: string;
|
|
27
|
-
ondismiss: any;
|
|
13
|
+
style?: string;
|
|
14
|
+
theme?: string;
|
|
28
15
|
class?: string;
|
|
29
|
-
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|