kosui 0.0.26 → 0.0.27

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 (173) hide show
  1. package/dist/alert/alert.svelte +1 -1
  2. package/dist/alert/alert.svelte.d.ts +1 -1
  3. package/dist/autocomplete/autocomplete-content.svelte +5 -5
  4. package/dist/autocomplete/autocomplete-content.svelte.d.ts +4 -4
  5. package/dist/autocomplete/autocomplete-context.svelte.d.ts +1 -1
  6. package/dist/autocomplete/autocomplete-context.svelte.js +2 -2
  7. package/dist/autocomplete/autocomplete-input.svelte +3 -4
  8. package/dist/autocomplete/autocomplete-input.svelte.d.ts +1 -1
  9. package/dist/autocomplete/autocomplete-item.svelte +5 -5
  10. package/dist/autocomplete/autocomplete-item.svelte.d.ts +3 -3
  11. package/dist/autocomplete/autocomplete.svelte +3 -3
  12. package/dist/autocomplete/autocomplete.svelte.d.ts +2 -2
  13. package/dist/autocomplete/index.d.ts +1 -0
  14. package/dist/autocomplete/index.js +1 -0
  15. package/dist/avatar/avatar.svelte +1 -1
  16. package/dist/avatar/avatar.svelte.d.ts +1 -1
  17. package/dist/badge/badge.svelte +1 -1
  18. package/dist/badge/badge.svelte.d.ts +1 -1
  19. package/dist/box/box.svelte +4 -4
  20. package/dist/box/box.svelte.d.ts +4 -4
  21. package/dist/breadcrumbs/breadcrumbs.svelte +2 -2
  22. package/dist/breadcrumbs/breadcrumbs.svelte.d.ts +2 -2
  23. package/dist/button/button.svelte +7 -7
  24. package/dist/button/button.svelte.d.ts +5 -5
  25. package/dist/chip/chip.svelte +2 -3
  26. package/dist/chip/chip.svelte.d.ts +2 -2
  27. package/dist/command/action.svelte.d.ts +1 -1
  28. package/dist/command/action.svelte.js +1 -0
  29. package/dist/command/command-content.svelte +2 -2
  30. package/dist/command/command-content.svelte.d.ts +2 -2
  31. package/dist/command/command-context.svelte.d.ts +1 -1
  32. package/dist/command/command-context.svelte.js +1 -1
  33. package/dist/command/command-input.svelte +5 -5
  34. package/dist/command/command-input.svelte.d.ts +3 -3
  35. package/dist/command/command-item.svelte +5 -5
  36. package/dist/command/command-item.svelte.d.ts +3 -3
  37. package/dist/command/command-search.svelte +1 -2
  38. package/dist/command/command-search.svelte.d.ts +1 -1
  39. package/dist/command/command.svelte +3 -3
  40. package/dist/command/command.svelte.d.ts +2 -2
  41. package/dist/command/commander.svelte +6 -6
  42. package/dist/command/commander.svelte.d.ts +1 -1
  43. package/dist/command/index.d.ts +7 -6
  44. package/dist/command/index.js +5 -4
  45. package/dist/common/divider.svelte +2 -2
  46. package/dist/common/divider.svelte.d.ts +2 -2
  47. package/dist/common/header.svelte +4 -4
  48. package/dist/common/header.svelte.d.ts +4 -4
  49. package/dist/common/item-context.svelte.js +3 -3
  50. package/dist/dialog/dialog-button.svelte +2 -2
  51. package/dist/dialog/dialog-button.svelte.d.ts +2 -2
  52. package/dist/dialog/dialog.svelte +4 -4
  53. package/dist/dialog/dialog.svelte.d.ts +3 -3
  54. package/dist/dialog/dialoguer-context.svelte.d.ts +6 -6
  55. package/dist/dialog/dialoguer-context.svelte.js +3 -0
  56. package/dist/dialog/dialoguer.svelte +7 -7
  57. package/dist/dialog/dialoguer.svelte.d.ts +1 -1
  58. package/dist/dialog/index.d.ts +1 -1
  59. package/dist/dialog/index.js +1 -1
  60. package/dist/event-manager.d.ts +1 -1
  61. package/dist/event-manager.js +2 -2
  62. package/dist/fab/fab.svelte +2 -2
  63. package/dist/fab/fab.svelte.d.ts +2 -2
  64. package/dist/fab/index.d.ts +1 -1
  65. package/dist/index.d.ts +30 -30
  66. package/dist/index.js +30 -30
  67. package/dist/input/input.svelte +4 -4
  68. package/dist/input/input.svelte.d.ts +3 -3
  69. package/dist/link/link.svelte +3 -3
  70. package/dist/link/link.svelte.d.ts +3 -3
  71. package/dist/markdown/markdown-blockquote.svelte +3 -3
  72. package/dist/markdown/markdown-blockquote.svelte.d.ts +3 -3
  73. package/dist/markdown/markdown-br.svelte +3 -3
  74. package/dist/markdown/markdown-br.svelte.d.ts +3 -3
  75. package/dist/markdown/markdown-code.svelte +3 -3
  76. package/dist/markdown/markdown-code.svelte.d.ts +3 -3
  77. package/dist/markdown/markdown-codespan.svelte +3 -3
  78. package/dist/markdown/markdown-codespan.svelte.d.ts +3 -3
  79. package/dist/markdown/markdown-context.svelte.d.ts +1 -1
  80. package/dist/markdown/markdown-context.svelte.js +1 -0
  81. package/dist/markdown/markdown-def.svelte +3 -3
  82. package/dist/markdown/markdown-def.svelte.d.ts +3 -3
  83. package/dist/markdown/markdown-del.svelte +3 -3
  84. package/dist/markdown/markdown-del.svelte.d.ts +3 -3
  85. package/dist/markdown/markdown-em.svelte +3 -3
  86. package/dist/markdown/markdown-em.svelte.d.ts +3 -3
  87. package/dist/markdown/markdown-escape.svelte +1 -1
  88. package/dist/markdown/markdown-escape.svelte.d.ts +1 -1
  89. package/dist/markdown/markdown-heading.svelte +3 -3
  90. package/dist/markdown/markdown-heading.svelte.d.ts +3 -3
  91. package/dist/markdown/markdown-hr.svelte +3 -3
  92. package/dist/markdown/markdown-hr.svelte.d.ts +3 -3
  93. package/dist/markdown/markdown-html.svelte +2 -2
  94. package/dist/markdown/markdown-html.svelte.d.ts +2 -2
  95. package/dist/markdown/markdown-image.svelte +3 -3
  96. package/dist/markdown/markdown-image.svelte.d.ts +3 -3
  97. package/dist/markdown/markdown-link.svelte +3 -3
  98. package/dist/markdown/markdown-link.svelte.d.ts +3 -3
  99. package/dist/markdown/markdown-list-item.svelte +3 -3
  100. package/dist/markdown/markdown-list-item.svelte.d.ts +3 -3
  101. package/dist/markdown/markdown-list.svelte +3 -3
  102. package/dist/markdown/markdown-list.svelte.d.ts +3 -3
  103. package/dist/markdown/markdown-paragraph.svelte +3 -3
  104. package/dist/markdown/markdown-paragraph.svelte.d.ts +3 -3
  105. package/dist/markdown/markdown-space.svelte +2 -2
  106. package/dist/markdown/markdown-space.svelte.d.ts +2 -2
  107. package/dist/markdown/markdown-strong.svelte +3 -3
  108. package/dist/markdown/markdown-strong.svelte.d.ts +3 -3
  109. package/dist/markdown/markdown-table-cell.svelte +6 -3
  110. package/dist/markdown/markdown-table-cell.svelte.d.ts +3 -3
  111. package/dist/markdown/markdown-table.svelte +6 -4
  112. package/dist/markdown/markdown-table.svelte.d.ts +3 -3
  113. package/dist/markdown/markdown-text.svelte +2 -2
  114. package/dist/markdown/markdown-text.svelte.d.ts +2 -2
  115. package/dist/markdown/markdown-token.svelte +1 -1
  116. package/dist/markdown/markdown-tokens.svelte +2 -2
  117. package/dist/markdown/markdown-tokens.svelte.d.ts +1 -1
  118. package/dist/markdown/markdown.svelte +8 -8
  119. package/dist/markdown/markdown.svelte.d.ts +2 -2
  120. package/dist/menu/index.d.ts +2 -1
  121. package/dist/menu/index.js +2 -1
  122. package/dist/menu/menu-actions.svelte +2 -2
  123. package/dist/menu/menu-actions.svelte.d.ts +1 -1
  124. package/dist/menu/menu-content.svelte +6 -6
  125. package/dist/menu/menu-content.svelte.d.ts +4 -4
  126. package/dist/menu/menu-context.svelte.js +4 -4
  127. package/dist/menu/menu-item.svelte +6 -6
  128. package/dist/menu/menu-item.svelte.d.ts +3 -3
  129. package/dist/menu/menu-trigger-button.svelte +4 -4
  130. package/dist/menu/menu-trigger-button.svelte.d.ts +1 -1
  131. package/dist/menu/menu-trigger.svelte +6 -6
  132. package/dist/menu/menu-trigger.svelte.d.ts +3 -3
  133. package/dist/menu/menu.svelte +3 -3
  134. package/dist/menu/menu.svelte.d.ts +2 -2
  135. package/dist/modal/modal.svelte +6 -6
  136. package/dist/modal/modal.svelte.d.ts +3 -3
  137. package/dist/popover/popover.svelte +9 -9
  138. package/dist/popover/popover.svelte.d.ts +2 -2
  139. package/dist/portal/index.d.ts +2 -1
  140. package/dist/portal/index.js +1 -0
  141. package/dist/portal/portal.svelte +7 -4
  142. package/dist/portal/portal.svelte.d.ts +2 -2
  143. package/dist/portal/proxy.svelte +7 -4
  144. package/dist/portal/proxy.svelte.d.ts +3 -3
  145. package/dist/progress/circular-progress.svelte +8 -7
  146. package/dist/progress/circular-progress.svelte.d.ts +3 -3
  147. package/dist/progress/index.d.ts +1 -1
  148. package/dist/progress/index.js +1 -1
  149. package/dist/shortcut/index.d.ts +1 -1
  150. package/dist/shortcut/index.js +1 -1
  151. package/dist/shortcut/shortcut-badge.svelte +4 -4
  152. package/dist/shortcut/shortcut-badge.svelte.d.ts +3 -3
  153. package/dist/skeleton/skeleton.svelte +2 -2
  154. package/dist/skeleton/skeleton.svelte.d.ts +2 -2
  155. package/dist/switch/index.d.ts +1 -0
  156. package/dist/switch/index.js +1 -0
  157. package/dist/switch/switch-thumb.svelte +52 -0
  158. package/dist/switch/switch-thumb.svelte.d.ts +7 -0
  159. package/dist/switch/switch.svelte +15 -29
  160. package/dist/switch/switch.svelte.d.ts +7 -4
  161. package/dist/textarea/textarea.svelte +3 -3
  162. package/dist/textarea/textarea.svelte.d.ts +3 -3
  163. package/dist/toggle/index.d.ts +3 -2
  164. package/dist/toggle/index.js +3 -2
  165. package/dist/toggle/toggle-button.svelte +6 -6
  166. package/dist/toggle/toggle-button.svelte.d.ts +4 -4
  167. package/dist/toggle/toggle-group.svelte +3 -3
  168. package/dist/toggle/toggle-group.svelte.d.ts +2 -2
  169. package/dist/tooltip/tooltip.svelte +2 -2
  170. package/dist/tooltip/tooltip.svelte.d.ts +2 -2
  171. package/dist/utils.d.ts +1 -1
  172. package/dist/utils.js +1 -0
  173. package/package.json +4 -2
@@ -1,7 +1,7 @@
1
- import type { Snippet } from "svelte";
2
- type Props = {
1
+ import { type Snippet } from "svelte";
2
+ export type ProxyProps = {
3
3
  children?: Snippet;
4
4
  };
5
- declare const Proxy: import("svelte").Component<Props, {}, "">;
5
+ declare const Proxy: import("svelte").Component<ProxyProps, {}, "">;
6
6
  type Proxy = ReturnType<typeof Proxy>;
7
7
  export default Proxy;
@@ -1,9 +1,6 @@
1
- <script lang="ts">
2
- import type { Snippet } from "svelte";
3
-
4
- const DASH_ARRAY = 2 * 3.1415926535 * 10;
5
-
6
- type Props = {
1
+ <script lang="ts" module>
2
+ import { type Snippet } from "svelte";
3
+ export type CircularProgressProps = {
7
4
  children?: Snippet;
8
5
  progress?: number;
9
6
  size?: string | number;
@@ -12,6 +9,10 @@
12
9
  color?: string;
13
10
  class?: string;
14
11
  };
12
+ </script>
13
+
14
+ <script lang="ts">
15
+ const DASH_ARRAY = 2 * 3.1415926535 * 10;
15
16
 
16
17
  const {
17
18
  children,
@@ -21,7 +22,7 @@
21
22
  textColor = "currentColor",
22
23
  color = "currentColor",
23
24
  class: className,
24
- }: Props = $props();
25
+ }: CircularProgressProps = $props();
25
26
  </script>
26
27
 
27
28
  <svg
@@ -1,5 +1,5 @@
1
- import type { Snippet } from "svelte";
2
- type Props = {
1
+ import { type Snippet } from "svelte";
2
+ export type CircularProgressProps = {
3
3
  children?: Snippet;
4
4
  progress?: number;
5
5
  size?: string | number;
@@ -8,6 +8,6 @@ type Props = {
8
8
  color?: string;
9
9
  class?: string;
10
10
  };
11
- declare const CircularProgress: import("svelte").Component<Props, {}, "">;
11
+ declare const CircularProgress: import("svelte").Component<CircularProgressProps, {}, "">;
12
12
  type CircularProgress = ReturnType<typeof CircularProgress>;
13
13
  export default CircularProgress;
@@ -1 +1 @@
1
- export { default as CircularProgress } from "./circular-progress.svelte";
1
+ export { default as CircularProgress, type CircularProgressProps, } from "./circular-progress.svelte";
@@ -1 +1 @@
1
- export { default as CircularProgress } from "./circular-progress.svelte";
1
+ export { default as CircularProgress, } from "./circular-progress.svelte";
@@ -1,2 +1,2 @@
1
- export { Shortcut } from "./shortcut";
2
1
  export { default as ShortcutBadge, type ShortcutBadgeProps, } from "./shortcut-badge.svelte";
2
+ export { Shortcut } from "./shortcut.js";
@@ -1,2 +1,2 @@
1
- export { Shortcut } from "./shortcut";
2
1
  export { default as ShortcutBadge, } from "./shortcut-badge.svelte";
2
+ export { Shortcut } from "./shortcut.js";
@@ -1,9 +1,9 @@
1
1
  <script module lang="ts">
2
- import type { HTMLInputAttributes } from "svelte/elements";
2
+ import { Box } from "../box/index.js";
3
+ import { type Shortcut } from "./index.js";
4
+ import { noop, type ClassName, type ElementRef } from "../utils.js";
5
+ import { type HTMLInputAttributes } from "svelte/elements";
3
6
  import { twMerge, type ClassNameValue } from "tailwind-merge";
4
- import { Box } from "../box";
5
- import { noop, type ClassName, type ElementRef } from "../utils";
6
- import type { Shortcut } from "./shortcut";
7
7
 
8
8
  export type ShortcutBadgeProps = {
9
9
  shortcut: Shortcut;
@@ -1,7 +1,7 @@
1
- import type { HTMLInputAttributes } from "svelte/elements";
1
+ import { type Shortcut } from "./index.js";
2
+ import { type ClassName, type ElementRef } from "../utils.js";
3
+ import { type HTMLInputAttributes } from "svelte/elements";
2
4
  import { type ClassNameValue } from "tailwind-merge";
3
- import { type ClassName, type ElementRef } from "../utils";
4
- import type { Shortcut } from "./shortcut";
5
5
  export type ShortcutBadgeProps = {
6
6
  shortcut: Shortcut;
7
7
  badgeClass?: ClassNameValue;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import type { Snippet } from "svelte";
2
+ import { Box, type BoxProps } from "../box/index.js";
3
+ import { type Snippet } from "svelte";
3
4
  import { twMerge } from "tailwind-merge";
4
- import { Box, type BoxProps } from "../box";
5
5
 
6
6
  export type SkeletonProps = { children?: Snippet } & BoxProps;
7
7
  let {
@@ -1,5 +1,5 @@
1
- import type { Snippet } from "svelte";
2
- import { type BoxProps } from "../box";
1
+ import { type BoxProps } from "../box/index.js";
2
+ import { type Snippet } from "svelte";
3
3
  export type SkeletonProps = {
4
4
  children?: Snippet;
5
5
  } & BoxProps;
@@ -1 +1,2 @@
1
+ export { default as SwitchThumb, type SwitchThumbProps, } from "./switch-thumb.svelte";
1
2
  export { default as Switch, SWITCH_COLORS, SWITCH_RADII, SWITCH_SIZES, type SwitchColor, type SwitchColorProp, type SwitchProps, type SwitchRadius, type SwitchRadiusProp, type SwitchSize, type SwitchSizeProp, } from "./switch.svelte";
@@ -1 +1,2 @@
1
+ export { default as SwitchThumb, } from "./switch-thumb.svelte";
1
2
  export { default as Switch, SWITCH_COLORS, SWITCH_RADII, SWITCH_SIZES, } from "./switch.svelte";
@@ -0,0 +1,52 @@
1
+ <script lang="ts" module>
2
+ import type {
3
+ SwitchColorProp,
4
+ SwitchRadiusProp,
5
+ SwitchSizeProp,
6
+ } from "./index.js";
7
+ import { type ClassName } from "../utils.js";
8
+ import { type HTMLAttributes } from "svelte/elements";
9
+ import { twMerge } from "tailwind-merge";
10
+
11
+ export type SwitchThumbProps = {} & ClassName &
12
+ SwitchColorProp &
13
+ SwitchSizeProp &
14
+ SwitchRadiusProp &
15
+ HTMLAttributes<HTMLDivElement>;
16
+ </script>
17
+
18
+ <script lang="ts">
19
+ let {
20
+ class: className,
21
+ color = "primary",
22
+ size = "sm",
23
+ radius = "xl",
24
+ ...restProps
25
+ }: SwitchThumbProps = $props();
26
+ </script>
27
+
28
+ <div
29
+ class={twMerge(
30
+ "absolute top-0.5 left-0.5 shadow-sm transition-all",
31
+
32
+ color === "primary" && "bg-m3-on-primary",
33
+ color === "secondary" && "bg-m3-on-secondary",
34
+ color === "tertiary" && "bg-m3-on-tertiary",
35
+ color === "error" && "bg-m3-on-error",
36
+
37
+ size === "xs" && "size-3 group-aria-checked:translate-x-4",
38
+ size === "sm" && "size-4 group-aria-checked:translate-x-5",
39
+ size === "md" && "size-5 group-aria-checked:translate-x-6",
40
+ size === "lg" && "size-6 group-aria-checked:translate-x-7",
41
+ size === "xl" && "size-7 group-aria-checked:translate-x-8",
42
+
43
+ radius === "xs" && "rounded-xs",
44
+ radius === "sm" && "rounded-sm",
45
+ radius === "md" && "rounded-lg",
46
+ radius === "lg" && "rounded-2xl",
47
+ radius === "xl" && "rounded-4xl",
48
+
49
+ className,
50
+ )}
51
+ {...restProps}
52
+ ></div>
@@ -0,0 +1,7 @@
1
+ import type { SwitchColorProp, SwitchRadiusProp, SwitchSizeProp } from "./index.js";
2
+ import { type ClassName } from "../utils.js";
3
+ import { type HTMLAttributes } from "svelte/elements";
4
+ export type SwitchThumbProps = {} & ClassName & SwitchColorProp & SwitchSizeProp & SwitchRadiusProp & HTMLAttributes<HTMLDivElement>;
5
+ declare const SwitchThumb: import("svelte").Component<SwitchThumbProps, {}, "">;
6
+ type SwitchThumb = ReturnType<typeof SwitchThumb>;
7
+ export default SwitchThumb;
@@ -1,6 +1,4 @@
1
1
  <script lang="ts" module>
2
- import type { HTMLButtonAttributes } from "svelte/elements";
3
- import { twMerge } from "tailwind-merge";
4
2
  import {
5
3
  COLORS,
6
4
  RADII,
@@ -11,9 +9,13 @@
11
9
  type RadiusProp,
12
10
  type Size,
13
11
  type SizeProp,
14
- } from "../base";
15
- import { mergeProps } from "../merge-props";
16
- import type { ClassName } from "../utils";
12
+ } from "../base.js";
13
+ import { mergeProps } from "../merge-props.js";
14
+ import { SwitchThumb, type SwitchThumbProps } from "./index.js";
15
+ import { type ClassName } from "../utils.js";
16
+ import { type Snippet } from "svelte";
17
+ import { type HTMLButtonAttributes } from "svelte/elements";
18
+ import { twMerge } from "tailwind-merge";
17
19
 
18
20
  export const SWITCH_COLORS = COLORS;
19
21
  export type SwitchColor = Color;
@@ -29,16 +31,18 @@
29
31
 
30
32
  export type SwitchProps = {
31
33
  checked?: boolean;
34
+ thumb?: Snippet<[SwitchThumbProps]>;
32
35
  } & ClassName &
36
+ SwitchColorProp &
33
37
  SwitchSizeProp &
34
38
  SwitchRadiusProp &
35
- SwitchColorProp &
36
39
  HTMLButtonAttributes;
37
40
  </script>
38
41
 
39
42
  <script lang="ts">
40
43
  let {
41
44
  checked = $bindable(false),
45
+ thumb = defaultThumb,
42
46
  class: className,
43
47
  color = "primary",
44
48
  size = "sm",
@@ -47,6 +51,10 @@
47
51
  }: SwitchProps = $props();
48
52
  </script>
49
53
 
54
+ {#snippet defaultThumb(props: SwitchThumbProps)}
55
+ <SwitchThumb {...props} />
56
+ {/snippet}
57
+
50
58
  <button
51
59
  type="button"
52
60
  role="switch"
@@ -79,27 +87,5 @@
79
87
  )}
80
88
  {...mergeProps(restProps, { onclick: () => (checked = !checked) })}
81
89
  >
82
- <!-- Thumb -->
83
- <div
84
- class={twMerge(
85
- "absolute top-0.5 left-0.5 shadow-sm transition-all",
86
-
87
- color === "primary" && "bg-m3-on-primary",
88
- color === "secondary" && "bg-m3-on-secondary",
89
- color === "tertiary" && "bg-m3-on-tertiary",
90
- color === "error" && "bg-m3-on-error",
91
-
92
- size === "xs" && "size-3 group-aria-checked:translate-x-4",
93
- size === "sm" && "size-4 group-aria-checked:translate-x-5",
94
- size === "md" && "size-5 group-aria-checked:translate-x-6",
95
- size === "lg" && "size-6 group-aria-checked:translate-x-7",
96
- size === "xl" && "size-7 group-aria-checked:translate-x-8",
97
-
98
- radius === "xs" && "rounded-xs",
99
- radius === "sm" && "rounded-sm",
100
- radius === "md" && "rounded-lg",
101
- radius === "lg" && "rounded-2xl",
102
- radius === "xl" && "rounded-4xl",
103
- )}
104
- ></div>
90
+ {@render thumb({ color, size, radius })}
105
91
  </button>
@@ -1,6 +1,8 @@
1
- import type { HTMLButtonAttributes } from "svelte/elements";
2
- import { type Color, type ColorProp, type Radius, type RadiusProp, type Size, type SizeProp } from "../base";
3
- import type { ClassName } from "../utils";
1
+ import { type Color, type ColorProp, type Radius, type RadiusProp, type Size, type SizeProp } from "../base.js";
2
+ import { type SwitchThumbProps } from "./index.js";
3
+ import { type ClassName } from "../utils.js";
4
+ import { type Snippet } from "svelte";
5
+ import { type HTMLButtonAttributes } from "svelte/elements";
4
6
  export declare const SWITCH_COLORS: readonly ["primary", "secondary", "tertiary", "error", "inherit"];
5
7
  export type SwitchColor = Color;
6
8
  export type SwitchColorProp = ColorProp;
@@ -12,7 +14,8 @@ export type SwitchRadius = Radius;
12
14
  export type SwitchRadiusProp = RadiusProp;
13
15
  export type SwitchProps = {
14
16
  checked?: boolean;
15
- } & ClassName & SwitchSizeProp & SwitchRadiusProp & SwitchColorProp & HTMLButtonAttributes;
17
+ thumb?: Snippet<[SwitchThumbProps]>;
18
+ } & ClassName & SwitchColorProp & SwitchSizeProp & SwitchRadiusProp & HTMLButtonAttributes;
16
19
  declare const Switch: import("svelte").Component<SwitchProps, {}, "checked">;
17
20
  type Switch = ReturnType<typeof Switch>;
18
21
  export default Switch;
@@ -9,9 +9,9 @@
9
9
  type RadiusProp,
10
10
  type Size,
11
11
  type SizeProp,
12
- } from "..";
13
- import { type ClassName } from "../utils";
14
- import type { HTMLTextareaAttributes } from "svelte/elements";
12
+ } from "../base.js";
13
+ import { type ClassName } from "../utils.js";
14
+ import { type HTMLTextareaAttributes } from "svelte/elements";
15
15
  import { twMerge } from "tailwind-merge";
16
16
 
17
17
  export const TEXTAREA_VARIANTS = ["outlined", "filled", "inherit"] as const;
@@ -1,6 +1,6 @@
1
- import { type Color, type ColorProp, type Radius, type RadiusProp, type Size, type SizeProp } from "..";
2
- import { type ClassName } from "../utils";
3
- import type { HTMLTextareaAttributes } from "svelte/elements";
1
+ import { type Color, type ColorProp, type Radius, type RadiusProp, type Size, type SizeProp } from "../base.js";
2
+ import { type ClassName } from "../utils.js";
3
+ import { type HTMLTextareaAttributes } from "svelte/elements";
4
4
  export declare const TEXTAREA_VARIANTS: readonly ["outlined", "filled", "inherit"];
5
5
  export type TextareaVariant = (typeof TEXTAREA_VARIANTS)[number];
6
6
  export type TextareaVariantProp = {
@@ -1,2 +1,3 @@
1
- export { default as ToggleButton } from "./toggle-button.svelte";
2
- export { default as ToggleGroup } from "./toggle-group.svelte";
1
+ export { default as ToggleButton, type ToggleButtonProps, } from "./toggle-button.svelte";
2
+ export { getToggleContext, setToggleContext, ToggleContext, } from "./toggle-context.svelte.js";
3
+ export { default as ToggleGroup, type ToggleGroupProps, } from "./toggle-group.svelte";
@@ -1,2 +1,3 @@
1
- export { default as ToggleButton } from "./toggle-button.svelte";
2
- export { default as ToggleGroup } from "./toggle-group.svelte";
1
+ export { default as ToggleButton, } from "./toggle-button.svelte";
2
+ export { getToggleContext, setToggleContext, ToggleContext, } from "./toggle-context.svelte.js";
3
+ export { default as ToggleGroup, } from "./toggle-group.svelte";
@@ -1,11 +1,11 @@
1
1
  <script module lang="ts">
2
- import type { Snippet } from "svelte";
3
- import type { HTMLButtonAttributes } from "svelte/elements";
2
+ import { type Variants } from "../base.js";
3
+ import { mergeProps } from "../merge-props.js";
4
+ import { getToggleContext } from "./index.js";
5
+ import { noop, type ClassName, type ElementRef } from "../utils.js";
6
+ import { type Snippet } from "svelte";
7
+ import { type HTMLButtonAttributes } from "svelte/elements";
4
8
  import { twMerge } from "tailwind-merge";
5
- import { type Variants } from "../base";
6
- import { mergeProps } from "../merge-props";
7
- import { noop, type ClassName, type ElementRef } from "../utils";
8
- import { getToggleContext } from "./toggle-context.svelte";
9
9
 
10
10
  export type ToggleButtonProps<T> = {
11
11
  value: T;
@@ -1,7 +1,7 @@
1
- import type { Snippet } from "svelte";
2
- import type { HTMLButtonAttributes } from "svelte/elements";
3
- import { type Variants } from "../base";
4
- import { type ClassName, type ElementRef } from "../utils";
1
+ import { type Variants } from "../base.js";
2
+ import { type ClassName, type ElementRef } from "../utils.js";
3
+ import { type Snippet } from "svelte";
4
+ import { type HTMLButtonAttributes } from "svelte/elements";
5
5
  export type ToggleButtonProps<T> = {
6
6
  value: T;
7
7
  children: Snippet;
@@ -1,9 +1,9 @@
1
1
  <script module lang="ts">
2
+ import { setToggleContext, ToggleContext } from "./index.js";
3
+ import { noop, type ClassName, type ElementRef } from "../utils.js";
2
4
  import { type Snippet } from "svelte";
3
- import type { HTMLAttributes } from "svelte/elements";
5
+ import { type HTMLAttributes } from "svelte/elements";
4
6
  import { twMerge } from "tailwind-merge";
5
- import { noop, type ClassName, type ElementRef } from "../utils";
6
- import { setToggleContext, ToggleContext } from "./toggle-context.svelte";
7
7
 
8
8
  export type ToggleGroupProps<T> = {
9
9
  value?: T;
@@ -1,6 +1,6 @@
1
+ import { type ClassName, type ElementRef } from "../utils.js";
1
2
  import { type Snippet } from "svelte";
2
- import type { HTMLAttributes } from "svelte/elements";
3
- import { type ClassName, type ElementRef } from "../utils";
3
+ import { type HTMLAttributes } from "svelte/elements";
4
4
  export type ToggleGroupProps<T> = {
5
5
  value?: T;
6
6
  onChange?: (value?: T) => void;
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" module>
2
+ import { Popover, type PopoverProps } from "../popover/index.js";
3
+ import { type ClassName } from "../utils.js";
2
4
  import { type Snippet } from "svelte";
3
5
  import { twMerge } from "tailwind-merge";
4
- import { Popover, type PopoverProps } from "../popover";
5
- import type { ClassName } from "../utils";
6
6
 
7
7
  export type TooltipTriggerProps = {
8
8
  ref: (el: HTMLElement) => void;
@@ -1,6 +1,6 @@
1
+ import { type PopoverProps } from "../popover/index.js";
2
+ import { type ClassName } from "../utils.js";
1
3
  import { type Snippet } from "svelte";
2
- import { type PopoverProps } from "../popover";
3
- import type { ClassName } from "../utils";
4
4
  export type TooltipTriggerProps = {
5
5
  ref: (el: HTMLElement) => void;
6
6
  onclick?: () => void;
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ClassNameValue } from "tailwind-merge";
1
+ import { type ClassNameValue } from "tailwind-merge";
2
2
  export declare function noop(): void;
3
3
  export type ElementRef = {
4
4
  el?: HTMLElement;
package/dist/utils.js CHANGED
@@ -1,3 +1,4 @@
1
+ import {} from "tailwind-merge";
1
2
  export function noop() { }
2
3
  export function uid({ prefix = "", separator = "-" } = {}) {
3
4
  const parts = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kosui",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -51,6 +51,8 @@
51
51
  "eslint-config-prettier": "^10.0.1",
52
52
  "eslint-plugin-svelte": "^3.0.0",
53
53
  "globals": "^16.0.0",
54
+ "highlight.js": "^11.11.1",
55
+ "highlight.svelte": "^0.1.3",
54
56
  "jsdom": "^26.1.0",
55
57
  "postcss": "^8.5.6",
56
58
  "prettier": "^3.4.2",
@@ -78,7 +80,7 @@
78
80
  "format": "prettier --write .",
79
81
  "lint": "prettier --check . && eslint .",
80
82
  "test:unit": "vitest",
81
- "test": "pnpm test:unit -- --run && pnpm test:e2e",
83
+ "test": "pnpm run \"/^(build|check|lint|test:unit)$/\"",
82
84
  "test:e2e": "playwright test",
83
85
  "ci:publish": "changeset publish"
84
86
  }