@fusion.dev/helix 0.147.0 → 0.148.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +4297 -489
- package/dist/announcement/root/announcement-root.css.js +1 -1
- package/dist/blockquote/root/blockquote-root.css.js +1 -1
- package/dist/blockquote/root/blockquote-root.d.ts +8 -2
- package/dist/button-group/root/button-group-root.css.js +10 -1
- package/dist/button-group/root/button-group-root.d.ts +29 -7
- package/dist/button-group/root/button-group-root.js +19 -0
- package/dist/canvas/node/canvas-node.css.js +6 -6
- package/dist/canvas/node/canvas-node.d.ts +5 -0
- package/dist/canvas/root/canvas-root.css.js +6 -2
- package/dist/canvas/root/canvas-root.d.ts +6 -0
- package/dist/card/root/card-root.css.js +3 -3
- package/dist/card/root/card-root.d.ts +4 -0
- package/dist/code-block/root/code-block-root.css.js +17 -9
- package/dist/code-block/root/code-block-root.d.ts +7 -0
- package/dist/combobox/root/combobox-root.js +2 -0
- package/dist/description-list/item/description-list-item.css.js +1 -1
- package/dist/description-list/item/description-list-item.d.ts +1 -0
- package/dist/description-list/root/description-list-root.css.js +2 -1
- package/dist/description-list/root/description-list-root.d.ts +12 -0
- package/dist/description-list/root/description-list-root.js +7 -0
- package/dist/divider/root/divider-root.css.js +3 -4
- package/dist/divider/root/divider-root.d.ts +3 -0
- package/dist/element-events.generated.js +1 -0
- package/dist/format-date/root/format-date-root.css.js +1 -1
- package/dist/format-date/root/format-date-root.d.ts +0 -1
- package/dist/format-date/root/format-date-root.js +0 -1
- package/dist/listbox/root/listbox-root.css.js +4 -1
- package/dist/listbox/root/listbox-root.d.ts +2 -0
- package/dist/listbox/root/listbox-root.js +1 -0
- package/dist/map/root/map-root.css.js +10 -6
- package/dist/map/root/map-root.d.ts +10 -0
- package/dist/notifications/root/notifications-root.css.js +1 -1
- package/dist/notifications/root/notifications-root.d.ts +4 -1
- package/dist/pagination/root/pagination-root.css.js +7 -7
- package/dist/pagination/root/pagination-root.d.ts +14 -0
- package/dist/pagination/size/pagination-size.css.js +1 -1
- package/dist/pagination/size/pagination-size.d.ts +3 -0
- package/dist/pagination/summary/pagination-summary.css.js +1 -1
- package/dist/pagination/summary/pagination-summary.d.ts +3 -0
- package/dist/qr-code/root/qr-code-root.css.js +1 -1
- package/dist/qr-code/root/qr-code-root.d.ts +3 -0
- package/dist/sandbox/preview/sandbox-preview.d.ts +9 -1
- package/dist/sandbox/preview/sandbox-preview.js +1 -1
- package/dist/select/root/select-root.css.js +4 -1
- package/dist/select/root/select-root.js +2 -0
- package/dist/shared/viewport/viewport.css.js +1 -1
- package/dist/speed-dial/group/speed-dial-group.css.d.ts +1 -0
- package/dist/speed-dial/group/speed-dial-group.css.js +2 -0
- package/dist/speed-dial/group/speed-dial-group.d.ts +27 -0
- package/dist/speed-dial/group/speed-dial-group.js +16 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +1 -0
- package/dist/speed-dial/item/speed-dial-item.css.js +1 -1
- package/dist/speed-dial/item/speed-dial-item.d.ts +1 -0
- package/dist/speed-dial/root/speed-dial-root.css.js +1 -1
- package/dist/splitter/root/splitter-root.css.js +15 -7
- package/dist/splitter/root/splitter-root.d.ts +4 -0
- package/dist/table/cell/table-cell.css.js +1 -1
- package/dist/table/root/table-root.css.js +1 -1
- package/dist/table/row/table-row.css.js +1 -1
- package/dist/time-picker/root/time-picker-root.css.js +9 -4
- package/dist/time-picker/root/time-picker-root.d.ts +6 -0
- package/dist/toast/item/toast-item.css.js +9 -6
- package/dist/toast/item/toast-item.d.ts +10 -0
- package/dist/toolbar/root/toolbar-root.css.js +1 -1
- package/dist/toolbar/root/toolbar-root.d.ts +9 -0
- package/dist/toolbar/root/toolbar-root.js +4 -0
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +1809 -176
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +505 -44
|
@@ -18,4 +18,4 @@ var(--_announcement-tint) 40%,
|
|
|
18
18
|
var(--_announcement-ground)
|
|
19
19
|
);}[part="content"] {flex: 1 1 auto;min-inline-size: 0;text-align: var(--announcement-text-align, center);}:host([dismissible]) [part="content"] {padding-inline: calc(var(--helix-size-icon) + var(--helix-space-2xs) * 2 + var(--helix-space-xs));}[part="actions"] slot::slotted(*) {margin-inline-start: var(--helix-space-md);}[part="actions"] {align-items: center;display: flex;flex: 0 0 auto;gap: var(--helix-space-xs);}[part="dismiss"] {all: unset;box-sizing: border-box;block-size: calc(var(--helix-size-icon) + var(--helix-space-2xs) * 2);inline-size: calc(var(--helix-size-icon) + var(--helix-space-2xs) * 2);border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground-muted);cursor: pointer;display: inline-flex;flex: 0 0 auto;place-content: center;place-items: center;position: absolute;inset-inline-end: var(--announcement-inset, var(--helix-space-lg));transition:
|
|
20
20
|
background-color var(--helix-duration-fast) var(--helix-easing-standard),
|
|
21
|
-
color var(--helix-duration-fast) var(--helix-easing-standard);}[part="dismiss"]:hover {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);color: var(--helix-color-foreground);}[part="dismiss"] svg {block-size: var(--helix-size-icon);inline-size: var(--helix-size-icon);}[part="dismiss"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="actions"][data-empty] {display: none;}@media print {:host {background-color: transparent;}}`);
|
|
21
|
+
color var(--helix-duration-fast) var(--helix-easing-standard);}[part="dismiss"]:hover {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);color: var(--helix-color-foreground);}[part="dismiss"] svg {block-size: var(--helix-size-icon);inline-size: var(--helix-size-icon);}[part="dismiss"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="actions"][data-empty] {display: none;}:host(:state(waiting)) {display: none;}@media print {:host {background-color: transparent;}}`);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {display: block;}[part="figure"] {margin: var(--helix-space-none);}[part="blockquote"] {display: block;margin: var(--helix-space-none);}slot:not([name]) {color: var(--blockquote-color, var(--helix-color-foreground-muted));font-family: var(--blockquote-font-family, var(--helix-font-display));font-size: var(--blockquote-size, var(--helix-text-xl));font-weight: var(--blockquote-font-weight, var(--helix-weight-medium));letter-spacing: var(--helix-tracking-tight);line-height: var(--blockquote-line-height, var(--helix-leading-tight));}slot:not([name])::slotted(*) {margin: var(--helix-space-none);}[part="attribution"] {color: var(--blockquote-attribution-color, var(--helix-color-foreground-muted));font-size: var(--blockquote-attribution-size, var(--helix-text-sm));margin-block-start: var(--blockquote-gap, var(--helix-space-sm));}[part="attribution"][data-empty] {display: none;}@media print {:host {print-color-adjust: economy;}}`);
|
|
2
|
+
export const styles = createSheet(`:host {display: block;}[part="figure"] {margin: var(--helix-space-none);}[part="blockquote"] {display: block;margin: var(--helix-space-none);}:host([marks]) [part="blockquote"]::before {color: var(--blockquote-mark-color, var(--helix-color-foreground-subtle));content: open-quote / "";float: inline-start;font-family: var(--blockquote-font-family, var(--helix-font-display));font-size: var(--blockquote-mark-size, var(--helix-text-3xl));line-height: 1;margin-inline-end: var(--helix-space-xs);}:host([marks]) [part="blockquote"]::after {content: no-close-quote;}slot:not([name]) {color: var(--blockquote-color, var(--helix-color-foreground-muted));font-family: var(--blockquote-font-family, var(--helix-font-display));font-size: var(--blockquote-size, var(--helix-text-xl));font-weight: var(--blockquote-font-weight, var(--helix-weight-medium));letter-spacing: var(--blockquote-letter-spacing, var(--helix-tracking-tight));line-height: var(--blockquote-line-height, var(--helix-leading-tight));}slot:not([name])::slotted(*) {margin: var(--helix-space-none);}[part="attribution"] {color: var(--blockquote-attribution-color, var(--helix-color-foreground-muted));font-family: var(--blockquote-attribution-font-family, inherit);font-size: var(--blockquote-attribution-size, var(--helix-text-sm));font-weight: var(--blockquote-attribution-font-weight, inherit);margin-block-start: var(--blockquote-gap, var(--helix-space-sm));}[part="attribution"][data-empty] {display: none;}@media print {:host {print-color-adjust: economy;}}`);
|
|
@@ -5,8 +5,9 @@ import type { CSSResultGroup } from 'lit';
|
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
7
|
* Set in the display face, larger than body text, to mark a change of voice. No
|
|
8
|
-
* quotation marks are drawn, because the size and spacing already
|
|
9
|
-
* passage apart.
|
|
8
|
+
* quotation marks are drawn by default, because the size and spacing already
|
|
9
|
+
* set the passage apart. `marks` draws one large opening mark over the passage,
|
|
10
|
+
* as a pull quote sets it, in the element's language.
|
|
10
11
|
*
|
|
11
12
|
* @since 0.1.0
|
|
12
13
|
* @status stable
|
|
@@ -15,12 +16,17 @@ import type { CSSResultGroup } from 'lit';
|
|
|
15
16
|
* @documentation https://fusion.dev/helix/components/blockquote
|
|
16
17
|
*
|
|
17
18
|
* @cssproperty --blockquote-attribution-color - The color of the attribution.
|
|
19
|
+
* @cssproperty --blockquote-attribution-font-family - The typeface of the attribution, the page's by default.
|
|
20
|
+
* @cssproperty --blockquote-attribution-font-weight - The weight of the attribution, the page's by default.
|
|
18
21
|
* @cssproperty --blockquote-attribution-size - The font size of the attribution.
|
|
19
22
|
* @cssproperty --blockquote-color - The color of the quoted passage.
|
|
20
23
|
* @cssproperty --blockquote-font-family - The typeface of the quoted passage, the display face by default.
|
|
21
24
|
* @cssproperty --blockquote-font-weight - The weight of the quoted passage, medium by default.
|
|
22
25
|
* @cssproperty --blockquote-gap - The space between the passage and its attribution.
|
|
26
|
+
* @cssproperty --blockquote-letter-spacing - The letter spacing of the quoted passage, the tight tracking by default.
|
|
23
27
|
* @cssproperty --blockquote-line-height - The line height of the quoted passage, the tight leading by default.
|
|
28
|
+
* @cssproperty --blockquote-mark-color - The color of the mark `marks` draws, the subtle foreground by default.
|
|
29
|
+
* @cssproperty --blockquote-mark-size - The font size of the mark `marks` draws.
|
|
24
30
|
* @cssproperty --blockquote-size - The font size of the quoted passage.
|
|
25
31
|
*/
|
|
26
32
|
export declare class HelixBlockquote extends HelixHeadlessBlockquote {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {display: inline-flex;}:host(
|
|
2
|
+
export const styles = createSheet(`:host {display: inline-flex;}:host([size="sm"]) {--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-control: var(--helix-size-control-sm);--helix-size-icon: var(--helix-size-icon-sm);--helix-space-control: var(--helix-space-sm);--helix-text-control: var(--helix-text-xs);}:host([size="md"]) {--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-control: var(--helix-size-control-md);--helix-size-icon: var(--helix-size-icon-md);--helix-space-control: var(--helix-space-md);--helix-text-control: var(--helix-text-sm);}:host([size="lg"]) {--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-control: var(--helix-size-control-lg);--helix-size-icon: var(--helix-size-icon-lg);--helix-space-control: var(--helix-space-lg);--helix-text-control: var(--helix-text-md);}:host([size]) ::slotted(button) {block-size: var(--helix-size-control);font-size: var(--helix-text-control);}:host([selection-mode]) {--_button-group-pressed-background: var(
|
|
3
|
+
--button-group-pressed-background-color,
|
|
4
|
+
var(--helix-color-foreground)
|
|
5
|
+
);--_button-group-pressed-border: var(
|
|
6
|
+
--button-group-pressed-border-color,
|
|
7
|
+
var(--_button-group-pressed-background)
|
|
8
|
+
);--_button-group-pressed-foreground: var(
|
|
9
|
+
--button-group-pressed-color,
|
|
10
|
+
var(--helix-color-background)
|
|
11
|
+
);}:host(:not([variant="spaced"])) ::slotted(*:not(:first-child)) {margin-inline-start: calc(var(--helix-border-thin) * -1);}:host(:not([variant="spaced"])) ::slotted(*:not(:first-child)) {--button-radius-start: 0;}:host(:not([variant="spaced"])) ::slotted(*:not(:last-child)) {--button-radius-end: 0;}:host([orientation="vertical"]) {align-items: stretch;flex-direction: column;}:host([orientation="vertical"]:not([variant="spaced"])) ::slotted(*:not(:first-child)) {--button-radius-start-start: 0;--button-radius-start-end: 0;--button-radius-start: var(--button-radius, var(--helix-radii-sm));margin-block-start: calc(var(--helix-border-thin) * -1);margin-inline-start: 0;}:host([orientation="vertical"]:not([variant="spaced"])) ::slotted(*:not(:last-child)) {--button-radius-end-end: 0;--button-radius-end-start: 0;--button-radius-end: var(--button-radius, var(--helix-radii-sm));}::slotted(*:hover),
|
|
3
12
|
::slotted(*:focus-within) {position: relative;z-index: var(--helix-layer-raised);}:host([variant="spaced"]) {gap: var(--button-group-gap, var(--helix-space-xs));}@media print {:host {display: none;}}`);
|
|
@@ -7,26 +7,42 @@ import type { CSSResultGroup } from 'lit';
|
|
|
7
7
|
* Joins the buttons into one shape: the outer corners keep their radius, the
|
|
8
8
|
* inner corners lose it, and adjacent borders collapse into one line.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* A Helix button's corners are on the control inside its shadow root, where
|
|
11
|
+
* this component's styles cannot reach, so the group flattens them through the
|
|
12
|
+
* button's own `--button-radius-*` hooks. A native `<button>` and your own
|
|
13
|
+
* anchor styled with `data-button` join through rules in the base layer,
|
|
14
|
+
* because a page rule setting their radius would beat any rule in here.
|
|
14
15
|
*
|
|
15
|
-
* The buttons take their height from the region, so
|
|
16
|
-
*
|
|
16
|
+
* The buttons take their height from the region, so `size` makes every
|
|
17
|
+
* button in the group smaller or larger together, as `data-density` on the
|
|
18
|
+
* group does, and a button's own size still wins. A native `<button>` in a
|
|
19
|
+
* sized group takes the height and the text size.
|
|
20
|
+
*
|
|
21
|
+
* With `selection-mode`, a pressed button takes the solid fill:
|
|
22
|
+
* `--button-group-pressed-background-color` behind it and
|
|
23
|
+
* `--button-group-pressed-color` for its words, set on the group or above it.
|
|
17
24
|
*
|
|
18
25
|
* @since 0.1.0
|
|
19
26
|
* @status stable
|
|
20
27
|
* @category actions
|
|
21
|
-
* @aliases Segmented buttons, Split button
|
|
28
|
+
* @aliases Segmented buttons, Split button, Toggle buttons
|
|
22
29
|
* @documentation https://fusion.dev/helix/components/button-group
|
|
23
30
|
*
|
|
24
31
|
* @slot - The buttons in the group.
|
|
25
32
|
*
|
|
26
33
|
* @cssproperty --button-group-gap - Space between the buttons, when `spaced`.
|
|
34
|
+
* @cssproperty --button-group-pressed-background-color - Fill behind a pressed button, in a selection mode. Defaults to the foreground color.
|
|
35
|
+
* @cssproperty --button-group-pressed-border-color - Edge of a pressed button, in a selection mode. Defaults to its fill.
|
|
36
|
+
* @cssproperty --button-group-pressed-color - Words and icons of a pressed button, in a selection mode. Defaults to the background color.
|
|
27
37
|
*/
|
|
28
38
|
export declare class HelixButtonGroup extends HelixHeadlessButtonGroup {
|
|
29
39
|
static styles: CSSResultGroup;
|
|
40
|
+
/**
|
|
41
|
+
* The size of every button in the group: their height, text, padding and
|
|
42
|
+
* icons, from the density steps. Unset, the buttons take the size of the
|
|
43
|
+
* region around the group.
|
|
44
|
+
*/
|
|
45
|
+
size?: 'sm' | 'md' | 'lg';
|
|
30
46
|
/**
|
|
31
47
|
* Whether the buttons are one bar or a spaced row.
|
|
32
48
|
*
|
|
@@ -39,6 +55,12 @@ export declare class HelixButtonGroup extends HelixHeadlessButtonGroup {
|
|
|
39
55
|
* `helix-flex` gives the spacing without the group.
|
|
40
56
|
*/
|
|
41
57
|
variant?: 'joined' | 'spaced';
|
|
58
|
+
/**
|
|
59
|
+
* Draws a pressed button as well as saying so. On the control inside the
|
|
60
|
+
* button, the only element that knows, and in the button's own hooks, so
|
|
61
|
+
* hover and the focus ring stay the button's.
|
|
62
|
+
*/
|
|
63
|
+
protected markPressed(control: HTMLElement, pressed: boolean | undefined): void;
|
|
42
64
|
}
|
|
43
65
|
declare global {
|
|
44
66
|
interface HTMLElementTagNameMap {
|
|
@@ -8,9 +8,28 @@ import { customElement } from '@fusion.dev/helix-core';
|
|
|
8
8
|
import { HelixHeadlessButtonGroup } from '@fusion.dev/helix-headless/button-group';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { styles } from './button-group-root.css.js';
|
|
11
|
+
const PRESSED = [
|
|
12
|
+
['--button-background-color', 'var(--_button-group-pressed-background)'],
|
|
13
|
+
['--button-border-color', 'var(--_button-group-pressed-border)'],
|
|
14
|
+
['--button-foreground-color', 'var(--_button-group-pressed-foreground)'],
|
|
15
|
+
];
|
|
11
16
|
let HelixButtonGroup = class HelixButtonGroup extends HelixHeadlessButtonGroup {
|
|
12
17
|
static { this.styles = styles; }
|
|
18
|
+
markPressed(control, pressed) {
|
|
19
|
+
super.markPressed(control, pressed);
|
|
20
|
+
for (const [hook, value] of PRESSED) {
|
|
21
|
+
if (pressed === true) {
|
|
22
|
+
control.style.setProperty(hook, value);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
control.style.removeProperty(hook);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
13
29
|
};
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ reflect: true })
|
|
32
|
+
], HelixButtonGroup.prototype, "size", void 0);
|
|
14
33
|
__decorate([
|
|
15
34
|
property({ reflect: true })
|
|
16
35
|
], HelixButtonGroup.prototype, "variant", void 0);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {--_canvas-card-x: 0px;--_canvas-card-y: 0px;--_canvas-card-inline-size: auto;--_canvas-card-block-size: auto;--_heading-ink: var(--helix-color-foreground);--_canvas-card-tone: var(--helix-color-border);--_canvas-card-color: var(--canvas-node-color, var(--_canvas-card-tone));--_canvas-handle-color: var(--_canvas-card-color);background-color: var(--canvas-node-background-color, var(--helix-color-surface));block-size: var(--_canvas-card-block-size);box-shadow: var(--canvas-node-shadow, none);border: var(--helix-border-thin) solid var(--_canvas-card-color);border-radius: var(--helix-radii-sm);box-sizing: border-box;color: var(--helix-color-foreground);display: block;font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);inline-size: var(--_canvas-card-inline-size);left: var(--_canvas-card-x);top: var(--_canvas-card-y);overflow: visible;position: absolute;z-index: 1;}:host([group]) {background-color: color-mix(in oklab, var(--helix-color-foreground) 4%, transparent);border-style: dashed;overflow: visible;z-index: 0;}:host([tone="accent"]) {--_canvas-card-tone: var(--helix-color-accent);}:host([tone="danger"]) {--_canvas-card-tone: var(--helix-color-danger);}:host([tone="info"]) {--_canvas-card-tone: var(--helix-color-info);}:host([tone="primary"]) {--_canvas-card-tone: var(--helix-color-primary);}:host([tone="success"]) {--_canvas-card-tone: var(--helix-color-success);}:host([tone="warning"]) {--_canvas-card-tone: var(--helix-color-warning);}:host(:not([tone])),
|
|
3
|
-
:host([tone="neutral"]) {--_canvas-handle-color: var(--canvas-node-color, var(--helix-color-foreground-muted));}:host(:state(selected)),
|
|
4
|
-
:host(:state(target)) {--_canvas-handle-color: var(--helix-color-accent);}:host([separation="filled"]:not([group])) {background-color: color-mix(in oklab, var(--_canvas-card-color) 16%, var(--helix-color-surface));border-color: transparent;}:host([separation="elevated"]:not([group])) {--canvas-node-shadow: var(--helix-shadow-md);}:host([separation="plain"]:not([group])) {background-color: transparent;border-color: transparent;}:host([material="glass"]:not([group])) {backdrop-filter: var(--helix-material-backdrop);background-color: var(--helix-material-translucent);}:host([material="frosted"]:not([group])) {backdrop-filter: blur(var(--helix-material-blur-lg));background-color: var(--helix-material-translucent-strong);}:host([material="transparent"]:not([group])) {backdrop-filter: none;background-color: transparent;}[part="node"] {block-size: 100%;border-radius: inherit;box-sizing: border-box;display: flex;flex-direction: column;gap: var(--helix-space-2xs);justify-content: center;overflow: hidden;padding: var(--canvas-node-padding, var(--helix-space-sm));}[part="node"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}:host([group]) [part="node"]::before {color: var(--helix-color-foreground-muted);content: attr(aria-label);font-size: var(--helix-text-xs);inset-block-end: 100%;inset-inline-start: 0;padding-block-end: var(--helix-space-2xs);position: absolute;}:host([group]) [part="node"] {display: block;overflow: visible;position: relative;}[part~="handle"] {background-color: var(--helix-color-surface);block-size: var(--canvas-handle-size, 0.625rem);border: var(--helix-border-thick) solid var(--_canvas-handle-color);border-radius: var(--helix-radii-full);box-sizing: border-box;cursor: crosshair;inline-size: var(--canvas-handle-size, 0.625rem);opacity: 0;position: absolute;transform: translate(-50%, -50%);transition: opacity var(--helix-duration-fast) var(--helix-easing-standard);}[part~="handle"]::after {content: "";inset: calc(var(--helix-space-sm) * -1);position: absolute;}:host(:hover) [part~="handle"],
|
|
2
|
+
export const styles = createSheet(`:host {--_canvas-card-x: 0px;--_canvas-card-y: 0px;--_canvas-card-inline-size: auto;--_canvas-card-block-size: auto;--_heading-ink: var(--helix-color-foreground);--_canvas-card-tone: var(--helix-color-border);--_canvas-card-color: var(--canvas-node-color, var(--_canvas-card-tone));--_canvas-handle-color: var(--_canvas-card-color);background-color: var(--canvas-node-background-color, var(--helix-color-surface));block-size: var(--_canvas-card-block-size);box-shadow: var(--canvas-node-shadow, none);border: var(--helix-border-thin) solid var(--_canvas-card-color);border-radius: var(--canvas-node-radius, var(--helix-radii-sm));box-sizing: border-box;color: var(--helix-color-foreground);display: block;font-family: var(--helix-font-sans);font-size: var(--canvas-node-font-size, var(--helix-text-sm));inline-size: var(--_canvas-card-inline-size);left: var(--_canvas-card-x);top: var(--_canvas-card-y);overflow: visible;position: absolute;z-index: 1;}:host([group]) {background-color: color-mix(in oklab, var(--helix-color-foreground) 4%, transparent);border-style: dashed;overflow: visible;z-index: 0;}:host([tone="accent"]) {--_canvas-card-tone: var(--helix-color-accent);}:host([tone="danger"]) {--_canvas-card-tone: var(--helix-color-danger);}:host([tone="info"]) {--_canvas-card-tone: var(--helix-color-info);}:host([tone="primary"]) {--_canvas-card-tone: var(--helix-color-primary);}:host([tone="success"]) {--_canvas-card-tone: var(--helix-color-success);}:host([tone="warning"]) {--_canvas-card-tone: var(--helix-color-warning);}:host(:not([tone])),
|
|
3
|
+
:host([tone="neutral"]) {--_canvas-handle-color: var(--canvas-node-color, var(--helix-color-foreground-muted));}:host(:state(selected)) {--_canvas-handle-color: var(--canvas-selected-color, var(--helix-color-accent));}:host(:state(target)) {--_canvas-handle-color: var(--canvas-connect-color, var(--helix-color-accent));}:host([separation="filled"]:not([group])) {background-color: color-mix(in oklab, var(--_canvas-card-color) 16%, var(--helix-color-surface));border-color: transparent;}:host([separation="elevated"]:not([group])) {--canvas-node-shadow: var(--helix-shadow-md);}:host([separation="plain"]:not([group])) {background-color: transparent;border-color: transparent;}:host([material="glass"]:not([group])) {backdrop-filter: var(--helix-material-backdrop);background-color: var(--helix-material-translucent);}:host([material="frosted"]:not([group])) {backdrop-filter: blur(var(--helix-material-blur-lg));background-color: var(--helix-material-translucent-strong);}:host([material="transparent"]:not([group])) {backdrop-filter: none;background-color: transparent;}[part="node"] {block-size: 100%;border-radius: inherit;box-sizing: border-box;display: flex;flex-direction: column;gap: var(--helix-space-2xs);justify-content: center;overflow: hidden;padding: var(--canvas-node-padding, var(--helix-space-sm));}[part="node"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}:host([group]) [part="node"]::before {color: var(--helix-color-foreground-muted);content: attr(aria-label);font-size: var(--helix-text-xs);inset-block-end: 100%;inset-inline-start: 0;padding-block-end: var(--helix-space-2xs);position: absolute;}:host([group]) [part="node"] {display: block;overflow: visible;position: relative;}[part~="handle"] {background-color: var(--helix-color-surface);block-size: var(--canvas-handle-size, 0.625rem);border: var(--helix-border-thick) solid var(--_canvas-handle-color);border-radius: var(--helix-radii-full);box-sizing: border-box;cursor: crosshair;inline-size: var(--canvas-handle-size, 0.625rem);opacity: 0;position: absolute;transform: translate(-50%, -50%);transition: opacity var(--helix-duration-fast) var(--helix-easing-standard);}[part~="handle"]::after {content: "";inset: calc(var(--helix-space-sm) * -1);position: absolute;}:host(:hover) [part~="handle"],
|
|
5
4
|
:host(:focus-within) [part~="handle"],
|
|
6
|
-
:host(:state(candidate)) [part~="handle"] {opacity: 1;}:host(:state(selected)) {outline: var(--helix-border-thick) solid var(--helix-color-accent);outline-offset: calc(var(--helix-border-thin) * -1);}:host(:state(target)) {box-shadow: 0 0 0 var(--helix-border-thick) var(--helix-color-accent);}:host(:state(target)) [part~="handle"] {background-color: var(--_canvas-handle-color);}@media (forced-colors: active) {:host(:state(target)) {outline: var(--helix-border-thick) solid Highlight;outline-offset: var(--helix-space-2xs);}}@media (prefers-reduced-motion: reduce) {[part~="handle"],
|
|
7
|
-
[part~="move"] {transition: none;}}[part~="handle-top"] {left: 50%;top: 0;}[part~="handle-right"] {left: 100%;top: 50%;}[part~="handle-bottom"] {left: 50%;top: 100%;}[part~="handle-left"] {left: 0;top: 50%;}::slotted([slot="description"]) {color: var(--helix-color-foreground-subtle);font-size: var(--helix-text-xs);}:host(:not(:state(placed))) {position: static;}[part~="grip"] {background-color: var(--helix-color-surface);block-size: var(--canvas-grip-size, 0.5rem);border: var(--helix-border-thin) solid var(--helix-color-accent);box-sizing: border-box;inline-size: var(--canvas-grip-size, 0.5rem);position: absolute;transform: translate(-50%, -50%);}[part~="grip"]::after {content: "";inset: calc(var(--helix-space-2xs) * -1);position: absolute;}
|
|
8
|
-
:host(:focus-within) [part~="
|
|
5
|
+
:host(:state(candidate)) [part~="handle"] {opacity: 1;}:host(:state(selected)) {outline: var(--helix-border-thick) solid var(--canvas-selected-color, var(--helix-color-accent));outline-offset: calc(var(--helix-border-thin) * -1);}:host(:state(target)) {box-shadow: 0 0 0 var(--helix-border-thick) var(--canvas-connect-color, var(--helix-color-accent));}:host(:state(target)) [part~="handle"] {background-color: var(--_canvas-handle-color);}@media (forced-colors: active) {:host(:state(target)) {outline: var(--helix-border-thick) solid Highlight;outline-offset: var(--helix-space-2xs);}}@media (prefers-reduced-motion: reduce) {[part~="handle"],
|
|
6
|
+
[part~="move"] {transition: none;}}[part~="handle-top"] {left: 50%;top: 0;}[part~="handle-right"] {left: 100%;top: 50%;}[part~="handle-bottom"] {left: 50%;top: 100%;}[part~="handle-left"] {left: 0;top: 50%;}::slotted([slot="description"]) {color: var(--helix-color-foreground-subtle);font-size: var(--helix-text-xs);}:host(:not(:state(placed))) {position: static;}[part~="grip"] {background-color: var(--helix-color-surface);block-size: var(--canvas-grip-size, 0.5rem);border: var(--helix-border-thin) solid var(--canvas-selected-color, var(--helix-color-accent));box-sizing: border-box;inline-size: var(--canvas-grip-size, 0.5rem);position: absolute;transform: translate(-50%, -50%);}[part~="grip"]::after {content: "";inset: calc(var(--helix-space-2xs) * -1);position: absolute;}@media (pointer: coarse) {:host(:focus-within) [part~="handle"]::after,
|
|
7
|
+
:host(:focus-within) [part~="grip"]::after {inset: calc((2.75rem - 100%) / -2);}}[part~="grip-top-left"] {cursor: nwse-resize;left: 0;top: 0;}[part~="grip-top-right"] {cursor: nesw-resize;left: 100%;top: 0;}[part~="grip-bottom-right"] {cursor: nwse-resize;left: 100%;top: 100%;}[part~="grip-bottom-left"] {cursor: nesw-resize;left: 0;top: 100%;}[part~="move"] {background-image: radial-gradient(circle, currentColor 1px, transparent 1.25px);background-size: 50% calc(100% / 3);block-size: var(--canvas-move-block-size, 0.75rem);color: var(--helix-color-foreground-subtle);cursor: move;inline-size: var(--canvas-move-inline-size, 0.5rem);inset-block-start: var(--canvas-move-inset, var(--helix-space-xs));inset-inline-start: var(--canvas-move-inset, var(--helix-space-xs));opacity: 0;position: absolute;transition: opacity var(--helix-duration-fast) var(--helix-easing-standard);}[part~="move"]::after {content: "";inset: calc((1.5rem - 100%) / -2);position: absolute;}:host(:hover) [part~="move"],
|
|
8
|
+
:host(:focus-within) [part~="move"] {opacity: 1;}[part~="move"]:hover {color: var(--canvas-selected-color, var(--helix-color-accent));}:host([shape="pill"]) [part~="move"],
|
|
9
9
|
:host([shape="circle"]) [part~="move"],
|
|
10
10
|
:host([shape="diamond"]) [part~="move"] {inset-block-start: calc(var(--canvas-move-inset, var(--helix-space-xs)) * 2);inset-inline: 0;margin-inline: auto;}:host([shape="square"]:not([group])) {border-radius: 0;}:host([shape="pill"]:not([group])) {border-radius: var(--helix-radii-full);}:host([shape="circle"]:not([group])) {border-radius: 50%;}:host([shape="pill"]:not([group])) [part="node"],
|
|
11
11
|
:host([shape="circle"]:not([group])) [part="node"] {align-items: center;padding-inline: 15%;text-align: center;}:host([shape="diamond"]:not([group])) {backdrop-filter: none;background-color: transparent;border-color: transparent;--canvas-node-shadow: none;}[part="outline"] {block-size: calc(100% + var(--helix-border-thin) * 2);inline-size: calc(100% + var(--helix-border-thin) * 2);left: calc(var(--helix-border-thin) * -1);overflow: visible;pointer-events: none;position: absolute;top: calc(var(--helix-border-thin) * -1);}[part="outline"] polygon {fill: var(--canvas-node-background-color, var(--helix-color-surface));stroke: var(--_canvas-card-color);stroke-width: var(--helix-border-thin);}:host([shape="diamond"][material="glass"]) [part="outline"] polygon {fill: var(--helix-material-translucent);}:host([shape="diamond"][material="frosted"]) [part="outline"] polygon {fill: var(--helix-material-translucent-strong);}:host([shape="diamond"][material="transparent"]) [part="outline"] polygon {fill: transparent;}:host([shape="diamond"][separation="filled"]) [part="outline"] polygon {fill: color-mix(in oklab, var(--_canvas-card-color) 16%, var(--helix-color-surface));stroke: transparent;}:host([shape="diamond"][separation="plain"]) [part="outline"] polygon {fill: transparent;stroke: transparent;}:host([shape="diamond"]:state(selected)),
|
|
@@ -10,6 +10,9 @@ import type { CSSResultGroup } from 'lit';
|
|
|
10
10
|
* Before the board places it, the card sits in normal flow. Without JavaScript,
|
|
11
11
|
* the page shows the cards' text in the order it was written.
|
|
12
12
|
*
|
|
13
|
+
* On a touch screen, the points and corners of the card with focus take a
|
|
14
|
+
* reach 44 pixels across, so a finger can start a connection from one.
|
|
15
|
+
*
|
|
13
16
|
* @since 0.100.0
|
|
14
17
|
* @status experimental
|
|
15
18
|
* @category media
|
|
@@ -23,7 +26,9 @@ import type { CSSResultGroup } from 'lit';
|
|
|
23
26
|
* @cssproperty --canvas-move-inset - The distance between the move handle and the card's corner.
|
|
24
27
|
* @cssproperty --canvas-node-background-color - The card's background.
|
|
25
28
|
* @cssproperty --canvas-node-color - A color for the card that carries no meaning, such as a hex color from a document. Use it when no tone fits.
|
|
29
|
+
* @cssproperty --canvas-node-font-size - The size of the card's text.
|
|
26
30
|
* @cssproperty --canvas-node-padding - The space between the card's edge and its content.
|
|
31
|
+
* @cssproperty --canvas-node-radius - The card's corners. A `shape` draws its own.
|
|
27
32
|
* @cssproperty --canvas-node-shadow - The shadow under the card, set by `separation="elevated"`.
|
|
28
33
|
*/
|
|
29
34
|
export declare class HelixCanvasNode extends HelixHeadlessCanvasNode {
|
|
@@ -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(--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:
|
|
@@ -9,4 +9,8 @@ var(--helix-color-border) var(--helix-border-thin),
|
|
|
9
9
|
transparent 0
|
|
10
10
|
);}:host(:state(direct)) [part="board"],
|
|
11
11
|
:host(:state(direct)) [part="viewport"] {transition: none;}@media (prefers-reduced-motion: reduce) {[part="board"],
|
|
12
|
-
:host([grid]) [part="viewport"] {transition: none;}}[part="edges"] {inset: 0;overflow: visible;position: absolute;z-index: var(--helix-layer-beneath);}[part="edge"] {stroke: var(--_canvas-edge-color, var(--canvas-edge-color, var(--helix-color-border)));stroke-width: var(--helix-border-thick);}[part="edge"] {pointer-events: none;}[part="edge-target"] {cursor: grab;pointer-events: stroke;stroke: transparent;stroke-width: var(--canvas-edge-target-width, 12px);}[part="edge-target"]:focus {outline: none;}[part="edge-target"]:hover + [part="edge"] {stroke: var(--helix-color-focus-ring);}[part="edge-target"]:focus-visible + [part="edge"] {stroke: var(--helix-color-focus-ring);stroke-width: calc(var(--helix-border-thick) * 2);}[part="edge-end"] {background-color: var(--helix-color-accent);block-size: var(--canvas-handle-size, 0.625rem);border: var(--helix-border-thick) solid var(--helix-color-surface);border-radius: var(--helix-radii-full);box-sizing: border-box;cursor: grab;inline-size: var(--canvas-handle-size, 0.625rem);left: var(--_canvas-end-x);position: absolute;top: var(--_canvas-end-y);transform: translate(-50%, -50%);z-index: 1;}[part="edge-end"]::after {content: "";inset: calc(var(--helix-space-sm) * -1);position: absolute;}:host(:state(holding)) [part="viewport"] {cursor: grabbing;}[part="label-editor"] {background-color: var(--helix-color-surface);border: var(--helix-border-thin) solid var(--helix-color-accent);border-radius: var(--helix-radii-sm);box-sizing: border-box;color: var(--helix-color-foreground);font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);inline-size: var(--canvas-label-editor-inline-size, 12rem);left: var(--_canvas-editor-x);padding: var(--helix-space-2xs) var(--helix-space-xs);position: absolute;text-align: center;top: var(--_canvas-editor-y);transform: translate(-50%, -50%);z-index: 1;}[part="label-editor"][data-target="group"] {text-align: start;transform: translate(0, -100%);}[part="label-editor"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="marquee"] {background-color: color-mix(
|
|
12
|
+
:host([grid]) [part="viewport"] {transition: none;}}[part="edges"] {inset: 0;overflow: visible;position: absolute;z-index: var(--helix-layer-beneath);}[part="edge"] {stroke: var(--_canvas-edge-color, var(--canvas-edge-color, var(--helix-color-border)));stroke-width: var(--canvas-edge-width, var(--helix-border-thick));}[part="edge"] {pointer-events: none;}[part="edge-target"] {cursor: grab;pointer-events: stroke;stroke: transparent;stroke-width: var(--canvas-edge-target-width, 12px);}[part="edge-target"]:focus {outline: none;}[part="edge-target"]:hover + [part="edge"] {stroke: var(--helix-color-focus-ring);}[part="edge-target"]:focus-visible + [part="edge"] {stroke: var(--helix-color-focus-ring);stroke-width: calc(var(--canvas-edge-width, var(--helix-border-thick)) * 2);}[part="edge-end"] {background-color: var(--canvas-selected-color, var(--helix-color-accent));block-size: var(--canvas-handle-size, 0.625rem);border: var(--helix-border-thick) solid var(--helix-color-surface);border-radius: var(--helix-radii-full);box-sizing: border-box;cursor: grab;inline-size: var(--canvas-handle-size, 0.625rem);left: var(--_canvas-end-x);position: absolute;top: var(--_canvas-end-y);transform: translate(-50%, -50%);z-index: 1;}[part="edge-end"]::after {content: "";inset: calc(var(--helix-space-sm) * -1);position: absolute;}@media (pointer: coarse) {[part="edge-end"]::after {inset: calc((2.75rem - 100%) / -2);}}:host(:state(holding)) [part="viewport"] {cursor: grabbing;}[part="label-editor"] {background-color: var(--helix-color-surface);border: var(--helix-border-thin) solid var(--helix-color-accent);border-radius: var(--helix-radii-sm);box-sizing: border-box;color: var(--helix-color-foreground);font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);inline-size: var(--canvas-label-editor-inline-size, 12rem);left: var(--_canvas-editor-x);padding: var(--helix-space-2xs) var(--helix-space-xs);position: absolute;text-align: center;top: var(--_canvas-editor-y);transform: translate(-50%, -50%);z-index: 1;}[part="label-editor"][data-target="group"] {text-align: start;transform: translate(0, -100%);}[part="label-editor"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="marquee"] {background-color: color-mix(
|
|
13
|
+
in oklab,
|
|
14
|
+
var(--canvas-selected-color, var(--helix-color-accent)) 10%,
|
|
15
|
+
transparent
|
|
16
|
+
);block-size: var(--_canvas-marquee-block-size);border: var(--helix-border-thin) dashed var(--canvas-selected-color, var(--helix-color-accent));box-sizing: border-box;inline-size: var(--_canvas-marquee-inline-size);left: var(--_canvas-marquee-x);pointer-events: none;position: absolute;top: var(--_canvas-marquee-y);z-index: 1;}[part="draft"] {pointer-events: none;stroke: var(--canvas-connect-color, var(--helix-color-accent));stroke-dasharray: 6 4;stroke-width: var(--helix-border-thick);}:host(:state(connecting)) [part="viewport"] {cursor: crosshair;}[part="arrow"] {fill: var(--canvas-edge-color, var(--helix-color-border));}@supports (fill: context-stroke) {[part="arrow"] {fill: context-stroke;}}[part="edge"][data-tone="accent"] {stroke: var(--helix-color-accent);}[part="edge"][data-tone="danger"] {stroke: var(--helix-color-danger);}[part="edge"][data-tone="info"] {stroke: var(--helix-color-info);}[part="edge"][data-tone="primary"] {stroke: var(--helix-color-primary);}[part="edge"][data-tone="success"] {stroke: var(--helix-color-success);}[part="edge"][data-tone="warning"] {stroke: var(--helix-color-warning);}[part="edge"][data-selected] {stroke: var(--canvas-selected-color, var(--helix-color-accent));stroke-width: calc(var(--canvas-edge-width, var(--helix-border-thick)) * 2);}[part="edge"][data-variant="dashed"] {stroke-dasharray: 6 4;}[part="edge"][data-variant="dotted"] {stroke-dasharray: 0 5;stroke-linecap: round;}[part="label"] {background-color: var(--canvas-background-color, var(--helix-color-surface-sunken));color: var(--canvas-label-color, var(--helix-color-foreground-subtle));font-family: var(--helix-font-sans);font-size: var(--canvas-label-font-size, var(--helix-text-xs));left: var(--_canvas-label-x);line-height: 1;padding: var(--helix-space-2xs);pointer-events: none;position: absolute;top: var(--_canvas-label-y);transform: translate(-50%, -50%);white-space: nowrap;}[part="viewport"] {cursor: grab;touch-action: none;}:host(:state(sharing)) [part="viewport"] {touch-action: pan-x pan-y;}:host(:state(pressing)) [part="viewport"] {user-select: none;}[part="viewport"]:active {cursor: grabbing;}@media print {[part="controls"] {display: none;}}`);
|
|
@@ -21,11 +21,17 @@ import type { CSSResultGroup } from 'lit';
|
|
|
21
21
|
* @cssproperty --canvas-background-color - The background behind the board.
|
|
22
22
|
* @cssproperty --canvas-block-size - The height of the frame.
|
|
23
23
|
* @cssproperty --canvas-border-color - The color of the frame's edge.
|
|
24
|
+
* @cssproperty --canvas-connect-color - The color of a connection being drawn, and of the card it will arrive at and that card's points.
|
|
24
25
|
* @cssproperty --canvas-edge-color - The color of a connection with no tone. Set it in one edge's `style` to color only that edge.
|
|
25
26
|
* @cssproperty --canvas-edge-target-width - The width of the area a pointer can press on a connection, which is wider than the drawn line.
|
|
27
|
+
* @cssproperty --canvas-edge-width - The width of a connection's line. A selected or focused connection is drawn at twice it.
|
|
26
28
|
* @cssproperty --canvas-grid-size - The spacing of the grid lines or dots, in the document's units, so it scales with the zoom.
|
|
27
29
|
* @cssproperty --canvas-handle-size - The size of the ends of a selected connection. A card's connection points use the same property.
|
|
30
|
+
* @cssproperty --canvas-label-color - The color of the label on a connection.
|
|
28
31
|
* @cssproperty --canvas-label-editor-inline-size - The width of the field for editing a label.
|
|
32
|
+
* @cssproperty --canvas-label-font-size - The size of the label on a connection.
|
|
33
|
+
* @cssproperty --canvas-radius - The frame's corners.
|
|
34
|
+
* @cssproperty --canvas-selected-color - The color of what is selected: a card's outline, its corners and its move handle, a connection and its ends, and the box drawn to select.
|
|
29
35
|
* @cssproperty --viewport-control-background-color - The background of the pan and zoom buttons. `Map` uses the same property.
|
|
30
36
|
*/
|
|
31
37
|
export declare class HelixCanvas extends HelixHeadlessCanvas {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {--_card-inset: var(--card-padding, var(--helix-space-control));--_card-media: var(--card-media-size, 12rem);--_heading-ink: var(--helix-color-foreground);background-color: var(--card-background-color, var(--helix-color-surface));border: var(--card-border-width, var(--helix-border-surface)) solid
|
|
3
|
-
var(--card-border-color, var(--helix-color-border));border-radius: var(--card-radius, var(--helix-radii-lg));box-shadow: var(--card-shadow, var(--helix-shadow-surface));color: var(--helix-color-foreground-muted);align-content: var(--card-align, start);display: grid;gap: var(--card-gap, var(--helix-space-sm));grid-template-columns: minmax(0, 1fr);line-height: var(--helix-leading-normal);overflow: hidden;padding: var(--_card-inset);transition:
|
|
2
|
+
export const styles = createSheet(`:host {--_card-inset: var(--card-padding, var(--helix-space-control));--_card-media: var(--card-media-size, 12rem);--_heading-ink: var(--card-heading-color, var(--helix-color-foreground));background-color: var(--card-background-color, var(--helix-color-surface));border: var(--card-border-width, var(--helix-border-surface)) solid
|
|
3
|
+
var(--card-border-color, var(--helix-color-border));border-radius: var(--card-radius, var(--helix-radii-lg));box-shadow: var(--card-shadow, var(--helix-shadow-surface));color: var(--card-color, var(--helix-color-foreground-muted));align-content: var(--card-align, start);display: grid;gap: var(--card-gap, var(--helix-space-sm));grid-template-columns: minmax(0, 1fr);line-height: var(--card-line-height, var(--helix-leading-normal));overflow: hidden;padding: var(--_card-inset);transition:
|
|
4
4
|
border-color var(--helix-duration-fast) var(--helix-easing-standard),
|
|
5
|
-
box-shadow var(--helix-duration-fast) var(--helix-easing-standard);}:host([separation="elevated"]) {--card-shadow: var(--helix-shadow-md);border-color: light-dark(transparent, var(--helix-color-border));}:host([separation="filled"]) {--card-shadow: none;border-color: transparent;}:host([separation="plain"]) {--card-shadow: none;background-color: transparent;border-color: transparent;}slot[name="media"]::slotted(*) {block-size: var(--card-media-block-size, auto);display: block;inline-size: calc(100% + var(--_card-inset) * 2);margin: calc(var(--_card-inset) * -1);margin-block-end: 0;object-fit: cover;}:host([media-placement="end"]) slot[name="media"]::slotted(*) {margin-block-end: calc(var(--_card-inset) * -1);margin-block-start: 0;order: 1;}slot[name="header"]::slotted(*) {color: var(--
|
|
5
|
+
box-shadow var(--helix-duration-fast) var(--helix-easing-standard);}:host([separation="elevated"]) {--card-shadow: var(--helix-shadow-md);border-color: light-dark(transparent, var(--helix-color-border));}:host([separation="filled"]) {--card-shadow: none;border-color: transparent;}:host([separation="plain"]) {--card-shadow: none;background-color: transparent;border-color: transparent;}slot[name="media"]::slotted(*) {block-size: var(--card-media-block-size, auto);display: block;inline-size: calc(100% + var(--_card-inset) * 2);margin: calc(var(--_card-inset) * -1);margin-block-end: 0;object-fit: var(--card-media-fit, cover);}:host([media-placement="end"]) slot[name="media"]::slotted(*) {margin-block-end: calc(var(--_card-inset) * -1);margin-block-start: 0;order: 1;}slot[name="header"]::slotted(*) {color: var(--_heading-ink);}slot[name="footer"]::slotted(*) {justify-self: end;}[part="header-row"],
|
|
6
6
|
[part="footer-row"] {align-items: center;display: flex;flex-wrap: wrap;gap: var(--card-gap, var(--helix-space-sm));min-inline-size: 0;}[part="header-row"] slot[name="header"]::slotted(*) {flex: 1 1 auto;min-inline-size: 0;}slot[name="header-actions"]::slotted(*),
|
|
7
7
|
slot[name="footer-actions"]::slotted(*) {flex: none;justify-self: end;}[part="footer-row"] slot[name="footer-actions"]::slotted(*) {margin-inline-start: auto;}:host([orientation="horizontal"]) {padding-inline-start: calc(var(--_card-media) + var(--_card-inset));position: relative;}:host([orientation="horizontal"]) slot[name="media"]::slotted(*) {block-size: 100%;inline-size: var(--_card-media);inset-block: 0;inset-inline-start: 0;margin: var(--helix-space-none);position: absolute;}@media (prefers-reduced-motion: reduce) {:host {transition: none;}}:host([material="glass"]) {backdrop-filter: var(--card-backdrop, var(--helix-material-backdrop));background-color: var(--card-background-color, var(--helix-material-translucent));}:host([material="frosted"]) {backdrop-filter: var(--card-backdrop, blur(var(--helix-material-blur-lg)));background-color: var(--card-background-color, var(--helix-material-translucent-strong));}:host([material="transparent"]) {backdrop-filter: none;background-color: transparent;}@media print {:host {background-color: transparent;box-shadow: none;}}`);
|
|
@@ -52,10 +52,14 @@ import type { CSSResultGroup } from 'lit';
|
|
|
52
52
|
* @cssproperty --card-border-width - Width of the surface's edge. Follows
|
|
53
53
|
* `--helix-border-surface`, which is a hairline unless your theme sets another width.
|
|
54
54
|
* The edge is what sets the surface apart.
|
|
55
|
+
* @cssproperty --card-color - Color of the card's text. Muted by default, so the header reads as the card's own voice.
|
|
55
56
|
* @cssproperty --card-gap - Space between the regions, and between a header or footer and its actions.
|
|
57
|
+
* @cssproperty --card-heading-color - Color of the header, and of a `Text` heading anywhere in the card. The foreground by default.
|
|
58
|
+
* @cssproperty --card-line-height - Line height of the card's text. The normal leading by default.
|
|
56
59
|
* @cssproperty --card-media-block-size - Height of the media region. Defaults to
|
|
57
60
|
* `auto`, which follows an image's own proportions. A chart has no height of its own,
|
|
58
61
|
* so set one here for a chart.
|
|
62
|
+
* @cssproperty --card-media-fit - How a slotted picture fills the media region, as `object-fit`. `cover` by default; `contain` shows all of a logo or a screenshot.
|
|
59
63
|
* @cssproperty --card-media-size - Width of the media column when horizontal.
|
|
60
64
|
* @cssproperty --card-padding - Inset applied to each region.
|
|
61
65
|
* @cssproperty --card-radius - Corner radius of the surface.
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {--_code-block-
|
|
3
|
-
var(--helix-space-sm) +
|
|
4
|
-
(var(--_code-block-line) - var(--helix-size-control-sm)) /
|
|
5
|
-
2
|
|
6
|
-
);--_code-block-gutter: calc(var(--helix-size-control-sm) + var(--_code-block-copy-inset) * 2);display: flex;flex-direction: column;}[part="frame"] {flex: 1;}[part="header"] {align-items: center;backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-header-background-color, var(--helix-color-surface-raised));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-end-end-radius: var(--helix-radii-none);border-end-start-radius: var(--helix-radii-none);border-start-end-radius: var(--code-block-radius, var(--helix-radii-lg));border-start-start-radius: var(--code-block-radius, var(--helix-radii-lg));display: flex;gap: var(--helix-space-sm);padding-block: var(--helix-space-xs);padding-inline: var(--helix-space-md);}[part="header"]:has(> [part="copy"]) {padding-block: var(--helix-space-2xs);padding-inline-end: var(--helix-space-2xs);}[part="label"] {color: var(--helix-color-foreground-muted);font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);min-inline-size: 0;overflow-wrap: anywhere;}[part="frame"] {position: relative;}[part="block"] {block-size: 100%;}[part="copy"] {--icon-button-size: var(--helix-size-control-sm);}[part="header"] > [part="copy"] {margin-inline-start: auto;}[part="frame"] > [part="copy"] {inset-block-start: var(--_code-block-copy-inset);inset-inline-end: var(--_code-block-copy-inset);position: absolute;}[part="block"] {backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-background-color, var(--helix-color-background));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-radius: var(--code-block-radius, var(--helix-radii-lg));margin: var(--helix-space-none);overflow-x: auto;padding-block: var(--helix-space-sm);padding-inline: var(--helix-space-md);}:host(:not([diff], [no-copy])) [part="frame"]:not([part="header"] + *) > [part="block"] {padding-inline-end: var(--_code-block-gutter);}[part="header"] + [part="frame"] [part="block"] {border-block-start-width: var(--helix-space-none);border-start-end-radius: var(--helix-radii-none);border-start-start-radius: var(--helix-radii-none);}[part="code"] {color: var(--helix-color-foreground);font-family: var(--helix-font-mono);font-size: var(--helix-text-sm);line-height: var(--helix-leading-normal);}:host(:not([diff])) [part="code"] {display: block;max-block-size: var(--code-block-max-block-size, none);overflow-x: auto;}:host(:state(expanded)) [part="code"] {max-block-size: none;}[part="expand"] {all: unset;box-sizing: border-box;border-radius: var(--helix-radii-sm);color: var(--code-block-expand-color, var(--helix-color-foreground-muted));cursor: pointer;font-size: var(--helix-text-sm);padding: var(--helix-space-xs);}[part="expand"]:hover {color: var(--helix-color-foreground);}[part="expand"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}:host([wrap]:not([diff], [line-numbers])) [part="code"] {overflow-wrap: anywhere;white-space: pre-wrap;}:host([line-numbers]:not([diff])) [part="block"] {column-gap: var(--helix-space-md);display: grid;grid-template-columns: auto minmax(0, 1fr);}[part="gutter"] {color: var(--code-block-gutter-color, var(--helix-color-foreground-subtle));font-family: var(--helix-font-mono);font-size: var(--helix-text-sm);font-variant-numeric: tabular-nums;line-height: var(--helix-leading-normal);text-align: end;user-select: none;}:host([diff]) {gap: var(--helix-space-md);}:host([diff]) [part="file"] {container-type: inline-size;display: flex;flex-direction: column;}:host([diff]) [part="block"],
|
|
2
|
+
export const styles = createSheet(`:host {--_code-block-size: var(--code-block-font-size, var(--helix-text-sm));--_code-block-leading: var(--code-block-line-height, var(--helix-leading-normal));--_code-block-face: var(--code-block-font-family, var(--helix-font-mono));--_code-block-copy-inset: calc(var(--helix-space-sm) + (1lh - var(--helix-size-control-sm)) / 2);--_code-block-gutter: calc(var(--helix-size-control-sm) + var(--_code-block-copy-inset) * 2);display: flex;flex-direction: column;}[part="frame"] {flex: 1;}:host(:not([diff])) [part="frame"] {font-size: var(--_code-block-size);line-height: var(--_code-block-leading);}[part="header"] {align-items: center;backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-header-background-color, var(--helix-color-surface-raised));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-end-end-radius: var(--helix-radii-none);border-end-start-radius: var(--helix-radii-none);border-start-end-radius: var(--code-block-radius, var(--helix-radii-lg));border-start-start-radius: var(--code-block-radius, var(--helix-radii-lg));display: flex;gap: var(--helix-space-sm);padding-block: var(--helix-space-xs);padding-inline: var(--helix-space-md);}[part="header"]:has(> [part="copy"]) {padding-block: var(--helix-space-2xs);padding-inline-end: var(--helix-space-2xs);}[part="label"] {color: var(--code-block-label-color, var(--helix-color-foreground-muted));font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);min-inline-size: 0;overflow-wrap: anywhere;}[part="frame"] {position: relative;}[part="block"] {block-size: 100%;}[part="copy"] {--icon-button-size: var(--helix-size-control-sm);}[part="header"] > [part="copy"] {margin-inline-start: auto;}[part="frame"] > [part="copy"] {font-size: var(--_code-block-size);inset-block-start: var(--_code-block-copy-inset);inset-inline-end: var(--_code-block-copy-inset);line-height: var(--_code-block-leading);position: absolute;}[part="block"] {backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-background-color, var(--helix-color-background));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-radius: var(--code-block-radius, var(--helix-radii-lg));margin: var(--helix-space-none);overflow-x: auto;padding-block: var(--helix-space-sm);padding-inline: var(--helix-space-md);}:host(:not([diff], [no-copy])) [part="frame"]:not([part="header"] + *) > [part="block"] {padding-inline-end: var(--_code-block-gutter);}[part="header"] + [part="frame"] [part="block"] {border-block-start-width: var(--helix-space-none);border-start-end-radius: var(--helix-radii-none);border-start-start-radius: var(--helix-radii-none);}[part="code"] {color: var(--code-block-color, var(--helix-color-foreground));font-family: var(--_code-block-face);font-size: var(--_code-block-size);line-height: var(--_code-block-leading);}:host(:not([diff])) [part="code"] {display: block;max-block-size: var(--code-block-max-block-size, none);overflow-x: auto;}:host(:state(expanded)) [part="code"] {max-block-size: none;}[part="expand"] {all: unset;box-sizing: border-box;border-radius: var(--helix-radii-sm);color: var(--code-block-expand-color, var(--helix-color-foreground-muted));cursor: pointer;font-size: var(--helix-text-sm);padding: var(--helix-space-xs);}[part="expand"]:hover {color: var(--helix-color-foreground);}[part="expand"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}:host([wrap]:not([diff], [line-numbers])) [part="code"] {overflow-wrap: anywhere;white-space: pre-wrap;}:host([line-numbers]:not([diff])) [part="block"] {column-gap: var(--helix-space-md);display: grid;grid-template-columns: auto minmax(0, 1fr);}[part="gutter"] {color: var(--code-block-gutter-color, var(--helix-color-foreground-subtle));font-family: var(--_code-block-face);font-size: var(--_code-block-size);font-variant-numeric: tabular-nums;line-height: var(--_code-block-leading);text-align: end;user-select: none;}:host([diff]) {gap: var(--helix-space-md);}:host([diff]) [part="file"] {container-type: inline-size;display: flex;flex-direction: column;}:host([diff]) [part="block"],
|
|
7
3
|
[part="old"],
|
|
8
4
|
[part="new"] {backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-background-color, var(--helix-color-background));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-radius: var(--code-block-radius, var(--helix-radii-lg));margin: var(--helix-space-none);min-inline-size: 0;overflow-x: auto;padding-block: var(--helix-space-none) var(--helix-space-sm);padding-inline: var(--helix-space-none);}:host([diff]:not([no-copy]))
|
|
9
5
|
[part="frame"]:not([part="header"] + *)
|
|
10
|
-
:is([part="block"], [part="old"], [part="new"])
|
|
6
|
+
:is([part="block"], [part="old"], [part="new"])
|
|
7
|
+
> [part="code"] {margin-block-start: var(--_code-block-gutter);}[part="header"] + [part="frame"] :is([part="block"], [part="split"] > *) {border-block-start-width: var(--helix-space-none);border-start-end-radius: var(--helix-radii-none);border-start-start-radius: var(--helix-radii-none);}[part="split"] {display: grid;gap: var(--helix-space-xs);grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);}@container (inline-size < 40rem) {[part="split"] {grid-template-columns: minmax(0, 1fr);}[part="header"] + [part="frame"] [part="new"] {border-block-start-width: var(--helix-border-thin);border-start-end-radius: var(--code-block-radius, var(--helix-radii-lg));border-start-start-radius: var(--code-block-radius, var(--helix-radii-lg));}:host([diff]:not([no-copy]))
|
|
8
|
+
[part="frame"]:not([part="header"] + *)
|
|
9
|
+
[part="new"]
|
|
10
|
+
> [part="code"] {margin-block-start: var(--helix-space-none);}}:host([diff]) [part="code"] {display: inline-block;min-inline-size: 100%;}[part="hunk"],
|
|
11
11
|
[part="context"],
|
|
12
12
|
[part="added"],
|
|
13
13
|
[part="removed"],
|
|
14
14
|
[part="filler"] {display: flex;padding-inline: var(--helix-space-md);text-decoration: none;}[part="hunk"] {background-color: var(--helix-color-surface-sunken);color: var(--helix-color-foreground-muted);}[part="added"] {background-color: color-mix(
|
|
15
15
|
in srgb,
|
|
16
|
-
var(--helix-color-success) 14%,
|
|
16
|
+
var(--code-block-added-color, var(--helix-color-success)) 14%,
|
|
17
17
|
var(--code-block-background-color, var(--helix-color-background))
|
|
18
18
|
);}[part="removed"] {background-color: color-mix(
|
|
19
19
|
in srgb,
|
|
20
|
-
var(--helix-color-danger) 14%,
|
|
20
|
+
var(--code-block-removed-color, var(--helix-color-danger)) 14%,
|
|
21
21
|
var(--code-block-background-color, var(--helix-color-background))
|
|
22
|
-
);}[part="marker"] {padding-inline-end: var(--helix-space-xs);user-select: none;}[part="added"] [part="marker"] {color: color-mix(
|
|
22
|
+
);}[part="marker"] {padding-inline-end: var(--helix-space-xs);user-select: none;}[part="added"] [part="marker"] {color: color-mix(
|
|
23
|
+
in oklab,
|
|
24
|
+
var(--code-block-added-color, var(--helix-color-success)) 55%,
|
|
25
|
+
var(--helix-color-foreground)
|
|
26
|
+
);}[part="removed"] [part="marker"] {color: color-mix(
|
|
27
|
+
in oklab,
|
|
28
|
+
var(--code-block-removed-color, var(--helix-color-danger)) 55%,
|
|
29
|
+
var(--helix-color-foreground)
|
|
30
|
+
);}[part="filler"] {background-color: var(--helix-color-surface-sunken);min-block-size: 1lh;}[part="number"] {color: var(--helix-color-foreground-muted);font-variant-numeric: tabular-nums;padding-inline-end: var(--helix-space-sm);user-select: none;}@media print {:host {background-color: transparent;}:host([diff]) [part="block"],
|
|
23
31
|
[part="old"],
|
|
24
32
|
[part="new"] {overflow: visible;white-space: pre-wrap;}[part="added"],
|
|
25
33
|
[part="removed"],
|
|
@@ -25,14 +25,21 @@ import '../../copy-button/index.js';
|
|
|
25
25
|
* @category typography
|
|
26
26
|
* @documentation https://fusion.dev/helix/components/code-block
|
|
27
27
|
*
|
|
28
|
+
* @cssproperty --code-block-added-color - The color a diff's added lines are tinted in and their `+` is drawn in. The success color by default.
|
|
28
29
|
* @cssproperty --code-block-backdrop - A backdrop filter for the block and its header, for a translucent background.
|
|
29
30
|
* @cssproperty --code-block-background-color - The background behind the code. Set it for a block that sits on a surface other than the page background.
|
|
30
31
|
* @cssproperty --code-block-border-color - The line around the block and its header.
|
|
32
|
+
* @cssproperty --code-block-color - The color of the code. A highlighter's own colors win on the tokens it colors.
|
|
31
33
|
* @cssproperty --code-block-expand-color - The color of the button under a capped block that shows every line.
|
|
34
|
+
* @cssproperty --code-block-font-family - The typeface of the code and its line numbers. The mono face by default.
|
|
35
|
+
* @cssproperty --code-block-font-size - The size of the code and its line numbers.
|
|
32
36
|
* @cssproperty --code-block-gutter-color - The color of the line numbers.
|
|
33
37
|
* @cssproperty --code-block-header-background-color - The background behind the name. The default is `surface-raised`.
|
|
38
|
+
* @cssproperty --code-block-label-color - The color of the name in the header.
|
|
39
|
+
* @cssproperty --code-block-line-height - The line height of the code and its line numbers, as a number or a length.
|
|
34
40
|
* @cssproperty --code-block-max-block-size - The tallest the code grows before it scrolls, or until `expandable`'s button shows every line. The default is no limit.
|
|
35
41
|
* @cssproperty --code-block-radius - The corner radius of the header's top and the block's bottom, which form one shape.
|
|
42
|
+
* @cssproperty --code-block-removed-color - The color a diff's removed lines are tinted in and their `-` is drawn in. The danger color by default.
|
|
36
43
|
*/
|
|
37
44
|
export declare class HelixCodeBlock extends HelixHeadlessCodeBlock {
|
|
38
45
|
static tier: string;
|
|
@@ -13,11 +13,13 @@ import { styles as fieldFrameStyles } from '../../shared/field/field-frame.css.j
|
|
|
13
13
|
import { styles as fieldStackedStyles } from '../../shared/field/field-stacked.css.js';
|
|
14
14
|
import { styles as floatingEntranceStyles } from '../../shared/floating/entrance.css.js';
|
|
15
15
|
import { styles as floatingPanelStyles } from '../../shared/floating/panel.css.js';
|
|
16
|
+
import { styles as liveStyles } from '../../shared/live/live.css.js';
|
|
16
17
|
import { styles as tagRowStyles } from '../../shared/tags/tags.css.js';
|
|
17
18
|
import { styles } from './combobox-root.css.js';
|
|
18
19
|
let HelixCombobox = class HelixCombobox extends HelixHeadlessCombobox {
|
|
19
20
|
static { this.tier = 'helix-'; }
|
|
20
21
|
static { this.styles = [
|
|
22
|
+
liveStyles,
|
|
21
23
|
fieldStyles,
|
|
22
24
|
fieldFrameStyles,
|
|
23
25
|
fieldStackedStyles,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {align-items: baseline;display: grid;grid-column: 1 / -1;grid-template-columns: subgrid;row-gap: var(--description-list-item-gap, var(--helix-space-2xs));}[part="label"] {color: var(--description-list-label-color, var(--helix-color-foreground-muted));font-size: var(--description-list-label-font-size, var(--helix-text-sm));font-weight: var(--description-list-label-weight, var(--helix-weight-medium));margin: 0;}[part="value"] {color: var(--description-list-value-color, var(--helix-color-foreground));font-variant-numeric: var(--_description-list-value-figures, normal);justify-self: var(--_description-list-value-align, stretch);margin: 0;min-inline-size: 0;overflow-wrap: anywhere;text-align: var(--_description-list-value-align, start);}::slotted(dd) {color: var(--description-list-value-color, var(--helix-color-foreground));font-variant-numeric: var(--_description-list-value-figures, normal);grid-column: -2 / -1;justify-self: var(--_description-list-value-align, stretch);margin: 0;min-inline-size: 0;overflow-wrap: anywhere;text-align: var(--_description-list-value-align, start);}::slotted([slot="actions"]) {margin-inline-start: var(--description-list-actions-gap, var(--helix-space-xs));vertical-align: middle;}@media print {:host {break-inside: avoid;}}`);
|
|
2
|
+
export const styles = createSheet(`:host {align-items: var(--description-list-item-align, baseline);display: grid;grid-column: 1 / -1;grid-template-columns: subgrid;row-gap: var(--description-list-item-gap, var(--helix-space-2xs));}[part="label"] {color: var(--description-list-label-color, var(--helix-color-foreground-muted));font-size: var(--description-list-label-font-size, var(--helix-text-sm));font-weight: var(--description-list-label-weight, var(--helix-weight-medium));margin: 0;}[part="value"] {color: var(--description-list-value-color, var(--helix-color-foreground));font-variant-numeric: var(--_description-list-value-figures, normal);justify-self: var(--_description-list-value-align, stretch);margin: 0;min-inline-size: 0;overflow-wrap: anywhere;text-align: var(--_description-list-value-align, start);}::slotted(dd) {color: var(--description-list-value-color, var(--helix-color-foreground));font-variant-numeric: var(--_description-list-value-figures, normal);grid-column: -2 / -1;justify-self: var(--_description-list-value-align, stretch);margin: 0;min-inline-size: 0;overflow-wrap: anywhere;text-align: var(--_description-list-value-align, start);}::slotted([slot="actions"]) {margin-inline-start: var(--description-list-actions-gap, var(--helix-space-xs));vertical-align: middle;}@media print {:host {break-inside: avoid;}}`);
|
|
@@ -12,6 +12,7 @@ import type { CSSResultGroup } from 'lit';
|
|
|
12
12
|
* @documentation https://fusion.dev/helix/components/description-list
|
|
13
13
|
*
|
|
14
14
|
* @cssproperty --description-list-actions-gap - The space between the value and the controls in `actions`.
|
|
15
|
+
* @cssproperty --description-list-item-align - How a label and its value line up beside each other, as `align-items`. Defaults to `baseline`; `center` suits a value taller than a line, such as an avatar.
|
|
15
16
|
* @cssproperty --description-list-item-gap - The space between a label and its value when the label sits over it.
|
|
16
17
|
* @cssproperty --description-list-label-color - The color of a label.
|
|
17
18
|
* @cssproperty --description-list-label-font-size - The size of a label's text.
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {container-type: inline-size;display: block;}[part="list"] {
|
|
2
|
+
export const styles = createSheet(`:host {container-type: inline-size;display: block;}[part="list"] {--_description-list-gap: var(--description-list-gap, var(--helix-space-md));display: grid;gap: var(--_description-list-gap);margin: 0;}:host([direction="row"]) [part="list"] {--_description-list-gap: var(--description-list-gap, var(--helix-space-sm));column-gap: var(--description-list-column-gap, var(--helix-space-lg));grid-template-columns: var(--description-list-label-width, max-content) minmax(0, 1fr);row-gap: var(--_description-list-gap);}@container (inline-size < 22rem) {:host([direction="row"]) [part="list"] {--_description-list-gap: var(--description-list-gap, var(--helix-space-md));grid-template-columns: minmax(0, 1fr);row-gap: var(--_description-list-gap);}}:host([width="auto"]) {container-type: normal;inline-size: fit-content;max-inline-size: 100%;}:host([direction="row"][justify="between"]) {--_description-list-value-align: end;--_description-list-value-figures: tabular-nums;}:host([divided]) ::slotted(:not(:first-child)) {border-block-start: var(--description-list-divider-width, var(--helix-border-thin)) solid
|
|
3
|
+
var(--description-list-divider-color, var(--helix-color-border));padding-block-start: var(--_description-list-gap);}`);
|
|
@@ -18,6 +18,9 @@ import type { CSSResultGroup } from 'lit';
|
|
|
18
18
|
* wide as its widest pair, labels sit on the start edge, and values sit on the
|
|
19
19
|
* end edge in tabular figures, as in a set of totals.
|
|
20
20
|
*
|
|
21
|
+
* **For a rule between pairs, set `divided`.** The rule sits in the middle of
|
|
22
|
+
* the gap, so the pairs keep the same room on either side of it.
|
|
23
|
+
*
|
|
21
24
|
* @since 0.1.0
|
|
22
25
|
* @status stable
|
|
23
26
|
* @category data
|
|
@@ -25,10 +28,19 @@ import type { CSSResultGroup } from 'lit';
|
|
|
25
28
|
* @documentation https://fusion.dev/helix/components/description-list
|
|
26
29
|
*
|
|
27
30
|
* @cssproperty --description-list-column-gap - The space between the column of labels and the column of values, with `direction="row"`.
|
|
31
|
+
* @cssproperty --description-list-divider-color - The color of the rule between pairs, with `divided`.
|
|
32
|
+
* @cssproperty --description-list-divider-width - The thickness of the rule between pairs, with `divided`.
|
|
28
33
|
* @cssproperty --description-list-gap - Space between one pair and the next. The default is smaller with `direction="row"` than when stacked. Setting this property replaces both defaults.
|
|
34
|
+
* @cssproperty --description-list-label-width - The width of the column of labels, with `direction="row"`. Defaults to the width of the longest label; set a length such as `10rem` to line up several lists.
|
|
29
35
|
*/
|
|
30
36
|
export declare class HelixDescriptionList extends HelixHeadlessDescriptionList {
|
|
31
37
|
static styles: CSSResultGroup;
|
|
38
|
+
/**
|
|
39
|
+
* Draws a rule between one pair and the next, in the middle of the gap, as
|
|
40
|
+
* a details panel with many rows often does. Off by default, where space
|
|
41
|
+
* alone separates the pairs.
|
|
42
|
+
*/
|
|
43
|
+
divided: boolean;
|
|
32
44
|
/**
|
|
33
45
|
* Where the values sit, beside their labels.
|
|
34
46
|
*
|
|
@@ -9,8 +9,15 @@ import { HelixHeadlessDescriptionList } from '@fusion.dev/helix-headless/descrip
|
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { styles } from './description-list-root.css.js';
|
|
11
11
|
let HelixDescriptionList = class HelixDescriptionList extends HelixHeadlessDescriptionList {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.divided = false;
|
|
15
|
+
}
|
|
12
16
|
static { this.styles = styles; }
|
|
13
17
|
};
|
|
18
|
+
__decorate([
|
|
19
|
+
property({ reflect: true, type: Boolean })
|
|
20
|
+
], HelixDescriptionList.prototype, "divided", void 0);
|
|
14
21
|
__decorate([
|
|
15
22
|
property({ reflect: true })
|
|
16
23
|
], HelixDescriptionList.prototype, "justify", void 0);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {--_divider-thickness: var(--divider-thickness, var(--helix-border-thin));align-items: center;display: flex;}[part="content"] {color: var(--divider-content-color, var(--helix-color-foreground-muted));margin-inline: var(--divider-content-gap, var(--helix-space-sm));display: inline-flex;flex: 0 0 auto;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);line-height: var(--helix-leading-tight);}[part="content"] slot::slotted(*),
|
|
2
|
+
export const styles = createSheet(`:host {--_divider-thickness: var(--divider-thickness, var(--helix-border-thin));align-items: center;display: flex;}[part="content"] {color: var(--divider-content-color, var(--helix-color-foreground-muted));margin-inline: var(--divider-content-gap, var(--helix-space-sm));display: inline-flex;flex: 0 0 auto;font-family: var(--divider-content-font-family, var(--helix-font-sans));font-size: var(--divider-content-font-size, var(--helix-text-xs));font-weight: var(--divider-content-font-weight, inherit);line-height: var(--helix-leading-tight);}[part="content"] slot::slotted(*),
|
|
3
3
|
[part="content"] {white-space: nowrap;}[part="content"][data-empty] {display: none;}:host {padding-inline-end: var(--divider-padding-end, var(--divider-padding, var(--helix-space-none)));padding-inline-start: var(
|
|
4
4
|
--divider-padding-start,
|
|
5
5
|
var(--divider-padding, var(--helix-space-none))
|
|
6
|
-
);}:host(
|
|
6
|
+
);}:host(:state(vertical)) {padding-block-end: var(--divider-padding-end, var(--divider-padding, var(--helix-space-none)));padding-block-start: var(
|
|
7
7
|
--divider-padding-start,
|
|
8
8
|
var(--divider-padding, var(--helix-space-none))
|
|
9
|
-
);padding-inline: var(--helix-space-none);}:host(
|
|
10
|
-
:host([orientation="horizontal"]) [part="line"] {block-size: var(--_divider-thickness);flex: 1 1 0;}:host([orientation="vertical"]) {block-size: var(--divider-length, auto);}:host([orientation="vertical"]) [part="line"] {flex: 1 1 0;inline-size: var(--_divider-thickness);min-block-size: 1em;}:host([content-placement="start"]) [part="line"]:has(+ [part="content"]:not([data-empty])),
|
|
9
|
+
);padding-inline: var(--helix-space-none);}:host(:state(vertical)) {align-self: stretch;display: inline-flex;flex-direction: column;}:host(:state(vertical)) [part="content"] {margin-block: var(--divider-content-gap, var(--helix-space-sm));margin-inline: var(--helix-space-none);}[part="line"] {background-color: var(--divider-color, var(--helix-color-border));}:host(:not(:state(vertical))) [part="line"] {block-size: var(--_divider-thickness);flex: 1 1 0;}:host(:state(vertical)) {block-size: var(--divider-length, auto);}:host(:state(vertical)) [part="line"] {flex: 1 1 0;inline-size: var(--_divider-thickness);min-block-size: 1em;}:host([content-placement="start"]) [part="line"]:has(+ [part="content"]:not([data-empty])),
|
|
11
10
|
:host([content-placement="end"]) [part="content"]:not([data-empty]) + [part="line"] {flex: 0 0 var(--divider-content-offset, var(--helix-space-lg));}@media print {:host {print-color-adjust: economy;}}`);
|
|
@@ -23,6 +23,9 @@ import type { CSSResultGroup } from 'lit';
|
|
|
23
23
|
*
|
|
24
24
|
* @cssproperty --divider-color - The color of the line.
|
|
25
25
|
* @cssproperty --divider-content-color - The color of the content set into the line.
|
|
26
|
+
* @cssproperty --divider-content-font-family - The typeface of the content set into the line. The sans face by default.
|
|
27
|
+
* @cssproperty --divider-content-font-size - The size of the content set into the line. The `xs` step by default.
|
|
28
|
+
* @cssproperty --divider-content-font-weight - The weight of the content set into the line. The weight around the divider by default.
|
|
26
29
|
* @cssproperty --divider-content-gap - The space either side of the content set into the line.
|
|
27
30
|
* @cssproperty --divider-content-offset - The length of line before the content under `content-placement="start"`, or after it under `end`.
|
|
28
31
|
* @cssproperty --divider-length - The length of a vertical line. A horizontal line takes the divider's width.
|
|
@@ -6,6 +6,7 @@ registerElementEvents({
|
|
|
6
6
|
'helix-aura': ['helix-aura-fallback'],
|
|
7
7
|
'helix-avatar': ['error', 'load'],
|
|
8
8
|
'helix-button': ['helix-press'],
|
|
9
|
+
'helix-button-group': ['change', 'helix-before-change'],
|
|
9
10
|
'helix-callout': ['helix-dismiss'],
|
|
10
11
|
'helix-canvas': [
|
|
11
12
|
'helix-before-move',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host
|
|
2
|
+
export const styles = createSheet(`:host([elapsed]) {font-variant-numeric: tabular-nums;}@media print {:host([elapsed]) [part="time"]::after {content: " (" attr(datetime) ")";}}`);
|
|
@@ -15,7 +15,6 @@ import type { CSSResultGroup } from 'lit';
|
|
|
15
15
|
* @documentation https://fusion.dev/helix/components/format-date
|
|
16
16
|
*/
|
|
17
17
|
export declare class HelixFormatDate extends HelixHeadlessFormatDate {
|
|
18
|
-
static tier: string;
|
|
19
18
|
static styles: CSSResultGroup;
|
|
20
19
|
}
|
|
21
20
|
declare global {
|
|
@@ -8,7 +8,6 @@ import { customElement } from '@fusion.dev/helix-core';
|
|
|
8
8
|
import { HelixHeadlessFormatDate } from '@fusion.dev/helix-headless/format-date';
|
|
9
9
|
import { styles } from './format-date-root.css.js';
|
|
10
10
|
let HelixFormatDate = class HelixFormatDate extends HelixHeadlessFormatDate {
|
|
11
|
-
static { this.tier = 'helix-'; }
|
|
12
11
|
static { this.styles = styles; }
|
|
13
12
|
};
|
|
14
13
|
HelixFormatDate = __decorate([
|