@human-kit/ui 1.0.0-beta.4 → 1.0.0-beta.6
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 +19 -17
- package/dist/accordion/README.md +3 -3
- package/dist/accordion/types.d.ts +37 -23
- package/dist/autocomplete/README.md +6 -7
- package/dist/autocomplete/empty/autocomplete-empty.svelte +1 -1
- package/dist/autocomplete/empty/autocomplete-empty.svelte.d.ts +1 -1
- package/dist/autocomplete/input/autocomplete-input.svelte +3 -3
- package/dist/autocomplete/input/autocomplete-input.svelte.d.ts +3 -3
- package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte +2 -2
- package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte.d.ts +2 -2
- package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
- package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +2 -2
- package/dist/autocomplete/root/autocomplete.svelte +7 -7
- package/dist/autocomplete/root/autocomplete.svelte.d.ts +7 -7
- package/dist/autocomplete/status/autocomplete-status.svelte +1 -1
- package/dist/autocomplete/status/autocomplete-status.svelte.d.ts +1 -1
- package/dist/button/README.md +1 -1
- package/dist/button/root/button-root.svelte +15 -10
- package/dist/button/root/button-root.svelte.d.ts +15 -10
- package/dist/calendar/README.md +3 -3
- package/dist/calendar/grid-header/calendar-grid-header.svelte +3 -4
- package/dist/calendar/grid-header/calendar-grid-header.svelte.d.ts +3 -4
- package/dist/calendar/root/calendar-root.svelte +8 -2
- package/dist/calendar/root/calendar-root.svelte.d.ts +8 -2
- package/dist/calendar/trigger-next/README.md +1 -1
- package/dist/calendar/trigger-previous/README.md +1 -1
- package/dist/checkbox/README.md +1 -1
- package/dist/checkbox/indicator/README.md +1 -1
- package/dist/checkbox/root/README.md +2 -2
- package/dist/checkbox/root/checkbox-root.svelte +12 -10
- package/dist/checkbox/root/checkbox-root.svelte.d.ts +12 -10
- package/dist/clock/README.md +3 -3
- package/dist/clock/axis/README.md +1 -1
- package/dist/clock/root/README.md +1 -1
- package/dist/clock/wheel-column/clock-wheel-column.svelte +1 -1
- package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +1 -1
- package/dist/collapsible/README.md +3 -3
- package/dist/collapsible/types.d.ts +10 -7
- package/dist/combobox/README.md +2 -2
- package/dist/combobox/button/README.md +6 -6
- package/dist/combobox/input/README.md +1 -1
- package/dist/combobox/input/combobox-input.svelte +3 -3
- package/dist/combobox/input/combobox-input.svelte.d.ts +3 -3
- package/dist/combobox/item/combobox-listboxitem.svelte +4 -2
- package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +4 -2
- package/dist/combobox/item-indicator/README.md +1 -1
- package/dist/combobox/item-indicator/combobox-item-indicator.svelte +2 -2
- package/dist/combobox/item-indicator/combobox-item-indicator.svelte.d.ts +2 -2
- package/dist/combobox/list/combobox-listbox.svelte +11 -8
- package/dist/combobox/list/combobox-listbox.svelte.d.ts +11 -8
- package/dist/combobox/popover/README.md +1 -1
- package/dist/combobox/root/README.md +24 -24
- package/dist/combobox/root/combobox.svelte +26 -17
- package/dist/combobox/root/combobox.svelte.d.ts +26 -17
- package/dist/combobox/status/README.md +1 -1
- package/dist/combobox/status/combobox-status.svelte +1 -1
- package/dist/combobox/status/combobox-status.svelte.d.ts +1 -1
- package/dist/combobox/tag/README.md +1 -1
- package/dist/combobox/tag/combobox-tag.svelte +1 -1
- package/dist/combobox/tag/combobox-tag.svelte.d.ts +1 -1
- package/dist/combobox/tag-remove/README.md +1 -1
- package/dist/combobox/tag-remove/combobox-tag-remove.svelte +4 -5
- package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +4 -5
- package/dist/combobox/tags/README.md +1 -1
- package/dist/combobox/tags/combobox-tags.svelte +11 -11
- package/dist/combobox/tags/combobox-tags.svelte.d.ts +11 -11
- package/dist/combobox/trigger/README.md +7 -7
- package/dist/datepicker/README.md +4 -4
- package/dist/datepicker/input/date-picker-input.svelte +3 -4
- package/dist/datepicker/input/date-picker-input.svelte.d.ts +3 -4
- package/dist/datepicker/root/date-picker-root.svelte +1 -1
- package/dist/datepicker/trigger/README.md +1 -1
- package/dist/daterangepicker/README.md +3 -3
- package/dist/daterangepicker/input/date-range-picker-input.svelte +3 -4
- package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +3 -4
- package/dist/dialog/README.md +1 -1
- package/dist/dialog/close/dialog-close.svelte +3 -3
- package/dist/dialog/close/dialog-close.svelte.d.ts +3 -3
- package/dist/dialog/content/dialog-content.svelte +4 -4
- package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
- package/dist/dialog/description/dialog-description.svelte +3 -3
- package/dist/dialog/description/dialog-description.svelte.d.ts +3 -3
- package/dist/dialog/overlay/dialog-overlay.svelte +1 -1
- package/dist/dialog/overlay/dialog-overlay.svelte.d.ts +1 -1
- package/dist/dialog/portal/dialog-portal.svelte +1 -1
- package/dist/dialog/portal/dialog-portal.svelte.d.ts +1 -1
- package/dist/dialog/root/README.md +1 -1
- package/dist/dialog/root/dialog-root.svelte +36 -11
- package/dist/dialog/root/dialog-root.svelte.d.ts +11 -9
- package/dist/dialog/title/dialog-title.svelte +3 -3
- package/dist/dialog/title/dialog-title.svelte.d.ts +3 -3
- package/dist/dialog/trigger/README.md +1 -1
- package/dist/drawer/README.md +3 -3
- package/dist/drawer/body/drawer-body.svelte +2 -2
- package/dist/drawer/body/drawer-body.svelte.d.ts +2 -2
- package/dist/drawer/close/drawer-close.svelte +3 -3
- package/dist/drawer/close/drawer-close.svelte.d.ts +3 -3
- package/dist/drawer/content/drawer-content.svelte +12 -9
- package/dist/drawer/content/drawer-content.svelte.d.ts +12 -9
- package/dist/drawer/description/drawer-description.svelte +3 -3
- package/dist/drawer/description/drawer-description.svelte.d.ts +3 -3
- package/dist/drawer/indent/drawer-indent-background.svelte +1 -1
- package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +1 -1
- package/dist/drawer/indent/drawer-indent.svelte +2 -2
- package/dist/drawer/indent/drawer-indent.svelte.d.ts +2 -2
- package/dist/drawer/overlay/drawer-overlay.svelte +1 -1
- package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +1 -1
- package/dist/drawer/portal/drawer-portal.svelte +1 -1
- package/dist/drawer/portal/drawer-portal.svelte.d.ts +1 -1
- package/dist/drawer/root/context.d.ts +1 -1
- package/dist/drawer/root/drawer-root.svelte +25 -23
- package/dist/drawer/root/drawer-root.svelte.d.ts +25 -23
- package/dist/drawer/swipe-area/drawer-swipe-area.svelte +3 -3
- package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +3 -3
- package/dist/drawer/title/drawer-title.svelte +3 -3
- package/dist/drawer/title/drawer-title.svelte.d.ts +3 -3
- package/dist/drawer/trigger/drawer-trigger.svelte +6 -6
- package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +6 -6
- package/dist/drawer/viewport/drawer-viewport.svelte +2 -2
- package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +2 -2
- package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +1 -1
- package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +1 -1
- package/dist/dropzone/README.md +4 -6
- package/dist/input/input.svelte +6 -6
- package/dist/input/input.svelte.d.ts +6 -6
- package/dist/listbox/README.md +3 -10
- package/dist/listbox/item/listbox-item.svelte +24 -15
- package/dist/listbox/item/listbox-item.svelte.d.ts +24 -15
- package/dist/listbox/root/README.md +1 -1
- package/dist/listbox/root/context.d.ts +1 -1
- package/dist/listbox/root/listbox.svelte +50 -38
- package/dist/listbox/root/listbox.svelte.d.ts +50 -38
- package/dist/locale-provider/README.md +1 -6
- package/dist/menu/README.md +6 -15
- package/dist/menu/content/menu-content.svelte +14 -10
- package/dist/menu/content/menu-content.svelte.d.ts +14 -10
- package/dist/menu/context-trigger/menu-context-trigger.svelte +8 -9
- package/dist/menu/context-trigger/menu-context-trigger.svelte.d.ts +8 -9
- package/dist/menu/group/menu-group-label.svelte +1 -1
- package/dist/menu/group/menu-group-label.svelte.d.ts +1 -1
- package/dist/menu/item/menu-item.svelte +11 -8
- package/dist/menu/item/menu-item.svelte.d.ts +11 -8
- package/dist/menu/overlay/menu-overlay.svelte +1 -1
- package/dist/menu/overlay/menu-overlay.svelte.d.ts +1 -1
- package/dist/menu/root/context.d.ts +6 -3
- package/dist/menu/root/menu-root.svelte +14 -8
- package/dist/menu/root/menu-root.svelte.d.ts +14 -8
- package/dist/menu/root/menu-state.svelte.d.ts +1 -1
- package/dist/menu/separator/menu-separator.svelte +1 -1
- package/dist/menu/separator/menu-separator.svelte.d.ts +1 -1
- package/dist/menu/submenu/menu-submenu-root.svelte +10 -7
- package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +10 -7
- package/dist/numberfield/root/README.md +1 -1
- package/dist/numberfield/scrub-area-cursor/README.md +1 -1
- package/dist/popover/README.md +1 -1
- package/dist/popover/content/popover-content.svelte +19 -14
- package/dist/popover/content/popover-content.svelte.d.ts +19 -14
- package/dist/popover/overlay/popover-overlay.svelte +1 -1
- package/dist/popover/overlay/popover-overlay.svelte.d.ts +1 -1
- package/dist/popover/root/README.md +1 -1
- package/dist/popover/root/popover-root.svelte +13 -10
- package/dist/popover/root/popover-root.svelte.d.ts +13 -10
- package/dist/popover/trigger/README.md +1 -1
- package/dist/primitives/floating.d.ts +3 -3
- package/dist/primitives/scroll-lock.js +37 -8
- package/dist/switch/root/README.md +2 -2
- package/dist/switch/root/switch-root.svelte +23 -18
- package/dist/switch/root/switch-root.svelte.d.ts +23 -18
- package/dist/switch/thumb/switch-thumb.svelte +1 -1
- package/dist/switch/thumb/switch-thumb.svelte.d.ts +1 -1
- package/dist/table/README.md +15 -10
- package/dist/table/checkbox-indicator/README.md +1 -1
- package/dist/table/column-resizer/README.md +2 -2
- package/dist/table/root/README.md +1 -1
- package/dist/table/sort-trigger/README.md +1 -1
- package/dist/table/types.d.ts +21 -20
- package/dist/tabs/types.d.ts +6 -6
- package/dist/timepicker/README.md +3 -2
- package/dist/timepicker/input/README.md +1 -1
- package/dist/timepicker/input/time-picker-input.svelte +58 -5
- package/dist/timepicker/input/time-picker-input.svelte.d.ts +10 -1
- package/dist/timepicker/root/README.md +1 -1
- package/dist/timepicker/trigger/README.md +1 -1
- package/dist/toggle/README.md +1 -1
- package/dist/toggle-group/README.md +6 -0
- package/dist/toggle-group/root/context.svelte.d.ts +1 -1
- package/dist/toggle-group/root/context.svelte.js +20 -11
- package/dist/toggle-group/root/toggle-group-root.svelte +20 -15
- package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte +13 -0
- package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte.d.ts +7 -0
- package/dist/toggle-group/types.d.ts +9 -9
- package/dist/transfer-list/README.md +6 -17
- package/dist/transfer-list/item/transfer-list-item.svelte +4 -4
- package/dist/transfer-list/item/transfer-list-item.svelte.d.ts +4 -4
- package/dist/transfer-list/list/transfer-list-list.svelte +12 -12
- package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +12 -12
- package/dist/transfer-list/move/transfer-list-move-button.svelte +4 -4
- package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +4 -4
- package/dist/transfer-list/move/transfer-list-reorder-button.svelte +3 -3
- package/dist/transfer-list/move/transfer-list-reorder-button.svelte.d.ts +3 -3
- package/dist/transfer-list/root/transfer-list-root.svelte +23 -20
- package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +23 -20
- package/dist/transfer-list/status/transfer-list-status.svelte +1 -1
- package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +1 -1
- package/dist/tree/README.md +3 -3
- package/dist/tree/checkbox-indicator/README.md +1 -1
- package/dist/tree/root/README.md +1 -1
- package/dist/tree/types.d.ts +19 -10
- package/package.json +1 -1
|
@@ -18,50 +18,59 @@
|
|
|
18
18
|
} from '../../primitives/input-modality';
|
|
19
19
|
|
|
20
20
|
type ComboBoxProps<T> = {
|
|
21
|
-
/**
|
|
21
|
+
/** A stable id, from which the component makes its internal ARIA ids. Give one on a server. */
|
|
22
22
|
id?: string;
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
pending?: boolean;
|
|
25
25
|
readonly?: boolean;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The selected value or values: one value in the single mode, and an array in the multiple mode.
|
|
28
|
+
* You can bind it with `bind:value`.
|
|
29
|
+
*/
|
|
27
30
|
value?: string | number | null | (string | number)[];
|
|
28
31
|
defaultValue?: string | number | null | (string | number)[];
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
31
|
-
* and
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* Give your own code full control of the selection. The component stops to write back to
|
|
34
|
+
* `value`, and it reports only through `onChange`. Thus the parent can refuse a change: the
|
|
35
|
+
* parent does not send the new value down. The default is off, because `bind:value` is the usual
|
|
36
|
+
* case and it needs the write-back.
|
|
34
37
|
*/
|
|
35
38
|
controlledValue?: boolean;
|
|
36
|
-
/**
|
|
39
|
+
/** The text in the input. You can bind it with `bind:inputValue`. */
|
|
37
40
|
inputValue?: string;
|
|
38
41
|
defaultInputValue?: string;
|
|
39
|
-
/**
|
|
42
|
+
/** Give your own code full control of the input text. Read `controlledValue`. */
|
|
40
43
|
controlledInputValue?: boolean;
|
|
41
44
|
selectionBehavior?: 'toggle' | 'replace';
|
|
42
45
|
selectionMode?: 'single' | 'multiple';
|
|
43
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Closes the popover after a selection. The default is true in the single mode, and false in the
|
|
48
|
+
* multiple mode.
|
|
49
|
+
*/
|
|
44
50
|
closeOnSelect?: boolean;
|
|
45
|
-
/**
|
|
51
|
+
/** The open state of the popover. You can bind it with `bind:open`. */
|
|
46
52
|
open?: boolean;
|
|
47
|
-
/**
|
|
53
|
+
/** Give your own code full control of the open state. Read `controlledValue`. */
|
|
48
54
|
controlledOpen?: boolean;
|
|
49
|
-
/**
|
|
55
|
+
/** What opens the popover: 'focus', 'input', or 'press'. The default is 'press'. */
|
|
50
56
|
trigger?: 'focus' | 'input' | 'press';
|
|
51
|
-
/**
|
|
57
|
+
/** The function that filters the items locally. Set it to null to stop the local filter. */
|
|
52
58
|
filter?: ComboBoxFilter | null;
|
|
53
|
-
/**
|
|
59
|
+
/** Puts the items that have an `onAction` function into the local filter. */
|
|
54
60
|
filterActionItems?: boolean;
|
|
55
61
|
onInputChange?: (value: string) => void;
|
|
56
62
|
onOpenChange?: (open: boolean) => void;
|
|
57
63
|
onChange?: (value: string | number | null | (string | number)[]) => void;
|
|
58
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* The array of the items. The component uses it to find the names of the selected values before
|
|
66
|
+
* the options go into the DOM.
|
|
67
|
+
*/
|
|
59
68
|
items?: T[];
|
|
60
69
|
children?: Snippet;
|
|
61
70
|
class?: string;
|
|
62
|
-
/**
|
|
71
|
+
/** The accessible name of the combobox group. */
|
|
63
72
|
'aria-label'?: string;
|
|
64
|
-
/**
|
|
73
|
+
/** The id of the element that gives this combobox group its name. */
|
|
65
74
|
'aria-labelledby'?: string;
|
|
66
75
|
};
|
|
67
76
|
|
|
@@ -1,50 +1,59 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
2
|
import { type ComboBoxFilter } from './context';
|
|
3
3
|
type ComboBoxProps<T> = {
|
|
4
|
-
/**
|
|
4
|
+
/** A stable id, from which the component makes its internal ARIA ids. Give one on a server. */
|
|
5
5
|
id?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
pending?: boolean;
|
|
8
8
|
readonly?: boolean;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The selected value or values: one value in the single mode, and an array in the multiple mode.
|
|
11
|
+
* You can bind it with `bind:value`.
|
|
12
|
+
*/
|
|
10
13
|
value?: string | number | null | (string | number)[];
|
|
11
14
|
defaultValue?: string | number | null | (string | number)[];
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
14
|
-
* and
|
|
15
|
-
*
|
|
16
|
-
*
|
|
16
|
+
* Give your own code full control of the selection. The component stops to write back to
|
|
17
|
+
* `value`, and it reports only through `onChange`. Thus the parent can refuse a change: the
|
|
18
|
+
* parent does not send the new value down. The default is off, because `bind:value` is the usual
|
|
19
|
+
* case and it needs the write-back.
|
|
17
20
|
*/
|
|
18
21
|
controlledValue?: boolean;
|
|
19
|
-
/**
|
|
22
|
+
/** The text in the input. You can bind it with `bind:inputValue`. */
|
|
20
23
|
inputValue?: string;
|
|
21
24
|
defaultInputValue?: string;
|
|
22
|
-
/**
|
|
25
|
+
/** Give your own code full control of the input text. Read `controlledValue`. */
|
|
23
26
|
controlledInputValue?: boolean;
|
|
24
27
|
selectionBehavior?: 'toggle' | 'replace';
|
|
25
28
|
selectionMode?: 'single' | 'multiple';
|
|
26
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Closes the popover after a selection. The default is true in the single mode, and false in the
|
|
31
|
+
* multiple mode.
|
|
32
|
+
*/
|
|
27
33
|
closeOnSelect?: boolean;
|
|
28
|
-
/**
|
|
34
|
+
/** The open state of the popover. You can bind it with `bind:open`. */
|
|
29
35
|
open?: boolean;
|
|
30
|
-
/**
|
|
36
|
+
/** Give your own code full control of the open state. Read `controlledValue`. */
|
|
31
37
|
controlledOpen?: boolean;
|
|
32
|
-
/**
|
|
38
|
+
/** What opens the popover: 'focus', 'input', or 'press'. The default is 'press'. */
|
|
33
39
|
trigger?: 'focus' | 'input' | 'press';
|
|
34
|
-
/**
|
|
40
|
+
/** The function that filters the items locally. Set it to null to stop the local filter. */
|
|
35
41
|
filter?: ComboBoxFilter | null;
|
|
36
|
-
/**
|
|
42
|
+
/** Puts the items that have an `onAction` function into the local filter. */
|
|
37
43
|
filterActionItems?: boolean;
|
|
38
44
|
onInputChange?: (value: string) => void;
|
|
39
45
|
onOpenChange?: (open: boolean) => void;
|
|
40
46
|
onChange?: (value: string | number | null | (string | number)[]) => void;
|
|
41
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* The array of the items. The component uses it to find the names of the selected values before
|
|
49
|
+
* the options go into the DOM.
|
|
50
|
+
*/
|
|
42
51
|
items?: T[];
|
|
43
52
|
children?: Snippet;
|
|
44
53
|
class?: string;
|
|
45
|
-
/**
|
|
54
|
+
/** The accessible name of the combobox group. */
|
|
46
55
|
'aria-label'?: string;
|
|
47
|
-
/**
|
|
56
|
+
/** The id of the element that gives this combobox group its name. */
|
|
48
57
|
'aria-labelledby'?: string;
|
|
49
58
|
};
|
|
50
59
|
declare function $$render<T extends object = object>(): {
|
|
@@ -13,7 +13,7 @@ Description: Visually-hidden `aria-live="polite"` region that announces the numb
|
|
|
13
13
|
|
|
14
14
|
## Notes
|
|
15
15
|
|
|
16
|
-
- The count includes disabled
|
|
16
|
+
- The count includes a disabled item that the user sees. Thus it agrees with the list on the screen.
|
|
17
17
|
- The default message is localized through `LocaleProvider` (`combobox.noResults`, `combobox.oneResult`, `combobox.multipleResults`).
|
|
18
18
|
- The region only announces while the popover is open; when closed it renders an empty message, so closing never announces "no results".
|
|
19
19
|
- Mirrors `Autocomplete.Status`.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* closed combobox would otherwise incorrectly announce "no results".
|
|
14
14
|
*/
|
|
15
15
|
type ComboBoxStatusProps = {
|
|
16
|
-
/**
|
|
16
|
+
/** Makes the announced message from the number of the items that the user sees. */
|
|
17
17
|
formatMessage?: (count: number) => string;
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* closed combobox would otherwise incorrectly announce "no results".
|
|
8
8
|
*/
|
|
9
9
|
type ComboBoxStatusProps = {
|
|
10
|
-
/**
|
|
10
|
+
/** Makes the announced message from the number of the items that the user sees. */
|
|
11
11
|
formatMessage?: (count: number) => string;
|
|
12
12
|
};
|
|
13
13
|
declare const ComboboxStatus: import("svelte").Component<ComboBoxStatusProps, {}, "">;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
### ComboBox.Tag
|
|
6
6
|
|
|
7
7
|
Name: `ComboBox.Tag`
|
|
8
|
-
Description:
|
|
8
|
+
Description: One tag, for one selected value, in the multiple selection mode.
|
|
9
9
|
|
|
10
10
|
| Prop | Type | Default | Description |
|
|
11
11
|
| -------------- | --------------------------------- | ----------- | ------------------------------------ |
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Supports keyboard navigation: ArrowLeft/Right to navigate, Delete/Backspace to remove, ArrowDown to focus input.
|
|
22
22
|
*/
|
|
23
23
|
type ComboBoxTagProps = {
|
|
24
|
-
/**
|
|
24
|
+
/** The content of the tag. For the remove button, use ComboBox.TagRemove. */
|
|
25
25
|
children: Snippet;
|
|
26
26
|
class?: string;
|
|
27
27
|
} & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;
|
|
@@ -13,7 +13,7 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
13
13
|
* Supports keyboard navigation: ArrowLeft/Right to navigate, Delete/Backspace to remove, ArrowDown to focus input.
|
|
14
14
|
*/
|
|
15
15
|
type ComboBoxTagProps = {
|
|
16
|
-
/**
|
|
16
|
+
/** The content of the tag. For the remove button, use ComboBox.TagRemove. */
|
|
17
17
|
children: Snippet;
|
|
18
18
|
class?: string;
|
|
19
19
|
} & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;
|
|
@@ -10,5 +10,5 @@ Description: Remove action button for a selected tag.
|
|
|
10
10
|
| Prop | Type | Default | Description |
|
|
11
11
|
| -------------- | ---------------------- | ----------- | --------------------------------------------------------------- |
|
|
12
12
|
| `children` | `Snippet` | `X icon` | Custom button content. |
|
|
13
|
-
| `class` | `string` | `undefined` | CSS class names
|
|
13
|
+
| `class` | `string` | `undefined` | The CSS class names of the remove button. |
|
|
14
14
|
| `...restProps` | `HTMLButtonAttributes` | `-` | Additional button attributes, excluding reserved trigger props. |
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
* Must be used inside ComboBox.Tag.
|
|
11
11
|
*/
|
|
12
12
|
type ComboBoxTagRemoveProps = {
|
|
13
|
-
/**
|
|
13
|
+
/** The content of the button. The default is an X icon. */
|
|
14
14
|
children?: Snippet;
|
|
15
15
|
class?: string;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* translate the verb, or to name the tag
|
|
19
|
-
*
|
|
20
|
-
* programmatically and the option never rendered).
|
|
17
|
+
* The accessible name of the button. The default is `Remove <tag label>`. Replace it to
|
|
18
|
+
* translate the verb, or to name the tag with a different text. The default label is the raw
|
|
19
|
+
* value when your code sets the selection and the option never goes into the DOM.
|
|
21
20
|
*/
|
|
22
21
|
'aria-label'?: string;
|
|
23
22
|
} & Omit<HTMLButtonAttributes, 'class' | 'children' | 'type' | 'onclick' | 'aria-label'>;
|
|
@@ -5,14 +5,13 @@ import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
|
5
5
|
* Must be used inside ComboBox.Tag.
|
|
6
6
|
*/
|
|
7
7
|
type ComboBoxTagRemoveProps = {
|
|
8
|
-
/**
|
|
8
|
+
/** The content of the button. The default is an X icon. */
|
|
9
9
|
children?: Snippet;
|
|
10
10
|
class?: string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* translate the verb, or to name the tag
|
|
14
|
-
*
|
|
15
|
-
* programmatically and the option never rendered).
|
|
12
|
+
* The accessible name of the button. The default is `Remove <tag label>`. Replace it to
|
|
13
|
+
* translate the verb, or to name the tag with a different text. The default label is the raw
|
|
14
|
+
* value when your code sets the selection and the option never goes into the DOM.
|
|
16
15
|
*/
|
|
17
16
|
'aria-label'?: string;
|
|
18
17
|
} & Omit<HTMLButtonAttributes, 'class' | 'children' | 'type' | 'onclick' | 'aria-label'>;
|
|
@@ -10,7 +10,7 @@ Description: Container that renders selected values as tags in multiple mode.
|
|
|
10
10
|
| Prop | Type | Default | Description |
|
|
11
11
|
| ---------- | ------------------------------ | ---------- | --------------------------------------------------------------------------------- |
|
|
12
12
|
| `children` | `Snippet<[{ item: TagItem }]>` | `required` | Render function that receives each selected item as `{ item: { value, label } }`. |
|
|
13
|
-
| `class` | `string` | `''` | CSS class names
|
|
13
|
+
| `class` | `string` | `''` | The CSS class names of the tags container. |
|
|
14
14
|
|
|
15
15
|
### TagItem type
|
|
16
16
|
|
|
@@ -22,25 +22,25 @@
|
|
|
22
22
|
* component only adapts it to the combobox (selection -> items, per-tag context).
|
|
23
23
|
*/
|
|
24
24
|
type ComboBoxTagsProps = {
|
|
25
|
-
/**
|
|
25
|
+
/** The snippet that makes each tag. It receives { item: { value, label } }. */
|
|
26
26
|
children: Snippet<[{ item: TagItem }]>;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
28
|
+
* An optional indicator for the tags that do not fit. With it, the tag row stays on one line.
|
|
29
|
+
* The component makes no tag that does not fit, and it puts this snippet at the end with the
|
|
30
|
+
* number of the hidden tags. The snippet also receives `visible` and `total`, thus you can show
|
|
31
|
+
* a summary when no tag fits. Make one element in it.
|
|
32
|
+
*
|
|
33
|
+
* Without `overflow`, the component makes each tag, and your styles decide how the row wraps.
|
|
34
34
|
*/
|
|
35
35
|
overflow?: Snippet<[TagsOverflow]>;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
* the search input
|
|
39
|
-
*
|
|
37
|
+
* The horizontal space to keep free in the parent, in px, for an element beside the tags such as
|
|
38
|
+
* the search input. Thus the calculation does not take the full row. The component uses it only
|
|
39
|
+
* with `overflow`.
|
|
40
40
|
*/
|
|
41
41
|
reserve?: number;
|
|
42
42
|
class?: string;
|
|
43
|
-
/**
|
|
43
|
+
/** The accessible name of the tag row. The default is `Selected values`. */
|
|
44
44
|
'aria-label'?: string;
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -14,27 +14,27 @@ export type TagsOverflow = OverflowRowState;
|
|
|
14
14
|
* component only adapts it to the combobox (selection -> items, per-tag context).
|
|
15
15
|
*/
|
|
16
16
|
type ComboBoxTagsProps = {
|
|
17
|
-
/**
|
|
17
|
+
/** The snippet that makes each tag. It receives { item: { value, label } }. */
|
|
18
18
|
children: Snippet<[{
|
|
19
19
|
item: TagItem;
|
|
20
20
|
}]>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
22
|
+
* An optional indicator for the tags that do not fit. With it, the tag row stays on one line.
|
|
23
|
+
* The component makes no tag that does not fit, and it puts this snippet at the end with the
|
|
24
|
+
* number of the hidden tags. The snippet also receives `visible` and `total`, thus you can show
|
|
25
|
+
* a summary when no tag fits. Make one element in it.
|
|
26
|
+
*
|
|
27
|
+
* Without `overflow`, the component makes each tag, and your styles decide how the row wraps.
|
|
28
28
|
*/
|
|
29
29
|
overflow?: Snippet<[TagsOverflow]>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
* the search input
|
|
33
|
-
*
|
|
31
|
+
* The horizontal space to keep free in the parent, in px, for an element beside the tags such as
|
|
32
|
+
* the search input. Thus the calculation does not take the full row. The component uses it only
|
|
33
|
+
* with `overflow`.
|
|
34
34
|
*/
|
|
35
35
|
reserve?: number;
|
|
36
36
|
class?: string;
|
|
37
|
-
/**
|
|
37
|
+
/** The accessible name of the tag row. The default is `Selected values`. */
|
|
38
38
|
'aria-label'?: string;
|
|
39
39
|
};
|
|
40
40
|
declare const ComboboxTags: import("svelte").Component<ComboBoxTagsProps, {}, "">;
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
Name: `ComboBox.Trigger`
|
|
8
8
|
Description: Optional trigger button that toggles the combobox popover without stealing focus from the input.
|
|
9
9
|
|
|
10
|
-
| Prop | Type | Default | Description
|
|
11
|
-
| -------------- | ---------------------- | ----------- |
|
|
12
|
-
| `class` | `string` | `undefined` | CSS class names
|
|
13
|
-
| `children` | `Snippet` | `undefined` |
|
|
14
|
-
| `tabindex` | `number` | `-1` | Tab index applied to the trigger button.
|
|
15
|
-
| `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes.
|
|
10
|
+
| Prop | Type | Default | Description |
|
|
11
|
+
| -------------- | ---------------------- | ----------- | --------------------------------------------------------------------------------------- |
|
|
12
|
+
| `class` | `string` | `undefined` | The CSS class names of the trigger element. |
|
|
13
|
+
| `children` | `Snippet` | `undefined` | Your own content for the trigger. If you give none, the component makes a chevron icon. |
|
|
14
|
+
| `tabindex` | `number` | `-1` | Tab index applied to the trigger button. |
|
|
15
|
+
| `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes. |
|
|
16
16
|
|
|
17
17
|
## Notes
|
|
18
18
|
|
|
19
19
|
- `ComboBox.Trigger` reflects the root pending state through `data-pending`.
|
|
20
20
|
- While the combobox is disabled, read-only, or pending, the trigger becomes non-interactive.
|
|
21
|
-
- The trigger
|
|
21
|
+
- The trigger obeys the `click` event. Thus the `Enter` key and the `Space` key work when the trigger can take the focus, for example with `tabindex={0}`. The component stops the pointer press, thus the trigger never takes the DOM focus from the input.
|
|
22
22
|
- `aria-controls` is only exposed while the popover is open, because the listbox does not exist in the DOM while closed.
|
|
23
23
|
- `ComboBox.Button` remains available as a compatibility alias.
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
|
|
87
87
|
## UX Decisions
|
|
88
88
|
|
|
89
|
-
- **No Date Auto-Correction:**
|
|
90
|
-
-
|
|
91
|
-
-
|
|
89
|
+
- **No Date Auto-Correction:** The user can type a date out of the limits of `minValue` and `maxValue`, or an unavailable date. The DatePicker does not correct that date, and it does not remove it. It exposes `aria-invalid="true"` and `data-invalid` on the input, so the user sees what they typed and that it is refused. Auto-correcting input without explicit user consent is an inaccessible anti-pattern.
|
|
90
|
+
- A refused date is still a value: the component sends the date through `onChange` and `value`, also when the limits refuse it. With `null`, the input would show a date and your code would read an empty field. That is how a form prints "required" below a control that has a value. A refusal travels as an invalid state, and not as an absent value. Thus the layer with the rule, usually a form schema, writes the error text. Typing bypasses the bounds this way; the Calendar does not — a disabled day is never selectable by pointer or keyboard.
|
|
91
|
+
- Disabled dates keep the focus: in the Calendar, the keyboard still goes to a disabled date. Thus the ARIA grid navigation stays complete. A screen reader announces each cell and says "disabled". Without this, the focus would go past those cells and confuse the user.
|
|
92
92
|
|
|
93
93
|
## Focus behavior decisions
|
|
94
94
|
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
- Trigger focus restore after calendar close is modality-aware:
|
|
98
98
|
- keyboard close paths keep visible focus,
|
|
99
99
|
- pointer outside close restores focus without visible focus.
|
|
100
|
-
- The component
|
|
100
|
+
- The component calls `trackInteractionModality(...)` in its own handlers. Thus the modality is correct before the focus-state code runs.
|
|
101
101
|
- Cross-component focus contract and invariants are documented in `FOCUS_STATE_CONTRACT.md`.
|
|
@@ -24,10 +24,9 @@
|
|
|
24
24
|
> & {
|
|
25
25
|
id?: string;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* into it) — dates are entered through the editable segments.
|
|
27
|
+
* The name of the hidden input for the form submission. That input only holds the value. It does
|
|
28
|
+
* not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
|
|
29
|
+
* not write in it. The user types the date in the segments.
|
|
31
30
|
*/
|
|
32
31
|
name?: string;
|
|
33
32
|
children?: Snippet<[DatePickerSegmentPart]>;
|
|
@@ -4,10 +4,9 @@ import { type DatePickerSegmentPart } from '../root/context';
|
|
|
4
4
|
type DatePickerInputProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'id' | 'role' | 'tabindex' | 'onmousedown' | 'onfocus' | 'onblur' | 'onfocusout' | 'onkeydown' | 'aria-invalid'> & {
|
|
5
5
|
id?: string;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* into it) — dates are entered through the editable segments.
|
|
7
|
+
* The name of the hidden input for the form submission. That input only holds the value. It does
|
|
8
|
+
* not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
|
|
9
|
+
* not write in it. The user types the date in the segments.
|
|
11
10
|
*/
|
|
12
11
|
name?: string;
|
|
13
12
|
children?: Snippet<[DatePickerSegmentPart]>;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
isDateUnavailable,
|
|
79
79
|
open = $bindable(),
|
|
80
80
|
defaultOpen = false,
|
|
81
|
-
/**
|
|
81
|
+
/** Give your own code full control of the open state. Read `controlledValue`. */
|
|
82
82
|
controlledOpen = false,
|
|
83
83
|
onOpenChange,
|
|
84
84
|
closeOnSelect = true,
|
|
@@ -10,5 +10,5 @@ Description: Button part that toggles `DatePicker.Popover` and anchors positioni
|
|
|
10
10
|
| Prop | Type | Default | Description |
|
|
11
11
|
| -------------- | ---------------------- | ----------- | ------------------------------------------------------ |
|
|
12
12
|
| `children` | `Snippet` | `undefined` | Optional trigger content. |
|
|
13
|
-
| `class` | `string` | `''` | CSS class names
|
|
13
|
+
| `class` | `string` | `''` | The CSS class names of the trigger button. |
|
|
14
14
|
| `...restProps` | `HTMLButtonAttributes` | `-` | Additional button attributes forwarded to the trigger. |
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
## Usage guidelines
|
|
55
55
|
|
|
56
|
-
- Use `value`
|
|
56
|
+
- Use `value` and `onChange` when your own code controls the state. Use `defaultValue` when the component controls it. The value is a `{ start, end }` pair, and the empty state is `null`. `DatePicker` uses the same contract.
|
|
57
57
|
- Always render one input with `part="start"` and one with `part="end"`, and pass the same `part` to their segments.
|
|
58
58
|
- Use `open` / `defaultOpen` / `onOpenChange` to control the popover, and `closeOnSelect` to keep it open after the range is confirmed.
|
|
59
59
|
- Use `minValue` / `maxValue` (`YYYY-MM-DD`) to constrain both the calendar and the typed inputs, and `isDateUnavailable` to mark specific days as non-selectable.
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
|
|
66
66
|
- Give each input its own accessible name (for example `aria-label="Start date"` and `aria-label="End date"`).
|
|
67
67
|
- Segment accessible names are resolved automatically from the active locale.
|
|
68
|
-
-
|
|
69
|
-
-
|
|
68
|
+
- Each input has its own validity. The text in the segments of one input can be an invalid date. Those segments then get `aria-invalid`, and assistive technology announces it on the spinbuttons. The input group gets `data-invalid`, for the styles. Empty text is never invalid. The component shows the text of the user and never corrects it. The DatePicker README has the same contract.
|
|
69
|
+
- A disabled date in the calendar keeps the focus. Thus a screen reader can find it and announce it as disabled.
|
|
70
70
|
- In the range calendar, the first selection starts the range, arrow keys extend the preview, and `Enter` or `Space` confirms it.
|
|
71
71
|
|
|
72
72
|
## Notes
|
|
@@ -29,10 +29,9 @@
|
|
|
29
29
|
part: DateRangePickerRangePart;
|
|
30
30
|
id?: string;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* into it) — dates are entered through the editable segments.
|
|
32
|
+
* The name of the hidden input for the form submission. That input only holds the value. It does
|
|
33
|
+
* not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
|
|
34
|
+
* not write in it. The user types the date in the segments.
|
|
36
35
|
*/
|
|
37
36
|
name?: string;
|
|
38
37
|
children?: Snippet<[DatePickerSegmentPart]>;
|
|
@@ -5,10 +5,9 @@ type DateRangePickerInputProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'
|
|
|
5
5
|
part: DateRangePickerRangePart;
|
|
6
6
|
id?: string;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* into it) — dates are entered through the editable segments.
|
|
8
|
+
* The name of the hidden input for the form submission. That input only holds the value. It does
|
|
9
|
+
* not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
|
|
10
|
+
* not write in it. The user types the date in the segments.
|
|
12
11
|
*/
|
|
13
12
|
name?: string;
|
|
14
13
|
children?: Snippet<[DatePickerSegmentPart]>;
|
package/dist/dialog/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
- Use `Dialog.Trigger` as the opener button.
|
|
11
11
|
- Render modal layers inside `Dialog.Portal`.
|
|
12
12
|
- Use `Dialog.Overlay` and `Dialog.Content` together for standard modal behavior.
|
|
13
|
-
- Use nested `Dialog.Root`
|
|
13
|
+
- Use nested `Dialog.Root` parts when you need a stack. The component controls which dialog is on top.
|
|
14
14
|
- Always give the dialog a `Dialog.Title`. A `role="dialog"` takes its name from `aria-labelledby`, not from the text inside it, so a bare heading leaves the dialog unnamed.
|
|
15
15
|
|
|
16
16
|
## Anatomy
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
* but usable at any depth without threading it down.
|
|
12
12
|
*/
|
|
13
13
|
export type DialogCloseProps = Omit<HTMLButtonAttributes, 'type' | 'class' | 'children'> & {
|
|
14
|
-
/**
|
|
14
|
+
/** The name on the button. */
|
|
15
15
|
children?: Snippet;
|
|
16
|
-
/** CSS class
|
|
16
|
+
/** The CSS class names of the button. */
|
|
17
17
|
class?: string;
|
|
18
|
-
/**
|
|
18
|
+
/** A bindable reference to the button element. */
|
|
19
19
|
element?: HTMLButtonElement | null;
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -7,11 +7,11 @@ import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
|
7
7
|
* but usable at any depth without threading it down.
|
|
8
8
|
*/
|
|
9
9
|
export type DialogCloseProps = Omit<HTMLButtonAttributes, 'type' | 'class' | 'children'> & {
|
|
10
|
-
/**
|
|
10
|
+
/** The name on the button. */
|
|
11
11
|
children?: Snippet;
|
|
12
|
-
/** CSS class
|
|
12
|
+
/** The CSS class names of the button. */
|
|
13
13
|
class?: string;
|
|
14
|
-
/**
|
|
14
|
+
/** A bindable reference to the button element. */
|
|
15
15
|
element?: HTMLButtonElement | null;
|
|
16
16
|
};
|
|
17
17
|
declare const DialogClose: import("svelte").Component<DialogCloseProps, {}, "element">;
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
* Must be used inside a Dialog.Portal.
|
|
24
24
|
*/
|
|
25
25
|
type DialogContentProps = {
|
|
26
|
-
/**
|
|
26
|
+
/** The content of the dialog. */
|
|
27
27
|
children?: Snippet;
|
|
28
|
-
/** CSS class
|
|
28
|
+
/** The CSS class names of the dialog container. */
|
|
29
29
|
class?: string;
|
|
30
|
-
/**
|
|
30
|
+
/** Closes the dialog when the user clicks outside it. */
|
|
31
31
|
shouldCloseOnInteractOutside?: boolean;
|
|
32
|
-
/**
|
|
32
|
+
/** Closes the dialog when the user pushes the `Escape` key. */
|
|
33
33
|
shouldCloseOnEscape?: boolean;
|
|
34
34
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
|
|
35
35
|
|