@fusion.dev/helix 0.143.0 → 0.144.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 +10028 -511
- package/dist/badge/root/badge-root.css.js +35 -0
- package/dist/badge/root/badge-root.d.ts +16 -0
- package/dist/badge/root/badge-root.js +3 -0
- package/dist/blockquote/root/blockquote-root.css.js +5 -5
- package/dist/blockquote/root/blockquote-root.d.ts +5 -0
- package/dist/button/root/button-root.css.js +38 -1
- package/dist/button/root/button-root.d.ts +5 -0
- package/dist/button/root/button-root.js +2 -1
- package/dist/callout/root/callout-root.css.js +69 -11
- package/dist/callout/root/callout-root.d.ts +25 -2
- package/dist/callout/root/callout-root.js +4 -0
- package/dist/card/root/card-root.css.js +26 -1
- package/dist/card/root/card-root.d.ts +11 -0
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +2 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +2 -0
- package/dist/code-block/root/code-block-root.css.js +23 -0
- package/dist/code-block/root/code-block-root.d.ts +15 -0
- package/dist/code-block/root/code-block-root.js +8 -0
- package/dist/color-picker/root/color-picker-root.css.js +64 -0
- package/dist/color-picker/root/color-picker-root.d.ts +2 -0
- package/dist/copy-button/root/copy-button-root.css.js +5 -0
- package/dist/date-input/root/date-input-root.css.js +19 -0
- package/dist/date-input/root/date-input-root.d.ts +8 -0
- package/dist/date-input/root/date-input-root.js +2 -0
- package/dist/date-picker/root/date-picker-root.css.js +68 -0
- package/dist/date-picker/root/date-picker-root.d.ts +1 -0
- package/dist/dialog/root/dialog-root.css.js +47 -0
- package/dist/divider/root/divider-root.css.js +8 -3
- package/dist/divider/root/divider-root.d.ts +17 -1
- package/dist/divider/root/divider-root.js +4 -0
- package/dist/drawer/root/drawer-root.css.js +28 -1
- package/dist/element-events.generated.js +8 -5
- package/dist/empty/root/empty-root.css.js +9 -9
- package/dist/empty/root/empty-root.d.ts +9 -0
- package/dist/file-input/root/file-input-root.js +2 -0
- package/dist/filter-input/root/filter-input-root.js +2 -0
- package/dist/heatmap/root/heatmap-root.css.js +33 -5
- package/dist/heatmap/root/heatmap-root.d.ts +4 -1
- package/dist/icon/index.d.ts +1 -0
- package/dist/icon/index.js +1 -0
- package/dist/icon/root/icon-root.d.ts +1 -1
- package/dist/icon/root/icon-root.js +1 -1
- package/dist/icon/root/index.d.ts +2 -0
- package/dist/icon/root/index.js +2 -0
- package/dist/icon-button/root/icon-button-root.css.js +37 -0
- package/dist/icon-button/root/icon-button-root.d.ts +4 -0
- package/dist/icon-button/root/icon-button-root.js +2 -1
- package/dist/input/root/input-root.css.js +3 -3
- package/dist/input/root/input-root.d.ts +3 -0
- package/dist/legend/root/legend-root.css.js +40 -13
- package/dist/legend/root/legend-root.d.ts +6 -0
- package/dist/legend/root/legend-root.js +1 -1
- package/dist/lightbox/root/lightbox-root.css.js +84 -0
- package/dist/lightbox/root/lightbox-root.d.ts +1 -0
- package/dist/loader/root/loader-root.css.js +10 -0
- package/dist/loader/root/loader-root.d.ts +3 -0
- package/dist/meter/root/meter-root.css.js +23 -1
- package/dist/meter/root/meter-root.d.ts +5 -0
- package/dist/notifications/notification/notification.css.js +5 -0
- package/dist/number-input/root/number-input-root.css.js +3 -3
- package/dist/number-input/root/number-input-root.d.ts +3 -0
- package/dist/pin-input/root/pin-input-root.css.js +12 -5
- package/dist/pin-input/root/pin-input-root.d.ts +5 -0
- package/dist/popover/root/popover-root.css.js +36 -0
- package/dist/popover/root/popover-root.d.ts +1 -0
- package/dist/progress/root/progress-root.css.js +22 -1
- package/dist/progress/root/progress-root.d.ts +5 -0
- package/dist/quote/root/quote-root.css.js +1 -1
- package/dist/quote/root/quote-root.d.ts +1 -0
- package/dist/shared/chart/tooltip.css.js +25 -2
- package/dist/shared/field/field-segments.css.d.ts +1 -0
- package/dist/shared/field/field-segments.css.js +40 -0
- package/dist/skeleton/root/skeleton-root.css.js +56 -5
- package/dist/skeleton/root/skeleton-root.d.ts +17 -1
- package/dist/skeleton/root/skeleton-root.js +3 -0
- package/dist/stat/root/stat-root.css.js +7 -7
- package/dist/stat/root/stat-root.d.ts +8 -0
- package/dist/switch/root/switch-root.css.js +13 -5
- package/dist/switch/root/switch-root.d.ts +25 -1
- package/dist/switch/root/switch-root.js +7 -0
- package/dist/tag/group/tag-group.css.d.ts +1 -0
- package/dist/tag/group/tag-group.css.js +6 -0
- package/dist/tag/group/tag-group.d.ts +25 -0
- package/dist/tag/group/tag-group.js +16 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/index.js +1 -0
- package/dist/tag/root/tag-root.css.js +50 -0
- package/dist/tag/root/tag-root.d.ts +4 -0
- package/dist/textarea/root/textarea-root.css.js +12 -4
- package/dist/textarea/root/textarea-root.d.ts +4 -0
- package/dist/time-input/root/time-input-root.css.js +19 -0
- package/dist/time-input/root/time-input-root.d.ts +8 -0
- package/dist/time-input/root/time-input-root.js +2 -0
- package/dist/toast/item/toast-item.css.js +16 -0
- package/dist/toggle/group/toggle-group.css.js +16 -0
- package/dist/tour/root/tour-root.css.js +8 -0
- package/dist/tour/stop/tour-stop.css.js +32 -0
- package/dist/trend/root/trend-root.css.js +12 -5
- package/dist/trend/root/trend-root.d.ts +6 -1
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +4556 -111
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +1307 -24
|
@@ -18,7 +18,12 @@ import type { CSSResultGroup } from 'lit';
|
|
|
18
18
|
* @aliases Progress bar, Loading bar
|
|
19
19
|
* @documentation https://fusion.dev/helix/components/progress
|
|
20
20
|
*
|
|
21
|
+
* @slot label - A visible label, above a bar and under a ring. Its words name it in place of `label`.
|
|
22
|
+
*
|
|
21
23
|
* @cssproperty --progress-color - Fill of the part that is done.
|
|
24
|
+
* @cssproperty --progress-label-color - Color of a slotted label.
|
|
25
|
+
* @cssproperty --progress-label-gap - Space between a slotted label and the bar.
|
|
26
|
+
* @cssproperty --progress-label-size - Type size of a slotted label.
|
|
22
27
|
* @cssproperty --progress-ring-size - Diameter of the ring.
|
|
23
28
|
* @cssproperty --progress-ring-width - Thickness of the ring's stroke.
|
|
24
29
|
* @cssproperty --progress-size - Thickness of the bar.
|
|
@@ -14,6 +14,7 @@ import type { CSSResultGroup } from 'lit';
|
|
|
14
14
|
* @documentation https://fusion.dev/helix/components/quote
|
|
15
15
|
*
|
|
16
16
|
* @cssproperty --quote-color - Color of the quoted text.
|
|
17
|
+
* @cssproperty --quote-font-style - The slant of the quoted text, `italic` by default. Set `normal` for a face whose italic is too loud, or `oblique` for one with no italic of its own.
|
|
17
18
|
*/
|
|
18
19
|
export declare class HelixQuote extends HelixHeadlessQuote {
|
|
19
20
|
static styles: CSSResultGroup;
|
|
@@ -18,7 +18,7 @@ font-weight: var(--helix-weight-medium);
|
|
|
18
18
|
margin-block-end: var(--helix-space-2xs);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
[part
|
|
21
|
+
[part~="tooltip-cell"] {
|
|
22
22
|
align-items: baseline;
|
|
23
23
|
column-gap: var(--helix-space-sm);
|
|
24
24
|
display: grid;
|
|
@@ -36,11 +36,34 @@ font-variant-numeric: tabular-nums;
|
|
|
36
36
|
grid-column: 3;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
[part
|
|
39
|
+
[part~="tooltip-cell"][data-series]::before {
|
|
40
40
|
background-color: var(--chart-series);
|
|
41
41
|
block-size: 0.5em;
|
|
42
42
|
border-radius: var(--helix-radii-full);
|
|
43
43
|
content: "";
|
|
44
44
|
grid-column: 1;
|
|
45
45
|
inline-size: 0.5em;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[part~="tooltip-cell-current"] {
|
|
49
|
+
font-weight: var(--helix-weight-medium);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[part~="tooltip-cell-current"] [part="tooltip-name"] {
|
|
53
|
+
opacity: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[part="plot"]:focus-visible {
|
|
57
|
+
outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
|
|
58
|
+
outline-offset: var(--helix-size-focus-offset);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[part="live"] {
|
|
62
|
+
block-size: 1px;
|
|
63
|
+
clip-path: inset(50%);
|
|
64
|
+
inline-size: 1px;
|
|
65
|
+
margin: var(--helix-space-none);
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
position: absolute;
|
|
68
|
+
white-space: nowrap;
|
|
46
69
|
}`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
+
export const styles = createSheet(`[part="segments"] {
|
|
3
|
+
align-items: center;
|
|
4
|
+
color: var(--helix-color-foreground);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex: 1 1 auto;
|
|
7
|
+
font-family: var(--helix-font-sans);
|
|
8
|
+
font-size: var(--helix-text-md);
|
|
9
|
+
|
|
10
|
+
font-variant-numeric: tabular-nums;
|
|
11
|
+
font-weight: var(--helix-weight-medium);
|
|
12
|
+
min-inline-size: 0;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[part~="segment"] {
|
|
17
|
+
border-radius: var(--helix-radii-sm);
|
|
18
|
+
caret-color: transparent;
|
|
19
|
+
outline: none;
|
|
20
|
+
padding-inline: calc(var(--helix-space-2xs) / 2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[part~="segment"]:focus {
|
|
24
|
+
background-color: var(--_segment-focus-background-color, var(--helix-color-primary));
|
|
25
|
+
color: var(--_segment-focus-color, var(--helix-color-foreground-on-primary));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[part~="segment-placeholder"] {
|
|
29
|
+
color: var(--_segment-placeholder-color, var(--helix-color-foreground-subtle));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[part="literal"] {
|
|
33
|
+
color: var(--_segment-literal-color, var(--helix-color-foreground-muted));
|
|
34
|
+
white-space: pre;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host(:disabled) [part="segments"] {
|
|
38
|
+
color: var(--helix-color-foreground-subtle);
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}`);
|
|
@@ -19,9 +19,12 @@ inline-size: var(--skeleton-size, var(--helix-size-control));
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
[part="skeleton"] {
|
|
22
|
-
background-color:
|
|
22
|
+
background-color: var(
|
|
23
|
+
--skeleton-color,
|
|
24
|
+
color-mix(in oklab, var(--helix-color-foreground) 8%, transparent)
|
|
25
|
+
);
|
|
23
26
|
block-size: 100%;
|
|
24
|
-
border-radius: var(--helix-radii-sm);
|
|
27
|
+
border-radius: var(--skeleton-radius, var(--helix-radii-sm));
|
|
25
28
|
display: block;
|
|
26
29
|
inline-size: 100%;
|
|
27
30
|
|
|
@@ -30,11 +33,13 @@ position: relative;
|
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
[part="skeleton"]::after {
|
|
33
|
-
animation: helix-skeleton-sweep calc(var(--helix-duration-slow) * 4)
|
|
36
|
+
animation: helix-skeleton-sweep var(--skeleton-duration, calc(var(--helix-duration-slow) * 4))
|
|
37
|
+
ease-in-out infinite;
|
|
34
38
|
background-image: linear-gradient(
|
|
35
39
|
90deg,
|
|
36
40
|
transparent 0%,
|
|
37
|
-
color-mix(in oklab, var(--helix-color-foreground) 8%, transparent)
|
|
41
|
+
var(--skeleton-sheen-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent))
|
|
42
|
+
50%,
|
|
38
43
|
transparent 100%
|
|
39
44
|
);
|
|
40
45
|
content: "";
|
|
@@ -53,6 +58,48 @@ border-radius: var(--helix-radii-full);
|
|
|
53
58
|
border-radius: var(--helix-radii-full);
|
|
54
59
|
}
|
|
55
60
|
|
|
61
|
+
:host([effect="pulse"]) [part="skeleton"]::after,
|
|
62
|
+
:host([effect="none"]) [part="skeleton"]::after {
|
|
63
|
+
animation: none;
|
|
64
|
+
background-image: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([effect="pulse"]) [part="skeleton"] {
|
|
68
|
+
animation: helix-skeleton-pulse var(--skeleton-duration, calc(var(--helix-duration-slow) * 4))
|
|
69
|
+
ease-in-out infinite;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@keyframes helix-skeleton-pulse {
|
|
73
|
+
50% {
|
|
74
|
+
opacity: 0.4;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host(:not(:empty)) {
|
|
79
|
+
block-size: auto;
|
|
80
|
+
inline-size: fit-content;
|
|
81
|
+
max-inline-size: 100%;
|
|
82
|
+
position: relative;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host(:not(:empty)) [part="content"] {
|
|
86
|
+
display: block;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host(:not(:empty)) [part="skeleton"] {
|
|
90
|
+
block-size: auto;
|
|
91
|
+
inset: 0;
|
|
92
|
+
position: absolute;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host(:not(:empty):not([loading])) [part="skeleton"] {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([loading]:not(:empty)) [part="content"] {
|
|
100
|
+
visibility: hidden;
|
|
101
|
+
}
|
|
102
|
+
|
|
56
103
|
@keyframes helix-skeleton-sweep {
|
|
57
104
|
from {
|
|
58
105
|
translate: -50% 0;
|
|
@@ -64,8 +111,12 @@ translate: 50% 0;
|
|
|
64
111
|
}
|
|
65
112
|
|
|
66
113
|
@media (prefers-reduced-motion: reduce) {
|
|
67
|
-
[part="skeleton"]::after
|
|
114
|
+
[part="skeleton"]::after,
|
|
115
|
+
:host([effect="pulse"]) [part="skeleton"] {
|
|
68
116
|
animation: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[part="skeleton"]::after {
|
|
69
120
|
background-image: none;
|
|
70
121
|
}
|
|
71
122
|
}
|
|
@@ -5,7 +5,11 @@ import type { CSSResultGroup } from 'lit';
|
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
7
|
* Animates a highlight sweeping across the block, which reads as work in
|
|
8
|
-
* progress. A block fading in and out can look broken
|
|
8
|
+
* progress. A block fading in and out can look broken, so `effect="pulse"` is
|
|
9
|
+
* a choice rather than the default.
|
|
10
|
+
*
|
|
11
|
+
* Around content with `loading`, the skeleton takes the content's box and
|
|
12
|
+
* paints over it, and the content is hidden until `loading` is taken off.
|
|
9
13
|
*
|
|
10
14
|
* @since 0.1.0
|
|
11
15
|
* @status stable
|
|
@@ -13,12 +17,24 @@ import type { CSSResultGroup } from 'lit';
|
|
|
13
17
|
* @aliases Placeholder, Shimmer, Ghost
|
|
14
18
|
* @documentation https://fusion.dev/helix/components/skeleton
|
|
15
19
|
*
|
|
20
|
+
* @csspart content - The box around the content, hidden while `loading`.
|
|
16
21
|
* @csspart skeleton - The placeholder shape.
|
|
17
22
|
*
|
|
18
23
|
* @cssproperty --skeleton-block-size - The height of the block shape, which is the shape when `shape` is unset. Defaults to the control height.
|
|
24
|
+
* @cssproperty --skeleton-color - The placeholder's fill.
|
|
25
|
+
* @cssproperty --skeleton-duration - How long one sweep or one pulse takes.
|
|
26
|
+
* @cssproperty --skeleton-radius - The corner of the block shape.
|
|
27
|
+
* @cssproperty --skeleton-sheen-color - The highlight the sweep carries across the fill.
|
|
19
28
|
* @cssproperty --skeleton-size - The diameter of the circle shape.
|
|
20
29
|
*/
|
|
21
30
|
export declare class HelixSkeleton extends HelixHeadlessSkeleton {
|
|
31
|
+
/**
|
|
32
|
+
* How the placeholder shows it is waiting: a sweep when unset, `pulse` to
|
|
33
|
+
* fade the fill in and out, or `none` to sit still.
|
|
34
|
+
*
|
|
35
|
+
* Reduced motion stills both.
|
|
36
|
+
*/
|
|
37
|
+
effect?: 'none' | 'pulse';
|
|
22
38
|
/**
|
|
23
39
|
* The shape of the placeholder: `text`, `circle`, or a block when unset.
|
|
24
40
|
*
|
|
@@ -11,6 +11,9 @@ import { styles } from './skeleton-root.css.js';
|
|
|
11
11
|
let HelixSkeleton = class HelixSkeleton extends HelixHeadlessSkeleton {
|
|
12
12
|
static { this.styles = styles; }
|
|
13
13
|
};
|
|
14
|
+
__decorate([
|
|
15
|
+
property({ reflect: true })
|
|
16
|
+
], HelixSkeleton.prototype, "effect", void 0);
|
|
14
17
|
__decorate([
|
|
15
18
|
property({ reflect: true })
|
|
16
19
|
], HelixSkeleton.prototype, "shape", void 0);
|
|
@@ -5,20 +5,20 @@ align-content: start;
|
|
|
5
5
|
|
|
6
6
|
align-items: baseline;
|
|
7
7
|
display: grid;
|
|
8
|
-
gap: var(--helix-space-2xs);
|
|
8
|
+
gap: var(--stat-gap, var(--helix-space-2xs));
|
|
9
9
|
grid-template-columns: auto 1fr;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
slot[name="label"]::slotted(*) {
|
|
13
|
-
color: var(--helix-color-foreground-muted);
|
|
14
|
-
font-size: calc(var(--helix-text-xs) / var(--helix-text-md) * 1em);
|
|
13
|
+
color: var(--stat-label-color, var(--helix-color-foreground-muted));
|
|
14
|
+
font-size: var(--stat-label-size, calc(var(--helix-text-xs) / var(--helix-text-md) * 1em));
|
|
15
15
|
font-weight: var(--helix-weight-medium);
|
|
16
16
|
grid-column: 1 / -1;
|
|
17
17
|
letter-spacing: var(--helix-tracking-wide);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
slot:not([name]) {
|
|
21
|
-
color: var(--helix-color-foreground);
|
|
21
|
+
color: var(--stat-value-color, var(--helix-color-foreground));
|
|
22
22
|
font-family: var(--helix-font-display);
|
|
23
23
|
font-size: var(--stat-value-size, calc(var(--helix-text-3xl) / var(--helix-text-md) * 1em));
|
|
24
24
|
font-weight: var(--helix-weight-semibold);
|
|
@@ -27,8 +27,8 @@ line-height: var(--helix-leading-tight);
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
slot[name="unit"]::slotted(*) {
|
|
30
|
-
color: var(--helix-color-foreground-muted);
|
|
31
|
-
font-size: calc(var(--helix-text-md) / var(--helix-text-md) * 1em);
|
|
30
|
+
color: var(--stat-unit-color, var(--helix-color-foreground-muted));
|
|
31
|
+
font-size: var(--stat-unit-size, calc(var(--helix-text-md) / var(--helix-text-md) * 1em));
|
|
32
32
|
font-weight: var(--helix-weight-medium);
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ order: 1;
|
|
|
40
40
|
:host([direction="row-reverse"]) {
|
|
41
41
|
align-items: baseline;
|
|
42
42
|
display: flex;
|
|
43
|
-
gap: var(--helix-space-xs);
|
|
43
|
+
gap: var(--stat-gap, var(--helix-space-xs));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
:host([direction="row"]) slot[name="label"]::slotted(*),
|
|
@@ -14,6 +14,14 @@ import type { CSSResultGroup } from 'lit';
|
|
|
14
14
|
* @aliases Metric, KPI, Figure
|
|
15
15
|
* @documentation https://fusion.dev/helix/components/stat
|
|
16
16
|
*
|
|
17
|
+
* @csspart value - The slot the value is written in. A slot draws no box, so it takes the inherited properties, such as color and font, and passes them to the value.
|
|
18
|
+
*
|
|
19
|
+
* @cssproperty --stat-gap - Space between the label and the value, and between the value and the unit in a row.
|
|
20
|
+
* @cssproperty --stat-label-color - Color of the label.
|
|
21
|
+
* @cssproperty --stat-label-size - Size of the label.
|
|
22
|
+
* @cssproperty --stat-unit-color - Color of the unit.
|
|
23
|
+
* @cssproperty --stat-unit-size - Size of the unit.
|
|
24
|
+
* @cssproperty --stat-value-color - Color of the figure.
|
|
17
25
|
* @cssproperty --stat-value-size - Size of the figure.
|
|
18
26
|
*/
|
|
19
27
|
export declare class HelixStat extends HelixHeadlessStat {
|
|
@@ -41,13 +41,16 @@ background-color var(--helix-duration-fast) var(--helix-easing-standard),
|
|
|
41
41
|
border-color var(--helix-duration-fast) var(--helix-easing-standard);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
[part="
|
|
44
|
+
[part="thumb"] {
|
|
45
|
+
align-items: center;
|
|
46
|
+
color: var(--switch-icon-color, var(--helix-color-foreground-muted));
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
45
49
|
|
|
46
50
|
background-color: var(--switch-thumb-color, var(--helix-color-surface-overlay));
|
|
47
51
|
block-size: calc(var(--_switch-height) - var(--_switch-inset) * 2);
|
|
48
52
|
border: var(--helix-border-thin) solid var(--helix-color-border);
|
|
49
53
|
border-radius: var(--helix-radii-full);
|
|
50
|
-
content: "";
|
|
51
54
|
inline-size: calc(var(--_switch-height) - var(--_switch-inset) * 2);
|
|
52
55
|
inset-block-start: 50%;
|
|
53
56
|
|
|
@@ -58,8 +61,13 @@ translate: 0 -50%;
|
|
|
58
61
|
transition: translate var(--helix-duration-fast) var(--helix-easing-emphasized);
|
|
59
62
|
}
|
|
60
63
|
|
|
61
|
-
:host(:state(checked)) [part="
|
|
64
|
+
:host(:state(checked)) [part="thumb"] {
|
|
62
65
|
border-color: transparent;
|
|
66
|
+
color: var(--switch-icon-color, var(--switch-on-color, var(--helix-color-primary)));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[part="thumb"] ::slotted(*) {
|
|
70
|
+
--icon-size: calc((var(--_switch-height) - var(--_switch-inset) * 2) * 0.7);
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
:host(:state(checked)) [part="track"] {
|
|
@@ -77,14 +85,14 @@ margin: var(--helix-space-none);
|
|
|
77
85
|
opacity: 0;
|
|
78
86
|
}
|
|
79
87
|
|
|
80
|
-
:host(:state(checked)) [part="
|
|
88
|
+
:host(:state(checked)) [part="thumb"] {
|
|
81
89
|
|
|
82
90
|
background-color: var(--switch-thumb-color, var(--helix-color-foreground-on-primary));
|
|
83
91
|
|
|
84
92
|
translate: calc(var(--_switch-width) - var(--_switch-height)) -50%;
|
|
85
93
|
}
|
|
86
94
|
|
|
87
|
-
[part="track"]:has([part="control"]:focus-visible)
|
|
95
|
+
[part="track"]:has([part="control"]:focus-visible) [part="thumb"] {
|
|
88
96
|
outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
|
|
89
97
|
outline-offset: var(--helix-size-focus-offset);
|
|
90
98
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HelixHeadlessSwitch } from '@fusion.dev/helix-headless/switch';
|
|
2
|
-
import type
|
|
2
|
+
import { type CSSResultGroup, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary A control that turns something on or off.
|
|
5
5
|
*
|
|
@@ -17,19 +17,43 @@ import type { CSSResultGroup } from 'lit';
|
|
|
17
17
|
* it, and the control looks like a small dash. The width follows the height, so
|
|
18
18
|
* setting `--switch-block-size` widens the switch too and keeps the proportion.
|
|
19
19
|
*
|
|
20
|
+
* The thumb is an element, the `thumb` part, and holds an icon for each state:
|
|
21
|
+
* one in the `on` slot shows while the switch is on, and one in the `off` slot
|
|
22
|
+
* while it is off.
|
|
23
|
+
*
|
|
20
24
|
* @since 0.1.0
|
|
21
25
|
* @status stable
|
|
22
26
|
* @category forms
|
|
23
27
|
* @aliases Toggle switch, On/off
|
|
24
28
|
* @documentation https://fusion.dev/helix/components/switch
|
|
25
29
|
*
|
|
30
|
+
* @slot - The label that names what the switch turns on.
|
|
31
|
+
* @slot feedback - The message that says what is wrong, for content richer than a string. It shows while there is a message.
|
|
32
|
+
* @slot hint - Help under the control, for content richer than the `hint` text.
|
|
33
|
+
* @slot off - An icon on the thumb while the switch is off.
|
|
34
|
+
* @slot on - An icon on the thumb while the switch is on.
|
|
35
|
+
*
|
|
36
|
+
* @csspart control - The input.
|
|
37
|
+
* @csspart feedback - The message that says what is wrong.
|
|
38
|
+
* @csspart field - The row: the track and its label.
|
|
39
|
+
* @csspart hint - Help under the control, while nothing is wrong.
|
|
40
|
+
* @csspart label - The label beside the track.
|
|
41
|
+
* @csspart thumb - The thumb that travels along the track, and the icon on it.
|
|
42
|
+
* @csspart track - The track.
|
|
43
|
+
*
|
|
26
44
|
* @cssproperty --switch-block-size - Height of the track. The width follows it.
|
|
45
|
+
* @cssproperty --switch-icon-color - Color of the icon on the thumb. Without it, the icon is muted while off and takes the on color while on.
|
|
27
46
|
* @cssproperty --switch-inline-size - Length of the track. Set it to override the length derived from the height.
|
|
28
47
|
* @cssproperty --switch-on-color - Fill when the switch is on.
|
|
29
48
|
* @cssproperty --switch-thumb-color - Color of the thumb, in both states.
|
|
30
49
|
*/
|
|
31
50
|
export declare class HelixSwitch extends HelixHeadlessSwitch {
|
|
32
51
|
static styles: CSSResultGroup;
|
|
52
|
+
/**
|
|
53
|
+
* The thumb as an element, so it is a part and holds an icon for each state.
|
|
54
|
+
* The slot for the other state is `hidden`, which takes its icon out.
|
|
55
|
+
*/
|
|
56
|
+
protected renderThumb(): TemplateResult;
|
|
33
57
|
}
|
|
34
58
|
declare global {
|
|
35
59
|
interface HTMLElementTagNameMap {
|
|
@@ -6,11 +6,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { customElement } from '@fusion.dev/helix-core';
|
|
8
8
|
import { HelixHeadlessSwitch } from '@fusion.dev/helix-headless/switch';
|
|
9
|
+
import { html } from 'lit';
|
|
9
10
|
import { styles as fieldStyles } from '../../shared/field/field.css.js';
|
|
10
11
|
import { styles as fieldInlineStyles } from '../../shared/field/field-inline.css.js';
|
|
11
12
|
import { styles } from './switch-root.css.js';
|
|
12
13
|
let HelixSwitch = class HelixSwitch extends HelixHeadlessSwitch {
|
|
13
14
|
static { this.styles = [fieldStyles, fieldInlineStyles, styles]; }
|
|
15
|
+
renderThumb() {
|
|
16
|
+
return html `<span part="thumb" aria-hidden="true"
|
|
17
|
+
><slot name="on" ?hidden=${!this.checked}></slot
|
|
18
|
+
><slot name="off" ?hidden=${this.checked}></slot
|
|
19
|
+
></span>`;
|
|
20
|
+
}
|
|
14
21
|
};
|
|
15
22
|
HelixSwitch = __decorate([
|
|
16
23
|
customElement('helix-switch')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HelixHeadlessTagGroup } from '@fusion.dev/helix-headless/tag';
|
|
2
|
+
import type { CSSResultGroup } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A set of tags that the arrow keys move through, and that can be removed and selected from the keyboard.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* The tags sit in a row that wraps. A selected tag is filled with its tone, as
|
|
8
|
+
* `emphasis="solid"` draws one, and the focused tag takes the focus ring round
|
|
9
|
+
* its whole box.
|
|
10
|
+
*
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
* @status stable
|
|
13
|
+
* @aliases Tag list, Chip group, Token list
|
|
14
|
+
* @documentation https://fusion.dev/helix/components/tag
|
|
15
|
+
*
|
|
16
|
+
* @cssproperty --tag-group-gap - The space between tags, across and between rows.
|
|
17
|
+
*/
|
|
18
|
+
export declare class HelixTagGroup extends HelixHeadlessTagGroup {
|
|
19
|
+
static styles: CSSResultGroup;
|
|
20
|
+
}
|
|
21
|
+
declare global {
|
|
22
|
+
interface HTMLElementTagNameMap {
|
|
23
|
+
'helix-tag-group': HelixTagGroup;
|
|
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 { HelixHeadlessTagGroup } from '@fusion.dev/helix-headless/tag';
|
|
9
|
+
import { styles } from './tag-group.css.js';
|
|
10
|
+
let HelixTagGroup = class HelixTagGroup extends HelixHeadlessTagGroup {
|
|
11
|
+
static { this.styles = styles; }
|
|
12
|
+
};
|
|
13
|
+
HelixTagGroup = __decorate([
|
|
14
|
+
customElement('helix-tag-group')
|
|
15
|
+
], HelixTagGroup);
|
|
16
|
+
export { HelixTagGroup };
|
package/dist/tag/index.d.ts
CHANGED
package/dist/tag/index.js
CHANGED
|
@@ -110,6 +110,56 @@ margin-inline-end: var(--_tag-inset);
|
|
|
110
110
|
opacity: 0.75;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
[part="link"] {
|
|
114
|
+
color: inherit;
|
|
115
|
+
display: block;
|
|
116
|
+
min-inline-size: 0;
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@media (hover: hover) {
|
|
121
|
+
[part="link"][href]:hover {
|
|
122
|
+
text-decoration: underline;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[part="link"]:focus-visible {
|
|
127
|
+
border-radius: var(--helix-radii-sm);
|
|
128
|
+
outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
|
|
129
|
+
outline-offset: var(--helix-size-focus-offset);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([disabled]) {
|
|
133
|
+
opacity: var(--tag-disabled-opacity, 0.5);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host([disabled]) [part="dismiss"] {
|
|
137
|
+
cursor: not-allowed;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[part="cell"] {
|
|
141
|
+
align-items: center;
|
|
142
|
+
align-self: stretch;
|
|
143
|
+
border-radius: inherit;
|
|
144
|
+
cursor: default;
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
gap: var(--helix-space-2xs);
|
|
147
|
+
margin-inline: calc(var(--_tag-inset) * -1);
|
|
148
|
+
min-inline-size: 0;
|
|
149
|
+
padding-inline: var(--_tag-inset);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[part="cell"]:focus-visible {
|
|
153
|
+
outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
|
|
154
|
+
outline-offset: var(--helix-size-focus-offset);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host(:state(selected)) {
|
|
158
|
+
--_tag-fill: color-mix(in oklab, var(--_tag-color) 82%, var(--helix-color-foreground));
|
|
159
|
+
--_tag-edge: var(--_tag-fill);
|
|
160
|
+
--_tag-label: var(--helix-color-foreground-inverse);
|
|
161
|
+
}
|
|
162
|
+
|
|
113
163
|
@media print {
|
|
114
164
|
:host {
|
|
115
165
|
print-color-adjust: economy;
|
|
@@ -14,13 +14,17 @@ import type { CSSResultGroup } from 'lit';
|
|
|
14
14
|
* @documentation https://fusion.dev/helix/components/tag
|
|
15
15
|
*
|
|
16
16
|
* @slot - The tag's label.
|
|
17
|
+
* @slot dismiss-icon - Replaces the glyph on the remove button.
|
|
17
18
|
*
|
|
18
19
|
* @event {HelixDismissEvent} helix-dismiss - The remove button was pressed. The tag does not remove itself, so remove it in response. Cancelable.
|
|
19
20
|
*
|
|
21
|
+
* @csspart cell - The grid cell in a `Tag.Group`, which takes focus and draws the ring round the whole tag.
|
|
20
22
|
* @csspart dismiss - The remove button, when `dismissible`.
|
|
23
|
+
* @csspart link - The link around the label, under `href`.
|
|
21
24
|
*
|
|
22
25
|
* @cssproperty --tag-background-color - The fill behind the tag.
|
|
23
26
|
* @cssproperty --tag-border-color - The color of the tag's edge.
|
|
27
|
+
* @cssproperty --tag-disabled-opacity - How strongly a `disabled` tag is drawn.
|
|
24
28
|
* @cssproperty --tag-foreground-color - The label color.
|
|
25
29
|
* @cssproperty --tag-radius - The corner radius of the tag.
|
|
26
30
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
2
|
export const styles = createSheet(`[part="field"] {
|
|
3
3
|
background-color: var(--textarea-background-color, var(--helix-color-well));
|
|
4
|
-
border: var(--helix-border-thin) solid var(--helix-color-border);
|
|
5
|
-
border-radius: var(--helix-radii-sm);
|
|
4
|
+
border: var(--helix-border-thin) solid var(--textarea-border-color, var(--helix-color-border));
|
|
5
|
+
border-radius: var(--textarea-radius, var(--helix-radii-sm));
|
|
6
6
|
display: flex;
|
|
7
|
-
|
|
7
|
+
gap: var(--helix-space-2xs);
|
|
8
|
+
padding: var(--textarea-padding, var(--helix-space-xs));
|
|
8
9
|
transition:
|
|
9
10
|
border-color var(--helix-duration-fast) var(--helix-easing-standard),
|
|
10
11
|
background-color var(--helix-duration-fast) var(--helix-easing-standard);
|
|
@@ -14,7 +15,14 @@ background-color var(--helix-duration-fast) var(--helix-easing-standard);
|
|
|
14
15
|
line-height: var(--helix-leading-normal);
|
|
15
16
|
overflow-wrap: break-word;
|
|
16
17
|
|
|
17
|
-
resize: vertical;
|
|
18
|
+
resize: var(--textarea-resize, vertical);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
slot[name="start"]::slotted(*),
|
|
22
|
+
slot[name="end"]::slotted(*) {
|
|
23
|
+
align-self: flex-start;
|
|
24
|
+
color: var(--helix-color-foreground-subtle);
|
|
25
|
+
flex: 0 0 auto;
|
|
18
26
|
}
|
|
19
27
|
|
|
20
28
|
:host([auto-grow]) [part="control"] {
|
|
@@ -15,6 +15,10 @@ import type { CSSResultGroup } from 'lit';
|
|
|
15
15
|
* @documentation https://fusion.dev/helix/components/textarea
|
|
16
16
|
*
|
|
17
17
|
* @cssproperty --textarea-background-color - Fill behind the text.
|
|
18
|
+
* @cssproperty --textarea-border-color - Edge of the field at rest. Hover, focus and an error still draw their own.
|
|
19
|
+
* @cssproperty --textarea-padding - Space between the edge of the field and the text.
|
|
20
|
+
* @cssproperty --textarea-radius - Corner radius of the field.
|
|
21
|
+
* @cssproperty --textarea-resize - Which way a reader can drag the field: `vertical` by default, `none`, `both` or `horizontal`. A field under `auto-grow` has nothing to drag.
|
|
18
22
|
*/
|
|
19
23
|
export declare class HelixTextarea extends HelixHeadlessTextarea {
|
|
20
24
|
static styles: CSSResultGroup;
|
|
@@ -90,6 +90,25 @@ flex-basis: 0;
|
|
|
90
90
|
min-inline-size: var(--helix-size-icon-loose);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
[part="segments"] {
|
|
94
|
+
--_segment-focus-background-color: var(
|
|
95
|
+
--time-input-segment-focus-background-color,
|
|
96
|
+
var(--helix-color-primary)
|
|
97
|
+
);
|
|
98
|
+
--_segment-focus-color: var(
|
|
99
|
+
--time-input-segment-focus-color,
|
|
100
|
+
var(--helix-color-foreground-on-primary)
|
|
101
|
+
);
|
|
102
|
+
--_segment-literal-color: var(
|
|
103
|
+
--time-input-segment-literal-color,
|
|
104
|
+
var(--helix-color-foreground-muted)
|
|
105
|
+
);
|
|
106
|
+
--_segment-placeholder-color: var(
|
|
107
|
+
--time-input-segment-placeholder-color,
|
|
108
|
+
var(--helix-color-foreground-subtle)
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
93
112
|
@media print {
|
|
94
113
|
:host {
|
|
95
114
|
print-color-adjust: exact;
|