svelte-multistyle-ui 0.0.5-alpha → 0.0.8-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.
Files changed (113) hide show
  1. package/cli/bin.js +3 -0
  2. package/cli/emit.js +3 -5
  3. package/cli/fixtures/sample.expected.svelte +229 -56
  4. package/cli/fixtures/sample.yaml +254 -128
  5. package/cli/generate.js +438 -7
  6. package/dist/components/Accordion.svelte +3 -1
  7. package/dist/components/Accordion.svelte.d.ts +2 -0
  8. package/dist/components/Alert.svelte +5 -3
  9. package/dist/components/Alert.svelte.d.ts +4 -2
  10. package/dist/components/Avatar.svelte +3 -1
  11. package/dist/components/Avatar.svelte.d.ts +2 -0
  12. package/dist/components/Breadcrumb.svelte +3 -2
  13. package/dist/components/Breadcrumb.svelte.d.ts +2 -0
  14. package/dist/components/Button.svelte +3 -1
  15. package/dist/components/Button.svelte.d.ts +2 -0
  16. package/dist/components/ButtonGroup.svelte +3 -1
  17. package/dist/components/ButtonGroup.svelte.d.ts +2 -0
  18. package/dist/components/Card.svelte +2 -1
  19. package/dist/components/Carousel.svelte +3 -1
  20. package/dist/components/Carousel.svelte.d.ts +2 -0
  21. package/dist/components/Checkbox.svelte +3 -1
  22. package/dist/components/Checkbox.svelte.d.ts +2 -0
  23. package/dist/components/Chip.svelte +3 -1
  24. package/dist/components/Chip.svelte.d.ts +2 -0
  25. package/dist/components/Column.svelte +2 -1
  26. package/dist/components/CommandPalette.svelte +3 -1
  27. package/dist/components/CommandPalette.svelte.d.ts +2 -0
  28. package/dist/components/DatePicker.svelte +3 -1
  29. package/dist/components/DatePicker.svelte.d.ts +2 -0
  30. package/dist/components/Divider.svelte +3 -1
  31. package/dist/components/Divider.svelte.d.ts +2 -0
  32. package/dist/components/Drawer.svelte +3 -1
  33. package/dist/components/Drawer.svelte.d.ts +2 -0
  34. package/dist/components/DropdownMenu.svelte +3 -1
  35. package/dist/components/DropdownMenu.svelte.d.ts +2 -0
  36. package/dist/components/FAB.svelte +3 -1
  37. package/dist/components/FAB.svelte.d.ts +2 -0
  38. package/dist/components/FileUpload.svelte +3 -1
  39. package/dist/components/FileUpload.svelte.d.ts +2 -0
  40. package/dist/components/Grid.svelte +2 -1
  41. package/dist/components/IconButton.svelte +3 -1
  42. package/dist/components/IconButton.svelte.d.ts +2 -0
  43. package/dist/components/Input.svelte +3 -1
  44. package/dist/components/Input.svelte.d.ts +2 -0
  45. package/dist/components/Modal.svelte +3 -1
  46. package/dist/components/Modal.svelte.d.ts +2 -0
  47. package/dist/components/MultiSelect.svelte +3 -1
  48. package/dist/components/MultiSelect.svelte.d.ts +2 -0
  49. package/dist/components/Pagination.svelte +3 -1
  50. package/dist/components/Pagination.svelte.d.ts +2 -0
  51. package/dist/components/Popover.svelte +3 -1
  52. package/dist/components/Popover.svelte.d.ts +2 -0
  53. package/dist/components/ProgressBar.svelte +3 -1
  54. package/dist/components/ProgressBar.svelte.d.ts +2 -0
  55. package/dist/components/Radio.svelte +3 -1
  56. package/dist/components/Radio.svelte.d.ts +2 -0
  57. package/dist/components/Rating.svelte +3 -1
  58. package/dist/components/Rating.svelte.d.ts +2 -0
  59. package/dist/components/Row.svelte +2 -1
  60. package/dist/components/Select.svelte +3 -1
  61. package/dist/components/Select.svelte.d.ts +2 -0
  62. package/dist/components/Skeleton.svelte +3 -1
  63. package/dist/components/Skeleton.svelte.d.ts +2 -0
  64. package/dist/components/Slider.svelte +3 -1
  65. package/dist/components/Slider.svelte.d.ts +2 -0
  66. package/dist/components/SortableList.svelte +3 -1
  67. package/dist/components/SortableList.svelte.d.ts +2 -0
  68. package/dist/components/Spinner.svelte +3 -1
  69. package/dist/components/Spinner.svelte.d.ts +2 -0
  70. package/dist/components/Stepper.svelte +3 -1
  71. package/dist/components/Stepper.svelte.d.ts +2 -0
  72. package/dist/components/Table.svelte +3 -1
  73. package/dist/components/Table.svelte.d.ts +2 -0
  74. package/dist/components/Tabs.svelte +3 -1
  75. package/dist/components/Tabs.svelte.d.ts +2 -0
  76. package/dist/components/Textarea.svelte +3 -1
  77. package/dist/components/Textarea.svelte.d.ts +2 -0
  78. package/dist/components/Toast.svelte +7 -5
  79. package/dist/components/Toast.svelte.d.ts +2 -0
  80. package/dist/components/Toggle.svelte +3 -1
  81. package/dist/components/Toggle.svelte.d.ts +2 -0
  82. package/dist/components/Tooltip.svelte +3 -1
  83. package/dist/components/Tooltip.svelte.d.ts +2 -0
  84. package/dist/components/charts/BarChart.svelte +2 -2
  85. package/dist/components/charts/BarChart.svelte.d.ts +2 -0
  86. package/dist/components/charts/BubbleChart.svelte +2 -2
  87. package/dist/components/charts/BubbleChart.svelte.d.ts +2 -0
  88. package/dist/components/charts/Chart.svelte +3 -1
  89. package/dist/components/charts/Chart.svelte.d.ts +2 -0
  90. package/dist/components/charts/ComboChart.svelte +2 -2
  91. package/dist/components/charts/ComboChart.svelte.d.ts +2 -0
  92. package/dist/components/charts/DoughnutChart.svelte +2 -2
  93. package/dist/components/charts/DoughnutChart.svelte.d.ts +2 -0
  94. package/dist/components/charts/LineChart.svelte +2 -2
  95. package/dist/components/charts/LineChart.svelte.d.ts +2 -0
  96. package/dist/components/charts/PieChart.svelte +2 -2
  97. package/dist/components/charts/PieChart.svelte.d.ts +2 -0
  98. package/dist/components/charts/PolarAreaChart.svelte +2 -2
  99. package/dist/components/charts/PolarAreaChart.svelte.d.ts +2 -0
  100. package/dist/components/charts/RadarChart.svelte +2 -2
  101. package/dist/components/charts/RadarChart.svelte.d.ts +2 -0
  102. package/dist/components/charts/ScatterChart.svelte +2 -2
  103. package/dist/components/charts/ScatterChart.svelte.d.ts +2 -0
  104. package/dist/components/charts/StackedBarChart.svelte +2 -2
  105. package/dist/components/charts/StackedBarChart.svelte.d.ts +2 -0
  106. package/dist/components/charts/StackedLineChart.svelte +2 -2
  107. package/dist/components/charts/StackedLineChart.svelte.d.ts +2 -0
  108. package/dist/components/select-styles.css +6 -1
  109. package/dist/index.d.ts +1 -0
  110. package/dist/index.js +3 -0
  111. package/dist/utils/cn.d.ts +1 -0
  112. package/dist/utils/cn.js +9 -0
  113. package/package.json +5 -5
@@ -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 {styleClass} {themeClass}"
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 {styleClass} {themeClass} {sizeClass}"
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 {styleClass} {themeClass}"
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 {styleClass} {themeClass} rating-{size}"
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 {className}" style={styleStr} {...rest}>
38
+ <div class={cn("s-row", className)} style={styleStr} {...rest}>
38
39
  {@render children?.()}
39
40
  </div>
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import "./select-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
  placeholder = "Select...",
11
12
  label = "",
12
13
  disabled = false,
14
+ class: className = "",
13
15
  ...rest
14
16
  } = $props();
15
17
 
@@ -41,7 +43,7 @@
41
43
  </script>
42
44
 
43
45
  <div
44
- class="s-select-wrapper {styleClass} {themeClass}"
46
+ class={cn("s-select-wrapper", styleClass, themeClass, className)}
45
47
  class:disabled
46
48
  class:focused
47
49
  class:has-value={hasValue}
@@ -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 {styleClass} {themeClass} skeleton-{variant}"
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 {styleClass} {themeClass}"
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 {directionClass} {styleClass} {themeClass}" use:isolateEvents>
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 {styleClass} {themeClass} {sizeClass}"
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
@@ -8,10 +8,12 @@ declare const Stepper: import("svelte").Component<{
8
8
  theme: any;
9
9
  steps?: any[];
10
10
  current?: number;
11
+ class?: string;
11
12
  } & Record<string, any>, {}, "">;
12
13
  type $$ComponentProps = {
13
14
  style: any;
14
15
  theme: any;
15
16
  steps?: any[];
16
17
  current?: number;
18
+ class?: string;
17
19
  } & Record<string, any>;
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import "./table-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
  data = null,
9
10
  variant = "plain",
10
11
  caption: summary,
12
+ class: className = "",
11
13
  ...rest
12
14
  } = $props();
13
15
 
@@ -30,7 +32,7 @@
30
32
  </script>
31
33
 
32
34
  <div
33
- class="s-table-wrapper {styleClass} {themeClass} {variantClass}"
35
+ class={cn("s-table-wrapper", styleClass, themeClass, variantClass, className)}
34
36
  {...rest}
35
37
  >
36
38
  <div class="s-table-scroll">
@@ -9,6 +9,7 @@ declare const Table: import("svelte").Component<{
9
9
  data?: any;
10
10
  variant?: string;
11
11
  caption: any;
12
+ class?: string;
12
13
  } & Record<string, any>, {}, "">;
13
14
  type $$ComponentProps = {
14
15
  style: any;
@@ -16,4 +17,5 @@ type $$ComponentProps = {
16
17
  data?: any;
17
18
  variant?: string;
18
19
  caption: any;
20
+ class?: string;
19
21
  } & Record<string, any>;
@@ -1,12 +1,14 @@
1
1
  <script>
2
2
  import "./tabs-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
  tabs = [],
9
10
  active = $bindable(""),
11
+ class: className = "",
10
12
  ...rest
11
13
  } = $props();
12
14
 
@@ -17,7 +19,7 @@
17
19
  const themeClass = $derived(`theme-${theme}`);
18
20
  </script>
19
21
 
20
- <div class="s-tabs {styleClass} {themeClass}" role="tablist" {...rest}>
22
+ <div class={cn("s-tabs", styleClass, themeClass, className)} role="tablist" {...rest}>
21
23
  {#each tabs as tab}
22
24
  <button
23
25
  class="s-tab"
@@ -8,10 +8,12 @@ declare const Tabs: import("svelte").Component<{
8
8
  theme: any;
9
9
  tabs?: any[];
10
10
  active?: string;
11
+ class?: string;
11
12
  } & Record<string, any>, {}, "active">;
12
13
  type $$ComponentProps = {
13
14
  style: any;
14
15
  theme: any;
15
16
  tabs?: any[];
16
17
  active?: string;
18
+ class?: string;
17
19
  } & Record<string, any>;
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import "./textarea-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,
@@ -14,6 +15,7 @@
14
15
  readonly = false,
15
16
  required = false,
16
17
  autoresize = false,
18
+ class: className = "",
17
19
  ...rest
18
20
  } = $props();
19
21
 
@@ -54,7 +56,7 @@
54
56
  </script>
55
57
 
56
58
  <div
57
- class="s-textarea-wrapper {styleClass} {themeClass}"
59
+ class={cn("s-textarea-wrapper", styleClass, themeClass, className)}
58
60
  class:disabled
59
61
  class:focused
60
62
  class:has-value={hasValue}
@@ -15,6 +15,7 @@ declare const Textarea: import("svelte").Component<{
15
15
  readonly?: boolean;
16
16
  required?: boolean;
17
17
  autoresize?: boolean;
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
  readonly?: boolean;
29
30
  required?: boolean;
30
31
  autoresize?: boolean;
32
+ class?: string;
31
33
  } & Record<string, any>;
@@ -2,6 +2,7 @@
2
2
  import "./toast-styles.css";
3
3
  import { defaults, iconClass } 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,
@@ -9,6 +10,7 @@
9
10
  toasts = $bindable([]),
10
11
  position = "top-right",
11
12
  duration = 4000,
13
+ class: className = "",
12
14
  ...rest
13
15
  } = $props();
14
16
 
@@ -33,12 +35,12 @@
33
35
  "bottom-center":{ x: 0, y: 20 }
34
36
  };
35
37
 
36
- function renderIcon(icon, variant) {
38
+ function renderIcon(icon, preset) {
37
39
  if (icon) {
38
40
  if (icon.length === 1) return icon;
39
41
  return `<span class="${iconClass}">${icon}</span>`;
40
42
  }
41
- return icons[variant] ?? "\u2139";
43
+ return icons[preset] ?? "\u2139";
42
44
  }
43
45
 
44
46
  function removeToast(id) {
@@ -52,13 +54,13 @@
52
54
  </script>
53
55
 
54
56
  <div
55
- class="s-toast-container toast-{position} {styleClass} {themeClass}"
57
+ class={cn("s-toast-container", `toast-${position}`, styleClass, themeClass, className)}
56
58
  {...rest}
57
59
  >
58
60
  {#each toasts as toast (toast.id)}
59
61
  {#key toast.id}
60
62
  <div
61
- class="s-toast s-toast-{toast.variant} {styleClass} {themeClass}"
63
+ class="s-toast s-toast-{toast.preset} {styleClass} {themeClass}"
62
64
  transition:fly={{
63
65
  ...flyParams[position],
64
66
  duration: 300,
@@ -66,7 +68,7 @@
66
68
  }}
67
69
  role="alert"
68
70
  >
69
- <span class="s-toast-icon">{@html renderIcon(toast.icon, toast.variant)}</span>
71
+ <span class="s-toast-icon">{@html renderIcon(toast.icon, toast.preset)}</span>
70
72
  <div class="s-toast-content">
71
73
  {#if toast.title}
72
74
  <div class="s-toast-title">{toast.title}</div>
@@ -9,6 +9,7 @@ declare const Toast: import("svelte").Component<{
9
9
  toasts?: any[];
10
10
  position?: string;
11
11
  duration?: number;
12
+ class?: string;
12
13
  } & Record<string, any>, {}, "toasts">;
13
14
  type $$ComponentProps = {
14
15
  style: any;
@@ -16,4 +17,5 @@ type $$ComponentProps = {
16
17
  toasts?: any[];
17
18
  position?: string;
18
19
  duration?: number;
20
+ class?: string;
19
21
  } & Record<string, any>;
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import "./toggle-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
  size = "md",
13
+ class: className = "",
12
14
  ...rest
13
15
  } = $props();
14
16
 
@@ -23,7 +25,7 @@
23
25
  </script>
24
26
 
25
27
  <label
26
- class="s-toggle {styleClass} {themeClass} {sizeClass}"
28
+ class={cn("s-toggle", styleClass, themeClass, sizeClass, className)}
27
29
  class:disabled
28
30
  class:checked
29
31
  for={internalId}
@@ -10,6 +10,7 @@ declare const Toggle: import("svelte").Component<{
10
10
  label?: string;
11
11
  disabled?: boolean;
12
12
  size?: string;
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
  size?: string;
22
+ class?: string;
21
23
  } & Record<string, any>;
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import "./tooltip-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
  text = "",
9
10
  position = "top",
10
11
  children,
12
+ class: className = "",
11
13
  ...rest
12
14
  } = $props();
13
15
 
@@ -21,7 +23,7 @@
21
23
  </script>
22
24
 
23
25
  <div
24
- class="s-tooltip-wrapper {styleClass} {themeClass}"
26
+ class={cn("s-tooltip-wrapper", styleClass, themeClass, className)}
25
27
  onmouseenter={() => (visible = true)}
26
28
  onmouseleave={() => (visible = false)}
27
29
  onfocusin={() => (visible = true)}
@@ -9,6 +9,7 @@ declare const Tooltip: import("svelte").Component<{
9
9
  text?: string;
10
10
  position?: string;
11
11
  children: any;
12
+ class?: string;
12
13
  } & Record<string, any>, {}, "">;
13
14
  type $$ComponentProps = {
14
15
  style: any;
@@ -16,4 +17,5 @@ type $$ComponentProps = {
16
17
  text?: string;
17
18
  position?: string;
18
19
  children: any;
20
+ class?: string;
19
21
  } & Record<string, any>;