@fusion.dev/helix-headless 0.165.0 → 0.166.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/custom-elements.json +578 -54
- package/dist/callout/root/callout-root.d.ts +8 -2
- package/dist/callout/root/callout-root.js +14 -1
- package/dist/code-block/root/code-block-root.d.ts +63 -0
- package/dist/code-block/root/code-block-root.js +117 -6
- package/dist/element-events.generated.js +15 -2
- package/dist/filter-input/menu/filter-menu.d.ts +1 -0
- package/dist/filter-input/menu/filter-menu.js +1 -1
- package/dist/listbox/root/listbox-root.js +2 -5
- package/dist/menu/item/menu-item.d.ts +20 -0
- package/dist/menu/item/menu-item.js +53 -20
- package/dist/menu/root/menu-root.d.ts +84 -1
- package/dist/menu/root/menu-root.js +187 -44
- package/dist/object-inspector/root/object-inspector-root.d.ts +5 -0
- package/dist/object-inspector/root/object-inspector-root.js +5 -0
- package/dist/steps/root/steps-root.d.ts +7 -0
- package/dist/steps/root/steps-root.js +7 -0
- package/dist/video/root/video-root.d.ts +2 -0
- package/dist/video/root/video-root.js +4 -2
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +1 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +1 -1
- package/dist/video-playlist/root/video-playlist-root.js +15 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +262 -20
- package/types/vue.d.ts +59 -5
- package/types/words.d.ts +18 -0
package/types/vue.d.ts
CHANGED
|
@@ -201,14 +201,14 @@ import type {
|
|
|
201
201
|
HelixHistoryEvent,
|
|
202
202
|
HelixPinEvent,
|
|
203
203
|
HelixBeforeToggleEvent,
|
|
204
|
-
HelixToggleEvent,
|
|
205
204
|
HelixCopyEvent,
|
|
205
|
+
HelixCopyErrorEvent,
|
|
206
|
+
HelixToggleEvent,
|
|
206
207
|
HelixSampleEndEvent,
|
|
207
208
|
HelixSampleStartEvent,
|
|
208
209
|
HelixCreateEvent,
|
|
209
210
|
HelixFilterEvent,
|
|
210
211
|
HelixLoadMoreEvent,
|
|
211
|
-
HelixCopyErrorEvent,
|
|
212
212
|
HelixBeforeReorderEvent,
|
|
213
213
|
HelixExpandEvent,
|
|
214
214
|
HelixFilteredEvent,
|
|
@@ -3152,9 +3152,18 @@ export type HelixHeadlessCodeBlockElementEvent<E = Event> = TypedEvent<
|
|
|
3152
3152
|
HelixHeadlessCodeBlock,
|
|
3153
3153
|
E
|
|
3154
3154
|
>;
|
|
3155
|
+
/** `helix-before-change` event type */
|
|
3156
|
+
export type HelixHeadlessCodeBlockHelixBeforeChangeElementEvent =
|
|
3157
|
+
HelixHeadlessCodeBlockElementEvent<HelixBeforeChangeEvent>;
|
|
3155
3158
|
/** `helix-before-toggle` event type */
|
|
3156
3159
|
export type HelixHeadlessCodeBlockHelixBeforeToggleElementEvent =
|
|
3157
3160
|
HelixHeadlessCodeBlockElementEvent<HelixBeforeToggleEvent>;
|
|
3161
|
+
/** `helix-copy` event type */
|
|
3162
|
+
export type HelixHeadlessCodeBlockHelixCopyElementEvent =
|
|
3163
|
+
HelixHeadlessCodeBlockElementEvent<HelixCopyEvent>;
|
|
3164
|
+
/** `helix-copy-error` event type */
|
|
3165
|
+
export type HelixHeadlessCodeBlockHelixCopyErrorElementEvent =
|
|
3166
|
+
HelixHeadlessCodeBlockElementEvent<HelixCopyErrorEvent>;
|
|
3158
3167
|
/** `helix-toggle` event type */
|
|
3159
3168
|
export type HelixHeadlessCodeBlockHelixToggleElementEvent =
|
|
3160
3169
|
HelixHeadlessCodeBlockElementEvent<HelixToggleEvent>;
|
|
@@ -3226,6 +3235,15 @@ block lays out. Not for a diff, whose files each scroll on their own. */
|
|
|
3226
3235
|
"expand-label"?: (HelixHeadlessCodeBlock["expandLabel"]) | undefined;
|
|
3227
3236
|
/** The expand button's words while the cap hides lines. */
|
|
3228
3237
|
expandLabel?: (HelixHeadlessCodeBlock["expandLabel"]) | undefined;
|
|
3238
|
+
/** The name of the file shown, where the block holds several Code Blocks:
|
|
3239
|
+
the `label` of one, or its `language` without one.
|
|
3240
|
+
|
|
3241
|
+
Unset, or a name no file has, shows the first. */
|
|
3242
|
+
file?: (HelixHeadlessCodeBlock["file"]) | undefined;
|
|
3243
|
+
/** The name of the file tabs, read by screen readers. */
|
|
3244
|
+
"files-label"?: (HelixHeadlessCodeBlock["filesLabel"]) | undefined;
|
|
3245
|
+
/** The name of the file tabs, read by screen readers. */
|
|
3246
|
+
filesLabel?: (HelixHeadlessCodeBlock["filesLabel"]) | undefined;
|
|
3229
3247
|
/** The words of a button that hides a run of unchanged lines it showed, in a
|
|
3230
3248
|
diff with `context-lines`. `{count}` is how many, and each language
|
|
3231
3249
|
writes the forms it has. */
|
|
@@ -3362,8 +3380,16 @@ read, nor for a diff. */
|
|
|
3362
3380
|
};
|
|
3363
3381
|
|
|
3364
3382
|
export type HelixHeadlessCodeBlockVueEvents = {
|
|
3383
|
+
/** A file tab showed its file, whose name `file` now holds. */
|
|
3384
|
+
change: HelixHeadlessCodeBlockElementEvent;
|
|
3385
|
+
/** A file tab is about to show its file, with the file's name in `detail.value`. Cancelable: cancel it to keep the file shown. */
|
|
3386
|
+
"helix-before-change": HelixHeadlessCodeBlockHelixBeforeChangeElementEvent;
|
|
3365
3387
|
/** The wrap button was pressed, with the `wrap` it asks for in `detail.checked`. Cancelable: cancel it to keep the lines as they are. */
|
|
3366
3388
|
"helix-before-toggle": HelixHeadlessCodeBlockHelixBeforeToggleElementEvent;
|
|
3389
|
+
/** The copy button put the code on the clipboard, with the text in `detail.value`. */
|
|
3390
|
+
"helix-copy": HelixHeadlessCodeBlockHelixCopyElementEvent;
|
|
3391
|
+
/** A press on the copy button put nothing on the clipboard: the browser did not allow the write, or there was no code. */
|
|
3392
|
+
"helix-copy-error": HelixHeadlessCodeBlockHelixCopyErrorElementEvent;
|
|
3367
3393
|
/** Fired after the wrap button changed `wrap`, with the new value in `detail.checked`. */
|
|
3368
3394
|
"helix-toggle": HelixHeadlessCodeBlockHelixToggleElementEvent;
|
|
3369
3395
|
};
|
|
@@ -10685,6 +10711,9 @@ export type HelixHeadlessMenuHelixBeforeCloseElementEvent =
|
|
|
10685
10711
|
/** `helix-before-open` event type */
|
|
10686
10712
|
export type HelixHeadlessMenuHelixBeforeOpenElementEvent =
|
|
10687
10713
|
HelixHeadlessMenuElementEvent<HelixBeforeOpenEvent>;
|
|
10714
|
+
/** `helix-filter` event type */
|
|
10715
|
+
export type HelixHeadlessMenuHelixFilterElementEvent =
|
|
10716
|
+
HelixHeadlessMenuElementEvent<HelixFilterEvent>;
|
|
10688
10717
|
/** `helix-select` event type */
|
|
10689
10718
|
export type HelixHeadlessMenuHelixSelectElementEvent =
|
|
10690
10719
|
HelixHeadlessMenuElementEvent<HelixSelectEvent>;
|
|
@@ -10712,6 +10741,18 @@ Ark UI's `closeOnSelect` does. A row's own `close-on-select` wins over this. */
|
|
|
10712
10741
|
/** Whether the menu is the trigger's context menu: it opens where the reader
|
|
10713
10742
|
asks for one, with a right-click, a long press, Shift+F10 or the menu key. */
|
|
10714
10743
|
context?: (HelixHeadlessMenu["context"]) | undefined;
|
|
10744
|
+
/** The text the rows are filtered by, which the filter field holds.
|
|
10745
|
+
|
|
10746
|
+
Cleared as the menu closes and as a submenu opens or closes, so each page
|
|
10747
|
+
starts with every row showing. */
|
|
10748
|
+
filter?: (HelixHeadlessMenu["filter"]) | undefined;
|
|
10749
|
+
/** Whether the menu shows a field above its rows that narrows them as the
|
|
10750
|
+
reader types, with focus staying in the field. */
|
|
10751
|
+
filterable?: (HelixHeadlessMenu["filterable"]) | undefined;
|
|
10752
|
+
/** The filter field's name and placeholder. */
|
|
10753
|
+
"filter-label"?: (HelixHeadlessMenu["filterLabel"]) | undefined;
|
|
10754
|
+
/** The filter field's name and placeholder. */
|
|
10755
|
+
filterLabel?: (HelixHeadlessMenu["filterLabel"]) | undefined;
|
|
10715
10756
|
/** Accessible name for the surface.
|
|
10716
10757
|
|
|
10717
10758
|
Empty by default, which names the surface by its trigger, so a menu opened
|
|
@@ -10724,6 +10765,10 @@ to open the menu. Translate it with the rest of your interface. */
|
|
|
10724
10765
|
/** The description a trigger gives under `open-on="long-press"`, saying how
|
|
10725
10766
|
to open the menu. Translate it with the rest of your interface. */
|
|
10726
10767
|
longPressLabel?: (HelixHeadlessMenu["longPressLabel"]) | undefined;
|
|
10768
|
+
/** The text shown when the filter keeps no rows. */
|
|
10769
|
+
"no-results-text"?: (HelixHeadlessMenu["noResultsText"]) | undefined;
|
|
10770
|
+
/** The text shown when the filter keeps no rows. */
|
|
10771
|
+
noResultsText?: (HelixHeadlessMenu["noResultsText"]) | undefined;
|
|
10727
10772
|
/** Space between the trigger and the surface, in pixels. */
|
|
10728
10773
|
offset?: (HelixHeadlessMenu["offset"]) | undefined;
|
|
10729
10774
|
/** What opens the menu from its trigger. `long-press` leaves a press to the
|
|
@@ -10772,6 +10817,13 @@ hydration, or diffed by a framework, it comes back holding whatever the
|
|
|
10772
10817
|
last reader did rather than what the author wrote. `:state(open)` carries
|
|
10773
10818
|
the resolved state for stylesheets, which is what the mirror is for. */
|
|
10774
10819
|
open?: (HelixHeadlessMenu["open"]) | undefined;
|
|
10820
|
+
/** Whether a row is kept by the filter: a function given the row's words and
|
|
10821
|
+
the filter, trimmed, that returns `true` to keep it showing, as React
|
|
10822
|
+
Aria's `Autocomplete` takes `filter`. See Listbox's `filterMatch`.
|
|
10823
|
+
|
|
10824
|
+
Absent, a row is kept where its words hold the filter, in any case. A
|
|
10825
|
+
property only, there being no way to write a function in markup. */
|
|
10826
|
+
filterMatch?: (HelixHeadlessMenu["filterMatch"]) | undefined;
|
|
10775
10827
|
};
|
|
10776
10828
|
|
|
10777
10829
|
export type HelixHeadlessMenuVueEvents = {
|
|
@@ -10779,6 +10831,8 @@ export type HelixHeadlessMenuVueEvents = {
|
|
|
10779
10831
|
"helix-before-close": HelixHeadlessMenuHelixBeforeCloseElementEvent;
|
|
10780
10832
|
/** The menu is about to open. Cancelable: cancel it to keep it closed. */
|
|
10781
10833
|
"helix-before-open": HelixHeadlessMenuHelixBeforeOpenElementEvent;
|
|
10834
|
+
/** The text in the filter field changed, with the new text in `detail.value`. Cancelable: cancel it to keep every row showing and narrow the rows yourself. */
|
|
10835
|
+
"helix-filter": HelixHeadlessMenuHelixFilterElementEvent;
|
|
10782
10836
|
/** An item was chosen. Cancelable: cancel it to keep the menu open. */
|
|
10783
10837
|
"helix-select": HelixHeadlessMenuHelixSelectElementEvent;
|
|
10784
10838
|
/** The menu opened or closed. The event carries `newState` and `oldState`. */
|
|
@@ -18856,7 +18910,7 @@ export interface WcToolkitVueGlobalComponents {
|
|
|
18856
18910
|
HelixHeadlessCheckboxVueProps,
|
|
18857
18911
|
HelixHeadlessCheckboxVueEvents
|
|
18858
18912
|
>;
|
|
18859
|
-
/** Renders a '<pre><code>' pair: 'pre' keeps the whitespace, and 'code' marks it as code. Long lines scroll inside the block and do not wrap, because a line break can be significant in code. A copy button is on by default. Set 'no-copy' to remove it. The button copies the slotted text, so there is no second copy of the code to keep in sync. For a fragment of code inside a sentence, use 'Code'. Set 'line-numbers' to number the lines in a gutter beside the code, hidden from the accessibility tree and left out of a copy. Set 'mark-lines' to mark lines a reader should look at, such as '2, 4-6': the block draws a band behind each run, placed where the lines are laid out, so it follows a highlighter's markup and lines that wrap. Set 'wrap' to wrap long lines rather than scroll them; a gutter then numbers each line where it starts. Set 'wrappable' for a button in the header that turns 'wrap' on and off, pressed while the lines wrap. The header holds the name, the 'actions' slot, and the copy button. Slot a control into 'actions', such as a button that sets 'wrap' or one that opens the code in an editor, and the block draws a header for it even with no name. 'copy-icon' and 'copied-icon' replace the copy button's two icons. Set 'highlight' to a function that turns the code into highlighted markup, such as one wrapping Shiki or Prism, and the block draws what it returns; it is handed the block's 'language', so one function serves every block. The code stays in the slot, so the copy button and the page's own text are the code as written. Set 'expandable' on a block whose height is capped, such as by '--code-block-max-block-size', and a button under it shows every line and then fewer again, as a docs site's long example does. The button is drawn only while the cap hides something, says whether the block is expanded with 'aria-expanded', names the block it opens with 'aria-controls', and the block carries ':state(expanded)' while it is. Set 'diff' to show a change. Put a unified diff, the output of 'git diff' or 'diff -u', in the same slot, and the block draws the lines it added and removed. The block never computes a diff itself. Line numbers come from the hunk headers and are hidden from the accessibility tree. Changed lines are '<ins>' and '<del>' with the '+' and '-' kept as text, so the change does not depend on color. Where a removed line is paired with the added line that replaced it, the words each does not share with the other are the 'changed' part, so the eye goes to what changed within the line. Each file in the patch is its own block under its own name, and its copy button copies the new version of the file. 'variant="split"' shows the old version beside the new, each removal opposite its replacement. 'context-lines' folds each long run of unchanged lines, keeping that many beside each change, behind a button that shows them and hides them again, as a code host draws a diff written with more context than a reader needs. **A block that scrolls is a tab stop.** While its lines run past its width or its cap, the scroller is a region named for the block, such as "Code, app.ts", that Tab reaches, so a keyboard scrolls it with the arrow keys in every browser. Chromium and Firefox make a scrolling box focusable on their own, and Safari does not. A block that fits is no stop at all. **The code the block draws is marked untranslated**, 'translate="no"' on its '<pre>', so a page translator leaves highlighted lines and a diff as written. Code in the slot takes its translation mode from the element, which writes nothing onto itself, so set 'translate="no"' on the element to keep a translator off plain code too. On the server, the slot renders as ordinary code, so a diff first appears as the patch text in a '<pre>'. The client makes the same first render, which keeps hydration clean, and draws the diff once it can read the content. Diff mode is experimental. The rest of the family is stable. */
|
|
18913
|
+
/** Renders a '<pre><code>' pair: 'pre' keeps the whitespace, and 'code' marks it as code. Long lines scroll inside the block and do not wrap, because a line break can be significant in code. A copy button is on by default. Set 'no-copy' to remove it. The button copies the slotted text, so there is no second copy of the code to keep in sync. For a fragment of code inside a sentence, use 'Code'. Set 'line-numbers' to number the lines in a gutter beside the code, hidden from the accessibility tree and left out of a copy. Set 'mark-lines' to mark lines a reader should look at, such as '2, 4-6': the block draws a band behind each run, placed where the lines are laid out, so it follows a highlighter's markup and lines that wrap. Set 'wrap' to wrap long lines rather than scroll them; a gutter then numbers each line where it starts. Set 'wrappable' for a button in the header that turns 'wrap' on and off, pressed while the lines wrap. The header holds the name, the 'actions' slot, and the copy button. Slot a control into 'actions', such as a button that sets 'wrap' or one that opens the code in an editor, and the block draws a header for it even with no name. 'copy-icon' and 'copied-icon' replace the copy button's two icons. Set 'highlight' to a function that turns the code into highlighted markup, such as one wrapping Shiki or Prism, and the block draws what it returns; it is handed the block's 'language', so one function serves every block. The code stays in the slot, so the copy button and the page's own text are the code as written. Set 'expandable' on a block whose height is capped, such as by '--code-block-max-block-size', and a button under it shows every line and then fewer again, as a docs site's long example does. The button is drawn only while the cap hides something, says whether the block is expanded with 'aria-expanded', names the block it opens with 'aria-controls', and the block carries ':state(expanded)' while it is. Set 'diff' to show a change. Put a unified diff, the output of 'git diff' or 'diff -u', in the same slot, and the block draws the lines it added and removed. The block never computes a diff itself. Line numbers come from the hunk headers and are hidden from the accessibility tree. Changed lines are '<ins>' and '<del>' with the '+' and '-' kept as text, so the change does not depend on color. Where a removed line is paired with the added line that replaced it, the words each does not share with the other are the 'changed' part, so the eye goes to what changed within the line. Each file in the patch is its own block under its own name, and its copy button copies the new version of the file. 'variant="split"' shows the old version beside the new, each removal opposite its replacement. 'context-lines' folds each long run of unchanged lines, keeping that many beside each change, behind a button that shows them and hides them again, as a code host draws a diff written with more context than a reader needs. **A block that scrolls is a tab stop.** While its lines run past its width or its cap, the scroller is a region named for the block, such as "Code, app.ts", that Tab reaches, so a keyboard scrolls it with the arrow keys in every browser. Chromium and Firefox make a scrolling box focusable on their own, and Safari does not. A block that fits is no stop at all. **The code the block draws is marked untranslated**, 'translate="no"' on its '<pre>', so a page translator leaves highlighted lines and a diff as written. Code in the slot takes its translation mode from the element, which writes nothing onto itself, so set 'translate="no"' on the element to keep a translator off plain code too. On the server, the slot renders as ordinary code, so a diff first appears as the patch text in a '<pre>'. The client makes the same first render, which keeps hydration clean, and draws the diff once it can read the content. Diff mode is experimental. The rest of the family is stable. **Several blocks are files**, one shown at a time under a row of tabs, as Sandbox shows its source panes. Put Code Blocks in the default slot of a Code Block, and each is a file named on its tab by its 'label' or, without one, its 'language'. 'file' holds the name of the file shown. The tabs are a tab list: the arrow keys move to a tab and show its file, the two swapping on a right-to-left page, and Home and End go to the first and the last. Choosing one sends 'helix-before-change' with the file's name, which you can cancel, and 'change' once 'file' holds it. The files not shown carry 'hidden', and the one shown draws no name of its own, its tab naming it. One block draws no tabs. A server cannot see the blocks inside, so the client draws the tabs once it upgrades. */
|
|
18860
18914
|
"helix-headless-code-block": DefineCustomElement<
|
|
18861
18915
|
HelixHeadlessCodeBlock,
|
|
18862
18916
|
HelixHeadlessCodeBlockVueProps,
|
|
@@ -19174,13 +19228,13 @@ export interface WcToolkitVueGlobalComponents {
|
|
|
19174
19228
|
HelixHeadlessMegamenuVueProps,
|
|
19175
19229
|
HelixHeadlessMegamenuVueEvents
|
|
19176
19230
|
>;
|
|
19177
|
-
/** One element covers three kinds of row, and what you give it decides which: - Content in the 'submenu' slot makes the row open a submenu page. - 'checked' makes the row a choice. - With neither, the row is a command. The role follows the kind. A row with 'checkable' or 'checked' is 'menuitemcheckbox' with 'aria-checked', and an 'exclusive' row is 'menuitemradio', for a set where only one can be on. A row that opens a page keeps 'menuitem' and sets 'aria-haspopup'. Choosing a choice row checks or unchecks it before 'helix-select' is sent, so a listener reads the new 'checked'. An 'exclusive' row turns on and turns off the 'exclusive' rows next to it. Cancel 'helix-before-toggle' to keep a row as it is and set 'checked' yourself. Space on a choice row changes it and leaves the menu open, so a reader can set several in a row, as the APG's menu does. Enter and a press change it and close the menu. 'close-on-select="false"' on the row keeps the menu open after any choice of it, and 'close-on-select' on the row closes it after a Space as well. The menu sets whether the row's page is showing as a property, never as an attribute. An attribute written onto your element after it upgrades causes a hydration mismatch. 'shortcut' shows a row's keyboard shortcut after its label, drawn by 'Kbd' in the platform's glyphs, and gives the row 'aria-keyshortcuts'. It binds nothing: the shortcut is the page's to bind. Other trailing words, such as a count, go in the 'end' slot. The row is named by its label alone. Words in 'description', a line under the label, and in 'end' describe it instead, through 'aria-describedby', as React Aria's menu item does with its description: a reader hears "Copy", then "Copies the selection". A development build warns when a row has no words to be named by, such as a row holding only an icon with no label. The check mark and the caret are the fallbacks of the 'check' and 'chevron' slots, so a mark of your own replaces either by being slotted. Neither is read as part of the row's name. */
|
|
19231
|
+
/** One element covers three kinds of row, and what you give it decides which: - Content in the 'submenu' slot makes the row open a submenu page. - 'checked' makes the row a choice. - With neither, the row is a command. The role follows the kind. A row with 'checkable' or 'checked' is 'menuitemcheckbox' with 'aria-checked', and an 'exclusive' row is 'menuitemradio', for a set where only one can be on. A row that opens a page keeps 'menuitem' and sets 'aria-haspopup'. Choosing a choice row checks or unchecks it before 'helix-select' is sent, so a listener reads the new 'checked'. An 'exclusive' row turns on and turns off the 'exclusive' rows next to it. Cancel 'helix-before-toggle' to keep a row as it is and set 'checked' yourself. Space on a choice row changes it and leaves the menu open, so a reader can set several in a row, as the APG's menu does. Enter and a press change it and close the menu. 'close-on-select="false"' on the row keeps the menu open after any choice of it, and 'close-on-select' on the row closes it after a Space as well. The menu sets whether the row's page is showing as a property, never as an attribute. An attribute written onto your element after it upgrades causes a hydration mismatch. 'shortcut' shows a row's keyboard shortcut after its label, drawn by 'Kbd' in the platform's glyphs, and gives the row 'aria-keyshortcuts'. It binds nothing: the shortcut is the page's to bind. Other trailing words, such as a count, go in the 'end' slot. The row is named by its label alone. Words in 'description', a line under the label, and in 'end' describe it instead, through 'aria-describedby', as React Aria's menu item does with its description: a reader hears "Copy", then "Copies the selection". A development build warns when a row has no words to be named by, such as a row holding only an icon with no label. The check mark and the caret are the fallbacks of the 'check' and 'chevron' slots, so a mark of your own replaces either by being slotted. Neither is read as part of the row's name. In a menu with 'filterable', focus stays in the menu's filter field and the row the arrow keys reach is highlighted: the field names it with 'aria-activedescendant', the row carries its role on its host so the field can point at it, and ':state(highlighted)' says which row it is. A row with an 'href' then follows its link without an anchor, as 'Option' does. */
|
|
19178
19232
|
"helix-headless-menu-item": DefineCustomElement<
|
|
19179
19233
|
HelixHeadlessMenuItem,
|
|
19180
19234
|
HelixHeadlessMenuItemVueProps,
|
|
19181
19235
|
HelixHeadlessMenuItemVueEvents
|
|
19182
19236
|
>;
|
|
19183
|
-
/** The trigger is slotted and stays your own element, as with the tooltip. The menu renders its surface in the top layer with the popover API, so an ancestor with 'overflow: hidden' does not clip it and it needs no 'z-index'. Slot a 'helix-button' or 'helix-icon-button' as the trigger, and the menu tells it that it opens a menu and whether the menu is open, inside its own shadow root. On a plain element, such as a '<button>', the menu writes 'aria-haspopup="menu"' and 'aria-expanded', from a frame after its own first render, so a server's markup is never changed while a framework hydrates it. It never writes 'aria-expanded' where you wrote it yourself. Submenus drill down by default. A submenu replaces the panel's content, and a back row returns to the previous page. One panel stays inside a narrow window, and works on touch screens, which have no hover. **'submenus="flyout"' opens each submenu in a panel of its own beside its row**, as React Aria's 'SubmenuTrigger' and Radix's 'Sub' do. Resting the pointer on the row opens it, and a pointer crossing toward the open panel over the rows between keeps it open, as Radix's grace area does. Right Arrow opens a row's submenu on its first row, and Left Arrow or Escape closes it and returns focus to the row, the two arrows swapping on a right-to-left page. The row says 'aria-expanded', and the panel is a 'menu' named by the row. The root holds which page is open, because only one page shows at a time. It sets this on items as a property, never as an attribute. An attribute written onto your element after it upgrades causes a hydration mismatch. Group rows under a heading with 'Menu.Section', which is a 'group' named by its heading. Between runs of rows, a '<helix-divider>' is a separator a screen reader announces. Keys: Enter, Space or Down Arrow on the trigger opens the menu on its first row, and Up Arrow on its last. In the menu, Up and Down Arrow move between rows, Home and End go to the first and the last, a typed letter moves to the next row whose name starts with it, Enter and Space choose (Space on a choice row changes it and leaves the menu open), Right Arrow opens a row's submenu and Left Arrow goes back, the two swapping on a right-to-left page. Left Arrow on the top page does nothing. Escape closes the menu and returns focus to the trigger. Tab closes it and moves on. While it is open, the surface carries the trigger's width as '--floating-anchor-inline-size' and the room left below it as '--floating-available-block-size', as Radix's dropdown menu publishes its trigger's width, for a menu as wide as its trigger: 'helix-menu::part(surface) { min-inline-size: var(--floating-anchor-inline-size) }'. With 'context', the trigger is an area and the menu is its context menu: a right-click, a long press, Shift+F10 or the menu key over the area opens it at the pointer, or at the area's corner from the keyboard, as Radix's context menu does. A press on the area does not open it, and closing it returns focus to where it was. A touch or a pen held still on the area opens it too, on every browser, since iOS sends no 'contextmenu' for one. **A trigger with its own action.** With 'open-on="long-press"', a press on the trigger is the trigger's own, and a press held for half a second opens the menu, as React Aria's 'trigger="longPress"' does. Alt+Down or Alt+Up opens it from the keyboard, and the trigger is described by 'long-press-label', which says so. */
|
|
19237
|
+
/** The trigger is slotted and stays your own element, as with the tooltip. The menu renders its surface in the top layer with the popover API, so an ancestor with 'overflow: hidden' does not clip it and it needs no 'z-index'. Slot a 'helix-button' or 'helix-icon-button' as the trigger, and the menu tells it that it opens a menu and whether the menu is open, inside its own shadow root. On a plain element, such as a '<button>', the menu writes 'aria-haspopup="menu"' and 'aria-expanded', from a frame after its own first render, so a server's markup is never changed while a framework hydrates it. It never writes 'aria-expanded' where you wrote it yourself. Submenus drill down by default. A submenu replaces the panel's content, and a back row returns to the previous page. One panel stays inside a narrow window, and works on touch screens, which have no hover. **'submenus="flyout"' opens each submenu in a panel of its own beside its row**, as React Aria's 'SubmenuTrigger' and Radix's 'Sub' do. Resting the pointer on the row opens it, and a pointer crossing toward the open panel over the rows between keeps it open, as Radix's grace area does. Right Arrow opens a row's submenu on its first row, and Left Arrow or Escape closes it and returns focus to the row, the two arrows swapping on a right-to-left page. The row says 'aria-expanded', and the panel is a 'menu' named by the row. The root holds which page is open, because only one page shows at a time. It sets this on items as a property, never as an attribute. An attribute written onto your element after it upgrades causes a hydration mismatch. Group rows under a heading with 'Menu.Section', which is a 'group' named by its heading. Between runs of rows, a '<helix-divider>' is a separator a screen reader announces. Keys: Enter, Space or Down Arrow on the trigger opens the menu on its first row, and Up Arrow on its last. In the menu, Up and Down Arrow move between rows, Home and End go to the first and the last, a typed letter moves to the next row whose name starts with it, Enter and Space choose (Space on a choice row changes it and leaves the menu open), Right Arrow opens a row's submenu and Left Arrow goes back, the two swapping on a right-to-left page. Left Arrow on the top page does nothing. Escape closes the menu and returns focus to the trigger. Tab closes it and moves on. While it is open, the surface carries the trigger's width as '--floating-anchor-inline-size' and the room left below it as '--floating-available-block-size', as Radix's dropdown menu publishes its trigger's width, for a menu as wide as its trigger: 'helix-menu::part(surface) { min-inline-size: var(--floating-anchor-inline-size) }'. With 'context', the trigger is an area and the menu is its context menu: a right-click, a long press, Shift+F10 or the menu key over the area opens it at the pointer, or at the area's corner from the keyboard, as Radix's context menu does. A press on the area does not open it, and closing it returns focus to where it was. A touch or a pen held still on the area opens it too, on every browser, since iOS sends no 'contextmenu' for one. **A trigger with its own action.** With 'open-on="long-press"', a press on the trigger is the trigger's own, and a press held for half a second opens the menu, as React Aria's 'trigger="longPress"' does. Alt+Down or Alt+Up opens it from the keyboard, and the trigger is described by 'long-press-label', which says so. **A filter field.** With 'filterable', the menu opens with focus in a field above its rows, and typing narrows the rows of the page the keys move in, as React Aria's 'Autocomplete' around a 'Menu' does. A row is kept where its words hold the filter, in any case, or where 'filterMatch' says so. Each page starts unfiltered, and the filter is cleared as the menu closes. Where typing keeps no row, the menu shows 'no-results-text'. Focus stays in the field: Up and Down Arrow move the highlight through the rows that are left, Enter chooses the highlighted row, Right Arrow opens its submenu, Left Arrow on a submenu goes back, and Escape clears the filter and then closes the menu. Home, End and the other keys move the caret and type. The field names the highlighted row with 'aria-activedescendant', and the rows are a 'menu' after the field. Cancel 'helix-filter' to keep every row showing and narrow the rows yourself, such as by replacing them with rows from a server. */
|
|
19184
19238
|
"helix-headless-menu": DefineCustomElement<
|
|
19185
19239
|
HelixHeadlessMenu,
|
|
19186
19240
|
HelixHeadlessMenuVueProps,
|
package/types/words.d.ts
CHANGED
|
@@ -623,6 +623,12 @@ declare module '@fusion.dev/helix-core' {
|
|
|
623
623
|
* English: `Show all lines`
|
|
624
624
|
*/
|
|
625
625
|
expandLabel: Message
|
|
626
|
+
/**
|
|
627
|
+
* The name of the file tabs, read by screen readers.
|
|
628
|
+
*
|
|
629
|
+
* English: `Files`
|
|
630
|
+
*/
|
|
631
|
+
filesLabel: Message
|
|
626
632
|
/**
|
|
627
633
|
* The words of a button that hides a run of unchanged lines it showed, in a
|
|
628
634
|
* diff with `context-lines`. `{count}` is how many, and each language
|
|
@@ -2312,6 +2318,12 @@ declare module '@fusion.dev/helix-core' {
|
|
|
2312
2318
|
* English: `Nothing to show`
|
|
2313
2319
|
*/
|
|
2314
2320
|
emptyText: Message
|
|
2321
|
+
/**
|
|
2322
|
+
* The filter field's name and placeholder.
|
|
2323
|
+
*
|
|
2324
|
+
* English: `Filter`
|
|
2325
|
+
*/
|
|
2326
|
+
filterLabel: Message
|
|
2315
2327
|
/**
|
|
2316
2328
|
* The text shown and announced while the rows load.
|
|
2317
2329
|
*
|
|
@@ -2325,6 +2337,12 @@ declare module '@fusion.dev/helix-core' {
|
|
|
2325
2337
|
* English: `Long press or press Alt+Down to show the menu`
|
|
2326
2338
|
*/
|
|
2327
2339
|
longPressLabel: Message
|
|
2340
|
+
/**
|
|
2341
|
+
* The text shown when the filter keeps no rows.
|
|
2342
|
+
*
|
|
2343
|
+
* English: `No matches`
|
|
2344
|
+
*/
|
|
2345
|
+
noResultsText: Message
|
|
2328
2346
|
}
|
|
2329
2347
|
'helix-meter': {
|
|
2330
2348
|
/**
|