sveltacular 1.0.13 → 1.0.15
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/README.md +2 -3
- package/dist/forms/check-box/check-box.svelte +3 -3
- package/dist/forms/dimension-box/dimension-box.svelte +18 -3
- package/dist/forms/dimension-box/dimension-box.svelte.d.ts +4 -0
- package/dist/forms/file-area/file-area.svelte +2 -2
- package/dist/forms/info-box/info-box.svelte +2 -2
- package/dist/forms/list-box/list-box.svelte +2 -2
- package/dist/forms/money-box/money-box.svelte +23 -3
- package/dist/forms/money-box/money-box.svelte.d.ts +5 -0
- package/dist/forms/number-range-box/number-range-box.svelte +20 -4
- package/dist/forms/number-range-box/number-range-box.svelte.d.ts +4 -0
- package/dist/forms/radio-group/radio-box.svelte +2 -2
- package/dist/forms/text-box/text-box.svelte +2 -2
- package/dist/generic/email/email.svelte +2 -2
- package/dist/generic/menu/menu.svelte +3 -3
- package/dist/generic/phone/phone.svelte +3 -4
- package/dist/icons/icon-data.d.ts +28 -0
- package/dist/icons/icon-data.js +621 -0
- package/dist/icons/icon.svelte +164 -0
- package/dist/icons/icon.svelte.d.ts +13 -0
- package/dist/icons/index.d.ts +2 -13
- package/dist/icons/index.js +1 -13
- package/dist/icons/types.d.ts +4 -0
- package/dist/icons/types.js +1 -0
- package/dist/images/index.d.ts +0 -1
- package/dist/images/index.js +0 -1
- package/dist/layout/main/main.svelte +2 -2
- package/dist/navigation/accordion/accordion.svelte +2 -2
- package/dist/navigation/app-bar/app-bar.svelte +1 -0
- package/dist/navigation/app-bar/app-branding.svelte +4 -3
- package/dist/navigation/app-bar/app-logo.svelte +8 -5
- package/dist/navigation/app-bar/app-nav-item.svelte +48 -1
- package/dist/navigation/app-bar/app-nav.svelte +2 -2
- package/dist/navigation/breadcrumbs/breadcrumbs.svelte +2 -2
- package/dist/navigation/context-menu/context-menu-item.svelte +2 -2
- package/dist/navigation/dropdown-button/dropdown-button.svelte +2 -2
- package/dist/navigation/tabs/tab-group.svelte +206 -94
- package/dist/navigation/tabs/tab.svelte +3 -4
- package/dist/tables/data-grid.svelte +2 -2
- package/dist/tables/table-header-cell.svelte +21 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -181,9 +181,8 @@ npm i sveltacular
|
|
|
181
181
|
### Images & Icons
|
|
182
182
|
|
|
183
183
|
- **Image** - Image component with lazy loading
|
|
184
|
-
- **Icon** -
|
|
185
|
-
-
|
|
186
|
-
- Built-in icons: AngleRightIcon, AngleUpIcon, CheckIcon, CopyIcon, EnvelopeIcon, FolderOpenIcon, HamburgerIcon, HomeIcon, LinkIcon, MobilePhoneIcon, PhoneIcon, UploadIcon
|
|
184
|
+
- **Icon** - Unified icon component with type-safe icon types, CSS mask support, and external image support
|
|
185
|
+
- Built-in icon types: `angle-right`, `angle-up`, `check`, `copy`, `envelope`, `folder-open`, `hamburger`, `home`, `link`, `mobile-phone`, `phone`, `upload`
|
|
187
186
|
|
|
188
187
|
### Data
|
|
189
188
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
|
-
import
|
|
4
|
+
import Icon from '../../icons/icon.svelte';
|
|
5
5
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
6
6
|
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
7
7
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
{required}
|
|
59
59
|
/>
|
|
60
60
|
<span class="checkbox">
|
|
61
|
-
<span class="checkmark"><
|
|
61
|
+
<span class="checkmark"><Icon type="check" size="sm" fill="#fff" mask /></span>
|
|
62
62
|
</span>
|
|
63
63
|
{#if children}
|
|
64
64
|
<div class="text">
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
{required}
|
|
85
85
|
/>
|
|
86
86
|
<span class="checkbox">
|
|
87
|
-
<span class="checkmark"
|
|
87
|
+
<span class="checkmark"> <Icon type="check" size="sm" fill="#fff" mask /></span>
|
|
88
88
|
</span>
|
|
89
89
|
{#if children}
|
|
90
90
|
<div class="text">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { roundToDecimals } from '../../helpers/round-to-decimals.js';
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
|
-
import FormField from '../form-field/form-field.svelte';
|
|
4
|
+
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
5
5
|
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
6
6
|
|
|
7
7
|
const baseId = uniqueId();
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
required = false,
|
|
24
24
|
size = 'full' as FormFieldSizeOptions,
|
|
25
25
|
label = undefined as string | undefined,
|
|
26
|
+
helperText = undefined as string | undefined,
|
|
27
|
+
feedback = undefined as FormFieldFeedback | undefined,
|
|
28
|
+
disabled = false,
|
|
26
29
|
onChange = undefined as ((value: (number | null)[]) => void) | undefined
|
|
27
30
|
}: {
|
|
28
31
|
dimensions?: string[];
|
|
@@ -36,6 +39,9 @@
|
|
|
36
39
|
required?: boolean;
|
|
37
40
|
size?: FormFieldSizeOptions;
|
|
38
41
|
label?: string;
|
|
42
|
+
helperText?: string;
|
|
43
|
+
feedback?: FormFieldFeedback;
|
|
44
|
+
disabled?: boolean;
|
|
39
45
|
onChange?: ((value: (number | null)[]) => void) | undefined;
|
|
40
46
|
} = $props();
|
|
41
47
|
|
|
@@ -97,13 +103,15 @@
|
|
|
97
103
|
const getPlaceholder = (dimension: string) => {
|
|
98
104
|
return dimension;
|
|
99
105
|
};
|
|
106
|
+
|
|
107
|
+
let hasError = $derived(!!feedback?.isError);
|
|
100
108
|
</script>
|
|
101
109
|
|
|
102
|
-
<FormField {size} {label} id={getDimensionId(0)} {required}>
|
|
110
|
+
<FormField {size} {label} id={getDimensionId(0)} {required} {disabled} {helperText} {feedback}>
|
|
103
111
|
<div class="dimension-inputs">
|
|
104
112
|
{#each dimensions as dimension, index}
|
|
105
113
|
<div class="input-group">
|
|
106
|
-
<div class="input">
|
|
114
|
+
<div class="input {disabled ? 'disabled' : ''}" class:error={hasError}>
|
|
107
115
|
{#if prefix}
|
|
108
116
|
<span class="prefix">{prefix}</span>
|
|
109
117
|
{/if}
|
|
@@ -119,6 +127,7 @@
|
|
|
119
127
|
oninput={(e) => onInput(e, index)}
|
|
120
128
|
onkeypress={onKeyPress}
|
|
121
129
|
{required}
|
|
130
|
+
{disabled}
|
|
122
131
|
/>
|
|
123
132
|
{#if suffix}
|
|
124
133
|
<span class="suffix">{suffix}</span>
|
|
@@ -169,6 +178,12 @@
|
|
|
169
178
|
user-select: none;
|
|
170
179
|
white-space: nowrap;
|
|
171
180
|
}
|
|
181
|
+
.input.disabled {
|
|
182
|
+
opacity: 0.5;
|
|
183
|
+
}
|
|
184
|
+
.input.error {
|
|
185
|
+
border-color: var(--color-error, #dc3545);
|
|
186
|
+
}
|
|
172
187
|
.input input {
|
|
173
188
|
background-color: transparent;
|
|
174
189
|
border: none;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
1
2
|
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
2
3
|
type $$ComponentProps = {
|
|
3
4
|
dimensions?: string[];
|
|
@@ -11,6 +12,9 @@ type $$ComponentProps = {
|
|
|
11
12
|
required?: boolean;
|
|
12
13
|
size?: FormFieldSizeOptions;
|
|
13
14
|
label?: string;
|
|
15
|
+
helperText?: string;
|
|
16
|
+
feedback?: FormFieldFeedback;
|
|
17
|
+
disabled?: boolean;
|
|
14
18
|
onChange?: ((value: (number | null)[]) => void) | undefined;
|
|
15
19
|
};
|
|
16
20
|
declare const DimensionBox: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import
|
|
3
|
+
import Icon from '../../icons/icon.svelte';
|
|
4
4
|
|
|
5
5
|
type SelectFilesTarget = null | { files: FileList | null | undefined };
|
|
6
6
|
type DroppedFiles = FileList | File[];
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
ondragexit={dragStop}
|
|
94
94
|
>
|
|
95
95
|
<input type="file" id="upload-button" accept="image/*" onchange={selectFiles} {disabled} />
|
|
96
|
-
<div class="icon"><
|
|
96
|
+
<div class="icon"><Icon type="upload" size="lg" /></div>
|
|
97
97
|
<div class="text">
|
|
98
98
|
{#if children}
|
|
99
99
|
{@render children?.()}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Icon from '../../icons/icon.svelte';
|
|
3
3
|
import type { FormFieldSizeOptions } from '../../index.js';
|
|
4
4
|
import FormField from '../form-field/form-field.svelte';
|
|
5
5
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="input">
|
|
21
21
|
{#if href}
|
|
22
22
|
<span class="icon">
|
|
23
|
-
<
|
|
23
|
+
<Icon type="link" size="sm" />
|
|
24
24
|
</span>
|
|
25
25
|
<a {href} class="text">{value}</a>
|
|
26
26
|
{:else}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
4
4
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
5
5
|
import Menu from '../../generic/menu/menu.svelte';
|
|
6
|
-
import
|
|
6
|
+
import Icon from '../../icons/icon.svelte';
|
|
7
7
|
import debounce from '../../helpers/debounce.js';
|
|
8
8
|
import { browser } from '$app/environment';
|
|
9
9
|
import { onMount, untrack } from 'svelte';
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
aria-label={open ? 'Close options' : 'Open options'}
|
|
312
312
|
tabindex="-1"
|
|
313
313
|
>
|
|
314
|
-
<
|
|
314
|
+
<Icon type="angle-up" size="sm" />
|
|
315
315
|
</button>
|
|
316
316
|
{#if text && isSearchable}
|
|
317
317
|
<button
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { uniqueId, type FormFieldSizeOptions } from '../../index.js';
|
|
3
|
-
import FormField from '../form-field/form-field.svelte';
|
|
3
|
+
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
4
4
|
import { untrack } from 'svelte';
|
|
5
5
|
|
|
6
6
|
const id = uniqueId();
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
units = 'ones' as 'ones' | 'cents',
|
|
17
17
|
min = 0,
|
|
18
18
|
max = null as number | null,
|
|
19
|
+
required = false,
|
|
20
|
+
helperText = undefined as string | undefined,
|
|
21
|
+
feedback = undefined as FormFieldFeedback | undefined,
|
|
22
|
+
disabled = false,
|
|
19
23
|
onChange = undefined,
|
|
20
24
|
label = undefined
|
|
21
25
|
}: {
|
|
@@ -29,6 +33,10 @@
|
|
|
29
33
|
units?: 'ones' | 'cents';
|
|
30
34
|
min?: number;
|
|
31
35
|
max?: number | null;
|
|
36
|
+
required?: boolean;
|
|
37
|
+
helperText?: string;
|
|
38
|
+
feedback?: FormFieldFeedback;
|
|
39
|
+
disabled?: boolean;
|
|
32
40
|
onChange?: ((value: number | null) => void) | undefined;
|
|
33
41
|
label?: string;
|
|
34
42
|
} = $props();
|
|
@@ -217,10 +225,12 @@
|
|
|
217
225
|
cents = String(centValue).padStart(2, '0');
|
|
218
226
|
onChange?.(value);
|
|
219
227
|
};
|
|
228
|
+
|
|
229
|
+
let hasError = $derived(!!feedback?.isError);
|
|
220
230
|
</script>
|
|
221
231
|
|
|
222
|
-
<FormField {size} {label} {id}>
|
|
223
|
-
<div class="input {currency}" class:allowCents {id}>
|
|
232
|
+
<FormField {size} {label} {id} {required} {disabled} {helperText} {feedback}>
|
|
233
|
+
<div class="input {currency}" class:allowCents class:disabled class:error={hasError} {id}>
|
|
224
234
|
{#if prefix}
|
|
225
235
|
<span class="prefix">{prefix}</span>
|
|
226
236
|
{/if}
|
|
@@ -240,6 +250,8 @@
|
|
|
240
250
|
name="dollars"
|
|
241
251
|
id="{id}-dollars"
|
|
242
252
|
inputmode="numeric"
|
|
253
|
+
{required}
|
|
254
|
+
{disabled}
|
|
243
255
|
/>
|
|
244
256
|
{#if allowCents}
|
|
245
257
|
<span class="separator">.</span>
|
|
@@ -258,6 +270,8 @@
|
|
|
258
270
|
name="cents"
|
|
259
271
|
id="{id}-cents"
|
|
260
272
|
inputmode="numeric"
|
|
273
|
+
{required}
|
|
274
|
+
{disabled}
|
|
261
275
|
/>
|
|
262
276
|
{/if}
|
|
263
277
|
|
|
@@ -286,6 +300,12 @@
|
|
|
286
300
|
user-select: none;
|
|
287
301
|
white-space: nowrap;
|
|
288
302
|
}
|
|
303
|
+
.input.disabled {
|
|
304
|
+
opacity: 0.5;
|
|
305
|
+
}
|
|
306
|
+
.input.error {
|
|
307
|
+
border-color: var(--color-error, #dc3545);
|
|
308
|
+
}
|
|
289
309
|
.input input {
|
|
290
310
|
background-color: transparent;
|
|
291
311
|
border: none;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type FormFieldSizeOptions } from '../../index.js';
|
|
2
|
+
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
2
3
|
type $$ComponentProps = {
|
|
3
4
|
value?: number | null;
|
|
4
5
|
prefix?: string;
|
|
@@ -10,6 +11,10 @@ type $$ComponentProps = {
|
|
|
10
11
|
units?: 'ones' | 'cents';
|
|
11
12
|
min?: number;
|
|
12
13
|
max?: number | null;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
helperText?: string;
|
|
16
|
+
feedback?: FormFieldFeedback;
|
|
17
|
+
disabled?: boolean;
|
|
13
18
|
onChange?: ((value: number | null) => void) | undefined;
|
|
14
19
|
label?: string;
|
|
15
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { roundToDecimals } from '../../helpers/round-to-decimals.js';
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
|
-
import FormField from '../form-field/form-field.svelte';
|
|
4
|
+
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
5
5
|
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
6
6
|
|
|
7
7
|
const minId = uniqueId();
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
required = false,
|
|
23
23
|
size = 'full' as FormFieldSizeOptions,
|
|
24
24
|
label = undefined as string | undefined,
|
|
25
|
+
helperText = undefined as string | undefined,
|
|
26
|
+
feedback = undefined as FormFieldFeedback | undefined,
|
|
27
|
+
disabled = false,
|
|
25
28
|
onChange = undefined as ((minValue: number | null, maxValue: number | null) => void) | undefined
|
|
26
29
|
}: {
|
|
27
30
|
minValue?: number | null;
|
|
@@ -38,6 +41,9 @@
|
|
|
38
41
|
required?: boolean;
|
|
39
42
|
size?: FormFieldSizeOptions;
|
|
40
43
|
label?: string;
|
|
44
|
+
helperText?: string;
|
|
45
|
+
feedback?: FormFieldFeedback;
|
|
46
|
+
disabled?: boolean;
|
|
41
47
|
onChange?: ((minValue: number | null, maxValue: number | null) => void) | undefined;
|
|
42
48
|
} = $props();
|
|
43
49
|
|
|
@@ -104,12 +110,14 @@
|
|
|
104
110
|
if (!isAllowed) return e.preventDefault();
|
|
105
111
|
if (isDecimal && !allowDecimals) return e.preventDefault();
|
|
106
112
|
};
|
|
113
|
+
|
|
114
|
+
let hasError = $derived(!!feedback?.isError);
|
|
107
115
|
</script>
|
|
108
116
|
|
|
109
|
-
<FormField {size} {label} id={minId} {required}>
|
|
117
|
+
<FormField {size} {label} id={minId} {required} {disabled} {helperText} {feedback}>
|
|
110
118
|
<div class="number-range-inputs">
|
|
111
119
|
<div class="input-group">
|
|
112
|
-
<div class="input">
|
|
120
|
+
<div class="input {disabled ? 'disabled' : ''}" class:error={hasError}>
|
|
113
121
|
{#if prefix}
|
|
114
122
|
<span class="prefix">{prefix}</span>
|
|
115
123
|
{/if}
|
|
@@ -125,6 +133,7 @@
|
|
|
125
133
|
oninput={(e) => onInput(e, true)}
|
|
126
134
|
onkeypress={(e) => onKeyPress(e, true)}
|
|
127
135
|
{required}
|
|
136
|
+
{disabled}
|
|
128
137
|
/>
|
|
129
138
|
{#if suffix}
|
|
130
139
|
<span class="suffix">{suffix}</span>
|
|
@@ -132,7 +141,7 @@
|
|
|
132
141
|
</div>
|
|
133
142
|
</div>
|
|
134
143
|
<div class="input-group">
|
|
135
|
-
<div class="input">
|
|
144
|
+
<div class="input {disabled ? 'disabled' : ''}" class:error={hasError}>
|
|
136
145
|
{#if prefix}
|
|
137
146
|
<span class="prefix">{prefix}</span>
|
|
138
147
|
{/if}
|
|
@@ -148,6 +157,7 @@
|
|
|
148
157
|
oninput={(e) => onInput(e, false)}
|
|
149
158
|
onkeypress={(e) => onKeyPress(e, false)}
|
|
150
159
|
{required}
|
|
160
|
+
{disabled}
|
|
151
161
|
/>
|
|
152
162
|
{#if suffix}
|
|
153
163
|
<span class="suffix">{suffix}</span>
|
|
@@ -185,6 +195,12 @@
|
|
|
185
195
|
user-select: none;
|
|
186
196
|
white-space: nowrap;
|
|
187
197
|
}
|
|
198
|
+
.input.disabled {
|
|
199
|
+
opacity: 0.5;
|
|
200
|
+
}
|
|
201
|
+
.input.error {
|
|
202
|
+
border-color: var(--color-error, #dc3545);
|
|
203
|
+
}
|
|
188
204
|
.input input {
|
|
189
205
|
background-color: transparent;
|
|
190
206
|
border: none;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
1
2
|
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
2
3
|
type $$ComponentProps = {
|
|
3
4
|
minValue?: number | null;
|
|
@@ -14,6 +15,9 @@ type $$ComponentProps = {
|
|
|
14
15
|
required?: boolean;
|
|
15
16
|
size?: FormFieldSizeOptions;
|
|
16
17
|
label?: string;
|
|
18
|
+
helperText?: string;
|
|
19
|
+
feedback?: FormFieldFeedback;
|
|
20
|
+
disabled?: boolean;
|
|
17
21
|
onChange?: ((minValue: number | null, maxValue: number | null) => void) | undefined;
|
|
18
22
|
};
|
|
19
23
|
declare const NumberRangeBox: import("svelte").Component<$$ComponentProps, {}, "minValue" | "maxValue">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
|
-
import
|
|
4
|
+
import Icon from '../../icons/icon.svelte';
|
|
5
5
|
|
|
6
6
|
type RadioValue = string | number | boolean | undefined | null;
|
|
7
7
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
onchange={() => onChange?.(String(value || ''))}
|
|
33
33
|
/>
|
|
34
34
|
<span class="checkbox">
|
|
35
|
-
<span class="checkmark"><
|
|
35
|
+
<span class="checkmark"><Icon type="check" size="sm" /></span>
|
|
36
36
|
</span>
|
|
37
37
|
{#if children}
|
|
38
38
|
<div class="text">
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
4
|
import { animateShake, animateScaleIn } from '../../helpers/animations.js';
|
|
5
5
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
6
|
-
import
|
|
6
|
+
import Icon from '../../icons/icon.svelte';
|
|
7
7
|
import type { AllowedTextInputTypes, FormFieldSizeOptions } from '../../types/form.js';
|
|
8
8
|
|
|
9
9
|
const id = uniqueId();
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
</div>
|
|
187
187
|
{:else if hasSuccess}
|
|
188
188
|
<div class="success-indicator" bind:this={successIconElement}>
|
|
189
|
-
<
|
|
189
|
+
<Icon type="check" size="sm" />
|
|
190
190
|
</div>
|
|
191
191
|
{/if}
|
|
192
192
|
{#if suffix}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Icon from '../../icons/icon.svelte';
|
|
3
3
|
|
|
4
4
|
let { value }: { value: string } = $props();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<a href="mailto:{value}" title="Email Address">
|
|
8
8
|
<span class="icon">
|
|
9
|
-
<
|
|
9
|
+
<Icon type="envelope" size="sm" />
|
|
10
10
|
</span>
|
|
11
11
|
<span class="address">
|
|
12
12
|
{value}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Icon from '../../icons/icon.svelte';
|
|
3
3
|
import type { FormFieldSizeOptions, MenuOption } from '../../index.js';
|
|
4
4
|
import FlexItem from '../../layout/flex-item.svelte';
|
|
5
5
|
import FlexRow from '../../layout/flex-row.svelte';
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
</FlexItem>
|
|
124
124
|
<FlexItem>
|
|
125
125
|
{#if item.value === value}
|
|
126
|
-
<span class="check" aria-hidden="true"><
|
|
126
|
+
<span class="check" aria-hidden="true"><Icon type="check" size="sm" /></span>
|
|
127
127
|
{/if}
|
|
128
128
|
</FlexItem>
|
|
129
129
|
</FlexRow>
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
</FlexItem>
|
|
157
157
|
<FlexItem>
|
|
158
158
|
{#if item.value === value}
|
|
159
|
-
<span class="check" aria-hidden="true"><
|
|
159
|
+
<span class="check" aria-hidden="true"><Icon type="check" size="sm" /></span>
|
|
160
160
|
{/if}
|
|
161
161
|
</FlexItem>
|
|
162
162
|
</FlexRow>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { capitalize } from '../../helpers/capitalize.js';
|
|
3
|
-
import
|
|
4
|
-
import PhoneIcon from '../../icons/phone-icon.svelte';
|
|
3
|
+
import Icon from '../../icons/icon.svelte';
|
|
5
4
|
|
|
6
5
|
let {
|
|
7
6
|
value,
|
|
@@ -33,9 +32,9 @@
|
|
|
33
32
|
<a href="{protocol}:{phoneNumberDigits}" title={capitalize(type)}>
|
|
34
33
|
<span class="icon">
|
|
35
34
|
{#if isCellPhone}
|
|
36
|
-
<
|
|
35
|
+
<Icon type="mobile-phone" size="sm" />
|
|
37
36
|
{:else}
|
|
38
|
-
<
|
|
37
|
+
<Icon type="phone" size="sm" />
|
|
39
38
|
{/if}
|
|
40
39
|
</span>
|
|
41
40
|
<span class="number">
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IconType } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* SVG path element data structure
|
|
4
|
+
*/
|
|
5
|
+
export interface IconPathData {
|
|
6
|
+
d?: string;
|
|
7
|
+
stroke?: string;
|
|
8
|
+
'stroke-linecap'?: string;
|
|
9
|
+
'stroke-linejoin'?: string;
|
|
10
|
+
'stroke-width'?: string | number;
|
|
11
|
+
fill?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Icon data structure
|
|
15
|
+
*/
|
|
16
|
+
export interface IconData {
|
|
17
|
+
viewBox: string;
|
|
18
|
+
paths: IconPathData[];
|
|
19
|
+
fill: 'none' | 'currentColor';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Registry of all icon data
|
|
23
|
+
*/
|
|
24
|
+
export declare const iconRegistry: Record<IconType, IconData>;
|
|
25
|
+
/**
|
|
26
|
+
* Get icon data for a given icon type
|
|
27
|
+
*/
|
|
28
|
+
export declare function getIconData(type: IconType): IconData;
|