sveltacular 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +2 -3
  2. package/dist/forms/check-box/check-box.svelte +22 -12
  3. package/dist/forms/check-box/check-box.svelte.d.ts +1 -0
  4. package/dist/forms/dimension-box/dimension-box.svelte +18 -3
  5. package/dist/forms/dimension-box/dimension-box.svelte.d.ts +4 -0
  6. package/dist/forms/file-area/file-area.svelte +2 -2
  7. package/dist/forms/info-box/info-box.svelte +2 -2
  8. package/dist/forms/list-box/list-box.svelte +2 -2
  9. package/dist/forms/money-box/money-box.svelte +23 -3
  10. package/dist/forms/money-box/money-box.svelte.d.ts +5 -0
  11. package/dist/forms/number-range-box/number-range-box.svelte +20 -4
  12. package/dist/forms/number-range-box/number-range-box.svelte.d.ts +4 -0
  13. package/dist/forms/radio-group/radio-box.svelte +21 -26
  14. package/dist/forms/radio-group/radio-box.svelte.d.ts +1 -0
  15. package/dist/forms/text-box/text-box.svelte +2 -2
  16. package/dist/generic/email/email.svelte +2 -2
  17. package/dist/generic/menu/menu.svelte +3 -3
  18. package/dist/generic/phone/phone.svelte +3 -4
  19. package/dist/icons/icon-data.d.ts +28 -0
  20. package/dist/icons/icon-data.js +621 -0
  21. package/dist/icons/icon.svelte +164 -0
  22. package/dist/icons/icon.svelte.d.ts +13 -0
  23. package/dist/icons/index.d.ts +2 -13
  24. package/dist/icons/index.js +1 -13
  25. package/dist/icons/types.d.ts +4 -0
  26. package/dist/icons/types.js +1 -0
  27. package/dist/images/index.d.ts +0 -1
  28. package/dist/images/index.js +0 -1
  29. package/dist/layout/main/main.svelte +2 -2
  30. package/dist/navigation/accordion/accordion.svelte +2 -2
  31. package/dist/navigation/app-bar/app-bar.svelte +1 -0
  32. package/dist/navigation/app-bar/app-branding.svelte +4 -3
  33. package/dist/navigation/app-bar/app-logo.svelte +8 -5
  34. package/dist/navigation/app-bar/app-nav-item.svelte +48 -1
  35. package/dist/navigation/app-bar/app-nav.svelte +2 -2
  36. package/dist/navigation/breadcrumbs/breadcrumbs.svelte +2 -2
  37. package/dist/navigation/context-menu/context-menu-item.svelte +2 -2
  38. package/dist/navigation/dropdown-button/dropdown-button.svelte +2 -2
  39. package/dist/tables/data-grid.svelte +38 -14
  40. package/dist/tables/data-grid.svelte.d.ts +4 -4
  41. package/dist/tables/table-context.svelte.d.ts +9 -5
  42. package/dist/tables/table-context.svelte.js +59 -12
  43. package/dist/tables/table-header-cell.svelte +21 -12
  44. package/dist/tables/table-row.svelte +3 -39
  45. package/dist/tables/table-selection-cell.svelte +134 -0
  46. package/dist/tables/table-selection-cell.svelte.d.ts +8 -0
  47. package/dist/tables/table-selection-header-cell.svelte +103 -0
  48. package/dist/tables/table-selection-header-cell.svelte.d.ts +3 -0
  49. package/dist/tables/table.svelte +15 -9
  50. package/dist/tables/table.svelte.d.ts +4 -3
  51. 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** - Icon component
185
- - **SvgIcon** - SVG icon wrapper
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 CheckIcon from '../../icons/check-icon.svelte';
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
 
@@ -12,6 +12,7 @@
12
12
  name = undefined,
13
13
  onChange = undefined,
14
14
  label,
15
+ ariaLabel,
15
16
  children,
16
17
  size = 'full' as FormFieldSizeOptions,
17
18
  helperText = undefined,
@@ -25,6 +26,7 @@
25
26
  name?: string | undefined;
26
27
  onChange?: ((data: { isChecked: boolean; value: string }) => void) | undefined;
27
28
  label?: string;
29
+ ariaLabel?: string;
28
30
  children?: Snippet;
29
31
  size?: FormFieldSizeOptions;
30
32
  helperText?: string;
@@ -33,6 +35,9 @@
33
35
  inline?: boolean;
34
36
  } = $props();
35
37
 
38
+ // Use ariaLabel if provided, otherwise fall back to label for accessibility
39
+ let inputAriaLabel = $derived(ariaLabel ?? label);
40
+
36
41
  const id = uniqueId();
37
42
 
38
43
  const onChecked = (event: Event) => {
@@ -56,18 +61,21 @@
56
61
  bind:checked={isChecked}
57
62
  onchange={onChecked}
58
63
  {required}
64
+ aria-label={inputAriaLabel}
59
65
  />
60
66
  <span class="checkbox">
61
- <span class="checkmark"><CheckIcon /></span>
67
+ <span class="checkmark"><Icon type="check" size="sm" fill="#fff" mask /></span>
62
68
  </span>
63
- {#if children}
64
- <div class="text">
65
- {@render children()}
66
- </div>
67
- {:else if label}
68
- <div class="text">
69
- {label}
70
- </div>
69
+ {#if !ariaLabel}
70
+ {#if children}
71
+ <div class="text">
72
+ {@render children()}
73
+ </div>
74
+ {:else if label}
75
+ <div class="text">
76
+ {label}
77
+ </div>
78
+ {/if}
71
79
  {/if}
72
80
  </label>
73
81
  {:else}
@@ -82,9 +90,10 @@
82
90
  bind:checked={isChecked}
83
91
  onchange={onChecked}
84
92
  {required}
93
+ aria-label={inputAriaLabel}
85
94
  />
86
95
  <span class="checkbox">
87
- <span class="checkmark"><CheckIcon /></span>
96
+ <span class="checkmark"> <Icon type="check" size="sm" fill="#fff" mask /></span>
88
97
  </span>
89
98
  {#if children}
90
99
  <div class="text">
@@ -123,7 +132,7 @@
123
132
  user-select: none;
124
133
  }
125
134
  .checkbox-label .checkbox .checkmark {
126
- display: block;
135
+ display: none;
127
136
  position: absolute;
128
137
  top: 0;
129
138
  left: 0;
@@ -145,6 +154,7 @@
145
154
  border-color: var(--form-input-border);
146
155
  }
147
156
  .checkbox-label input:checked + .checkbox .checkmark {
157
+ display: block;
148
158
  width: 100%;
149
159
  height: 100%;
150
160
  }</style>
@@ -11,6 +11,7 @@ type $$ComponentProps = {
11
11
  value: string;
12
12
  }) => void) | undefined;
13
13
  label?: string;
14
+ ariaLabel?: string;
14
15
  children?: Snippet;
15
16
  size?: FormFieldSizeOptions;
16
17
  helperText?: string;
@@ -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 UploadIcon from '../../icons/upload-icon.svelte';
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"><UploadIcon /></div>
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 LinkIcon from '../../icons/link-icon.svelte';
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
- <LinkIcon />
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 AngleUpIcon from '../../icons/angle-up-icon.svelte';
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
- <AngleUpIcon />
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 CheckIcon from '../../icons/check-icon.svelte';
4
+ import Icon from '../../icons/icon.svelte';
5
5
 
6
6
  type RadioValue = string | number | boolean | undefined | null;
7
7
 
@@ -9,12 +9,14 @@
9
9
  value = undefined as RadioValue,
10
10
  group = $bindable(undefined as string | undefined),
11
11
  disabled = false,
12
+ ariaLabel,
12
13
  children = undefined,
13
14
  onChange = undefined
14
15
  }: {
15
16
  value?: RadioValue;
16
17
  group?: string | undefined;
17
18
  disabled?: boolean;
19
+ ariaLabel?: string;
18
20
  children?: Snippet;
19
21
  onChange?: ((value: string) => void) | undefined;
20
22
  } = $props();
@@ -29,12 +31,13 @@
29
31
  {value}
30
32
  {disabled}
31
33
  {id}
34
+ aria-label={ariaLabel}
32
35
  onchange={() => onChange?.(String(value || ''))}
33
36
  />
34
- <span class="checkbox">
35
- <span class="checkmark"><CheckIcon /></span>
37
+ <span class="radio-circle">
38
+ <span class="radio-dot"></span>
36
39
  </span>
37
- {#if children}
40
+ {#if !ariaLabel && children}
38
41
  <div class="text">
39
42
  {@render children?.()}
40
43
  </div>
@@ -49,43 +52,35 @@
49
52
  font-size: 1rem;
50
53
  cursor: pointer;
51
54
  }
52
- label .checkbox {
55
+ label .radio-circle {
53
56
  position: relative;
54
57
  width: 1.2rem;
55
58
  height: 1.2rem;
56
- border-radius: 0.6rem;
59
+ border-radius: 50%;
57
60
  border: 1px solid var(--form-input-border, black);
58
61
  background-color: var(--form-input-bg, white);
59
- color: var(--form-input-fg, black);
60
- font-size: 0.875rem;
61
- font-weight: 500;
62
- line-height: 1.25rem;
63
- transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out, fill 0.2s ease-in-out, stroke 0.2s ease-in-out;
62
+ transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
64
63
  user-select: none;
65
64
  display: flex;
66
65
  align-items: center;
67
66
  justify-content: center;
68
- padding-top: 0.1rem;
69
67
  }
70
- label .checkbox .checkmark {
71
- display: block;
72
- width: 0;
73
- height: 0;
74
- line-height: 100%;
75
- color: var(--form-input-selected-fg, white);
76
- fill: var(--form-input-selected-bg, #3182ce);
77
- stroke: var(--form-input-selected-fg, white);
78
- transition: width 0.2s ease-in-out, height 0.2s ease-in-out;
68
+ label .radio-circle .radio-dot {
69
+ display: none;
70
+ width: 0.5rem;
71
+ height: 0.5rem;
72
+ border-radius: 50%;
73
+ background-color: var(--form-input-selected-bg, #3182ce);
74
+ transition: opacity 0.2s ease-in-out;
79
75
  }
80
76
  label input {
81
77
  width: 0;
82
78
  height: 0;
83
79
  position: absolute;
84
80
  }
85
- label input:checked + .checkbox {
86
- background-color: var(--form-input-selected-bg, #3182ce);
81
+ label input:checked + .radio-circle {
82
+ border-color: var(--form-input-selected-bg, #3182ce);
87
83
  }
88
- label input:checked + .checkbox .checkmark {
89
- width: 100%;
90
- height: 100%;
84
+ label input:checked + .radio-circle .radio-dot {
85
+ display: block;
91
86
  }</style>
@@ -4,6 +4,7 @@ type $$ComponentProps = {
4
4
  value?: RadioValue;
5
5
  group?: string | undefined;
6
6
  disabled?: boolean;
7
+ ariaLabel?: string;
7
8
  children?: Snippet;
8
9
  onChange?: ((value: string) => void) | undefined;
9
10
  };
@@ -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 CheckIcon from '../../icons/check-icon.svelte';
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
- <CheckIcon />
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 EnvelopeIcon from '../../icons/envelope-icon.svelte';
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
- <EnvelopeIcon />
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 CheckIcon from '../../icons/check-icon.svelte';
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"><CheckIcon /></span>
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"><CheckIcon /></span>
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 MobilePhoneIcon from '../../icons/mobile-phone-icon.svelte';
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
- <MobilePhoneIcon />
35
+ <Icon type="mobile-phone" size="sm" />
37
36
  {:else}
38
- <PhoneIcon />
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;