@fusion.dev/helix-headless 0.247.0 → 0.248.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/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/accordion/root/accordion-root.d.ts +10 -1
- package/dist/announcement/root/announcement-root.d.ts +8 -7
- package/dist/app-header/root/app-header-root.d.ts +12 -8
- package/dist/area-chart/root/area-chart-root.d.ts +12 -4
- package/dist/avatar/root/avatar-root.d.ts +3 -0
- package/dist/badge/root/badge-root.d.ts +2 -6
- package/dist/bar-chart/root/bar-chart-root.d.ts +10 -2
- package/dist/blockquote/root/blockquote-root.d.ts +7 -4
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -3
- package/dist/button/root/button-root.d.ts +7 -8
- package/dist/button-group/root/button-group-root.d.ts +7 -3
- package/dist/callout/root/callout-root.d.ts +5 -2
- package/dist/canvas/root/canvas-root.d.ts +8 -7
- package/dist/card/root/card-root.d.ts +4 -0
- package/dist/carousel/root/carousel-root.d.ts +11 -3
- package/dist/chat/root/chat-root.d.ts +15 -16
- package/dist/checkbox/root/checkbox-root.d.ts +6 -3
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +12 -8
- package/dist/code/root/code-root.d.ts +6 -3
- package/dist/code-block/root/code-block-root.d.ts +14 -7
- package/dist/code-editor/root/code-editor-root.d.ts +17 -6
- package/dist/code-input/root/code-input-root.d.ts +10 -5
- package/dist/color-input/root/color-input-root.d.ts +7 -0
- package/dist/color-picker/root/color-picker-root.d.ts +6 -0
- package/dist/column-manager/root/column-manager-root.d.ts +12 -4
- package/dist/combobox/root/combobox-root.d.ts +6 -12
- package/dist/command/root/command-root.d.ts +13 -8
- package/dist/copy-button/root/copy-button-root.d.ts +8 -3
- package/dist/data-table/root/data-table-root.d.ts +18 -14
- package/dist/date-input/root/date-input-root.d.ts +8 -0
- package/dist/date-picker/root/date-picker-root.d.ts +11 -7
- package/dist/description-list/root/description-list-root.d.ts +6 -0
- package/dist/device-screen/root/device-screen-root.d.ts +13 -8
- package/dist/dialog/root/dialog-root.d.ts +6 -4
- package/dist/divider/root/divider-root.d.ts +6 -4
- package/dist/donut-chart/root/donut-chart-root.d.ts +8 -6
- package/dist/drawer/root/drawer-root.d.ts +8 -10
- package/dist/drilldown/root/drilldown-root.d.ts +11 -6
- package/dist/editor/root/editor-root.d.ts +11 -2
- package/dist/empty/root/empty-root.d.ts +6 -4
- package/dist/file-input/root/file-input-root.d.ts +5 -0
- package/dist/filter-input/root/filter-input-root.d.ts +20 -28
- package/dist/find/root/find-root.d.ts +9 -0
- package/dist/format-date/root/format-date-root.d.ts +9 -4
- package/dist/graph/root/graph-root.d.ts +10 -4
- package/dist/heatmap/root/heatmap-root.d.ts +10 -3
- package/dist/hover-card/root/hover-card-root.d.ts +8 -6
- package/dist/icon/root/icon-root.d.ts +7 -3
- package/dist/icon-button/root/icon-button-root.d.ts +4 -0
- package/dist/image/root/image-root.d.ts +4 -0
- package/dist/input/root/input-root.d.ts +9 -2
- package/dist/kbd/root/kbd-root.d.ts +7 -11
- package/dist/legend/root/legend-root.d.ts +10 -7
- package/dist/lightbox/root/lightbox-root.d.ts +15 -8
- package/dist/line-chart/root/line-chart-root.d.ts +12 -7
- package/dist/list/root/list-root.d.ts +16 -11
- package/dist/listbox/root/listbox-root.d.ts +10 -17
- package/dist/loader/root/loader-root.d.ts +12 -8
- package/dist/log/root/log-root.d.ts +11 -3
- package/dist/map/root/map-root.d.ts +11 -6
- package/dist/markdown/root/markdown-root.d.ts +12 -8
- package/dist/megamenu/root/megamenu-root.d.ts +6 -3
- package/dist/menu/root/menu-root.d.ts +14 -21
- package/dist/meter/root/meter-root.d.ts +14 -7
- package/dist/motion-toggle/root/motion-toggle-root.d.ts +5 -0
- package/dist/navigation/root/navigation-root.d.ts +9 -3
- package/dist/notifications/root/notifications-root.d.ts +9 -8
- package/dist/number-input/root/number-input-root.d.ts +6 -1
- package/dist/object-inspector/root/object-inspector-root.d.ts +13 -5
- package/dist/option/root/option-root.d.ts +10 -5
- package/dist/outline/root/outline-root.d.ts +6 -3
- package/dist/pagination/root/pagination-root.d.ts +9 -6
- package/dist/pin-input/root/pin-input-root.d.ts +6 -0
- package/dist/popover/root/popover-root.d.ts +11 -8
- package/dist/progress/root/progress-root.d.ts +12 -7
- package/dist/qr-code/root/qr-code-root.d.ts +6 -2
- package/dist/quick-filters/root/quick-filters-root.d.ts +10 -5
- package/dist/quote/root/quote-root.d.ts +5 -5
- package/dist/radio/root/radio-root.d.ts +6 -3
- package/dist/rating/root/rating-root.d.ts +10 -5
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +13 -7
- package/dist/scroll-area/root/scroll-area-root.d.ts +3 -0
- package/dist/select/root/select-root.d.ts +8 -15
- package/dist/selection-bar/root/selection-bar-root.d.ts +11 -6
- package/dist/shortcut-overlay/root/shortcut-overlay-root.d.ts +9 -7
- package/dist/skeleton/root/skeleton-root.d.ts +8 -9
- package/dist/skip-link/root/skip-link-root.d.ts +2 -0
- package/dist/slider/root/slider-root.d.ts +13 -7
- package/dist/sparkline/root/sparkline-root.d.ts +8 -10
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +6 -0
- package/dist/spatial-heatmap/root/spatial-heatmap-root.d.ts +7 -0
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.d.ts +6 -0
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.d.ts +7 -0
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.d.ts +7 -0
- package/dist/spatial-treemap/root/spatial-treemap-root.d.ts +6 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +12 -4
- package/dist/splitter/root/splitter-root.d.ts +16 -13
- package/dist/stat/root/stat-root.d.ts +13 -7
- package/dist/steps/root/steps-root.d.ts +5 -3
- package/dist/switch/root/switch-root.d.ts +6 -1
- package/dist/table/root/table-root.d.ts +13 -8
- package/dist/table-export/root/table-export-root.d.ts +10 -2
- package/dist/tabs/root/tabs-root.d.ts +10 -2
- package/dist/tag/root/tag-root.d.ts +3 -3
- package/dist/terminal/root/terminal-root.d.ts +12 -5
- package/dist/textarea/root/textarea-root.d.ts +7 -0
- package/dist/theme-toggle/root/theme-toggle-root.d.ts +8 -3
- package/dist/time-input/root/time-input-root.d.ts +10 -4
- package/dist/time-picker/root/time-picker-root.d.ts +12 -9
- package/dist/timeline/root/timeline-root.d.ts +18 -10
- package/dist/toast/root/toast-root.d.ts +14 -14
- package/dist/toggle/root/toggle-root.d.ts +3 -0
- package/dist/toolbar/root/toolbar-root.d.ts +4 -0
- package/dist/tooltip/root/tooltip-root.d.ts +5 -5
- package/dist/tour/root/tour-root.d.ts +10 -3
- package/dist/tree/root/tree-root.d.ts +9 -2
- package/dist/trend/root/trend-root.d.ts +10 -5
- package/dist/video/root/video-root.d.ts +12 -9
- package/dist/video-playlist/root/video-playlist-root.d.ts +10 -5
- package/dist/view-panel/root/view-panel-root.d.ts +13 -7
- package/dist/virtual-list/root/virtual-list-root.d.ts +12 -7
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +266 -623
- package/types/vue.d.ts +267 -624
|
@@ -26,7 +26,7 @@ import { HelixHeadlessAccordionItem } from '../item/accordion-item.js';
|
|
|
26
26
|
* Each trigger is a button with `aria-expanded` and `aria-controls`, inside a
|
|
27
27
|
* heading, level 3 unless `heading-level` says otherwise, so the sections are
|
|
28
28
|
* in a screen reader's list of headings. An open section is a region named by
|
|
29
|
-
* its trigger.
|
|
29
|
+
* its trigger.
|
|
30
30
|
*
|
|
31
31
|
* Find in page searches the closed sections too, and opens the one it matches
|
|
32
32
|
* in. `hidden-until-found="false"` turns that off.
|
|
@@ -35,6 +35,15 @@ import { HelixHeadlessAccordionItem } from '../item/accordion-item.js';
|
|
|
35
35
|
* @status stable
|
|
36
36
|
* @category layout
|
|
37
37
|
* @aliases Collapse, Expander group
|
|
38
|
+
* @use Sections that you open and close in place, such as questions and answers on a help page.
|
|
39
|
+
* @instead tabs - A few sections that you switch between from a row of names.
|
|
40
|
+
* @instead drawer - Details that slide in over the page from an edge.
|
|
41
|
+
* @instead card - Content that stays open on a surface of its own.
|
|
42
|
+
* @anatomy item
|
|
43
|
+
* @anatomy trigger
|
|
44
|
+
* @anatomy chevron
|
|
45
|
+
* @anatomy content
|
|
46
|
+
* @practice Set `heading-level` to the level that fits the page's outline. - The sections join the page's headings, at level 3 unless it is set.
|
|
38
47
|
* @documentation https://fusion.dev/helix/components/accordion
|
|
39
48
|
*
|
|
40
49
|
* @slot - The accordion's items.
|
|
@@ -21,8 +21,7 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
|
|
|
21
21
|
* readers, so it is in the page once. When the announcement is in the served
|
|
22
22
|
* HTML, the region stays empty and nothing is read out.
|
|
23
23
|
*
|
|
24
|
-
* The dismiss button fires `helix-dismiss
|
|
25
|
-
* document, so remove it in your listener. The event is cancelable, and
|
|
24
|
+
* The dismiss button fires `helix-dismiss`. The event is cancelable, and
|
|
26
25
|
* `dismiss()` returns `false` when a listener calls `preventDefault()`. When
|
|
27
26
|
* your listener removes an announcement whose dismiss button has focus, focus
|
|
28
27
|
* moves to the dismiss button of the announcement beside it. With no other
|
|
@@ -38,11 +37,9 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
|
|
|
38
37
|
* the key moved focus into is removed with focus still inside, focus goes
|
|
39
38
|
* back to where it was before the key.
|
|
40
39
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* read out, and its `duration` starts. While it waits it renders nothing,
|
|
45
|
-
* is no region, and carries `:state(waiting)`. A server cannot see the
|
|
40
|
+
* When a queued announcement shows, its message is read out, and its
|
|
41
|
+
* `duration` starts. While it waits it renders nothing, is no region, and
|
|
42
|
+
* carries `:state(waiting)`. A server cannot see the
|
|
46
43
|
* announcements beside it, so a served page shows every one until the script
|
|
47
44
|
* runs.
|
|
48
45
|
*
|
|
@@ -61,6 +58,10 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
|
|
|
61
58
|
* @use A message for every page of a site, shown above its header, such as planned downtime.
|
|
62
59
|
* @instead callout - A message about one section.
|
|
63
60
|
* @instead toast - A reply to an action.
|
|
61
|
+
* @anatomy content
|
|
62
|
+
* @anatomy dismiss?
|
|
63
|
+
* @practice Remove a dismissed announcement in your listener. - The dismiss button and `duration` send the dismiss event, and the announcement stays in the document.
|
|
64
|
+
* @practice Set `queued` to show several announcements one at a time. - A queued announcement waits while one queued before it in the same parent is still there, and shows when that one is removed.
|
|
64
65
|
* @documentation https://fusion.dev/helix/components/announcement
|
|
65
66
|
*
|
|
66
67
|
* @slot - The message.
|
|
@@ -17,19 +17,14 @@ declare const HelixHeadlessAppHeader_base: (new (...args: any[]) => import("@fus
|
|
|
17
17
|
* `ElementInternals.states` is not in the DOM, so hydration has nothing to
|
|
18
18
|
* compare. Select the state with `:state(scrolled)`.
|
|
19
19
|
*
|
|
20
|
-
* The page is the window unless `scroller` names the element that scrolls, for
|
|
21
|
-
* an app shell whose content scrolls inside a container.
|
|
22
|
-
*
|
|
23
20
|
* **Set `hide-on-scroll` for a bar that moves out of the way.** Scrolling down
|
|
24
21
|
* past the bar's own height hides it, and scrolling up shows it again, as does
|
|
25
22
|
* focus moving into it. The custom state `hidden` is on the host while it is
|
|
26
23
|
* hidden, and the styled tier slides a `sticky` bar up out of view.
|
|
27
24
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* `toggle-placement="start"`. The toggle says whether the region is open with
|
|
32
|
-
* `aria-expanded`, and the region opens below the row. The region follows the
|
|
25
|
+
* The toggle that holds a folded middle region is at the end of the bar, named
|
|
26
|
+
* by `menu-label`, or at its start with `toggle-placement="start"`. The toggle
|
|
27
|
+
* says whether the region is open with `aria-expanded`, and the region opens below the row. The region follows the
|
|
33
28
|
* toggle's region in focus order, so Tab from the toggle at the end goes into
|
|
34
29
|
* the open region. The custom state `folded` is on the host while the bar is
|
|
35
30
|
* that narrow, and `open` while the folded region is open. A server serves the
|
|
@@ -56,6 +51,15 @@ declare const HelixHeadlessAppHeader_base: (new (...args: any[]) => import("@fus
|
|
|
56
51
|
* @status stable
|
|
57
52
|
* @category navigation
|
|
58
53
|
* @aliases Masthead, Navbar, TopBar
|
|
54
|
+
* @use The banner at the top of every page, with the brand, the main navigation, and actions.
|
|
55
|
+
* @instead navigation - A set of destinations on its own, such as in a sidebar or a footer.
|
|
56
|
+
* @instead megamenu - A section of the navigation that opens a panel of links.
|
|
57
|
+
* @instead announcement - A message for the whole site, shown above the header.
|
|
58
|
+
* @anatomy start
|
|
59
|
+
* @anatomy content
|
|
60
|
+
* @anatomy end
|
|
61
|
+
* @practice Set `fold-below` to fold the middle region on a narrow screen. - Below that many pixels of the bar's own width, the middle region is hidden behind a toggle.
|
|
62
|
+
* @practice Set `scroller` in an app shell whose content scrolls inside a container. - The bar reads the window's scroll unless `scroller` names the element that scrolls.
|
|
59
63
|
* @documentation https://fusion.dev/helix/components/app-header
|
|
60
64
|
*
|
|
61
65
|
* @slot - The middle region, usually a `Navigation`.
|
|
@@ -67,8 +67,7 @@ declare const HelixHeadlessAreaChart_base: typeof HelixElement & (new (...args:
|
|
|
67
67
|
* a reading. The tooltip follows, the `live` part says the reading in words,
|
|
68
68
|
* and Escape puts the tooltip away.
|
|
69
69
|
*
|
|
70
|
-
*
|
|
71
|
-
* chart reads, or it is counted twice. A negative reading is drawn as zero.
|
|
70
|
+
* A negative reading is drawn as zero.
|
|
72
71
|
*
|
|
73
72
|
* **A tap shows the reading under it**, and keeps it until a tap lands
|
|
74
73
|
* elsewhere. `helix-reading-change` says each move of the reading, by pointer,
|
|
@@ -77,8 +76,7 @@ declare const HelixHeadlessAreaChart_base: typeof HelixElement & (new (...args:
|
|
|
77
76
|
*
|
|
78
77
|
* **`data` takes the readings as data** where the page has no table to point
|
|
79
78
|
* `for` at, in a table's shape: the column headings, then one row per reading
|
|
80
|
-
* with its label first.
|
|
81
|
-
* show one, since it reads before any script runs.
|
|
79
|
+
* with its label first.
|
|
82
80
|
*
|
|
83
81
|
* **A chart with nothing to draw says so.** A table with no readings shows
|
|
84
82
|
* `empty-text`, "No readings", in the plot, and `loading` shows `loading-text`
|
|
@@ -104,6 +102,16 @@ declare const HelixHeadlessAreaChart_base: typeof HelixElement & (new (...args:
|
|
|
104
102
|
* @status stable
|
|
105
103
|
* @category charts
|
|
106
104
|
* @aliases Stacked Area Chart, Composition Chart, Banded Chart
|
|
105
|
+
* @use A total over time and the parts it is made of, such as visits a month by source.
|
|
106
|
+
* @instead line-chart - Series over time that you compare with one another.
|
|
107
|
+
* @instead bar-chart - A comparison across categories, such as signups by channel.
|
|
108
|
+
* @instead donut-chart - Parts of a whole at one moment.
|
|
109
|
+
* @anatomy axis
|
|
110
|
+
* @anatomy gridline
|
|
111
|
+
* @anatomy area
|
|
112
|
+
* @anatomy labels
|
|
113
|
+
* @practice Leave a total column out of the table `for` names. - Every numeric column is a part, so a total column is counted twice.
|
|
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.
|
|
107
115
|
* @documentation https://fusion.dev/helix/components/area-chart
|
|
108
116
|
*
|
|
109
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`.
|
|
@@ -30,6 +30,9 @@ export declare const initialsOf: (name: string) => string;
|
|
|
30
30
|
* @status stable
|
|
31
31
|
* @category media
|
|
32
32
|
* @aliases Profile picture, Gravatar
|
|
33
|
+
* @use A person or an account, shown by their photo or their initials, such as beside a comment.
|
|
34
|
+
* @instead icon - A symbol for an action or a kind of thing.
|
|
35
|
+
* @instead image - A photo that is part of the content.
|
|
33
36
|
* @documentation https://fusion.dev/helix/components/avatar
|
|
34
37
|
*
|
|
35
38
|
* @slot - Shown when there is no usable image, in place of the initials. Hidden from assistive technology when the avatar has a `name`, which the host announces.
|
|
@@ -29,12 +29,6 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
29
29
|
* count changes. A control that already has a description keeps its own. The
|
|
30
30
|
* count is also a status of its own, read when it changes.
|
|
31
31
|
*
|
|
32
|
-
* **Put the badge inside the control to have its count read with the
|
|
33
|
-
* control's name**, as Web Awesome and Shoelace do: `<button>Inbox
|
|
34
|
-
* <helix-badge value="8" label="8 unread"></helix-badge></button>` is the
|
|
35
|
-
* button "Inbox 8 unread", and stays current as the count changes. The styled
|
|
36
|
-
* tier's `placement="inline"` draws the mark in the line for that case.
|
|
37
|
-
*
|
|
38
32
|
* **An icon goes inside the mark** through the `icon` slot, before the count,
|
|
39
33
|
* as Web Awesome's badge takes one at its start. With no `value` the icon is
|
|
40
34
|
* the whole mark, such as a check on an avatar, drawn where the dot would be.
|
|
@@ -48,6 +42,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
48
42
|
* @use A count on an icon, a tab, or a button, or a dot that marks something new.
|
|
49
43
|
* @instead tag - A word that describes the content.
|
|
50
44
|
* @instead stat - A number that is the content itself.
|
|
45
|
+
* @anatomy indicator
|
|
46
|
+
* @practice {inline} Put the badge inside a control, with `placement="inline"`, to read its count in the control's name. - The button is then "Inbox 8 unread", and the badge keeps the name current with no label of yours to update.
|
|
51
47
|
* @documentation https://fusion.dev/helix/components/badge
|
|
52
48
|
*
|
|
53
49
|
* @slot - The element being decorated.
|
|
@@ -56,8 +56,7 @@ declare const HelixHeadlessBarChart_base: typeof HelixElement & (new (...args: a
|
|
|
56
56
|
*
|
|
57
57
|
* **`data` takes the readings as data** where the page has no table to point
|
|
58
58
|
* `for` at, in a table's shape: the column headings, then one row per reading
|
|
59
|
-
* with its label first.
|
|
60
|
-
* show one, since it reads before any script runs.
|
|
59
|
+
* with its label first.
|
|
61
60
|
*
|
|
62
61
|
* **A chart with nothing to draw says so.** A table with no readings shows
|
|
63
62
|
* `empty-text`, "No readings", in the plot, and `loading` shows `loading-text`
|
|
@@ -84,6 +83,15 @@ declare const HelixHeadlessBarChart_base: typeof HelixElement & (new (...args: a
|
|
|
84
83
|
* @status stable
|
|
85
84
|
* @category charts
|
|
86
85
|
* @aliases Column Chart, Categorical Chart
|
|
86
|
+
* @use A comparison across categories, such as revenue by quarter or signups by channel.
|
|
87
|
+
* @instead line-chart - A trend over many points in time.
|
|
88
|
+
* @instead donut-chart - Parts of one whole, such as sessions by source.
|
|
89
|
+
* @instead spatial-bar-chart - Values over two sets of categories, drawn in three dimensions.
|
|
90
|
+
* @anatomy axis
|
|
91
|
+
* @anatomy gridline
|
|
92
|
+
* @anatomy bar
|
|
93
|
+
* @anatomy labels
|
|
94
|
+
* @practice Point `for` at a table on the page, and set `data` only where there is none. - A table reads before any script runs.
|
|
87
95
|
* @documentation https://fusion.dev/helix/components/bar-chart
|
|
88
96
|
*
|
|
89
97
|
* @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`.
|
|
@@ -25,11 +25,10 @@ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'l
|
|
|
25
25
|
* the one the browser sets for a `<q>` in the element's language, „ under
|
|
26
26
|
* `lang="de"` and « under `lang="fr"`, and a `Quote` inside the passage takes
|
|
27
27
|
* the inner marks. The mark is drawn, not read: a screen reader hears the
|
|
28
|
-
* passage. A passage under `marks` that starts with a
|
|
29
|
-
*
|
|
28
|
+
* passage. A passage under `marks` that starts with a typed mark warns once,
|
|
29
|
+
* with the runtime kind `typed-marks`.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
* Words in it, such as the author's name, warn once, with the runtime kind
|
|
31
|
+
* Words in `cite`, such as the author's name, warn once, with the runtime kind
|
|
33
32
|
* `cite-not-url`.
|
|
34
33
|
*
|
|
35
34
|
* For a quotation inside a sentence, use `Quote`.
|
|
@@ -40,6 +39,10 @@ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'l
|
|
|
40
39
|
* @aliases Pullquote, Citation, Excerpt
|
|
41
40
|
* @use A passage set apart from the prose, including a pull quote with `marks`.
|
|
42
41
|
* @instead quote - A few words quoted inside a sentence.
|
|
42
|
+
* @anatomy blockquote
|
|
43
|
+
* @anatomy attribution?
|
|
44
|
+
* @practice Write the source's URL in `cite`, and who said it in `attribution`. - The browser keeps `cite` and does not show it, so a name written there is never seen.
|
|
45
|
+
* @practice {pull-quote} Leave typed quotation marks out of a passage under `marks`. - The mark is drawn for the element's language, so a typed one makes a second mark.
|
|
43
46
|
* @documentation https://fusion.dev/helix/components/blockquote
|
|
44
47
|
*
|
|
45
48
|
* @slot - The quoted passage.
|
|
@@ -31,9 +31,8 @@ export interface BreadcrumbItem {
|
|
|
31
31
|
* The trail does not measure itself, and you write its overflow in markup: put
|
|
32
32
|
* the crumb that holds the folded items where the gap should appear.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* current page. Slotted crumbs follow them. Use one way or the other in a trail.
|
|
34
|
+
* `items` is an array of `{ label, href }`. Slotted crumbs follow them. Use one
|
|
35
|
+
* way or the other in a trail.
|
|
37
36
|
*
|
|
38
37
|
* With `max-items`, a trail that is longer folds its middle into one place:
|
|
39
38
|
* the first crumb, a button, then the last `max-items` less one. The button is
|
|
@@ -52,6 +51,13 @@ export interface BreadcrumbItem {
|
|
|
52
51
|
* @status stable
|
|
53
52
|
* @category navigation
|
|
54
53
|
* @aliases Breadcrumb, Crumbs
|
|
54
|
+
* @use The path from the home page to the page you are on, in a site with nested sections.
|
|
55
|
+
* @instead navigation - Links to the sections of a site, with the current one marked.
|
|
56
|
+
* @instead steps - Stages of a task you complete in order, such as a checkout.
|
|
57
|
+
* @anatomy breadcrumb
|
|
58
|
+
* @anatomy start?
|
|
59
|
+
* @anatomy link
|
|
60
|
+
* @practice Set `items` for a trail built from data, such as a router's matched routes. - It draws each entry as a crumb in order, the last one as the current page.
|
|
55
61
|
* @documentation https://fusion.dev/helix/components/breadcrumbs
|
|
56
62
|
*
|
|
57
63
|
* @slot - The trail's items, in order from the root to the current page. Put
|
|
@@ -7,11 +7,6 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
7
7
|
* Renders a real `<button>`, so activation, focus, and other browser behavior
|
|
8
8
|
* come from the platform.
|
|
9
9
|
*
|
|
10
|
-
* **It never renders an anchor.** A router renders its own `<a>` to intercept a
|
|
11
|
-
* click, and it cannot render one inside the button's shadow root. For a link
|
|
12
|
-
* that looks like a button, use the base layer recipe on your own anchor:
|
|
13
|
-
* `<Link data-button="solid">` draws the same control.
|
|
14
|
-
*
|
|
15
10
|
* `delegatesFocus` moves focus to the inner control. It is serialized into the
|
|
16
11
|
* server markup, so the button is reachable by keyboard before any JavaScript
|
|
17
12
|
* loads.
|
|
@@ -32,9 +27,6 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
32
27
|
* button's does, so `preventDefault()` in a `click` listener cancels it: the
|
|
33
28
|
* form is not submitted or reset, and no command is sent.
|
|
34
29
|
*
|
|
35
|
-
* Set `pending` while the action a press started is still running. The button
|
|
36
|
-
* keeps focus and refuses presses, and a reader on it hears `pending-label`.
|
|
37
|
-
*
|
|
38
30
|
* Set `focusable-when-disabled` on a disabled button whose reason a Tooltip
|
|
39
31
|
* gives. It stays in the tab order and takes hover, so the tooltip opens, and
|
|
40
32
|
* it refuses every press.
|
|
@@ -51,6 +43,13 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
51
43
|
* @since 0.1.0
|
|
52
44
|
* @status stable
|
|
53
45
|
* @category actions
|
|
46
|
+
* @use An action on the page or a form's submit, such as Save, Delete, or Open settings.
|
|
47
|
+
* @instead icon-button - An action shown as an icon alone, such as Settings in a toolbar.
|
|
48
|
+
* @instead copy-button - A value you copy to the clipboard, such as an install command.
|
|
49
|
+
* @anatomy button
|
|
50
|
+
* @anatomy text
|
|
51
|
+
* @practice {as-link} Draw a link that looks like a button on your own anchor, with the base layer's recipe. - Button never renders an anchor, because a router renders its own to intercept a click.
|
|
52
|
+
* @practice {pending} Set `pending` while the action a press started is still running. - The button keeps focus and refuses presses, and a screen reader on it hears `pending-label`.
|
|
54
53
|
* @documentation https://fusion.dev/helix/components/button
|
|
55
54
|
*
|
|
56
55
|
* @slot - The button's label.
|
|
@@ -15,9 +15,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
15
15
|
* Buttons are slotted, so they stay your own elements and keep their own
|
|
16
16
|
* appearance and size.
|
|
17
17
|
*
|
|
18
|
-
* **Buttons that stay pressed.**
|
|
19
|
-
* `value` is a toggle button: a press presses or releases it. `multiple` lets
|
|
20
|
-
* any number be pressed, and each button says so with `aria-pressed`. `single`
|
|
18
|
+
* **Buttons that stay pressed.** `multiple` lets any number be pressed, and each button says so with `aria-pressed`. `single`
|
|
21
19
|
* keeps one pressed at a time: the group is a `radiogroup` and each button a
|
|
22
20
|
* `radio` that says so with `aria-checked`, as React Aria's toggle button
|
|
23
21
|
* group is. A press on the pressed one releases it, unless
|
|
@@ -67,6 +65,12 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
67
65
|
* @status stable
|
|
68
66
|
* @category actions
|
|
69
67
|
* @aliases Segmented buttons, Split button, Toggle buttons
|
|
68
|
+
* @use Related actions joined into one control, such as Cut, Copy, and Paste.
|
|
69
|
+
* @use Actions that stay on once pressed, such as Bold and Italic.
|
|
70
|
+
* @instead toggle - A choice a form submits, where the arrow keys choose as they move.
|
|
71
|
+
* @instead toolbar - A mix of controls that share one tab stop.
|
|
72
|
+
* @instead tabs - A row that shows one panel of content for each choice.
|
|
73
|
+
* @practice {selection} Set `selection-mode`, and give each button a `value`, for buttons that stay pressed. - Each button with a `value` is then a toggle button, which a press presses or releases.
|
|
70
74
|
* @documentation https://fusion.dev/helix/components/button-group
|
|
71
75
|
*
|
|
72
76
|
* @slot - The buttons in the group.
|
|
@@ -17,8 +17,7 @@ declare const HelixHeadlessCallout_base: (new (...args: any[]) => import("@fusio
|
|
|
17
17
|
* Set `dismissible` for a note a reader may put away, as Shoelace's `closable`
|
|
18
18
|
* alert does. The button fires `helix-dismiss`, and unless a listener cancels
|
|
19
19
|
* it the callout hides itself: `open` turns false, `:state(exiting)` holds
|
|
20
|
-
* while its exit animations run, and then it is `hidden`.
|
|
21
|
-
* listener to take it out of the page, or set `open` to show it again, which
|
|
20
|
+
* while its exit animations run, and then it is `hidden`. Setting `open` again
|
|
22
21
|
* holds `:state(entering)` while it comes back. Focus on its dismiss button
|
|
23
22
|
* moves to the next callout's, or to the tab stop beside it, once it hides.
|
|
24
23
|
*
|
|
@@ -33,6 +32,10 @@ declare const HelixHeadlessCallout_base: (new (...args: any[]) => import("@fusio
|
|
|
33
32
|
* @use A note, a warning, or an error about the content around it.
|
|
34
33
|
* @instead toast - A confirmation that leaves on its own.
|
|
35
34
|
* @instead announcement - A message for the whole site.
|
|
35
|
+
* @anatomy icon
|
|
36
|
+
* @anatomy content
|
|
37
|
+
* @practice {dismissible} Set `open` to show a dismissed callout again, or remove it in your listener. - A dismissed callout hides itself and stays in the page.
|
|
38
|
+
* @practice {density} Size a callout with `data-density="sm"` or `data-density="lg"`, on the callout or a region around it. - A callout follows the density of the controls around it, and has no size property.
|
|
36
39
|
* @documentation https://fusion.dev/helix/components/callout
|
|
37
40
|
*
|
|
38
41
|
* @slot - The callout's content.
|
|
@@ -36,9 +36,7 @@ declare const HelixHeadlessCanvas_base: (new (...args: any[]) => import("@fusion
|
|
|
36
36
|
* own state and apply them yourself.
|
|
37
37
|
* - `helix-move` once the move is finished.
|
|
38
38
|
*
|
|
39
|
-
* A resize dispatches the same pair with a size.
|
|
40
|
-
* keep every card in place, such as on a published board. Set `readonly` on one
|
|
41
|
-
* card or connection to keep only that one in place.
|
|
39
|
+
* A resize dispatches the same pair with a size.
|
|
42
40
|
*
|
|
43
41
|
* Set `snap` to a length in the document's units, such as `32`, and a card
|
|
44
42
|
* that is moved or resized lands on a multiple of it. Carrying a card, a
|
|
@@ -110,10 +108,6 @@ declare const HelixHeadlessCanvas_base: (new (...args: any[]) => import("@fusion
|
|
|
110
108
|
* left. A focused card your page removes for its own reasons hands focus on
|
|
111
109
|
* the same way, unless the reader has already moved focus somewhere else.
|
|
112
110
|
*
|
|
113
|
-
* The board applies a move itself, because the card already exists. A
|
|
114
|
-
* connection is a new element, and React discards an element the board adds to
|
|
115
|
-
* its markup on the next render, so you write the connection.
|
|
116
|
-
*
|
|
117
111
|
* **`edgeRoute` draws the connections' lines your own way**: a function from
|
|
118
112
|
* where a line leaves and arrives, and the sides it does, to its SVG path, for
|
|
119
113
|
* a route such as one that bends around the cards between. What it returns
|
|
@@ -136,6 +130,13 @@ declare const HelixHeadlessCanvas_base: (new (...args: any[]) => import("@fusion
|
|
|
136
130
|
* @status stable
|
|
137
131
|
* @category media
|
|
138
132
|
* @aliases Board, JSON Canvas, Whiteboard
|
|
133
|
+
* @use A board of cards and arrows that you place by hand, such as a flow or a plan.
|
|
134
|
+
* @instead graph - Notes and their links, laid out by a library from the data.
|
|
135
|
+
* @anatomy node
|
|
136
|
+
* @anatomy label
|
|
137
|
+
* @anatomy controls
|
|
138
|
+
* @practice Set `readonly` on a published board, or on one card or connection to hold only that one. - A card moves by default, and the board writes its new `x` and `y` onto it.
|
|
139
|
+
* @practice Write a Canvas Edge yourself for each connection the board asks for. - A connection is a new element, and React discards an element the board adds to its markup on the next render.
|
|
139
140
|
* @documentation https://fusion.dev/helix/components/canvas
|
|
140
141
|
*
|
|
141
142
|
* @slot - The board's `helix-canvas-node` and `helix-canvas-edge` elements, drawn on the plane.
|
|
@@ -50,6 +50,10 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
50
50
|
* @use Related content and actions grouped on one surface, often repeated in a grid.
|
|
51
51
|
* @instead drawer - A panel that slides in over the page.
|
|
52
52
|
* @instead drilldown - Pages you step into and back out of.
|
|
53
|
+
* @anatomy header
|
|
54
|
+
* @anatomy footer?
|
|
55
|
+
* @practice {actions} Put a header of more than one element in one wrapper. - The header and its `header-actions` share one line.
|
|
56
|
+
* @practice Put an image or a chart in `media` with no inset of its own. - Media runs edge to edge and clips to the card's corners.
|
|
53
57
|
* @documentation https://fusion.dev/helix/components/card
|
|
54
58
|
*
|
|
55
59
|
* @slot - The card's main content.
|
|
@@ -43,9 +43,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
43
43
|
* move by a control, an indicator, a key, or a drag, the `live` part says the
|
|
44
44
|
* slide's name politely. While the carousel rotates the region is off.
|
|
45
45
|
*
|
|
46
|
-
* **`slides-per-move` moves several slides at a time
|
|
47
|
-
*
|
|
48
|
-
* indicator for each stop, and the track snaps only at the stops. The last
|
|
46
|
+
* **`slides-per-move` moves several slides at a time**, and the track snaps
|
|
47
|
+
* only at the stops. The last
|
|
49
48
|
* stop is always the end of the run, so a run that does not divide evenly
|
|
50
49
|
* ends on its last slides. Unset moves one slide.
|
|
51
50
|
*
|
|
@@ -62,6 +61,15 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
62
61
|
* @status stable
|
|
63
62
|
* @category layout
|
|
64
63
|
* @aliases Slider, Gallery, Slideshow
|
|
64
|
+
* @use Several slides of one kind that take turns in one place, such as featured products.
|
|
65
|
+
* @instead video-playlist - Clips that play one after another in one player.
|
|
66
|
+
* @instead image - One picture that stays in its place.
|
|
67
|
+
* @instead marquee - A band of logos that runs by itself.
|
|
68
|
+
* @anatomy slide
|
|
69
|
+
* @anatomy previous
|
|
70
|
+
* @anatomy next
|
|
71
|
+
* @anatomy indicators
|
|
72
|
+
* @practice {several-across} Set `slides-per-move` to match `per-view` for a run of cards. - Next then shows the next set, with one indicator for each set.
|
|
65
73
|
* @documentation https://fusion.dev/helix/components/carousel
|
|
66
74
|
*
|
|
67
75
|
* @slot - The slides.
|
|
@@ -59,10 +59,8 @@ declare const HelixHeadlessChat_base: (new (...args: any[]) => import("@fusion.d
|
|
|
59
59
|
* there when the transcript opened. A turn is said with its author first, such
|
|
60
60
|
* as "Ada: It ships today" (`arrival-label`), where its author can be named.
|
|
61
61
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* in the console. Children render from the server and suit most
|
|
65
|
-
* conversations. `turns` draws a long
|
|
62
|
+
* A chat given turns both ways says so once in the console. Children render
|
|
63
|
+
* from the server and suit most conversations. `turns` draws a long
|
|
66
64
|
* transcript one window at a time, so the log needs a block size of its own.
|
|
67
65
|
*
|
|
68
66
|
* The log scrolls on this tier. It carries `data-scroller`, and `core` ships
|
|
@@ -83,18 +81,9 @@ declare const HelixHeadlessChat_base: (new (...args: any[]) => import("@fusion.d
|
|
|
83
81
|
* "Ada is typing" (`typing-label`), which a screen reader hears, and clearing
|
|
84
82
|
* it takes them away. Anything slotted into `status` is drawn first.
|
|
85
83
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* ```js
|
|
91
|
-
* import '@fusion.dev/helix/chat/root'
|
|
92
|
-
* import '@fusion.dev/helix/chat/composer'
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
* A composer written without the second is reported once the page has loaded,
|
|
96
|
-
* with the entry to add. The family's own entry, `@fusion.dev/helix/chat`,
|
|
97
|
-
* registers every element.
|
|
84
|
+
* A composer written without its own entry is reported once the page has
|
|
85
|
+
* loaded, with the entry to add. The family's own entry,
|
|
86
|
+
* `@fusion.dev/helix/chat`, registers every element.
|
|
98
87
|
*
|
|
99
88
|
* **Keyboard.** The transcript moves between turns the way a feed does. Each
|
|
100
89
|
* turn says its place, such as "3 of 40", windowed or not. The transcript is
|
|
@@ -133,6 +122,16 @@ declare const HelixHeadlessChat_base: (new (...args: any[]) => import("@fusion.d
|
|
|
133
122
|
* @status stable
|
|
134
123
|
* @category feedback
|
|
135
124
|
* @aliases Conversation, Transcript, Thread, Messages
|
|
125
|
+
* @use A conversation between people, or with an agent, such as a support thread.
|
|
126
|
+
* @instead log - Output from a process, such as a build, that you follow as it runs.
|
|
127
|
+
* @instead timeline - Events in the order they happened, such as an audit trail.
|
|
128
|
+
* @instead notifications - A record of events you mark read.
|
|
129
|
+
* @anatomy header?
|
|
130
|
+
* @anatomy message
|
|
131
|
+
* @anatomy status?
|
|
132
|
+
* @anatomy composer
|
|
133
|
+
* @practice Pass the turns either as children or as `turns`. - A chat given both draws every turn from `turns` and then the children.
|
|
134
|
+
* @practice Import `@fusion.dev/helix/chat/composer` beside `@fusion.dev/helix/chat/root` where you write a `Chat.Composer`. - A chat that only shows a conversation needs no composer, so the root's entry leaves it out.
|
|
136
135
|
* @documentation https://fusion.dev/helix/components/chat
|
|
137
136
|
*
|
|
138
137
|
* @slot - The turns.
|
|
@@ -17,9 +17,8 @@ declare const HelixHeadlessCheckbox_base: (new (...args: any[]) => import("@fusi
|
|
|
17
17
|
* A checked box submits its `value`, and an unchecked one submits nothing, as a
|
|
18
18
|
* native checkbox does.
|
|
19
19
|
*
|
|
20
|
-
* `indeterminate`
|
|
21
|
-
*
|
|
22
|
-
* resolves it.
|
|
20
|
+
* Assistive technology reports `indeterminate` as neither checked nor
|
|
21
|
+
* unchecked.
|
|
23
22
|
*
|
|
24
23
|
* **Keyboard.** The box is one tab stop.
|
|
25
24
|
*
|
|
@@ -37,6 +36,10 @@ declare const HelixHeadlessCheckbox_base: (new (...args: any[]) => import("@fusi
|
|
|
37
36
|
* @aliases Tickbox
|
|
38
37
|
* @use A choice submitted with a form, or a set of independent choices.
|
|
39
38
|
* @instead switch - A setting that applies at once.
|
|
39
|
+
* @anatomy box
|
|
40
|
+
* @anatomy label
|
|
41
|
+
* @anatomy hint?
|
|
42
|
+
* @practice {states} Set `indeterminate` from your own state, on a box over a set that is partly checked. - It changes only the presentation, it never submits, and the first click resolves it.
|
|
40
43
|
* @documentation https://fusion.dev/helix/components/checkbox
|
|
41
44
|
*
|
|
42
45
|
* @slot - The label.
|
|
@@ -11,10 +11,9 @@ declare const HelixHeadlessCheckboxGroup_base: (new (...args: any[]) => import("
|
|
|
11
11
|
* names it. Without a name, screen readers announce the checkboxes as separate
|
|
12
12
|
* controls.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* the
|
|
17
|
-
* `name` that you write once, and one place to read and write the whole set.
|
|
14
|
+
* Checkboxes are already form-associated, and a native group is several inputs
|
|
15
|
+
* that share a name. The group adds the grouping and one place to read and
|
|
16
|
+
* write the whole set.
|
|
18
17
|
*
|
|
19
18
|
* `value` is the checked values, separated by commas, in the order the
|
|
20
19
|
* checkboxes are written, read from the boxes themselves. Setting it checks
|
|
@@ -30,10 +29,6 @@ declare const HelixHeadlessCheckboxGroup_base: (new (...args: any[]) => import("
|
|
|
30
29
|
* another kind inside the group, such as an "Other" text field, sends its own
|
|
31
30
|
* `input` and `change` past the group.
|
|
32
31
|
*
|
|
33
|
-
* **The group shows the message you set in `feedback`.** It is form-associated
|
|
34
|
-
* only for validity and never calls `setFormValue`, so the browser does not
|
|
35
|
-
* generate a message for it.
|
|
36
|
-
*
|
|
37
32
|
* **Keyboard.** Each box is its own tab stop, as a set of native checkboxes
|
|
38
33
|
* is, and Space checks the focused one. The select-all box comes first.
|
|
39
34
|
*
|
|
@@ -41,6 +36,15 @@ declare const HelixHeadlessCheckboxGroup_base: (new (...args: any[]) => import("
|
|
|
41
36
|
* @status stable
|
|
42
37
|
* @category forms
|
|
43
38
|
* @aliases Checkbox list, Multi-select
|
|
39
|
+
* @use Several choices from one set, such as the places you receive updates.
|
|
40
|
+
* @instead checkbox - One choice that stands on its own, such as accepting the terms.
|
|
41
|
+
* @instead radio - One choice from a set of up to five options.
|
|
42
|
+
* @instead listbox - A list too long to show as boxes, from which you choose several.
|
|
43
|
+
* @anatomy label
|
|
44
|
+
* @anatomy items
|
|
45
|
+
* @anatomy hint?
|
|
46
|
+
* @practice Write `name` once, on the group. - Each checkbox submits its own value under that name, and the group adds no value of its own.
|
|
47
|
+
* @practice Set `feedback` for a message about the whole set. - The group never sets a form value, so the browser writes no message for it.
|
|
44
48
|
* @documentation https://fusion.dev/helix/components/checkbox-group
|
|
45
49
|
*
|
|
46
50
|
* @slot - The checkboxes, and anything laid out around them.
|
|
@@ -8,10 +8,8 @@ import { type TemplateResult } from 'lit';
|
|
|
8
8
|
* tools and document search. A styled span carries no such meaning, and a
|
|
9
9
|
* screen reader announces nothing about it.
|
|
10
10
|
*
|
|
11
|
-
* **Set `translate="no"` on the element to keep a page translator off the
|
|
12
|
-
* code.** A translator that rewrites prose would also rewrite an identifier.
|
|
13
11
|
* The slotted text takes its translation mode from the element, its parent in
|
|
14
|
-
* the page, and the element writes nothing onto itself, so
|
|
12
|
+
* the page, and the element writes nothing onto itself, so `translate` is
|
|
15
13
|
* yours to set. The `<code>` inside carries `translate="no"` for anything the
|
|
16
14
|
* element draws itself.
|
|
17
15
|
*
|
|
@@ -23,6 +21,11 @@ import { type TemplateResult } from 'lit';
|
|
|
23
21
|
* @status stable
|
|
24
22
|
* @category typography
|
|
25
23
|
* @aliases Inline code
|
|
24
|
+
* @use A name from code inside a sentence, such as a property or a command.
|
|
25
|
+
* @instead code-block - Lines of code set apart from the prose, with a copy button.
|
|
26
|
+
* @instead kbd - A key or a chord you press.
|
|
27
|
+
* @instead code-input - Code you type into a form.
|
|
28
|
+
* @practice Set `translate="no"` on the element to keep a page translator off the code. - A translator that rewrites prose would also rewrite an identifier.
|
|
26
29
|
* @documentation https://fusion.dev/helix/components/code
|
|
27
30
|
*
|
|
28
31
|
* @slot - The code.
|
|
@@ -21,9 +21,8 @@ import { HighlighterController } from '../highlighter.js';
|
|
|
21
21
|
* band behind each run, placed where the lines are laid out, so it follows a
|
|
22
22
|
* highlighter's markup and lines that wrap. `added-lines` and
|
|
23
23
|
* `removed-lines` mark lines the same way as inserted and deleted, as
|
|
24
|
-
* Expressive Code's `ins` and `del` do, in code that is not a diff.
|
|
25
|
-
*
|
|
26
|
-
* block what a marked line means. Set `wrap` to wrap long lines
|
|
24
|
+
* Expressive Code's `ins` and `del` do, in code that is not a diff. Set
|
|
25
|
+
* `wrap` to wrap long lines
|
|
27
26
|
* rather than scroll them; a gutter then numbers each line where it starts.
|
|
28
27
|
* Set `wrappable` for a button in the header that turns `wrap` on and off,
|
|
29
28
|
* pressed while the lines wrap.
|
|
@@ -38,10 +37,8 @@ import { HighlighterController } from '../highlighter.js';
|
|
|
38
37
|
* the slot, so the copy button and the page's own text are the code as
|
|
39
38
|
* written.
|
|
40
39
|
*
|
|
41
|
-
* **Code Block ships no grammar**, so plain code costs you no parser.
|
|
42
|
-
* every block on the page
|
|
43
|
-
* with the function and, for a highlighter that writes classes, the
|
|
44
|
-
* stylesheet that colors them. A block's own `highlight` wins over it:
|
|
40
|
+
* **Code Block ships no grammar**, so plain code costs you no parser. Shiki,
|
|
41
|
+
* registered for every block on the page:
|
|
45
42
|
*
|
|
46
43
|
* ```js
|
|
47
44
|
* import { registerHighlighter } from '@fusion.dev/helix-headless/code-block'
|
|
@@ -111,6 +108,16 @@ import { HighlighterController } from '../highlighter.js';
|
|
|
111
108
|
* @status stable
|
|
112
109
|
* @category typography
|
|
113
110
|
* @aliases Code block, Snippet, Pre
|
|
111
|
+
* @use Lines of code set apart from the prose, such as an example to copy.
|
|
112
|
+
* @instead code - A name from code inside a sentence.
|
|
113
|
+
* @instead code-input - A short piece of code you type into a form.
|
|
114
|
+
* @instead code-editor - A file of code you edit, in a code editor you connect.
|
|
115
|
+
* @anatomy label
|
|
116
|
+
* @anatomy copy
|
|
117
|
+
* @anatomy block
|
|
118
|
+
* @practice Import `@fusion.dev/helix-sandbox/code-block` beside the block to color code with no highlighter of your own. - It registers a highlighter for every block, which colors code as the sandbox's editor does.
|
|
119
|
+
* @practice Call `registerHighlighter()` once, with the stylesheet for a highlighter that writes classes. - Every block on the page then shares it, and a block's own `highlight` still wins.
|
|
120
|
+
* @practice Say in the text around the block what a marked line means. - The bands that `mark-lines`, `added-lines`, and `removed-lines` draw are hidden from screen readers.
|
|
114
121
|
* @documentation https://fusion.dev/helix/components/code-block
|
|
115
122
|
*
|
|
116
123
|
* @slot - The code.
|