@fusion.dev/helix 0.142.1 → 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.
Files changed (160) hide show
  1. package/README.md +9 -5
  2. package/custom-elements.json +29287 -1905
  3. package/dist/accordion/item/accordion-item.css.js +6 -1
  4. package/dist/accordion/item/accordion-item.d.ts +1 -0
  5. package/dist/announcement/root/announcement-root.d.ts +3 -3
  6. package/dist/app-header/root/app-header-root.d.ts +1 -3
  7. package/dist/aura/shader.d.ts +5 -1
  8. package/dist/aura/shader.js +88 -613
  9. package/dist/avatar/root/avatar-root.d.ts +3 -3
  10. package/dist/badge/root/badge-root.css.js +38 -2
  11. package/dist/badge/root/badge-root.d.ts +17 -0
  12. package/dist/badge/root/badge-root.js +3 -0
  13. package/dist/bar-chart/root/bar-chart-root.css.js +10 -0
  14. package/dist/blockquote/root/blockquote-root.css.js +9 -5
  15. package/dist/blockquote/root/blockquote-root.d.ts +5 -0
  16. package/dist/button/root/button-root.css.js +38 -1
  17. package/dist/button/root/button-root.d.ts +5 -0
  18. package/dist/button/root/button-root.js +2 -1
  19. package/dist/callout/root/callout-root.css.js +69 -11
  20. package/dist/callout/root/callout-root.d.ts +25 -2
  21. package/dist/callout/root/callout-root.js +4 -0
  22. package/dist/card/root/card-root.css.js +27 -1
  23. package/dist/card/root/card-root.d.ts +11 -0
  24. package/dist/carousel/root/carousel-root.js +2 -1
  25. package/dist/checkbox/root/checkbox-root.css.js +3 -3
  26. package/dist/checkbox-group/root/checkbox-group-root.d.ts +2 -0
  27. package/dist/checkbox-group/root/checkbox-group-root.js +2 -0
  28. package/dist/code-block/root/code-block-root.css.js +23 -0
  29. package/dist/code-block/root/code-block-root.d.ts +15 -0
  30. package/dist/code-block/root/code-block-root.js +8 -0
  31. package/dist/color-picker/root/color-picker-root.css.js +64 -0
  32. package/dist/color-picker/root/color-picker-root.d.ts +2 -1
  33. package/dist/color-picker/root/color-picker-root.js +0 -1
  34. package/dist/combobox/root/combobox-root.css.js +5 -4
  35. package/dist/copy-button/root/copy-button-root.css.js +5 -0
  36. package/dist/data-table/root/data-table-root.css.js +7 -0
  37. package/dist/date-input/root/date-input-root.css.js +19 -0
  38. package/dist/date-input/root/date-input-root.d.ts +8 -0
  39. package/dist/date-input/root/date-input-root.js +2 -0
  40. package/dist/date-picker/root/date-picker-root.css.js +83 -3
  41. package/dist/date-picker/root/date-picker-root.d.ts +1 -0
  42. package/dist/dialog/root/dialog-root.css.js +47 -0
  43. package/dist/divider/root/divider-root.css.js +8 -3
  44. package/dist/divider/root/divider-root.d.ts +17 -1
  45. package/dist/divider/root/divider-root.js +4 -0
  46. package/dist/donut-chart/root/donut-chart-root.css.js +10 -0
  47. package/dist/drawer/root/drawer-root.css.js +53 -5
  48. package/dist/element-events.generated.js +48 -14
  49. package/dist/empty/root/empty-root.css.js +9 -9
  50. package/dist/empty/root/empty-root.d.ts +9 -0
  51. package/dist/file-input/root/file-input-root.d.ts +0 -1
  52. package/dist/file-input/root/file-input-root.js +2 -1
  53. package/dist/filter-input/root/filter-input-root.d.ts +0 -1
  54. package/dist/filter-input/root/filter-input-root.js +2 -1
  55. package/dist/grid/root/grid-root.d.ts +15 -11
  56. package/dist/grid/root/grid-root.js +49 -15
  57. package/dist/heatmap/root/heatmap-root.css.js +33 -5
  58. package/dist/heatmap/root/heatmap-root.d.ts +4 -1
  59. package/dist/icon/index.d.ts +1 -0
  60. package/dist/icon/index.js +1 -0
  61. package/dist/icon/root/icon-root.d.ts +1 -1
  62. package/dist/icon/root/icon-root.js +1 -1
  63. package/dist/icon/root/index.d.ts +2 -0
  64. package/dist/icon/root/index.js +2 -0
  65. package/dist/icon-button/root/icon-button-root.css.js +80 -16
  66. package/dist/icon-button/root/icon-button-root.d.ts +8 -1
  67. package/dist/icon-button/root/icon-button-root.js +2 -1
  68. package/dist/image/root/image-root.css.js +1 -1
  69. package/dist/input/root/input-root.css.js +3 -3
  70. package/dist/input/root/input-root.d.ts +3 -1
  71. package/dist/input/root/input-root.js +0 -1
  72. package/dist/legend/root/legend-root.css.js +40 -13
  73. package/dist/legend/root/legend-root.d.ts +6 -0
  74. package/dist/legend/root/legend-root.js +1 -1
  75. package/dist/lightbox/root/lightbox-root.css.js +84 -0
  76. package/dist/lightbox/root/lightbox-root.d.ts +1 -0
  77. package/dist/line-chart/root/line-chart-root.css.js +10 -0
  78. package/dist/list/item/list-item.css.js +7 -1
  79. package/dist/loader/root/loader-root.css.js +10 -0
  80. package/dist/loader/root/loader-root.d.ts +10 -4
  81. package/dist/menu/item/menu-item.css.js +1 -1
  82. package/dist/menu/root/menu-root.d.ts +0 -3
  83. package/dist/meter/root/meter-root.css.js +27 -5
  84. package/dist/meter/root/meter-root.d.ts +5 -0
  85. package/dist/notifications/notification/notification.css.js +5 -0
  86. package/dist/number-input/root/number-input-root.css.js +3 -3
  87. package/dist/number-input/root/number-input-root.d.ts +6 -0
  88. package/dist/orb/root/orb-root.d.ts +11 -2
  89. package/dist/orb/root/orb-root.js +5 -1
  90. package/dist/pin-input/root/pin-input-root.css.js +12 -5
  91. package/dist/pin-input/root/pin-input-root.d.ts +5 -0
  92. package/dist/popover/root/popover-root.css.js +36 -0
  93. package/dist/popover/root/popover-root.d.ts +1 -0
  94. package/dist/progress/root/progress-root.css.js +22 -1
  95. package/dist/progress/root/progress-root.d.ts +5 -0
  96. package/dist/qr-code/root/qr-code-root.css.js +2 -1
  97. package/dist/qr-code/root/qr-code-root.d.ts +2 -2
  98. package/dist/quote/root/quote-root.css.js +1 -1
  99. package/dist/quote/root/quote-root.d.ts +1 -0
  100. package/dist/rating/root/rating-root.d.ts +3 -0
  101. package/dist/sandbox/index.d.ts +2 -2
  102. package/dist/sandbox/root/sandbox-root.d.ts +20 -1
  103. package/dist/sandbox/root/sandbox-root.js +27 -10
  104. package/dist/sandbox/source/sandbox-source.d.ts +6 -1
  105. package/dist/sandbox/source/sandbox-source.js +13 -3
  106. package/dist/sandbox/terminal/sandbox-terminal.d.ts +3 -1
  107. package/dist/sandbox/terminal/sandbox-terminal.js +3 -1
  108. package/dist/shared/chart/tooltip.css.js +25 -2
  109. package/dist/shared/field/field-segments.css.d.ts +1 -0
  110. package/dist/shared/field/field-segments.css.js +40 -0
  111. package/dist/skeleton/root/skeleton-root.css.js +60 -5
  112. package/dist/skeleton/root/skeleton-root.d.ts +21 -2
  113. package/dist/skeleton/root/skeleton-root.js +3 -0
  114. package/dist/stat/root/stat-root.css.js +7 -7
  115. package/dist/stat/root/stat-root.d.ts +8 -0
  116. package/dist/switch/root/switch-root.css.js +13 -5
  117. package/dist/switch/root/switch-root.d.ts +25 -1
  118. package/dist/switch/root/switch-root.js +7 -0
  119. package/dist/table/column/table-column.css.js +5 -0
  120. package/dist/tabs/panel/tab-panel.css.js +1 -1
  121. package/dist/tabs/panel/tab-panel.d.ts +2 -0
  122. package/dist/tabs/root/tabs-root.css.js +13 -7
  123. package/dist/tabs/root/tabs-root.d.ts +5 -0
  124. package/dist/tabs/tab/tab.css.js +4 -4
  125. package/dist/tabs/tab/tab.d.ts +5 -0
  126. package/dist/tag/group/tag-group.css.d.ts +1 -0
  127. package/dist/tag/group/tag-group.css.js +6 -0
  128. package/dist/tag/group/tag-group.d.ts +25 -0
  129. package/dist/tag/group/tag-group.js +16 -0
  130. package/dist/tag/index.d.ts +1 -0
  131. package/dist/tag/index.js +1 -0
  132. package/dist/tag/root/tag-root.css.js +50 -0
  133. package/dist/tag/root/tag-root.d.ts +6 -3
  134. package/dist/text/root/text-root.css.js +58 -1
  135. package/dist/text/root/text-root.d.ts +11 -2
  136. package/dist/text/root/text-root.js +19 -1
  137. package/dist/textarea/root/textarea-root.css.js +12 -4
  138. package/dist/textarea/root/textarea-root.d.ts +4 -0
  139. package/dist/time-input/root/time-input-root.css.js +19 -0
  140. package/dist/time-input/root/time-input-root.d.ts +8 -1
  141. package/dist/time-input/root/time-input-root.js +2 -1
  142. package/dist/toast/item/toast-item.css.js +16 -0
  143. package/dist/toast/root/toast-root.css.js +31 -7
  144. package/dist/toast/root/toast-root.d.ts +6 -9
  145. package/dist/toggle/group/toggle-group.css.js +16 -0
  146. package/dist/toggle/group/toggle-group.d.ts +3 -0
  147. package/dist/tour/root/tour-root.css.js +8 -0
  148. package/dist/tour/stop/tour-stop.css.js +37 -0
  149. package/dist/trend/root/trend-root.css.js +12 -5
  150. package/dist/trend/root/trend-root.d.ts +6 -2
  151. package/dist/trend/root/trend-root.js +0 -1
  152. package/dist/video/root/video-root.d.ts +0 -1
  153. package/dist/video/root/video-root.js +0 -1
  154. package/dist/video-playlist/menu/video-playlist-menu.d.ts +0 -1
  155. package/dist/video-playlist/menu/video-playlist-menu.js +0 -1
  156. package/lint.json +1 -1
  157. package/package.json +6 -6
  158. package/types/jsx.d.ts +9515 -2061
  159. package/types/svelte.d.ts +1 -0
  160. package/types/vue.d.ts +2302 -233
@@ -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
+ }`);
@@ -4,6 +4,10 @@ display: block;
4
4
  inline-size: 100%;
5
5
  }
6
6
 
7
+ :host(:not([shape])) {
8
+ block-size: var(--skeleton-block-size, var(--helix-size-control));
9
+ }
10
+
7
11
  :host([shape="text"]) {
8
12
  block-size: 1em;
9
13
  }
@@ -15,9 +19,12 @@ inline-size: var(--skeleton-size, var(--helix-size-control));
15
19
  }
16
20
 
17
21
  [part="skeleton"] {
18
- background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);
22
+ background-color: var(
23
+ --skeleton-color,
24
+ color-mix(in oklab, var(--helix-color-foreground) 8%, transparent)
25
+ );
19
26
  block-size: 100%;
20
- border-radius: var(--helix-radii-sm);
27
+ border-radius: var(--skeleton-radius, var(--helix-radii-sm));
21
28
  display: block;
22
29
  inline-size: 100%;
23
30
 
@@ -26,11 +33,13 @@ position: relative;
26
33
  }
27
34
 
28
35
  [part="skeleton"]::after {
29
- animation: helix-skeleton-sweep calc(var(--helix-duration-slow) * 4) ease-in-out infinite;
36
+ animation: helix-skeleton-sweep var(--skeleton-duration, calc(var(--helix-duration-slow) * 4))
37
+ ease-in-out infinite;
30
38
  background-image: linear-gradient(
31
39
  90deg,
32
40
  transparent 0%,
33
- color-mix(in oklab, var(--helix-color-foreground) 8%, transparent) 50%,
41
+ var(--skeleton-sheen-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent))
42
+ 50%,
34
43
  transparent 100%
35
44
  );
36
45
  content: "";
@@ -49,6 +58,48 @@ border-radius: var(--helix-radii-full);
49
58
  border-radius: var(--helix-radii-full);
50
59
  }
51
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
+
52
103
  @keyframes helix-skeleton-sweep {
53
104
  from {
54
105
  translate: -50% 0;
@@ -60,8 +111,12 @@ translate: 50% 0;
60
111
  }
61
112
 
62
113
  @media (prefers-reduced-motion: reduce) {
63
- [part="skeleton"]::after {
114
+ [part="skeleton"]::after,
115
+ :host([effect="pulse"]) [part="skeleton"] {
64
116
  animation: none;
117
+ }
118
+
119
+ [part="skeleton"]::after {
65
120
  background-image: none;
66
121
  }
67
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,15 +17,30 @@ 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
  *
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.
18
28
  * @cssproperty --skeleton-size - The diameter of the circle shape.
19
29
  */
20
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';
21
38
  /**
22
39
  * The shape of the placeholder: `text`, `circle`, or a block when unset.
23
40
  *
24
- * Unset is a block, which is what most missing things are.
41
+ * Unset is a block, which is what most missing things are. A block is the
42
+ * control height until you size it, with a height on the element or
43
+ * `--skeleton-block-size`.
25
44
  */
26
45
  shape?: 'text' | 'circle';
27
46
  static styles: CSSResultGroup;
@@ -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="track"]::after {
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="track"]::after {
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="track"]::after {
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)::after {
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 { CSSResultGroup } from 'lit';
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')
@@ -59,6 +59,11 @@ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
59
59
  outline-offset: var(--helix-size-focus-offset);
60
60
  }
61
61
 
62
+ [part="column"]:focus-visible {
63
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
64
+ outline-offset: calc(var(--helix-size-focus-offset) * -1);
65
+ }
66
+
62
67
  [part="grip"] {
63
68
  all: unset;
64
69
  align-items: center;
@@ -8,7 +8,7 @@ display: contents;
8
8
  min-block-size: 0;
9
9
  min-inline-size: 0;
10
10
  outline: none;
11
- padding-block-start: var(--helix-space-md);
11
+ padding-block-start: var(--tabs-panel-padding-block-start, var(--helix-space-md));
12
12
  }
13
13
 
14
14
  [part="panel"][hidden] {
@@ -14,6 +14,8 @@ import type { CSSResultGroup } from 'lit';
14
14
  * @slot - The panel's content.
15
15
  *
16
16
  * @csspart panel - The panel container.
17
+ *
18
+ * @cssproperty --tabs-panel-padding-block-start - The space between the tab row and the panel's content.
17
19
  */
18
20
  export declare class HelixTabPanel extends HelixHeadlessTabPanel {
19
21
  static styles: CSSResultGroup;
@@ -18,12 +18,15 @@ background-position: bottom;
18
18
  background-repeat: repeat-x;
19
19
  background-size: 100% var(--helix-border-thin);
20
20
  display: flex;
21
- gap: var(--helix-space-2xs);
21
+ gap: var(--tabs-gap, var(--helix-space-2xs));
22
22
  overflow-x: auto;
23
23
  }
24
24
 
25
25
  :host([variant="underlined"]) {
26
- --_tabs-rule: linear-gradient(var(--helix-color-border), var(--helix-color-border));
26
+ --_tabs-rule: linear-gradient(
27
+ var(--tabs-rule-color, var(--helix-color-border)),
28
+ var(--tabs-rule-color, var(--helix-color-border))
29
+ );
27
30
  --_tab-radius: var(--helix-radii-none);
28
31
  --_tab-selected-shadow: none;
29
32
  --_tab-selected-surface: transparent;
@@ -87,14 +90,17 @@ z-index: var(--helix-layer-raised);
87
90
  }
88
91
 
89
92
  :host([variant="underlined"]) [part="indicator"] {
90
- --_indicator-block: var(--helix-border-thick);
91
- --_indicator-color: var(--helix-color-primary);
92
- --_indicator-offset: calc(var(--indicator-block-size, 0px) - var(--helix-border-thick));
93
+ --_indicator-block: var(--tabs-indicator-thickness, var(--helix-border-thick));
94
+ --_indicator-color: var(--tabs-indicator-color, var(--helix-color-primary));
95
+ --_indicator-offset: calc(
96
+ var(--indicator-block-size, 0px) -
97
+ var(--tabs-indicator-thickness, var(--helix-border-thick))
98
+ );
93
99
  }
94
100
 
95
101
  :host([variant="segmented"]) [part="indicator"] {
96
102
  --_indicator-block: var(--indicator-block-size, 0);
97
- --_indicator-color: var(--helix-color-surface-overlay);
103
+ --_indicator-color: var(--tabs-indicator-color, var(--helix-color-surface-overlay));
98
104
  --_indicator-radius: calc(var(--helix-radii-sm) - var(--helix-border-thin));
99
105
  --_indicator-shadow: var(--helix-shadow-sm);
100
106
  --_indicator-offset: 0px;
@@ -109,7 +115,7 @@ z-index: var(--helix-layer-raised);
109
115
 
110
116
  --_indicator-border: var(--helix-border-thin);
111
117
  --_indicator-border-color: var(--helix-color-border);
112
- --_indicator-color: var(--helix-color-surface-overlay);
118
+ --_indicator-color: var(--tabs-indicator-color, var(--helix-color-surface-overlay));
113
119
  --_indicator-radius: var(--helix-radii-sm);
114
120
  --_indicator-shadow: var(--helix-shadow-sm);
115
121
  --_indicator-offset: 0px;
@@ -26,6 +26,11 @@ import type { CSSResultGroup } from 'lit';
26
26
  *
27
27
  * @csspart panels - The panel container.
28
28
  * @csspart tabs - The tab list.
29
+ *
30
+ * @cssproperty --tabs-gap - The space between tabs.
31
+ * @cssproperty --tabs-indicator-color - The fill of the mark on the current tab: the bar under `underlined`, and the pill otherwise.
32
+ * @cssproperty --tabs-indicator-thickness - The height of the bar under `underlined`.
33
+ * @cssproperty --tabs-rule-color - The color of the rule under the row in `underlined`.
29
34
  */
30
35
  export declare class HelixTabs extends HelixHeadlessTabs {
31
36
  static styles: CSSResultGroup;
@@ -7,19 +7,19 @@ display: inline-flex;
7
7
  align-items: center;
8
8
  background-color: transparent;
9
9
 
10
- block-size: var(--_tab-height, var(--helix-size-control));
10
+ block-size: var(--_tab-height, var(--tabs-tab-block-size, var(--helix-size-control)));
11
11
  border: none;
12
12
 
13
13
  border-block-end: var(--helix-border-thick) solid transparent;
14
14
  border-radius: var(--_tab-radius, var(--helix-radii-none));
15
- color: var(--helix-color-foreground-subtle);
15
+ color: var(--tabs-tab-color, var(--helix-color-foreground-subtle));
16
16
  cursor: pointer;
17
17
  font: inherit;
18
18
  font-size: var(--helix-text-sm);
19
19
  font-weight: var(--helix-weight-medium);
20
20
  display: inline-flex;
21
21
  justify-content: center;
22
- padding-inline: var(--helix-space-sm);
22
+ padding-inline: var(--tabs-tab-padding-inline, var(--helix-space-sm));
23
23
  transition:
24
24
  background-color var(--helix-duration-fast) var(--helix-easing-standard),
25
25
  border-color var(--helix-duration-normal) var(--helix-easing-emphasized),
@@ -36,7 +36,7 @@ color: var(--helix-color-foreground);
36
36
  :host(:state(selected)) [part="tab"]:hover {
37
37
  background-color: var(--_tab-selected-surface, transparent);
38
38
  box-shadow: var(--_tab-selected-shadow, none);
39
- color: var(--helix-color-foreground);
39
+ color: var(--tabs-tab-selected-color, var(--helix-color-foreground));
40
40
  }
41
41
 
42
42
  [part="tab"]:disabled {
@@ -16,6 +16,11 @@ import type { CSSResultGroup } from 'lit';
16
16
  * @slot - The tab's label.
17
17
  *
18
18
  * @csspart tab - The tab itself.
19
+ *
20
+ * @cssproperty --tabs-tab-block-size - The height of a tab. `segmented` sizes its tabs to the track and does not read it.
21
+ * @cssproperty --tabs-tab-color - The label color of a tab that is not current.
22
+ * @cssproperty --tabs-tab-padding-inline - The space either side of the label.
23
+ * @cssproperty --tabs-tab-selected-color - The label color of the current tab.
19
24
  */
20
25
  export declare class HelixTab extends HelixHeadlessTab {
21
26
  static styles: CSSResultGroup;
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,6 @@
1
+ import { createSheet } from '@fusion.dev/helix-core';
2
+ export const styles = createSheet(`:host {
3
+ display: flex;
4
+ flex-wrap: wrap;
5
+ gap: var(--tag-group-gap, var(--helix-space-2xs));
6
+ }`);
@@ -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 };
@@ -1 +1,2 @@
1
+ export * from './group/tag-group.js';
1
2
  export * from './root/tag-root.js';
package/dist/tag/index.js CHANGED
@@ -1 +1,2 @@
1
+ export * from './group/tag-group.js';
1
2
  export * from './root/tag-root.js';
@@ -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;