@fusion.dev/helix-headless 0.0.0-dev → 0.0.3
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 +4513 -4483
- package/dist/accordion/item/accordion-item.d.ts +13 -15
- package/dist/accordion/item/accordion-item.js +15 -17
- package/dist/announcement/root/announcement-root.d.ts +7 -25
- package/dist/announcement/root/announcement-root.js +7 -20
- package/dist/app-header/root/app-header-root.d.ts +10 -17
- package/dist/app-header/root/app-header-root.js +9 -18
- package/dist/avatar/group/avatar-group.d.ts +10 -19
- package/dist/avatar/group/avatar-group.js +12 -17
- package/dist/avatar/root/avatar-root.d.ts +8 -8
- package/dist/avatar/root/avatar-root.js +19 -20
- package/dist/badge/root/badge-root.d.ts +6 -6
- package/dist/badge/root/badge-root.js +13 -13
- package/dist/bar-chart/root/bar-chart-root.d.ts +21 -29
- package/dist/bar-chart/root/bar-chart-root.js +42 -57
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +12 -18
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +13 -16
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -28
- package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -28
- package/dist/button/root/button-root.d.ts +84 -94
- package/dist/button/root/button-root.js +82 -92
- package/dist/callout/root/callout-root.d.ts +4 -5
- package/dist/carousel/root/carousel-root.d.ts +59 -71
- package/dist/carousel/root/carousel-root.js +73 -101
- package/dist/chat/composer/chat-composer.d.ts +29 -33
- package/dist/chat/composer/chat-composer.js +40 -44
- package/dist/chat/message/chat-message.d.ts +25 -25
- package/dist/chat/message/chat-message.js +26 -26
- package/dist/chat/root/chat-root.d.ts +28 -41
- package/dist/chat/root/chat-root.js +27 -40
- package/dist/checkbox/root/checkbox-root.d.ts +10 -12
- package/dist/checkbox/root/checkbox-root.js +29 -35
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +32 -45
- package/dist/checkbox-group/root/checkbox-group-root.js +53 -79
- package/dist/code-block/root/code-block-root.d.ts +3 -4
- package/dist/code-block/root/code-block-root.js +8 -12
- package/dist/color-input/root/color-input-root.d.ts +36 -37
- package/dist/color-input/root/color-input-root.js +29 -34
- package/dist/color-picker/color.d.ts +7 -8
- package/dist/color-picker/color.js +7 -8
- package/dist/color-picker/root/color-picker-root.d.ts +55 -57
- package/dist/color-picker/root/color-picker-root.js +60 -64
- package/dist/combobox/root/combobox-root.d.ts +53 -58
- package/dist/combobox/root/combobox-root.js +85 -94
- package/dist/command/root/command-root.d.ts +8 -8
- package/dist/command/root/command-root.js +29 -33
- package/dist/copy-button/root/copy-button-root.d.ts +21 -24
- package/dist/copy-button/root/copy-button-root.js +25 -35
- package/dist/data-table/root/data-table-root.d.ts +77 -76
- package/dist/data-table/root/data-table-root.js +95 -84
- package/dist/data-table/root/order.d.ts +2 -2
- package/dist/data-table/root/order.js +1 -3
- package/dist/date-input/root/date-input-root.d.ts +88 -93
- package/dist/date-input/root/date-input-root.js +147 -158
- package/dist/date-picker/root/date-picker-root.d.ts +75 -83
- package/dist/date-picker/root/date-picker-root.js +120 -143
- package/dist/dialog/root/dialog-root.d.ts +41 -24
- package/dist/dialog/root/dialog-root.js +47 -24
- package/dist/divider/root/divider-root.d.ts +5 -6
- package/dist/divider/root/divider-root.js +4 -5
- package/dist/donut-chart/root/donut-chart-root.d.ts +22 -25
- package/dist/donut-chart/root/donut-chart-root.js +37 -51
- package/dist/drawer/root/drawer-root.d.ts +24 -29
- package/dist/drawer/root/drawer-root.js +15 -22
- package/dist/drilldown/item/drilldown-item.d.ts +14 -14
- package/dist/drilldown/item/drilldown-item.js +24 -26
- package/dist/drilldown/root/drilldown-root.d.ts +8 -10
- package/dist/drilldown/root/drilldown-root.js +6 -7
- package/dist/element-events.generated.js +1 -1
- package/dist/file-input/root/file-input-root.d.ts +20 -24
- package/dist/file-input/root/file-input-root.js +42 -57
- package/dist/format-date/root/format-date-root.js +1 -1
- package/dist/heatmap/root/buckets.d.ts +8 -8
- package/dist/heatmap/root/buckets.js +8 -8
- package/dist/heatmap/root/heatmap-root.d.ts +57 -63
- package/dist/heatmap/root/heatmap-root.js +72 -83
- package/dist/icon/root/icon-root.d.ts +4 -4
- package/dist/icon/root/icon-root.js +9 -9
- package/dist/icon-button/root/icon-button-root.d.ts +4 -6
- package/dist/icon-button/root/icon-button-root.js +4 -6
- package/dist/image/root/image-root.d.ts +49 -59
- package/dist/image/root/image-root.js +55 -65
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/root/input-root.d.ts +61 -85
- package/dist/input/root/input-root.js +79 -106
- package/dist/kbd/root/kbd-root.d.ts +8 -7
- package/dist/kbd/root/kbd-root.js +71 -11
- package/dist/legend/root/legend-root.d.ts +1 -1
- package/dist/legend/root/legend-root.js +4 -5
- package/dist/line-chart/root/line-chart-root.d.ts +26 -30
- package/dist/line-chart/root/line-chart-root.js +10 -10
- package/dist/list/item/list-item.d.ts +14 -18
- package/dist/list/item/list-item.js +18 -22
- package/dist/list/root/list-root.d.ts +4 -4
- package/dist/list/root/list-root.js +3 -3
- package/dist/listbox/root/listbox-root.d.ts +31 -58
- package/dist/listbox/root/listbox-root.js +66 -109
- package/dist/megamenu/root/megamenu-root.d.ts +34 -35
- package/dist/megamenu/root/megamenu-root.js +53 -58
- package/dist/menu/item/menu-item.d.ts +39 -53
- package/dist/menu/item/menu-item.js +50 -64
- package/dist/menu/root/menu-root.d.ts +30 -40
- package/dist/menu/root/menu-root.js +49 -82
- package/dist/meter/root/meter-root.d.ts +49 -53
- package/dist/meter/root/meter-root.js +22 -27
- package/dist/navigation/root/navigation-root.js +11 -19
- package/dist/notifications/notification/notification.d.ts +16 -22
- package/dist/notifications/notification/notification.js +21 -27
- package/dist/notifications/root/notifications-root.d.ts +31 -39
- package/dist/notifications/root/notifications-root.js +41 -52
- package/dist/number-input/root/number-input-root.d.ts +31 -33
- package/dist/number-input/root/number-input-root.js +37 -39
- package/dist/option/root/option-root.d.ts +73 -74
- package/dist/option/root/option-root.js +62 -64
- package/dist/outline/root/outline-root.d.ts +38 -44
- package/dist/outline/root/outline-root.js +66 -82
- package/dist/pagination/root/pagination-root.d.ts +87 -92
- package/dist/pagination/root/pagination-root.js +116 -123
- package/dist/pagination/size/pagination-size.d.ts +31 -50
- package/dist/pagination/size/pagination-size.js +35 -55
- package/dist/pagination/summary/pagination-summary.d.ts +12 -12
- package/dist/pagination/summary/pagination-summary.js +18 -18
- package/dist/pin-input/root/pin-input-root.d.ts +53 -70
- package/dist/pin-input/root/pin-input-root.js +74 -94
- package/dist/popover/root/popover-root.d.ts +15 -20
- package/dist/popover/root/popover-root.js +19 -36
- package/dist/progress/root/progress-root.d.ts +12 -14
- package/dist/progress/root/progress-root.js +22 -25
- package/dist/qr-code/root/qr-code-root.d.ts +11 -11
- package/dist/qr-code/root/qr-code-root.js +12 -14
- package/dist/radio/group/radio-group.js +19 -26
- package/dist/radio/root/radio-root.d.ts +12 -13
- package/dist/radio/root/radio-root.js +12 -13
- package/dist/rating/root/rating-root.d.ts +25 -30
- package/dist/rating/root/rating-root.js +43 -50
- package/dist/scroll-area/root/scroll-area-root.d.ts +11 -14
- package/dist/scroll-area/root/scroll-area-root.js +39 -33
- package/dist/select/root/select-root.d.ts +7 -12
- package/dist/select/root/select-root.js +40 -55
- package/dist/slider/root/slider-root.d.ts +53 -60
- package/dist/slider/root/slider-root.js +74 -85
- package/dist/sparkline/root/sparkline-root.d.ts +43 -47
- package/dist/sparkline/root/sparkline-root.js +23 -32
- package/dist/speed-dial/item/speed-dial-item.d.ts +6 -6
- package/dist/speed-dial/item/speed-dial-item.js +9 -9
- package/dist/speed-dial/root/speed-dial-root.d.ts +21 -25
- package/dist/speed-dial/root/speed-dial-root.js +32 -40
- package/dist/splitter/root/splitter-root.d.ts +98 -111
- package/dist/splitter/root/splitter-root.js +96 -123
- package/dist/stat/root/stat-root.d.ts +2 -7
- package/dist/stat/root/stat-root.js +0 -5
- package/dist/steps/step/step.d.ts +19 -24
- package/dist/steps/step/step.js +27 -32
- package/dist/switch/root/switch-root.js +2 -2
- package/dist/table/column/table-column.d.ts +54 -60
- package/dist/table/column/table-column.js +95 -68
- package/dist/table/root/table-root.d.ts +5 -6
- package/dist/table/root/table-root.js +7 -10
- package/dist/tabs/panel/tab-panel.d.ts +21 -25
- package/dist/tabs/panel/tab-panel.js +25 -29
- package/dist/tabs/root/tabs-root.d.ts +25 -34
- package/dist/tabs/root/tabs-root.js +22 -28
- package/dist/tabs/tab/tab.d.ts +12 -12
- package/dist/tabs/tab/tab.js +19 -20
- package/dist/textarea/root/textarea-root.d.ts +36 -36
- package/dist/textarea/root/textarea-root.js +43 -47
- package/dist/time-input/root/time-input-root.d.ts +58 -68
- package/dist/time-input/root/time-input-root.js +62 -77
- package/dist/time-picker/root/time-picker-root.d.ts +73 -79
- package/dist/time-picker/root/time-picker-root.js +72 -84
- package/dist/timeline/item/timeline-item.d.ts +8 -11
- package/dist/timeline/item/timeline-item.js +8 -11
- package/dist/timeline/root/timeline-root.d.ts +5 -7
- package/dist/timeline/root/timeline-root.js +5 -7
- package/dist/toast/item/toast-item.d.ts +9 -27
- package/dist/toast/item/toast-item.js +19 -41
- package/dist/toast/root/toast-root.d.ts +10 -14
- package/dist/toast/root/toast-root.js +4 -5
- package/dist/toggle/group/toggle-group.d.ts +6 -15
- package/dist/toggle/group/toggle-group.js +21 -36
- package/dist/toggle/root/toggle-root.d.ts +26 -27
- package/dist/toggle/root/toggle-root.js +30 -31
- package/dist/toolbar/root/toolbar-root.d.ts +7 -10
- package/dist/toolbar/root/toolbar-root.js +10 -14
- package/dist/tooltip/root/tooltip-root.d.ts +52 -59
- package/dist/tooltip/root/tooltip-root.js +98 -93
- package/dist/tour/root/tour-root.d.ts +19 -23
- package/dist/tour/root/tour-root.js +31 -41
- package/dist/tour/stop/tour-stop.d.ts +14 -15
- package/dist/tour/stop/tour-stop.js +31 -34
- package/dist/tree/item/tree-item.d.ts +30 -35
- package/dist/tree/item/tree-item.js +43 -55
- package/dist/tree/root/tree-root.d.ts +7 -10
- package/dist/tree/root/tree-root.js +33 -42
- package/dist/trend/root/trend-root.d.ts +3 -5
- package/dist/trend/root/trend-root.js +5 -9
- package/dist/video/root/video-root.d.ts +100 -124
- package/dist/video/root/video-root.js +142 -176
- package/dist/video-playlist/item/video-playlist-item.d.ts +16 -16
- package/dist/video-playlist/item/video-playlist-item.js +24 -24
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -8
- package/dist/video-playlist/menu/video-playlist-menu.js +20 -29
- package/dist/video-playlist/root/video-playlist-root.d.ts +16 -11
- package/dist/video-playlist/root/video-playlist-root.js +21 -25
- package/dist/virtual-list/root/virtual-list-root.d.ts +8 -12
- package/dist/virtual-list/root/virtual-list-root.js +11 -16
- package/jsx.d.ts +9797 -12561
- package/package.json +6 -6
- package/vue.d.ts +2684 -3228
|
@@ -38,25 +38,71 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
38
38
|
export declare class HelixHeadlessButton extends HelixFormElement {
|
|
39
39
|
protected readonly aria: AriaForwardController;
|
|
40
40
|
/**
|
|
41
|
-
* What
|
|
41
|
+
* What to send when the button is activated, and what to send it to.
|
|
42
|
+
*
|
|
43
|
+
* The platform's invoker attributes, forwarded onto the inner `<button>`
|
|
44
|
+
* rather than left on the host: only a real button is recognized as an
|
|
45
|
+
* invoker, so `commandfor` written on a custom element resolves nothing and
|
|
46
|
+
* the trigger silently does nothing at all. A wrapper has to hand them down,
|
|
47
|
+
* the same way `label` becomes `aria-label` in there.
|
|
48
|
+
*
|
|
49
|
+
* ```html
|
|
50
|
+
* <helix-button commandfor="confirm" command="--show">Delete…</helix-button>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* `commandFor` spells its attribute out, because Lit lowercases a property
|
|
54
|
+
* name to derive one rather than dash-casing it, and what a consumer writes
|
|
55
|
+
* is the platform's `commandfor`.
|
|
56
|
+
*
|
|
57
|
+
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-command Invoker Commands
|
|
42
58
|
*/
|
|
43
|
-
|
|
59
|
+
command: string;
|
|
44
60
|
/**
|
|
45
|
-
*
|
|
61
|
+
* The id of the element the command is sent to.
|
|
46
62
|
*
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
* the same name, so `submit` below sets it, submits, and clears it inside one
|
|
53
|
-
* synchronous call.
|
|
63
|
+
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-commandfor Invoker Commands
|
|
64
|
+
*/
|
|
65
|
+
commandFor: string;
|
|
66
|
+
/**
|
|
67
|
+
* Whether this button is a disclosure trigger, and whether its panel is open.
|
|
54
68
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
69
|
+
* **Set by whatever owns the panel, and a property rather than an attribute
|
|
70
|
+
* for the reason `Menu` already states about its items**: an attribute
|
|
71
|
+
* written onto a consumer's element after it upgrades is a hydration mismatch
|
|
72
|
+
* waiting to happen. Measured 28 Aug 2026 against React 19.2.8, server markup
|
|
73
|
+
* hydrated with the definitions loaded either side of `hydrateRoot`:
|
|
74
|
+
* `Megamenu` and `SpeedDial` wrote `aria-expanded` onto the slotted trigger
|
|
75
|
+
* and React reported "some attributes of the server rendered HTML didn't
|
|
76
|
+
* match the client properties. This won't be patched up" in both orders;
|
|
77
|
+
* `Popover` and `Menu`, which write nothing, were clean in both.
|
|
78
|
+
*
|
|
79
|
+
* **A property crosses that gap because React never looks at one.** It diffs
|
|
80
|
+
* the attributes it rendered, and this one is `attribute: false`, so the state
|
|
81
|
+
* travels to the inner `<button>` and lands inside a shadow root React does
|
|
82
|
+
* not own and cannot compare. The consumer's own element is left exactly as
|
|
83
|
+
* they served it and the reader is still told what the control does.
|
|
84
|
+
*
|
|
85
|
+
* `undefined` renders nothing at all, so a button that is not a trigger
|
|
86
|
+
* carries no `aria-expanded`: the resting state is the attribute's absence,
|
|
87
|
+
* which is the rule every reflected property here follows.
|
|
88
|
+
*
|
|
89
|
+
* A consumer who wants to say this statically writes `aria-expanded` on the
|
|
90
|
+
* host instead, which `AriaForwardController` carries to the same place.
|
|
58
91
|
*/
|
|
59
|
-
|
|
92
|
+
expanded?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the button holds its group's tab stop.
|
|
95
|
+
*
|
|
96
|
+
* A toolbar keeps one tab stop across its children, and the obvious way to do
|
|
97
|
+
* that is to write `tabindex` onto each of them. That is a change to markup
|
|
98
|
+
* the consumer rendered, so a React consumer's hydration reports it and does
|
|
99
|
+
* not patch it up. A parent sets this property instead, which writes nothing,
|
|
100
|
+
* and the stop lands on the inner control inside the shadow root.
|
|
101
|
+
*
|
|
102
|
+
* No attribute, because it is coordination between elements rather than
|
|
103
|
+
* anything a consumer sets.
|
|
104
|
+
*/
|
|
105
|
+
focusable: boolean;
|
|
60
106
|
/**
|
|
61
107
|
* Where this button's submission goes, overriding the form's own.
|
|
62
108
|
*
|
|
@@ -98,77 +144,29 @@ export declare class HelixHeadlessButton extends HelixFormElement {
|
|
|
98
144
|
* "button" and nothing else.
|
|
99
145
|
*/
|
|
100
146
|
label: string;
|
|
101
|
-
/**
|
|
102
|
-
* What to send when the button is activated, and what to send it to.
|
|
103
|
-
*
|
|
104
|
-
* The platform's invoker attributes, forwarded onto the inner `<button>`
|
|
105
|
-
* rather than left on the host: only a real button is recognized as an
|
|
106
|
-
* invoker, so `commandfor` written on a custom element resolves nothing and
|
|
107
|
-
* the trigger silently does nothing at all. A wrapper has to hand them down,
|
|
108
|
-
* the same way `label` becomes `aria-label` in there.
|
|
109
|
-
*
|
|
110
|
-
* ```html
|
|
111
|
-
* <helix-button commandfor="confirm" command="--show">Delete…</helix-button>
|
|
112
|
-
* ```
|
|
113
|
-
*
|
|
114
|
-
* `commandFor` spells its attribute out, because Lit lowercases a property
|
|
115
|
-
* name to derive one rather than dash-casing it, and what a consumer writes
|
|
116
|
-
* is the platform's `commandfor`.
|
|
117
|
-
*
|
|
118
|
-
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-command Invoker Commands
|
|
119
|
-
*/
|
|
120
|
-
command: string;
|
|
121
|
-
/**
|
|
122
|
-
* The id of the element the command is sent to.
|
|
123
|
-
*
|
|
124
|
-
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-commandfor Invoker Commands
|
|
125
|
-
*/
|
|
126
|
-
commandFor: string;
|
|
127
147
|
/** Moves focus to the inner control, so the host is never the focus target. */
|
|
128
148
|
static shadowRootOptions: ShadowRootInit;
|
|
129
149
|
private readonly handleClick;
|
|
130
150
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* A toolbar keeps one tab stop across its children, and the obvious way to do
|
|
134
|
-
* that is to write `tabindex` onto each of them. That is a change to markup
|
|
135
|
-
* the consumer rendered, so a React consumer's hydration reports it and does
|
|
136
|
-
* not patch it up. A parent sets this property instead, which writes nothing,
|
|
137
|
-
* and the stop lands on the inner control inside the shadow root.
|
|
138
|
-
*
|
|
139
|
-
* No attribute, because it is coordination between elements rather than
|
|
140
|
-
* anything a consumer sets.
|
|
151
|
+
* What activating the button does to its form.
|
|
141
152
|
*/
|
|
142
|
-
|
|
153
|
+
type: 'button' | 'submit' | 'reset';
|
|
143
154
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* **Set by whatever owns the panel, and a property rather than an attribute
|
|
147
|
-
* for the reason `Menu` already states about its items**: an attribute
|
|
148
|
-
* written onto a consumer's element after it upgrades is a hydration mismatch
|
|
149
|
-
* waiting to happen. Measured 28 Aug 2026 against React 19.2.8, server markup
|
|
150
|
-
* hydrated with the definitions loaded either side of `hydrateRoot`:
|
|
151
|
-
* `Megamenu` and `SpeedDial` wrote `aria-expanded` onto the slotted trigger
|
|
152
|
-
* and React reported "some attributes of the server rendered HTML didn't
|
|
153
|
-
* match the client properties. This won't be patched up" in both orders;
|
|
154
|
-
* `Popover` and `Menu`, which write nothing, were clean in both.
|
|
155
|
-
*
|
|
156
|
-
* **A property crosses that gap because React never looks at one.** It diffs
|
|
157
|
-
* the attributes it rendered, and this one is `attribute: false`, so the state
|
|
158
|
-
* travels to the inner `<button>` and lands inside a shadow root React does
|
|
159
|
-
* not own and cannot compare. The consumer's own element is left exactly as
|
|
160
|
-
* they served it, which is what `Popover`'s note asks for, and the reader is
|
|
161
|
-
* still told what the control does, which is what `SpeedDial`'s note asks
|
|
162
|
-
* for. See #322.
|
|
155
|
+
* What this button submits under its own `name`, the way a native submitter does.
|
|
163
156
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
157
|
+
* **Reported for exactly the submission this button starts and not otherwise.**
|
|
158
|
+
* A native submit button contributes `name=value` only when it is the one
|
|
159
|
+
* that submitted, and every other button on the form contributes nothing. A
|
|
160
|
+
* form-associated element reporting a value continuously would contribute on
|
|
161
|
+
* every submission whoever started it, which is a different feature wearing
|
|
162
|
+
* the same name, so `submit` below sets it, submits, and clears it inside one
|
|
163
|
+
* synchronous call.
|
|
167
164
|
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
165
|
+
* `CopyButton` has a `value` of its own meaning the text to put on the
|
|
166
|
+
* clipboard, which is not this and is why it is declared there rather than
|
|
167
|
+
* inherited.
|
|
170
168
|
*/
|
|
171
|
-
|
|
169
|
+
value: string;
|
|
172
170
|
/**
|
|
173
171
|
* Submits the form as this button, for the length of one call.
|
|
174
172
|
*
|
|
@@ -188,11 +186,11 @@ export declare class HelixHeadlessButton extends HelixFormElement {
|
|
|
188
186
|
/**
|
|
189
187
|
* The element this button's command is sent to, resolved.
|
|
190
188
|
*
|
|
191
|
-
* The platform's own accessor,
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
189
|
+
* The platform's own accessor, because the resolution is otherwise kept
|
|
190
|
+
* inside: `linkCommand` writes the target onto the inner `<button>`, where a
|
|
191
|
+
* consumer cannot reach it, and `commandFor` answers with an id rather than
|
|
192
|
+
* an element. Writing assigns the inner control directly, which is what an
|
|
193
|
+
* invoker without an id in the same tree needs.
|
|
196
194
|
*/
|
|
197
195
|
get commandForElement(): Element | null;
|
|
198
196
|
set commandForElement(target: Element | null);
|
|
@@ -208,13 +206,7 @@ export declare class HelixHeadlessButton extends HelixFormElement {
|
|
|
208
206
|
*
|
|
209
207
|
* `commandForElement` takes an element instead, and an element reference
|
|
210
208
|
* resolves outward: a node in a shadow root may point at one in the document.
|
|
211
|
-
* The same asymmetry the listbox relies on for `aria-activedescendant
|
|
212
|
-
* the second place in this library where the id form is the one that cannot
|
|
213
|
-
* work.
|
|
214
|
-
*
|
|
215
|
-
* The id is looked up in the host's own root rather than the document, so a
|
|
216
|
-
* button inside somebody else's shadow root finds a target in that same root
|
|
217
|
-
* and not a coincidence in the page.
|
|
209
|
+
* The same asymmetry the listbox relies on for `aria-activedescendant`.
|
|
218
210
|
*/
|
|
219
211
|
private linkCommand;
|
|
220
212
|
/**
|
|
@@ -228,12 +220,10 @@ export declare class HelixHeadlessButton extends HelixFormElement {
|
|
|
228
220
|
/**
|
|
229
221
|
* Sends the `command` event where the browser will not.
|
|
230
222
|
*
|
|
231
|
-
* Invoker commands are recent, and where they are missing `linkCommand`
|
|
232
|
-
* property that does not exist and
|
|
233
|
-
* when clicked. Silently: the markup
|
|
234
|
-
* every `command` in the library
|
|
235
|
-
* design system cannot ship an example that depends on a feature failing that
|
|
236
|
-
* quietly.
|
|
223
|
+
* Invoker commands are recent, and where they are missing `linkCommand` sets a
|
|
224
|
+
* property that does not exist and returns, so the button does nothing at all
|
|
225
|
+
* when clicked. Silently: the markup is right, the component is right, and
|
|
226
|
+
* every `command` in the library is inert at once with no error to find.
|
|
237
227
|
*
|
|
238
228
|
* Only where the platform is absent, so a browser that has invokers sends
|
|
239
229
|
* exactly one event and this sends none. Doing both would open a dialog and
|
|
@@ -54,25 +54,44 @@ let HelixHeadlessButton = class HelixHeadlessButton extends HelixFormElement {
|
|
|
54
54
|
target: () => this.renderRoot?.querySelector('[part="button"]') ?? null,
|
|
55
55
|
});
|
|
56
56
|
/**
|
|
57
|
-
* What
|
|
57
|
+
* What to send when the button is activated, and what to send it to.
|
|
58
|
+
*
|
|
59
|
+
* The platform's invoker attributes, forwarded onto the inner `<button>`
|
|
60
|
+
* rather than left on the host: only a real button is recognized as an
|
|
61
|
+
* invoker, so `commandfor` written on a custom element resolves nothing and
|
|
62
|
+
* the trigger silently does nothing at all. A wrapper has to hand them down,
|
|
63
|
+
* the same way `label` becomes `aria-label` in there.
|
|
64
|
+
*
|
|
65
|
+
* ```html
|
|
66
|
+
* <helix-button commandfor="confirm" command="--show">Delete…</helix-button>
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* `commandFor` spells its attribute out, because Lit lowercases a property
|
|
70
|
+
* name to derive one rather than dash-casing it, and what a consumer writes
|
|
71
|
+
* is the platform's `commandfor`.
|
|
72
|
+
*
|
|
73
|
+
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-command Invoker Commands
|
|
58
74
|
*/
|
|
59
|
-
this.
|
|
75
|
+
this.command = '';
|
|
60
76
|
/**
|
|
61
|
-
*
|
|
77
|
+
* The id of the element the command is sent to.
|
|
62
78
|
*
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
* the same name, so `submit` below sets it, submits, and clears it inside one
|
|
69
|
-
* synchronous call.
|
|
79
|
+
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-commandfor Invoker Commands
|
|
80
|
+
*/
|
|
81
|
+
this.commandFor = '';
|
|
82
|
+
/**
|
|
83
|
+
* Whether the button holds its group's tab stop.
|
|
70
84
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
85
|
+
* A toolbar keeps one tab stop across its children, and the obvious way to do
|
|
86
|
+
* that is to write `tabindex` onto each of them. That is a change to markup
|
|
87
|
+
* the consumer rendered, so a React consumer's hydration reports it and does
|
|
88
|
+
* not patch it up. A parent sets this property instead, which writes nothing,
|
|
89
|
+
* and the stop lands on the inner control inside the shadow root.
|
|
90
|
+
*
|
|
91
|
+
* No attribute, because it is coordination between elements rather than
|
|
92
|
+
* anything a consumer sets.
|
|
74
93
|
*/
|
|
75
|
-
this.
|
|
94
|
+
this.focusable = true;
|
|
76
95
|
/**
|
|
77
96
|
* Where this button's submission goes, overriding the form's own.
|
|
78
97
|
*
|
|
@@ -114,49 +133,21 @@ let HelixHeadlessButton = class HelixHeadlessButton extends HelixFormElement {
|
|
|
114
133
|
* "button" and nothing else.
|
|
115
134
|
*/
|
|
116
135
|
this.label = '';
|
|
117
|
-
/**
|
|
118
|
-
* What to send when the button is activated, and what to send it to.
|
|
119
|
-
*
|
|
120
|
-
* The platform's invoker attributes, forwarded onto the inner `<button>`
|
|
121
|
-
* rather than left on the host: only a real button is recognized as an
|
|
122
|
-
* invoker, so `commandfor` written on a custom element resolves nothing and
|
|
123
|
-
* the trigger silently does nothing at all. A wrapper has to hand them down,
|
|
124
|
-
* the same way `label` becomes `aria-label` in there.
|
|
125
|
-
*
|
|
126
|
-
* ```html
|
|
127
|
-
* <helix-button commandfor="confirm" command="--show">Delete…</helix-button>
|
|
128
|
-
* ```
|
|
129
|
-
*
|
|
130
|
-
* `commandFor` spells its attribute out, because Lit lowercases a property
|
|
131
|
-
* name to derive one rather than dash-casing it, and what a consumer writes
|
|
132
|
-
* is the platform's `commandfor`.
|
|
133
|
-
*
|
|
134
|
-
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-command Invoker Commands
|
|
135
|
-
*/
|
|
136
|
-
this.command = '';
|
|
137
|
-
/**
|
|
138
|
-
* The id of the element the command is sent to.
|
|
139
|
-
*
|
|
140
|
-
* @reference https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-commandfor Invoker Commands
|
|
141
|
-
*/
|
|
142
|
-
this.commandFor = '';
|
|
143
136
|
this.handleClick = () => {
|
|
144
137
|
/* **Re-linked here, and this is the line that makes a trigger reliable.**
|
|
145
138
|
*
|
|
146
|
-
* `
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
139
|
+
* From `updated` alone the target resolves once, whenever the button last
|
|
140
|
+
* rendered, and never again. A button whose properties do not change does
|
|
141
|
+
* not update again, so one whose target had not been inserted yet stays
|
|
142
|
+
* wired to nothing for good. Measured: `commandForElement` read null with
|
|
143
|
+
* the target absent, null again after the target was inserted, and resolved
|
|
144
|
+
* the instant an unrelated property forced an update. Whether a trigger
|
|
145
|
+
* works then comes down to insertion order, which is why it survives a full
|
|
146
|
+
* reload and not a client navigation, where the same markup arrives in
|
|
147
|
+
* pieces.
|
|
155
148
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* browser *without* invokers ran this correctly and a browser with them did
|
|
159
|
-
* not.
|
|
149
|
+
* `sendCommand` resolves through `commandTarget` at activation, so a browser
|
|
150
|
+
* *without* invokers was never affected and one with them was.
|
|
160
151
|
*
|
|
161
152
|
* A click listener is early enough, and that is measured rather than read
|
|
162
153
|
* off the specification: activation behavior runs after the click has
|
|
@@ -187,18 +178,25 @@ let HelixHeadlessButton = class HelixHeadlessButton extends HelixFormElement {
|
|
|
187
178
|
}
|
|
188
179
|
};
|
|
189
180
|
/**
|
|
190
|
-
*
|
|
181
|
+
* What activating the button does to its form.
|
|
182
|
+
*/
|
|
183
|
+
this.type = 'button';
|
|
184
|
+
/**
|
|
185
|
+
* What this button submits under its own `name`, the way a native submitter does.
|
|
191
186
|
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
187
|
+
* **Reported for exactly the submission this button starts and not otherwise.**
|
|
188
|
+
* A native submit button contributes `name=value` only when it is the one
|
|
189
|
+
* that submitted, and every other button on the form contributes nothing. A
|
|
190
|
+
* form-associated element reporting a value continuously would contribute on
|
|
191
|
+
* every submission whoever started it, which is a different feature wearing
|
|
192
|
+
* the same name, so `submit` below sets it, submits, and clears it inside one
|
|
193
|
+
* synchronous call.
|
|
197
194
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
195
|
+
* `CopyButton` has a `value` of its own meaning the text to put on the
|
|
196
|
+
* clipboard, which is not this and is why it is declared there rather than
|
|
197
|
+
* inherited.
|
|
200
198
|
*/
|
|
201
|
-
this.
|
|
199
|
+
this.value = '';
|
|
202
200
|
}
|
|
203
201
|
/** Moves focus to the inner control, so the host is never the focus target. */
|
|
204
202
|
static { this.shadowRootOptions = {
|
|
@@ -261,11 +259,11 @@ let HelixHeadlessButton = class HelixHeadlessButton extends HelixFormElement {
|
|
|
261
259
|
/**
|
|
262
260
|
* The element this button's command is sent to, resolved.
|
|
263
261
|
*
|
|
264
|
-
* The platform's own accessor,
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
262
|
+
* The platform's own accessor, because the resolution is otherwise kept
|
|
263
|
+
* inside: `linkCommand` writes the target onto the inner `<button>`, where a
|
|
264
|
+
* consumer cannot reach it, and `commandFor` answers with an id rather than
|
|
265
|
+
* an element. Writing assigns the inner control directly, which is what an
|
|
266
|
+
* invoker without an id in the same tree needs.
|
|
269
267
|
*/
|
|
270
268
|
get commandForElement() {
|
|
271
269
|
const button = this.renderRoot?.querySelector('button');
|
|
@@ -289,13 +287,7 @@ let HelixHeadlessButton = class HelixHeadlessButton extends HelixFormElement {
|
|
|
289
287
|
*
|
|
290
288
|
* `commandForElement` takes an element instead, and an element reference
|
|
291
289
|
* resolves outward: a node in a shadow root may point at one in the document.
|
|
292
|
-
* The same asymmetry the listbox relies on for `aria-activedescendant
|
|
293
|
-
* the second place in this library where the id form is the one that cannot
|
|
294
|
-
* work.
|
|
295
|
-
*
|
|
296
|
-
* The id is looked up in the host's own root rather than the document, so a
|
|
297
|
-
* button inside somebody else's shadow root finds a target in that same root
|
|
298
|
-
* and not a coincidence in the page.
|
|
290
|
+
* The same asymmetry the listbox relies on for `aria-activedescendant`.
|
|
299
291
|
*/
|
|
300
292
|
linkCommand() {
|
|
301
293
|
const button = this.renderRoot?.querySelector('button');
|
|
@@ -320,12 +312,10 @@ let HelixHeadlessButton = class HelixHeadlessButton extends HelixFormElement {
|
|
|
320
312
|
/**
|
|
321
313
|
* Sends the `command` event where the browser will not.
|
|
322
314
|
*
|
|
323
|
-
* Invoker commands are recent, and where they are missing `linkCommand`
|
|
324
|
-
* property that does not exist and
|
|
325
|
-
* when clicked. Silently: the markup
|
|
326
|
-
* every `command` in the library
|
|
327
|
-
* design system cannot ship an example that depends on a feature failing that
|
|
328
|
-
* quietly.
|
|
315
|
+
* Invoker commands are recent, and where they are missing `linkCommand` sets a
|
|
316
|
+
* property that does not exist and returns, so the button does nothing at all
|
|
317
|
+
* when clicked. Silently: the markup is right, the component is right, and
|
|
318
|
+
* every `command` in the library is inert at once with no error to find.
|
|
329
319
|
*
|
|
330
320
|
* Only where the platform is absent, so a browser that has invokers sends
|
|
331
321
|
* exactly one event and this sends none. Doing both would open a dialog and
|
|
@@ -361,10 +351,16 @@ let HelixHeadlessButton = class HelixHeadlessButton extends HelixFormElement {
|
|
|
361
351
|
};
|
|
362
352
|
__decorate([
|
|
363
353
|
property()
|
|
364
|
-
], HelixHeadlessButton.prototype, "
|
|
354
|
+
], HelixHeadlessButton.prototype, "command", void 0);
|
|
365
355
|
__decorate([
|
|
366
|
-
property()
|
|
367
|
-
], HelixHeadlessButton.prototype, "
|
|
356
|
+
property({ attribute: 'commandfor' })
|
|
357
|
+
], HelixHeadlessButton.prototype, "commandFor", void 0);
|
|
358
|
+
__decorate([
|
|
359
|
+
property({ attribute: false })
|
|
360
|
+
], HelixHeadlessButton.prototype, "expanded", void 0);
|
|
361
|
+
__decorate([
|
|
362
|
+
property({ attribute: false })
|
|
363
|
+
], HelixHeadlessButton.prototype, "focusable", void 0);
|
|
368
364
|
__decorate([
|
|
369
365
|
property({ attribute: 'formaction' })
|
|
370
366
|
], HelixHeadlessButton.prototype, "formAction", void 0);
|
|
@@ -385,16 +381,10 @@ __decorate([
|
|
|
385
381
|
], HelixHeadlessButton.prototype, "label", void 0);
|
|
386
382
|
__decorate([
|
|
387
383
|
property()
|
|
388
|
-
], HelixHeadlessButton.prototype, "
|
|
389
|
-
__decorate([
|
|
390
|
-
property({ attribute: 'commandfor' })
|
|
391
|
-
], HelixHeadlessButton.prototype, "commandFor", void 0);
|
|
392
|
-
__decorate([
|
|
393
|
-
property({ attribute: false })
|
|
394
|
-
], HelixHeadlessButton.prototype, "focusable", void 0);
|
|
384
|
+
], HelixHeadlessButton.prototype, "type", void 0);
|
|
395
385
|
__decorate([
|
|
396
|
-
property(
|
|
397
|
-
], HelixHeadlessButton.prototype, "
|
|
386
|
+
property()
|
|
387
|
+
], HelixHeadlessButton.prototype, "value", void 0);
|
|
398
388
|
HelixHeadlessButton = __decorate([
|
|
399
389
|
customElement('helix-headless-button')
|
|
400
390
|
], HelixHeadlessButton);
|
|
@@ -39,11 +39,10 @@ export declare class HelixHeadlessCallout extends HelixElement {
|
|
|
39
39
|
/**
|
|
40
40
|
* What kind of attention the passage needs.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* five incompatible value sets before anything held it.
|
|
42
|
+
* `tone` is the axis for what a thing means, and this is a subset of it: a
|
|
43
|
+
* callout reports a status and never a brand role, so it takes four of the
|
|
44
|
+
* seven values. One word per axis is the whole of the registry, which is why
|
|
45
|
+
* there is no `severity` beside it.
|
|
47
46
|
*/
|
|
48
47
|
tone?: 'danger' | 'info' | 'success' | 'warning';
|
|
49
48
|
/**
|