@fusion.dev/helix-headless 0.1.0 → 0.3.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 +234 -234
- package/dist/accordion/item/accordion-item.js +0 -108
- package/dist/accordion/root/accordion-root.js +0 -33
- package/dist/announcement/root/announcement-root.js +1 -76
- package/dist/app-header/root/app-header-root.js +0 -84
- package/dist/avatar/group/avatar-group.js +0 -77
- package/dist/avatar/root/avatar-root.js +0 -72
- package/dist/badge/root/badge-root.js +0 -67
- package/dist/bar-chart/root/bar-chart-root.js +3 -263
- package/dist/blockquote/root/blockquote-root.js +0 -46
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +0 -72
- package/dist/breadcrumbs/root/breadcrumbs-root.js +0 -52
- package/dist/button/root/button-root.js +0 -215
- package/dist/button-group/root/button-group-root.js +0 -30
- package/dist/callout/root/callout-root.js +0 -52
- package/dist/card/root/card-root.js +0 -41
- package/dist/carousel/root/carousel-root.d.ts +2 -2
- package/dist/carousel/root/carousel-root.js +2 -362
- package/dist/chat/composer/chat-composer.js +0 -131
- package/dist/chat/message/chat-message.js +0 -137
- package/dist/chat/root/chat-root.js +0 -193
- package/dist/checkbox/root/checkbox-root.js +0 -113
- package/dist/checkbox-group/root/checkbox-group-root.js +1 -157
- package/dist/code/root/code-root.js +0 -26
- package/dist/code-block/root/code-block-root.js +0 -100
- package/dist/color-input/root/color-input-root.js +0 -217
- package/dist/color-picker/color.js +0 -69
- package/dist/color-picker/root/color-picker-root.js +0 -272
- package/dist/combobox/root/combobox-root.js +0 -428
- package/dist/command/root/command-root.js +0 -177
- package/dist/copy-button/root/copy-button-root.js +0 -134
- package/dist/data-table/root/data-table-root.js +0 -336
- package/dist/data-table/root/order.js +0 -100
- package/dist/date-input/root/date-input-root.js +1 -398
- package/dist/date-picker/root/date-picker-root.js +0 -358
- package/dist/dialog/root/dialog-root.js +0 -189
- package/dist/divider/root/divider-root.js +0 -71
- package/dist/donut-chart/root/donut-chart-root.js +0 -214
- package/dist/drawer/root/drawer-root.js +0 -116
- package/dist/drilldown/item/drilldown-item.js +0 -82
- package/dist/drilldown/root/drilldown-root.js +0 -91
- package/dist/element-events.generated.js +0 -5
- package/dist/empty/root/empty-root.js +0 -35
- package/dist/file-input/root/file-input-root.js +0 -232
- package/dist/format-date/root/format-date-root.js +0 -95
- package/dist/heatmap/root/buckets.js +0 -57
- package/dist/heatmap/root/heatmap-root.js +0 -313
- package/dist/icon/root/icon-root.js +0 -48
- package/dist/icon-button/root/icon-button-root.js +0 -30
- package/dist/image/root/image-root.js +0 -174
- package/dist/index.js +0 -9
- package/dist/input/root/input-root.js +0 -228
- package/dist/kbd/root/kbd-root.js +0 -117
- package/dist/legend/root/legend-root.js +0 -73
- package/dist/line-chart/root/line-chart-root.js +0 -172
- package/dist/list/item/list-item.js +0 -92
- package/dist/list/root/list-root.js +0 -26
- package/dist/listbox/root/listbox-root.js +2 -429
- package/dist/loader/root/loader-root.js +0 -40
- package/dist/megamenu/root/megamenu-root.js +0 -284
- package/dist/menu/item/menu-item.js +1 -221
- package/dist/menu/root/menu-root.js +1 -171
- package/dist/meter/root/meter-root.js +1 -152
- package/dist/navigation/root/navigation-root.js +0 -56
- package/dist/notifications/notification/notification.js +0 -159
- package/dist/notifications/root/notifications-root.js +0 -148
- package/dist/number-input/root/number-input-root.js +1 -263
- package/dist/option/group/option-group.js +0 -26
- package/dist/option/root/option-root.js +0 -157
- package/dist/outline/root/outline-root.js +0 -292
- package/dist/pagination/root/pagination-root.js +0 -361
- package/dist/pagination/size/pagination-size.js +0 -104
- package/dist/pagination/summary/pagination-summary.js +0 -90
- package/dist/pin-input/root/pin-input-root.js +0 -276
- package/dist/popover/root/popover-root.js +0 -103
- package/dist/progress/root/progress-root.js +1 -133
- package/dist/qr-code/root/qr-code-root.js +0 -96
- package/dist/quote/root/quote-root.js +0 -25
- package/dist/radio/group/radio-group.js +0 -81
- package/dist/radio/root/radio-root.js +0 -85
- package/dist/rating/root/rating-root.js +0 -220
- package/dist/scroll-area/root/scroll-area-root.js +0 -100
- package/dist/select/root/select-root.js +2 -218
- package/dist/skeleton/root/skeleton-root.js +0 -20
- package/dist/slider/root/slider-root.js +1 -267
- package/dist/sparkline/root/sparkline-root.js +3 -164
- package/dist/speed-dial/item/speed-dial-item.js +0 -52
- package/dist/speed-dial/root/speed-dial-root.js +1 -116
- package/dist/splitter/root/splitter-root.js +0 -489
- package/dist/stat/group/stat-group.js +0 -18
- package/dist/stat/root/stat-root.js +0 -23
- package/dist/steps/root/steps-root.js +0 -62
- package/dist/steps/step/step.js +0 -131
- package/dist/switch/root/switch-root.js +0 -80
- package/dist/table/cell/table-cell.js +0 -23
- package/dist/table/column/table-column.js +0 -158
- package/dist/table/root/table-root.js +0 -82
- package/dist/table/row/table-row.js +0 -21
- package/dist/tabs/panel/tab-panel.js +0 -49
- package/dist/tabs/root/tabs-root.js +0 -98
- package/dist/tabs/tab/tab.js +0 -59
- package/dist/tag/root/tag-root.js +0 -31
- package/dist/textarea/root/textarea-root.js +0 -162
- package/dist/time-input/root/time-input-root.js +0 -283
- package/dist/time-picker/root/time-picker-root.js +0 -326
- package/dist/timeline/item/timeline-item.js +0 -66
- package/dist/timeline/root/timeline-root.js +0 -41
- package/dist/toast/item/toast-item.js +0 -165
- package/dist/toast/root/toast-root.js +0 -51
- package/dist/toggle/group/toggle-group.js +0 -150
- package/dist/toggle/root/toggle-root.js +0 -78
- package/dist/toolbar/root/toolbar-root.js +0 -116
- package/dist/tooltip/root/tooltip-root.js +0 -427
- package/dist/tour/root/tour-root.js +0 -130
- package/dist/tour/stop/tour-stop.js +1 -127
- package/dist/tree/item/tree-item.js +0 -198
- package/dist/tree/root/tree-root.js +0 -97
- package/dist/trend/root/trend-root.js +0 -53
- package/dist/video/root/video-root.d.ts +8 -12
- package/dist/video/root/video-root.js +5 -756
- package/dist/video-playlist/item/video-playlist-item.js +1 -90
- package/dist/video-playlist/menu/video-playlist-menu.js +1 -132
- package/dist/video-playlist/root/video-playlist-root.js +0 -113
- package/dist/virtual-list/root/virtual-list-root.js +0 -105
- package/jsx.d.ts +1408 -2576
- package/package.json +6 -6
- package/vue.d.ts +1 -1
|
@@ -7,117 +7,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { customElement, HelixElement, hostAria } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
|
-
/**
|
|
11
|
-
* @summary One row of a list.
|
|
12
|
-
*
|
|
13
|
-
* @description
|
|
14
|
-
* Layout and semantics, and deliberately not a target.
|
|
15
|
-
*
|
|
16
|
-
* **`href` makes the row itself the link.** A whole-row target needs the anchor
|
|
17
|
-
* to wrap the layout, which a *consumer's* anchor cannot do for slots it does not
|
|
18
|
-
* own. The component's can: an `<a part="row">` wraps this component's own layout
|
|
19
|
-
* perfectly well, which is what `Tree.Item` does.
|
|
20
|
-
*
|
|
21
|
-
* What the anchor buys is what the row could not fake: the whole row is a
|
|
22
|
-
* target, Enter follows it, middle click opens a tab, the status bar shows the
|
|
23
|
-
* destination, and it all works before any JavaScript runs.
|
|
24
|
-
*
|
|
25
|
-
* What it costs is client-side routing, and that is the consumer's to restore.
|
|
26
|
-
* A router renders its own anchor and cannot render one inside this shadow
|
|
27
|
-
* root, so a framework wanting a soft navigation intercepts the click on the
|
|
28
|
-
* way out: the anchor is in `composedPath()`, and taking only a plain primary
|
|
29
|
-
* press leaves every native gesture alone.
|
|
30
|
-
*
|
|
31
|
-
* **`data-list-item` is still the answer for a row that is not a destination.**
|
|
32
|
-
* A list row is often a container of controls rather than a place to go, and a
|
|
33
|
-
* row with `href` unset behaves exactly as it always did.
|
|
34
|
-
*
|
|
35
|
-
* @since 0.1.0
|
|
36
|
-
* @status stable
|
|
37
|
-
* @aliases Row, Entry
|
|
38
|
-
* @documentation https://helix.fusion.dev/components/list
|
|
39
|
-
*
|
|
40
|
-
* @slot - The label.
|
|
41
|
-
* @slot end - Trailing content.
|
|
42
|
-
* @slot start - Leading content, usually an icon or an avatar.
|
|
43
|
-
* @slot supporting - Secondary text under the label.
|
|
44
|
-
*
|
|
45
|
-
* @csspart row - The layout, held off the host so the host can carry a marker.
|
|
46
|
-
*/
|
|
47
10
|
let HelixHeadlessListItem = class HelixHeadlessListItem extends HelixElement {
|
|
48
11
|
constructor() {
|
|
49
12
|
super(...arguments);
|
|
50
|
-
/**
|
|
51
|
-
* Where the row goes, and nothing when it goes nowhere.
|
|
52
|
-
*
|
|
53
|
-
* Empty rather than optional, and unset by default: a list is not always a
|
|
54
|
-
* list of links, and an empty `href` written onto every row would be a link
|
|
55
|
-
* to the current page on every row a consumer never asked to be one.
|
|
56
|
-
*/
|
|
57
13
|
this.href = '';
|
|
58
|
-
/**
|
|
59
|
-
* What the link declares about where it goes. The consumer's decision rather
|
|
60
|
-
* than one derived from `target`, for the reason `Tree.Item` gives.
|
|
61
|
-
*/
|
|
62
14
|
this.rel = '';
|
|
63
|
-
/**
|
|
64
|
-
* Where the link opens, for the rare row that leaves the site.
|
|
65
|
-
*/
|
|
66
15
|
this.target = '';
|
|
67
16
|
}
|
|
68
17
|
willUpdate(changed) {
|
|
69
18
|
super.willUpdate(changed);
|
|
70
19
|
hostAria(this.internals, { role: 'listitem' });
|
|
71
20
|
}
|
|
72
|
-
/**
|
|
73
|
-
* The cell before the row's content, which this tier leaves empty.
|
|
74
|
-
*
|
|
75
|
-
* A railed list puts its number at the block's own start edge, in a track of
|
|
76
|
-
* its own ahead of the words, and the native `::marker` cannot reach there:
|
|
77
|
-
* `outside` hangs the marker just clear of the row's content box, which is
|
|
78
|
-
* beside the words rather than at the edge of the block. A number that has to
|
|
79
|
-
* sit in a track has to be a box in that track.
|
|
80
|
-
*
|
|
81
|
-
* **The box belongs to the styled tier, which is why this returns `nothing`.**
|
|
82
|
-
* Rendering it here puts an unstyled empty box in front of every headless row,
|
|
83
|
-
* and a row styled with `display: flex` and a `gap` draws that gap beside the
|
|
84
|
-
* empty child: measured on this tier's own example, which is exactly such a
|
|
85
|
-
* row, 1384 pixels moved and every label sat half a rem further in. The styled
|
|
86
|
-
* row's own comment records the same fault about a column gap beside a
|
|
87
|
-
* zero-width column.
|
|
88
|
-
*
|
|
89
|
-
* A tier that ships no CSS cannot make a box it renders cost nothing, so it
|
|
90
|
-
* does not render one. `marker="rail"` is a styled-tier attribute for the same
|
|
91
|
-
* reason: *that* a list is numbered is a fact about the content and *where the
|
|
92
|
-
* numbers are drawn* is not. A headless consumer wanting a rail writes the
|
|
93
|
-
* cell they were going to style anyway.
|
|
94
|
-
*
|
|
95
|
-
* `protected` rather than `private`, so the tier above can reach it.
|
|
96
|
-
*/
|
|
97
21
|
renderRail() {
|
|
98
22
|
return nothing;
|
|
99
23
|
}
|
|
100
24
|
render() {
|
|
101
|
-
/* One wrapper, and it earns its place rather than breaking the bare-slot
|
|
102
|
-
rule. That rule is about optional *regions*, which generate an empty box
|
|
103
|
-
when nothing fills them; this is a single always-present container whose
|
|
104
|
-
job is to hold the layout somewhere other than the host.
|
|
105
|
-
|
|
106
|
-
The host has to be free for `display: list-item`, which is how an ordered
|
|
107
|
-
or unordered list gets its marker: native numbering, native counters,
|
|
108
|
-
native RTL, and nothing written by script or counted on the server. But
|
|
109
|
-
`list-item` cannot combine with `grid`, so a row whose host carried the
|
|
110
|
-
grid lost it the moment the list asked for a marker. Measured before this
|
|
111
|
-
wrapper: a row with a leading icon put the icon 32px in instead of 16 and
|
|
112
|
-
its supporting text beside the label instead of under it. */
|
|
113
25
|
const content = html `${this.renderRail()}<slot name="start"></slot>
|
|
114
26
|
<slot></slot>
|
|
115
27
|
<slot name="supporting"></slot>
|
|
116
28
|
<slot name="end"></slot>`;
|
|
117
|
-
/* An anchor where there is somewhere to go, and the same box either way.
|
|
118
|
-
The host keeps `role="listitem"`, so the row inside it is the link and
|
|
119
|
-
not the item: an `<a>` carrying `listitem` would be a link that claims to
|
|
120
|
-
be a list entry, and the list would have one fewer entry than it has. */
|
|
121
29
|
return this.href === ''
|
|
122
30
|
? html `<div part="row">${content}</div>`
|
|
123
31
|
: html `<a
|
|
@@ -7,40 +7,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { customElement, HelixElement, hostAria } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
|
-
/**
|
|
11
|
-
* @summary A set of rows, read as a set.
|
|
12
|
-
*
|
|
13
|
-
* @description
|
|
14
|
-
* `role="list"` on the host, so the rows are counted and announced as "1 of 7"
|
|
15
|
-
* rather than as seven unrelated passages. That count is the whole reason to
|
|
16
|
-
* use a list rather than a stack of divs.
|
|
17
|
-
*
|
|
18
|
-
* @since 0.1.0
|
|
19
|
-
* @status stable
|
|
20
|
-
* @category data
|
|
21
|
-
* @aliases Rows, Stack, Menu
|
|
22
|
-
* @documentation https://helix.fusion.dev/components/list
|
|
23
|
-
*
|
|
24
|
-
* @slot - The rows.
|
|
25
|
-
*/
|
|
26
10
|
let HelixHeadlessList = class HelixHeadlessList extends HelixElement {
|
|
27
11
|
constructor() {
|
|
28
12
|
super(...arguments);
|
|
29
|
-
/**
|
|
30
|
-
* Accessible name for the set.
|
|
31
|
-
*/
|
|
32
13
|
this.label = '';
|
|
33
14
|
}
|
|
34
15
|
willUpdate(changed) {
|
|
35
16
|
super.willUpdate(changed);
|
|
36
17
|
hostAria(this.internals, { label: this.label, role: 'list' });
|
|
37
|
-
/* `role="list"` at every kind, including `description`. A description list
|
|
38
|
-
has its own native role, but this renders divs rather than `<dl>`, and
|
|
39
|
-
claiming `term`/`definition` without the owning `list` those roles
|
|
40
|
-
require is worse than a plain list: an invented role that resolves to
|
|
41
|
-
nothing tells a reader less than an honest generic one. The pairing is
|
|
42
|
-
carried by the markup being a label and its supporting text, which is
|
|
43
|
-
what it already was. */
|
|
44
18
|
}
|
|
45
19
|
render() {
|
|
46
20
|
return html `<slot></slot>`;
|