@fusion.dev/helix 0.144.0 → 0.145.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 +9978 -916
- package/dist/accordion/item/accordion-item.css.js +14 -3
- package/dist/accordion/item/accordion-item.d.ts +2 -0
- package/dist/aura/palette.d.ts +38 -0
- package/dist/aura/palette.js +22 -0
- package/dist/aura/root/aura-root.css.js +24 -3
- package/dist/aura/root/aura-root.d.ts +42 -7
- package/dist/aura/root/aura-root.js +31 -25
- package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +7 -7
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +5 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.css.js +1 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +3 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +2 -0
- package/dist/button-group/root/button-group-root.d.ts +3 -0
- package/dist/canvas/root/canvas-root.css.js +1 -0
- package/dist/carousel/root/carousel-root.css.js +17 -1
- package/dist/data-table/root/data-table-root.css.js +63 -0
- package/dist/data-table/root/data-table-root.d.ts +1 -0
- package/dist/description-list/item/description-list-item.css.js +11 -0
- package/dist/drilldown/item/drilldown-item.css.js +2 -1
- package/dist/drilldown/root/drilldown-root.css.js +2 -1
- package/dist/element-events.generated.js +58 -9
- package/dist/flex/root/flex-root.css.js +134 -9
- package/dist/flex/root/flex-root.d.ts +51 -5
- package/dist/flex/root/flex-root.js +17 -1
- package/dist/grid/root/grid-root.css.js +114 -11
- package/dist/grid/root/grid-root.d.ts +37 -0
- package/dist/grid/root/grid-root.js +13 -1
- package/dist/list/item/list-item.css.js +21 -1
- package/dist/list/item/list-item.d.ts +3 -0
- package/dist/list/root/list-root.css.js +13 -1
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +1 -0
- package/dist/menu/item/menu-item.css.js +15 -1
- package/dist/menu/item/menu-item.d.ts +3 -0
- package/dist/menu/item/menu-item.js +2 -0
- package/dist/menu/section/menu-section.css.d.ts +1 -0
- package/dist/menu/section/menu-section.css.js +14 -0
- package/dist/menu/section/menu-section.d.ts +24 -0
- package/dist/menu/section/menu-section.js +16 -0
- package/dist/navigation/root/navigation-root.css.js +3 -2
- package/dist/navigation/root/navigation-root.d.ts +6 -0
- package/dist/notifications/root/notifications-root.css.js +24 -1
- package/dist/notifications/root/notifications-root.d.ts +1 -0
- package/dist/object-inspector/root/object-inspector-root.css.js +36 -1
- package/dist/object-inspector/root/object-inspector-root.d.ts +4 -1
- package/dist/object-inspector/root/object-inspector-root.js +2 -1
- package/dist/orb/index.d.ts +1 -1
- package/dist/orb/index.js +1 -1
- package/dist/orb/root/orb-root.d.ts +31 -5
- package/dist/orb/root/orb-root.js +33 -4
- package/dist/outline/root/outline-root.css.js +10 -0
- package/dist/outline/root/outline-root.d.ts +7 -0
- package/dist/sandbox/frame.d.ts +63 -0
- package/dist/sandbox/frame.js +132 -0
- package/dist/sandbox/index.d.ts +1 -0
- package/dist/sandbox/index.js +1 -0
- package/dist/sandbox/levels.d.ts +10 -0
- package/dist/sandbox/levels.js +5 -0
- package/dist/sandbox/root/sandbox-root.d.ts +3 -0
- package/dist/sandbox/root/sandbox-root.js +13 -3
- package/dist/sandbox/source/sandbox-source.d.ts +1 -0
- package/dist/sandbox/source/sandbox-source.js +7 -3
- package/dist/sandbox/terminal/sandbox-terminal.css.js +39 -0
- package/dist/sandbox/terminal/sandbox-terminal.d.ts +42 -1
- package/dist/sandbox/terminal/sandbox-terminal.js +47 -3
- package/dist/scroll-area/root/scroll-area-root.css.js +83 -1
- package/dist/scroll-area/root/scroll-area-root.d.ts +6 -0
- package/dist/skip-link/root/skip-link-root.css.js +8 -8
- package/dist/skip-link/root/skip-link-root.d.ts +9 -0
- package/dist/speed-dial/item/speed-dial-item.css.js +11 -4
- package/dist/speed-dial/item/speed-dial-item.d.ts +4 -0
- package/dist/speed-dial/root/speed-dial-root.css.js +7 -3
- package/dist/speed-dial/root/speed-dial-root.d.ts +9 -0
- package/dist/speed-dial/root/speed-dial-root.js +4 -0
- package/dist/steps/step/step.js +2 -1
- package/dist/table/root/table-root.css.js +18 -0
- package/dist/table/root/table-root.d.ts +6 -0
- package/dist/table/root/table-root.js +2 -0
- package/dist/table/row/table-row.css.js +18 -0
- package/dist/table/row/table-row.d.ts +2 -0
- package/dist/table/row/table-row.js +2 -0
- package/dist/tabs/panel/tab-panel.css.js +5 -1
- package/dist/tabs/root/tabs-root.css.js +56 -1
- package/dist/tabs/tab/tab.css.js +5 -1
- package/dist/text/clamp.d.ts +8 -0
- package/dist/text/clamp.js +1 -0
- package/dist/text/root/text-root.css.js +85 -45
- package/dist/text/root/text-root.d.ts +48 -7
- package/dist/text/root/text-root.js +17 -11
- package/dist/timeline/group/timeline-group.css.d.ts +1 -0
- package/dist/timeline/group/timeline-group.css.js +32 -0
- package/dist/timeline/group/timeline-group.d.ts +25 -0
- package/dist/timeline/group/timeline-group.js +16 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +1 -0
- package/dist/timeline/item/timeline-item.css.js +43 -16
- package/dist/timeline/root/timeline-root.css.js +56 -0
- package/dist/timeline/root/timeline-root.d.ts +26 -0
- package/dist/timeline/root/timeline-root.js +7 -0
- package/dist/toolbar/root/toolbar-root.css.js +3 -0
- package/dist/toolbar/root/toolbar-root.d.ts +3 -0
- package/dist/tree/item/tree-item.css.js +72 -0
- package/dist/tree/item/tree-item.d.ts +10 -0
- package/dist/video/root/video-root.css.js +6 -0
- package/dist/video/root/video-root.d.ts +3 -0
- package/dist/virtual-list/root/virtual-list-root.css.js +5 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +4 -3
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +4033 -671
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +1078 -202
|
@@ -25,6 +25,14 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
|
|
|
25
25
|
* state. Combining them would need a variant for every pair, such as
|
|
26
26
|
* `caption-danger` and `label-muted`.
|
|
27
27
|
*
|
|
28
|
+
* `lines` cuts the text off after that many lines and ends it with an
|
|
29
|
+
* ellipsis. `text-wrap` balances or tidies the line breaks, and `text-align`
|
|
30
|
+
* sets the alignment. Each `--text-*` property overrides one value of the
|
|
31
|
+
* ramp, for a text or for every text inside an element.
|
|
32
|
+
*
|
|
33
|
+
* **To label a control, write a native `<label data-text="label">`.** The
|
|
34
|
+
* base layer gives it the label ramp. A Helix field takes its own `label`.
|
|
35
|
+
*
|
|
28
36
|
* @since 0.1.0
|
|
29
37
|
* @status stable
|
|
30
38
|
* @category typography
|
|
@@ -34,6 +42,12 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
|
|
|
34
42
|
* @slot - The text.
|
|
35
43
|
*
|
|
36
44
|
* @csspart text - The rendered element.
|
|
45
|
+
*
|
|
46
|
+
* @cssproperty --text-font-family - The typeface. Overrides the ramp's.
|
|
47
|
+
* @cssproperty --text-font-size - The size. Overrides the ramp's.
|
|
48
|
+
* @cssproperty --text-font-weight - The weight. Overrides the ramp's.
|
|
49
|
+
* @cssproperty --text-letter-spacing - The tracking. Overrides the ramp's.
|
|
50
|
+
* @cssproperty --text-line-height - The leading. Overrides the ramp's.
|
|
37
51
|
*/
|
|
38
52
|
export declare class HelixText extends HelixElement {
|
|
39
53
|
/**
|
|
@@ -41,12 +55,14 @@ export declare class HelixText extends HelixElement {
|
|
|
41
55
|
*
|
|
42
56
|
* Decides the outline and the semantics.
|
|
43
57
|
*
|
|
44
|
-
* **`label`
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
58
|
+
* **`label` is deprecated and no longer listed.** The element is in this
|
|
59
|
+
* one's shadow root, which neither `for` nor a wrapped control can reach, so
|
|
60
|
+
* it labeled nothing. Written anyway, it still renders a `<label>` in the
|
|
61
|
+
* label ramp and warns. Use `variant="label"` for the look, a native
|
|
62
|
+
* `<label data-text="label">` to label a native control, and a Helix field's
|
|
63
|
+
* own `label`.
|
|
48
64
|
*/
|
|
49
|
-
as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'strong' | 'em' | 'code'
|
|
65
|
+
as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'strong' | 'em' | 'code';
|
|
50
66
|
/**
|
|
51
67
|
* Makes the text quieter: `muted`, or the quieter `subtle`.
|
|
52
68
|
*
|
|
@@ -64,6 +80,33 @@ export declare class HelixText extends HelixElement {
|
|
|
64
80
|
* The resting case is the absent attribute, full strength.
|
|
65
81
|
*/
|
|
66
82
|
emphasis?: 'muted' | 'subtle';
|
|
83
|
+
/**
|
|
84
|
+
* The most lines to show. Text past the last one is cut off with an
|
|
85
|
+
* ellipsis.
|
|
86
|
+
*
|
|
87
|
+
* Lays the text out as a block, because a line count needs a width to break
|
|
88
|
+
* against. The whole text stays in the page, so a screen reader and a search
|
|
89
|
+
* still read all of it. Set it as an attribute, such as `lines="1"` for a
|
|
90
|
+
* single line.
|
|
91
|
+
*/
|
|
92
|
+
lines?: number;
|
|
93
|
+
/**
|
|
94
|
+
* How the lines align, set as `text-align`.
|
|
95
|
+
*
|
|
96
|
+
* Named for the CSS property it sets. `align` alone is a legacy HTML
|
|
97
|
+
* attribute the browser maps to `text-align` by itself on any element, and
|
|
98
|
+
* it has no `start` or `end`.
|
|
99
|
+
*/
|
|
100
|
+
textAlign?: 'start' | 'center' | 'end' | 'justify';
|
|
101
|
+
/**
|
|
102
|
+
* How the lines break, set as `text-wrap`.
|
|
103
|
+
*
|
|
104
|
+
* `balance` evens out the length of every line, for a heading of a few
|
|
105
|
+
* lines. `pretty` avoids a last line of one short word, for a paragraph.
|
|
106
|
+
* `nowrap` keeps the text on one line. Absent, the lines break as the
|
|
107
|
+
* browser breaks them.
|
|
108
|
+
*/
|
|
109
|
+
textWrap?: 'balance' | 'pretty' | 'nowrap';
|
|
67
110
|
/**
|
|
68
111
|
* The meaning of the text, shown by its color, such as `danger` or `success`.
|
|
69
112
|
* It is set separately from `variant`.
|
|
@@ -84,8 +127,6 @@ export declare class HelixText extends HelixElement {
|
|
|
84
127
|
*/
|
|
85
128
|
variant?: 'display' | 'heading' | 'subheading' | 'title' | 'body' | 'body-strong' | 'caption' | 'label' | 'code';
|
|
86
129
|
protected updated(changed: PropertyValues): void;
|
|
87
|
-
/** Whether the page wrote this as the label of a control, which it cannot be. */
|
|
88
|
-
private labelsNothing;
|
|
89
130
|
protected render(): unknown;
|
|
90
131
|
static styles: CSSResultGroup;
|
|
91
132
|
}
|
|
@@ -5,8 +5,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { customElement, HelixElement, reportRuntime } from '@fusion.dev/helix-core';
|
|
8
|
+
import { nothing } from 'lit';
|
|
8
9
|
import { property } from 'lit/decorators.js';
|
|
9
10
|
import { literal, html as staticHtml } from 'lit/static-html.js';
|
|
11
|
+
import { clampOf } from '../clamp.js';
|
|
10
12
|
import { styles } from './text-root.css.js';
|
|
11
13
|
const TAGS = {
|
|
12
14
|
code: literal `code`,
|
|
@@ -25,25 +27,20 @@ const TAGS = {
|
|
|
25
27
|
let HelixText = class HelixText extends HelixElement {
|
|
26
28
|
updated(changed) {
|
|
27
29
|
super.updated(changed);
|
|
28
|
-
if (changed.has('as') && this.as === 'label'
|
|
30
|
+
if (changed.has('as') && this.as === 'label') {
|
|
29
31
|
reportRuntime({
|
|
30
32
|
kind: 'unreachable-label',
|
|
31
|
-
message: '<helix-text as="label">
|
|
32
|
-
'
|
|
33
|
-
'
|
|
33
|
+
message: '<helix-text as="label"> is deprecated: its label is in a shadow root, which `for` ' +
|
|
34
|
+
'and a wrapped control cannot reach, so it labels nothing. Write `variant="label"` ' +
|
|
35
|
+
'for the look, `<label data-text="label">` for a native control, and give a Helix ' +
|
|
36
|
+
'field its own `label`.',
|
|
34
37
|
tag: this.localName,
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
|
-
labelsNothing() {
|
|
39
|
-
const fields = [...this.querySelectorAll('*')].some((element) => element.constructor.formAssociated === true);
|
|
40
|
-
return (fields ||
|
|
41
|
-
this.hasAttribute('for') ||
|
|
42
|
-
this.querySelector('input, select, textarea, button, meter, output, progress') !== null);
|
|
43
|
-
}
|
|
44
41
|
render() {
|
|
45
42
|
const tag = (this.as && Object.hasOwn(TAGS, this.as) ? TAGS[this.as] : undefined) ?? literal `span`;
|
|
46
|
-
return staticHtml `<${tag} part="text"><slot></slot></${tag}>`;
|
|
43
|
+
return staticHtml `<${tag} part="text" style=${clampOf(this.lines) ?? nothing}><slot></slot></${tag}>`;
|
|
47
44
|
}
|
|
48
45
|
static { this.styles = styles; }
|
|
49
46
|
};
|
|
@@ -53,6 +50,15 @@ __decorate([
|
|
|
53
50
|
__decorate([
|
|
54
51
|
property({ reflect: true })
|
|
55
52
|
], HelixText.prototype, "emphasis", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
property({ reflect: true, type: Number })
|
|
55
|
+
], HelixText.prototype, "lines", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
property({ attribute: 'text-align', reflect: true })
|
|
58
|
+
], HelixText.prototype, "textAlign", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
property({ attribute: 'text-wrap', reflect: true })
|
|
61
|
+
], HelixText.prototype, "textWrap", void 0);
|
|
56
62
|
__decorate([
|
|
57
63
|
property({ reflect: true })
|
|
58
64
|
], HelixText.prototype, "tone", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
+
export const styles = createSheet(`:host {
|
|
3
|
+
display: block;
|
|
4
|
+
padding-block-end: var(--timeline-gap, var(--helix-space-lg));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host(:last-child) {
|
|
8
|
+
padding-block-end: var(--helix-space-none);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[part="heading"] {
|
|
12
|
+
color: var(--timeline-group-heading-color, var(--helix-color-foreground));
|
|
13
|
+
font-size: var(--helix-text-sm);
|
|
14
|
+
font-weight: var(--helix-weight-semibold);
|
|
15
|
+
padding-block-end: var(--helix-space-sm);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[part="entries"] {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: var(--_timeline-direction, column);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
::slotted(*) {
|
|
24
|
+
flex: var(--_timeline-entry-flex, 0 1 auto);
|
|
25
|
+
min-inline-size: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media print {
|
|
29
|
+
:host {
|
|
30
|
+
break-inside: avoid-page;
|
|
31
|
+
}
|
|
32
|
+
}`);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HelixHeadlessTimelineGroup } from '@fusion.dev/helix-headless/timeline';
|
|
2
|
+
import type { CSSResultGroup } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A run of timeline entries under a heading, such as a day.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* The heading sits at the start edge, over the entries, in the small heavy
|
|
8
|
+
* type of a section label, and the space under one group is the space between
|
|
9
|
+
* two entries.
|
|
10
|
+
*
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
* @status stable
|
|
13
|
+
* @aliases Day, Section, Date group
|
|
14
|
+
* @documentation https://fusion.dev/helix/components/timeline
|
|
15
|
+
*
|
|
16
|
+
* @cssproperty --timeline-group-heading-color - The color of the heading.
|
|
17
|
+
*/
|
|
18
|
+
export declare class HelixTimelineGroup extends HelixHeadlessTimelineGroup {
|
|
19
|
+
static styles: CSSResultGroup;
|
|
20
|
+
}
|
|
21
|
+
declare global {
|
|
22
|
+
interface HTMLElementTagNameMap {
|
|
23
|
+
'helix-timeline-group': HelixTimelineGroup;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement } from '@fusion.dev/helix-core';
|
|
8
|
+
import { HelixHeadlessTimelineGroup } from '@fusion.dev/helix-headless/timeline';
|
|
9
|
+
import { styles } from './timeline-group.css.js';
|
|
10
|
+
let HelixTimelineGroup = class HelixTimelineGroup extends HelixHeadlessTimelineGroup {
|
|
11
|
+
static { this.styles = styles; }
|
|
12
|
+
};
|
|
13
|
+
HelixTimelineGroup = __decorate([
|
|
14
|
+
customElement('helix-timeline-group')
|
|
15
|
+
], HelixTimelineGroup);
|
|
16
|
+
export { HelixTimelineGroup };
|
package/dist/timeline/index.d.ts
CHANGED
package/dist/timeline/index.js
CHANGED
|
@@ -2,21 +2,26 @@ import { createSheet } from '@fusion.dev/helix-core';
|
|
|
2
2
|
export const styles = createSheet(`:host {
|
|
3
3
|
column-gap: var(--helix-space-md);
|
|
4
4
|
display: grid;
|
|
5
|
-
|
|
6
|
-
grid-template-
|
|
5
|
+
|
|
6
|
+
grid-template-columns: var(--_timeline-columns, auto minmax(0, 1fr));
|
|
7
|
+
grid-template-rows: var(--_timeline-rows, auto minmax(0, 1fr));
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
[part="rail"] {
|
|
11
|
+
align-items: var(--_timeline-rail-align, normal);
|
|
10
12
|
display: grid;
|
|
11
|
-
grid-
|
|
12
|
-
grid-
|
|
13
|
-
|
|
13
|
+
grid-column: var(--_timeline-rail-column, auto);
|
|
14
|
+
grid-row: var(--_timeline-rail-row, 1 / -1);
|
|
15
|
+
grid-template-columns: var(--_timeline-rail-columns, none);
|
|
16
|
+
grid-template-rows: var(--_timeline-rail-rows, subgrid);
|
|
17
|
+
justify-items: var(--_timeline-rail-justify, center);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
[part="rail"]::before {
|
|
17
21
|
background-color: var(--helix-color-border);
|
|
18
22
|
block-size: 100%;
|
|
19
23
|
content: "";
|
|
24
|
+
display: var(--_timeline-arrive-display, block);
|
|
20
25
|
grid-column: 1;
|
|
21
26
|
grid-row: 1;
|
|
22
27
|
inline-size: var(--timeline-rail-size, var(--helix-border-thin));
|
|
@@ -27,14 +32,22 @@ visibility: hidden;
|
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
[part="rail"]::after {
|
|
30
|
-
align-self: stretch;
|
|
35
|
+
align-self: var(--_timeline-leave-align, stretch);
|
|
31
36
|
background-color: var(--helix-color-border);
|
|
37
|
+
block-size: var(--_timeline-leave-block-size, auto);
|
|
32
38
|
content: "";
|
|
33
39
|
|
|
34
|
-
grid-column: 1;
|
|
35
|
-
grid-row: 2;
|
|
36
|
-
inline-size: var(
|
|
37
|
-
|
|
40
|
+
grid-column: var(--_timeline-leave-column, 1);
|
|
41
|
+
grid-row: var(--_timeline-leave-row, 2);
|
|
42
|
+
inline-size: var(
|
|
43
|
+
--_timeline-leave-inline-size,
|
|
44
|
+
var(--timeline-rail-size, var(--helix-border-thin))
|
|
45
|
+
);
|
|
46
|
+
justify-self: var(--_timeline-leave-justify, auto);
|
|
47
|
+
margin-block-start: var(
|
|
48
|
+
--_timeline-leave-margin-block,
|
|
49
|
+
var(--timeline-marker-size, var(--helix-size-icon-md))
|
|
50
|
+
);
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
:host(:last-child) [part="rail"]::after {
|
|
@@ -52,7 +65,7 @@ border-radius: var(--timeline-marker-radius, var(--helix-radii-full));
|
|
|
52
65
|
color: var(--_timeline-tone, var(--helix-color-foreground-subtle));
|
|
53
66
|
display: inline-flex;
|
|
54
67
|
grid-column: 1;
|
|
55
|
-
grid-row: 2;
|
|
68
|
+
grid-row: var(--_timeline-marker-row, 2);
|
|
56
69
|
inline-size: var(--timeline-marker-size, var(--helix-size-icon-md));
|
|
57
70
|
justify-content: center;
|
|
58
71
|
}
|
|
@@ -92,21 +105,35 @@ color: var(--helix-color-foreground-muted);
|
|
|
92
105
|
font-family: var(--helix-font-sans);
|
|
93
106
|
font-size: var(--helix-text-xs);
|
|
94
107
|
font-weight: var(--helix-weight-medium);
|
|
95
|
-
grid-column: 2;
|
|
96
|
-
grid-row: 1;
|
|
108
|
+
grid-column: var(--_timeline-time-column, 2);
|
|
109
|
+
grid-row: var(--_timeline-time-row, 1);
|
|
97
110
|
padding-block-end: var(--helix-space-2xs);
|
|
111
|
+
|
|
112
|
+
text-align: var(--_timeline-time-align);
|
|
98
113
|
}
|
|
99
114
|
|
|
100
115
|
[part="content"] {
|
|
101
116
|
display: flex;
|
|
102
117
|
flex-direction: column;
|
|
103
118
|
gap: var(--helix-space-2xs);
|
|
104
|
-
grid-column: 2;
|
|
105
|
-
grid-row: 2;
|
|
119
|
+
grid-column: var(--_timeline-content-column, 2);
|
|
120
|
+
grid-row: var(--_timeline-content-row, 2);
|
|
106
121
|
min-inline-size: 0;
|
|
107
|
-
padding-block-end: var(--timeline-gap, var(--helix-space-lg));
|
|
122
|
+
padding-block-end: var(--_timeline-content-block-end, var(--timeline-gap, var(--helix-space-lg)));
|
|
123
|
+
padding-inline-end: var(--_timeline-content-inline-end, var(--helix-space-none));
|
|
108
124
|
}
|
|
109
125
|
|
|
110
126
|
:host(:last-child) [part="content"] {
|
|
111
127
|
padding-block-end: var(--helix-space-none);
|
|
128
|
+
padding-inline-end: var(--helix-space-none);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host(:nth-child(even)) [part="time"] {
|
|
132
|
+
grid-column: var(--_timeline-even-column, var(--_timeline-time-column, 2));
|
|
133
|
+
text-align: var(--_timeline-even-align, var(--_timeline-time-align));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host(:nth-child(even)) [part="content"] {
|
|
137
|
+
grid-column: var(--_timeline-even-column, var(--_timeline-content-column, 2));
|
|
138
|
+
text-align: var(--_timeline-even-align);
|
|
112
139
|
}`);
|
|
@@ -4,6 +4,62 @@ display: flex;
|
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
:host([layout="opposite"]) {
|
|
8
|
+
--_timeline-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
9
|
+
--_timeline-content-column: 3;
|
|
10
|
+
--_timeline-rail-column: 2;
|
|
11
|
+
--_timeline-time-align: end;
|
|
12
|
+
--_timeline-time-column: 1;
|
|
13
|
+
--_timeline-time-row: 2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([layout="alternate"]) {
|
|
17
|
+
--_timeline-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
18
|
+
--_timeline-content-column: 3;
|
|
19
|
+
--_timeline-even-align: end;
|
|
20
|
+
--_timeline-even-column: 1;
|
|
21
|
+
--_timeline-rail-column: 2;
|
|
22
|
+
--_timeline-time-column: 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([orientation="horizontal"]) {
|
|
26
|
+
--_timeline-arrive-display: none;
|
|
27
|
+
--_timeline-columns: minmax(0, 1fr);
|
|
28
|
+
--_timeline-content-block-end: var(--helix-space-none);
|
|
29
|
+
--_timeline-content-column: 1;
|
|
30
|
+
--_timeline-content-inline-end: var(--timeline-gap, var(--helix-space-lg));
|
|
31
|
+
--_timeline-content-row: 3;
|
|
32
|
+
--_timeline-direction: row;
|
|
33
|
+
--_timeline-entry-flex: 1 1 0;
|
|
34
|
+
--_timeline-even-align: initial;
|
|
35
|
+
--_timeline-even-column: initial;
|
|
36
|
+
--_timeline-leave-align: center;
|
|
37
|
+
--_timeline-leave-block-size: var(--timeline-rail-size, var(--helix-border-thin));
|
|
38
|
+
--_timeline-leave-column: 2;
|
|
39
|
+
--_timeline-leave-inline-size: auto;
|
|
40
|
+
--_timeline-leave-justify: stretch;
|
|
41
|
+
--_timeline-leave-margin-block: var(--helix-space-none);
|
|
42
|
+
--_timeline-leave-row: 1;
|
|
43
|
+
--_timeline-marker-row: 1;
|
|
44
|
+
--_timeline-rail-align: center;
|
|
45
|
+
--_timeline-rail-column: 1;
|
|
46
|
+
--_timeline-rail-columns: auto minmax(0, 1fr);
|
|
47
|
+
--_timeline-rail-justify: start;
|
|
48
|
+
--_timeline-rail-row: 1;
|
|
49
|
+
--_timeline-rail-rows: auto;
|
|
50
|
+
--_timeline-rows: auto auto minmax(0, 1fr);
|
|
51
|
+
--_timeline-time-align: initial;
|
|
52
|
+
--_timeline-time-column: 1;
|
|
53
|
+
--_timeline-time-row: 2;
|
|
54
|
+
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([orientation="horizontal"]) ::slotted(*) {
|
|
59
|
+
flex: 1 1 0;
|
|
60
|
+
min-inline-size: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
7
63
|
@media print {
|
|
8
64
|
:host {
|
|
9
65
|
print-color-adjust: economy;
|
|
@@ -7,6 +7,19 @@ import type { CSSResultGroup } from 'lit';
|
|
|
7
7
|
* Sets the direction time runs in and the spacing between events. Each entry
|
|
8
8
|
* draws its own mark and line.
|
|
9
9
|
*
|
|
10
|
+
* `layout` and `orientation` move where the entries are drawn, and never the
|
|
11
|
+
* order they are read in, which is the order you write them in:
|
|
12
|
+
*
|
|
13
|
+
* - Unset, the line runs down the start edge, with each time over what
|
|
14
|
+
* happened.
|
|
15
|
+
* - `layout="opposite"` runs the line down the middle, with each time on the
|
|
16
|
+
* start side and what happened on the end side.
|
|
17
|
+
* - `layout="alternate"` runs the line down the middle, with the first entry on
|
|
18
|
+
* the end side, the second on the start side, and so on.
|
|
19
|
+
* - `orientation="horizontal"` runs the line across the top, with the entries
|
|
20
|
+
* side by side in the order they are read, and the time over what happened
|
|
21
|
+
* under each mark. Use it for a few entries, since they share the width.
|
|
22
|
+
*
|
|
10
23
|
* @since 0.1.0
|
|
11
24
|
* @status stable
|
|
12
25
|
* @category data
|
|
@@ -17,6 +30,19 @@ import type { CSSResultGroup } from 'lit';
|
|
|
17
30
|
*/
|
|
18
31
|
export declare class HelixTimeline extends HelixHeadlessTimeline {
|
|
19
32
|
static styles: CSSResultGroup;
|
|
33
|
+
/**
|
|
34
|
+
* Where the entries sit beside the line: `opposite` puts the times on one
|
|
35
|
+
* side and what happened on the other, and `alternate` puts every other
|
|
36
|
+
* entry on the other side. Unset, the line runs down the start edge.
|
|
37
|
+
*
|
|
38
|
+
* Down the page only: across the page it is set aside.
|
|
39
|
+
*/
|
|
40
|
+
layout?: 'alternate' | 'opposite';
|
|
41
|
+
/**
|
|
42
|
+
* Which way time runs: `horizontal` lays the entries across the page. Unset,
|
|
43
|
+
* they run down it.
|
|
44
|
+
*/
|
|
45
|
+
orientation?: 'horizontal';
|
|
20
46
|
}
|
|
21
47
|
declare global {
|
|
22
48
|
interface HTMLElementTagNameMap {
|
|
@@ -6,10 +6,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { customElement } from '@fusion.dev/helix-core';
|
|
8
8
|
import { HelixHeadlessTimeline } from '@fusion.dev/helix-headless/timeline';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
9
10
|
import { styles } from './timeline-root.css.js';
|
|
10
11
|
let HelixTimeline = class HelixTimeline extends HelixHeadlessTimeline {
|
|
11
12
|
static { this.styles = styles; }
|
|
12
13
|
};
|
|
14
|
+
__decorate([
|
|
15
|
+
property({ reflect: true })
|
|
16
|
+
], HelixTimeline.prototype, "layout", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
property({ reflect: true })
|
|
19
|
+
], HelixTimeline.prototype, "orientation", void 0);
|
|
13
20
|
HelixTimeline = __decorate([
|
|
14
21
|
customElement('helix-timeline')
|
|
15
22
|
], HelixTimeline);
|
|
@@ -18,8 +18,11 @@ display: inline-flex;
|
|
|
18
18
|
|
|
19
19
|
[part="toolbar"] {
|
|
20
20
|
align-items: center;
|
|
21
|
+
background-color: var(--toolbar-background-color, transparent);
|
|
22
|
+
border-radius: var(--toolbar-radius, var(--helix-radii-none));
|
|
21
23
|
display: flex;
|
|
22
24
|
gap: var(--toolbar-gap, var(--helix-space-2xs));
|
|
25
|
+
padding: var(--toolbar-padding, var(--helix-space-none));
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
:host([orientation="vertical"]) [part="toolbar"] {
|
|
@@ -17,7 +17,10 @@ import type { CSSResultGroup } from 'lit';
|
|
|
17
17
|
*
|
|
18
18
|
* @csspart toolbar - The toolbar container.
|
|
19
19
|
*
|
|
20
|
+
* @cssproperty --toolbar-background-color - The fill behind the controls. Transparent unless set.
|
|
20
21
|
* @cssproperty --toolbar-gap - The space between controls.
|
|
22
|
+
* @cssproperty --toolbar-padding - The space between the toolbar's edge and its controls.
|
|
23
|
+
* @cssproperty --toolbar-radius - The corner radius of the toolbar's fill.
|
|
21
24
|
*/
|
|
22
25
|
export declare class HelixToolbar extends HelixHeadlessToolbar {
|
|
23
26
|
static styles: CSSResultGroup;
|
|
@@ -166,4 +166,76 @@ grid-template-rows: 0fr;
|
|
|
166
166
|
align-self: center;
|
|
167
167
|
margin-inline-start: var(--tree-chevron-gap, var(--helix-space-none));
|
|
168
168
|
order: var(--tree-chevron-order, 0);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
slot[name="chevron"]::slotted(*) {
|
|
172
|
+
align-self: center;
|
|
173
|
+
block-size: var(--_tree-chevron);
|
|
174
|
+
color: var(--helix-color-foreground-subtle);
|
|
175
|
+
flex: 0 0 auto;
|
|
176
|
+
inline-size: var(--_tree-chevron);
|
|
177
|
+
margin-inline-start: var(--tree-chevron-gap, var(--helix-space-none));
|
|
178
|
+
order: var(--tree-chevron-order, 0);
|
|
179
|
+
transform: rotate(-90deg);
|
|
180
|
+
transition: transform var(--helix-duration-fast) var(--helix-easing-standard);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host(:dir(rtl)) slot[name="chevron"]::slotted(*) {
|
|
184
|
+
transform: rotate(90deg);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host(:state(open)) slot[name="chevron"]::slotted(*) {
|
|
188
|
+
transform: rotate(0deg);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[part~="checkbox"] {
|
|
192
|
+
align-self: center;
|
|
193
|
+
background-color: var(--tree-checkbox-background-color, var(--helix-color-background));
|
|
194
|
+
block-size: var(--tree-checkbox-size, var(--_tree-chevron));
|
|
195
|
+
border: var(--helix-border-thin) solid
|
|
196
|
+
var(--tree-checkbox-border-color, var(--helix-color-border));
|
|
197
|
+
border-radius: var(--helix-radii-sm);
|
|
198
|
+
color: var(--tree-checkbox-mark-color, var(--helix-color-foreground));
|
|
199
|
+
display: grid;
|
|
200
|
+
flex: 0 0 auto;
|
|
201
|
+
inline-size: var(--tree-checkbox-size, var(--_tree-chevron));
|
|
202
|
+
place-items: center;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
[part~="checkbox-checked"],
|
|
206
|
+
[part~="checkbox-mixed"] {
|
|
207
|
+
border-color: var(--tree-checkbox-border-color, var(--helix-color-foreground));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[part~="checkbox"] svg {
|
|
211
|
+
block-size: 80%;
|
|
212
|
+
inline-size: 80%;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:host([disabled]) [part="row"] {
|
|
216
|
+
cursor: not-allowed;
|
|
217
|
+
opacity: 0.5;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host([disabled]) [part="row"]:hover {
|
|
221
|
+
background-color: transparent;
|
|
222
|
+
color: var(--helix-color-foreground-muted);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:host(:state(loading)) [part="toggle"],
|
|
226
|
+
:host(:state(loading)) slot[name="chevron"]::slotted(*) {
|
|
227
|
+
animation: tree-loading var(--helix-duration-slow) var(--helix-easing-standard) infinite alternate;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@keyframes tree-loading {
|
|
231
|
+
to {
|
|
232
|
+
opacity: 0.3;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media (prefers-reduced-motion: reduce) {
|
|
237
|
+
:host(:state(loading)) [part="toggle"],
|
|
238
|
+
:host(:state(loading)) slot[name="chevron"]::slotted(*) {
|
|
239
|
+
animation: none;
|
|
240
|
+
}
|
|
169
241
|
}`);
|
|
@@ -16,16 +16,26 @@ import type { CSSResultGroup } from 'lit';
|
|
|
16
16
|
* @documentation https://fusion.dev/helix/components/tree
|
|
17
17
|
*
|
|
18
18
|
* @slot - The item's label.
|
|
19
|
+
* @slot chevron - Replaces the expand and collapse mark of a branch. A slotted icon is sized and
|
|
20
|
+
* turned like the drawn one.
|
|
19
21
|
* @slot children - Nested items, which make this a branch.
|
|
20
22
|
*
|
|
21
23
|
* @event {HelixSelectEvent} helix-select - Fired when the item is chosen, and cancelable. Canceling it changes nothing.
|
|
22
24
|
*
|
|
25
|
+
* @csspart checkbox - The check mark's box, in a tree with `selection-mode="multiple"`.
|
|
26
|
+
* @csspart checkbox-checked - The check mark's box while the item is checked.
|
|
27
|
+
* @csspart checkbox-mixed - The check mark's box while some of a branch's items are checked.
|
|
23
28
|
* @csspart group - The container for nested items.
|
|
24
29
|
* @csspart item - The node, and the focus target.
|
|
25
30
|
* @csspart label - The label text.
|
|
26
31
|
* @csspart row - The clickable label row.
|
|
27
32
|
* @csspart toggle - The expand and collapse control.
|
|
28
33
|
*
|
|
34
|
+
* @cssproperty --tree-checkbox-background-color - Fill of the check mark's box.
|
|
35
|
+
* @cssproperty --tree-checkbox-border-color - Border of the check mark's box.
|
|
36
|
+
* @cssproperty --tree-checkbox-mark-color - Color of the check, and of the bar of a partly checked
|
|
37
|
+
* branch.
|
|
38
|
+
* @cssproperty --tree-checkbox-size - Size of the check mark's box. Follows the chevron's size.
|
|
29
39
|
* @cssproperty --tree-chevron-size - Size of the chevron, and the gutter a leaf reserves.
|
|
30
40
|
* @cssproperty --tree-gap - Space between rows.
|
|
31
41
|
* @cssproperty --tree-indent - Indent added per level.
|
|
@@ -104,6 +104,12 @@ min-block-size: var(--helix-size-icon-loose);
|
|
|
104
104
|
min-inline-size: var(--helix-size-icon-loose);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
slot[name$="-icon"]::slotted(*) {
|
|
108
|
+
block-size: var(--icon-size, var(--helix-size-icon));
|
|
109
|
+
flex: 0 0 auto;
|
|
110
|
+
inline-size: var(--icon-size, var(--helix-size-icon));
|
|
111
|
+
}
|
|
112
|
+
|
|
107
113
|
[part="controls"] :where(a, button):focus-visible,
|
|
108
114
|
[part="scrubber"]:focus-visible,
|
|
109
115
|
[part="volume"]:focus-visible {
|
|
@@ -15,6 +15,9 @@ import '../../menu/index.js';
|
|
|
15
15
|
* shows again when the pointer moves, and whenever anything inside it has
|
|
16
16
|
* focus, so you can reach it with the keyboard. A paused video keeps its bar.
|
|
17
17
|
*
|
|
18
|
+
* An icon put in one of the `-icon` slots is drawn at the size of the glyph it
|
|
19
|
+
* replaces, and in the control's color.
|
|
20
|
+
*
|
|
18
21
|
* @since 0.1.0
|
|
19
22
|
* @status stable
|
|
20
23
|
* @category media
|
|
@@ -12,6 +12,11 @@ overscroll-behavior: contain;
|
|
|
12
12
|
padding-inline: var(--helix-size-focus-reach);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
::slotted([data-index]:focus-visible) {
|
|
16
|
+
outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
|
|
17
|
+
outline-offset: calc(var(--helix-size-focus-offset) * -1);
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
[part="after"],
|
|
16
21
|
[part="before"] {
|
|
17
22
|
flex: none;
|
|
@@ -4,9 +4,10 @@ import type { CSSResultGroup } from 'lit';
|
|
|
4
4
|
* @summary A list that renders only the rows of a long set that are on screen.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
* The styled tier styles
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The styled tier styles the scrolling box and draws the focus ring on the row
|
|
8
|
+
* holding focus. Rows are your markup in the light DOM, so your stylesheet
|
|
9
|
+
* styles them the same as any other content, and a rule of yours on a row wins
|
|
10
|
+
* over the ring.
|
|
10
11
|
*
|
|
11
12
|
* @category layout
|
|
12
13
|
* @since 0.1.0
|