svelte-multistyle-ui 0.0.1-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/LICENSE +201 -0
- package/README.md +183 -0
- package/dist/actions/portal.d.ts +20 -0
- package/dist/actions/portal.js +32 -0
- package/dist/components/Accordion.svelte +64 -0
- package/dist/components/Accordion.svelte.d.ts +19 -0
- package/dist/components/Alert.svelte +61 -0
- package/dist/components/Alert.svelte.d.ts +23 -0
- package/dist/components/Avatar.svelte +31 -0
- package/dist/components/Avatar.svelte.d.ts +21 -0
- package/dist/components/Breadcrumb.svelte +35 -0
- package/dist/components/Breadcrumb.svelte.d.ts +15 -0
- package/dist/components/Button.svelte +34 -0
- package/dist/components/Button.svelte.d.ts +25 -0
- package/dist/components/ButtonGroup.svelte +45 -0
- package/dist/components/ButtonGroup.svelte.d.ts +23 -0
- package/dist/components/Card.svelte +29 -0
- package/dist/components/Card.svelte.d.ts +21 -0
- package/dist/components/Carousel.svelte +111 -0
- package/dist/components/Carousel.svelte.d.ts +23 -0
- package/dist/components/Checkbox.svelte +64 -0
- package/dist/components/Checkbox.svelte.d.ts +21 -0
- package/dist/components/Chip.svelte +43 -0
- package/dist/components/Chip.svelte.d.ts +27 -0
- package/dist/components/Column.svelte +38 -0
- package/dist/components/Column.svelte.d.ts +21 -0
- package/dist/components/CommandPalette.svelte +207 -0
- package/dist/components/CommandPalette.svelte.d.ts +19 -0
- package/dist/components/DatePicker.svelte +365 -0
- package/dist/components/DatePicker.svelte.d.ts +31 -0
- package/dist/components/Divider.svelte +32 -0
- package/dist/components/Divider.svelte.d.ts +17 -0
- package/dist/components/Drawer.svelte +69 -0
- package/dist/components/Drawer.svelte.d.ts +21 -0
- package/dist/components/DropdownMenu.svelte +113 -0
- package/dist/components/DropdownMenu.svelte.d.ts +25 -0
- package/dist/components/FAB.svelte +27 -0
- package/dist/components/FAB.svelte.d.ts +19 -0
- package/dist/components/FileUpload.svelte +76 -0
- package/dist/components/FileUpload.svelte.d.ts +21 -0
- package/dist/components/Grid.svelte +51 -0
- package/dist/components/Grid.svelte.d.ts +27 -0
- package/dist/components/IconButton.svelte +39 -0
- package/dist/components/IconButton.svelte.d.ts +27 -0
- package/dist/components/Input.svelte +121 -0
- package/dist/components/Input.svelte.d.ts +69 -0
- package/dist/components/Modal.svelte +57 -0
- package/dist/components/Modal.svelte.d.ts +23 -0
- package/dist/components/MultiSelect.svelte +125 -0
- package/dist/components/MultiSelect.svelte.d.ts +23 -0
- package/dist/components/Pagination.svelte +52 -0
- package/dist/components/Pagination.svelte.d.ts +19 -0
- package/dist/components/Popover.svelte +114 -0
- package/dist/components/Popover.svelte.d.ts +23 -0
- package/dist/components/ProgressBar.svelte +72 -0
- package/dist/components/ProgressBar.svelte.d.ts +21 -0
- package/dist/components/Radio.svelte +39 -0
- package/dist/components/Radio.svelte.d.ts +21 -0
- package/dist/components/Rating.svelte +102 -0
- package/dist/components/Rating.svelte.d.ts +25 -0
- package/dist/components/Row.svelte +39 -0
- package/dist/components/Row.svelte.d.ts +23 -0
- package/dist/components/Select.svelte +80 -0
- package/dist/components/Select.svelte.d.ts +23 -0
- package/dist/components/Skeleton.svelte +26 -0
- package/dist/components/Skeleton.svelte.d.ts +19 -0
- package/dist/components/Slider.svelte +46 -0
- package/dist/components/Slider.svelte.d.ts +25 -0
- package/dist/components/Spinner.svelte +27 -0
- package/dist/components/Spinner.svelte.d.ts +15 -0
- package/dist/components/Stepper.svelte +34 -0
- package/dist/components/Stepper.svelte.d.ts +17 -0
- package/dist/components/Table.svelte +59 -0
- package/dist/components/Table.svelte.d.ts +19 -0
- package/dist/components/Tabs.svelte +32 -0
- package/dist/components/Tabs.svelte.d.ts +17 -0
- package/dist/components/Textarea.svelte +86 -0
- package/dist/components/Textarea.svelte.d.ts +31 -0
- package/dist/components/Toast.svelte +90 -0
- package/dist/components/Toast.svelte.d.ts +19 -0
- package/dist/components/Toggle.svelte +46 -0
- package/dist/components/Toggle.svelte.d.ts +21 -0
- package/dist/components/Tooltip.svelte +35 -0
- package/dist/components/Tooltip.svelte.d.ts +19 -0
- package/dist/components/accordion-styles.css +89 -0
- package/dist/components/alert-styles.css +66 -0
- package/dist/components/avatar-styles.css +50 -0
- package/dist/components/breadcrumb-styles.css +73 -0
- package/dist/components/button-styles.css +272 -0
- package/dist/components/buttongroup-styles.css +118 -0
- package/dist/components/card-styles.css +101 -0
- package/dist/components/carousel-styles.css +145 -0
- package/dist/components/charts/BarChart.svelte +5 -0
- package/dist/components/charts/BarChart.svelte.d.ts +29 -0
- package/dist/components/charts/BubbleChart.svelte +5 -0
- package/dist/components/charts/BubbleChart.svelte.d.ts +29 -0
- package/dist/components/charts/Chart.svelte +186 -0
- package/dist/components/charts/Chart.svelte.d.ts +37 -0
- package/dist/components/charts/ComboChart.svelte +5 -0
- package/dist/components/charts/ComboChart.svelte.d.ts +29 -0
- package/dist/components/charts/DoughnutChart.svelte +5 -0
- package/dist/components/charts/DoughnutChart.svelte.d.ts +29 -0
- package/dist/components/charts/LineChart.svelte +5 -0
- package/dist/components/charts/LineChart.svelte.d.ts +29 -0
- package/dist/components/charts/PieChart.svelte +5 -0
- package/dist/components/charts/PieChart.svelte.d.ts +29 -0
- package/dist/components/charts/PolarAreaChart.svelte +5 -0
- package/dist/components/charts/PolarAreaChart.svelte.d.ts +29 -0
- package/dist/components/charts/RadarChart.svelte +5 -0
- package/dist/components/charts/RadarChart.svelte.d.ts +29 -0
- package/dist/components/charts/ScatterChart.svelte +5 -0
- package/dist/components/charts/ScatterChart.svelte.d.ts +29 -0
- package/dist/components/charts/StackedBarChart.svelte +18 -0
- package/dist/components/charts/StackedBarChart.svelte.d.ts +29 -0
- package/dist/components/charts/StackedLineChart.svelte +21 -0
- package/dist/components/charts/StackedLineChart.svelte.d.ts +29 -0
- package/dist/components/charts/chart-config.d.ts +102 -0
- package/dist/components/charts/chart-config.js +616 -0
- package/dist/components/charts/chart-styles.css +159 -0
- package/dist/components/checkbox-styles.css +125 -0
- package/dist/components/chip-styles.css +107 -0
- package/dist/components/column-styles.css +6 -0
- package/dist/components/commandpalette-styles.css +162 -0
- package/dist/components/datepicker-styles.css +1011 -0
- package/dist/components/divider-styles.css +56 -0
- package/dist/components/drawer-styles.css +83 -0
- package/dist/components/dropdown-styles.css +128 -0
- package/dist/components/fab-styles.css +61 -0
- package/dist/components/fileupload-styles.css +125 -0
- package/dist/components/grid-styles.css +6 -0
- package/dist/components/iconbutton-styles.css +146 -0
- package/dist/components/input-styles.css +436 -0
- package/dist/components/modal-styles.css +103 -0
- package/dist/components/multiselect-styles.css +202 -0
- package/dist/components/pagination-styles.css +63 -0
- package/dist/components/popover-styles.css +122 -0
- package/dist/components/progressbar-styles.css +106 -0
- package/dist/components/radio-styles.css +120 -0
- package/dist/components/rating-styles.css +68 -0
- package/dist/components/row-styles.css +6 -0
- package/dist/components/select-styles.css +218 -0
- package/dist/components/skeleton-styles.css +48 -0
- package/dist/components/slider-styles.css +85 -0
- package/dist/components/spinner-styles.css +52 -0
- package/dist/components/stepper-styles.css +93 -0
- package/dist/components/table-styles.css +114 -0
- package/dist/components/tabs-styles.css +74 -0
- package/dist/components/textarea-styles.css +224 -0
- package/dist/components/theme-base.css +64 -0
- package/dist/components/theme.css +440 -0
- package/dist/components/toast-styles.css +106 -0
- package/dist/components/toggle-styles.css +131 -0
- package/dist/components/tooltip-styles.css +56 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +9 -0
- package/dist/config.svelte.d.ts +25 -0
- package/dist/config.svelte.js +41 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +69 -0
- package/package.json +65 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./breadcrumb-styles.css";
|
|
3
|
+
import { defaults } from "../config.js";
|
|
4
|
+
|
|
5
|
+
let { style: styleProp, theme: themeProp, items = [], ...rest } = $props();
|
|
6
|
+
|
|
7
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
8
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
9
|
+
|
|
10
|
+
const styleClass = $derived(`s-breadcrumb-${style}`);
|
|
11
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<nav
|
|
15
|
+
class="s-breadcrumb {styleClass} {themeClass}"
|
|
16
|
+
aria-label="Breadcrumb"
|
|
17
|
+
{...rest}
|
|
18
|
+
>
|
|
19
|
+
<ol class="s-breadcrumb-list">
|
|
20
|
+
{#each items as item, i}
|
|
21
|
+
<li class="s-breadcrumb-item" class:current={i === items.length - 1}>
|
|
22
|
+
{#if item.href && i < items.length - 1}
|
|
23
|
+
<a href={item.href}>{item.label}</a>
|
|
24
|
+
{:else}
|
|
25
|
+
<span aria-current={i === items.length - 1 ? "page" : undefined}
|
|
26
|
+
>{item.label}</span
|
|
27
|
+
>
|
|
28
|
+
{/if}
|
|
29
|
+
{#if i < items.length - 1}
|
|
30
|
+
<span class="s-breadcrumb-sep" aria-hidden="true">/</span>
|
|
31
|
+
{/if}
|
|
32
|
+
</li>
|
|
33
|
+
{/each}
|
|
34
|
+
</ol>
|
|
35
|
+
</nav>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default Breadcrumb;
|
|
2
|
+
type Breadcrumb = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Breadcrumb: import("svelte").Component<{
|
|
7
|
+
style: any;
|
|
8
|
+
theme: any;
|
|
9
|
+
items?: any[];
|
|
10
|
+
} & Record<string, any>, {}, "">;
|
|
11
|
+
type $$ComponentProps = {
|
|
12
|
+
style: any;
|
|
13
|
+
theme: any;
|
|
14
|
+
items?: any[];
|
|
15
|
+
} & Record<string, any>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./button-styles.css";
|
|
3
|
+
import { defaults, iconClass } from "../config.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
style: styleProp,
|
|
7
|
+
theme: themeProp,
|
|
8
|
+
variant = "filled",
|
|
9
|
+
size = "md",
|
|
10
|
+
disabled = false,
|
|
11
|
+
icon,
|
|
12
|
+
children,
|
|
13
|
+
onclick,
|
|
14
|
+
...rest
|
|
15
|
+
} = $props();
|
|
16
|
+
|
|
17
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
18
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
19
|
+
|
|
20
|
+
const styleClass = $derived(`s-button-${style}`);
|
|
21
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
22
|
+
const variantClass = $derived(`btn-${variant}`);
|
|
23
|
+
const sizeClass = $derived(`btn-${size}`);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<button
|
|
27
|
+
class="s-button {styleClass} {themeClass} {variantClass} {sizeClass}"
|
|
28
|
+
{disabled}
|
|
29
|
+
{onclick}
|
|
30
|
+
{...rest}
|
|
31
|
+
>
|
|
32
|
+
{#if icon}<span class="s-button-icon {iconClass}">{icon}</span>{/if}
|
|
33
|
+
{@render children?.()}
|
|
34
|
+
</button>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default Button;
|
|
2
|
+
type Button = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Button: import("svelte").Component<{
|
|
7
|
+
style: any;
|
|
8
|
+
theme: any;
|
|
9
|
+
variant?: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
icon: any;
|
|
13
|
+
children: any;
|
|
14
|
+
onclick: any;
|
|
15
|
+
} & Record<string, any>, {}, "">;
|
|
16
|
+
type $$ComponentProps = {
|
|
17
|
+
style: any;
|
|
18
|
+
theme: any;
|
|
19
|
+
variant?: string;
|
|
20
|
+
size?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
icon: any;
|
|
23
|
+
children: any;
|
|
24
|
+
onclick: any;
|
|
25
|
+
} & Record<string, any>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./buttongroup-styles.css";
|
|
3
|
+
import { defaults } from "../config.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
style: styleProp,
|
|
7
|
+
theme: themeProp,
|
|
8
|
+
variant = "outlined",
|
|
9
|
+
size = "md",
|
|
10
|
+
items = [],
|
|
11
|
+
value = $bindable(""),
|
|
12
|
+
orientation = "horizontal",
|
|
13
|
+
...rest
|
|
14
|
+
} = $props();
|
|
15
|
+
|
|
16
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
17
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
18
|
+
const styleClass = $derived(`s-btn-group-${style}`);
|
|
19
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
20
|
+
|
|
21
|
+
function handleClick(item) {
|
|
22
|
+
value = item.value;
|
|
23
|
+
item.onclick?.();
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
class="s-btn-group {styleClass} {themeClass} btn-group-{orientation} btn-group-{variant} btn-group-{size}"
|
|
29
|
+
role="group"
|
|
30
|
+
{...rest}
|
|
31
|
+
>
|
|
32
|
+
{#each items as item}
|
|
33
|
+
<button
|
|
34
|
+
class="s-btn-group-item"
|
|
35
|
+
class:active={value === item.value}
|
|
36
|
+
onclick={() => handleClick(item)}
|
|
37
|
+
disabled={item.disabled}
|
|
38
|
+
>
|
|
39
|
+
{#if item.icon}
|
|
40
|
+
<span class="btn-group-icon">{item.icon}</span>
|
|
41
|
+
{/if}
|
|
42
|
+
<span>{item.label}</span>
|
|
43
|
+
</button>
|
|
44
|
+
{/each}
|
|
45
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default ButtonGroup;
|
|
2
|
+
type ButtonGroup = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ButtonGroup: import("svelte").Component<{
|
|
7
|
+
style: any;
|
|
8
|
+
theme: any;
|
|
9
|
+
variant?: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
items?: any[];
|
|
12
|
+
value?: string;
|
|
13
|
+
orientation?: string;
|
|
14
|
+
} & Record<string, any>, {}, "value">;
|
|
15
|
+
type $$ComponentProps = {
|
|
16
|
+
style: any;
|
|
17
|
+
theme: any;
|
|
18
|
+
variant?: string;
|
|
19
|
+
size?: string;
|
|
20
|
+
items?: any[];
|
|
21
|
+
value?: string;
|
|
22
|
+
orientation?: string;
|
|
23
|
+
} & Record<string, any>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./card-styles.css";
|
|
3
|
+
import { defaults } from "../config.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
style: styleProp,
|
|
7
|
+
theme: themeProp,
|
|
8
|
+
children,
|
|
9
|
+
padding = "md",
|
|
10
|
+
elevated = false,
|
|
11
|
+
class: className = "",
|
|
12
|
+
...rest
|
|
13
|
+
} = $props();
|
|
14
|
+
|
|
15
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
16
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
17
|
+
|
|
18
|
+
const styleClass = $derived(`s-card-${style}`);
|
|
19
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
20
|
+
const padClass = $derived(`card-pad-${padding}`);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class="s-card {styleClass} {themeClass} {padClass} {className}"
|
|
25
|
+
class:elevated
|
|
26
|
+
{...rest}
|
|
27
|
+
>
|
|
28
|
+
{@render children?.()}
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default Card;
|
|
2
|
+
type Card = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Card: import("svelte").Component<{
|
|
7
|
+
style: any;
|
|
8
|
+
theme: any;
|
|
9
|
+
children: any;
|
|
10
|
+
padding?: string;
|
|
11
|
+
elevated?: boolean;
|
|
12
|
+
class?: string;
|
|
13
|
+
} & Record<string, any>, {}, "">;
|
|
14
|
+
type $$ComponentProps = {
|
|
15
|
+
style: any;
|
|
16
|
+
theme: any;
|
|
17
|
+
children: any;
|
|
18
|
+
padding?: string;
|
|
19
|
+
elevated?: boolean;
|
|
20
|
+
class?: string;
|
|
21
|
+
} & Record<string, any>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./carousel-styles.css";
|
|
3
|
+
import { defaults } from "../config.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
style: styleProp,
|
|
7
|
+
theme: themeProp,
|
|
8
|
+
slides = [],
|
|
9
|
+
autoPlay = true,
|
|
10
|
+
interval = 4000,
|
|
11
|
+
showArrows = true,
|
|
12
|
+
showIndicators = true,
|
|
13
|
+
...rest
|
|
14
|
+
} = $props();
|
|
15
|
+
|
|
16
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
17
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
18
|
+
const styleClass = $derived(`s-carousel-${style}`);
|
|
19
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
20
|
+
let current = $state(0);
|
|
21
|
+
let direction = $state(1);
|
|
22
|
+
let isHovering = $state(false);
|
|
23
|
+
const total = $derived(slides.length);
|
|
24
|
+
|
|
25
|
+
function goTo(index) {
|
|
26
|
+
const next = ((index % total) + total) % total;
|
|
27
|
+
direction = next > current ? 1 : -1;
|
|
28
|
+
current = next;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function next() { goTo(current + 1); }
|
|
32
|
+
function prev() { goTo(current - 1); }
|
|
33
|
+
|
|
34
|
+
// Auto-play with proper cleanup
|
|
35
|
+
$effect(() => {
|
|
36
|
+
if (!autoPlay || total <= 1 || isHovering) return;
|
|
37
|
+
const id = setInterval(next, interval);
|
|
38
|
+
return () => clearInterval(id);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
function slideTransition(node) {
|
|
42
|
+
return {
|
|
43
|
+
duration: 350,
|
|
44
|
+
easing: (t) => 1 - Math.pow(1 - t, 3),
|
|
45
|
+
css: (t, u) => `transform: translateX(${direction * u * 30}px); opacity: ${1 - u * 0.3};`
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
class="s-carousel {styleClass} {themeClass}"
|
|
52
|
+
onmouseenter={() => { isHovering = true; }}
|
|
53
|
+
onmouseleave={() => { isHovering = false; }}
|
|
54
|
+
role="region"
|
|
55
|
+
aria-roledescription="carousel"
|
|
56
|
+
aria-label="Image carousel"
|
|
57
|
+
{...rest}
|
|
58
|
+
>
|
|
59
|
+
<div class="s-carousel-viewport">
|
|
60
|
+
{#if slides.length > 0}
|
|
61
|
+
{#each slides as slide, i}
|
|
62
|
+
{#if i === current}
|
|
63
|
+
<div
|
|
64
|
+
class="s-carousel-slide"
|
|
65
|
+
transition:slideTransition
|
|
66
|
+
role="group"
|
|
67
|
+
aria-roledescription="slide"
|
|
68
|
+
aria-label={`Slide ${i + 1} of ${total}`}
|
|
69
|
+
>
|
|
70
|
+
{#if slide.image}
|
|
71
|
+
<img
|
|
72
|
+
class="s-carousel-image"
|
|
73
|
+
src={slide.image}
|
|
74
|
+
alt={slide.alt || ""}
|
|
75
|
+
draggable="false"
|
|
76
|
+
/>
|
|
77
|
+
{/if}
|
|
78
|
+
{#if slide.caption}
|
|
79
|
+
<div class="s-carousel-caption">{slide.caption}</div>
|
|
80
|
+
{/if}
|
|
81
|
+
{#if slide.content}
|
|
82
|
+
<div class="s-carousel-content">{slide.content}</div>
|
|
83
|
+
{/if}
|
|
84
|
+
</div>
|
|
85
|
+
{/if}
|
|
86
|
+
{/each}
|
|
87
|
+
{:else}
|
|
88
|
+
<div class="s-carousel-empty">No slides</div>
|
|
89
|
+
{/if}
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
{#if showArrows && total > 1}
|
|
93
|
+
<button class="s-carousel-arrow s-carousel-prev" onclick={prev} aria-label="Previous slide">❮</button>
|
|
94
|
+
<button class="s-carousel-arrow s-carousel-next" onclick={next} aria-label="Next slide">❯</button>
|
|
95
|
+
{/if}
|
|
96
|
+
|
|
97
|
+
{#if showIndicators && total > 1}
|
|
98
|
+
<div class="s-carousel-indicators" role="tablist">
|
|
99
|
+
{#each slides as _, i}
|
|
100
|
+
<button
|
|
101
|
+
class="s-carousel-dot"
|
|
102
|
+
class:active={i === current}
|
|
103
|
+
onclick={() => goTo(i)}
|
|
104
|
+
role="tab"
|
|
105
|
+
aria-selected={i === current}
|
|
106
|
+
aria-label={`Go to slide ${i + 1}`}
|
|
107
|
+
></button>
|
|
108
|
+
{/each}
|
|
109
|
+
</div>
|
|
110
|
+
{/if}
|
|
111
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default Carousel;
|
|
2
|
+
type Carousel = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Carousel: import("svelte").Component<{
|
|
7
|
+
style: any;
|
|
8
|
+
theme: any;
|
|
9
|
+
slides?: any[];
|
|
10
|
+
autoPlay?: boolean;
|
|
11
|
+
interval?: number;
|
|
12
|
+
showArrows?: boolean;
|
|
13
|
+
showIndicators?: boolean;
|
|
14
|
+
} & Record<string, any>, {}, "">;
|
|
15
|
+
type $$ComponentProps = {
|
|
16
|
+
style: any;
|
|
17
|
+
theme: any;
|
|
18
|
+
slides?: any[];
|
|
19
|
+
autoPlay?: boolean;
|
|
20
|
+
interval?: number;
|
|
21
|
+
showArrows?: boolean;
|
|
22
|
+
showIndicators?: boolean;
|
|
23
|
+
} & Record<string, any>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./checkbox-styles.css";
|
|
3
|
+
import { defaults } from "../config.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
style: styleProp,
|
|
7
|
+
theme: themeProp,
|
|
8
|
+
checked = $bindable(false),
|
|
9
|
+
label = "",
|
|
10
|
+
disabled = false,
|
|
11
|
+
indeterminate = false,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props();
|
|
14
|
+
|
|
15
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
16
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
17
|
+
|
|
18
|
+
const styleClass = $derived(`s-checkbox-${style}`);
|
|
19
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
20
|
+
const uid = Math.random().toString(36).slice(2, 9);
|
|
21
|
+
const internalId = `checkbox-${uid}`;
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<label
|
|
25
|
+
class="s-checkbox {styleClass} {themeClass}"
|
|
26
|
+
class:disabled
|
|
27
|
+
class:checked
|
|
28
|
+
class:indeterminate
|
|
29
|
+
for={internalId}
|
|
30
|
+
>
|
|
31
|
+
<input
|
|
32
|
+
type="checkbox"
|
|
33
|
+
bind:checked
|
|
34
|
+
{disabled}
|
|
35
|
+
id={internalId}
|
|
36
|
+
bind:indeterminate
|
|
37
|
+
{...rest}
|
|
38
|
+
/>
|
|
39
|
+
<span class="s-checkbox-box">
|
|
40
|
+
{#if indeterminate}
|
|
41
|
+
<svg class="s-checkbox-icon" viewBox="0 0 16 16" fill="none">
|
|
42
|
+
<path
|
|
43
|
+
d="M4 8h8"
|
|
44
|
+
stroke="currentColor"
|
|
45
|
+
stroke-width="2"
|
|
46
|
+
stroke-linecap="round"
|
|
47
|
+
/>
|
|
48
|
+
</svg>
|
|
49
|
+
{:else if checked}
|
|
50
|
+
<svg class="s-checkbox-icon" viewBox="0 0 16 16" fill="none">
|
|
51
|
+
<path
|
|
52
|
+
d="M3.5 8.5L6.5 11.5L12.5 4.5"
|
|
53
|
+
stroke="currentColor"
|
|
54
|
+
stroke-width="2"
|
|
55
|
+
stroke-linecap="round"
|
|
56
|
+
stroke-linejoin="round"
|
|
57
|
+
/>
|
|
58
|
+
</svg>
|
|
59
|
+
{/if}
|
|
60
|
+
</span>
|
|
61
|
+
{#if label}
|
|
62
|
+
<span class="s-checkbox-label">{label}</span>
|
|
63
|
+
{/if}
|
|
64
|
+
</label>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default Checkbox;
|
|
2
|
+
type Checkbox = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Checkbox: import("svelte").Component<{
|
|
7
|
+
style: any;
|
|
8
|
+
theme: any;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
label?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
indeterminate?: boolean;
|
|
13
|
+
} & Record<string, any>, {}, "checked">;
|
|
14
|
+
type $$ComponentProps = {
|
|
15
|
+
style: any;
|
|
16
|
+
theme: any;
|
|
17
|
+
checked?: boolean;
|
|
18
|
+
label?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
indeterminate?: boolean;
|
|
21
|
+
} & Record<string, any>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./chip-styles.css";
|
|
3
|
+
import { defaults } from "../config.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
style: styleProp,
|
|
7
|
+
theme: themeProp,
|
|
8
|
+
variant = "filled",
|
|
9
|
+
color = "primary",
|
|
10
|
+
size = "md",
|
|
11
|
+
children,
|
|
12
|
+
dismissible = false,
|
|
13
|
+
icon = "",
|
|
14
|
+
ondismiss,
|
|
15
|
+
...rest
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
const style = $derived(styleProp ?? defaults.style);
|
|
19
|
+
const theme = $derived(themeProp ?? defaults.theme);
|
|
20
|
+
const styleClass = $derived(`s-chip-${style}`);
|
|
21
|
+
const themeClass = $derived(`theme-${theme}`);
|
|
22
|
+
|
|
23
|
+
let visible = $state(true);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
{#if visible}
|
|
27
|
+
<span
|
|
28
|
+
class="s-chip {styleClass} {themeClass} chip-{variant} chip-{color} chip-{size}"
|
|
29
|
+
{...rest}
|
|
30
|
+
>
|
|
31
|
+
{#if icon}
|
|
32
|
+
<span class="s-chip-icon">{icon}</span>
|
|
33
|
+
{/if}
|
|
34
|
+
<span class="s-chip-label">{@render children?.()}</span>
|
|
35
|
+
{#if dismissible}
|
|
36
|
+
<button
|
|
37
|
+
class="s-chip-dismiss"
|
|
38
|
+
onclick={() => { visible = false; ondismiss?.(); }}
|
|
39
|
+
aria-label="Remove"
|
|
40
|
+
>×</button>
|
|
41
|
+
{/if}
|
|
42
|
+
</span>
|
|
43
|
+
{/if}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default Chip;
|
|
2
|
+
type Chip = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Chip: import("svelte").Component<{
|
|
7
|
+
style: any;
|
|
8
|
+
theme: any;
|
|
9
|
+
variant?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
size?: string;
|
|
12
|
+
children: any;
|
|
13
|
+
dismissible?: boolean;
|
|
14
|
+
icon?: string;
|
|
15
|
+
ondismiss: any;
|
|
16
|
+
} & Record<string, any>, {}, "">;
|
|
17
|
+
type $$ComponentProps = {
|
|
18
|
+
style: any;
|
|
19
|
+
theme: any;
|
|
20
|
+
variant?: string;
|
|
21
|
+
color?: string;
|
|
22
|
+
size?: string;
|
|
23
|
+
children: any;
|
|
24
|
+
dismissible?: boolean;
|
|
25
|
+
icon?: string;
|
|
26
|
+
ondismiss: any;
|
|
27
|
+
} & Record<string, any>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "./column-styles.css";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
gap = "8px",
|
|
6
|
+
align = "stretch",
|
|
7
|
+
justify = "start",
|
|
8
|
+
fill = false,
|
|
9
|
+
class: className = "",
|
|
10
|
+
children,
|
|
11
|
+
...rest
|
|
12
|
+
} = $props();
|
|
13
|
+
|
|
14
|
+
// align = cross-axis (align-items), justify = main-axis (justify-content)
|
|
15
|
+
const alignItems = {
|
|
16
|
+
start: "flex-start",
|
|
17
|
+
center: "center",
|
|
18
|
+
end: "flex-end",
|
|
19
|
+
stretch: "stretch",
|
|
20
|
+
baseline: "baseline",
|
|
21
|
+
};
|
|
22
|
+
const justifyContent = {
|
|
23
|
+
start: "flex-start",
|
|
24
|
+
center: "center",
|
|
25
|
+
end: "flex-end",
|
|
26
|
+
between: "space-between",
|
|
27
|
+
around: "space-around",
|
|
28
|
+
evenly: "space-evenly",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const styleStr = $derived(
|
|
32
|
+
`display:flex;flex-direction:column;gap:${gap};align-items:${alignItems[align] ?? align};justify-content:${justifyContent[justify] ?? justify};${fill ? "width:100%;" : ""}`
|
|
33
|
+
);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div class="s-column {className}" style={styleStr} {...rest}>
|
|
37
|
+
{@render children?.()}
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default Column;
|
|
2
|
+
type Column = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Column: import("svelte").Component<{
|
|
7
|
+
gap?: string;
|
|
8
|
+
align?: string;
|
|
9
|
+
justify?: string;
|
|
10
|
+
fill?: boolean;
|
|
11
|
+
class?: string;
|
|
12
|
+
children: any;
|
|
13
|
+
} & Record<string, any>, {}, "">;
|
|
14
|
+
type $$ComponentProps = {
|
|
15
|
+
gap?: string;
|
|
16
|
+
align?: string;
|
|
17
|
+
justify?: string;
|
|
18
|
+
fill?: boolean;
|
|
19
|
+
class?: string;
|
|
20
|
+
children: any;
|
|
21
|
+
} & Record<string, any>;
|