noph-ui 0.39.0 → 0.40.0
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/checkbox/Checkbox.svelte +8 -4
- package/dist/checkbox/types.d.ts +3 -1
- package/dist/date-picker/DockedDatePicker.svelte +34 -7
- package/dist/date-picker/DockedDateTimePicker.svelte +36 -6
- package/dist/date-picker/types.d.ts +6 -2
- package/dist/form-reset.d.ts +1 -0
- package/dist/form-reset.js +7 -0
- package/dist/icons/index.d.ts +0 -20
- package/dist/icons/index.js +0 -20
- package/dist/radio/Radio.svelte +4 -0
- package/dist/select/NativeSelect.svelte +4 -0
- package/dist/select/Select.svelte +12 -0
- package/dist/switch/Switch.svelte +3 -0
- package/dist/text-field/TextField.svelte +3 -0
- package/package.json +1 -1
- package/dist/icons/AccountCircleIcon.svelte +0 -15
- package/dist/icons/AccountCircleIcon.svelte.d.ts +0 -7
- package/dist/icons/ArrowBackIcon.svelte +0 -3
- package/dist/icons/ArrowBackIcon.svelte.d.ts +0 -26
- package/dist/icons/ArrowForwardIcon.svelte +0 -3
- package/dist/icons/ArrowForwardIcon.svelte.d.ts +0 -26
- package/dist/icons/BreakingNewsIcon.svelte +0 -5
- package/dist/icons/BreakingNewsIcon.svelte.d.ts +0 -26
- package/dist/icons/BrightnessMediumIcon.svelte +0 -5
- package/dist/icons/BrightnessMediumIcon.svelte.d.ts +0 -26
- package/dist/icons/ChatIcon.svelte +0 -5
- package/dist/icons/ChatIcon.svelte.d.ts +0 -26
- package/dist/icons/CopyContentIcon.svelte +0 -5
- package/dist/icons/CopyContentIcon.svelte.d.ts +0 -26
- package/dist/icons/DarkModeIcon.svelte +0 -5
- package/dist/icons/DarkModeIcon.svelte.d.ts +0 -26
- package/dist/icons/DashboardIcon.svelte +0 -5
- package/dist/icons/DashboardIcon.svelte.d.ts +0 -26
- package/dist/icons/DownloadIcon.svelte +0 -5
- package/dist/icons/DownloadIcon.svelte.d.ts +0 -26
- package/dist/icons/ErrorIcon.svelte +0 -5
- package/dist/icons/ErrorIcon.svelte.d.ts +0 -26
- package/dist/icons/GroupsIcon.svelte +0 -5
- package/dist/icons/GroupsIcon.svelte.d.ts +0 -26
- package/dist/icons/LanguageIcon.svelte +0 -5
- package/dist/icons/LanguageIcon.svelte.d.ts +0 -26
- package/dist/icons/LightModeIcon.svelte +0 -5
- package/dist/icons/LightModeIcon.svelte.d.ts +0 -26
- package/dist/icons/LogoutIcon.svelte +0 -5
- package/dist/icons/LogoutIcon.svelte.d.ts +0 -26
- package/dist/icons/MenuIcon.svelte +0 -3
- package/dist/icons/MenuIcon.svelte.d.ts +0 -26
- package/dist/icons/OpenInNewIcon.svelte +0 -10
- package/dist/icons/OpenInNewIcon.svelte.d.ts +0 -26
- package/dist/icons/PaletteIcon.svelte +0 -5
- package/dist/icons/PaletteIcon.svelte.d.ts +0 -26
- package/dist/icons/PersonIcon.svelte +0 -5
- package/dist/icons/PersonIcon.svelte.d.ts +0 -26
- package/dist/icons/SearchIcon.svelte +0 -10
- package/dist/icons/SearchIcon.svelte.d.ts +0 -26
- package/dist/icons/SendIcon.svelte +0 -10
- package/dist/icons/SendIcon.svelte.d.ts +0 -26
- package/dist/icons/SettingsIcon.svelte +0 -5
- package/dist/icons/SettingsIcon.svelte.d.ts +0 -26
- package/dist/icons/SportsGymnasticsIcon.svelte +0 -5
- package/dist/icons/SportsGymnasticsIcon.svelte.d.ts +0 -26
- package/dist/icons/VisibilityIcon.svelte +0 -10
- package/dist/icons/VisibilityIcon.svelte.d.ts +0 -26
- package/dist/icons/VisibilityOffIcon.svelte +0 -10
- package/dist/icons/VisibilityOffIcon.svelte.d.ts +0 -26
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
checked = $bindable(),
|
|
8
8
|
element = $bindable(),
|
|
9
9
|
group = $bindable(),
|
|
10
|
-
|
|
10
|
+
issues,
|
|
11
11
|
style,
|
|
12
12
|
value,
|
|
13
13
|
...attributes
|
|
14
14
|
}: CheckboxProps = $props()
|
|
15
15
|
|
|
16
16
|
let inputEl: HTMLInputElement | undefined = $state()
|
|
17
|
+
let hasError = $derived(!!issues?.length)
|
|
17
18
|
|
|
18
19
|
let groupValue = $derived(
|
|
19
20
|
typeof value === 'string' || typeof value === 'number' ? value : undefined,
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
|
|
40
41
|
<div
|
|
41
42
|
{style}
|
|
42
|
-
class={['np-container',
|
|
43
|
+
class={['np-container', hasError && !attributes.disabled && 'np-error', attributes.class]}
|
|
43
44
|
bind:this={element}
|
|
44
45
|
>
|
|
45
46
|
<div class="np-outline"></div>
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
bind:this={inputEl}
|
|
63
64
|
checked={groupChecked}
|
|
64
65
|
{onchange}
|
|
65
|
-
aria-invalid={
|
|
66
|
+
aria-invalid={hasError ? 'true' : undefined}
|
|
66
67
|
aria-checked={indeterminate ? 'mixed' : undefined}
|
|
67
68
|
/>
|
|
68
69
|
{:else}
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
bind:indeterminate
|
|
75
76
|
bind:checked
|
|
76
77
|
bind:this={inputEl}
|
|
77
|
-
aria-invalid={
|
|
78
|
+
aria-invalid={hasError ? 'true' : undefined}
|
|
78
79
|
aria-checked={indeterminate ? 'mixed' : undefined}
|
|
79
80
|
/>
|
|
80
81
|
{/if}
|
|
@@ -96,6 +97,9 @@
|
|
|
96
97
|
-webkit-tap-highlight-color: transparent;
|
|
97
98
|
margin: var(--np-checkbox-margin, max(0px, (48px - 18px)/2));
|
|
98
99
|
}
|
|
100
|
+
:global(label) {
|
|
101
|
+
-webkit-tap-highlight-color: transparent;
|
|
102
|
+
}
|
|
99
103
|
.np-container:has(input:disabled) {
|
|
100
104
|
cursor: default;
|
|
101
105
|
}
|
package/dist/checkbox/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import Divider from '../divider/Divider.svelte'
|
|
5
5
|
import CalendarToday from '../icons/CalendarToday.svelte'
|
|
6
6
|
import Menu from '../menu/Menu.svelte'
|
|
7
|
+
import { onFormReset } from '../form-reset.js'
|
|
7
8
|
import TextField from '../text-field/TextField.svelte'
|
|
8
9
|
import { onMount, tick } from 'svelte'
|
|
9
10
|
import Calendar from './Calendar.svelte'
|
|
@@ -32,6 +33,10 @@
|
|
|
32
33
|
|
|
33
34
|
let {
|
|
34
35
|
value = $bindable(),
|
|
36
|
+
defaultValue,
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- absorbed on purpose
|
|
38
|
+
type,
|
|
39
|
+
'aria-invalid': ariaInvalid,
|
|
35
40
|
displayMonth = $bindable(),
|
|
36
41
|
open = $bindable(false),
|
|
37
42
|
element = $bindable(),
|
|
@@ -79,16 +84,21 @@
|
|
|
79
84
|
let pending = $state<ISODate | undefined>(undefined)
|
|
80
85
|
let focusedDay = $state<Date | undefined>(undefined)
|
|
81
86
|
let inputElement = $state<HTMLInputElement | HTMLTextAreaElement>()
|
|
87
|
+
let valueInput = $state<HTMLInputElement>()
|
|
82
88
|
|
|
83
89
|
let typed = $state.raw<{ source: ISODate | null | undefined; text: string } | undefined>()
|
|
84
90
|
let invalidText = $state<string | undefined>()
|
|
85
91
|
let monthBeforeOpen: ISODate | undefined
|
|
86
92
|
|
|
93
|
+
let current = $derived<ISODate | undefined>(
|
|
94
|
+
typeof value === 'string' ? value : typeof defaultValue === 'string' ? defaultValue : undefined,
|
|
95
|
+
)
|
|
96
|
+
|
|
87
97
|
let todayValue = $derived(getToday())
|
|
88
98
|
let week = $derived(firstDayOfWeek ?? getFirstDayOfWeek(locale))
|
|
89
99
|
let minDate = $derived(parseISODate(min))
|
|
90
100
|
let maxDate = $derived(parseISODate(max))
|
|
91
|
-
let committed = $derived(parseISODate(
|
|
101
|
+
let committed = $derived(parseISODate(current))
|
|
92
102
|
let pendingDate = $derived(open ? parseISODate(pending) : committed)
|
|
93
103
|
let mounted = $state(false)
|
|
94
104
|
|
|
@@ -122,7 +132,7 @@
|
|
|
122
132
|
return localeKnown ? formatDate(committed, locale) : toISODate(committed)
|
|
123
133
|
}
|
|
124
134
|
|
|
125
|
-
let text = $derived(typed && typed.source ===
|
|
135
|
+
let text = $derived(typed && typed.source === current ? typed.text : formatValue())
|
|
126
136
|
|
|
127
137
|
let inputInvalid = $derived(invalidText !== undefined && invalidText === text)
|
|
128
138
|
|
|
@@ -167,11 +177,25 @@
|
|
|
167
177
|
}
|
|
168
178
|
|
|
169
179
|
const commit = (next: ISODate | undefined) => {
|
|
170
|
-
if (
|
|
180
|
+
if (current === next) return
|
|
171
181
|
value = next
|
|
172
182
|
onchange?.(next)
|
|
173
183
|
}
|
|
174
184
|
|
|
185
|
+
const restoreDefault = () => {
|
|
186
|
+
const next = typeof defaultValue === 'string' ? defaultValue : undefined
|
|
187
|
+
if (valueInput) valueInput.value = next ?? ''
|
|
188
|
+
queueMicrotask(() => {
|
|
189
|
+
typed = undefined
|
|
190
|
+
invalidText = undefined
|
|
191
|
+
pending = undefined
|
|
192
|
+
value = next
|
|
193
|
+
text = formatValue()
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
$effect(() => onFormReset(valueInput, restoreDefault))
|
|
198
|
+
|
|
175
199
|
const isShowing = () => !!menuElement?.matches(':popover-open')
|
|
176
200
|
|
|
177
201
|
const openPicker = () => {
|
|
@@ -230,7 +254,7 @@
|
|
|
230
254
|
commit(parsed ? toISODate(parsed) : undefined)
|
|
231
255
|
if (parsed) setMonth(parsed)
|
|
232
256
|
// Recorded after the commit, so that it is remembered against the value it just produced.
|
|
233
|
-
typed = { source:
|
|
257
|
+
typed = { source: current, text: next }
|
|
234
258
|
invalidText = undefined
|
|
235
259
|
}
|
|
236
260
|
|
|
@@ -280,7 +304,9 @@
|
|
|
280
304
|
supportingText={supportingText ?? pattern}
|
|
281
305
|
bind:value={text}
|
|
282
306
|
bind:inputElement
|
|
283
|
-
aria-invalid={inputInvalid || issues?.length
|
|
307
|
+
aria-invalid={inputInvalid || issues?.length || ariaInvalid === true || ariaInvalid === 'true'
|
|
308
|
+
? 'true'
|
|
309
|
+
: undefined}
|
|
284
310
|
oninput={handleInput}
|
|
285
311
|
onblur={handleBlur}
|
|
286
312
|
>
|
|
@@ -302,9 +328,10 @@
|
|
|
302
328
|
{/snippet}
|
|
303
329
|
</TextField>
|
|
304
330
|
<input
|
|
331
|
+
bind:this={valueInput}
|
|
305
332
|
class="np-docked-date-picker-value"
|
|
306
333
|
type="hidden"
|
|
307
|
-
value={
|
|
334
|
+
value={current ?? ''}
|
|
308
335
|
{name}
|
|
309
336
|
{form}
|
|
310
337
|
{disabled}
|
|
@@ -330,7 +357,7 @@
|
|
|
330
357
|
ontoggle={({ newState }) => {
|
|
331
358
|
if (newState === 'open') {
|
|
332
359
|
monthBeforeOpen = displayMonth
|
|
333
|
-
pending =
|
|
360
|
+
pending = current
|
|
334
361
|
focusCalendarWhenReady()
|
|
335
362
|
}
|
|
336
363
|
if (newState === 'closed') {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import Divider from '../divider/Divider.svelte'
|
|
5
5
|
import CalendarToday from '../icons/CalendarToday.svelte'
|
|
6
6
|
import Menu from '../menu/Menu.svelte'
|
|
7
|
+
import { onFormReset } from '../form-reset.js'
|
|
7
8
|
import TextField from '../text-field/TextField.svelte'
|
|
8
9
|
import { onMount, tick } from 'svelte'
|
|
9
10
|
import Calendar from './Calendar.svelte'
|
|
@@ -46,6 +47,10 @@
|
|
|
46
47
|
|
|
47
48
|
let {
|
|
48
49
|
value = $bindable(),
|
|
50
|
+
defaultValue,
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- absorbed on purpose
|
|
52
|
+
type,
|
|
53
|
+
'aria-invalid': ariaInvalid,
|
|
49
54
|
displayMonth = $bindable(),
|
|
50
55
|
open = $bindable(false),
|
|
51
56
|
element = $bindable(),
|
|
@@ -101,6 +106,7 @@
|
|
|
101
106
|
let pendingMinutes = $state(0)
|
|
102
107
|
let focusedDay = $state<Date | undefined>(undefined)
|
|
103
108
|
let inputElement = $state<HTMLInputElement | HTMLTextAreaElement>()
|
|
109
|
+
let valueInput = $state<HTMLInputElement>()
|
|
104
110
|
|
|
105
111
|
let typed = $state.raw<{ source: string | null | undefined; text: string } | undefined>()
|
|
106
112
|
let invalidText = $state<string | undefined>()
|
|
@@ -110,7 +116,13 @@
|
|
|
110
116
|
let week = $derived(firstDayOfWeek ?? getFirstDayOfWeek(locale))
|
|
111
117
|
let minDate = $derived(parseISODateTime(min))
|
|
112
118
|
let maxDate = $derived(parseISODateTime(max, MINUTES_IN_DAY - 1))
|
|
113
|
-
|
|
119
|
+
// `as('datetime-local')` types its value as `string | number` and carries the last submission in
|
|
120
|
+
// `defaultValue`, so both are funnelled into one ISO string the rest of the component reads.
|
|
121
|
+
let current = $derived<string | undefined>(
|
|
122
|
+
typeof value === 'string' ? value : typeof defaultValue === 'string' ? defaultValue : undefined,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
let committed = $derived(parseISODateTime(current))
|
|
114
126
|
let pendingDayDate = $derived(open ? parseISODate(pendingDay) : undefined)
|
|
115
127
|
let pendingDate = $derived(
|
|
116
128
|
open ? (pendingDayDate ? withMinutes(pendingDayDate, pendingMinutes) : undefined) : committed,
|
|
@@ -153,7 +165,7 @@
|
|
|
153
165
|
return localeKnown ? formatDateTime(committed, locale, hour12) : toISODateTime(committed)
|
|
154
166
|
}
|
|
155
167
|
|
|
156
|
-
let text = $derived(typed && typed.source ===
|
|
168
|
+
let text = $derived(typed && typed.source === current ? typed.text : formatValue())
|
|
157
169
|
|
|
158
170
|
let inputInvalid = $derived(invalidText !== undefined && invalidText === text)
|
|
159
171
|
|
|
@@ -247,11 +259,26 @@
|
|
|
247
259
|
}
|
|
248
260
|
|
|
249
261
|
const commit = (next: string | undefined) => {
|
|
250
|
-
if (
|
|
262
|
+
if (current === next) return
|
|
251
263
|
value = next
|
|
252
264
|
onchange?.(next)
|
|
253
265
|
}
|
|
254
266
|
|
|
267
|
+
const restoreDefault = () => {
|
|
268
|
+
const next = typeof defaultValue === 'string' ? defaultValue : undefined
|
|
269
|
+
if (valueInput) valueInput.value = next ?? ''
|
|
270
|
+
queueMicrotask(() => {
|
|
271
|
+
typed = undefined
|
|
272
|
+
invalidText = undefined
|
|
273
|
+
pendingDay = undefined
|
|
274
|
+
pendingMinutes = 0
|
|
275
|
+
value = next
|
|
276
|
+
text = formatValue()
|
|
277
|
+
})
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
$effect(() => onFormReset(valueInput, restoreDefault))
|
|
281
|
+
|
|
255
282
|
const isShowing = () => !!menuElement?.matches(':popover-open')
|
|
256
283
|
|
|
257
284
|
const openPicker = () => {
|
|
@@ -321,7 +348,7 @@
|
|
|
321
348
|
const parsed = usableDate(next)
|
|
322
349
|
commit(parsed ? toISODateTime(parsed) : undefined)
|
|
323
350
|
if (parsed) setMonth(parsed)
|
|
324
|
-
typed = { source:
|
|
351
|
+
typed = { source: current, text: next }
|
|
325
352
|
invalidText = undefined
|
|
326
353
|
}
|
|
327
354
|
|
|
@@ -371,7 +398,9 @@
|
|
|
371
398
|
supportingText={supportingText ?? pattern}
|
|
372
399
|
bind:value={text}
|
|
373
400
|
bind:inputElement
|
|
374
|
-
aria-invalid={inputInvalid || issues?.length
|
|
401
|
+
aria-invalid={inputInvalid || issues?.length || ariaInvalid === true || ariaInvalid === 'true'
|
|
402
|
+
? 'true'
|
|
403
|
+
: undefined}
|
|
375
404
|
oninput={handleInput}
|
|
376
405
|
onblur={handleBlur}
|
|
377
406
|
>
|
|
@@ -393,9 +422,10 @@
|
|
|
393
422
|
{/snippet}
|
|
394
423
|
</TextField>
|
|
395
424
|
<input
|
|
425
|
+
bind:this={valueInput}
|
|
396
426
|
class="np-docked-date-time-picker-value"
|
|
397
427
|
type="hidden"
|
|
398
|
-
value={
|
|
428
|
+
value={current ?? ''}
|
|
399
429
|
{name}
|
|
400
430
|
{form}
|
|
401
431
|
{disabled}
|
|
@@ -27,7 +27,7 @@ interface MonthStepperLabelProps {
|
|
|
27
27
|
previousMonthLabel?: string;
|
|
28
28
|
}
|
|
29
29
|
export interface DockedDatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onchange'>, DatePickerLocaleProps, DatePickerRangeProps, DatePickerCommonLabelProps, MonthStepperLabelProps {
|
|
30
|
-
value?: ISODate | null;
|
|
30
|
+
value?: ISODate | number | null;
|
|
31
31
|
displayMonth?: ISODate;
|
|
32
32
|
open?: boolean;
|
|
33
33
|
element?: HTMLDivElement;
|
|
@@ -40,6 +40,8 @@ export interface DockedDatePickerProps extends Omit<HTMLAttributes<HTMLDivElemen
|
|
|
40
40
|
issues?: {
|
|
41
41
|
message: string;
|
|
42
42
|
}[];
|
|
43
|
+
defaultValue?: ISODate | number | null;
|
|
44
|
+
type?: 'date';
|
|
43
45
|
noAsterisk?: boolean;
|
|
44
46
|
autocomplete?: HTMLInputAttributes['autocomplete'];
|
|
45
47
|
label?: string;
|
|
@@ -53,7 +55,7 @@ export interface DockedDatePickerProps extends Omit<HTMLAttributes<HTMLDivElemen
|
|
|
53
55
|
onchange?: (value: ISODate | undefined) => void;
|
|
54
56
|
}
|
|
55
57
|
export interface DockedDateTimePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onchange'>, DatePickerLocaleProps, Omit<DatePickerRangeProps, 'min' | 'max'>, DatePickerCommonLabelProps, MonthStepperLabelProps {
|
|
56
|
-
value?: ISODateTime | null;
|
|
58
|
+
value?: ISODateTime | number | null;
|
|
57
59
|
displayMonth?: ISODate;
|
|
58
60
|
open?: boolean;
|
|
59
61
|
element?: HTMLDivElement;
|
|
@@ -68,6 +70,8 @@ export interface DockedDateTimePickerProps extends Omit<HTMLAttributes<HTMLDivEl
|
|
|
68
70
|
issues?: {
|
|
69
71
|
message: string;
|
|
70
72
|
}[];
|
|
73
|
+
defaultValue?: ISODateTime | number | null;
|
|
74
|
+
type?: 'datetime-local';
|
|
71
75
|
noAsterisk?: boolean;
|
|
72
76
|
autocomplete?: HTMLInputAttributes['autocomplete'];
|
|
73
77
|
label?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const onFormReset: (control: HTMLInputElement | HTMLSelectElement | undefined, restore: () => void) => (() => void) | undefined;
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
export { default as AccountCircleIcon } from './AccountCircleIcon.svelte';
|
|
2
|
-
export { default as ArrowBackIcon } from './ArrowBackIcon.svelte';
|
|
3
1
|
export { default as ArrowDropDownIcon } from './ArrowDropDownIcon.svelte';
|
|
4
|
-
export { default as ArrowForwardIcon } from './ArrowForwardIcon.svelte';
|
|
5
|
-
export { default as BreakingNewsIcon } from './BreakingNewsIcon.svelte';
|
|
6
|
-
export { default as BrightnessMediumIcon } from './BrightnessMediumIcon.svelte';
|
|
7
2
|
export { default as CalendarToday } from './CalendarToday.svelte';
|
|
8
|
-
export { default as ChatIcon } from './ChatIcon.svelte';
|
|
9
3
|
export { default as CheckIcon } from './CheckIcon.svelte';
|
|
10
4
|
export { default as ChevronLeftIcon } from './ChevronLeftIcon.svelte';
|
|
11
5
|
export { default as ChevronRightIcon } from './ChevronRightIcon.svelte';
|
|
12
6
|
export { default as CloseIcon } from './CloseIcon.svelte';
|
|
13
|
-
export { default as DarkModeIcon } from './DarkModeIcon.svelte';
|
|
14
|
-
export { default as DashboardIcon } from './DashboardIcon.svelte';
|
|
15
|
-
export { default as DownloadIcon } from './DownloadIcon.svelte';
|
|
16
7
|
export { default as EditCalendarIcon } from './EditCalendarIcon.svelte';
|
|
17
|
-
export { default as ErrorIcon } from './ErrorIcon.svelte';
|
|
18
|
-
export { default as GroupsIcon } from './GroupsIcon.svelte';
|
|
19
|
-
export { default as LanguageIcon } from './LanguageIcon.svelte';
|
|
20
|
-
export { default as LightModeIcon } from './LightModeIcon.svelte';
|
|
21
|
-
export { default as MenuIcon } from './MenuIcon.svelte';
|
|
22
|
-
export { default as OpenInNewIcon } from './OpenInNewIcon.svelte';
|
|
23
|
-
export { default as SearchIcon } from './SearchIcon.svelte';
|
|
24
|
-
export { default as SendIcon } from './SendIcon.svelte';
|
|
25
|
-
export { default as SportsGymnasticsIcon } from './SportsGymnasticsIcon.svelte';
|
|
26
|
-
export { default as VisibilityIcon } from './VisibilityIcon.svelte';
|
|
27
|
-
export { default as VisibilityOffIcon } from './VisibilityOffIcon.svelte';
|
|
28
8
|
export { default as Icon } from './Icon.svelte';
|
package/dist/icons/index.js
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
export { default as AccountCircleIcon } from './AccountCircleIcon.svelte';
|
|
2
|
-
export { default as ArrowBackIcon } from './ArrowBackIcon.svelte';
|
|
3
1
|
export { default as ArrowDropDownIcon } from './ArrowDropDownIcon.svelte';
|
|
4
|
-
export { default as ArrowForwardIcon } from './ArrowForwardIcon.svelte';
|
|
5
|
-
export { default as BreakingNewsIcon } from './BreakingNewsIcon.svelte';
|
|
6
|
-
export { default as BrightnessMediumIcon } from './BrightnessMediumIcon.svelte';
|
|
7
2
|
export { default as CalendarToday } from './CalendarToday.svelte';
|
|
8
|
-
export { default as ChatIcon } from './ChatIcon.svelte';
|
|
9
3
|
export { default as CheckIcon } from './CheckIcon.svelte';
|
|
10
4
|
export { default as ChevronLeftIcon } from './ChevronLeftIcon.svelte';
|
|
11
5
|
export { default as ChevronRightIcon } from './ChevronRightIcon.svelte';
|
|
12
6
|
export { default as CloseIcon } from './CloseIcon.svelte';
|
|
13
|
-
export { default as DarkModeIcon } from './DarkModeIcon.svelte';
|
|
14
|
-
export { default as DashboardIcon } from './DashboardIcon.svelte';
|
|
15
|
-
export { default as DownloadIcon } from './DownloadIcon.svelte';
|
|
16
7
|
export { default as EditCalendarIcon } from './EditCalendarIcon.svelte';
|
|
17
|
-
export { default as ErrorIcon } from './ErrorIcon.svelte';
|
|
18
|
-
export { default as GroupsIcon } from './GroupsIcon.svelte';
|
|
19
|
-
export { default as LanguageIcon } from './LanguageIcon.svelte';
|
|
20
|
-
export { default as LightModeIcon } from './LightModeIcon.svelte';
|
|
21
|
-
export { default as MenuIcon } from './MenuIcon.svelte';
|
|
22
|
-
export { default as OpenInNewIcon } from './OpenInNewIcon.svelte';
|
|
23
|
-
export { default as SearchIcon } from './SearchIcon.svelte';
|
|
24
|
-
export { default as SendIcon } from './SendIcon.svelte';
|
|
25
|
-
export { default as SportsGymnasticsIcon } from './SportsGymnasticsIcon.svelte';
|
|
26
|
-
export { default as VisibilityIcon } from './VisibilityIcon.svelte';
|
|
27
|
-
export { default as VisibilityOffIcon } from './VisibilityOffIcon.svelte';
|
|
28
8
|
export { default as Icon } from './Icon.svelte';
|
package/dist/radio/Radio.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { onFormReset } from '../form-reset.js'
|
|
2
3
|
import Item from '../list/Item.svelte'
|
|
3
4
|
import Menu from '../menu/Menu.svelte'
|
|
4
5
|
import Check from './Check.svelte'
|
|
@@ -60,6 +61,17 @@
|
|
|
60
61
|
let selectElement = $state<HTMLSelectElement>()
|
|
61
62
|
let menuElement = $state<HTMLDivElement>()
|
|
62
63
|
let anchorElement = $state<HTMLDivElement>()
|
|
64
|
+
|
|
65
|
+
$effect(() =>
|
|
66
|
+
onFormReset(selectElement, () => {
|
|
67
|
+
queueMicrotask(() => {
|
|
68
|
+
value = multiple
|
|
69
|
+
? options.filter((option) => option.selected).map((option) => option.value)
|
|
70
|
+
: options.find((option) => option.selected)?.value
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
)
|
|
74
|
+
|
|
63
75
|
let field = $state<HTMLDivElement>()
|
|
64
76
|
let clientWidth = $state(0)
|
|
65
77
|
let menuOpen = $state(false)
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let {
|
|
3
|
-
height = 24,
|
|
4
|
-
width = 24,
|
|
5
|
-
}: {
|
|
6
|
-
height?: number
|
|
7
|
-
width?: number
|
|
8
|
-
} = $props()
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<svg xmlns="http://www.w3.org/2000/svg" {height} viewBox="0 -960 960 960" {width}
|
|
12
|
-
><path
|
|
13
|
-
d="M242-251.154q56.846-38.615 113.461-60.577Q412.077-333.692 480-333.692t124.654 21.961q56.731 21.962 113.577 60.577 43.231-47.077 67.115-104.451Q809.231-412.978 809.231-480q0-138.077-95.577-233.654T480-809.231q-138.077 0-233.654 95.577T150.769-480q0 67.022 24 124.395 24 57.374 67.231 104.451Zm237.752-213.461q-50.06 0-84.175-34.364-34.116-34.363-34.116-84.423t34.364-84.175q34.363-34.115 84.423-34.115t84.175 34.363q34.116 34.363 34.116 84.423t-34.364 84.175q-34.363 34.116-84.423 34.116ZM480.468-120q-75.545 0-141.016-28.038-65.472-28.039-114.423-77.154-48.952-49.116-76.991-114.189Q120-404.455 120-479.881q0-75.427 28.038-140.619 28.039-65.192 77.154-114.308 49.116-49.115 114.189-77.154Q404.455-840 479.881-840q75.427 0 140.619 28.038 65.192 28.039 114.308 77.154 49.115 49.116 77.154 114.34Q840-555.244 840-480.468q0 75.545-28.038 141.016-28.039 65.472-77.154 114.423-49.116 48.952-114.34 76.991Q555.244-120 480.468-120ZM480-150.769q56.538 0 112.5-19.462 55.961-19.461 100.808-58.692-44.847-34.462-99-54.231Q540.154-302.923 480-302.923t-114.692 19.385q-54.539 19.384-97.846 54.615 44.077 39.231 100.038 58.692 55.962 19.462 112.5 19.462Zm.107-344.616q37.739 0 62.701-25.069 24.961-25.068 24.961-62.807 0-37.739-25.069-62.701-25.069-24.961-62.807-24.961-37.739 0-62.701 25.069-24.961 25.069-24.961 62.807 0 37.739 25.069 62.701 25.069 24.961 62.807 24.961ZM480-583.154Zm0 356.308Z"
|
|
14
|
-
/></svg
|
|
15
|
-
>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default ArrowBackIcon;
|
|
2
|
-
type ArrowBackIcon = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const ArrowBackIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default ArrowForwardIcon;
|
|
2
|
-
type ArrowForwardIcon = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const ArrowForwardIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"
|
|
2
|
-
><path
|
|
3
|
-
d="M280-280q17 0 28.5-11.5T320-320q0-17-11.5-28.5T280-360q-17 0-28.5 11.5T240-320q0 17 11.5 28.5T280-280Zm-40-160h80v-240h-80v240Zm200 160h280v-80H440v80Zm0-160h280v-80H440v80Zm0-160h280v-80H440v80ZM160-120q-33 0-56.5-23.5T80-200v-560q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v560q0 33-23.5 56.5T800-120H160Zm0-80h640v-560H160v560Zm0 0v-560 560Z"
|
|
4
|
-
/></svg
|
|
5
|
-
>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default BreakingNewsIcon;
|
|
2
|
-
type BreakingNewsIcon = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const BreakingNewsIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"
|
|
2
|
-
><path
|
|
3
|
-
d="M480-28 346-160H160v-186L28-480l132-134v-186h186l134-132 134 132h186v186l132 134-132 134v186H614L480-28Zm0-252q83 0 141.5-58.5T680-480q0-83-58.5-141.5T480-680v400Zm0 140 100-100h140v-140l100-100-100-100v-140H580L480-820 380-720H240v140L140-480l100 100v140h140l100 100Zm0-340Z"
|
|
4
|
-
/></svg
|
|
5
|
-
>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default BrightnessMediumIcon;
|
|
2
|
-
type BrightnessMediumIcon = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const BrightnessMediumIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"
|
|
2
|
-
><path
|
|
3
|
-
d="M240-400h320v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"
|
|
4
|
-
/></svg
|
|
5
|
-
>
|