@svadmin/ui 0.136.0 → 0.137.1
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/app.css +107 -2
- package/dist/app.theme.css +107 -2
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/Affix.svelte +17 -2
- package/dist/components/Affix.svelte.d.ts +2 -0
- package/dist/components/Anchor.svelte +33 -8
- package/dist/components/Anchor.svelte.d.ts +6 -2
- package/dist/components/AutoComplete.svelte +27 -3
- package/dist/components/AutoComplete.svelte.d.ts +3 -0
- package/dist/components/BackTop.svelte +18 -7
- package/dist/components/BackTop.svelte.d.ts +4 -0
- package/dist/components/Barcode.svelte +9 -2
- package/dist/components/Barcode.svelte.d.ts +2 -0
- package/dist/components/Breadcrumbs.svelte +21 -8
- package/dist/components/Breadcrumbs.svelte.d.ts +6 -2
- package/dist/components/Calendar.svelte +26 -4
- package/dist/components/Calendar.svelte.d.ts +4 -1
- package/dist/components/Carousel.svelte +30 -4
- package/dist/components/Carousel.svelte.d.ts +4 -0
- package/dist/components/Cascader.svelte +79 -17
- package/dist/components/Cascader.svelte.d.ts +9 -2
- package/dist/components/CheckCard.svelte +14 -4
- package/dist/components/CheckCard.svelte.d.ts +4 -2
- package/dist/components/Col.svelte +14 -10
- package/dist/components/Col.svelte.d.ts +2 -0
- package/dist/components/Collapse.svelte +67 -9
- package/dist/components/Collapse.svelte.d.ts +12 -4
- package/dist/components/ColorPicker.svelte +76 -14
- package/dist/components/ColorPicker.svelte.d.ts +6 -0
- package/dist/components/ConfigProvider.svelte +1 -0
- package/dist/components/ConfigProvider.svelte.d.ts +1 -0
- package/dist/components/ConfirmDialog.svelte +33 -8
- package/dist/components/ConfirmDialog.svelte.d.ts +5 -0
- package/dist/components/Countdown.svelte +49 -15
- package/dist/components/Countdown.svelte.d.ts +6 -2
- package/dist/components/DatePicker.svelte +36 -8
- package/dist/components/DatePicker.svelte.d.ts +8 -0
- package/dist/components/DateRangeInput.svelte +67 -4
- package/dist/components/DateRangeInput.svelte.d.ts +7 -0
- package/dist/components/DateTimeInput.svelte +19 -1
- package/dist/components/DateTimeInput.svelte.d.ts +4 -0
- package/dist/components/Divider.svelte +27 -4
- package/dist/components/Divider.svelte.d.ts +6 -0
- package/dist/components/DrawerForm.svelte +131 -43
- package/dist/components/DrawerForm.svelte.d.ts +14 -1
- package/dist/components/EditableTabs.svelte +1 -1
- package/dist/components/EllipsisText.svelte +31 -8
- package/dist/components/EllipsisText.svelte.d.ts +8 -0
- package/dist/components/EmptyState.svelte +25 -5
- package/dist/components/EmptyState.svelte.d.ts +6 -1
- package/dist/components/FileUpload.svelte +15 -5
- package/dist/components/FileUpload.svelte.d.ts +3 -0
- package/dist/components/FloatButton.svelte +4 -1
- package/dist/components/FloatButton.svelte.d.ts +1 -0
- package/dist/components/HighlightText.svelte +15 -3
- package/dist/components/HighlightText.svelte.d.ts +6 -0
- package/dist/components/Image.svelte +10 -4
- package/dist/components/Image.svelte.d.ts +1 -0
- package/dist/components/LightFilter.svelte +37 -17
- package/dist/components/LightFilter.svelte.d.ts +8 -2
- package/dist/components/Link.svelte +19 -8
- package/dist/components/Link.svelte.d.ts +3 -2
- package/dist/components/ListPagination.svelte +165 -27
- package/dist/components/ListPagination.svelte.d.ts +10 -3
- package/dist/components/MentionsInput.svelte +33 -3
- package/dist/components/MentionsInput.svelte.d.ts +5 -0
- package/dist/components/ModalForm.svelte +116 -48
- package/dist/components/ModalForm.svelte.d.ts +14 -1
- package/dist/components/OtpInput.svelte +40 -12
- package/dist/components/OtpInput.svelte.d.ts +4 -1
- package/dist/components/PageContainer.svelte +74 -22
- package/dist/components/PageContainer.svelte.d.ts +20 -4
- package/dist/components/PageHeader.svelte +47 -8
- package/dist/components/PageHeader.svelte.d.ts +7 -2
- package/dist/components/PasswordInput.svelte +42 -11
- package/dist/components/PasswordInput.svelte.d.ts +10 -3
- package/dist/components/Popconfirm.svelte +96 -17
- package/dist/components/Popconfirm.svelte.d.ts +13 -1
- package/dist/components/PresenceAvatarGroup.svelte +12 -4
- package/dist/components/PresenceAvatarGroup.svelte.d.ts +1 -1
- package/dist/components/ProCard.svelte +17 -0
- package/dist/components/ProCard.svelte.d.ts +6 -0
- package/dist/components/ProDescriptions.svelte +28 -12
- package/dist/components/ProDescriptions.svelte.d.ts +7 -3
- package/dist/components/ProSkeleton.svelte +17 -2
- package/dist/components/ProSkeleton.svelte.d.ts +7 -0
- package/dist/components/QRCode.svelte +51 -14
- package/dist/components/QRCode.svelte.d.ts +10 -0
- package/dist/components/QueryFilter.svelte +48 -9
- package/dist/components/QueryFilter.svelte.d.ts +16 -0
- package/dist/components/RadioGroup.svelte +86 -8
- package/dist/components/RadioGroup.svelte.d.ts +2 -0
- package/dist/components/RangeSlider.svelte +34 -7
- package/dist/components/RangeSlider.svelte.d.ts +4 -0
- package/dist/components/Rate.svelte +178 -15
- package/dist/components/Rate.svelte.d.ts +16 -0
- package/dist/components/ResizeBox.svelte +39 -9
- package/dist/components/ResizeBox.svelte.d.ts +3 -0
- package/dist/components/Result.svelte +34 -5
- package/dist/components/Result.svelte.d.ts +4 -2
- package/dist/components/Ribbon.svelte +8 -4
- package/dist/components/Ribbon.svelte.d.ts +1 -1
- package/dist/components/Row.svelte +21 -5
- package/dist/components/Row.svelte.d.ts +2 -2
- package/dist/components/RowActions.svelte +4 -0
- package/dist/components/SegmentedControl.svelte +70 -8
- package/dist/components/SegmentedControl.svelte.d.ts +6 -1
- package/dist/components/Slider.svelte +35 -8
- package/dist/components/Slider.svelte.d.ts +4 -0
- package/dist/components/Space.svelte +34 -7
- package/dist/components/Space.svelte.d.ts +3 -3
- package/dist/components/Spin.svelte +142 -9
- package/dist/components/Spin.svelte.d.ts +7 -2
- package/dist/components/Statistic.svelte +29 -6
- package/dist/components/Statistic.svelte.d.ts +5 -1
- package/dist/components/StatisticCard.svelte +20 -4
- package/dist/components/StatisticCard.svelte.d.ts +5 -1
- package/dist/components/Steps.svelte +28 -7
- package/dist/components/Steps.svelte.d.ts +8 -2
- package/dist/components/Tag.svelte +63 -6
- package/dist/components/Tag.svelte.d.ts +12 -3
- package/dist/components/TagsInput.svelte +42 -21
- package/dist/components/TagsInput.svelte.d.ts +4 -0
- package/dist/components/Timeline.svelte +54 -3
- package/dist/components/Timeline.svelte.d.ts +13 -1
- package/dist/components/TooltipButton.svelte +7 -3
- package/dist/components/TooltipButton.svelte.d.ts +4 -1
- package/dist/components/Tour.svelte +56 -6
- package/dist/components/Tour.svelte.d.ts +7 -0
- package/dist/components/Transfer.svelte +77 -20
- package/dist/components/Transfer.svelte.d.ts +11 -2
- package/dist/components/Tree.svelte +109 -26
- package/dist/components/Tree.svelte.d.ts +15 -2
- package/dist/components/TreeSelect.svelte +168 -97
- package/dist/components/TreeSelect.svelte.d.ts +11 -2
- package/dist/components/Typography.svelte +18 -2
- package/dist/components/Typography.svelte.d.ts +4 -1
- package/dist/components/TypographyText.svelte +10 -3
- package/dist/components/TypographyText.svelte.d.ts +3 -1
- package/dist/components/Watermark.svelte +15 -2
- package/dist/components/Watermark.svelte.d.ts +3 -0
- package/dist/components/content/DescriptionList.svelte +21 -8
- package/dist/components/content/DescriptionList.svelte.d.ts +3 -0
- package/dist/components/content/FilterToolbar.svelte +1 -0
- package/dist/components/ui/alert/alert.svelte +51 -7
- package/dist/components/ui/alert/alert.svelte.d.ts +8 -2
- package/dist/components/ui/avatar/avatar-variants.d.ts +1 -1
- package/dist/components/ui/avatar/avatar-variants.js +19 -7
- package/dist/components/ui/avatar/avatar.svelte +50 -3
- package/dist/components/ui/avatar/avatar.svelte.d.ts +5 -0
- package/dist/components/ui/badge/badge.svelte +27 -12
- package/dist/components/ui/badge/badge.svelte.d.ts +5 -2
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +4 -2
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte.d.ts +1 -1
- package/dist/components/ui/button/button.svelte +100 -11
- package/dist/components/ui/button/button.svelte.d.ts +15 -2
- package/dist/components/ui/card/card.svelte +40 -4
- package/dist/components/ui/card/card.svelte.d.ts +5 -1
- package/dist/components/ui/checkbox/checkbox.svelte +71 -23
- package/dist/components/ui/checkbox/checkbox.svelte.d.ts +8 -1
- package/dist/components/ui/input/input.svelte +7 -4
- package/dist/components/ui/input/input.svelte.d.ts +2 -2
- package/dist/components/ui/progress/progress.svelte +122 -22
- package/dist/components/ui/progress/progress.svelte.d.ts +9 -1
- package/dist/components/ui/skeleton/index.d.ts +1 -1
- package/dist/components/ui/skeleton/skeleton.svelte +124 -6
- package/dist/components/ui/skeleton/skeleton.svelte.d.ts +19 -3
- package/dist/components/ui/switch/switch.svelte +44 -6
- package/dist/components/ui/switch/switch.svelte.d.ts +10 -3
- package/dist/components/ui/tabs/tabs-content.svelte +6 -1
- package/dist/components/ui/tabs/tabs-content.svelte.d.ts +1 -0
- package/dist/components/ui/tabs/tabs-context.svelte.d.ts +4 -1
- package/dist/components/ui/tabs/tabs-list.svelte +12 -3
- package/dist/components/ui/tabs/tabs-list.svelte.d.ts +4 -2
- package/dist/components/ui/tabs/tabs-trigger.svelte +11 -1
- package/dist/components/ui/tabs/tabs-trigger.svelte.d.ts +3 -0
- package/dist/components/ui/tabs/tabs.svelte +49 -5
- package/dist/components/ui/tabs/tabs.svelte.d.ts +10 -2
- package/dist/components/ui/textarea/textarea.svelte +17 -2
- package/dist/components/ui/textarea/textarea.svelte.d.ts +3 -1
- package/dist/components/ui/tooltip/tooltip-content.svelte +4 -1
- package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip.svelte +14 -1
- package/dist/components.css +7 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/notifications.svelte.d.ts +6 -1
- package/dist/notifications.svelte.js +20 -4
- package/dist/page-chrome.css +5 -0
- package/package.json +1 -1
- package/dist/components/ui/tooltip/tooltip.svelte.d.ts +0 -25
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { badgeVariants as resolveBadgeVariants, type BadgeVariant as BadgeVariantValue } from "./badge-variants.js";
|
|
3
3
|
|
|
4
4
|
export { badgeVariants, type BadgeVariant } from "./badge-variants.js";
|
|
5
|
-
export type BadgeStatus = 'success' | 'processing' | 'default' | 'error' | 'warning';
|
|
5
|
+
export type BadgeStatus = 'success' | 'processing' | 'default' | 'error' | 'warning' | 'danger' | 'info' | 'primary';
|
|
6
|
+
export type BadgeSize = "default" | "compact" | "small" | "mini" | "large";
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<script lang="ts">
|
|
@@ -25,11 +26,13 @@
|
|
|
25
26
|
offset,
|
|
26
27
|
showZero = false,
|
|
27
28
|
color,
|
|
29
|
+
countStyle,
|
|
30
|
+
dotStyle,
|
|
28
31
|
children,
|
|
29
32
|
...restProps
|
|
30
33
|
}: WithElementRef<HTMLAnchorAttributes> & {
|
|
31
34
|
variant?: BadgeVariantValue;
|
|
32
|
-
size?:
|
|
35
|
+
size?: BadgeSize;
|
|
33
36
|
count?: number | string | undefined;
|
|
34
37
|
overflowCount?: number | undefined;
|
|
35
38
|
maxCount?: number | undefined;
|
|
@@ -39,10 +42,13 @@
|
|
|
39
42
|
offset?: [number, number] | undefined;
|
|
40
43
|
showZero?: boolean | undefined;
|
|
41
44
|
color?: string | undefined;
|
|
45
|
+
countStyle?: string | undefined;
|
|
46
|
+
dotStyle?: string | undefined;
|
|
42
47
|
} = $props();
|
|
43
48
|
|
|
44
49
|
const config = useComponentConfig();
|
|
45
50
|
const size = $derived(sizeProp ?? (config.density === "compact" || config.componentSize === "sm" ? "compact" : "default"));
|
|
51
|
+
const isSmall = $derived(size === 'small' || size === 'compact' || size === 'mini');
|
|
46
52
|
|
|
47
53
|
const isStatusMode = $derived(count !== undefined || dot || status !== undefined);
|
|
48
54
|
|
|
@@ -72,10 +78,13 @@
|
|
|
72
78
|
case 'success':
|
|
73
79
|
return 'bg-success';
|
|
74
80
|
case 'processing':
|
|
81
|
+
case 'primary':
|
|
82
|
+
case 'info':
|
|
75
83
|
return 'bg-primary';
|
|
76
84
|
case 'warning':
|
|
77
85
|
return 'bg-warning';
|
|
78
86
|
case 'error':
|
|
87
|
+
case 'danger':
|
|
79
88
|
return 'bg-destructive';
|
|
80
89
|
case 'default':
|
|
81
90
|
default:
|
|
@@ -92,15 +101,16 @@
|
|
|
92
101
|
data-svadmin-component="badge"
|
|
93
102
|
data-slot="badge-status"
|
|
94
103
|
data-status={status}
|
|
104
|
+
data-size={size}
|
|
95
105
|
{href}
|
|
96
106
|
class={cn('inline-flex items-center gap-2 text-sm text-foreground', className)}
|
|
97
107
|
{...restProps}
|
|
98
108
|
>
|
|
99
|
-
<span class="relative flex h-2 w-2">
|
|
109
|
+
<span class={cn("relative flex", isSmall ? "h-1.5 w-1.5" : "h-2 w-2")}>
|
|
100
110
|
{#if status === 'processing'}
|
|
101
111
|
<span class={cn('absolute inline-flex h-full w-full animate-ping rounded-full opacity-75', statusColorClass)} style={color ? `background-color: ${color}` : undefined}></span>
|
|
102
112
|
{/if}
|
|
103
|
-
<span class={cn('relative inline-flex h-
|
|
113
|
+
<span class={cn('relative inline-flex rounded-full', isSmall ? 'h-1.5 w-1.5' : 'h-2 w-2', statusColorClass)} style={color ? `background-color: ${color}` : undefined}></span>
|
|
104
114
|
</span>
|
|
105
115
|
{#if text}
|
|
106
116
|
<span class="svadmin-badge-status-text select-none text-xs">{text}</span>
|
|
@@ -113,6 +123,7 @@
|
|
|
113
123
|
bind:this={ref}
|
|
114
124
|
data-svadmin-component="badge"
|
|
115
125
|
data-slot="badge-wrapper"
|
|
126
|
+
data-size={size}
|
|
116
127
|
{href}
|
|
117
128
|
class={cn('relative inline-flex shrink-0 align-middle', className)}
|
|
118
129
|
{...restProps}
|
|
@@ -123,19 +134,21 @@
|
|
|
123
134
|
<span
|
|
124
135
|
data-slot="badge-dot"
|
|
125
136
|
class={cn(
|
|
126
|
-
'absolute top-0 right-0 z-10
|
|
137
|
+
'absolute top-0 right-0 z-10 rounded-full ring-2 ring-background transform translate-x-1/2 -translate-y-1/2',
|
|
138
|
+
isSmall ? 'h-1.5 w-1.5' : 'h-2 w-2',
|
|
127
139
|
status ? statusColorClass : 'bg-destructive',
|
|
128
140
|
)}
|
|
129
|
-
style={`${offsetStyle}${color ? ` background-color: ${color};` : ''}`}
|
|
141
|
+
style={`${offsetStyle}${color ? ` background-color: ${color};` : ''}${dotStyle ? ` ${dotStyle};` : ''}`}
|
|
130
142
|
></span>
|
|
131
143
|
{:else if displayCount !== null}
|
|
132
144
|
<span
|
|
133
145
|
data-slot="badge-count"
|
|
134
146
|
class={cn(
|
|
135
|
-
'absolute top-0 right-0 z-10 flex
|
|
147
|
+
'absolute top-0 right-0 z-10 flex items-center justify-center rounded-full leading-none shadow-xs ring-2 ring-background transform translate-x-1/2 -translate-y-1/2 whitespace-nowrap',
|
|
148
|
+
isSmall ? 'min-w-3.5 h-3.5 px-1 text-[9px] font-medium' : 'min-w-4.5 h-4.5 px-1.5 text-[11px] font-semibold',
|
|
136
149
|
status ? cn(statusColorClass, 'text-primary-foreground') : 'bg-destructive text-destructive-foreground',
|
|
137
150
|
)}
|
|
138
|
-
style={`${offsetStyle}${color ? ` background-color: ${color};` : ''}`}
|
|
151
|
+
style={`${offsetStyle}${color ? ` background-color: ${color};` : ''}${countStyle ? ` ${countStyle};` : ''}`}
|
|
139
152
|
>
|
|
140
153
|
{displayCount}
|
|
141
154
|
</span>
|
|
@@ -149,22 +162,24 @@
|
|
|
149
162
|
bind:this={ref}
|
|
150
163
|
data-svadmin-component="badge"
|
|
151
164
|
data-slot="badge-standalone"
|
|
165
|
+
data-size={size}
|
|
152
166
|
{href}
|
|
153
167
|
class={cn('inline-flex items-center align-middle', className)}
|
|
154
168
|
{...restProps}
|
|
155
169
|
>
|
|
156
170
|
{#if dot}
|
|
157
171
|
<span
|
|
158
|
-
class={cn('h-
|
|
159
|
-
style={color ? `background-color: ${color}` : undefined}
|
|
172
|
+
class={cn('rounded-full', isSmall ? 'h-1.5 w-1.5' : 'h-2 w-2', status ? statusColorClass : 'bg-destructive')}
|
|
173
|
+
style={[color ? `background-color: ${color}` : undefined, dotStyle].filter(Boolean).join('; ') || undefined}
|
|
160
174
|
></span>
|
|
161
175
|
{:else if displayCount !== null}
|
|
162
176
|
<span
|
|
163
177
|
class={cn(
|
|
164
|
-
'flex
|
|
178
|
+
'flex items-center justify-center rounded-full leading-none shadow-xs whitespace-nowrap',
|
|
179
|
+
isSmall ? 'min-w-3.5 h-3.5 px-1 text-[9px] font-medium' : 'min-w-4.5 h-4.5 px-1.5 text-[11px] font-semibold',
|
|
165
180
|
status ? cn(statusColorClass, 'text-primary-foreground') : 'bg-destructive text-destructive-foreground',
|
|
166
181
|
)}
|
|
167
|
-
style={color ? `background-color: ${color}` : undefined}
|
|
182
|
+
style={[color ? `background-color: ${color}` : undefined, countStyle].filter(Boolean).join('; ') || undefined}
|
|
168
183
|
>
|
|
169
184
|
{displayCount}
|
|
170
185
|
</span>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type BadgeVariant as BadgeVariantValue } from "./badge-variants.js";
|
|
2
2
|
export { badgeVariants, type BadgeVariant } from "./badge-variants.js";
|
|
3
|
-
export type BadgeStatus = 'success' | 'processing' | 'default' | 'error' | 'warning';
|
|
3
|
+
export type BadgeStatus = 'success' | 'processing' | 'default' | 'error' | 'warning' | 'danger' | 'info' | 'primary';
|
|
4
|
+
export type BadgeSize = "default" | "compact" | "small" | "mini" | "large";
|
|
4
5
|
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
5
6
|
import { type WithElementRef } from "../../../utils.js";
|
|
6
7
|
type $$ComponentProps = WithElementRef<HTMLAnchorAttributes> & {
|
|
7
8
|
variant?: BadgeVariantValue;
|
|
8
|
-
size?:
|
|
9
|
+
size?: BadgeSize;
|
|
9
10
|
count?: number | string | undefined;
|
|
10
11
|
overflowCount?: number | undefined;
|
|
11
12
|
maxCount?: number | undefined;
|
|
@@ -15,6 +16,8 @@ type $$ComponentProps = WithElementRef<HTMLAnchorAttributes> & {
|
|
|
15
16
|
offset?: [number, number] | undefined;
|
|
16
17
|
showZero?: boolean | undefined;
|
|
17
18
|
color?: string | undefined;
|
|
19
|
+
countStyle?: string | undefined;
|
|
20
|
+
dotStyle?: string | undefined;
|
|
18
21
|
};
|
|
19
22
|
declare const Badge: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
20
23
|
type Badge = ReturnType<typeof Badge>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
children,
|
|
10
10
|
separator = 'slash',
|
|
11
11
|
...restProps
|
|
12
|
-
}: HTMLLiAttributes & { children?: Snippet; separator?: 'slash' | 'arrow' } = $props();
|
|
12
|
+
}: HTMLLiAttributes & { children?: Snippet; separator?: 'slash' | 'arrow' | string } = $props();
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<li
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
{@render children()}
|
|
25
25
|
{:else if separator === 'arrow'}
|
|
26
26
|
<ChevronRight class="svadmin-breadcrumb-icon" />
|
|
27
|
-
{:else}
|
|
27
|
+
{:else if separator === 'slash'}
|
|
28
28
|
<span class="svadmin-breadcrumb-slash">/</span>
|
|
29
|
+
{:else}
|
|
30
|
+
<span class="svadmin-breadcrumb-custom">{separator}</span>
|
|
29
31
|
{/if}
|
|
30
32
|
</li>
|
|
@@ -2,7 +2,7 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLLiAttributes } from 'svelte/elements';
|
|
3
3
|
type $$ComponentProps = HTMLLiAttributes & {
|
|
4
4
|
children?: Snippet;
|
|
5
|
-
separator?: 'slash' | 'arrow';
|
|
5
|
+
separator?: 'slash' | 'arrow' | string;
|
|
6
6
|
};
|
|
7
7
|
declare const BreadcrumbSeparator: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
8
|
type BreadcrumbSeparator = ReturnType<typeof BreadcrumbSeparator>;
|
|
@@ -9,12 +9,27 @@
|
|
|
9
9
|
|
|
10
10
|
export { buttonVariants, type ButtonSize, type ButtonVariant } from "./button-variants.js";
|
|
11
11
|
|
|
12
|
+
export type ButtonShape = "square" | "round" | "circle";
|
|
13
|
+
export type ButtonStatus = "normal" | "warning" | "danger" | "success";
|
|
14
|
+
/** Emphasis alias: 让 `primary` / `text` 这类语义直接落在 variant 上,同时不占用 HTML `type`。 */
|
|
15
|
+
export type ButtonEmphasisType = "primary" | "secondary" | "dashed" | "outline" | "text";
|
|
16
|
+
|
|
17
|
+
type ButtonElementAttributes = HTMLButtonAttributes & HTMLAnchorAttributes;
|
|
18
|
+
|
|
12
19
|
export type ButtonProps = WithElementRef<
|
|
13
|
-
|
|
20
|
+
ButtonElementAttributes,
|
|
14
21
|
HTMLButtonElement | HTMLAnchorElement
|
|
15
22
|
> & {
|
|
16
23
|
variant?: ButtonVariantValue;
|
|
17
|
-
size?: ButtonSizeValue;
|
|
24
|
+
size?: ButtonSizeValue | "mini" | "small" | "large";
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
shape?: ButtonShape;
|
|
27
|
+
status?: ButtonStatus;
|
|
28
|
+
long?: boolean;
|
|
29
|
+
block?: boolean;
|
|
30
|
+
/** 原生 type 保持 HTML 语义;强调语义统一走 `emphasis`。 */
|
|
31
|
+
type?: "button" | "submit" | "reset";
|
|
32
|
+
emphasis?: ButtonEmphasisType;
|
|
18
33
|
disabledReason?: string;
|
|
19
34
|
disabledReasonDisplay?: "tooltip" | "inline";
|
|
20
35
|
disabledReasonSide?: "top" | "bottom" | "left" | "right";
|
|
@@ -25,17 +40,38 @@
|
|
|
25
40
|
|
|
26
41
|
<script lang="ts">
|
|
27
42
|
import * as Tooltip from "../tooltip/index.js";
|
|
43
|
+
import { Loader2 } from "@lucide/svelte";
|
|
28
44
|
import { useComponentConfig } from "../../ConfigProvider.svelte";
|
|
29
45
|
|
|
30
46
|
const BUTTON_VARIANTS = new Set(["default", "outline", "secondary", "ghost", "destructive", "link", "dashed", "text"]);
|
|
31
47
|
const BUTTON_SIZES = new Set(["default", "xs", "sm", "lg", "icon", "icon-xs", "icon-sm", "icon-lg"]);
|
|
32
48
|
|
|
49
|
+
const SIZE_ALIASES: Record<string, ButtonSizeValue> = {
|
|
50
|
+
mini: "xs",
|
|
51
|
+
small: "sm",
|
|
52
|
+
large: "lg",
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const EMPHASIS_TYPE_MAP: Record<string, ButtonVariantValue> = {
|
|
56
|
+
primary: "default",
|
|
57
|
+
secondary: "secondary",
|
|
58
|
+
dashed: "dashed",
|
|
59
|
+
outline: "outline",
|
|
60
|
+
text: "text",
|
|
61
|
+
};
|
|
62
|
+
|
|
33
63
|
function readButtonVariant(value: unknown): ButtonVariantValue | undefined {
|
|
34
|
-
|
|
64
|
+
if (typeof value !== "string") return undefined;
|
|
65
|
+
if (BUTTON_VARIANTS.has(value)) return value as ButtonVariantValue;
|
|
66
|
+
if (value in EMPHASIS_TYPE_MAP) return EMPHASIS_TYPE_MAP[value];
|
|
67
|
+
return undefined;
|
|
35
68
|
}
|
|
36
69
|
|
|
37
70
|
function readButtonSize(value: unknown): ButtonSizeValue | undefined {
|
|
38
|
-
|
|
71
|
+
if (typeof value !== "string") return undefined;
|
|
72
|
+
if (BUTTON_SIZES.has(value)) return value as ButtonSizeValue;
|
|
73
|
+
if (value in SIZE_ALIASES) return SIZE_ALIASES[value];
|
|
74
|
+
return undefined;
|
|
39
75
|
}
|
|
40
76
|
|
|
41
77
|
const uid = $props.id();
|
|
@@ -43,9 +79,15 @@
|
|
|
43
79
|
class: className,
|
|
44
80
|
variant: variantProp,
|
|
45
81
|
size: sizeProp,
|
|
82
|
+
loading = false,
|
|
83
|
+
shape,
|
|
84
|
+
status = "normal",
|
|
85
|
+
long = false,
|
|
86
|
+
block = false,
|
|
46
87
|
ref = $bindable(null),
|
|
47
88
|
href = undefined,
|
|
48
|
-
type = "button",
|
|
89
|
+
type: typeProp = "button",
|
|
90
|
+
emphasis,
|
|
49
91
|
disabled,
|
|
50
92
|
disabledReason = "",
|
|
51
93
|
disabledReasonDisplay = "tooltip",
|
|
@@ -57,18 +99,39 @@
|
|
|
57
99
|
...restProps
|
|
58
100
|
}: ButtonProps = $props();
|
|
59
101
|
|
|
102
|
+
const emphasisVariant = $derived(emphasis ? EMPHASIS_TYPE_MAP[emphasis] : undefined);
|
|
103
|
+
const htmlType = $derived(emphasis ? "button" : (typeProp as "button" | "submit" | "reset"));
|
|
104
|
+
|
|
60
105
|
const config = useComponentConfig();
|
|
61
106
|
const buttonDefaults = $derived(config.componentDefaults['Button'] ?? {});
|
|
62
|
-
const
|
|
63
|
-
const
|
|
107
|
+
const baseVariant = $derived(variantProp ?? emphasisVariant ?? readButtonVariant(buttonDefaults['variant']) ?? "default");
|
|
108
|
+
const variant = $derived(status === "danger" && baseVariant === "default" ? "destructive" : baseVariant);
|
|
109
|
+
const size = $derived(readButtonSize(sizeProp) ?? readButtonSize(buttonDefaults['size']) ?? (config.density === "compact" || config.componentSize === "sm" ? "sm" : config.componentSize === "lg" ? "lg" : "default"));
|
|
64
110
|
|
|
65
111
|
const restriction = $derived((disabledReason ?? "").trim());
|
|
66
|
-
const isDisabled = $derived(Boolean(disabled || restriction));
|
|
112
|
+
const isDisabled = $derived(Boolean(disabled || loading || restriction));
|
|
67
113
|
const restrictionId = `svadmin-button-restriction-${uid}`;
|
|
68
114
|
const describedBy = $derived(
|
|
69
115
|
[ariaDescribedBy, restriction ? restrictionId : ""].filter(Boolean).join(" ") || undefined,
|
|
70
116
|
);
|
|
71
117
|
|
|
118
|
+
const isFullWidth = $derived(long || block);
|
|
119
|
+
const shapeClasses = $derived(
|
|
120
|
+
shape === "round"
|
|
121
|
+
? "rounded-full px-4"
|
|
122
|
+
: shape === "circle"
|
|
123
|
+
? "rounded-full p-0 aspect-square justify-center"
|
|
124
|
+
: ""
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const statusClasses = $derived(
|
|
128
|
+
status === "warning"
|
|
129
|
+
? "border-warning text-warning hover:bg-warning/10"
|
|
130
|
+
: status === "success"
|
|
131
|
+
? "border-success text-success hover:bg-success/10"
|
|
132
|
+
: ""
|
|
133
|
+
);
|
|
134
|
+
|
|
72
135
|
function restrictionTriggerProps(props: Record<string, unknown>): Record<string, unknown> {
|
|
73
136
|
const next = { ...props };
|
|
74
137
|
delete next['type'];
|
|
@@ -86,9 +149,19 @@
|
|
|
86
149
|
data-slot="button"
|
|
87
150
|
data-variant={variant}
|
|
88
151
|
data-size={size}
|
|
89
|
-
|
|
152
|
+
data-shape={shape || undefined}
|
|
153
|
+
data-status={status !== "normal" ? status : undefined}
|
|
154
|
+
data-loading={loading ? "true" : undefined}
|
|
155
|
+
class={cn(
|
|
156
|
+
resolveButtonVariants({ variant, size }),
|
|
157
|
+
isFullWidth && "w-full",
|
|
158
|
+
shapeClasses,
|
|
159
|
+
statusClasses,
|
|
160
|
+
className
|
|
161
|
+
)}
|
|
90
162
|
href={isDisabled ? undefined : href}
|
|
91
163
|
aria-disabled={isDisabled ? true : undefined}
|
|
164
|
+
aria-busy={loading ? true : undefined}
|
|
92
165
|
role={isDisabled ? "link" : undefined}
|
|
93
166
|
tabindex={isDisabled ? -1 : undefined}
|
|
94
167
|
aria-describedby={describedBy}
|
|
@@ -102,6 +175,9 @@
|
|
|
102
175
|
restProps.onclick?.(event);
|
|
103
176
|
}}
|
|
104
177
|
>
|
|
178
|
+
{#if loading}
|
|
179
|
+
<Loader2 class={cn("animate-spin shrink-0", size === "xs" || size === "icon-xs" ? "size-3 mr-1" : "size-3.5 mr-1.5")} aria-hidden="true" />
|
|
180
|
+
{/if}
|
|
105
181
|
{@render children?.()}
|
|
106
182
|
</a>
|
|
107
183
|
{:else}
|
|
@@ -110,12 +186,25 @@
|
|
|
110
186
|
data-slot="button"
|
|
111
187
|
data-variant={variant}
|
|
112
188
|
data-size={size}
|
|
113
|
-
|
|
114
|
-
{
|
|
189
|
+
data-shape={shape || undefined}
|
|
190
|
+
data-status={status !== "normal" ? status : undefined}
|
|
191
|
+
data-loading={loading ? "true" : undefined}
|
|
192
|
+
class={cn(
|
|
193
|
+
resolveButtonVariants({ variant, size }),
|
|
194
|
+
isFullWidth && "w-full",
|
|
195
|
+
shapeClasses,
|
|
196
|
+
statusClasses,
|
|
197
|
+
className
|
|
198
|
+
)}
|
|
199
|
+
type={htmlType}
|
|
115
200
|
disabled={isDisabled}
|
|
201
|
+
aria-busy={loading ? true : undefined}
|
|
116
202
|
aria-describedby={describedBy}
|
|
117
203
|
{...restProps}
|
|
118
204
|
>
|
|
205
|
+
{#if loading}
|
|
206
|
+
<Loader2 class={cn("animate-spin shrink-0", size === "xs" || size === "icon-xs" ? "size-3 mr-1" : "size-3.5 mr-1.5")} aria-hidden="true" />
|
|
207
|
+
{/if}
|
|
119
208
|
{@render children?.()}
|
|
120
209
|
</button>
|
|
121
210
|
{/if}
|
|
@@ -2,9 +2,22 @@ import { type WithElementRef } from "../../../utils.js";
|
|
|
2
2
|
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
3
3
|
import { type ButtonSize as ButtonSizeValue, type ButtonVariant as ButtonVariantValue } from "./button-variants.js";
|
|
4
4
|
export { buttonVariants, type ButtonSize, type ButtonVariant } from "./button-variants.js";
|
|
5
|
-
export type
|
|
5
|
+
export type ButtonShape = "square" | "round" | "circle";
|
|
6
|
+
export type ButtonStatus = "normal" | "warning" | "danger" | "success";
|
|
7
|
+
/** Emphasis alias: 让 `primary` / `text` 这类语义直接落在 variant 上,同时不占用 HTML `type`。 */
|
|
8
|
+
export type ButtonEmphasisType = "primary" | "secondary" | "dashed" | "outline" | "text";
|
|
9
|
+
type ButtonElementAttributes = HTMLButtonAttributes & HTMLAnchorAttributes;
|
|
10
|
+
export type ButtonProps = WithElementRef<ButtonElementAttributes, HTMLButtonElement | HTMLAnchorElement> & {
|
|
6
11
|
variant?: ButtonVariantValue;
|
|
7
|
-
size?: ButtonSizeValue;
|
|
12
|
+
size?: ButtonSizeValue | "mini" | "small" | "large";
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
shape?: ButtonShape;
|
|
15
|
+
status?: ButtonStatus;
|
|
16
|
+
long?: boolean;
|
|
17
|
+
block?: boolean;
|
|
18
|
+
/** 原生 type 保持 HTML 语义;强调语义统一走 `emphasis`。 */
|
|
19
|
+
type?: "button" | "submit" | "reset";
|
|
20
|
+
emphasis?: ButtonEmphasisType;
|
|
8
21
|
disabledReason?: string;
|
|
9
22
|
disabledReasonDisplay?: "tooltip" | "inline";
|
|
10
23
|
disabledReasonSide?: "top" | "bottom" | "left" | "right";
|
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
import CardContent from "./card-content.svelte";
|
|
10
10
|
|
|
11
11
|
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
12
|
-
size?: "default" | "sm";
|
|
12
|
+
size?: "default" | "sm" | "small" | "mini";
|
|
13
13
|
hoverable?: boolean;
|
|
14
14
|
bordered?: boolean;
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
title?: string | Snippet;
|
|
17
17
|
extra?: Snippet;
|
|
18
|
+
cover?: Snippet;
|
|
19
|
+
actions?: Snippet;
|
|
20
|
+
headerStyle?: string;
|
|
21
|
+
bodyStyle?: string;
|
|
18
22
|
};
|
|
19
23
|
|
|
20
24
|
let {
|
|
@@ -27,19 +31,28 @@
|
|
|
27
31
|
loading = false,
|
|
28
32
|
title,
|
|
29
33
|
extra,
|
|
34
|
+
cover,
|
|
35
|
+
actions,
|
|
36
|
+
headerStyle,
|
|
37
|
+
bodyStyle,
|
|
30
38
|
...restProps
|
|
31
39
|
}: Props = $props();
|
|
40
|
+
|
|
41
|
+
const normalizedSize = $derived(
|
|
42
|
+
size === "small" || size === "mini" ? "sm" : size
|
|
43
|
+
);
|
|
32
44
|
</script>
|
|
33
45
|
|
|
34
46
|
<div
|
|
35
47
|
bind:this={ref}
|
|
36
48
|
data-slot="card"
|
|
37
|
-
data-size={
|
|
49
|
+
data-size={normalizedSize}
|
|
38
50
|
data-hoverable={hoverable ? "true" : undefined}
|
|
39
51
|
class={cn(
|
|
40
52
|
"svadmin-card",
|
|
41
53
|
hoverable && "svadmin-card--hoverable",
|
|
42
54
|
!bordered && "border-0 shadow-none",
|
|
55
|
+
normalizedSize === "sm" && "svadmin-card--small",
|
|
43
56
|
className
|
|
44
57
|
)}
|
|
45
58
|
{...restProps}
|
|
@@ -52,8 +65,16 @@
|
|
|
52
65
|
<Skeleton class="h-16 w-full mt-2" />
|
|
53
66
|
</div>
|
|
54
67
|
{:else}
|
|
68
|
+
{#if cover}
|
|
69
|
+
<div class="svadmin-card__cover overflow-hidden rounded-t-[calc(var(--radius)-1px)]" data-slot="card-cover">
|
|
70
|
+
{@render cover()}
|
|
71
|
+
</div>
|
|
72
|
+
{/if}
|
|
55
73
|
{#if title || extra}
|
|
56
|
-
<CardHeader
|
|
74
|
+
<CardHeader
|
|
75
|
+
class="flex flex-row items-center justify-between pb-2"
|
|
76
|
+
style={headerStyle}
|
|
77
|
+
>
|
|
57
78
|
{#if title}
|
|
58
79
|
<CardTitle>
|
|
59
80
|
{#if typeof title === "string"}
|
|
@@ -72,11 +93,26 @@
|
|
|
72
93
|
</CardHeader>
|
|
73
94
|
{/if}
|
|
74
95
|
{#if title || extra}
|
|
75
|
-
<CardContent>
|
|
96
|
+
<CardContent style={bodyStyle}>
|
|
76
97
|
{@render children?.()}
|
|
77
98
|
</CardContent>
|
|
99
|
+
{:else if bodyStyle}
|
|
100
|
+
<div style={bodyStyle}>
|
|
101
|
+
{@render children?.()}
|
|
102
|
+
</div>
|
|
78
103
|
{:else}
|
|
79
104
|
{@render children?.()}
|
|
80
105
|
{/if}
|
|
106
|
+
{#if actions}
|
|
107
|
+
<div
|
|
108
|
+
class={cn(
|
|
109
|
+
"svadmin-card__actions border-t border-border flex items-center justify-end gap-2 bg-muted/10",
|
|
110
|
+
normalizedSize === "sm" ? "px-3 py-2" : "px-6 py-3"
|
|
111
|
+
)}
|
|
112
|
+
data-slot="card-actions"
|
|
113
|
+
>
|
|
114
|
+
{@render actions()}
|
|
115
|
+
</div>
|
|
116
|
+
{/if}
|
|
81
117
|
{/if}
|
|
82
118
|
</div>
|
|
@@ -2,12 +2,16 @@ import type { Snippet } from "svelte";
|
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
import { type WithElementRef } from "../../../utils.js";
|
|
4
4
|
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
5
|
-
size?: "default" | "sm";
|
|
5
|
+
size?: "default" | "sm" | "small" | "mini";
|
|
6
6
|
hoverable?: boolean;
|
|
7
7
|
bordered?: boolean;
|
|
8
8
|
loading?: boolean;
|
|
9
9
|
title?: string | Snippet;
|
|
10
10
|
extra?: Snippet;
|
|
11
|
+
cover?: Snippet;
|
|
12
|
+
actions?: Snippet;
|
|
13
|
+
headerStyle?: string;
|
|
14
|
+
bodyStyle?: string;
|
|
11
15
|
};
|
|
12
16
|
declare const Card: import("svelte").Component<Props, {}, "ref">;
|
|
13
17
|
type Card = ReturnType<typeof Card>;
|
|
@@ -3,38 +3,86 @@
|
|
|
3
3
|
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
4
4
|
import CheckIcon from '@lucide/svelte/icons/check';
|
|
5
5
|
import MinusIcon from '@lucide/svelte/icons/minus';
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
|
|
8
|
+
export type CheckboxSize = "default" | "compact" | "small" | "mini" | "large";
|
|
9
|
+
|
|
10
|
+
let labelId = `svadmin-cb-${Math.random().toString(36).slice(2, 9)}`;
|
|
6
11
|
|
|
7
12
|
let {
|
|
8
13
|
ref = $bindable(null),
|
|
9
14
|
checked = $bindable(false),
|
|
15
|
+
defaultChecked,
|
|
10
16
|
indeterminate = $bindable(false),
|
|
17
|
+
defaultIndeterminate,
|
|
11
18
|
size = "default",
|
|
12
19
|
class: className,
|
|
20
|
+
children: childrenProp,
|
|
21
|
+
onchange,
|
|
22
|
+
onChange,
|
|
13
23
|
...restProps
|
|
14
24
|
}: Omit<WithoutChildrenOrChild<CheckboxPrimitive.RootProps>, "size"> & {
|
|
15
|
-
size?:
|
|
25
|
+
size?: CheckboxSize;
|
|
26
|
+
defaultChecked?: boolean;
|
|
27
|
+
defaultIndeterminate?: boolean;
|
|
28
|
+
children?: Snippet;
|
|
29
|
+
onchange?: (checked: boolean) => void;
|
|
30
|
+
onChange?: (checked: boolean) => void;
|
|
16
31
|
} = $props();
|
|
32
|
+
|
|
33
|
+
let initialized = false;
|
|
34
|
+
$effect(() => {
|
|
35
|
+
if (!initialized) {
|
|
36
|
+
initialized = true;
|
|
37
|
+
if (defaultChecked !== undefined && !checked) checked = defaultChecked;
|
|
38
|
+
if (defaultIndeterminate !== undefined && !indeterminate) indeterminate = defaultIndeterminate;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const normalizedSize = $derived(
|
|
43
|
+
size === "small" || size === "mini" ? "compact" : size === "large" ? "default" : size
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
function handleCheckedChange(val: boolean | "indeterminate") {
|
|
47
|
+
const isChecked = val === true;
|
|
48
|
+
restProps.onCheckedChange?.(val === true);
|
|
49
|
+
onChange?.(isChecked);
|
|
50
|
+
onchange?.(isChecked);
|
|
51
|
+
}
|
|
17
52
|
</script>
|
|
18
53
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
{#snippet checkboxControl()}
|
|
55
|
+
<CheckboxPrimitive.Root
|
|
56
|
+
bind:ref
|
|
57
|
+
data-slot="checkbox"
|
|
58
|
+
data-size={normalizedSize}
|
|
59
|
+
class={cn("svadmin-checkbox", !childrenProp && className)}
|
|
60
|
+
bind:checked
|
|
61
|
+
bind:indeterminate
|
|
62
|
+
aria-labelledby={childrenProp && !restProps["aria-label"] ? labelId : undefined}
|
|
63
|
+
{...restProps}
|
|
64
|
+
onCheckedChange={handleCheckedChange}
|
|
65
|
+
>
|
|
66
|
+
{#snippet children({ checked, indeterminate })}
|
|
67
|
+
<div
|
|
68
|
+
data-slot="checkbox-indicator"
|
|
69
|
+
class="svadmin-checkbox-indicator"
|
|
70
|
+
>
|
|
71
|
+
{#if checked}
|
|
72
|
+
<CheckIcon />
|
|
73
|
+
{:else if indeterminate}
|
|
74
|
+
<MinusIcon />
|
|
75
|
+
{/if}
|
|
76
|
+
</div>
|
|
77
|
+
{/snippet}
|
|
78
|
+
</CheckboxPrimitive.Root>
|
|
79
|
+
{/snippet}
|
|
80
|
+
|
|
81
|
+
{#if childrenProp}
|
|
82
|
+
<label class={cn("svadmin-checkbox-wrapper inline-flex items-center gap-2 cursor-pointer select-none text-sm text-foreground", className)}>
|
|
83
|
+
{@render checkboxControl()}
|
|
84
|
+
<span id={labelId} class="svadmin-checkbox-label">{@render childrenProp()}</span>
|
|
85
|
+
</label>
|
|
86
|
+
{:else}
|
|
87
|
+
{@render checkboxControl()}
|
|
88
|
+
{/if}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { Checkbox as CheckboxPrimitive } from "bits-ui";
|
|
2
2
|
import { type WithoutChildrenOrChild } from "../../../utils.js";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
export type CheckboxSize = "default" | "compact" | "small" | "mini" | "large";
|
|
3
5
|
type $$ComponentProps = Omit<WithoutChildrenOrChild<CheckboxPrimitive.RootProps>, "size"> & {
|
|
4
|
-
size?:
|
|
6
|
+
size?: CheckboxSize;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
defaultIndeterminate?: boolean;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
onchange?: (checked: boolean) => void;
|
|
11
|
+
onChange?: (checked: boolean) => void;
|
|
5
12
|
};
|
|
6
13
|
declare const Checkbox: import("svelte").Component<$$ComponentProps, {}, "ref" | "checked" | "indeterminate">;
|
|
7
14
|
type Checkbox = ReturnType<typeof Checkbox>;
|