@fusion.dev/helix 0.155.0 → 0.156.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.
Files changed (33) hide show
  1. package/custom-elements.json +2453 -21
  2. package/dist/canvas/root/canvas-root.css.js +1 -1
  3. package/dist/command/root/command-root.css.js +1 -1
  4. package/dist/data-table/root/data-table-root.css.js +1 -1
  5. package/dist/data-table/root/data-table-root.d.ts +2 -0
  6. package/dist/date-input/root/date-input-root.css.js +2 -1
  7. package/dist/element-events.generated.js +1 -0
  8. package/dist/graph/root/graph-root.css.js +1 -1
  9. package/dist/list/root/list-root.css.js +1 -1
  10. package/dist/list/root/list-root.d.ts +4 -0
  11. package/dist/number-input/root/number-input-root.css.js +3 -1
  12. package/dist/number-input/root/number-input-root.d.ts +3 -1
  13. package/dist/sandbox/frame.d.ts +9 -2
  14. package/dist/sandbox/frame.js +34 -2
  15. package/dist/sandbox/preview/sandbox-preview.d.ts +22 -1
  16. package/dist/sandbox/preview/sandbox-preview.js +25 -6
  17. package/dist/sandbox/root/sandbox-root.d.ts +4 -3
  18. package/dist/sandbox/root/sandbox-root.js +5 -3
  19. package/dist/table/root/table-root.css.js +1 -1
  20. package/dist/table/root/table-root.d.ts +2 -0
  21. package/dist/time-input/root/time-input-root.css.js +2 -1
  22. package/dist/time-picker/root/time-picker-root.css.js +2 -2
  23. package/dist/timeline/item/timeline-item.css.js +2 -2
  24. package/dist/timeline/item/timeline-item.d.ts +4 -0
  25. package/dist/timeline/root/timeline-root.d.ts +4 -0
  26. package/dist/video-playlist/root/video-playlist-root.js +2 -1
  27. package/dist/virtual-list/root/virtual-list-root.css.js +1 -1
  28. package/dist/virtual-list/root/virtual-list-root.d.ts +1 -0
  29. package/lint.json +1 -1
  30. package/package.json +6 -6
  31. package/types/jsx.d.ts +2588 -221
  32. package/types/vue.d.ts +839 -47
  33. package/types/words.d.ts +94 -0
@@ -1,5 +1,5 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {display: contents;}[part="region"] {background-color: var(--canvas-background-color, var(--helix-color-surface-sunken));block-size: var(--canvas-block-size, 30rem);border: var(--helix-border-thin) solid var(--canvas-border-color, var(--helix-color-border));border-radius: var(--canvas-radius, var(--helix-radii-sm));box-sizing: border-box;display: grid;grid-template-rows: auto 1fr auto;overflow: hidden;position: relative;}:host([separation="plain"]) [part="region"] {background-color: transparent;border: none;border-radius: 0;}[part="viewport"] {min-block-size: 0;overflow: hidden;position: relative;}:host(:not(:state(empty))) ::slotted([slot="empty"]) {display: none;}[part="board"] {block-size: var(--_canvas-plane-block-size);inline-size: var(--_canvas-plane-inline-size);left: 0;position: absolute;top: 0;transform: translate(var(--_canvas-x), var(--_canvas-y)) scale(var(--_canvas-zoom));transform-origin: 0 0;transition: transform var(--helix-duration-normal) var(--helix-easing-standard);}:host([grid]) [part="viewport"] {background-position: var(--_canvas-rule-x) var(--_canvas-rule-y);background-size: calc(var(--canvas-grid-size, 32px) * var(--_canvas-rule-zoom))
2
+ export const styles = createSheet(`:host {display: contents;}[part="region"] {background-color: var(--canvas-background-color, var(--helix-color-surface-sunken));block-size: var(--canvas-block-size, 30rem);border: var(--helix-border-thin) solid var(--canvas-border-color, var(--helix-color-border));border-radius: var(--canvas-radius, var(--helix-radii-sm));box-sizing: border-box;display: grid;grid-template-rows: auto 1fr auto;overflow: hidden;position: relative;}:host([separation="plain"]) [part="region"] {background-color: transparent;border: none;border-radius: 0;}[part="viewport"] {min-block-size: 0;overflow: hidden;position: relative;}:host(:not(:state(empty))) ::slotted([slot="empty"]) {display: none;}[part="board"] {block-size: var(--_canvas-plane-block-size);inline-size: var(--_canvas-plane-inline-size);left: 0;position: absolute;top: 0;transform: translate(var(--_canvas-x), var(--_canvas-y)) scale(var(--canvas-zoom));transform-origin: 0 0;transition: transform var(--helix-duration-normal) var(--helix-easing-standard);}:host([grid]) [part="viewport"] {background-position: var(--_canvas-rule-x) var(--_canvas-rule-y);background-size: calc(var(--canvas-grid-size, 32px) * var(--_canvas-rule-zoom))
3
3
  calc(var(--canvas-grid-size, 32px) * var(--_canvas-rule-zoom));transition:
4
4
  background-position var(--helix-duration-normal) var(--helix-easing-standard),
5
5
  background-size var(--helix-duration-normal) var(--helix-easing-standard);}:host([grid="lines"]) [part="viewport"] {--_canvas-rule: color-mix(in oklab, var(--helix-color-border) 50%, transparent);background-image:
@@ -1,4 +1,4 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`helix-dialog::part(dialog) {align-self: start;inline-size: min(var(--command-size, 40rem), calc(100vw - var(--helix-space-xl) * 2));margin-block-start: 20vh;padding: var(--helix-space-none);}:host {--option-padding: var(--helix-space-sm);}[part="listbox"] {--listbox-background-color: transparent;border: none;display: block;}helix-listbox::part(items) {background-color: transparent;border: none;max-block-size: var(--command-list-size, 22rem);padding-block: var(--helix-space-xs);}helix-listbox::part(search) {border-block-end: var(--helix-border-thin) solid var(--helix-color-border);padding: var(--option-padding);}helix-listbox::part(search-field) {font-size: var(--helix-text-md);}:host {--_command-row: var(--helix-space-sm);--option-block-padding: var(--_command-row);}:host([data-density="sm"]),
3
3
  :host(:where([data-density="sm"] *)) {--_command-row: var(--helix-space-2xs);}:host([data-density="lg"]),
4
- :host(:where([data-density="lg"] *)) {--_command-row: var(--helix-space-md);}[part="footer"] {align-items: center;border-block-start: var(--helix-border-thin) solid var(--helix-color-border);color: var(--helix-color-foreground-muted);display: flex;font-size: var(--helix-text-xs);gap: var(--helix-space-sm);padding: var(--helix-space-xs) var(--option-padding);}[part="footer"][hidden] {display: none;}@media print {:host {display: none;}}`);
4
+ :host(:where([data-density="lg"] *)) {--_command-row: var(--helix-space-md);}[part="footer"] {align-items: center;border-block-start: var(--helix-border-thin) solid var(--helix-color-border);color: var(--helix-color-foreground-muted);display: flex;font-size: var(--helix-text-xs);gap: var(--helix-space-sm);padding: var(--helix-space-xs) var(--option-padding);}[part="footer"][hidden] {display: none;}:host([inline]) {background-color: var(--helix-color-surface);border: var(--helix-border-thin) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);display: block;inline-size: min(var(--command-size, 40rem), 100%);overflow: hidden;}@media print {:host {display: none;}}`);
@@ -25,7 +25,7 @@ color-mix(in srgb, var(--helix-color-primary) 10%, var(--helix-color-background)
25
25
  var(--data-table-drop-indicator-color, var(--helix-color-primary));}[part~="row"][part~="row-drop-after"] > * {box-shadow: inset 0 calc(var(--data-table-drop-indicator-size, var(--helix-border-thick)) * -1) 0
26
26
  0 var(--data-table-drop-indicator-color, var(--helix-color-primary));}[part="toolbar"][data-empty],
27
27
  [part="footer"][data-empty] {display: none;}[part="toolbar"] {padding-block-end: var(--data-table-toolbar-gap, var(--helix-space-sm));}[part="footer"] {align-items: center;display: flex;flex-wrap: wrap;gap: var(--data-table-footer-item-gap, var(--helix-space-md));padding-block-start: var(--data-table-footer-gap, var(--helix-space-sm));}[part="pagination"] {margin-inline-start: auto;}[part="empty"],
28
- [part="loading"] {grid-column: 1 / -1;}:host([child-field]) [part~="cell-header"] {--_data-table-gutter: calc(
28
+ [part="loading"] {grid-column: 1 / -1;}[part="error"] {color: var(--data-table-error-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);grid-column: 1 / -1;margin: var(--helix-space-none);padding-block: var(--helix-space-md);padding-inline: var(--helix-space-sm);text-align: center;}:host([child-field]) [part~="cell-header"] {--_data-table-gutter: calc(
29
29
  var(--data-table-toggle-size, var(--helix-size-icon-tight)) +
30
30
  var(--data-table-toggle-gap, var(--helix-space-2xs))
31
31
  );padding-inline-start: calc(
@@ -29,6 +29,7 @@ import '../../table/index.js';
29
29
  *
30
30
  * @slot - The columns, as `TableColumn` elements.
31
31
  * @slot empty - Content shown when there are no rows to show and none are loading, such as a picture and a link. Falls back to `empty-text`, which the live region still says.
32
+ * @slot error - Content shown while `error-text` is set, such as a button that tries again. Falls back to `error-text`, which the live region still says.
32
33
  * @slot footer - Content below the grid. It replaces the built-in pagination.
33
34
  * @slot loading - Content shown while the rows load, such as a spinner. Falls back to `loading-text`, which the live region still says.
34
35
  * @slot toolbar - Content above the grid, such as a search field or actions.
@@ -53,6 +54,7 @@ import '../../table/index.js';
53
54
  * @cssproperty --data-table-dragging-opacity - The opacity of a row being moved, with `reorderable-rows`.
54
55
  * @cssproperty --data-table-drop-indicator-color - The color of the line where a moved row would land.
55
56
  * @cssproperty --data-table-drop-indicator-size - The thickness of the line where a moved row would land.
57
+ * @cssproperty --data-table-error-color - The color of the words in the line shown while `error-text` is set.
56
58
  * @cssproperty --data-table-footer-gap - The space between the grid and the footer below it.
57
59
  * @cssproperty --data-table-footer-item-gap - The space between the pieces of the footer, such as a summary and the pagination.
58
60
  * @cssproperty --data-table-grip-color - The color of a row's grip, with `reorderable-rows`.
@@ -1,7 +1,8 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`[part="field"] {align-items: center;background-color: var(--date-input-background-color, var(--helix-color-well));border: var(--helix-border-thin) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);display: flex;flex-wrap: wrap;gap: var(--helix-space-2xs);min-block-size: var(--helix-size-control);padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-xs);transition:
3
3
  background-color var(--helix-duration-fast) var(--helix-easing-standard),
4
- border-color var(--helix-duration-fast) var(--helix-easing-standard);}[part="trigger"] {all: unset;block-size: var(--helix-size-icon);box-sizing: border-box;color: var(--helix-color-foreground-muted);cursor: pointer;flex: none;inline-size: var(--helix-size-icon);mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");mask-position: center;mask-repeat: no-repeat;mask-size: 100%;background-color: currentColor;transition: color var(--helix-duration-fast) var(--helix-easing-standard);}[part="trigger"]:hover {color: var(--helix-color-foreground);}[part="trigger"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="surface"] {--_floating-border-color: var(--date-input-border-color, var(--helix-color-border));--_floating-border-width: var(--date-input-border-width, var(--helix-border-floating));--_floating-shadow: var(--date-input-shadow, var(--helix-shadow-floating));inline-size: max-content;padding: var(--helix-space-sm);position: absolute;}::slotted([slot="panel-header"]) {display: block;margin-block-end: var(--helix-space-sm);}::slotted([slot="panel-footer"]) {display: block;margin-block-start: var(--helix-space-sm);}:host(:disabled) [part="field"] {color: var(--helix-color-foreground-subtle);}:host(:disabled) [part="control"],
4
+ border-color var(--helix-duration-fast) var(--helix-easing-standard);}slot[name="start"]::slotted(*),
5
+ slot[name="end"]::slotted(*) {color: var(--helix-color-foreground-subtle);flex: none;}[part="trigger"] {all: unset;block-size: var(--helix-size-icon);box-sizing: border-box;color: var(--helix-color-foreground-muted);cursor: pointer;flex: none;inline-size: var(--helix-size-icon);mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");mask-position: center;mask-repeat: no-repeat;mask-size: 100%;background-color: currentColor;transition: color var(--helix-duration-fast) var(--helix-easing-standard);}[part="trigger"]:hover {color: var(--helix-color-foreground);}[part="trigger"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="surface"] {--_floating-border-color: var(--date-input-border-color, var(--helix-color-border));--_floating-border-width: var(--date-input-border-width, var(--helix-border-floating));--_floating-shadow: var(--date-input-shadow, var(--helix-shadow-floating));inline-size: max-content;padding: var(--helix-space-sm);position: absolute;}::slotted([slot="panel-header"]) {display: block;margin-block-end: var(--helix-space-sm);}::slotted([slot="panel-footer"]) {display: block;margin-block-start: var(--helix-space-sm);}:host(:disabled) [part="field"] {color: var(--helix-color-foreground-subtle);}:host(:disabled) [part="control"],
5
6
  :host(:disabled) [part="trigger"] {cursor: not-allowed;}@media (prefers-reduced-motion: reduce) {[part="field"],
6
7
  [part="trigger"] {transition: none;}}[part="date"] {flex: none;}:host([mode="multiple"]) [part="control"] {flex-basis: 0;min-inline-size: var(--helix-size-icon-loose);}[part="segments"] {--_segment-focus-background-color: var(
7
8
  --date-input-segment-focus-background-color,
@@ -142,6 +142,7 @@ registerElementEvents({
142
142
  'helix-action',
143
143
  'helix-before-change',
144
144
  'helix-before-reorder',
145
+ 'helix-load-more',
145
146
  'helix-reorder',
146
147
  ],
147
148
  'helix-list-item': ['helix-action'],
@@ -9,7 +9,7 @@ export const styles = createSheet(`:host {display: contents;}[part="region"] {ba
9
9
  ". down . notes"
10
10
  ". . . full";}[part="legend"] {display: flex;flex-wrap: wrap;gap: var(--helix-space-2xs);inset-block-end: var(--helix-space-sm);inset-inline-start: var(--helix-space-sm);max-inline-size: calc(100% - var(--helix-space-sm) * 3 - var(--helix-size-control-sm));position: absolute;}:host([controls-placement="bottom-start"]) [part="legend"] {inset-inline: auto var(--helix-space-sm);}@container (inline-size < 40rem) {[part="legend"] {flex-wrap: nowrap;inset-block-end: calc(var(--helix-space-sm) - var(--helix-space-2xs));inset-inline-start: calc(var(--helix-space-sm) - var(--helix-space-2xs));overflow-x: auto;padding: var(--helix-space-2xs);scrollbar-width: none;}}[part~="legend-item"] {align-items: center;background-color: var(--viewport-control-background-color, var(--helix-color-surface-overlay));block-size: var(--helix-size-control-tight);border: var(--helix-border-floating) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);box-shadow: var(--helix-shadow-floating);color: var(--helix-color-foreground);cursor: pointer;display: inline-flex;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);gap: var(--helix-space-2xs);padding-inline: var(--helix-space-xs);white-space: nowrap;}[part~="legend-item"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part~="legend-item"]:nth-child(24n + 1) {--_graph-swatch: var(--helix-color-series-1);}[part~="legend-item"]:nth-child(24n + 2) {--_graph-swatch: var(--helix-color-series-2);}[part~="legend-item"]:nth-child(24n + 3) {--_graph-swatch: var(--helix-color-series-3);}[part~="legend-item"]:nth-child(24n + 4) {--_graph-swatch: var(--helix-color-series-4);}[part~="legend-item"]:nth-child(24n + 5) {--_graph-swatch: var(--helix-color-series-5);}[part~="legend-item"]:nth-child(24n + 6) {--_graph-swatch: var(--helix-color-series-6);}[part~="legend-item"]:nth-child(24n + 7) {--_graph-swatch: var(--helix-color-series-7);}[part~="legend-item"]:nth-child(24n + 8) {--_graph-swatch: var(--helix-color-series-8);}[part~="legend-item"]:nth-child(24n + 9) {--_graph-swatch: var(--helix-color-series-9);}[part~="legend-item"]:nth-child(24n + 10) {--_graph-swatch: var(--helix-color-series-10);}[part~="legend-item"]:nth-child(24n + 11) {--_graph-swatch: var(--helix-color-series-11);}[part~="legend-item"]:nth-child(24n + 12) {--_graph-swatch: var(--helix-color-series-12);}[part~="legend-item"]:nth-child(24n + 13) {--_graph-swatch: var(--helix-color-series-13);}[part~="legend-item"]:nth-child(24n + 14) {--_graph-swatch: var(--helix-color-series-14);}[part~="legend-item"]:nth-child(24n + 15) {--_graph-swatch: var(--helix-color-series-15);}[part~="legend-item"]:nth-child(24n + 16) {--_graph-swatch: var(--helix-color-series-16);}[part~="legend-item"]:nth-child(24n + 17) {--_graph-swatch: var(--helix-color-series-17);}[part~="legend-item"]:nth-child(24n + 18) {--_graph-swatch: var(--helix-color-series-18);}[part~="legend-item"]:nth-child(24n + 19) {--_graph-swatch: var(--helix-color-series-19);}[part~="legend-item"]:nth-child(24n + 20) {--_graph-swatch: var(--helix-color-series-20);}[part~="legend-item"]:nth-child(24n + 21) {--_graph-swatch: var(--helix-color-series-21);}[part~="legend-item"]:nth-child(24n + 22) {--_graph-swatch: var(--helix-color-series-22);}[part~="legend-item"]:nth-child(24n + 23) {--_graph-swatch: var(--helix-color-series-23);}[part~="legend-item"]:nth-child(24n + 24) {--_graph-swatch: var(--helix-color-series-24);}[part~="legend-item"][data-tone="accent"] {--_graph-swatch: var(--helix-color-accent);}[part~="legend-item"][data-tone="danger"] {--_graph-swatch: var(--helix-color-danger);}[part~="legend-item"][data-tone="info"] {--_graph-swatch: var(--helix-color-info);}[part~="legend-item"][data-tone="neutral"] {--_graph-swatch: var(--helix-color-foreground-muted);}[part~="legend-item"][data-tone="primary"] {--_graph-swatch: var(--helix-color-primary);}[part~="legend-item"][data-tone="success"] {--_graph-swatch: var(--helix-color-success);}[part~="legend-item"][data-tone="warning"] {--_graph-swatch: var(--helix-color-warning);}[part="legend-swatch"] {block-size: var(--helix-space-xs);border: var(--helix-border-thin) solid var(--_graph-swatch, var(--helix-color-foreground-muted));border-radius: var(--helix-radii-full);box-sizing: border-box;background-color: var(--_graph-swatch, var(--helix-color-foreground-muted));flex: 0 0 auto;inline-size: var(--helix-space-xs);}[part~="legend-item-hidden"] {color: var(--helix-color-foreground-subtle);}[part~="legend-item-hidden"] [part="legend-swatch"] {background-color: transparent;}[part="search"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--helix-color-border);display: flex;gap: var(--helix-space-2xs);padding: var(--helix-space-2xs);padding-inline-start: var(--helix-space-xs);}[part="filter-icon"] {align-items: center;color: var(--helix-color-foreground-subtle);display: inline-flex;flex: 0 0 auto;}[part="filter-icon"] svg,
11
11
  slot[name="filter-icon"]::slotted(*) {--icon-size: var(--helix-size-icon-tight);block-size: var(--helix-size-icon-tight);inline-size: var(--helix-size-icon-tight);}[part="search-field"] {appearance: none;background-color: transparent;block-size: var(--helix-size-control-tight);border: none;box-sizing: border-box;color: var(--helix-color-foreground);flex: 1 1 auto;font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);font-weight: var(--helix-weight-medium);min-inline-size: 0;padding-inline: var(--helix-space-2xs);}[part="search-field"]::placeholder {color: var(--helix-color-foreground-subtle);}[part="search-field"]:focus-visible {outline: none;}[part="search"]:has([part="search-field"]:focus-visible),
12
- [part="list"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="count"] {color: var(--helix-color-foreground-muted);flex: 0 0 auto;font-size: var(--helix-text-xs);font-variant-numeric: tabular-nums;padding-inline-end: calc(var(--helix-space-xs) - var(--helix-space-2xs));}[part="list"] {min-block-size: 0;overflow-y: auto;overscroll-behavior: contain;padding-block: var(--helix-space-2xs);}[part~="note"] {align-items: center;box-sizing: border-box;cursor: pointer;display: flex;font-size: var(--graph-note-text, var(--helix-text-sm));gap: var(--helix-space-sm);min-block-size: var(--helix-size-control-tight);padding-block: var(--helix-space-2xs);padding-inline: var(--graph-note-padding-inline, var(--helix-space-xs));user-select: none;}[part~="note"]:hover,
12
+ [part="list"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="count"] {color: var(--helix-color-foreground-muted);flex: 0 0 auto;font-size: var(--helix-text-xs);font-variant-numeric: tabular-nums;padding-inline-end: calc(var(--helix-space-xs) - var(--helix-space-2xs));}[part="empty"] {color: var(--helix-color-foreground-muted);font-size: var(--helix-text-sm);grid-area: 2 / 1;padding: var(--helix-space-sm);}[part="list"] {min-block-size: 0;overflow-y: auto;overscroll-behavior: contain;padding-block: var(--helix-space-2xs);}[part~="note"] {align-items: center;box-sizing: border-box;cursor: pointer;display: flex;font-size: var(--graph-note-text, var(--helix-text-sm));gap: var(--helix-space-sm);min-block-size: var(--helix-size-control-tight);padding-block: var(--helix-space-2xs);padding-inline: var(--graph-note-padding-inline, var(--helix-space-xs));user-select: none;}[part~="note"]:hover,
13
13
  [part="list"]:focus-visible [part~="note-cursor"] {--_graph-wash: var(
14
14
  --graph-note-hover-color,
15
15
  light-dark(
@@ -2,5 +2,5 @@ import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`:host {display: flex;flex-direction: column;gap: var(--list-gap, var(--helix-space-none));}:host([divided]) ::slotted(*:not(:first-child)) {border-block-start: var(--helix-border-thin) solid var(--helix-color-border);}:host([kind="ordered"]),
3
3
  :host([kind="unordered"]) {contain: style;padding-inline-start: var(--list-marker-gutter, var(--helix-space-md));}:host([kind="ordered"]) ::slotted(*),
4
4
  :host([kind="unordered"]) ::slotted(*) {display: list-item;list-style-position: outside;}:host([kind="ordered"]) ::slotted(*) {list-style-type: decimal;}:host([kind="ordered"][type="a"]) ::slotted(*) {list-style-type: lower-alpha;}:host([kind="ordered"][type="A"]) ::slotted(*) {list-style-type: upper-alpha;}:host([kind="ordered"][type="i"]) ::slotted(*) {list-style-type: lower-roman;}:host([kind="ordered"][type="I"]) ::slotted(*) {list-style-type: upper-roman;}:host([kind="unordered"]) ::slotted(*) {list-style-type: disc;}:host([kind="ordered"]) ::slotted(*) {counter-increment: list-item var(--list-step, 1);}:host([kind="ordered"]) ::slotted(:first-child) {counter-set: list-item var(--list-first);}:host([marker="rail"]) {counter-reset: list-rail;padding-inline-start: var(--helix-space-none);}:host([marker="rail"]) ::slotted(*) {--list-item-rail-content: counter(list-rail, var(--list-rail-style, decimal-leading-zero));--list-item-rail-display: block;counter-increment: list-rail var(--list-step, 1);}:host([marker="rail"]) ::slotted(:first-child) {counter-set: list-rail var(--list-first);}:host([kind="ordered"][marker="rail"]) ::slotted(*),
5
- :host([kind="unordered"][marker="rail"]) ::slotted(*) {display: block;list-style: none;}:host([kind="description"]) ::slotted(*) {--list-item-term-weight: var(--helix-weight-semibold);}[part="drag-preview"] {background-color: var(--list-drag-preview-background-color, var(--helix-color-surface-raised));border: var(--list-drag-preview-border-width, var(--helix-border-floating)) solid
5
+ :host([kind="unordered"][marker="rail"]) ::slotted(*) {display: block;list-style: none;}:host([kind="description"]) ::slotted(*) {--list-item-term-weight: var(--helix-weight-semibold);}[part="empty"] {color: var(--list-empty-color, var(--helix-color-foreground-muted));font-size: var(--helix-text-sm);padding: var(--list-empty-padding, var(--helix-space-md));text-align: center;}[part="empty"][hidden] {display: none;}[part="loading"] {color: var(--list-loading-color, var(--helix-color-foreground-muted));font-size: var(--helix-text-sm);padding: var(--list-loading-padding, var(--helix-space-sm));text-align: center;}[part="drag-preview"] {background-color: var(--list-drag-preview-background-color, var(--helix-color-surface-raised));border: var(--list-drag-preview-border-width, var(--helix-border-floating)) solid
6
6
  var(--list-drag-preview-border-color, var(--helix-color-border));border-radius: var(--list-drag-preview-radius, var(--helix-radii-sm));box-shadow: var(--list-drag-preview-shadow, var(--helix-shadow-floating));opacity: var(--list-drag-preview-opacity, 0.9);}@media print {:host {print-color-adjust: economy;}}`);
@@ -19,7 +19,11 @@ import type { CSSResultGroup } from 'lit';
19
19
  * @cssproperty --list-drag-preview-opacity - The opacity of the copy of a row a pointer drags.
20
20
  * @cssproperty --list-drag-preview-radius - The corner radius of the copy of a row a pointer drags.
21
21
  * @cssproperty --list-drag-preview-shadow - The shadow that raises the copy of a row a pointer drags over the page.
22
+ * @cssproperty --list-empty-color - The color of the text in the row shown while the list has no rows.
23
+ * @cssproperty --list-empty-padding - The space around the text in the row shown while the list has no rows.
22
24
  * @cssproperty --list-gap - The space between rows.
25
+ * @cssproperty --list-loading-color - The color of the text in the row drawn while `loading` is set.
26
+ * @cssproperty --list-loading-padding - The space around the text in the row drawn while `loading` is set.
23
27
  * @cssproperty --list-marker-gutter - The space that the markers of ordered and unordered lists sit in.
24
28
  * @cssproperty --list-rail-inline-size - The width of the rail's track.
25
29
  * @cssproperty --list-rail-style - The counter style of the rail's numbers. Takes any `list-style-type`.
@@ -8,5 +8,7 @@ var(--number-input-stepper-border-color, var(--helix-color-border));}[part="incr
8
8
  var(--number-input-stepper-border-color, var(--helix-color-border));}[part="decrement"]:hover:not(:disabled),
9
9
  [part="increment"]:hover:not(:disabled) {background-color: var(--number-input-stepper-background-color-hover, var(--helix-color-surface));color: var(--number-input-stepper-color-hover, var(--helix-color-foreground));}[part="decrement"]:disabled,
10
10
  [part="increment"]:disabled {cursor: default;opacity: 0.4;}[part="decrement"] svg,
11
- [part="increment"] svg {block-size: var(--number-input-stepper-icon-size, var(--helix-size-icon-tight));inline-size: var(--number-input-stepper-icon-size, var(--helix-size-icon-tight));}:host([scrub]) [part="label"] {cursor: ew-resize;touch-action: none;user-select: none;}:host([scrub]:disabled) [part="label"],
11
+ [part="increment"] svg,
12
+ slot[name="decrement-icon"]::slotted(*),
13
+ slot[name="increment-icon"]::slotted(*) {block-size: var(--number-input-stepper-icon-size, var(--helix-size-icon-tight));inline-size: var(--number-input-stepper-icon-size, var(--helix-size-icon-tight));}:host([scrub]) [part="label"] {cursor: ew-resize;touch-action: none;user-select: none;}:host([scrub]:disabled) [part="label"],
12
14
  :host([scrub][readonly]) [part="label"] {cursor: default;}@media print {:host {print-color-adjust: exact;}}`);
@@ -21,9 +21,11 @@ import type { CSSResultGroup } from 'lit';
21
21
  * @aliases NumberField, Stepper, InputNumber
22
22
  * @documentation https://fusion.dev/helix/components/number-input
23
23
  *
24
+ * @slot decrement-icon - Replaces the icon on the step down button.
24
25
  * @slot end - Content after the number, such as a unit.
25
26
  * @slot feedback - The message that says what is wrong, for content richer than a string. It shows while there is a message.
26
27
  * @slot hint - Help under the control, for content richer than the `hint` text.
28
+ * @slot increment-icon - Replaces the icon on the step up button.
27
29
  * @slot label - The label, for content richer than the `label` text.
28
30
  * @slot start - Content before the number, such as a unit or an icon.
29
31
  *
@@ -42,7 +44,7 @@ import type { CSSResultGroup } from 'lit';
42
44
  * @cssproperty --number-input-stepper-border-color - The rule between each stepper button and the number.
43
45
  * @cssproperty --number-input-stepper-color - Icon color of the stepper buttons at rest.
44
46
  * @cssproperty --number-input-stepper-color-hover - Icon color of a stepper button under the pointer.
45
- * @cssproperty --number-input-stepper-icon-size - Width and height of the stepper icons.
47
+ * @cssproperty --number-input-stepper-icon-size - Width and height of the stepper icons, drawn or slotted.
46
48
  * @cssproperty --number-input-stepper-size - Width of each stepper button.
47
49
  */
48
50
  export declare class HelixNumberInput extends HelixHeadlessNumberInput {
@@ -51,8 +51,9 @@ export declare const loggedText: (value: unknown) => string;
51
51
  * - Writes each `helix-preview-render` into the root: the markup, the
52
52
  * stylesheet, the direction, the layout and the color mode. Scripts in the
53
53
  * markup run.
54
- * - Posts every console call and uncaught error as `helix-preview-console`,
55
- * an uncaught one marked `uncaught`, which marks the preview `failed`.
54
+ * - Posts every console call, uncaught error, and unhandled promise rejection
55
+ * as `helix-preview-console`, an uncaught one marked `uncaught`, which marks
56
+ * the preview `failed`.
56
57
  * - Posts `helix-preview-size` whenever what was drawn changes height.
57
58
  * - Posts `helix-preview-press` on every press, so menus outside close.
58
59
  *
@@ -63,3 +64,9 @@ export declare const loggedText: (value: unknown) => string;
63
64
  * @returns A function that stops serving and puts the console back.
64
65
  */
65
66
  export declare const servePreview: (options?: ServePreviewOptions) => (() => void);
67
+ /**
68
+ * Markup with a script after it, run as a module once the markup is in: what
69
+ * a sandbox's `js` pane adds to its `html` pane.
70
+ */
71
+ export declare const withScript: (source: string, script: string) => string;
72
+ export declare const defaultFrame: () => string;
@@ -51,13 +51,14 @@ const drawn = (child) => {
51
51
  .map((node) => node.getBoundingClientRect())
52
52
  .filter((box) => box.width > 0 || box.height > 0);
53
53
  };
54
- export const servePreview = (options = {}) => {
54
+ const serveWith = (tools, options = {}) => {
55
+ const { drawn, isRender, layoutRules, loggedText, runScripts, withoutStylesheets } = tools;
55
56
  const root = options.root ?? document.getElementById('preview-root') ?? document.body;
56
57
  root.toggleAttribute('data-preview-root', true);
57
58
  root.dataset.layout ??= 'padded';
58
59
  if (options.layouts !== false) {
59
60
  const rules = document.createElement('style');
60
- rules.textContent = LAYOUT_RULES;
61
+ rules.textContent = layoutRules;
61
62
  document.head.prepend(rules);
62
63
  }
63
64
  const post = (message) => window.parent?.postMessage(message, '*');
@@ -73,6 +74,16 @@ export const servePreview = (options = {}) => {
73
74
  const failed = (event) => {
74
75
  post({ level: 'error', text: event.message, type: 'helix-preview-console', uncaught: true });
75
76
  };
77
+ const refused = (event) => {
78
+ const { reason } = event;
79
+ const said = reason instanceof Error ? `${reason.name}: ${reason.message}` : loggedText(reason);
80
+ post({
81
+ level: 'error',
82
+ text: `Uncaught (in promise) ${said}`,
83
+ type: 'helix-preview-console',
84
+ uncaught: true,
85
+ });
86
+ };
76
87
  const measure = () => {
77
88
  const boxes = [...root.children].flatMap(drawn);
78
89
  if (boxes.length === 0) {
@@ -130,6 +141,7 @@ export const servePreview = (options = {}) => {
130
141
  watch();
131
142
  const press = () => post({ type: 'helix-preview-press' });
132
143
  window.addEventListener('error', failed);
144
+ window.addEventListener('unhandledrejection', refused);
133
145
  window.addEventListener('message', render);
134
146
  document.addEventListener('pointerdown', press, { capture: true, passive: true });
135
147
  post({ type: 'helix-preview-ready' });
@@ -140,7 +152,27 @@ export const servePreview = (options = {}) => {
140
152
  watcher.disconnect();
141
153
  children.disconnect();
142
154
  window.removeEventListener('error', failed);
155
+ window.removeEventListener('unhandledrejection', refused);
143
156
  window.removeEventListener('message', render);
144
157
  document.removeEventListener('pointerdown', press, { capture: true });
145
158
  };
146
159
  };
160
+ const TOOLS = {
161
+ drawn,
162
+ isRender,
163
+ layoutRules: LAYOUT_RULES,
164
+ loggedText,
165
+ runScripts,
166
+ withoutStylesheets,
167
+ };
168
+ export const servePreview = (options = {}) => serveWith(TOOLS, options);
169
+ let builtIn;
170
+ export const withScript = (source, script) => script === '' ? source : `${source}<script type="module">${script}${SCRIPT_END}`;
171
+ const SCRIPT_END = ['<', 'script>'].join('/');
172
+ export const defaultFrame = () => {
173
+ if (builtIn === undefined) {
174
+ const script = `(${serveWith})({drawn:${drawn},isRender:${isRender},layoutRules:${JSON.stringify(LAYOUT_RULES)},loggedText:${loggedText},runScripts:${runScripts},withoutStylesheets:${withoutStylesheets}})`;
175
+ builtIn = `<!doctype html><html><head><meta charset="utf-8"><meta content="width=device-width" name="viewport"><style>:root{color-scheme:light dark;font-family:system-ui,sans-serif}body{margin:0}</style></head><body><div id="preview-root"></div><script>${script.replaceAll('</', '<\\/')}${SCRIPT_END}</body></html>`;
176
+ }
177
+ return builtIn;
178
+ };
@@ -48,6 +48,12 @@ export type PreviewMessage = PreviewConsole | PreviewPress | PreviewReady | Prev
48
48
  * document imports what the examples need, listens for a render message, and
49
49
  * writes the markup into itself.
50
50
  *
51
+ * **Without `src`, the frame loads a built-in document**, so a sandbox renders
52
+ * with nothing to host. It runs HTML, CSS, and scripts, and reports the
53
+ * console, uncaught errors, its height, and presses as a frame on
54
+ * `servePreview` does. It defines no element, so an example that uses Helix
55
+ * components needs a `src` that imports them.
56
+ *
51
57
  * **Examples render in a frame**, so an example's styles and scripts do not
52
58
  * affect the page around the sandbox, and `position: fixed` stays inside the
53
59
  * pane. The frame starts empty, with its own stylesheets and its own custom
@@ -128,12 +134,18 @@ export declare class HelixSandboxPreview extends HelixElement {
128
134
  * could read it.
129
135
  */
130
136
  layout?: 'padded' | 'centered' | 'fullscreen' | 'hug';
137
+ /**
138
+ * A script to run as a module after the markup, on every render of new
139
+ * source. A sandbox writes its `js` pane here.
140
+ */
141
+ script: string;
131
142
  /**
132
143
  * Markup to render.
133
144
  */
134
145
  source: string;
135
146
  /**
136
147
  * The document the frame loads. It provides the styles and the elements.
148
+ * Empty loads the built-in document, which defines no element.
137
149
  */
138
150
  src: string;
139
151
  /**
@@ -142,6 +154,12 @@ export declare class HelixSandboxPreview extends HelixElement {
142
154
  styles: string;
143
155
  /** Whether the frame has said it is listening. */
144
156
  private ready;
157
+ /** The source the frame was last sent, which it holds and does not run again. */
158
+ private sentSource;
159
+ /** The source the frame held when it last reported an uncaught error. */
160
+ private failedSource;
161
+ /** What the frame is sent as its source: the markup, and the script after it. */
162
+ private get sending();
145
163
  private get frame();
146
164
  /**
147
165
  * The frame's document has finished loading, so its listener exists, the
@@ -238,7 +256,10 @@ export declare class HelixSandboxPreview extends HelixElement {
238
256
  * new document announces itself the same way the first one did.
239
257
  */
240
258
  reload(): void;
241
- /** A new document is on its way, so nothing is sent until it listens, and nothing has failed in it. */
259
+ /**
260
+ * A new document is on its way, so nothing is sent until it listens, and
261
+ * nothing has failed in it. The built-in document loads too.
262
+ */
242
263
  private unready;
243
264
  protected updated(changed: PropertyValues): void;
244
265
  protected render(): TemplateResult;
@@ -7,13 +7,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var HelixSandboxPreview_1;
8
8
  import { customElement, DelayController, HelixConsoleEvent, HelixElement, HelixResizeEvent, words, } from '@fusion.dev/helix-core';
9
9
  const SETTLE = 120;
10
- import { html } from 'lit';
10
+ import { html, nothing } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
+ import { defaultFrame, withScript } from '../frame.js';
12
13
  import { styles as sheet } from './sandbox-preview.css.js';
13
14
  let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
14
15
  constructor() {
15
16
  super(...arguments);
16
17
  this.label = 'Preview';
18
+ this.script = '';
17
19
  this.source = '';
18
20
  this.src = '';
19
21
  this.styles = '';
@@ -35,6 +37,7 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
35
37
  if (data?.type === 'helix-preview-console') {
36
38
  this.dispatchEvent(new HelixConsoleEvent({ level: data.level, text: data.text }));
37
39
  if (data.uncaught) {
40
+ this.failedSource = this.sentSource;
38
41
  this.toggleState('failed', true);
39
42
  }
40
43
  }
@@ -49,13 +52,18 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
49
52
  }
50
53
  static { HelixSandboxPreview_1 = this; }
51
54
  static { this.words = 'helix-sandbox-preview'; }
55
+ get sending() {
56
+ return withScript(this.source, this.script);
57
+ }
52
58
  get frame() {
53
59
  return this.renderRoot.querySelector('iframe');
54
60
  }
55
61
  static { this.target = '*'; }
56
62
  scheduleSend() {
57
63
  this.settle.start(SETTLE, () => {
58
- this.toggleState('failed', false);
64
+ if (this.sending !== this.failedSource) {
65
+ this.toggleState('failed', false);
66
+ }
59
67
  this.send();
60
68
  });
61
69
  }
@@ -67,11 +75,12 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
67
75
  ...(this.colorMode ? { colorMode: this.colorMode } : {}),
68
76
  direction: this.direction ?? 'ltr',
69
77
  layout: this.layout ?? 'padded',
70
- source: this.source,
78
+ source: this.sending,
71
79
  styles: this.styles,
72
80
  type: 'helix-preview-render',
73
81
  };
74
82
  this.frame?.contentWindow?.postMessage(message, HelixSandboxPreview_1.target);
83
+ this.sentSource = this.sending;
75
84
  }
76
85
  connectedCallback() {
77
86
  super.connectedCallback();
@@ -87,12 +96,18 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
87
96
  return;
88
97
  }
89
98
  this.unready();
99
+ if (this.src === '') {
100
+ frame.srcdoc = defaultFrame();
101
+ return;
102
+ }
90
103
  frame.src = this.src;
91
104
  }
92
105
  unready() {
93
106
  this.ready = false;
107
+ this.sentSource = undefined;
108
+ this.failedSource = undefined;
94
109
  this.toggleState('failed', false);
95
- this.toggleState('loading', this.src !== '');
110
+ this.toggleState('loading', true);
96
111
  }
97
112
  updated(changed) {
98
113
  super.updated(changed);
@@ -100,7 +115,7 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
100
115
  this.unready();
101
116
  return;
102
117
  }
103
- if (changed.has('source') || changed.has('styles')) {
118
+ if (changed.has('source') || changed.has('script') || changed.has('styles')) {
104
119
  this.scheduleSend();
105
120
  return;
106
121
  }
@@ -110,7 +125,8 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
110
125
  return html `<iframe
111
126
  part="frame"
112
127
  @load=${this.handleFrameLoad}
113
- src=${this.src}
128
+ src=${this.src || nothing}
129
+ srcdoc=${this.src === '' ? defaultFrame() : nothing}
114
130
  title=${this.label}
115
131
  allow="clipboard-write *; fullscreen *"
116
132
  sandbox="allow-scripts allow-forms"
@@ -131,6 +147,9 @@ __decorate([
131
147
  __decorate([
132
148
  property()
133
149
  ], HelixSandboxPreview.prototype, "layout", void 0);
150
+ __decorate([
151
+ property()
152
+ ], HelixSandboxPreview.prototype, "script", void 0);
134
153
  __decorate([
135
154
  property()
136
155
  ], HelixSandboxPreview.prototype, "source", void 0);
@@ -11,9 +11,10 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
11
11
  * alone.
12
12
  *
13
13
  * The event carries the pane's `name`, so one sandbox can hold several panes.
14
- * `html` sets the preview's markup and `css` sets its stylesheet. The sandbox
15
- * ignores a pane with any other name, so that pane can show content without
16
- * changing the preview.
14
+ * `html` sets the preview's markup, `css` sets its stylesheet, and `js` sets
15
+ * a script that runs as a module after the markup. The sandbox ignores a pane
16
+ * with any other name, so that pane can show content without changing the
17
+ * preview.
17
18
  *
18
19
  * **The dividers are two nested `helix-splitter` elements**, which handle the
19
20
  * pointer, the keyboard, and the corner. The inner splitter holds the panes and
@@ -12,6 +12,8 @@ import { styles } from './sandbox-root.css.js';
12
12
  const DEFAULT_SPLIT = 50;
13
13
  const DEFAULT_PANEL = 160;
14
14
  const PANEL_MAX = 0.8;
15
+ const PANE_KEYS = { css: 'styles', html: 'source', js: 'script' };
16
+ const isPaneName = (name) => typeof name === 'string' && Object.hasOwn(PANE_KEYS, name);
15
17
  let HelixSandbox = class HelixSandbox extends HelixElement {
16
18
  constructor() {
17
19
  super(...arguments);
@@ -38,7 +40,7 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
38
40
  const { value } = event.detail;
39
41
  const pane = event.composedPath()[0];
40
42
  const name = pane?.name;
41
- if (name !== 'css' && name !== 'html') {
43
+ if (!isPaneName(name)) {
42
44
  return;
43
45
  }
44
46
  queueMicrotask(() => {
@@ -52,7 +54,7 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
52
54
  for (const pane of slot?.assignedElements({ flatten: true }) ?? []) {
53
55
  const { name, value } = pane;
54
56
  const text = typeof value === 'string' ? value : pane.getAttribute('value');
55
- if ((name === 'css' || name === 'html') && text) {
57
+ if (isPaneName(name) && text) {
56
58
  this.write(name, text, true);
57
59
  }
58
60
  }
@@ -147,7 +149,7 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
147
149
  }
148
150
  write(name, value, seeding) {
149
151
  for (const preview of this.previews) {
150
- const key = name === 'css' ? 'styles' : 'source';
152
+ const key = PANE_KEYS[name];
151
153
  if (!seeding || !preview[key]) {
152
154
  preview[key] = value;
153
155
  }
@@ -1,4 +1,4 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`:host {display: block;overflow-x: auto;}[part="table"] {display: grid;grid-template-columns: var(--table-columns, var(--table-template, minmax(0, 1fr)));inline-size: 100%;}[part="head"] {display: contents;}::slotted([slot="heading"]) {color: var(--table-title-color, var(--helix-color-foreground));display: block;font-family: var(--helix-font-sans);font-size: var(--table-title-text, var(--helix-text-md));font-weight: var(--helix-weight-semibold);margin-block: var(--helix-space-none) var(--table-title-gap, var(--helix-space-sm));}[part="select-all"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--helix-color-border);box-sizing: border-box;display: flex;min-block-size: var(--helix-size-control-loose);padding-inline: var(--helix-space-none) var(--helix-space-md);}[part="grip-head"] {border-block-end: var(--helix-border-thin) solid var(--helix-color-border);box-sizing: border-box;min-block-size: var(--helix-size-control-loose);}[part="grip-head"]:focus-visible,
3
- [part="select-all"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}:host([loading]) [part="table"] {opacity: 0.5;}[part="drag-preview"] {background-color: var(--table-drag-preview-background-color, var(--helix-color-surface-raised));border: var(--table-drag-preview-border-width, var(--helix-border-floating)) solid
3
+ [part="select-all"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="error"] {color: var(--table-error-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);margin: var(--helix-space-none);padding-block: var(--helix-space-md);padding-inline: var(--helix-space-sm);text-align: center;}:host([loading]) [part="table"] {opacity: 0.5;}[part="drag-preview"] {background-color: var(--table-drag-preview-background-color, var(--helix-color-surface-raised));border: var(--table-drag-preview-border-width, var(--helix-border-floating)) solid
4
4
  var(--table-drag-preview-border-color, var(--helix-color-border));border-radius: var(--table-drag-preview-radius, var(--helix-radii-sm));box-shadow: var(--table-drag-preview-shadow, var(--helix-shadow-floating));opacity: var(--table-drag-preview-opacity, 0.9);}@media print {:host {print-color-adjust: economy;}}`);
@@ -15,6 +15,7 @@ import '../../checkbox/index.js';
15
15
  *
16
16
  * @slot - The table's rows.
17
17
  * @slot empty - Content shown when there are no rows and none are loading, such as a picture and a link. Falls back to `empty-text`, which the live region still says.
18
+ * @slot error - Content shown while `error-text` is set, such as a button that tries again. Falls back to `error-text`, which the live region still says.
18
19
  * @slot heading - Words that name the table, shown above it in the weight of a heading.
19
20
  * @slot loading - Content shown while the rows load, such as a spinner. Falls back to `loading-text`, which the live region still says.
20
21
  *
@@ -29,6 +30,7 @@ import '../../checkbox/index.js';
29
30
  * @cssproperty --table-drag-preview-opacity - The opacity of the copy of a row a pointer drags.
30
31
  * @cssproperty --table-drag-preview-radius - The corner radius of the copy of a row a pointer drags.
31
32
  * @cssproperty --table-drag-preview-shadow - The shadow that raises the copy of a row a pointer drags over the page.
33
+ * @cssproperty --table-error-color - The color of the words in the line shown while `error-text` is set.
32
34
  * @cssproperty --table-title-color - The color of the words in the `heading` slot.
33
35
  * @cssproperty --table-title-gap - The space between the `heading` slot and the grid.
34
36
  * @cssproperty --table-title-text - The font size of the words in the `heading` slot.
@@ -1,7 +1,8 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`[part="field"] {align-items: center;background-color: var(--time-input-background-color, var(--helix-color-well));flex-wrap: wrap;min-block-size: var(--helix-size-control);padding-block: var(--helix-space-2xs);border: var(--helix-border-thin) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);display: flex;gap: var(--helix-space-2xs);padding-inline: var(--helix-space-xs);transition:
3
3
  background-color var(--helix-duration-fast) var(--helix-easing-standard),
4
- border-color var(--helix-duration-fast) var(--helix-easing-standard);}:host(:disabled) [part="field"] {color: var(--helix-color-foreground-subtle);}[part="trigger"] {--icon-size: var(--helix-size-icon);all: unset;align-items: center;box-sizing: border-box;color: var(--helix-color-foreground-muted);cursor: pointer;display: flex;flex: none;transition: color var(--helix-duration-fast) var(--helix-easing-standard);}:host(:not([mode="multiple"])) [part="field"] {flex-wrap: nowrap;}[part="trigger-icon"] {block-size: var(--icon-size);inline-size: var(--icon-size);}[part="trigger"]:hover {color: var(--helix-color-foreground);}[part="trigger"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}:host(:disabled) [part="trigger"] {cursor: not-allowed;}[part="surface"] {--_floating-border-color: var(--time-input-border-color, var(--helix-color-border));--_floating-border-width: var(--time-input-border-width, var(--helix-border-floating));--_floating-shadow: var(--time-input-shadow, var(--helix-shadow-floating));inline-size: var(--floating-anchor-inline-size, 100%);min-inline-size: max-content;overflow: hidden;padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-none);position: absolute;}::slotted([slot="panel-header"]) {display: block;margin-block-end: var(--helix-space-sm);margin-inline: var(--helix-space-sm);}::slotted([slot="panel-footer"]) {display: block;margin-block-start: var(--helix-space-sm);margin-inline: var(--helix-space-sm);}@media (prefers-reduced-motion: reduce) {[part="field"],
4
+ border-color var(--helix-duration-fast) var(--helix-easing-standard);}slot[name="start"]::slotted(*),
5
+ slot[name="end"]::slotted(*) {color: var(--helix-color-foreground-subtle);flex: none;}:host(:disabled) [part="field"] {color: var(--helix-color-foreground-subtle);}[part="trigger"] {--icon-size: var(--helix-size-icon);all: unset;align-items: center;box-sizing: border-box;color: var(--helix-color-foreground-muted);cursor: pointer;display: flex;flex: none;transition: color var(--helix-duration-fast) var(--helix-easing-standard);}:host(:not([mode="multiple"])) [part="field"] {flex-wrap: nowrap;}[part="trigger-icon"] {block-size: var(--icon-size);inline-size: var(--icon-size);}[part="trigger"]:hover {color: var(--helix-color-foreground);}[part="trigger"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}:host(:disabled) [part="trigger"] {cursor: not-allowed;}[part="surface"] {--_floating-border-color: var(--time-input-border-color, var(--helix-color-border));--_floating-border-width: var(--time-input-border-width, var(--helix-border-floating));--_floating-shadow: var(--time-input-shadow, var(--helix-shadow-floating));inline-size: var(--floating-anchor-inline-size, 100%);min-inline-size: max-content;overflow: hidden;padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-none);position: absolute;}::slotted([slot="panel-header"]) {display: block;margin-block-end: var(--helix-space-sm);margin-inline: var(--helix-space-sm);}::slotted([slot="panel-footer"]) {display: block;margin-block-start: var(--helix-space-sm);margin-inline: var(--helix-space-sm);}@media (prefers-reduced-motion: reduce) {[part="field"],
5
6
  [part="trigger"] {transition: none;}}:host([variant="wheels"]) [part="surface"] {inline-size: max-content;}[part="time"] {flex: none;}:host([mode="multiple"]) [part="control"] {flex-basis: 0;min-inline-size: var(--helix-size-icon-loose);}[part="segments"] {--_segment-focus-background-color: var(
6
7
  --time-input-segment-focus-background-color,
7
8
  var(--helix-color-primary)
@@ -1,5 +1,5 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {display: block;}[part="list"] {--listbox-max-block-size: var(
2
+ export const styles = createSheet(`:host {display: block;}[part="label"] {color: var(--helix-color-foreground);display: block;font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);font-weight: var(--helix-weight-medium);line-height: var(--helix-leading-tight);padding-block-end: var(--helix-space-2xs);}[part="list"] {--listbox-max-block-size: var(
3
3
  --time-picker-list-block-size,
4
4
  calc(var(--helix-size-control-tight) * 7)
5
5
  );display: block;}[part="list"]::part(items) {background-color: transparent;border: none;border-radius: var(--helix-radii-none);padding-block: var(--helix-space-none);}:host([mode="range"]) [part~="option"]:state(selected)::part(item) {background-color: var(--helix-color-surface-inverse);color: var(--helix-color-foreground-inverse);}[part~="option"][data-between]::part(item) {background-color: var(
@@ -20,4 +20,4 @@ var(--time-picker-invalid-color, var(--helix-color-danger));outline-offset: var(
20
20
  :host([invalid]) [part="columns"][data-unset],
21
21
  :host(:state(invalid)) [part="list"][data-unset],
22
22
  :host(:state(invalid)) [part="columns"][data-unset] {border-radius: var(--helix-radii-sm);outline: var(--helix-size-focus-ring) solid
23
- var(--time-picker-invalid-color, var(--helix-color-danger));outline-offset: var(--helix-size-focus-offset);}[part="feedback"] {color: var(--time-picker-feedback-color, var(--helix-color-danger));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);margin: var(--helix-space-sm) var(--helix-space-none) var(--helix-space-none);}@media print {:host {print-color-adjust: exact;}}`);
23
+ var(--time-picker-invalid-color, var(--helix-color-danger));outline-offset: var(--helix-size-focus-offset);}[part="hint"] {color: var(--helix-color-foreground-subtle);font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);margin: var(--helix-space-sm) var(--helix-space-none) var(--helix-space-none);}[part="feedback"] {color: var(--time-picker-feedback-color, var(--helix-color-danger));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);margin: var(--helix-space-sm) var(--helix-space-none) var(--helix-space-none);}@media print {:host {print-color-adjust: exact;}}`);
@@ -1,8 +1,8 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {column-gap: var(--helix-space-md);display: grid;grid-template-columns: var(--_timeline-columns, auto minmax(0, 1fr));grid-template-rows: var(--_timeline-rows, auto minmax(0, 1fr));}[part="rail"] {align-items: var(--_timeline-rail-align, normal);display: grid;grid-column: var(--_timeline-rail-column, auto);grid-row: var(--_timeline-rail-row, 1 / -1);grid-template-columns: var(--_timeline-rail-columns, none);grid-template-rows: var(--_timeline-rail-rows, subgrid);justify-items: var(--_timeline-rail-justify, center);}[part="rail"]::before {background-color: var(--helix-color-border);block-size: 100%;content: "";display: var(--_timeline-arrive-display, block);grid-column: 1;grid-row: 1;inline-size: var(--timeline-rail-size, var(--helix-border-thin));}:host(:first-child) [part="rail"]::before {visibility: hidden;}[part="rail"]::after {align-self: var(--_timeline-leave-align, stretch);background-color: var(--helix-color-border);block-size: var(--_timeline-leave-block-size, auto);content: "";grid-column: var(--_timeline-leave-column, 1);grid-row: var(--_timeline-leave-row, 2);inline-size: var(
2
+ export const styles = createSheet(`:host {column-gap: var(--timeline-column-gap, var(--helix-space-md));display: grid;grid-template-columns: var(--_timeline-columns, auto minmax(0, 1fr));grid-template-rows: var(--_timeline-rows, auto minmax(0, 1fr));}[part="rail"] {align-items: var(--_timeline-rail-align, normal);display: grid;grid-column: var(--_timeline-rail-column, auto);grid-row: var(--_timeline-rail-row, 1 / -1);grid-template-columns: var(--_timeline-rail-columns, none);grid-template-rows: var(--_timeline-rail-rows, subgrid);justify-items: var(--_timeline-rail-justify, center);}[part="rail"]::before {background-color: var(--timeline-rail-color, var(--helix-color-border));block-size: 100%;content: "";display: var(--_timeline-arrive-display, block);grid-column: 1;grid-row: 1;inline-size: var(--timeline-rail-size, var(--helix-border-thin));}:host(:first-child) [part="rail"]::before {visibility: hidden;}[part="rail"]::after {align-self: var(--_timeline-leave-align, stretch);background-color: var(--timeline-rail-color, var(--helix-color-border));block-size: var(--_timeline-leave-block-size, auto);content: "";grid-column: var(--_timeline-leave-column, 1);grid-row: var(--_timeline-leave-row, 2);inline-size: var(
3
3
  --_timeline-leave-inline-size,
4
4
  var(--timeline-rail-size, var(--helix-border-thin))
5
5
  );justify-self: var(--_timeline-leave-justify, auto);margin-block-start: var(
6
6
  --_timeline-leave-margin-block,
7
7
  var(--timeline-marker-size, var(--helix-size-icon-md))
8
- );}:host(:last-child) [part="rail"]::after {visibility: hidden;}[part="marker"] {--icon-size: var(--helix-size-icon-sm);align-items: center;align-self: start;aspect-ratio: 1;border-radius: var(--timeline-marker-radius, var(--helix-radii-full));color: var(--_timeline-tone, var(--helix-color-foreground-subtle));display: inline-flex;grid-column: 1;grid-row: var(--_timeline-marker-row, 2);inline-size: var(--timeline-marker-size, var(--helix-size-icon-md));justify-content: center;}[part="dot"] {block-size: var(--helix-size-icon-sm);inline-size: var(--helix-size-icon-sm);}:host([tone="danger"]) {--_timeline-tone: var(--helix-color-danger);}:host([tone="info"]) {--_timeline-tone: var(--helix-color-info);}:host([tone="neutral"]) {--_timeline-tone: var(--helix-color-foreground-muted);}:host([tone="primary"]) {--_timeline-tone: var(--helix-color-primary);}:host([tone="success"]) {--_timeline-tone: var(--helix-color-success);}:host([tone="warning"]) {--_timeline-tone: var(--helix-color-warning);}[part="time"] {color: var(--helix-color-foreground-muted);font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);grid-column: var(--_timeline-time-column, 2);grid-row: var(--_timeline-time-row, 1);padding-block-end: var(--helix-space-2xs);text-align: var(--_timeline-time-align);}[part="content"] {display: flex;flex-direction: column;gap: var(--helix-space-2xs);grid-column: var(--_timeline-content-column, 2);grid-row: var(--_timeline-content-row, 2);min-inline-size: 0;padding-block-end: var(--_timeline-content-block-end, var(--timeline-gap, var(--helix-space-lg)));padding-inline-end: var(--_timeline-content-inline-end, var(--helix-space-none));}:host(:last-child) [part="content"] {padding-block-end: var(--helix-space-none);padding-inline-end: var(--helix-space-none);}:host(:nth-child(even)) [part="time"] {grid-column: var(--_timeline-even-column, var(--_timeline-time-column, 2));text-align: var(--_timeline-even-align, var(--_timeline-time-align));}:host(:nth-child(even)) [part="content"] {grid-column: var(--_timeline-even-column, var(--_timeline-content-column, 2));text-align: var(--_timeline-even-align);}`);
8
+ );}:host(:last-child) [part="rail"]::after {visibility: hidden;}[part="marker"] {--icon-size: var(--helix-size-icon-sm);align-items: center;align-self: start;aspect-ratio: 1;border-radius: var(--timeline-marker-radius, var(--helix-radii-full));color: var(--_timeline-tone, var(--timeline-marker-color, var(--helix-color-foreground-subtle)));display: inline-flex;grid-column: 1;grid-row: var(--_timeline-marker-row, 2);inline-size: var(--timeline-marker-size, var(--helix-size-icon-md));justify-content: center;}[part="dot"] {block-size: var(--helix-size-icon-sm);inline-size: var(--helix-size-icon-sm);}:host([tone="danger"]) {--_timeline-tone: var(--helix-color-danger);}:host([tone="info"]) {--_timeline-tone: var(--helix-color-info);}:host([tone="neutral"]) {--_timeline-tone: var(--helix-color-foreground-muted);}:host([tone="primary"]) {--_timeline-tone: var(--helix-color-primary);}:host([tone="success"]) {--_timeline-tone: var(--helix-color-success);}:host([tone="warning"]) {--_timeline-tone: var(--helix-color-warning);}[part="time"] {color: var(--timeline-time-color, var(--helix-color-foreground-muted));font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);grid-column: var(--_timeline-time-column, 2);grid-row: var(--_timeline-time-row, 1);padding-block-end: var(--helix-space-2xs);text-align: var(--_timeline-time-align);}[part="content"] {display: flex;flex-direction: column;gap: var(--helix-space-2xs);grid-column: var(--_timeline-content-column, 2);grid-row: var(--_timeline-content-row, 2);min-inline-size: 0;padding-block-end: var(--_timeline-content-block-end, var(--timeline-gap, var(--helix-space-lg)));padding-inline-end: var(--_timeline-content-inline-end, var(--helix-space-none));}:host(:last-child) [part="content"] {padding-block-end: var(--helix-space-none);padding-inline-end: var(--helix-space-none);}:host(:nth-child(even)) [part="time"] {grid-column: var(--_timeline-even-column, var(--_timeline-time-column, 2));text-align: var(--_timeline-even-align, var(--_timeline-time-align));}:host(:nth-child(even)) [part="content"] {grid-column: var(--_timeline-even-column, var(--_timeline-content-column, 2));text-align: var(--_timeline-even-align);}`);
@@ -13,9 +13,13 @@ import type { CSSResultGroup } from 'lit';
13
13
  * @aliases Activity item, History entry, Event
14
14
  * @documentation https://fusion.dev/helix/components/timeline
15
15
  *
16
+ * @cssproperty --timeline-column-gap - Space between the rail and the time and what happened.
17
+ * @cssproperty --timeline-marker-color - The color of the mark on an entry with no `tone`. A `tone` colors the mark itself.
16
18
  * @cssproperty --timeline-marker-radius - How round the mark is. Zero is a square, and half its size is a disc.
17
19
  * @cssproperty --timeline-marker-size - Edge length of the mark.
20
+ * @cssproperty --timeline-rail-color - The color of the line.
18
21
  * @cssproperty --timeline-rail-size - Width of the line.
22
+ * @cssproperty --timeline-time-color - The color of the time.
19
23
  */
20
24
  export declare class HelixTimelineItem extends HelixHeadlessTimelineItem {
21
25
  static styles: CSSResultGroup;
@@ -20,6 +20,10 @@ import type { CSSResultGroup } from 'lit';
20
20
  * side by side in the order they are read, and the time over what happened
21
21
  * under each mark. Use it for a few entries, since they share the width.
22
22
  *
23
+ * An entry's custom properties, such as `--timeline-rail-color` and
24
+ * `--timeline-marker-size`, inherit, so setting them on the timeline changes
25
+ * every entry in it.
26
+ *
23
27
  * @since 0.1.0
24
28
  * @status stable
25
29
  * @category data
@@ -6,9 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessVideoPlaylist } from '@fusion.dev/helix-headless/video-playlist';
9
+ import { styles as liveStyles } from '../../shared/live/live.css.js';
9
10
  import { styles } from './video-playlist-root.css.js';
10
11
  let HelixVideoPlaylist = class HelixVideoPlaylist extends HelixHeadlessVideoPlaylist {
11
- static { this.styles = styles; }
12
+ static { this.styles = [liveStyles, styles]; }
12
13
  };
13
14
  HelixVideoPlaylist = __decorate([
14
15
  customElement('helix-video-playlist')
@@ -7,5 +7,5 @@ var(--helix-scrollbar-thumb-hover-color)
7
7
  var(--virtual-list-scrollbar-track-color, var(--helix-scrollbar-track-color));}::slotted([data-index]:focus-visible) {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}::slotted([aria-selected="true"]) {background-color: var(
8
8
  --virtual-list-selected-background-color,
9
9
  var(--helix-color-primary-subtle)
10
- );}[part="empty"] {color: var(--virtual-list-empty-color, var(--helix-color-foreground-muted));font-size: var(--helix-text-sm);padding: var(--virtual-list-empty-padding, var(--helix-space-md));text-align: center;}[part="loading"] {color: var(--virtual-list-loading-color, var(--helix-color-foreground-muted));font-size: var(--helix-text-sm);padding: var(--virtual-list-loading-padding, var(--helix-space-sm));text-align: center;}[part="after"],
10
+ );color: var(--virtual-list-selected-color, inherit);}[part="empty"] {color: var(--virtual-list-empty-color, var(--helix-color-foreground-muted));font-size: var(--helix-text-sm);padding: var(--virtual-list-empty-padding, var(--helix-space-md));text-align: center;}[part="loading"] {color: var(--virtual-list-loading-color, var(--helix-color-foreground-muted));font-size: var(--helix-text-sm);padding: var(--virtual-list-loading-padding, var(--helix-space-sm));text-align: center;}[part="after"],
11
11
  [part="before"] {flex: none;}@media print {:host {overflow: visible;}}`);