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.
- package/dist/alert/alert.svelte +1 -1
- package/dist/alert/alert.svelte.d.ts +1 -1
- package/dist/autocomplete/autocomplete-content.svelte +5 -5
- package/dist/autocomplete/autocomplete-content.svelte.d.ts +4 -4
- package/dist/autocomplete/autocomplete-context.svelte.d.ts +1 -1
- package/dist/autocomplete/autocomplete-context.svelte.js +2 -2
- package/dist/autocomplete/autocomplete-input.svelte +3 -4
- package/dist/autocomplete/autocomplete-input.svelte.d.ts +1 -1
- package/dist/autocomplete/autocomplete-item.svelte +5 -5
- package/dist/autocomplete/autocomplete-item.svelte.d.ts +3 -3
- package/dist/autocomplete/autocomplete.svelte +3 -3
- package/dist/autocomplete/autocomplete.svelte.d.ts +2 -2
- package/dist/autocomplete/index.d.ts +1 -0
- package/dist/autocomplete/index.js +1 -0
- package/dist/avatar/avatar.svelte +1 -1
- package/dist/avatar/avatar.svelte.d.ts +1 -1
- package/dist/badge/badge.svelte +1 -1
- package/dist/badge/badge.svelte.d.ts +1 -1
- package/dist/box/box.svelte +4 -4
- package/dist/box/box.svelte.d.ts +4 -4
- package/dist/breadcrumbs/breadcrumbs.svelte +2 -2
- package/dist/breadcrumbs/breadcrumbs.svelte.d.ts +2 -2
- package/dist/button/button.svelte +7 -7
- package/dist/button/button.svelte.d.ts +5 -5
- package/dist/chip/chip.svelte +2 -3
- package/dist/chip/chip.svelte.d.ts +2 -2
- package/dist/command/action.svelte.d.ts +1 -1
- package/dist/command/action.svelte.js +1 -0
- package/dist/command/command-content.svelte +2 -2
- package/dist/command/command-content.svelte.d.ts +2 -2
- package/dist/command/command-context.svelte.d.ts +1 -1
- package/dist/command/command-context.svelte.js +1 -1
- package/dist/command/command-input.svelte +5 -5
- package/dist/command/command-input.svelte.d.ts +3 -3
- package/dist/command/command-item.svelte +5 -5
- package/dist/command/command-item.svelte.d.ts +3 -3
- package/dist/command/command-search.svelte +1 -2
- package/dist/command/command-search.svelte.d.ts +1 -1
- package/dist/command/command.svelte +3 -3
- package/dist/command/command.svelte.d.ts +2 -2
- package/dist/command/commander.svelte +6 -6
- package/dist/command/commander.svelte.d.ts +1 -1
- package/dist/command/index.d.ts +7 -6
- package/dist/command/index.js +5 -4
- package/dist/common/divider.svelte +2 -2
- package/dist/common/divider.svelte.d.ts +2 -2
- package/dist/common/header.svelte +4 -4
- package/dist/common/header.svelte.d.ts +4 -4
- package/dist/common/item-context.svelte.js +3 -3
- package/dist/dialog/dialog-button.svelte +2 -2
- package/dist/dialog/dialog-button.svelte.d.ts +2 -2
- package/dist/dialog/dialog.svelte +4 -4
- package/dist/dialog/dialog.svelte.d.ts +3 -3
- package/dist/dialog/dialoguer-context.svelte.d.ts +6 -6
- package/dist/dialog/dialoguer-context.svelte.js +3 -0
- package/dist/dialog/dialoguer.svelte +7 -7
- package/dist/dialog/dialoguer.svelte.d.ts +1 -1
- package/dist/dialog/index.d.ts +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/event-manager.d.ts +1 -1
- package/dist/event-manager.js +2 -2
- package/dist/fab/fab.svelte +2 -2
- package/dist/fab/fab.svelte.d.ts +2 -2
- package/dist/fab/index.d.ts +1 -1
- package/dist/index.d.ts +30 -30
- package/dist/index.js +30 -30
- package/dist/input/input.svelte +4 -4
- package/dist/input/input.svelte.d.ts +3 -3
- package/dist/link/link.svelte +3 -3
- package/dist/link/link.svelte.d.ts +3 -3
- package/dist/markdown/markdown-blockquote.svelte +3 -3
- package/dist/markdown/markdown-blockquote.svelte.d.ts +3 -3
- package/dist/markdown/markdown-br.svelte +3 -3
- package/dist/markdown/markdown-br.svelte.d.ts +3 -3
- package/dist/markdown/markdown-code.svelte +3 -3
- package/dist/markdown/markdown-code.svelte.d.ts +3 -3
- package/dist/markdown/markdown-codespan.svelte +3 -3
- package/dist/markdown/markdown-codespan.svelte.d.ts +3 -3
- package/dist/markdown/markdown-context.svelte.d.ts +1 -1
- package/dist/markdown/markdown-context.svelte.js +1 -0
- package/dist/markdown/markdown-def.svelte +3 -3
- package/dist/markdown/markdown-def.svelte.d.ts +3 -3
- package/dist/markdown/markdown-del.svelte +3 -3
- package/dist/markdown/markdown-del.svelte.d.ts +3 -3
- package/dist/markdown/markdown-em.svelte +3 -3
- package/dist/markdown/markdown-em.svelte.d.ts +3 -3
- package/dist/markdown/markdown-escape.svelte +1 -1
- package/dist/markdown/markdown-escape.svelte.d.ts +1 -1
- package/dist/markdown/markdown-heading.svelte +3 -3
- package/dist/markdown/markdown-heading.svelte.d.ts +3 -3
- package/dist/markdown/markdown-hr.svelte +3 -3
- package/dist/markdown/markdown-hr.svelte.d.ts +3 -3
- package/dist/markdown/markdown-html.svelte +2 -2
- package/dist/markdown/markdown-html.svelte.d.ts +2 -2
- package/dist/markdown/markdown-image.svelte +3 -3
- package/dist/markdown/markdown-image.svelte.d.ts +3 -3
- package/dist/markdown/markdown-link.svelte +3 -3
- package/dist/markdown/markdown-link.svelte.d.ts +3 -3
- package/dist/markdown/markdown-list-item.svelte +3 -3
- package/dist/markdown/markdown-list-item.svelte.d.ts +3 -3
- package/dist/markdown/markdown-list.svelte +3 -3
- package/dist/markdown/markdown-list.svelte.d.ts +3 -3
- package/dist/markdown/markdown-paragraph.svelte +3 -3
- package/dist/markdown/markdown-paragraph.svelte.d.ts +3 -3
- package/dist/markdown/markdown-space.svelte +2 -2
- package/dist/markdown/markdown-space.svelte.d.ts +2 -2
- package/dist/markdown/markdown-strong.svelte +3 -3
- package/dist/markdown/markdown-strong.svelte.d.ts +3 -3
- package/dist/markdown/markdown-table-cell.svelte +6 -3
- package/dist/markdown/markdown-table-cell.svelte.d.ts +3 -3
- package/dist/markdown/markdown-table.svelte +6 -4
- package/dist/markdown/markdown-table.svelte.d.ts +3 -3
- package/dist/markdown/markdown-text.svelte +2 -2
- package/dist/markdown/markdown-text.svelte.d.ts +2 -2
- package/dist/markdown/markdown-token.svelte +1 -1
- package/dist/markdown/markdown-tokens.svelte +2 -2
- package/dist/markdown/markdown-tokens.svelte.d.ts +1 -1
- package/dist/markdown/markdown.svelte +8 -8
- package/dist/markdown/markdown.svelte.d.ts +2 -2
- package/dist/menu/index.d.ts +2 -1
- package/dist/menu/index.js +2 -1
- package/dist/menu/menu-actions.svelte +2 -2
- package/dist/menu/menu-actions.svelte.d.ts +1 -1
- package/dist/menu/menu-content.svelte +6 -6
- package/dist/menu/menu-content.svelte.d.ts +4 -4
- package/dist/menu/menu-context.svelte.js +4 -4
- package/dist/menu/menu-item.svelte +6 -6
- package/dist/menu/menu-item.svelte.d.ts +3 -3
- package/dist/menu/menu-trigger-button.svelte +4 -4
- package/dist/menu/menu-trigger-button.svelte.d.ts +1 -1
- package/dist/menu/menu-trigger.svelte +6 -6
- package/dist/menu/menu-trigger.svelte.d.ts +3 -3
- package/dist/menu/menu.svelte +3 -3
- package/dist/menu/menu.svelte.d.ts +2 -2
- package/dist/modal/modal.svelte +6 -6
- package/dist/modal/modal.svelte.d.ts +3 -3
- package/dist/popover/popover.svelte +9 -9
- package/dist/popover/popover.svelte.d.ts +2 -2
- package/dist/portal/index.d.ts +2 -1
- package/dist/portal/index.js +1 -0
- package/dist/portal/portal.svelte +7 -4
- package/dist/portal/portal.svelte.d.ts +2 -2
- package/dist/portal/proxy.svelte +7 -4
- package/dist/portal/proxy.svelte.d.ts +3 -3
- package/dist/progress/circular-progress.svelte +8 -7
- package/dist/progress/circular-progress.svelte.d.ts +3 -3
- package/dist/progress/index.d.ts +1 -1
- package/dist/progress/index.js +1 -1
- package/dist/shortcut/index.d.ts +1 -1
- package/dist/shortcut/index.js +1 -1
- package/dist/shortcut/shortcut-badge.svelte +4 -4
- package/dist/shortcut/shortcut-badge.svelte.d.ts +3 -3
- package/dist/skeleton/skeleton.svelte +2 -2
- package/dist/skeleton/skeleton.svelte.d.ts +2 -2
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/switch-thumb.svelte +52 -0
- package/dist/switch/switch-thumb.svelte.d.ts +7 -0
- package/dist/switch/switch.svelte +15 -29
- package/dist/switch/switch.svelte.d.ts +7 -4
- package/dist/textarea/textarea.svelte +3 -3
- package/dist/textarea/textarea.svelte.d.ts +3 -3
- package/dist/toggle/index.d.ts +3 -2
- package/dist/toggle/index.js +3 -2
- package/dist/toggle/toggle-button.svelte +6 -6
- package/dist/toggle/toggle-button.svelte.d.ts +4 -4
- package/dist/toggle/toggle-group.svelte +3 -3
- package/dist/toggle/toggle-group.svelte.d.ts +2 -2
- package/dist/tooltip/tooltip.svelte +2 -2
- package/dist/tooltip/tooltip.svelte.d.ts +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -0
- package/package.json +4 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
type
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
|
+
export type ProxyProps = {
|
|
3
3
|
children?: Snippet;
|
|
4
4
|
};
|
|
5
|
-
declare const Proxy: import("svelte").Component<
|
|
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
|
|
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
|
-
}:
|
|
25
|
+
}: CircularProgressProps = $props();
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
28
|
<svg
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
type
|
|
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<
|
|
11
|
+
declare const CircularProgress: import("svelte").Component<CircularProgressProps, {}, "">;
|
|
12
12
|
type CircularProgress = ReturnType<typeof CircularProgress>;
|
|
13
13
|
export default CircularProgress;
|
package/dist/progress/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CircularProgress } from "./circular-progress.svelte";
|
|
1
|
+
export { default as CircularProgress, type CircularProgressProps, } from "./circular-progress.svelte";
|
package/dist/progress/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CircularProgress } from "./circular-progress.svelte";
|
|
1
|
+
export { default as CircularProgress, } from "./circular-progress.svelte";
|
package/dist/shortcut/index.d.ts
CHANGED
package/dist/shortcut/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
import
|
|
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
|
|
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
|
|
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 {
|
package/dist/switch/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/switch/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
|
2
|
-
import { type
|
|
3
|
-
import type
|
|
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
|
-
|
|
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
|
|
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
|
|
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 = {
|
package/dist/toggle/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default as ToggleButton } from "./toggle-button.svelte";
|
|
2
|
-
export {
|
|
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";
|
package/dist/toggle/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default as ToggleButton } from "./toggle-button.svelte";
|
|
2
|
-
export {
|
|
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
|
|
3
|
-
import
|
|
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
|
|
2
|
-
import type
|
|
3
|
-
import { type
|
|
4
|
-
import { type
|
|
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
|
|
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
|
|
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
package/dist/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kosui",
|
|
3
|
-
"version": "0.0.
|
|
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
|
|
83
|
+
"test": "pnpm run \"/^(build|check|lint|test:unit)$/\"",
|
|
82
84
|
"test:e2e": "playwright test",
|
|
83
85
|
"ci:publish": "changeset publish"
|
|
84
86
|
}
|