@fusion.dev/helix-headless 0.247.1 → 0.248.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/accordion/item/accordion-item.d.ts +1 -1
- package/dist/accordion/root/accordion-root.d.ts +11 -2
- package/dist/announcement/root/announcement-root.d.ts +9 -8
- package/dist/app-header/root/app-header-root.d.ts +13 -9
- package/dist/area-chart/root/area-chart-root.d.ts +13 -5
- package/dist/avatar/group/avatar-group.d.ts +1 -1
- package/dist/avatar/root/avatar-root.d.ts +4 -1
- package/dist/badge/root/badge-root.d.ts +3 -7
- package/dist/bar-chart/root/bar-chart-root.d.ts +11 -3
- package/dist/blockquote/root/blockquote-root.d.ts +8 -5
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +10 -4
- package/dist/button/root/button-root.d.ts +8 -9
- package/dist/button-group/root/button-group-root.d.ts +8 -4
- package/dist/callout/root/callout-root.d.ts +6 -3
- package/dist/canvas/edge/canvas-edge.d.ts +1 -1
- package/dist/canvas/node/canvas-node.d.ts +1 -1
- package/dist/canvas/root/canvas-root.d.ts +9 -8
- package/dist/card/root/card-root.d.ts +5 -1
- package/dist/carousel/root/carousel-root.d.ts +12 -4
- package/dist/chat/composer/chat-composer.d.ts +1 -1
- package/dist/chat/message/chat-message.d.ts +1 -1
- package/dist/chat/root/chat-root.d.ts +16 -17
- package/dist/checkbox/root/checkbox-root.d.ts +7 -4
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +13 -9
- package/dist/code/root/code-root.d.ts +7 -4
- package/dist/code-block/root/code-block-root.d.ts +15 -8
- package/dist/code-editor/root/code-editor-root.d.ts +18 -7
- package/dist/code-input/root/code-input-root.d.ts +11 -6
- package/dist/color-input/root/color-input-root.d.ts +8 -1
- package/dist/color-picker/root/color-picker-root.d.ts +7 -1
- package/dist/column-manager/root/column-manager-root.d.ts +13 -5
- package/dist/combobox/root/combobox-root.d.ts +7 -13
- package/dist/command/root/command-root.d.ts +14 -9
- package/dist/copy-button/root/copy-button-root.d.ts +9 -4
- package/dist/data-table/root/data-table-root.d.ts +19 -15
- package/dist/date-input/root/date-input-root.d.ts +9 -1
- package/dist/date-picker/root/date-picker-root.d.ts +12 -8
- package/dist/description-list/item/description-list-item.d.ts +1 -1
- package/dist/description-list/root/description-list-root.d.ts +7 -1
- package/dist/device-screen/root/device-screen-root.d.ts +14 -9
- package/dist/dialog/root/dialog-root.d.ts +7 -5
- package/dist/divider/root/divider-root.d.ts +7 -5
- package/dist/donut-chart/root/donut-chart-root.d.ts +9 -7
- package/dist/drawer/root/drawer-root.d.ts +9 -11
- package/dist/drilldown/item/drilldown-item.d.ts +1 -1
- package/dist/drilldown/root/drilldown-root.d.ts +12 -7
- package/dist/editor/root/editor-root.d.ts +12 -3
- package/dist/empty/root/empty-root.d.ts +7 -5
- package/dist/file-input/root/file-input-root.d.ts +6 -1
- package/dist/filter-input/chip/filter-chip.d.ts +1 -1
- package/dist/filter-input/field/filter-field.d.ts +1 -1
- package/dist/filter-input/menu/filter-menu.d.ts +1 -1
- package/dist/filter-input/operator/filter-operator.d.ts +1 -1
- package/dist/filter-input/root/filter-input-root.d.ts +21 -29
- package/dist/find/root/find-root.d.ts +10 -1
- package/dist/format-date/root/format-date-root.d.ts +10 -5
- package/dist/graph/root/graph-root.d.ts +11 -5
- package/dist/heatmap/root/heatmap-root.d.ts +11 -4
- package/dist/hover-card/root/hover-card-root.d.ts +9 -7
- package/dist/icon/root/icon-root.d.ts +8 -4
- package/dist/icon-button/root/icon-button-root.d.ts +5 -1
- package/dist/image/root/image-root.d.ts +5 -1
- package/dist/input/root/input-root.d.ts +10 -3
- package/dist/kbd/root/kbd-root.d.ts +8 -12
- package/dist/legend/root/legend-root.d.ts +11 -8
- package/dist/lightbox/item/lightbox-item.d.ts +1 -1
- package/dist/lightbox/root/lightbox-root.d.ts +16 -9
- package/dist/line-chart/root/line-chart-root.d.ts +13 -8
- package/dist/list/item/list-item.d.ts +1 -1
- package/dist/list/root/list-root.d.ts +17 -12
- package/dist/listbox/root/listbox-root.d.ts +11 -18
- package/dist/loader/root/loader-root.d.ts +13 -9
- package/dist/log/group/log-group.d.ts +1 -1
- package/dist/log/line/log-line.d.ts +1 -1
- package/dist/log/root/log-root.d.ts +12 -4
- package/dist/map/area/map-area.d.ts +1 -1
- package/dist/map/buildings/map-buildings.d.ts +1 -1
- package/dist/map/contours/map-contours.d.ts +1 -1
- package/dist/map/landcover/map-landcover.d.ts +1 -1
- package/dist/map/marker/map-marker.d.ts +1 -1
- package/dist/map/points/map-points.d.ts +1 -1
- package/dist/map/position/map-position.d.ts +1 -1
- package/dist/map/raster/map-raster.d.ts +1 -1
- package/dist/map/root/map-root.d.ts +12 -7
- package/dist/map/route/map-route.d.ts +1 -1
- package/dist/map/terrain/map-terrain.d.ts +1 -1
- package/dist/markdown/root/markdown-root.d.ts +13 -9
- package/dist/megamenu/root/megamenu-root.d.ts +7 -4
- package/dist/menu/item/menu-item.d.ts +1 -1
- package/dist/menu/root/menu-root.d.ts +15 -22
- package/dist/menu/section/menu-section.d.ts +1 -1
- package/dist/meter/root/meter-root.d.ts +15 -8
- package/dist/meter/segment/meter-segment.d.ts +1 -1
- package/dist/motion-toggle/root/motion-toggle-root.d.ts +6 -1
- package/dist/navigation/root/navigation-root.d.ts +10 -4
- package/dist/notifications/group/notification-group.d.ts +1 -1
- package/dist/notifications/notification/notification.d.ts +1 -1
- package/dist/notifications/root/notifications-root.d.ts +10 -9
- package/dist/number-input/root/number-input-root.d.ts +7 -2
- package/dist/object-inspector/root/object-inspector-root.d.ts +14 -6
- package/dist/option/group/option-group.d.ts +1 -1
- package/dist/option/root/option-root.d.ts +11 -6
- package/dist/option/separator/option-separator.d.ts +1 -1
- package/dist/outline/root/outline-root.d.ts +7 -4
- package/dist/pagination/root/pagination-root.d.ts +10 -7
- package/dist/pagination/size/pagination-size.d.ts +1 -1
- package/dist/pagination/summary/pagination-summary.d.ts +1 -1
- package/dist/pin-input/root/pin-input-root.d.ts +7 -1
- package/dist/popover/root/popover-root.d.ts +12 -9
- package/dist/progress/root/progress-root.d.ts +13 -8
- package/dist/qr-code/root/qr-code-root.d.ts +7 -3
- package/dist/quick-filters/filter/quick-filter.d.ts +1 -1
- package/dist/quick-filters/root/quick-filters-root.d.ts +11 -6
- package/dist/quote/root/quote-root.d.ts +6 -6
- package/dist/radio/group/radio-group.d.ts +1 -1
- package/dist/radio/root/radio-root.d.ts +7 -4
- package/dist/rating/root/rating-root.d.ts +11 -6
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +14 -8
- package/dist/scroll-area/root/scroll-area-root.d.ts +4 -1
- package/dist/select/root/select-root.d.ts +9 -16
- package/dist/selection-bar/root/selection-bar-root.d.ts +12 -7
- package/dist/shortcut-overlay/root/shortcut-overlay-root.d.ts +10 -8
- package/dist/skeleton/root/skeleton-root.d.ts +9 -10
- package/dist/skip-link/root/skip-link-root.d.ts +3 -1
- package/dist/slider/root/slider-root.d.ts +14 -8
- package/dist/sparkline/root/sparkline-root.d.ts +9 -11
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +7 -1
- package/dist/spatial-heatmap/root/spatial-heatmap-root.d.ts +8 -1
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.d.ts +7 -1
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.d.ts +8 -1
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.d.ts +8 -1
- package/dist/spatial-treemap/root/spatial-treemap-root.d.ts +7 -1
- package/dist/speed-dial/group/speed-dial-group.d.ts +1 -1
- package/dist/speed-dial/item/speed-dial-item.d.ts +1 -1
- package/dist/speed-dial/root/speed-dial-root.d.ts +13 -5
- package/dist/splitter/root/splitter-root.d.ts +17 -14
- package/dist/stat/group/stat-group.d.ts +1 -1
- package/dist/stat/root/stat-root.d.ts +25 -8
- package/dist/stat/root/stat-root.js +8 -2
- package/dist/steps/root/steps-root.d.ts +6 -4
- package/dist/steps/step/step.d.ts +1 -1
- package/dist/switch/root/switch-root.d.ts +7 -2
- package/dist/table/cell/table-cell.d.ts +1 -1
- package/dist/table/column/table-column.d.ts +1 -1
- package/dist/table/root/table-root.d.ts +14 -9
- package/dist/table/row/table-row.d.ts +1 -1
- package/dist/table-export/root/table-export-root.d.ts +11 -3
- package/dist/tabs/panel/tab-panel.d.ts +1 -1
- package/dist/tabs/root/tabs-root.d.ts +11 -3
- package/dist/tabs/tab/tab.d.ts +1 -1
- package/dist/tag/group/tag-group.d.ts +1 -1
- package/dist/tag/root/tag-root.d.ts +4 -4
- package/dist/terminal/root/terminal-root.d.ts +13 -6
- package/dist/textarea/root/textarea-root.d.ts +8 -1
- package/dist/theme-toggle/root/theme-toggle-root.d.ts +9 -4
- package/dist/time-input/root/time-input-root.d.ts +11 -5
- package/dist/time-picker/root/time-picker-root.d.ts +13 -10
- package/dist/timeline/group/timeline-group.d.ts +1 -1
- package/dist/timeline/item/timeline-item.d.ts +1 -1
- package/dist/timeline/root/timeline-root.d.ts +19 -11
- package/dist/toast/item/toast-item.d.ts +1 -1
- package/dist/toast/root/toast-root.d.ts +15 -15
- package/dist/toggle/group/toggle-group.d.ts +1 -1
- package/dist/toggle/root/toggle-root.d.ts +4 -1
- package/dist/toolbar/root/toolbar-root.d.ts +5 -1
- package/dist/tooltip/root/tooltip-root.d.ts +6 -6
- package/dist/tour/root/tour-root.d.ts +11 -4
- package/dist/tour/stop/tour-stop.d.ts +1 -1
- package/dist/tree/item/tree-item.d.ts +1 -1
- package/dist/tree/root/tree-root.d.ts +10 -3
- package/dist/trend/root/trend-root.d.ts +11 -6
- package/dist/video/root/video-root.d.ts +13 -10
- package/dist/video-playlist/item/video-playlist-item.d.ts +1 -1
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +1 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +11 -6
- package/dist/view-panel/root/view-panel-root.d.ts +14 -8
- package/dist/virtual-list/root/virtual-list-root.d.ts +13 -8
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +266 -623
- package/types/vue.d.ts +267 -624
|
@@ -29,11 +29,9 @@ declare const HelixHeadlessScatterChart_base: typeof HelixElement & (new (...arg
|
|
|
29
29
|
* @summary A chart that shows whether two measures move together, with one point per row.
|
|
30
30
|
*
|
|
31
31
|
* @description
|
|
32
|
-
* A scatter chart shows how two measures relate.
|
|
33
|
-
* column
|
|
34
|
-
*
|
|
35
|
-
* expectancy column draws one point for each country. Each additional numeric
|
|
36
|
-
* column is another series, in its own color.
|
|
32
|
+
* A scatter chart shows how two measures relate. A table of countries with an
|
|
33
|
+
* income column and a life expectancy column draws one point for each country.
|
|
34
|
+
* Each additional numeric column is another series, in its own color.
|
|
37
35
|
*
|
|
38
36
|
* Both axes are labeled, because both positions are values. The ticks sit at
|
|
39
37
|
* round numbers, and the range extends to them.
|
|
@@ -79,8 +77,7 @@ declare const HelixHeadlessScatterChart_base: typeof HelixElement & (new (...arg
|
|
|
79
77
|
*
|
|
80
78
|
* **`data` takes the readings as data** where the page has no table to point
|
|
81
79
|
* `for` at, in a table's shape: the column headings, then one row per reading
|
|
82
|
-
* with its label first.
|
|
83
|
-
* show one, since it reads before any script runs.
|
|
80
|
+
* with its label first.
|
|
84
81
|
*
|
|
85
82
|
* **A chart with nothing to draw says so.** A table with no readings shows
|
|
86
83
|
* `empty-text`, "No readings", in the plot, and `loading` shows `loading-text`
|
|
@@ -106,7 +103,16 @@ declare const HelixHeadlessScatterChart_base: typeof HelixElement & (new (...arg
|
|
|
106
103
|
* @status stable
|
|
107
104
|
* @category charts
|
|
108
105
|
* @aliases Scatter Plot, XY Chart, Correlation Chart, Dot Plot
|
|
109
|
-
* @
|
|
106
|
+
* @use Two measures against each other, one point per row, such as page weight and load time.
|
|
107
|
+
* @instead line-chart - One measure over time.
|
|
108
|
+
* @instead spatial-scatter-chart - Three measures for each row, such as age, spend, and visits.
|
|
109
|
+
* @anatomy y-axis
|
|
110
|
+
* @anatomy points
|
|
111
|
+
* @anatomy x-axis
|
|
112
|
+
* @anatomy x-name
|
|
113
|
+
* @practice Put the measure read across in the first numeric column of the table `for` names. - That column is measured across, every other numeric column is measured up, and each row is one point.
|
|
114
|
+
* @practice Point `for` at a table on the page, and set `data` only where there is none. - A table reads before any script runs.
|
|
115
|
+
* @documentation https://fusion.dev/design/components/scatter-chart
|
|
110
116
|
*
|
|
111
117
|
* @slot empty - Content shown in place of the drawing when the table has no readings, such as a link to add the first. Falls back to `empty-text`.
|
|
112
118
|
* @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
|
|
@@ -53,7 +53,10 @@ declare const EDGES: readonly ['block-start', 'block-end', 'inline-start', 'inli
|
|
|
53
53
|
* @status stable
|
|
54
54
|
* @category layout
|
|
55
55
|
* @aliases Scroller, Overflow, Scroll container
|
|
56
|
-
* @
|
|
56
|
+
* @use A box of fixed height whose content scrolls, such as release notes in a panel.
|
|
57
|
+
* @instead virtual-list - Thousands of rows, of which only those in view are drawn.
|
|
58
|
+
* @instead log - Output that arrives while you watch, with the newest line kept in view.
|
|
59
|
+
* @documentation https://fusion.dev/design/components/scroll-area
|
|
57
60
|
*
|
|
58
61
|
* @slot - The content that scrolls.
|
|
59
62
|
*
|
|
@@ -13,12 +13,7 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
|
|
|
13
13
|
* place for focus to return to when the list closes.
|
|
14
14
|
*
|
|
15
15
|
* Your options stay in your light DOM and are slotted through into the listbox,
|
|
16
|
-
* so the listbox looks through slots to find them.
|
|
17
|
-
* group them in `Option.Group`, and divide them with `Option.Separator`.
|
|
18
|
-
* Importing the Option entry registers all three. For a list too long to draw
|
|
19
|
-
* whole, set `items` instead: the list draws only the options in sight, as
|
|
20
|
-
* Listbox's `items` does, and the trigger, its keys and the form read the
|
|
21
|
-
* whole set.
|
|
16
|
+
* so the listbox looks through slots to find them.
|
|
22
17
|
*
|
|
23
18
|
* `Select` owns the value, passes it down to the listbox, and takes changes
|
|
24
19
|
* back, so the value lives in one place. With `multiple`, the value is the
|
|
@@ -59,15 +54,6 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
|
|
|
59
54
|
* Set `autocomplete` to let a browser's autofill choose, as a native `<select>`
|
|
60
55
|
* with the same attribute would.
|
|
61
56
|
*
|
|
62
|
-
* **The options are an import of their own.** An option is the Option family's,
|
|
63
|
-
* which the select does not register, so a page that writes one imports it
|
|
64
|
-
* beside the select:
|
|
65
|
-
*
|
|
66
|
-
* ```js
|
|
67
|
-
* import '@fusion.dev/helix/select'
|
|
68
|
-
* import '@fusion.dev/helix/option'
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
57
|
* In development, a select holding an option nobody registered says so once the
|
|
72
58
|
* page has loaded, with the line to add.
|
|
73
59
|
*
|
|
@@ -79,7 +65,14 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
|
|
|
79
65
|
* @instead combobox - A list long enough that you type to find the value.
|
|
80
66
|
* @instead radio - Up to five options you should see without opening anything.
|
|
81
67
|
* @instead menu - An action that runs when you choose it.
|
|
82
|
-
* @
|
|
68
|
+
* @anatomy label
|
|
69
|
+
* @anatomy trigger
|
|
70
|
+
* @anatomy indicator
|
|
71
|
+
* @anatomy surface
|
|
72
|
+
* @practice Import Option beside Select. - An option belongs to the Option family, which Select does not register.
|
|
73
|
+
* @practice Group options with `Option.Group`, and divide them with `Option.Separator`. - The Option import registers all three.
|
|
74
|
+
* @practice Set `items` for a list too long to draw whole. - The list draws only the options in sight, and the trigger, its keys, and the form still read the whole set.
|
|
75
|
+
* @documentation https://fusion.dev/design/components/select
|
|
83
76
|
*
|
|
84
77
|
* @slot - The options, and any groups of them.
|
|
85
78
|
* @slot end - Content after the chosen value, such as a count, a unit, or a clear button.
|
|
@@ -5,9 +5,8 @@ import { TableBinding, type ToolTable } from '../../data-table/binding.js';
|
|
|
5
5
|
* @summary A bar that says how many of a Data Table's rows are selected, with what you can do to them and a way to clear them.
|
|
6
6
|
*
|
|
7
7
|
* @description
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* and Export, and Clear unselects every row.
|
|
8
|
+
* Slot your actions into the bar, such as Archive and Export, and Clear
|
|
9
|
+
* unselects every row.
|
|
11
10
|
*
|
|
12
11
|
* ```html
|
|
13
12
|
* <helix-data-table selectable row-key="id">
|
|
@@ -17,15 +16,21 @@ import { TableBinding, type ToolTable } from '../../data-table/binding.js';
|
|
|
17
16
|
* </helix-data-table>
|
|
18
17
|
* ```
|
|
19
18
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* as a reader's own choice does.
|
|
19
|
+
* Clear asks the table with `helix-before-select`, as a reader's own choice
|
|
20
|
+
* does.
|
|
23
21
|
*
|
|
24
22
|
* @since 0.238.0
|
|
25
23
|
* @status experimental
|
|
26
24
|
* @category data
|
|
27
25
|
* @aliases Bulk actions, Action bar
|
|
28
|
-
* @
|
|
26
|
+
* @use Actions on the rows selected in a Data Table, with how many are selected.
|
|
27
|
+
* @instead toolbar - Controls that stay in place whatever is selected.
|
|
28
|
+
* @anatomy count
|
|
29
|
+
* @anatomy actions
|
|
30
|
+
* @anatomy clear
|
|
31
|
+
* @practice Put Selection Bar in the Data Table's selection slot. - It then takes the toolbar's place while rows are selected.
|
|
32
|
+
* @practice Set `for` to the table's id where the bar is written outside the table. - Written inside the table, it finds the table.
|
|
33
|
+
* @documentation https://fusion.dev/design/components/selection-bar
|
|
29
34
|
*
|
|
30
35
|
* @slot - What you can do to the selected rows, such as buttons.
|
|
31
36
|
*
|
|
@@ -21,13 +21,8 @@ type HoldKey = 'alt' | 'ctrl' | 'mod' | 'shift';
|
|
|
21
21
|
*
|
|
22
22
|
* Press `?` outside a text field, or call `showSheet()`, to open the sheet: a
|
|
23
23
|
* dialog listing every shortcut on the page by name, which is how a keyboard
|
|
24
|
-
* or screen reader user gets the same list.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Many apps, GitHub and Gmail among them, already give `?` to their own help,
|
|
28
|
-
* so a page that answers `?` itself opens both on one press. Such a page sets
|
|
29
|
-
* `sheet-keys` to another chord, or to nothing and calls `showSheet()` from
|
|
30
|
-
* its own handler.
|
|
24
|
+
* or screen reader user gets the same list. `sheet-keys` set to nothing leaves
|
|
25
|
+
* `?` to the page, which can call `showSheet()` from its own handler.
|
|
31
26
|
*
|
|
32
27
|
* The badges are a picture of what the controls already expose, so they are
|
|
33
28
|
* hidden from assistive technology.
|
|
@@ -36,7 +31,14 @@ type HoldKey = 'alt' | 'ctrl' | 'mod' | 'shift';
|
|
|
36
31
|
* @status experimental
|
|
37
32
|
* @category navigation
|
|
38
33
|
* @aliases Keyboard shortcuts, Shortcut hints, Key tips, Cheat sheet
|
|
39
|
-
* @
|
|
34
|
+
* @use A page with many keyboard shortcuts, each shown on its control while you hold a key.
|
|
35
|
+
* @instead kbd - One key or chord written inside a sentence.
|
|
36
|
+
* @instead command - Commands you find by typing.
|
|
37
|
+
* @anatomy badge
|
|
38
|
+
* @anatomy badge-keys
|
|
39
|
+
* @anatomy badge-name
|
|
40
|
+
* @practice Set `sheet-keys` to another chord where your page answers `?` with its own help. - Many apps, GitHub and Gmail among them, give `?` to their own help, and one press then opens both.
|
|
41
|
+
* @documentation https://fusion.dev/design/components/shortcut-overlay
|
|
40
42
|
*
|
|
41
43
|
* @csspart badge - One control's badge.
|
|
42
44
|
* @csspart badge-keys - A badge's keys.
|
|
@@ -15,17 +15,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
15
15
|
* There is no `shape` property. Whether a placeholder is a line, a block, or a
|
|
16
16
|
* circle is presentation, which belongs to the styled tier.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `
|
|
21
|
-
* placeholder over its box, so nothing moves when the content arrives. Take
|
|
22
|
-
* `loading` off and the content is shown as it is. An empty skeleton is a
|
|
18
|
+
* While `loading` is set the content is inert, the host is `aria-busy`, and
|
|
19
|
+
* the styled tier hides the content and paints the placeholder over its box.
|
|
20
|
+
* Take `loading` off and the content is shown as it is. An empty skeleton is a
|
|
23
21
|
* placeholder of its own size, as before.
|
|
24
22
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* and three lines, laid out as the card will be. While `loading` is set the
|
|
28
|
-
* placeholder shows and the content is hidden. Once it is off the placeholder
|
|
23
|
+
* While `loading` is set, a placeholder in the `placeholder` slot shows and the
|
|
24
|
+
* content is hidden. Once it is off the placeholder
|
|
29
25
|
* is hidden and the content shows. The placeholder is hidden from screen
|
|
30
26
|
* readers. A server cannot see the children, so it serves both, and the
|
|
31
27
|
* content is hidden once the page has its children.
|
|
@@ -37,7 +33,10 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
37
33
|
* @use The shape of content that is loading, where its layout is known.
|
|
38
34
|
* @instead loader - Work of unknown length with no layout to hold.
|
|
39
35
|
* @instead empty - A region that loaded and holds nothing.
|
|
40
|
-
* @
|
|
36
|
+
* @anatomy skeleton
|
|
37
|
+
* @practice {loading} Put the real content inside the skeleton and set `loading`. - The skeleton takes the content's size, so nothing moves when the content arrives.
|
|
38
|
+
* @practice {revealing} Draw your own placeholder in the `placeholder` slot for content that is not there until it loads. - The placeholder shows while `loading` is set, laid out as the content will be, such as a circle and three lines for a profile.
|
|
39
|
+
* @documentation https://fusion.dev/design/components/skeleton
|
|
41
40
|
*
|
|
42
41
|
* @slot - The content the skeleton stands in for, which sizes it. Optional.
|
|
43
42
|
* @slot placeholder - What shows while `loading` is set, in place of the content, such as skeletons laid out as the content will be. Falls back to the skeleton's own shape.
|
|
@@ -28,7 +28,9 @@ import { type TemplateResult } from 'lit';
|
|
|
28
28
|
* @status stable
|
|
29
29
|
* @category navigation
|
|
30
30
|
* @aliases Skip navigation, Skip to content
|
|
31
|
-
* @
|
|
31
|
+
* @use A page with a header or a navigation before its main content.
|
|
32
|
+
* @practice {custom-target} Put it first inside the body, and give the content region the id its `href` names. - A press moves focus past the header to that region.
|
|
33
|
+
* @documentation https://fusion.dev/design/components/skip-link
|
|
32
34
|
*
|
|
33
35
|
* @slot - The link's text. Defaults to `label`.
|
|
34
36
|
*
|
|
@@ -9,14 +9,10 @@ declare const HelixHeadlessSlider_base: (new (...args: any[]) => import("@fusion
|
|
|
9
9
|
* End, the page keys, and the touch target come from the platform. A native
|
|
10
10
|
* range has a hit area larger than its thumb, sized for a finger.
|
|
11
11
|
*
|
|
12
|
-
* The value is a string, like every other form control's, and
|
|
13
|
-
* `MixinControllerValue` holds text. Use `valueAsNumber` for arithmetic.
|
|
14
|
-
*
|
|
15
12
|
* Marks are drawn by the component. The ticks of a `<datalist>` cannot be
|
|
16
|
-
* styled, and Firefox does not render them for a range.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* does not draw a hundred and one marks by accident.
|
|
13
|
+
* styled, and Firefox does not render them for a range. `markers` is a count,
|
|
14
|
+
* so a slider from zero to a hundred does not draw a hundred and one marks by
|
|
15
|
+
* accident.
|
|
20
16
|
*
|
|
21
17
|
* A range with two thumbs is two inputs stacked on one track, because there is
|
|
22
18
|
* no native two-thumb range. Each thumb keeps its own value, and a named range
|
|
@@ -69,7 +65,17 @@ declare const HelixHeadlessSlider_base: (new (...args: any[]) => import("@fusion
|
|
|
69
65
|
* @status stable
|
|
70
66
|
* @category forms
|
|
71
67
|
* @aliases Range, Range input
|
|
72
|
-
* @
|
|
68
|
+
* @use A value picked from a range by eye, such as a volume.
|
|
69
|
+
* @instead number-input - An exact number you type, such as a quantity.
|
|
70
|
+
* @instead rating - A score of a few steps, such as stars on a review.
|
|
71
|
+
* @instead carousel - Slides you move between, one at a time.
|
|
72
|
+
* @anatomy label
|
|
73
|
+
* @anatomy control
|
|
74
|
+
* @anatomy output?
|
|
75
|
+
* @anatomy hint?
|
|
76
|
+
* @practice Read `valueAsNumber` for arithmetic. - The value is a string, like every other form control's.
|
|
77
|
+
* @practice {markers} Set `step` for where the value can land, and `markers` for the marks drawn. - Marks are decoration, and the input holds to `step` whether or not marks are drawn.
|
|
78
|
+
* @documentation https://fusion.dev/design/components/slider
|
|
73
79
|
*
|
|
74
80
|
* @slot feedback - The message that says what is wrong, for content richer than a string. It shows while there is a message.
|
|
75
81
|
* @slot hint - Help under the control, for content richer than the `hint` text.
|
|
@@ -4,13 +4,9 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
4
4
|
* @summary A small chart with no axes that shows the shape of a series beside its number.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
* Takes its numbers from the `values` attribute
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* announces.
|
|
11
|
-
*
|
|
12
|
-
* Use `for` when a sparkline has a real table behind it. `for` wins when both
|
|
13
|
-
* are set.
|
|
7
|
+
* Takes its numbers from the `values` attribute, where the other charts read a
|
|
8
|
+
* table. Set `label` to the one sentence a screen reader announces. `for` wins
|
|
9
|
+
* when it and `values` are both set.
|
|
14
10
|
*
|
|
15
11
|
* Without a `label` the sparkline is decorative and `aria-hidden`, for example
|
|
16
12
|
* beside a stat that already says "Sessions, 1,102". With a `label` it is
|
|
@@ -39,9 +35,6 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
39
35
|
* readings arrive, as on every chart. The `empty` and `loading` slots take
|
|
40
36
|
* markup in place of either.
|
|
41
37
|
*
|
|
42
|
-
* Place it beside a `Stat`, because a change beside a figure is a second fact,
|
|
43
|
-
* as `Stat`'s own spec says. `Trend` is composed the same way.
|
|
44
|
-
*
|
|
45
38
|
* The component writes the properties listed below, and the stylesheet that
|
|
46
39
|
* draws the sparkline reads them. Do not set them yourself. They carry numbers
|
|
47
40
|
* the component computes and CSS cannot, so a stylesheet can draw the sparkline
|
|
@@ -62,7 +55,12 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
62
55
|
* @status stable
|
|
63
56
|
* @category charts
|
|
64
57
|
* @aliases Micro Chart, Trend Line, Inline Chart
|
|
65
|
-
* @
|
|
58
|
+
* @use The shape of a series beside its number, such as in a stat or a table row.
|
|
59
|
+
* @instead line-chart - A series you read against a scale, with axes and labels.
|
|
60
|
+
* @instead trend - Which way one measurement moved, and whether that is good.
|
|
61
|
+
* @practice Set `values` to the numbers, and use `for` only where a real table stands behind the sparkline. - A table behind a small trend line would be read aloud row by row.
|
|
62
|
+
* @practice Place the sparkline beside a `Stat`. - A change beside a figure is a second fact, and `Trend` is placed the same way.
|
|
63
|
+
* @documentation https://fusion.dev/design/components/sparkline
|
|
66
64
|
*
|
|
67
65
|
* @slot empty - Content shown in place of the line when there are no readings. Falls back to `empty-text`.
|
|
68
66
|
* @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
|
|
@@ -66,7 +66,13 @@ declare const HelixHeadlessSpatialBarChart_base: typeof HelixElement & (new (...
|
|
|
66
66
|
* @status experimental
|
|
67
67
|
* @category charts
|
|
68
68
|
* @aliases 3D bar chart, 3D column chart, Isometric bar chart, Isometric column chart, Bar chart in 3D
|
|
69
|
-
* @
|
|
69
|
+
* @use Values over two sets of categories, such as signups by region and quarter.
|
|
70
|
+
* @instead bar-chart - Values over one set of categories, read against a scale.
|
|
71
|
+
* @instead spatial-heatmap - A count for each day over weeks, such as commits.
|
|
72
|
+
* @anatomy grid
|
|
73
|
+
* @anatomy bar
|
|
74
|
+
* @anatomy tick
|
|
75
|
+
* @documentation https://fusion.dev/design/components/spatial-bar-chart
|
|
70
76
|
*
|
|
71
77
|
* @slot - The renderer's box, which the 3D drawing is made in.
|
|
72
78
|
* @slot empty - Content shown when the table has no readings. Falls back to `empty-text`.
|
|
@@ -91,7 +91,14 @@ type DrawnCorners = {
|
|
|
91
91
|
* @status experimental
|
|
92
92
|
* @category charts
|
|
93
93
|
* @aliases Isometric heatmap, Isometric chart, 3D heatmap, Relief chart, Isometric contribution graph
|
|
94
|
-
* @
|
|
94
|
+
* @use Counts for each day over weeks, drawn as a relief, such as a year of commits.
|
|
95
|
+
* @instead heatmap - A strip of readings you scan, such as uptime.
|
|
96
|
+
* @instead spatial-bar-chart - Values over two sets of categories, such as signups by region and quarter.
|
|
97
|
+
* @anatomy cell
|
|
98
|
+
* @anatomy base
|
|
99
|
+
* @anatomy start?
|
|
100
|
+
* @anatomy end?
|
|
101
|
+
* @documentation https://fusion.dev/design/components/spatial-heatmap
|
|
95
102
|
*
|
|
96
103
|
* @slot renderer - The renderer's box, which a 3D drawing is made in, over the chart's own.
|
|
97
104
|
*
|
|
@@ -60,7 +60,13 @@ declare const HelixHeadlessSpatialRibbonChart_base: typeof HelixElement & (new (
|
|
|
60
60
|
* @status experimental
|
|
61
61
|
* @category charts
|
|
62
62
|
* @aliases 3D ribbon chart, 3D line chart, Ribbon chart, Waterfall plot, Line chart in 3D
|
|
63
|
-
* @
|
|
63
|
+
* @use Several series over one set of places that would tangle as lines, such as latency by region.
|
|
64
|
+
* @instead line-chart - Series over time that you read against one scale.
|
|
65
|
+
* @instead spatial-surface-chart - A measure that varies over two others, such as load by day and hour.
|
|
66
|
+
* @anatomy grid
|
|
67
|
+
* @anatomy ribbon
|
|
68
|
+
* @anatomy tick
|
|
69
|
+
* @documentation https://fusion.dev/design/components/spatial-ribbon-chart
|
|
64
70
|
*
|
|
65
71
|
* @slot - The renderer's box, which the 3D drawing is made in.
|
|
66
72
|
* @slot empty - Content shown when the table has no readings. Falls back to `empty-text`.
|
|
@@ -57,7 +57,14 @@ declare const HelixHeadlessSpatialScatterChart_base: typeof HelixElement & (new
|
|
|
57
57
|
* @status experimental
|
|
58
58
|
* @category charts
|
|
59
59
|
* @aliases 3D scatter chart, 3D scatter plot, Point cloud, Three-dimensional scatter
|
|
60
|
-
* @
|
|
60
|
+
* @use Three measures for each row, such as customers by age, spend, and visits.
|
|
61
|
+
* @instead scatter-chart - Two measures for each row, such as page weight and load time.
|
|
62
|
+
* @instead spatial-surface-chart - A measure that varies over a grid of two others.
|
|
63
|
+
* @anatomy grid
|
|
64
|
+
* @anatomy point
|
|
65
|
+
* @anatomy tick
|
|
66
|
+
* @anatomy axis-name
|
|
67
|
+
* @documentation https://fusion.dev/design/components/spatial-scatter-chart
|
|
61
68
|
*
|
|
62
69
|
* @slot - The renderer's box, which the 3D drawing is made in.
|
|
63
70
|
* @slot empty - Content shown when the table has no points. Falls back to `empty-text`.
|
|
@@ -59,7 +59,14 @@ declare const HelixHeadlessSpatialSurfaceChart_base: typeof HelixElement & (new
|
|
|
59
59
|
* @status experimental
|
|
60
60
|
* @category charts
|
|
61
61
|
* @aliases 3D surface chart, 3D surface plot, Surface chart, Height map, Terrain chart
|
|
62
|
-
* @
|
|
62
|
+
* @use A measure that varies over two others, such as requests by day and hour.
|
|
63
|
+
* @instead heatmap - A reading for each day or hour, colored in a strip.
|
|
64
|
+
* @instead spatial-ribbon-chart - A few separate series over one set of places.
|
|
65
|
+
* @instead spatial-scatter-chart - Rows that each have three measures of their own.
|
|
66
|
+
* @anatomy grid
|
|
67
|
+
* @anatomy face
|
|
68
|
+
* @anatomy tick
|
|
69
|
+
* @documentation https://fusion.dev/design/components/spatial-surface-chart
|
|
63
70
|
*
|
|
64
71
|
* @slot - The renderer's box, which the 3D drawing is made in.
|
|
65
72
|
* @slot empty - Content shown when the table has no readings. Falls back to `empty-text`.
|
|
@@ -61,7 +61,13 @@ declare const HelixHeadlessSpatialTreemap_base: typeof HelixElement & (new (...a
|
|
|
61
61
|
* @status experimental
|
|
62
62
|
* @category charts
|
|
63
63
|
* @aliases 3D treemap, Isometric treemap, Treemap in 3D, City map chart
|
|
64
|
-
* @
|
|
64
|
+
* @use Items sized by one measure and raised by a second, such as services by requests and latency.
|
|
65
|
+
* @instead donut-chart - Parts of one whole, with a handful of parts.
|
|
66
|
+
* @instead spatial-bar-chart - Values over two sets of categories.
|
|
67
|
+
* @anatomy grid
|
|
68
|
+
* @anatomy block
|
|
69
|
+
* @anatomy tick
|
|
70
|
+
* @documentation https://fusion.dev/design/components/spatial-treemap
|
|
65
71
|
*
|
|
66
72
|
* @slot - The renderer's box, which the 3D drawing is made in.
|
|
67
73
|
* @slot empty - Content shown when the table has no readings. Falls back to `empty-text`.
|
|
@@ -16,7 +16,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
16
16
|
* @status stable
|
|
17
17
|
* @category actions
|
|
18
18
|
* @aliases Speed dial section, Action group
|
|
19
|
-
* @documentation https://fusion.dev/
|
|
19
|
+
* @documentation https://fusion.dev/design/components/speed-dial
|
|
20
20
|
*
|
|
21
21
|
* @slot - The group's actions.
|
|
22
22
|
* @slot label - The group's name, for content richer than the `label` text.
|
|
@@ -28,7 +28,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
28
28
|
* @status stable
|
|
29
29
|
* @category actions
|
|
30
30
|
* @aliases Speed dial action, FAB action, Quick action
|
|
31
|
-
* @documentation https://fusion.dev/
|
|
31
|
+
* @documentation https://fusion.dev/design/components/speed-dial
|
|
32
32
|
*
|
|
33
33
|
* @slot - The action's name.
|
|
34
34
|
* @slot icon - The action's icon, the main way the action is recognized.
|
|
@@ -43,10 +43,9 @@ declare const HelixHeadlessSpeedDial_base: (new (...args: any[]) => import("@fus
|
|
|
43
43
|
* them apart as Menu's sections do: each is a `group` of the menu, and the
|
|
44
44
|
* arrow keys walk through every group's actions in order.
|
|
45
45
|
*
|
|
46
|
-
* **A trigger with its own action.**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `trigger="longPress"`. Alt+Down or Alt+Up opens it from the keyboard, and
|
|
46
|
+
* **A trigger with its own action.** A long press opens the dial as React
|
|
47
|
+
* Aria's menu trigger does with `trigger="longPress"`. Alt+Down or Alt+Up
|
|
48
|
+
* opens it from the keyboard, and
|
|
50
49
|
* the trigger says so in its description, `long-press-label`, the drawn one
|
|
51
50
|
* and a slotted one alike. A press that has opened the dial does not also do
|
|
52
51
|
* the trigger's action.
|
|
@@ -62,7 +61,16 @@ declare const HelixHeadlessSpeedDial_base: (new (...args: any[]) => import("@fus
|
|
|
62
61
|
* @status stable
|
|
63
62
|
* @category actions
|
|
64
63
|
* @aliases FAB, Floating action button, Action button, Quick actions
|
|
65
|
-
* @
|
|
64
|
+
* @use A few main actions of a screen behind one floating button.
|
|
65
|
+
* @instead menu - Commands with submenus, or items you check.
|
|
66
|
+
* @instead icon-button - One main action on a floating button, such as Compose.
|
|
67
|
+
* @anatomy trigger
|
|
68
|
+
* @anatomy actions
|
|
69
|
+
* @anatomy item
|
|
70
|
+
* @anatomy icon
|
|
71
|
+
* @practice Import Icon beside Speed Dial where your trigger or your actions use one. - Speed Dial draws no icon of its own, so it does not register one.
|
|
72
|
+
* @practice Set `open-on="long-press"` for a trigger with an action of its own, such as composing a message. - A press then runs the trigger's action, and holding it for half a second opens the dial.
|
|
73
|
+
* @documentation https://fusion.dev/design/components/speed-dial
|
|
66
74
|
*
|
|
67
75
|
* @slot - The actions.
|
|
68
76
|
* @slot icon - Replaces the plus on the button the dial draws when no trigger is slotted, such as with a pencil for a dial of ways to write.
|
|
@@ -20,9 +20,6 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
20
20
|
* the start pane and open it again. A drag in progress is tracked as a state, so both dividers a
|
|
21
21
|
* corner moves stay lit for as long as they move.
|
|
22
22
|
*
|
|
23
|
-
* By default, `min` and `max` let the divider reach either edge, so you can
|
|
24
|
-
* drag a pane fully closed. Set them to limit the range.
|
|
25
|
-
*
|
|
26
23
|
* A pane can be collapsed, which is a separate state from a divider at the
|
|
27
24
|
* edge. `collapsed` names the shut pane, `start` or `end`, and the pane opens
|
|
28
25
|
* back to the position where the collapsing gesture began. A drag records that position
|
|
@@ -39,17 +36,14 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
39
36
|
* with nothing measured, so the divider is where it belongs from the first
|
|
40
37
|
* paint, and the start pane keeps that size as the splitter's own size changes.
|
|
41
38
|
*
|
|
42
|
-
*
|
|
43
|
-
* changes
|
|
44
|
-
* takes all of the change, as Web Awesome's split panel does. Without it,
|
|
45
|
-
* both panes keep their share.
|
|
39
|
+
* Without `primary`, both panes keep their share when the splitter's own size
|
|
40
|
+
* changes.
|
|
46
41
|
*
|
|
47
|
-
* **Three or more panes along one axis are splitters nested on that axis
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* keeps its share, unless `primary` says otherwise.
|
|
42
|
+
* **Three or more panes along one axis are splitters nested on that axis.**
|
|
43
|
+
* The nested one keeps the pane on its far side the size it was while the
|
|
44
|
+
* outer divider moves, as Zag's splitter does with any number of panels. Where
|
|
45
|
+
* the whole row is resized, every pane keeps its share, unless `primary` says
|
|
46
|
+
* otherwise.
|
|
53
47
|
*
|
|
54
48
|
* **Keyboard.** The divider is one tab stop.
|
|
55
49
|
*
|
|
@@ -65,7 +59,16 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
65
59
|
* @status stable
|
|
66
60
|
* @category layout
|
|
67
61
|
* @aliases SplitPane, Resizable, SplitView
|
|
68
|
-
* @
|
|
62
|
+
* @use Two panes, such as files and an editor, whose share of the space you set by dragging.
|
|
63
|
+
* @instead grid - Columns whose widths the page sets.
|
|
64
|
+
* @instead drawer - A panel that slides in over the page from an edge.
|
|
65
|
+
* @anatomy start
|
|
66
|
+
* @anatomy separator
|
|
67
|
+
* @anatomy end
|
|
68
|
+
* @practice Set `primary` to a sidebar's pane. - That pane keeps its size when the splitter's own size changes, and the other pane takes all of the change.
|
|
69
|
+
* @practice {bounds} Set `min` and `end-min` to the least each pane needs. - By default the divider reaches either edge, so you can drag a pane fully closed.
|
|
70
|
+
* @practice {nested} For three columns, nest a splitter in the `end` pane of another. - A divider then resizes only the two panes beside it.
|
|
71
|
+
* @documentation https://fusion.dev/design/components/splitter
|
|
69
72
|
*
|
|
70
73
|
* @slot end - The pane after the divider.
|
|
71
74
|
* @slot handle - A mark drawn at the middle of the divider, such as a grip icon. It takes no focus and no pointer of its own: a press on it is a press on the divider.
|
|
@@ -14,7 +14,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
14
14
|
* @since 0.1.0
|
|
15
15
|
* @status stable
|
|
16
16
|
* @aliases Metrics, KPIs, Figures
|
|
17
|
-
* @documentation https://fusion.dev/
|
|
17
|
+
* @documentation https://fusion.dev/design/components/stat
|
|
18
18
|
*
|
|
19
19
|
* @slot - The stats.
|
|
20
20
|
*/
|
|
@@ -16,8 +16,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
16
16
|
* dashboard hears "Revenue, group" and then the figure, its unit and its
|
|
17
17
|
* trend as one reading, rather than a run of loose words. The role and the name
|
|
18
18
|
* are set through `ElementInternals` once the label is known, which writes no
|
|
19
|
-
* attribute; a stat with no label has no role.
|
|
20
|
-
* slot to have it read inside the group, after the figure it qualifies.
|
|
19
|
+
* attribute; a stat with no label has no role.
|
|
21
20
|
*
|
|
22
21
|
* **Or give the figure as a number.** `value` is written with
|
|
23
22
|
* `Intl.NumberFormat`, in `locale` and with `format-options`, so
|
|
@@ -31,13 +30,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
31
30
|
* the stat with those breaks, and the slot is hidden while it is. A figure
|
|
32
31
|
* holding an element is shown as it is.
|
|
33
32
|
*
|
|
34
|
-
* **A new `value` counts to the new number
|
|
35
|
-
*
|
|
36
|
-
* the new number. The stat times the count from `--stat-count-duration` and
|
|
33
|
+
* **A new `value` counts to the new number.** A screen reader reads only the
|
|
34
|
+
* new number. The stat times the count from `--stat-count-duration` and
|
|
37
35
|
* `--stat-count-easing`, which the styled tier sets from the duration and
|
|
38
36
|
* easing tokens. Here neither is set, so the figure changes at once until you
|
|
39
|
-
* set them, and under reduced motion it always does.
|
|
40
|
-
* at once.
|
|
37
|
+
* set them, and under reduced motion it always does.
|
|
41
38
|
*
|
|
42
39
|
* **Each slot is a part of the same name**, and `value` for the figure, so a
|
|
43
40
|
* page reaches the label, the unit and the trend from outside. A slot draws no
|
|
@@ -50,7 +47,16 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
50
47
|
* @status stable
|
|
51
48
|
* @category data
|
|
52
49
|
* @aliases Metric, KPI
|
|
53
|
-
* @
|
|
50
|
+
* @use One measurement with a label, such as active users on a dashboard.
|
|
51
|
+
* @instead badge - A count pinned to another element.
|
|
52
|
+
* @instead meter - A measurement shown against a known range.
|
|
53
|
+
* @instead sliding-number - A figure whose digits roll to each new value.
|
|
54
|
+
* @anatomy label
|
|
55
|
+
* @anatomy value
|
|
56
|
+
* @anatomy group?
|
|
57
|
+
* @practice {trend} Put a Trend in the `trend` slot. - It is read inside the stat's group, after the figure it qualifies.
|
|
58
|
+
* @practice {counting} Set `value` for a figure a dashboard refreshes. - A new `value` counts from the one before, so the figure reads as having moved, and a slotted figure changes at once.
|
|
59
|
+
* @documentation https://fusion.dev/design/components/stat
|
|
54
60
|
*
|
|
55
61
|
* @slot - The value.
|
|
56
62
|
* @slot label - What the value measures, which also names the stat for a screen reader.
|
|
@@ -144,6 +150,17 @@ export declare class HelixHeadlessStat extends HelixElement {
|
|
|
144
150
|
connectedCallback(): void;
|
|
145
151
|
disconnectedCallback(): void;
|
|
146
152
|
private readonly refit;
|
|
153
|
+
/**
|
|
154
|
+
* Reads a slotted figure that changed, and measures it again.
|
|
155
|
+
*
|
|
156
|
+
* **A figure edited in place kept its old step.** A render measures, but an
|
|
157
|
+
* edit that leaves the runs as they were asks for none, and the stat's own
|
|
158
|
+
* width does not move, so nothing measured: "123456789012" stepped twice in a
|
|
159
|
+
* 120 pixel stat, edited to "12", stayed two steps down with room to spare.
|
|
160
|
+
* Measured here only when no update is coming, since the update measures, and
|
|
161
|
+
* not while a count runs, which is fitted to the number it rests on.
|
|
162
|
+
*/
|
|
163
|
+
private readonly figureEdited;
|
|
147
164
|
/**
|
|
148
165
|
* Sets the figure a step or two smaller where it does not fit on one line.
|
|
149
166
|
*
|
|
@@ -20,6 +20,12 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
20
20
|
this.slottedRuns = [];
|
|
21
21
|
this.figureRead = false;
|
|
22
22
|
this.refit = () => this.fit();
|
|
23
|
+
this.figureEdited = () => {
|
|
24
|
+
this.readFigure();
|
|
25
|
+
if (this.hasUpdated && !this.isUpdatePending && this.count.counting === undefined) {
|
|
26
|
+
this.fit();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
23
29
|
this.stepNeeded = 0;
|
|
24
30
|
this.readFigure = () => {
|
|
25
31
|
const slot = this.renderRoot?.querySelector('slot:not([name])');
|
|
@@ -93,7 +99,7 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
93
99
|
this.widths = new ResizeObserver(() => this.fit());
|
|
94
100
|
this.widths.observe(this);
|
|
95
101
|
if (typeof MutationObserver !== 'undefined') {
|
|
96
|
-
this.edits = new MutationObserver(this.
|
|
102
|
+
this.edits = new MutationObserver(this.figureEdited);
|
|
97
103
|
this.edits.observe(this, { characterData: true, subtree: true });
|
|
98
104
|
}
|
|
99
105
|
this.ownerDocument.fonts?.addEventListener('loadingdone', this.refit);
|
|
@@ -203,7 +209,7 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
203
209
|
}
|
|
204
210
|
const written = figure !== '' || slotted.length > 0;
|
|
205
211
|
return html `<slot name="label" part="label" @slotchange=${() => this.requestUpdate()}></slot>
|
|
206
|
-
${figure === '' ? html `${written ? html `<span part="value">${pieces}</span>` : nothing}<slot part=${written ? nothing : 'value'} ?hidden=${written} @slotchange=${this.
|
|
212
|
+
${figure === '' ? html `${written ? html `<span part="value">${pieces}</span>` : nothing}<slot part=${written ? nothing : 'value'} ?hidden=${written} @slotchange=${this.figureEdited}></slot>` : this.drawFigure(pieces)}
|
|
207
213
|
<slot name="unit" part="unit" @slotchange=${this.readPieces}></slot>
|
|
208
214
|
<slot name="trend" part="trend" @slotchange=${this.readPieces}></slot>`;
|
|
209
215
|
}
|