@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
|
@@ -6,15 +6,12 @@ declare const HelixHeadlessBarChart_base: typeof HelixElement & (new (...args: a
|
|
|
6
6
|
* @summary Categories as columns, read from a table.
|
|
7
7
|
*
|
|
8
8
|
* @description
|
|
9
|
-
*
|
|
10
|
-
* decisions are made here rather than left to a consumer.
|
|
9
|
+
* Two decisions are made here rather than left to a consumer.
|
|
11
10
|
*
|
|
12
11
|
* **It measures from zero and there is no property to change that.** A bar's
|
|
13
12
|
* length *is* its value, so a baseline anywhere else makes the lengths
|
|
14
|
-
* proportional to nothing.
|
|
15
|
-
*
|
|
16
|
-
* wants the differences between values rather than the values should be drawing
|
|
17
|
-
* a line, which claims only a shape.
|
|
13
|
+
* proportional to nothing. A reader who wants the differences between values
|
|
14
|
+
* rather than the values should be drawing a line, which claims only a shape.
|
|
18
15
|
*
|
|
19
16
|
* **The labels are HTML beside the drawing rather than `<text>` inside it.** An
|
|
20
17
|
* `<svg>` that fills its box scales everything in it, including type: the same
|
|
@@ -26,10 +23,9 @@ declare const HelixHeadlessBarChart_base: typeof HelixElement & (new (...args: a
|
|
|
26
23
|
* A reader who wants the numbers gets the numbers, not a described picture of
|
|
27
24
|
* them.
|
|
28
25
|
*
|
|
29
|
-
* The properties below are written by this component and read by whoever
|
|
30
|
-
* it. A consumer sets none of them: they carry a number this element
|
|
31
|
-
* and CSS cannot
|
|
32
|
-
* without measuring anything itself.
|
|
26
|
+
* The custom properties below are written by this component and read by whoever
|
|
27
|
+
* draws it. A consumer sets none of them: they carry a number this element
|
|
28
|
+
* computed and CSS cannot.
|
|
33
29
|
*
|
|
34
30
|
* @since 0.1.0
|
|
35
31
|
* @status experimental
|
|
@@ -83,12 +79,11 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
|
|
|
83
79
|
* group, and `both` draws both. Which of those is horizontal turns with
|
|
84
80
|
* `direction`, because a rule belongs to an axis and not to a screen edge.
|
|
85
81
|
*
|
|
86
|
-
* **A bare `gridlines` means `value`**, and so does anything
|
|
87
|
-
*
|
|
82
|
+
* **A bare `gridlines` means `value`**, and so does anything unrecognized: an
|
|
83
|
+
* unrecognized value that draws nothing is indistinguishable from the
|
|
88
84
|
* attribute being absent, which is the one thing a reader cannot debug.
|
|
89
85
|
*
|
|
90
|
-
* `category` is the quieter half of this on a bar chart
|
|
91
|
-
* completeness rather than because it is usually right: columns already
|
|
86
|
+
* `category` is the quieter half of this on a bar chart: columns already
|
|
92
87
|
* divide the categories by being separate columns, and a rule through each
|
|
93
88
|
* one is a second statement of the same fact. It earns its place on a chart
|
|
94
89
|
* of many thin bars, where the eye has stopped counting.
|
|
@@ -115,9 +110,7 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
|
|
|
115
110
|
* and the reader has no way to see it happening.
|
|
116
111
|
*
|
|
117
112
|
* A line among columns still measures from zero, because the columns do and
|
|
118
|
-
* they share the axis.
|
|
119
|
-
* this is a bar chart that can carry a line rather than a line chart that can
|
|
120
|
-
* carry columns.
|
|
113
|
+
* they share the axis.
|
|
121
114
|
*/
|
|
122
115
|
lines?: string;
|
|
123
116
|
/**
|
|
@@ -140,7 +133,7 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
|
|
|
140
133
|
* measured against each other and a reader needs no numbers to do that. With
|
|
141
134
|
* two, a reader has no way of knowing there are two, let alone which series
|
|
142
135
|
* is on which, so both scales are labeled the moment this is set. An
|
|
143
|
-
*
|
|
136
|
+
* unlabeled second axis is the deceptive case rather than the tidy one.
|
|
144
137
|
*
|
|
145
138
|
* The grid stays on the primary axis, since a rule measured against two
|
|
146
139
|
* scales at once is a rule that means nothing. The tooltip is unaffected: it
|
|
@@ -162,8 +155,7 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
|
|
|
162
155
|
* In `willUpdate` because `direction` is a property a consumer can change at
|
|
163
156
|
* any time, and the controller resolves a reading from whichever axis it was
|
|
164
157
|
* last told about: set once at connect, a chart turned sideways after that
|
|
165
|
-
*
|
|
166
|
-
* went. That is the bug this pair was written for, one step later.
|
|
158
|
+
* goes on reading x and answers with the same row wherever the pointer goes.
|
|
167
159
|
*
|
|
168
160
|
* `willUpdate` and not `updated`, because SSR calls the first and not the
|
|
169
161
|
* second, and a value the server and the client disagree about is worse than
|
|
@@ -189,13 +181,13 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
|
|
|
189
181
|
* recover either from the picture. So this appears with `secondary` and never
|
|
190
182
|
* without it.
|
|
191
183
|
*
|
|
192
|
-
* **Beside the plot and not inside it
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
184
|
+
* **Beside the plot and not inside it.** Inside, the numbers are drawn over
|
|
185
|
+
* the drawing, and a horizontal chart shows it immediately: its value axis
|
|
186
|
+
* runs along the bottom, which is where the last row of bars is. The vertical
|
|
187
|
+
* case has the same fault and enough slack to hide it. The plot is also the
|
|
188
|
+
* pointer's catchment and the tooltip's containing block, both measured from
|
|
189
|
+
* its box, so padding it to make room would move every reading half an axis
|
|
190
|
+
* to the right.
|
|
199
191
|
*
|
|
200
192
|
* A column of the host grid instead, which the stylesheet grows only when
|
|
201
193
|
* `secondary` is set. That is what the property reflects for.
|
|
@@ -229,8 +221,8 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
|
|
|
229
221
|
* thing by lighting the region the pointer is actually in, and the region is
|
|
230
222
|
* the whole slot, because that is the catchment the pointer resolves against.
|
|
231
223
|
*
|
|
232
|
-
* Both are kept. The fade separates the active group from its
|
|
233
|
-
* the band says where the
|
|
224
|
+
* Both are kept. The fade separates the active group from its neighbors and
|
|
225
|
+
* the band says where the neighborhood is, and on a chart of two categories
|
|
234
226
|
* the fade alone is ambiguous about which half is lit.
|
|
235
227
|
*/
|
|
236
228
|
protected renderBand(count: number, sideways: boolean): TemplateResult | typeof nothing;
|
|
@@ -14,15 +14,12 @@ const HEIGHT = 100;
|
|
|
14
14
|
* @summary Categories as columns, read from a table.
|
|
15
15
|
*
|
|
16
16
|
* @description
|
|
17
|
-
*
|
|
18
|
-
* decisions are made here rather than left to a consumer.
|
|
17
|
+
* Two decisions are made here rather than left to a consumer.
|
|
19
18
|
*
|
|
20
19
|
* **It measures from zero and there is no property to change that.** A bar's
|
|
21
20
|
* length *is* its value, so a baseline anywhere else makes the lengths
|
|
22
|
-
* proportional to nothing.
|
|
23
|
-
*
|
|
24
|
-
* wants the differences between values rather than the values should be drawing
|
|
25
|
-
* a line, which claims only a shape.
|
|
21
|
+
* proportional to nothing. A reader who wants the differences between values
|
|
22
|
+
* rather than the values should be drawing a line, which claims only a shape.
|
|
26
23
|
*
|
|
27
24
|
* **The labels are HTML beside the drawing rather than `<text>` inside it.** An
|
|
28
25
|
* `<svg>` that fills its box scales everything in it, including type: the same
|
|
@@ -34,10 +31,9 @@ const HEIGHT = 100;
|
|
|
34
31
|
* A reader who wants the numbers gets the numbers, not a described picture of
|
|
35
32
|
* them.
|
|
36
33
|
*
|
|
37
|
-
* The properties below are written by this component and read by whoever
|
|
38
|
-
* it. A consumer sets none of them: they carry a number this element
|
|
39
|
-
* and CSS cannot
|
|
40
|
-
* without measuring anything itself.
|
|
34
|
+
* The custom properties below are written by this component and read by whoever
|
|
35
|
+
* draws it. A consumer sets none of them: they carry a number this element
|
|
36
|
+
* computed and CSS cannot.
|
|
41
37
|
*
|
|
42
38
|
* @since 0.1.0
|
|
43
39
|
* @status experimental
|
|
@@ -102,8 +98,7 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
102
98
|
* In `willUpdate` because `direction` is a property a consumer can change at
|
|
103
99
|
* any time, and the controller resolves a reading from whichever axis it was
|
|
104
100
|
* last told about: set once at connect, a chart turned sideways after that
|
|
105
|
-
*
|
|
106
|
-
* went. That is the bug this pair was written for, one step later.
|
|
101
|
+
* goes on reading x and answers with the same row wherever the pointer goes.
|
|
107
102
|
*
|
|
108
103
|
* `willUpdate` and not `updated`, because SSR calls the first and not the
|
|
109
104
|
* second, and a value the server and the client disagree about is worse than
|
|
@@ -143,9 +138,9 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
143
138
|
growing upward needs `[HEIGHT, 0]`; a bar growing rightward is already
|
|
144
139
|
going the way x counts, so it takes `[0, HEIGHT]`.
|
|
145
140
|
*
|
|
146
|
-
* Reusing the inverted scale for both
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
* Reusing the inverted scale for both puts the longest bar at x=0 and every
|
|
142
|
+
shorter one hard against the right edge, growing away from the baseline
|
|
143
|
+
instead of out of it. */
|
|
149
144
|
const domain = [Math.min(0, low), Math.max(0, high)];
|
|
150
145
|
const range = this.direction === 'horizontal' ? [0, HEIGHT] : [HEIGHT, 0];
|
|
151
146
|
const y = linear(domain, range);
|
|
@@ -168,13 +163,12 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
168
163
|
/* The second axis wears its series' color when exactly one series is on it,
|
|
169
164
|
which is the case worth helping and the only one a single color can
|
|
170
165
|
describe honestly: with two sharing it, painting the axis either of their
|
|
171
|
-
|
|
166
|
+
colors says it belongs to that one.
|
|
172
167
|
*
|
|
173
|
-
**Written onto the axis and not onto the plot
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
same mistake `--donut-chart-stroke` made one component over. */
|
|
168
|
+
**Written onto the axis and not onto the plot.** The axis is the plot's
|
|
169
|
+
sibling, being a column of the host grid, and a custom property inherits
|
|
170
|
+
down and never sideways: written onto the plot, both axes come out the
|
|
171
|
+
neutral. */
|
|
178
172
|
const lone = series.filter(own);
|
|
179
173
|
const tint = lone.length === 1 && lone[0] !== undefined
|
|
180
174
|
? `--bar-chart-secondary: var(--chart-series-${seriesIndex(series.indexOf(lone[0]))})`
|
|
@@ -192,7 +186,7 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
192
186
|
const slot = 100 / categories.length;
|
|
193
187
|
/* Split first, because the columns share the slot between themselves and a
|
|
194
188
|
line takes none of it. Sized by every series instead, a chart of two
|
|
195
|
-
columns and one line
|
|
189
|
+
columns and one line draws both columns two thirds as wide and leaves a
|
|
196
190
|
third of every slot empty, for a mark that is not in the slot at all. */
|
|
197
191
|
const lined = this.lined;
|
|
198
192
|
/* Kept with the index it has among *all* the series, because a column needs
|
|
@@ -201,10 +195,10 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
201
195
|
stand shoulder to shoulder with no gap where a line was; `tone` is its
|
|
202
196
|
place in the palette, so it keeps the color the legend gives it.
|
|
203
197
|
*
|
|
204
|
-
Passing the first for both
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
198
|
+
Passing the first for both moves a series into its neighbor's color as
|
|
199
|
+
well as its slot: with `Target` drawn as a line, a chart of four series
|
|
200
|
+
paints three columns in the first three colors and the line in the third
|
|
201
|
+
one as well. */
|
|
208
202
|
const scaled = this.scaled;
|
|
209
203
|
const own = (one) => scaled.has(one.name.trim().toLowerCase());
|
|
210
204
|
/* The scale a series is measured against, resolved once per series rather
|
|
@@ -215,12 +209,11 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
215
209
|
.map((one, index) => ({ one, tone: index }))
|
|
216
210
|
.filter(({ one }) => !lined.has(one.name.trim().toLowerCase()));
|
|
217
211
|
/* **The stride is what the columns share and the thickness is what they
|
|
218
|
-
draw
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
anything is outlined or not.
|
|
212
|
+
draw.** Back to back, two columns meet on one coordinate and each one's
|
|
213
|
+
edge is the other's: an outlined chart then shows a single line between
|
|
214
|
+
them rather than two, and a bar looks as though it were missing a side.
|
|
215
|
+
A gap is also just the right way to draw a group, which is why the split
|
|
216
|
+
stays whether anything is outlined or not.
|
|
224
217
|
|
|
225
218
|
Centered in the stride rather than flush against it, so the gap between two
|
|
226
219
|
columns is the same size everywhere and the group sits where it did. One
|
|
@@ -229,11 +222,11 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
229
222
|
const gap = columns.length > 1 ? stride * 0.08 : 0;
|
|
230
223
|
const thickness = stride - gap;
|
|
231
224
|
/* **The geometry is computed for the axis it is drawn on, not rotated onto
|
|
232
|
-
it.**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
225
|
+
it.** Turning the whole plot with `rotate: 90deg` is the shorter CSS and
|
|
226
|
+
does not work: a rotation is about the element's own center, so the
|
|
227
|
+
drawing leaves its grid cell entirely while the labels, which are a
|
|
228
|
+
separate row, stay where they were. What that produces is one column
|
|
229
|
+
floating beside a list of names.
|
|
237
230
|
*
|
|
238
231
|
* Swapping the two axes here costs one branch and keeps every other fact
|
|
239
232
|
* about the chart the same. `value` runs along x when the bars are
|
|
@@ -280,11 +273,10 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
280
273
|
tier's: `wash="gradient"` there switches `fill` to
|
|
281
274
|
`--chart-bar-wash` and this is what it would find.
|
|
282
275
|
|
|
283
|
-
|
|
276
|
+
Colored through the series property rather than an attribute, so
|
|
284
277
|
the stops read a token this tier never names. The id resolves
|
|
285
278
|
within the shadow root, so two charts on a page carrying the same
|
|
286
|
-
ids stay independent
|
|
287
|
-
on it. */
|
|
279
|
+
ids stay independent. */
|
|
288
280
|
svg `<defs>
|
|
289
281
|
${series.map((_, index) => svg `<linearGradient
|
|
290
282
|
id="helix-bar-wash-${seriesIndex(index)}"
|
|
@@ -334,13 +326,13 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
334
326
|
* recover either from the picture. So this appears with `secondary` and never
|
|
335
327
|
* without it.
|
|
336
328
|
*
|
|
337
|
-
* **Beside the plot and not inside it
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
329
|
+
* **Beside the plot and not inside it.** Inside, the numbers are drawn over
|
|
330
|
+
* the drawing, and a horizontal chart shows it immediately: its value axis
|
|
331
|
+
* runs along the bottom, which is where the last row of bars is. The vertical
|
|
332
|
+
* case has the same fault and enough slack to hide it. The plot is also the
|
|
333
|
+
* pointer's catchment and the tooltip's containing block, both measured from
|
|
334
|
+
* its box, so padding it to make room would move every reading half an axis
|
|
335
|
+
* to the right.
|
|
344
336
|
*
|
|
345
337
|
* A column of the host grid instead, which the stylesheet grows only when
|
|
346
338
|
* `secondary` is set. That is what the property reflects for.
|
|
@@ -364,13 +356,6 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
364
356
|
>`)}
|
|
365
357
|
</div>`;
|
|
366
358
|
}
|
|
367
|
-
/*
|
|
368
|
-
* The category names, as HTML beside the drawing rather than inside it.
|
|
369
|
-
*
|
|
370
|
-
* Inside, they would scale with the box: an `<svg>` that fills its container
|
|
371
|
-
* scales its type along with everything else, and there is no non-scaling
|
|
372
|
-
* equivalent for a font the way `vector-effect` is one for a stroke.
|
|
373
|
-
*/
|
|
374
359
|
/**
|
|
375
360
|
* The grid, behind everything, or nothing at all.
|
|
376
361
|
*
|
|
@@ -413,8 +398,8 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
413
398
|
* thing by lighting the region the pointer is actually in, and the region is
|
|
414
399
|
* the whole slot, because that is the catchment the pointer resolves against.
|
|
415
400
|
*
|
|
416
|
-
* Both are kept. The fade separates the active group from its
|
|
417
|
-
* the band says where the
|
|
401
|
+
* Both are kept. The fade separates the active group from its neighbors and
|
|
402
|
+
* the band says where the neighborhood is, and on a chart of two categories
|
|
418
403
|
* the fade alone is ambiguous about which half is lit.
|
|
419
404
|
*/
|
|
420
405
|
renderBand(count, sideways) {
|
|
@@ -451,7 +436,7 @@ let HelixHeadlessBarChart = class HelixHeadlessBarChart extends MixinChartSource
|
|
|
451
436
|
const along = y(point.value);
|
|
452
437
|
return sideways ? [along, across] : [across, along];
|
|
453
438
|
});
|
|
454
|
-
/* Straight between the category
|
|
439
|
+
/* Straight between the category centers, and no `curve` property to change
|
|
455
440
|
it. A bar chart's other axis is categorical: there is nothing between
|
|
456
441
|
Gateway and Billing, so a curve through them draws values at positions
|
|
457
442
|
that do not exist and bulges past the readings on the way. `LineChart`
|
|
@@ -7,12 +7,10 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
7
7
|
* Contributes the separator, the list-item role, and the link itself where one
|
|
8
8
|
* is wanted.
|
|
9
9
|
*
|
|
10
|
-
* **`href` makes the crumb the link.**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* click on the way out, which is what `Tree.Item` and `List.Item` both do.
|
|
15
|
-
* What the anchor buys is the whole crumb as a target, Enter, middle click, the
|
|
10
|
+
* **`href` makes the crumb the link.** A router cannot reach an anchor inside a
|
|
11
|
+
* shadow root, and the consumer restores the soft navigation by intercepting the
|
|
12
|
+
* click on the way out, which is what `Tree.Item` and `List.Item` both do. What
|
|
13
|
+
* the anchor buys is the whole crumb as a target, Enter, middle click, the
|
|
16
14
|
* status bar, and a trail that works before any JavaScript runs.
|
|
17
15
|
*
|
|
18
16
|
* **And the parent needs it.** A trail that collapses has to rebuild its hidden
|
|
@@ -62,29 +60,25 @@ export declare class HelixHeadlessBreadcrumb extends HelixElement {
|
|
|
62
60
|
* the property, rendered the anchor, and left the host looking unlinked: the
|
|
63
61
|
* crumb drew at 20px where a markup twin drew at 28.
|
|
64
62
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* this optional rather than defaulted: an `href` written onto every host would
|
|
69
|
-
* be a link to the current page on every crumb nobody asked to be one. That is
|
|
70
|
-
* the general rule as well, that a reflected property takes no default, so the
|
|
71
|
-
* two agree.
|
|
63
|
+
* Optional rather than defaulted, which is the general rule that a reflected
|
|
64
|
+
* property takes no default: an `href` written onto every host would be a link
|
|
65
|
+
* to the current page on every crumb nobody asked to be one.
|
|
72
66
|
*
|
|
73
|
-
*
|
|
67
|
+
* Reading cannot catch this and the picture comparison can. React assigns a
|
|
74
68
|
* matching property instead of an attribute, so every crumb in the React twin
|
|
75
69
|
* of `breadcrumbs/links` lost its padding at once.
|
|
76
70
|
*/
|
|
77
71
|
href?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Where the link opens, for the rare crumb that leaves the site.
|
|
80
|
-
*/
|
|
81
|
-
target: string;
|
|
82
72
|
/**
|
|
83
73
|
* What the link declares about where it goes.
|
|
84
74
|
*
|
|
85
75
|
* The consumer's decision.
|
|
86
76
|
*/
|
|
87
77
|
rel: string;
|
|
78
|
+
/**
|
|
79
|
+
* Where the link opens, for the rare crumb that leaves the site.
|
|
80
|
+
*/
|
|
81
|
+
target: string;
|
|
88
82
|
protected willUpdate(changed: PropertyValues): void;
|
|
89
83
|
/**
|
|
90
84
|
* The mark between one crumb and the next.
|
|
@@ -16,12 +16,10 @@ import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
|
16
16
|
* Contributes the separator, the list-item role, and the link itself where one
|
|
17
17
|
* is wanted.
|
|
18
18
|
*
|
|
19
|
-
* **`href` makes the crumb the link.**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* click on the way out, which is what `Tree.Item` and `List.Item` both do.
|
|
24
|
-
* What the anchor buys is the whole crumb as a target, Enter, middle click, the
|
|
19
|
+
* **`href` makes the crumb the link.** A router cannot reach an anchor inside a
|
|
20
|
+
* shadow root, and the consumer restores the soft navigation by intercepting the
|
|
21
|
+
* click on the way out, which is what `Tree.Item` and `List.Item` both do. What
|
|
22
|
+
* the anchor buys is the whole crumb as a target, Enter, middle click, the
|
|
25
23
|
* status bar, and a trail that works before any JavaScript runs.
|
|
26
24
|
*
|
|
27
25
|
* **And the parent needs it.** A trail that collapses has to rebuild its hidden
|
|
@@ -63,16 +61,16 @@ let HelixHeadlessBreadcrumb = class HelixHeadlessBreadcrumb extends HelixElement
|
|
|
63
61
|
* Whether this item is the page the reader is on.
|
|
64
62
|
*/
|
|
65
63
|
this.current = false;
|
|
66
|
-
/**
|
|
67
|
-
* Where the link opens, for the rare crumb that leaves the site.
|
|
68
|
-
*/
|
|
69
|
-
this.target = '';
|
|
70
64
|
/**
|
|
71
65
|
* What the link declares about where it goes.
|
|
72
66
|
*
|
|
73
67
|
* The consumer's decision.
|
|
74
68
|
*/
|
|
75
69
|
this.rel = '';
|
|
70
|
+
/**
|
|
71
|
+
* Where the link opens, for the rare crumb that leaves the site.
|
|
72
|
+
*/
|
|
73
|
+
this.target = '';
|
|
76
74
|
}
|
|
77
75
|
willUpdate(changed) {
|
|
78
76
|
super.willUpdate(changed);
|
|
@@ -101,10 +99,9 @@ let HelixHeadlessBreadcrumb = class HelixHeadlessBreadcrumb extends HelixElement
|
|
|
101
99
|
/* The label and whatever flanks it, which is the same content whether or
|
|
102
100
|
not it is a link. Built once so the two branches below cannot drift. */
|
|
103
101
|
const label = html `<slot name="start"></slot><slot></slot><slot name="end"></slot>`;
|
|
104
|
-
/* The current page is text, not a link, whatever it was given
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
contradicting each other in the markup. */
|
|
102
|
+
/* The current page is text, not a link, whatever it was given, so `current`
|
|
103
|
+
wins over `href` rather than the two contradicting each other in the
|
|
104
|
+
markup. */
|
|
108
105
|
const linked = (this.href ?? '') !== '' && !this.current;
|
|
109
106
|
return html `<span part="separator" aria-hidden="true"
|
|
110
107
|
>${this.renderSeparator()}</span
|
|
@@ -127,10 +124,10 @@ __decorate([
|
|
|
127
124
|
], HelixHeadlessBreadcrumb.prototype, "href", void 0);
|
|
128
125
|
__decorate([
|
|
129
126
|
property()
|
|
130
|
-
], HelixHeadlessBreadcrumb.prototype, "
|
|
127
|
+
], HelixHeadlessBreadcrumb.prototype, "rel", void 0);
|
|
131
128
|
__decorate([
|
|
132
129
|
property()
|
|
133
|
-
], HelixHeadlessBreadcrumb.prototype, "
|
|
130
|
+
], HelixHeadlessBreadcrumb.prototype, "target", void 0);
|
|
134
131
|
HelixHeadlessBreadcrumb = __decorate([
|
|
135
132
|
customElement('helix-headless-breadcrumb')
|
|
136
133
|
], HelixHeadlessBreadcrumb);
|
|
@@ -15,27 +15,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
15
15
|
* Items are slotted rather than wrapped, so they are `<ol>` children in the flat
|
|
16
16
|
* tree and each carries `role="listitem"` itself.
|
|
17
17
|
*
|
|
18
|
-
* **The trail does not measure itself, and the overflow is markup.**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* server shipped every crumb and the client removed some after hydrating. A
|
|
26
|
-
* trail that collapses therefore painted wrong on every single load, and the
|
|
27
|
-
* SSR spec asserting "hides no crumb, whatever collapse says" was recording
|
|
28
|
-
* that as correct behavior rather than as the cost it is.
|
|
29
|
-
* - **The consumer already wrote the crumbs.** The measurement hid some, then
|
|
30
|
-
* announced which, so that the consumer could read them back off the element
|
|
31
|
-
* and clone them into menu items. The overflow example spent 32 lines of
|
|
32
|
-
* JavaScript making a round trip out of data that started in its own markup.
|
|
33
|
-
* - **Nobody specifies a breadcrumb in units of fit.** Designs say "keep the
|
|
34
|
-
* root and the current page, fold the middle", which is a fact about depth,
|
|
35
|
-
* or "fold below this width", which is a fact CSS knows. The arithmetic was
|
|
36
|
-
* the only thing that needed a width, and it was wrong three times in one day:
|
|
37
|
-
* the observer watched a container that did not exist yet, the gap between
|
|
38
|
-
* items went uncounted, and the result was still wrong at 34rem.
|
|
18
|
+
* **The trail does not measure itself, and the overflow is markup.** Measuring
|
|
19
|
+
* how many crumbs fit can never reach the server: there is no width without a
|
|
20
|
+
* DOM, so the server ships every crumb and the client removes some after
|
|
21
|
+
* hydrating, and a trail that collapses paints wrong on every single load. Nor
|
|
22
|
+
* does anybody specify a breadcrumb in units of fit. Designs say "keep the root
|
|
23
|
+
* and the current page, fold the middle", which is a fact about depth, or "fold
|
|
24
|
+
* below this width", which is a fact CSS knows.
|
|
39
25
|
*
|
|
40
26
|
* So the trail lays out crumbs and separators, and the consumer writes what
|
|
41
27
|
* folds: a `helix-menu` of `helix-menu-item`s in a crumb, where the gap
|
|
@@ -44,13 +30,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
44
30
|
* container query in the consumer's own sheet, which is theirs to write and
|
|
45
31
|
* theirs to leave out.
|
|
46
32
|
*
|
|
47
|
-
* **And the crumbs carry no marker for any of it.**
|
|
48
|
-
*
|
|
49
|
-
* from a step and so the trail could size it. With the controller gone the
|
|
50
|
-
* first use went with it, and the second is better answered by the crumb
|
|
51
|
-
* sizing whatever is slotted into it, which is true of every crumb rather than
|
|
52
|
-
* of one a consumer remembered to mark. What is left is a fact CSS can already
|
|
53
|
-
* see: the crumb with the menu in it is `:has(helix-menu)`, and the middle is
|
|
33
|
+
* **And the crumbs carry no marker for any of it.** CSS can already see it: the
|
|
34
|
+
* crumb with the menu in it is `:has(helix-menu)`, and the middle is
|
|
54
35
|
* `:not(:first-child, [current])`. A marker would be the design rule written
|
|
55
36
|
* twice, once in the HTML and once in the sheet, with nothing keeping the two
|
|
56
37
|
* honest.
|
|
@@ -21,27 +21,13 @@ import { html } from 'lit';
|
|
|
21
21
|
* Items are slotted rather than wrapped, so they are `<ol>` children in the flat
|
|
22
22
|
* tree and each carries `role="listitem"` itself.
|
|
23
23
|
*
|
|
24
|
-
* **The trail does not measure itself, and the overflow is markup.**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* server shipped every crumb and the client removed some after hydrating. A
|
|
32
|
-
* trail that collapses therefore painted wrong on every single load, and the
|
|
33
|
-
* SSR spec asserting "hides no crumb, whatever collapse says" was recording
|
|
34
|
-
* that as correct behavior rather than as the cost it is.
|
|
35
|
-
* - **The consumer already wrote the crumbs.** The measurement hid some, then
|
|
36
|
-
* announced which, so that the consumer could read them back off the element
|
|
37
|
-
* and clone them into menu items. The overflow example spent 32 lines of
|
|
38
|
-
* JavaScript making a round trip out of data that started in its own markup.
|
|
39
|
-
* - **Nobody specifies a breadcrumb in units of fit.** Designs say "keep the
|
|
40
|
-
* root and the current page, fold the middle", which is a fact about depth,
|
|
41
|
-
* or "fold below this width", which is a fact CSS knows. The arithmetic was
|
|
42
|
-
* the only thing that needed a width, and it was wrong three times in one day:
|
|
43
|
-
* the observer watched a container that did not exist yet, the gap between
|
|
44
|
-
* items went uncounted, and the result was still wrong at 34rem.
|
|
24
|
+
* **The trail does not measure itself, and the overflow is markup.** Measuring
|
|
25
|
+
* how many crumbs fit can never reach the server: there is no width without a
|
|
26
|
+
* DOM, so the server ships every crumb and the client removes some after
|
|
27
|
+
* hydrating, and a trail that collapses paints wrong on every single load. Nor
|
|
28
|
+
* does anybody specify a breadcrumb in units of fit. Designs say "keep the root
|
|
29
|
+
* and the current page, fold the middle", which is a fact about depth, or "fold
|
|
30
|
+
* below this width", which is a fact CSS knows.
|
|
45
31
|
*
|
|
46
32
|
* So the trail lays out crumbs and separators, and the consumer writes what
|
|
47
33
|
* folds: a `helix-menu` of `helix-menu-item`s in a crumb, where the gap
|
|
@@ -50,13 +36,8 @@ import { html } from 'lit';
|
|
|
50
36
|
* container query in the consumer's own sheet, which is theirs to write and
|
|
51
37
|
* theirs to leave out.
|
|
52
38
|
*
|
|
53
|
-
* **And the crumbs carry no marker for any of it.**
|
|
54
|
-
*
|
|
55
|
-
* from a step and so the trail could size it. With the controller gone the
|
|
56
|
-
* first use went with it, and the second is better answered by the crumb
|
|
57
|
-
* sizing whatever is slotted into it, which is true of every crumb rather than
|
|
58
|
-
* of one a consumer remembered to mark. What is left is a fact CSS can already
|
|
59
|
-
* see: the crumb with the menu in it is `:has(helix-menu)`, and the middle is
|
|
39
|
+
* **And the crumbs carry no marker for any of it.** CSS can already see it: the
|
|
40
|
+
* crumb with the menu in it is `:has(helix-menu)`, and the middle is
|
|
60
41
|
* `:not(:first-child, [current])`. A marker would be the design rule written
|
|
61
42
|
* twice, once in the HTML and once in the sheet, with nothing keeping the two
|
|
62
43
|
* honest.
|