@human-kit/ui 1.0.0-beta.5 → 1.0.0-beta.7
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/autocomplete-item.svelte +10 -0
- 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 +24 -10
- package/dist/button/root/button-root.svelte.d.ts +15 -10
- package/dist/calendar/README.md +3 -3
- package/dist/calendar/body-cell/calendar-body-cell.svelte +7 -0
- 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/indicator/checkbox-indicator.svelte +1 -0
- package/dist/checkbox/indicator/checkbox-indicator.svelte.d.ts +1 -0
- package/dist/checkbox/root/README.md +2 -2
- package/dist/checkbox/root/checkbox-root.svelte +118 -40
- package/dist/checkbox/root/checkbox-root.svelte.d.ts +17 -10
- package/dist/checkbox-group/README.md +95 -0
- package/dist/checkbox-group/index.d.ts +15 -0
- package/dist/checkbox-group/index.js +6 -0
- package/dist/checkbox-group/index.parts.d.ts +4 -0
- package/dist/checkbox-group/index.parts.js +7 -0
- package/dist/checkbox-group/label/checkbox-group-label.svelte +36 -0
- package/dist/checkbox-group/label/checkbox-group-label.svelte.d.ts +4 -0
- package/dist/checkbox-group/root/checkbox-group-root.svelte +118 -0
- package/dist/checkbox-group/root/checkbox-group-root.svelte.d.ts +4 -0
- package/dist/checkbox-group/root/context.svelte.d.ts +52 -0
- package/dist/checkbox-group/root/context.svelte.js +251 -0
- package/dist/checkbox-group/types.d.ts +57 -0
- package/dist/checkbox-group/types.js +1 -0
- 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/index.d.ts +4 -0
- package/dist/index.js +4 -0
- 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/focus-visible.svelte.d.ts +14 -0
- package/dist/primitives/focus-visible.svelte.js +19 -0
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +1 -0
- package/dist/primitives/input-modality.d.ts +7 -0
- package/dist/primitives/input-modality.js +32 -5
- package/dist/primitives/scroll-lock.js +37 -8
- package/dist/radio-group/README.md +103 -0
- package/dist/radio-group/index.d.ts +18 -0
- package/dist/radio-group/index.js +9 -0
- package/dist/radio-group/index.parts.d.ts +4 -0
- package/dist/radio-group/index.parts.js +4 -0
- package/dist/radio-group/indicator/radio-group-indicator.svelte +43 -0
- package/dist/radio-group/indicator/radio-group-indicator.svelte.d.ts +12 -0
- package/dist/radio-group/item/context.d.ts +18 -0
- package/dist/radio-group/item/context.js +15 -0
- package/dist/radio-group/item/radio-group-item.svelte +377 -0
- package/dist/radio-group/item/radio-group-item.svelte.d.ts +35 -0
- package/dist/radio-group/label/radio-group-label.svelte +37 -0
- package/dist/radio-group/label/radio-group-label.svelte.d.ts +4 -0
- package/dist/radio-group/root/context.svelte.d.ts +57 -0
- package/dist/radio-group/root/context.svelte.js +284 -0
- package/dist/radio-group/root/radio-group-root.svelte +193 -0
- package/dist/radio-group/root/radio-group-root.svelte.d.ts +4 -0
- package/dist/radio-group/types.d.ts +50 -0
- package/dist/radio-group/types.js +1 -0
- package/dist/switch/root/README.md +2 -2
- package/dist/switch/root/switch-root.svelte +32 -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-header-cell/table-column-header-cell.svelte +24 -0
- package/dist/table/column-resizer/README.md +2 -2
- package/dist/table/root/README.md +1 -1
- package/dist/table/root/table-root.svelte +29 -6
- 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 +66 -5
- package/dist/timepicker/input/time-picker-input.svelte.d.ts +18 -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/root/toggle-root.svelte +28 -0
- package/dist/toggle/root/toggle-root.svelte.d.ts +19 -0
- package/dist/toggle-group/README.md +8 -10
- package/dist/toggle-group/index.d.ts +2 -0
- package/dist/toggle-group/index.parts.d.ts +1 -0
- package/dist/toggle-group/index.parts.js +4 -0
- package/dist/toggle-group/types.d.ts +7 -6
- 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 +11 -1
package/dist/menu/README.md
CHANGED
|
@@ -12,8 +12,7 @@ primitives as `Popover`.
|
|
|
12
12
|
- Use `Menu.Root` to share open state and the trigger reference.
|
|
13
13
|
- Use `Menu.Trigger` as the opener button. `ArrowDown`/`Enter`/`Space` open the menu and focus the
|
|
14
14
|
first item; `ArrowUp` opens and focuses the last item.
|
|
15
|
-
- Use `Menu.ContextTrigger`
|
|
16
|
-
a button: right click, long press on touch, or `Shift+F10` / the `ContextMenu` key.
|
|
15
|
+
- Use `Menu.ContextTrigger` in place of `Menu.Trigger` to open the menu from a surface, and not from a button. It opens from a right click, a long press, the `Shift+F10` keys, or the `ContextMenu` key.
|
|
17
16
|
- Use `Menu.Content` inside `Menu.Root`. It renders the `role="menu"` panel in a portal and
|
|
18
17
|
positions it against the trigger (default placement `bottom-start`).
|
|
19
18
|
- Use `Menu.Item` for actions. Provide `onAction`, and optionally `disabled`, `closeOnSelect`, or
|
|
@@ -31,9 +30,7 @@ primitives as `Popover`.
|
|
|
31
30
|
typed text.
|
|
32
31
|
- Escape closes the current (topmost) menu and returns focus to its trigger. `Tab` and outside
|
|
33
32
|
interaction close the whole menu chain. Within a submenu, `ArrowLeft` closes just that level.
|
|
34
|
-
-
|
|
35
|
-
open submenu, hovering the sibling items it passes over does not close the submenu for a short
|
|
36
|
-
grace period, so the user can reach it without the submenu collapsing mid-path.
|
|
33
|
+
- A submenu uses a safe triangle for the pointer. While the pointer moves at an angle to the open submenu, the items that the pointer goes over do not close it. This continues for a short time. Thus the user gets to the submenu, and the submenu stays open.
|
|
37
34
|
|
|
38
35
|
## Context menus
|
|
39
36
|
|
|
@@ -41,14 +38,10 @@ primitives as `Popover`.
|
|
|
41
38
|
arbitrary — sometimes interactive — content. It opens the menu three ways, and each anchors the
|
|
42
39
|
panel differently:
|
|
43
40
|
|
|
44
|
-
-
|
|
45
|
-
`offset` to `0` for a context menu), unfolding down and to the right like a native one. Right
|
|
41
|
+
- A right click puts the menu at the pointer, against it. For a context menu, `Menu.Content` makes its default `offset` `0`. The panel opens down and to the right, like a native menu. Right
|
|
46
42
|
clicking again re-anchors the open menu instead of closing and reopening it.
|
|
47
43
|
- **Long press** on touch or pen — anchored at the finger. It is what makes the menu reachable at
|
|
48
|
-
all on a phone, where `contextmenu` is unreliable. The action
|
|
49
|
-
`contextmenu` the platform emits for the same gesture, and the surface sets
|
|
50
|
-
`-webkit-touch-callout: none; user-select: none` inline so iOS raises the menu instead of the
|
|
51
|
-
text callout. Turn either off with `longPress={false}` / `preventTouchCallout={false}`.
|
|
44
|
+
all on a phone, where `contextmenu` is unreliable. The action stops the `click` event and the `contextmenu` event of the same gesture. The surface also sets `-webkit-touch-callout: none; user-select: none` in its style attribute. Thus iOS shows the menu and not the text callout. Turn either off with `longPress={false}` / `preventTouchCallout={false}`.
|
|
52
45
|
- **`Shift+F10` or the `ContextMenu` key** — anchored to the surface itself, with the first item
|
|
53
46
|
focused. There is no pointer involved, so reusing the last cursor position would put the panel
|
|
54
47
|
somewhere the keyboard user never pointed at.
|
|
@@ -57,9 +50,7 @@ A left press anywhere — including on the surface itself — dismisses it, like
|
|
|
57
50
|
|
|
58
51
|
### Accessibility
|
|
59
52
|
|
|
60
|
-
|
|
61
|
-
`tabindex={-1}` when it lives inside a composite that already manages focus with a roving
|
|
62
|
-
tabindex, such as a table or a tree.
|
|
53
|
+
By default, the surface is a tab stop (`tabindex={0}`), thus a keyboard user can go to it. Give `tabindex={-1}` when the surface is in a component that already controls the focus with a roving tabindex, for example a table or a tree.
|
|
63
54
|
|
|
64
55
|
It carries `aria-keyshortcuts="Shift+F10"` and nothing else. `aria-haspopup` and `aria-expanded`
|
|
65
56
|
are **not** global ARIA properties: on a generic element they would be invalid, so the component
|
|
@@ -74,7 +65,7 @@ actions elsewhere in the UI.
|
|
|
74
65
|
- `onOpenChange(open, details)`
|
|
75
66
|
- `details.reason`: `trigger-press | imperative-action | none | escape-key | outside-press | focus-out | item-select`
|
|
76
67
|
- `details.event?`: native event that triggered the change when available
|
|
77
|
-
- `details.cancel()`:
|
|
68
|
+
- `details.cancel()`: stops the change of the open state
|
|
78
69
|
- `details.isCanceled`: reflects cancellation state inside the callback
|
|
79
70
|
|
|
80
71
|
## Anatomy
|
|
@@ -18,23 +18,27 @@
|
|
|
18
18
|
* Rendered in a Portal, positioned against the trigger.
|
|
19
19
|
*/
|
|
20
20
|
type MenuContentProps = {
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
21
|
+
/**
|
|
22
|
+
* The distance from the trigger element, on the main axis. The default is `4`. For a context
|
|
23
|
+
* menu it is `0`, because that menu goes at the pointer, like a native one.
|
|
24
|
+
*/
|
|
23
25
|
offset?: number;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
+
/**
|
|
27
|
+
* The position against the trigger element. The default is `bottom-start` for a root menu, and
|
|
28
|
+
* `right-start` for a submenu.
|
|
29
|
+
*/
|
|
26
30
|
placement?: ExtendedPlacement;
|
|
27
|
-
/**
|
|
31
|
+
/** Moves the panel to the opposite side when the space is not sufficient. */
|
|
28
32
|
shouldFlip?: boolean;
|
|
29
|
-
/**
|
|
33
|
+
/** The element that gives the limits of the position. */
|
|
30
34
|
boundaryElement?: Element | null;
|
|
31
|
-
/**
|
|
35
|
+
/** Closes the menu when the user pushes the `Escape` key. */
|
|
32
36
|
shouldCloseOnEscape?: boolean;
|
|
33
|
-
/**
|
|
37
|
+
/** Closes the menu when the user interacts outside it. */
|
|
34
38
|
shouldCloseOnInteractOutside?: boolean;
|
|
35
|
-
/**
|
|
39
|
+
/** The content of the menu. */
|
|
36
40
|
children?: Snippet;
|
|
37
|
-
/** CSS class
|
|
41
|
+
/** The CSS class names of the menu container. */
|
|
38
42
|
class?: string;
|
|
39
43
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children' | 'role'>;
|
|
40
44
|
|
|
@@ -6,23 +6,27 @@ import { type ExtendedPlacement } from '../../primitives/floating';
|
|
|
6
6
|
* Rendered in a Portal, positioned against the trigger.
|
|
7
7
|
*/
|
|
8
8
|
type MenuContentProps = {
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
9
|
+
/**
|
|
10
|
+
* The distance from the trigger element, on the main axis. The default is `4`. For a context
|
|
11
|
+
* menu it is `0`, because that menu goes at the pointer, like a native one.
|
|
12
|
+
*/
|
|
11
13
|
offset?: number;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
+
/**
|
|
15
|
+
* The position against the trigger element. The default is `bottom-start` for a root menu, and
|
|
16
|
+
* `right-start` for a submenu.
|
|
17
|
+
*/
|
|
14
18
|
placement?: ExtendedPlacement;
|
|
15
|
-
/**
|
|
19
|
+
/** Moves the panel to the opposite side when the space is not sufficient. */
|
|
16
20
|
shouldFlip?: boolean;
|
|
17
|
-
/**
|
|
21
|
+
/** The element that gives the limits of the position. */
|
|
18
22
|
boundaryElement?: Element | null;
|
|
19
|
-
/**
|
|
23
|
+
/** Closes the menu when the user pushes the `Escape` key. */
|
|
20
24
|
shouldCloseOnEscape?: boolean;
|
|
21
|
-
/**
|
|
25
|
+
/** Closes the menu when the user interacts outside it. */
|
|
22
26
|
shouldCloseOnInteractOutside?: boolean;
|
|
23
|
-
/**
|
|
27
|
+
/** The content of the menu. */
|
|
24
28
|
children?: Snippet;
|
|
25
|
-
/** CSS class
|
|
29
|
+
/** The CSS class names of the menu container. */
|
|
26
30
|
class?: string;
|
|
27
31
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children' | 'role'>;
|
|
28
32
|
declare const MenuContent: import("svelte").Component<MenuContentProps, {}, "">;
|
|
@@ -14,22 +14,21 @@
|
|
|
14
14
|
* semantics.
|
|
15
15
|
*/
|
|
16
16
|
export type MenuContextTriggerProps = {
|
|
17
|
-
/**
|
|
17
|
+
/** Disables the surface. The browser then shows its own context menu. */
|
|
18
18
|
disabled?: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/** Opens the menu from a long press with a finger or a pen. */
|
|
20
20
|
longPress?: boolean;
|
|
21
|
-
/**
|
|
21
|
+
/** The time of the long press, in ms. */
|
|
22
22
|
longPressDelay?: number;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* is meant to select.
|
|
24
|
+
* Stops the iOS text callout and the text selection on the surface. Without it, the long press
|
|
25
|
+
* does not work there. Set it to `false` when the surface has text that the user must select.
|
|
27
26
|
*/
|
|
28
27
|
preventTouchCallout?: boolean;
|
|
29
28
|
/**
|
|
30
|
-
*
|
|
31
|
-
* open the menu with Shift+F10.
|
|
32
|
-
*
|
|
29
|
+
* The position in the tab order. The default is `0`, thus a keyboard user can go to the surface
|
|
30
|
+
* and open the menu with the Shift+F10 keys. Give `-1` when the surface is in a component that
|
|
31
|
+
* already controls the focus with a roving tabindex, for example a table or a tree.
|
|
33
32
|
*/
|
|
34
33
|
tabindex?: number;
|
|
35
34
|
children?: Snippet;
|
|
@@ -9,22 +9,21 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
9
9
|
* semantics.
|
|
10
10
|
*/
|
|
11
11
|
export type MenuContextTriggerProps = {
|
|
12
|
-
/**
|
|
12
|
+
/** Disables the surface. The browser then shows its own context menu. */
|
|
13
13
|
disabled?: boolean;
|
|
14
|
-
/**
|
|
14
|
+
/** Opens the menu from a long press with a finger or a pen. */
|
|
15
15
|
longPress?: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/** The time of the long press, in ms. */
|
|
17
17
|
longPressDelay?: number;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* is meant to select.
|
|
19
|
+
* Stops the iOS text callout and the text selection on the surface. Without it, the long press
|
|
20
|
+
* does not work there. Set it to `false` when the surface has text that the user must select.
|
|
22
21
|
*/
|
|
23
22
|
preventTouchCallout?: boolean;
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
26
|
-
* open the menu with Shift+F10.
|
|
27
|
-
*
|
|
24
|
+
* The position in the tab order. The default is `0`, thus a keyboard user can go to the surface
|
|
25
|
+
* and open the menu with the Shift+F10 keys. Give `-1` when the surface is in a component that
|
|
26
|
+
* already controls the focus with a roving tabindex, for example a table or a tree.
|
|
28
27
|
*/
|
|
29
28
|
tabindex?: number;
|
|
30
29
|
children?: Snippet;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Menu.GroupLabel - Accessible label for a Menu.Group. Non-interactive.
|
|
8
8
|
*/
|
|
9
9
|
type MenuGroupLabelProps = {
|
|
10
|
-
/**
|
|
10
|
+
/** The id. If you give none, the component makes one. */
|
|
11
11
|
id?: string;
|
|
12
12
|
children?: Snippet;
|
|
13
13
|
class?: string;
|
|
@@ -4,7 +4,7 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
4
4
|
* Menu.GroupLabel - Accessible label for a Menu.Group. Non-interactive.
|
|
5
5
|
*/
|
|
6
6
|
type MenuGroupLabelProps = {
|
|
7
|
-
/**
|
|
7
|
+
/** The id. If you give none, the component makes one. */
|
|
8
8
|
id?: string;
|
|
9
9
|
children?: Snippet;
|
|
10
10
|
class?: string;
|
|
@@ -51,21 +51,24 @@
|
|
|
51
51
|
* Menu.Item - An interactive menu item (role="menuitem").
|
|
52
52
|
*/
|
|
53
53
|
type MenuItemProps = {
|
|
54
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The stable identifier, for the typeahead and the keyboard. If you give none, the component
|
|
56
|
+
* makes one.
|
|
57
|
+
*/
|
|
55
58
|
value?: string | number;
|
|
56
|
-
/**
|
|
59
|
+
/** The component calls it when the user activates the item. */
|
|
57
60
|
onAction?: (event?: Event) => void;
|
|
58
|
-
/**
|
|
61
|
+
/** Disables the item. */
|
|
59
62
|
disabled?: boolean;
|
|
60
|
-
/**
|
|
63
|
+
/** Replaces the `closeOnSelect` value of the Root, for this item. */
|
|
61
64
|
closeOnSelect?: boolean;
|
|
62
|
-
/**
|
|
65
|
+
/** The text for the typeahead. Without it, the component uses the text content of the item. */
|
|
63
66
|
textValue?: string;
|
|
64
|
-
/**
|
|
67
|
+
/** The content of the item. */
|
|
65
68
|
children?: Snippet;
|
|
66
|
-
/** CSS class
|
|
69
|
+
/** The CSS class names of the item. */
|
|
67
70
|
class?: string;
|
|
68
|
-
/**
|
|
71
|
+
/** A bindable reference to the item element. */
|
|
69
72
|
element?: HTMLElement | null;
|
|
70
73
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children' | 'role'>;
|
|
71
74
|
|
|
@@ -4,21 +4,24 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
4
4
|
* Menu.Item - An interactive menu item (role="menuitem").
|
|
5
5
|
*/
|
|
6
6
|
type MenuItemProps = {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The stable identifier, for the typeahead and the keyboard. If you give none, the component
|
|
9
|
+
* makes one.
|
|
10
|
+
*/
|
|
8
11
|
value?: string | number;
|
|
9
|
-
/**
|
|
12
|
+
/** The component calls it when the user activates the item. */
|
|
10
13
|
onAction?: (event?: Event) => void;
|
|
11
|
-
/**
|
|
14
|
+
/** Disables the item. */
|
|
12
15
|
disabled?: boolean;
|
|
13
|
-
/**
|
|
16
|
+
/** Replaces the `closeOnSelect` value of the Root, for this item. */
|
|
14
17
|
closeOnSelect?: boolean;
|
|
15
|
-
/**
|
|
18
|
+
/** The text for the typeahead. Without it, the component uses the text content of the item. */
|
|
16
19
|
textValue?: string;
|
|
17
|
-
/**
|
|
20
|
+
/** The content of the item. */
|
|
18
21
|
children?: Snippet;
|
|
19
|
-
/** CSS class
|
|
22
|
+
/** The CSS class names of the item. */
|
|
20
23
|
class?: string;
|
|
21
|
-
/**
|
|
24
|
+
/** A bindable reference to the item element. */
|
|
22
25
|
element?: HTMLElement | null;
|
|
23
26
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children' | 'role'>;
|
|
24
27
|
declare const MenuItem: import("svelte").Component<MenuItemProps, {}, "element">;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* a nested overlay would just stack a second dim layer, so callers place it at the root level.
|
|
16
16
|
*/
|
|
17
17
|
type MenuOverlayProps = {
|
|
18
|
-
/** CSS class
|
|
18
|
+
/** The CSS class names of the overlay. */
|
|
19
19
|
class?: string;
|
|
20
20
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class'>;
|
|
21
21
|
|
|
@@ -9,7 +9,7 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
9
9
|
* a nested overlay would just stack a second dim layer, so callers place it at the root level.
|
|
10
10
|
*/
|
|
11
11
|
type MenuOverlayProps = {
|
|
12
|
-
/** CSS class
|
|
12
|
+
/** The CSS class names of the overlay. */
|
|
13
13
|
class?: string;
|
|
14
14
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class'>;
|
|
15
15
|
declare const MenuOverlay: import("svelte").Component<MenuOverlayProps, {}, "">;
|
|
@@ -32,9 +32,9 @@ export type MenuItemData = {
|
|
|
32
32
|
textValue?: string;
|
|
33
33
|
/** The item's DOM element. */
|
|
34
34
|
element?: HTMLElement;
|
|
35
|
-
/**
|
|
35
|
+
/** Disables the item. */
|
|
36
36
|
disabled?: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/** The component calls it when the user activates the item. */
|
|
38
38
|
onSelect?: (event?: Event) => void;
|
|
39
39
|
/** Per-item override for the Root `closeOnSelect` default. */
|
|
40
40
|
closeOnSelect?: boolean;
|
|
@@ -61,7 +61,10 @@ export type MenuContext = {
|
|
|
61
61
|
anchorPoint: MenuAnchorPoint | null;
|
|
62
62
|
/** Whether this menu is opened as a context menu (right click / long press). */
|
|
63
63
|
isContextMenu: boolean;
|
|
64
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* At the last item, the arrow keys move the focus to the first item, and at the first item, to
|
|
66
|
+
* the last one.
|
|
67
|
+
*/
|
|
65
68
|
loop: boolean;
|
|
66
69
|
/** Whether typeahead is enabled. */
|
|
67
70
|
typeahead: boolean;
|
|
@@ -9,21 +9,27 @@
|
|
|
9
9
|
* Provides context for Trigger and Content children.
|
|
10
10
|
*/
|
|
11
11
|
type MenuRootProps = {
|
|
12
|
-
/**
|
|
12
|
+
/** The open state. */
|
|
13
13
|
open?: boolean;
|
|
14
|
-
/**
|
|
14
|
+
/** The open state at the start, for when the component controls the state. */
|
|
15
15
|
defaultOpen?: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/** The component calls it when the open state changes. */
|
|
17
17
|
onOpenChange?: (open: boolean, details: MenuOpenChangeDetails) => void;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* At the last item, the arrow keys move the focus to the first item, and at the first item, to
|
|
20
|
+
* the last one.
|
|
21
|
+
*/
|
|
19
22
|
loop?: boolean;
|
|
20
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Starts the typeahead. When the user types, the focus moves to an item that agrees with the
|
|
25
|
+
* text.
|
|
26
|
+
*/
|
|
21
27
|
typeahead?: boolean;
|
|
22
|
-
/**
|
|
28
|
+
/** Closes the menu when the user selects an item. An item can replace this value. */
|
|
23
29
|
closeOnSelect?: boolean;
|
|
24
|
-
/**
|
|
30
|
+
/** The reference to the trigger element. Set it in your own code, or let Menu.Trigger set it. */
|
|
25
31
|
triggerRef?: HTMLElement | null;
|
|
26
|
-
/**
|
|
32
|
+
/** The children: the Trigger and the Content. */
|
|
27
33
|
children?: Snippet;
|
|
28
34
|
};
|
|
29
35
|
|
|
@@ -5,21 +5,27 @@ import { type MenuOpenChangeDetails } from './context';
|
|
|
5
5
|
* Provides context for Trigger and Content children.
|
|
6
6
|
*/
|
|
7
7
|
type MenuRootProps = {
|
|
8
|
-
/**
|
|
8
|
+
/** The open state. */
|
|
9
9
|
open?: boolean;
|
|
10
|
-
/**
|
|
10
|
+
/** The open state at the start, for when the component controls the state. */
|
|
11
11
|
defaultOpen?: boolean;
|
|
12
|
-
/**
|
|
12
|
+
/** The component calls it when the open state changes. */
|
|
13
13
|
onOpenChange?: (open: boolean, details: MenuOpenChangeDetails) => void;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* At the last item, the arrow keys move the focus to the first item, and at the first item, to
|
|
16
|
+
* the last one.
|
|
17
|
+
*/
|
|
15
18
|
loop?: boolean;
|
|
16
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Starts the typeahead. When the user types, the focus moves to an item that agrees with the
|
|
21
|
+
* text.
|
|
22
|
+
*/
|
|
17
23
|
typeahead?: boolean;
|
|
18
|
-
/**
|
|
24
|
+
/** Closes the menu when the user selects an item. An item can replace this value. */
|
|
19
25
|
closeOnSelect?: boolean;
|
|
20
|
-
/**
|
|
26
|
+
/** The reference to the trigger element. Set it in your own code, or let Menu.Trigger set it. */
|
|
21
27
|
triggerRef?: HTMLElement | null;
|
|
22
|
-
/**
|
|
28
|
+
/** The children: the Trigger and the Content. */
|
|
23
29
|
children?: Snippet;
|
|
24
30
|
};
|
|
25
31
|
declare const MenuRoot: import("svelte").Component<MenuRootProps, {}, "open" | "triggerRef">;
|
|
@@ -4,7 +4,7 @@ export type CreateMenuStateOptions = {
|
|
|
4
4
|
getOpen: () => boolean | undefined;
|
|
5
5
|
/** Writes the open value back to the bindable prop. */
|
|
6
6
|
setOpen: (value: boolean) => void;
|
|
7
|
-
/**
|
|
7
|
+
/** The open state at the start, for when the component controls the state. */
|
|
8
8
|
defaultOpen: boolean;
|
|
9
9
|
/** Reads the current open-change callback. */
|
|
10
10
|
getOnOpenChange?: () => ((open: boolean, details: MenuOpenChangeDetails) => void) | undefined;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Menu.Separator - A visual divider between menu items (role="separator").
|
|
6
6
|
*/
|
|
7
7
|
type MenuSeparatorProps = {
|
|
8
|
-
/**
|
|
8
|
+
/** The orientation of the separator. */
|
|
9
9
|
orientation?: 'horizontal' | 'vertical';
|
|
10
10
|
class?: string;
|
|
11
11
|
element?: HTMLElement | null;
|
|
@@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
3
3
|
* Menu.Separator - A visual divider between menu items (role="separator").
|
|
4
4
|
*/
|
|
5
5
|
type MenuSeparatorProps = {
|
|
6
|
-
/**
|
|
6
|
+
/** The orientation of the separator. */
|
|
7
7
|
orientation?: 'horizontal' | 'vertical';
|
|
8
8
|
class?: string;
|
|
9
9
|
element?: HTMLElement | null;
|
|
@@ -9,19 +9,22 @@
|
|
|
9
9
|
* Must be used inside a parent Menu.Content.
|
|
10
10
|
*/
|
|
11
11
|
type MenuSubmenuRootProps = {
|
|
12
|
-
/**
|
|
12
|
+
/** The open state. */
|
|
13
13
|
open?: boolean;
|
|
14
|
-
/**
|
|
14
|
+
/** The open state at the start, for when the component controls the state. */
|
|
15
15
|
defaultOpen?: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/** The component calls it when the open state changes. */
|
|
17
17
|
onOpenChange?: (open: boolean, details: MenuOpenChangeDetails) => void;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* At the last item, the arrow keys move the focus to the first item. The default comes from the
|
|
20
|
+
* menu above it.
|
|
21
|
+
*/
|
|
19
22
|
loop?: boolean;
|
|
20
|
-
/**
|
|
23
|
+
/** Starts the typeahead. The default comes from the menu above it. */
|
|
21
24
|
typeahead?: boolean;
|
|
22
|
-
/**
|
|
25
|
+
/** Closes the menu when the user selects an item. The default comes from the menu above it. */
|
|
23
26
|
closeOnSelect?: boolean;
|
|
24
|
-
/**
|
|
27
|
+
/** The reference to the submenu trigger element. */
|
|
25
28
|
triggerRef?: HTMLElement | null;
|
|
26
29
|
children?: Snippet;
|
|
27
30
|
};
|
|
@@ -5,19 +5,22 @@ import { type MenuOpenChangeDetails } from '../root/context';
|
|
|
5
5
|
* Must be used inside a parent Menu.Content.
|
|
6
6
|
*/
|
|
7
7
|
type MenuSubmenuRootProps = {
|
|
8
|
-
/**
|
|
8
|
+
/** The open state. */
|
|
9
9
|
open?: boolean;
|
|
10
|
-
/**
|
|
10
|
+
/** The open state at the start, for when the component controls the state. */
|
|
11
11
|
defaultOpen?: boolean;
|
|
12
|
-
/**
|
|
12
|
+
/** The component calls it when the open state changes. */
|
|
13
13
|
onOpenChange?: (open: boolean, details: MenuOpenChangeDetails) => void;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* At the last item, the arrow keys move the focus to the first item. The default comes from the
|
|
16
|
+
* menu above it.
|
|
17
|
+
*/
|
|
15
18
|
loop?: boolean;
|
|
16
|
-
/**
|
|
19
|
+
/** Starts the typeahead. The default comes from the menu above it. */
|
|
17
20
|
typeahead?: boolean;
|
|
18
|
-
/**
|
|
21
|
+
/** Closes the menu when the user selects an item. The default comes from the menu above it. */
|
|
19
22
|
closeOnSelect?: boolean;
|
|
20
|
-
/**
|
|
23
|
+
/** The reference to the submenu trigger element. */
|
|
21
24
|
triggerRef?: HTMLElement | null;
|
|
22
25
|
children?: Snippet;
|
|
23
26
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# NumberField.Root
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Holds the numeric value, the text in the input, the locale, the steps, and the validation state. It gives the shared context to each NumberField part.
|
|
4
4
|
|
|
5
5
|
Use `bind:value` for two-way state. When `name` is provided, Root renders a hidden form input containing the raw numeric value.
|
|
6
6
|
|
|
@@ -4,4 +4,4 @@ Decorative cursor content displayed by consumers while scrubbing.
|
|
|
4
4
|
|
|
5
5
|
It renders `aria-hidden="true"` and mirrors NumberField state through `data-*` attributes.
|
|
6
6
|
|
|
7
|
-
It is
|
|
7
|
+
It is only a visual element. It does not use pointer lock, it is not a virtual cursor, and it does not move the native pointer. Write its styles and its position yourself, usually with `data-scrubbing`, when you want a cursor during the drag.
|
package/dist/popover/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- `onOpenChange(open, details)`
|
|
19
19
|
- `details.reason`: `trigger-press | imperative-action | none | escape-key | outside-press | focus-out | close-press`
|
|
20
20
|
- `details.event?`: native event that triggered the change when available
|
|
21
|
-
- `details.cancel()`:
|
|
21
|
+
- `details.cancel()`: stops the change of the open state
|
|
22
22
|
- `details.isCanceled`: reflects cancellation state inside the callback
|
|
23
23
|
|
|
24
24
|
## Anatomy
|
|
@@ -29,34 +29,39 @@
|
|
|
29
29
|
* Can be used inside Popover.Root (reads context) or standalone (props required).
|
|
30
30
|
*/
|
|
31
31
|
type PopoverContentProps = {
|
|
32
|
-
/**
|
|
32
|
+
/** The distance from the anchor element, on the main axis. */
|
|
33
33
|
offset?: number;
|
|
34
|
-
/**
|
|
34
|
+
/** The position against the anchor element. */
|
|
35
35
|
placement?: ExtendedPlacement;
|
|
36
|
-
/**
|
|
36
|
+
/** Moves the panel to the opposite side when the space is not sufficient. */
|
|
37
37
|
shouldFlip?: boolean;
|
|
38
|
-
/**
|
|
38
|
+
/** The element that gives the limits of the position. */
|
|
39
39
|
boundaryElement?: Element | null;
|
|
40
|
-
/**
|
|
40
|
+
/** The content of the popover. */
|
|
41
41
|
children?: Snippet;
|
|
42
|
-
/** CSS class
|
|
42
|
+
/** The CSS class names of the popover container. */
|
|
43
43
|
class?: string;
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Makes the popover non-modal. The user can then operate the page, the focus does not stay in
|
|
46
|
+
* the panel, and the page scrolls.
|
|
47
|
+
*/
|
|
45
48
|
nonModal?: boolean;
|
|
46
|
-
/**
|
|
49
|
+
/** Closes the popover when the user clicks outside it. */
|
|
47
50
|
shouldCloseOnInteractOutside?: boolean;
|
|
48
|
-
/**
|
|
51
|
+
/** Closes the popover when the user pushes the `Escape` key. */
|
|
49
52
|
shouldCloseOnEscape?: boolean;
|
|
50
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Closes the popover when the focus goes out of it. The default is true for a non-modal popover.
|
|
55
|
+
*/
|
|
51
56
|
shouldCloseOnBlur?: boolean;
|
|
52
|
-
/**
|
|
57
|
+
/** The element, or the selector of the element, that gets the focus first in the modal mode. */
|
|
53
58
|
initialFocus?: FocusTrapOptions['initialFocus'];
|
|
54
59
|
// Standalone mode props (used when not inside Popover.Root)
|
|
55
|
-
/**
|
|
60
|
+
/** The open state, when you use the part alone. */
|
|
56
61
|
open?: boolean;
|
|
57
|
-
/**
|
|
62
|
+
/** The reference to the trigger element, when you use the part alone. */
|
|
58
63
|
triggerRef?: HTMLElement | null;
|
|
59
|
-
/**
|
|
64
|
+
/** The component calls it when the open state changes, when you use the part alone. */
|
|
60
65
|
onOpenChange?: (open: boolean, details: PopoverOpenChangeDetails) => void;
|
|
61
66
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
|
|
62
67
|
|