ui-svelte 0.2.1 → 0.2.3
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/charts/ArcChart.svelte +3 -3
- package/dist/charts/ArcChart.svelte.d.ts +1 -1
- package/dist/charts/AreaChart.svelte +3 -3
- package/dist/charts/AreaChart.svelte.d.ts +1 -1
- package/dist/charts/BarChart.svelte +3 -3
- package/dist/charts/BarChart.svelte.d.ts +1 -1
- package/dist/charts/Candlestick.svelte +3 -3
- package/dist/charts/Candlestick.svelte.d.ts +1 -1
- package/dist/charts/LineChart.svelte +3 -3
- package/dist/charts/LineChart.svelte.d.ts +1 -1
- package/dist/charts/PieChart.svelte +3 -3
- package/dist/charts/PieChart.svelte.d.ts +1 -1
- package/dist/control/Button.svelte +2 -8
- package/dist/control/Button.svelte.d.ts +0 -2
- package/dist/control/IconButton.svelte +0 -3
- package/dist/control/IconButton.svelte.d.ts +0 -1
- package/dist/control/css/btn.css +0 -4
- package/dist/css/base.css +262 -45
- package/dist/css/utilities.css +0 -4
- package/dist/display/Accordion.svelte +3 -3
- package/dist/display/Accordion.svelte.d.ts +1 -1
- package/dist/display/Alert.svelte +0 -2
- package/dist/display/Card.svelte +4 -17
- package/dist/display/Card.svelte.d.ts +1 -3
- package/dist/display/Carousel.svelte +3 -3
- package/dist/display/Carousel.svelte.d.ts +1 -1
- package/dist/display/ChatBox.svelte +3 -3
- package/dist/display/ChatBox.svelte.d.ts +1 -1
- package/dist/display/Code.svelte +28 -11
- package/dist/display/Code.svelte.d.ts +5 -3
- package/dist/display/Collapsible.svelte +3 -3
- package/dist/display/Collapsible.svelte.d.ts +1 -1
- package/dist/display/Empty.svelte +11 -5
- package/dist/display/Marquee.svelte +3 -3
- package/dist/display/Marquee.svelte.d.ts +1 -1
- package/dist/display/Section.svelte +3 -3
- package/dist/display/Section.svelte.d.ts +1 -1
- package/dist/display/css/alert.css +1 -1
- package/dist/display/css/card.css +7 -126
- package/dist/display/css/code.css +7 -1
- package/dist/display/css/section.css +5 -1
- package/dist/form/ComboBox.svelte +17 -17
- package/dist/form/ComboBox.svelte.d.ts +2 -2
- package/dist/form/Select.svelte +3 -3
- package/dist/form/Select.svelte.d.ts +1 -1
- package/dist/form/TextField.svelte +4 -6
- package/dist/form/TextField.svelte.d.ts +2 -2
- package/dist/form/css/control.css +1 -1
- package/dist/hooks/use-search.svelte.d.ts +2 -1
- package/dist/index.css +2 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +5 -4
- package/dist/layout/AppBar.svelte +3 -3
- package/dist/layout/AppBar.svelte.d.ts +1 -1
- package/dist/layout/Footer.svelte +3 -3
- package/dist/layout/Footer.svelte.d.ts +1 -1
- package/dist/layout/Sidebar.svelte +4 -11
- package/dist/layout/Sidebar.svelte.d.ts +1 -1
- package/dist/navigation/BottomNav.svelte +80 -0
- package/dist/navigation/FooterGroup.svelte +51 -0
- package/dist/navigation/FooterGroup.svelte.d.ts +15 -0
- package/dist/{layout/FooterLinks.svelte → navigation/FooterNav.svelte} +2 -2
- package/dist/navigation/FooterNav.svelte.d.ts +11 -0
- package/dist/navigation/SideNav.svelte +17 -16
- package/dist/navigation/SideNav.svelte.d.ts +33 -0
- package/dist/navigation/Tabs.svelte +3 -3
- package/dist/navigation/Tabs.svelte.d.ts +1 -1
- package/dist/navigation/css/bottom-nav.css +134 -0
- package/dist/navigation/css/footer-group.css +27 -0
- package/dist/{layout/css/footer-links.css → navigation/css/footer-nav.css} +3 -3
- package/package.json +2 -2
- package/dist/layout/FooterLinks.svelte.d.ts +0 -11
- package/dist/navigation/BottomNav.svelte.d.ts +0 -26
- /package/dist/{types.d.ts → types.svelte.d.ts} +0 -0
- /package/dist/{types.js → types.svelte.js} +0 -0
package/dist/display/Code.svelte
CHANGED
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { codeToHtml } from 'shiki';
|
|
3
3
|
import { useClipboard } from '../hooks/use-clipboard.svelte.js';
|
|
4
|
-
import {
|
|
4
|
+
import { IconButton } from '../index.js';
|
|
5
5
|
import { Checkmark24RegularIcon, Copy24RegularIcon } from '../icons/index.js';
|
|
6
|
+
import { theme } from '../stores/theme.svelte.js';
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
8
9
|
code: string;
|
|
9
|
-
lang
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
lang: string;
|
|
11
|
+
lightTheme?: string;
|
|
12
|
+
darkTheme?: string;
|
|
13
|
+
disableCopy?: boolean;
|
|
14
|
+
hideLang?: boolean;
|
|
12
15
|
};
|
|
13
16
|
|
|
14
|
-
let {
|
|
17
|
+
let {
|
|
18
|
+
code,
|
|
19
|
+
lang,
|
|
20
|
+
lightTheme = 'catppuccin-latte',
|
|
21
|
+
darkTheme = 'catppuccin-frappe',
|
|
22
|
+
disableCopy,
|
|
23
|
+
hideLang
|
|
24
|
+
}: Props = $props();
|
|
15
25
|
|
|
16
26
|
let html: string = $state('');
|
|
17
27
|
let open = $state(false);
|
|
28
|
+
let hover = $state(false);
|
|
18
29
|
|
|
19
|
-
const generateCode = async (value: string) => {
|
|
30
|
+
const generateCode = async (value: string, currentTheme: string) => {
|
|
20
31
|
html = await codeToHtml(value, {
|
|
21
32
|
lang,
|
|
22
|
-
theme
|
|
33
|
+
theme: currentTheme
|
|
23
34
|
});
|
|
24
35
|
open = true;
|
|
25
36
|
};
|
|
26
37
|
|
|
27
38
|
$effect(() => {
|
|
28
|
-
|
|
39
|
+
const currentTheme = theme.isDark ? darkTheme : lightTheme;
|
|
40
|
+
generateCode(code, currentTheme);
|
|
29
41
|
});
|
|
30
42
|
|
|
31
43
|
const clipboard = useClipboard();
|
|
@@ -36,13 +48,18 @@
|
|
|
36
48
|
</script>
|
|
37
49
|
|
|
38
50
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
39
|
-
<div class="code">
|
|
51
|
+
<div class="code" onmouseenter={() => (hover = true)} onmouseleave={() => (hover = false)}>
|
|
40
52
|
{#if open}
|
|
41
|
-
{#if
|
|
53
|
+
{#if !hover && !hideLang}
|
|
54
|
+
<div class="code-info">
|
|
55
|
+
<div class="code-lang">{lang}</div>
|
|
56
|
+
</div>
|
|
57
|
+
{/if}
|
|
58
|
+
{#if hover && !disableCopy}
|
|
42
59
|
<div class="code-info">
|
|
43
60
|
<IconButton
|
|
44
61
|
onclick={handleCopy}
|
|
45
|
-
variant="
|
|
62
|
+
variant="ghost"
|
|
46
63
|
size="sm"
|
|
47
64
|
icon={clipboard.copied ? Checkmark24RegularIcon : Copy24RegularIcon}
|
|
48
65
|
/>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
code: string;
|
|
3
|
-
lang
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
lang: string;
|
|
4
|
+
lightTheme?: string;
|
|
5
|
+
darkTheme?: string;
|
|
6
|
+
disableCopy?: boolean;
|
|
7
|
+
hideLang?: boolean;
|
|
6
8
|
};
|
|
7
9
|
declare const Code: import("svelte").Component<Props, {}, "">;
|
|
8
10
|
type Code = ReturnType<typeof Code>;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
defaultOpen?: boolean;
|
|
14
14
|
variant?: 'primary' | 'secondary' | 'muted' | 'outline';
|
|
15
|
-
|
|
15
|
+
rootClass?: string;
|
|
16
16
|
headerClass?: string;
|
|
17
17
|
contentClass?: string;
|
|
18
18
|
};
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
disabled = false,
|
|
25
25
|
defaultOpen = false,
|
|
26
26
|
variant = 'muted',
|
|
27
|
-
|
|
27
|
+
rootClass,
|
|
28
28
|
headerClass,
|
|
29
29
|
contentClass
|
|
30
30
|
}: Props = $props();
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
|
-
<div class={cn('collapsible', variants[variant],
|
|
47
|
+
<div class={cn('collapsible', variants[variant], rootClass, disabled && 'is-disabled')}>
|
|
48
48
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
49
49
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
50
50
|
<div class={cn('collapsible-header', headerClass, isOpen && 'is-open')} onclick={toggle}>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
href?: string;
|
|
8
8
|
onclick?: () => void;
|
|
9
9
|
};
|
|
10
|
-
let { type = 'template', class: className }: Props = $props();
|
|
10
|
+
let { type = 'template', class: className, title, description }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<div class="empty">
|
|
@@ -455,8 +455,14 @@
|
|
|
455
455
|
/>
|
|
456
456
|
</svg>
|
|
457
457
|
{/if}
|
|
458
|
-
|
|
459
|
-
<
|
|
460
|
-
|
|
461
|
-
|
|
458
|
+
{#if title || description}
|
|
459
|
+
<div class="column center">
|
|
460
|
+
{#if title}
|
|
461
|
+
<h6>{title}</h6>
|
|
462
|
+
{/if}
|
|
463
|
+
{#if description}
|
|
464
|
+
<p>{description}</p>
|
|
465
|
+
{/if}
|
|
466
|
+
</div>
|
|
467
|
+
{/if}
|
|
462
468
|
</div>
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
fade?: boolean;
|
|
18
18
|
fadeColor?: string;
|
|
19
19
|
gap?: string;
|
|
20
|
-
|
|
20
|
+
rootClass?: string;
|
|
21
21
|
itemClass?: string;
|
|
22
22
|
children?: Snippet;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const {
|
|
26
|
-
|
|
26
|
+
rootClass,
|
|
27
27
|
itemClass,
|
|
28
28
|
items = [],
|
|
29
29
|
speed = 'normal',
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
</script>
|
|
107
107
|
|
|
108
108
|
<div
|
|
109
|
-
class={cn('marquee', isVertical && 'is-vertical', fade && 'has-fade',
|
|
109
|
+
class={cn('marquee', isVertical && 'is-vertical', fade && 'has-fade', rootClass)}
|
|
110
110
|
bind:this={containerEl}
|
|
111
111
|
onmouseenter={handleMouseEnter}
|
|
112
112
|
onmouseleave={handleMouseLeave}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
|
-
|
|
6
|
+
rootClass?: string;
|
|
7
7
|
bodyClass?: string;
|
|
8
8
|
coverClass?: string;
|
|
9
9
|
overlayClass?: string;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const {
|
|
28
|
-
|
|
28
|
+
rootClass,
|
|
29
29
|
bodyClass,
|
|
30
30
|
coverClass,
|
|
31
31
|
overlayClass,
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
variantClasses[variant],
|
|
57
57
|
isSolid && 'is-solid',
|
|
58
58
|
isBoxed && 'boxed',
|
|
59
|
-
|
|
59
|
+
rootClass
|
|
60
60
|
)}
|
|
61
61
|
>
|
|
62
62
|
{#if cover}
|
|
@@ -8,75 +8,22 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.card.has-divider {
|
|
12
|
-
.card-header {
|
|
13
|
-
@apply border-b;
|
|
14
|
-
}
|
|
15
|
-
.card-footer {
|
|
16
|
-
@apply border-t;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.card.has-shadow {
|
|
21
|
-
@apply shadow-sm shadow-muted;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
11
|
.card.is-primary {
|
|
25
12
|
@apply bg-on-primary text-primary;
|
|
26
13
|
}
|
|
27
14
|
|
|
28
|
-
.card.is-primary.has-divider {
|
|
29
|
-
.card-header {
|
|
30
|
-
@apply border-primary;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.card-footer {
|
|
34
|
-
@apply border-primary;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
15
|
.card.is-primary.is-solid {
|
|
39
16
|
@apply bg-primary text-on-primary;
|
|
40
17
|
}
|
|
41
18
|
|
|
42
|
-
.card.is-primary.is-solid.has-divider {
|
|
43
|
-
.card-header {
|
|
44
|
-
@apply border-on-primary;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.card-footer {
|
|
48
|
-
@apply border-on-primary;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
19
|
.card.is-secondary {
|
|
53
20
|
@apply bg-on-secondary text-secondary;
|
|
54
21
|
}
|
|
55
22
|
|
|
56
|
-
.card.is-secondary.has-divider {
|
|
57
|
-
.card-header {
|
|
58
|
-
@apply border-secondary;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.card-footer {
|
|
62
|
-
@apply border-secondary;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
23
|
.card.is-secondary.is-solid {
|
|
67
24
|
@apply bg-secondary text-on-secondary;
|
|
68
25
|
}
|
|
69
26
|
|
|
70
|
-
.card.is-secondary.is-solid.has-divider {
|
|
71
|
-
.card-header {
|
|
72
|
-
@apply border-on-secondary;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.card-footer {
|
|
76
|
-
@apply border-on-secondary;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
27
|
.card.is-success {
|
|
81
28
|
@apply bg-on-success text-success;
|
|
82
29
|
}
|
|
@@ -85,16 +32,6 @@
|
|
|
85
32
|
@apply bg-success text-on-success;
|
|
86
33
|
}
|
|
87
34
|
|
|
88
|
-
.card.is-success.is-solid.has-divider {
|
|
89
|
-
.card-header {
|
|
90
|
-
@apply border-on-success;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.card-footer {
|
|
94
|
-
@apply border-on-success;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
35
|
.card.is-info {
|
|
99
36
|
@apply bg-on-info text-info;
|
|
100
37
|
}
|
|
@@ -103,16 +40,6 @@
|
|
|
103
40
|
@apply bg-info text-on-info;
|
|
104
41
|
}
|
|
105
42
|
|
|
106
|
-
.card.is-info.is-solid.has-divider {
|
|
107
|
-
.card-header {
|
|
108
|
-
@apply border-on-info;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.card-footer {
|
|
112
|
-
@apply border-on-info;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
43
|
.card.is-warning {
|
|
117
44
|
@apply bg-on-warning text-warning;
|
|
118
45
|
}
|
|
@@ -121,16 +48,6 @@
|
|
|
121
48
|
@apply bg-warning text-on-warning;
|
|
122
49
|
}
|
|
123
50
|
|
|
124
|
-
.card.is-warning.is-solid.has-divider {
|
|
125
|
-
.card-header {
|
|
126
|
-
@apply border-on-warning;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.card-footer {
|
|
130
|
-
@apply border-on-warning;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
51
|
.card.is-danger {
|
|
135
52
|
@apply bg-on-danger text-danger;
|
|
136
53
|
}
|
|
@@ -139,58 +56,18 @@
|
|
|
139
56
|
@apply bg-danger text-on-danger;
|
|
140
57
|
}
|
|
141
58
|
|
|
142
|
-
.card.is-danger.is-solid.has-divider {
|
|
143
|
-
.card-header {
|
|
144
|
-
@apply border-on-danger;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.card-footer {
|
|
148
|
-
@apply border-on-danger;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
59
|
.card.is-muted {
|
|
153
60
|
@apply bg-muted text-on-muted;
|
|
154
61
|
}
|
|
155
62
|
|
|
156
|
-
.card.is-muted.has-divider {
|
|
157
|
-
.card-header {
|
|
158
|
-
@apply border-on-muted;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.card-footer {
|
|
162
|
-
@apply border-on-muted;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
63
|
.card.is-muted.is-solid {
|
|
167
64
|
@apply bg-on-muted text-muted;
|
|
168
65
|
}
|
|
169
66
|
|
|
170
|
-
.card.is-muted.is-solid.has-divider {
|
|
171
|
-
.card-header {
|
|
172
|
-
@apply border-muted;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.card-footer {
|
|
176
|
-
@apply border-muted;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
67
|
.card.is-outlined {
|
|
181
68
|
@apply border border-muted;
|
|
182
69
|
}
|
|
183
70
|
|
|
184
|
-
.card.is-outlined.has-divider {
|
|
185
|
-
.card-header {
|
|
186
|
-
@apply border-muted;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.card-footer {
|
|
190
|
-
@apply border-muted;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
71
|
.card.is-surface {
|
|
195
72
|
@apply bg-surface text-on-surface;
|
|
196
73
|
}
|
|
@@ -218,14 +95,18 @@
|
|
|
218
95
|
}
|
|
219
96
|
|
|
220
97
|
.card-body {
|
|
221
|
-
@apply flex-1 w-full
|
|
98
|
+
@apply flex-1 w-full p-4 md:p-6;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.card-body:not(.prose) {
|
|
102
|
+
@apply column gap-4 md:gap-6;
|
|
222
103
|
}
|
|
223
104
|
|
|
224
105
|
.card-header {
|
|
225
|
-
@apply w-full flex justify-between items-center
|
|
106
|
+
@apply w-full flex justify-between items-center px-4 pt-4 gap-4 md:px-6 md:pt-6 md:gap-6;
|
|
226
107
|
}
|
|
227
108
|
|
|
228
109
|
.card-footer {
|
|
229
|
-
@apply w-full flex justify-between items-center
|
|
110
|
+
@apply w-full flex justify-between items-center px-4 pb-4 gap-4 md:px-6 md:pb-6 md:gap-6;
|
|
230
111
|
}
|
|
231
112
|
}
|
|
@@ -4,14 +4,20 @@
|
|
|
4
4
|
tab-size: 4;
|
|
5
5
|
-moz-tab-size: 4;
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
.code-content {
|
|
8
9
|
@apply size-full overflow-auto rounded-md;
|
|
9
10
|
background-color: inherit;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
.code-info {
|
|
13
|
-
@apply absolute top-2 right-2 flex justify-end items-center gap-2;
|
|
14
|
+
@apply absolute top-2 right-2 flex justify-end items-center gap-2 z-10;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.code-lang {
|
|
18
|
+
@apply text-sm font-medium text-on-muted;
|
|
14
19
|
}
|
|
20
|
+
|
|
15
21
|
.shiki {
|
|
16
22
|
@apply p-3 rounded-ui;
|
|
17
23
|
min-width: fit-content;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SearchState, SearchOption } from '../hooks/use-search.svelte.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
ArrowDown24RegularIcon,
|
|
5
|
+
Dismiss24RegularIcon,
|
|
6
|
+
DotsMoveIcon,
|
|
7
|
+
Search24RegularIcon
|
|
8
|
+
} from '../icons/index.js';
|
|
9
|
+
import { Avatar, Icon, Item, type IconData } from '../index.js';
|
|
5
10
|
import { cn } from '../utils/class-names.js';
|
|
6
11
|
import { onMount, tick } from 'svelte';
|
|
7
12
|
|
|
@@ -27,7 +32,7 @@
|
|
|
27
32
|
isSolid?: boolean;
|
|
28
33
|
isClearable?: boolean;
|
|
29
34
|
isDisabled?: boolean;
|
|
30
|
-
arrowIcon?:
|
|
35
|
+
arrowIcon?: IconData;
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
let {
|
|
@@ -52,7 +57,7 @@
|
|
|
52
57
|
isSolid,
|
|
53
58
|
isClearable = false,
|
|
54
59
|
isDisabled = false,
|
|
55
|
-
arrowIcon =
|
|
60
|
+
arrowIcon = ArrowDown24RegularIcon
|
|
56
61
|
}: Props = $props();
|
|
57
62
|
|
|
58
63
|
const variantClasses = {
|
|
@@ -356,13 +361,8 @@
|
|
|
356
361
|
</span>
|
|
357
362
|
{/if}
|
|
358
363
|
|
|
359
|
-
{#if selected?.src
|
|
360
|
-
<Avatar
|
|
361
|
-
src={selected.src}
|
|
362
|
-
name={selected.label}
|
|
363
|
-
icon={selected.icon as IconName}
|
|
364
|
-
size={avatarSizes[size]}
|
|
365
|
-
/>
|
|
364
|
+
{#if selected?.src}
|
|
365
|
+
<Avatar src={selected.src} name={selected.label} size={avatarSizes[size]} />
|
|
366
366
|
{/if}
|
|
367
367
|
|
|
368
368
|
<div class="control-selected">
|
|
@@ -386,10 +386,10 @@
|
|
|
386
386
|
onclick={handleClear}
|
|
387
387
|
aria-label="Clear selection"
|
|
388
388
|
>
|
|
389
|
-
<Icon
|
|
389
|
+
<Icon icon={Dismiss24RegularIcon} />
|
|
390
390
|
</button>
|
|
391
391
|
{/if}
|
|
392
|
-
<Icon
|
|
392
|
+
<Icon icon={arrowIcon} class={cn('control-arrow', isOpen && 'is-active')} />
|
|
393
393
|
</div>
|
|
394
394
|
</button>
|
|
395
395
|
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
|
|
400
400
|
<div class:is-active={isOpen} class="combo-box-popover" bind:this={contentEl} {style}>
|
|
401
401
|
<div class={cn('combo-box-search', variantClasses[variant])}>
|
|
402
|
-
<Icon
|
|
402
|
+
<Icon icon={Search24RegularIcon} class="combo-box-search-icon" />
|
|
403
403
|
<input
|
|
404
404
|
type="text"
|
|
405
405
|
class="combo-box-search-input"
|
|
@@ -410,7 +410,7 @@
|
|
|
410
410
|
|
|
411
411
|
{#if search.isLoading}
|
|
412
412
|
<div class="combo-box-loading">
|
|
413
|
-
<Icon
|
|
413
|
+
<Icon icon={DotsMoveIcon} class="combo-box-loading-spinner" />
|
|
414
414
|
<span>{loadingText}</span>
|
|
415
415
|
</div>
|
|
416
416
|
{:else if search.options.length === 0 && hasSearched}
|
|
@@ -421,7 +421,7 @@
|
|
|
421
421
|
<li>
|
|
422
422
|
<Item
|
|
423
423
|
label={item.label}
|
|
424
|
-
icon={item.icon as
|
|
424
|
+
icon={item.icon as IconData}
|
|
425
425
|
src={item.src}
|
|
426
426
|
description={item.description}
|
|
427
427
|
id={item.id}
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
|
|
439
439
|
{#if search.isLoadingMore}
|
|
440
440
|
<li class="combo-box-loading-more">
|
|
441
|
-
<Icon
|
|
441
|
+
<Icon icon={DotsMoveIcon} class="combo-box-loading-spinner" />
|
|
442
442
|
<span>{loadingMoreText}</span>
|
|
443
443
|
</li>
|
|
444
444
|
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SearchState, SearchOption } from '../hooks/use-search.svelte.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type IconData } from '../index.js';
|
|
3
3
|
type Props = {
|
|
4
4
|
search: SearchState;
|
|
5
5
|
value?: string | number | null;
|
|
@@ -22,7 +22,7 @@ type Props = {
|
|
|
22
22
|
isSolid?: boolean;
|
|
23
23
|
isClearable?: boolean;
|
|
24
24
|
isDisabled?: boolean;
|
|
25
|
-
arrowIcon?:
|
|
25
|
+
arrowIcon?: IconData;
|
|
26
26
|
};
|
|
27
27
|
declare const ComboBox: import("svelte").Component<Props, {}, "value" | "selected">;
|
|
28
28
|
type ComboBox = ReturnType<typeof ComboBox>;
|
package/dist/form/Select.svelte
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
variant?: 'primary' | 'secondary' | 'muted' | 'outlined' | 'line';
|
|
21
21
|
size?: 'sm' | 'md' | 'lg';
|
|
22
22
|
name?: string;
|
|
23
|
-
|
|
23
|
+
rootClass?: string;
|
|
24
24
|
label?: string;
|
|
25
25
|
isLabelActive?: boolean;
|
|
26
26
|
helpText?: string;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
let {
|
|
33
|
-
|
|
33
|
+
rootClass,
|
|
34
34
|
options = [],
|
|
35
35
|
value = $bindable(),
|
|
36
36
|
selected = $bindable(),
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
});
|
|
269
269
|
</script>
|
|
270
270
|
|
|
271
|
-
<div class={cn('field',
|
|
271
|
+
<div class={cn('field', rootClass)}>
|
|
272
272
|
<input type="text" {name} bind:value hidden />
|
|
273
273
|
|
|
274
274
|
{#if !isFloatLabel && label}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Icon } from '../index.js';
|
|
3
|
-
import type { IconData } from '../types.js';
|
|
2
|
+
import { Icon, type IconData } from '../index.js';
|
|
4
3
|
import { cn } from '../utils/class-names.js';
|
|
5
|
-
import type { Snippet } from 'svelte';
|
|
6
4
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
7
5
|
|
|
8
6
|
type Props = {
|
|
@@ -11,7 +9,7 @@
|
|
|
11
9
|
defaultValue?: string;
|
|
12
10
|
placeholder?: string;
|
|
13
11
|
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
14
|
-
|
|
12
|
+
rootClass?: string;
|
|
15
13
|
controlClass?: string;
|
|
16
14
|
startIcon?: IconData;
|
|
17
15
|
endIcon?: IconData;
|
|
@@ -41,7 +39,7 @@
|
|
|
41
39
|
placeholder,
|
|
42
40
|
autocomplete,
|
|
43
41
|
type = 'text',
|
|
44
|
-
|
|
42
|
+
rootClass,
|
|
45
43
|
controlClass,
|
|
46
44
|
startIcon,
|
|
47
45
|
endIcon,
|
|
@@ -95,7 +93,7 @@
|
|
|
95
93
|
});
|
|
96
94
|
</script>
|
|
97
95
|
|
|
98
|
-
<div class={cn('field',
|
|
96
|
+
<div class={cn('field', rootClass)}>
|
|
99
97
|
{#if !isFloatLabel && label}
|
|
100
98
|
<span class="field-label">{label}</span>
|
|
101
99
|
{/if}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IconData } from '../index.js';
|
|
2
2
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
3
|
type Props = {
|
|
4
4
|
el?: HTMLInputElement;
|
|
@@ -6,7 +6,7 @@ type Props = {
|
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
9
|
-
|
|
9
|
+
rootClass?: string;
|
|
10
10
|
controlClass?: string;
|
|
11
11
|
startIcon?: IconData;
|
|
12
12
|
endIcon?: IconData;
|