@helixui/library 3.1.0-next.66 → 3.1.0-next.67
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/dist/components/hx-code-snippet/hx-code-snippet.styles.d.ts.map +1 -1
- package/dist/components/hx-code-snippet/index.js +1 -1
- package/dist/components/hx-rating/index.js +1 -1
- package/dist/components/hx-stat/index.js +1 -1
- package/dist/components/hx-status-indicator/index.js +1 -1
- package/dist/components/hx-steps/index.js +1 -1
- package/dist/components/hx-table/index.js +1 -1
- package/dist/components/hx-theme/hx-theme.d.ts.map +1 -1
- package/dist/components/hx-theme/index.js +1 -1
- package/dist/components/hx-toast/index.js +1 -1
- package/dist/css/helix-all.css +35 -32
- package/dist/css/helix-data.css +23 -20
- package/dist/css/helix-feedback.css +10 -10
- package/dist/css/helix-forms.css +2 -2
- package/dist/css/hx-code-snippet.css +18 -15
- package/dist/css/hx-rating.css +2 -2
- package/dist/css/hx-stat.css +3 -3
- package/dist/css/hx-status-indicator.css +1 -1
- package/dist/css/hx-table.css +5 -5
- package/dist/css/hx-toast.css +6 -6
- package/dist/css/index.css +1 -1
- package/dist/css/manifest.json +21 -18
- package/dist/index.js +8 -8
- package/dist/shared/{hx-code-snippet-B7wUKzyb.js → hx-code-snippet-DssubcYM.js} +27 -24
- package/dist/shared/hx-code-snippet-DssubcYM.js.map +1 -0
- package/dist/shared/{hx-rating-C3E3ENJb.js → hx-rating-BO9kl9pb.js} +33 -33
- package/dist/shared/hx-rating-BO9kl9pb.js.map +1 -0
- package/dist/shared/{hx-stat-BTpykQAt.js → hx-stat-DTRyLF3a.js} +8 -8
- package/dist/shared/{hx-stat-BTpykQAt.js.map → hx-stat-DTRyLF3a.js.map} +1 -1
- package/dist/shared/{hx-status-indicator-X2QEWNFt.js → hx-status-indicator-DIGRGM2G.js} +6 -6
- package/dist/shared/{hx-status-indicator-X2QEWNFt.js.map → hx-status-indicator-DIGRGM2G.js.map} +1 -1
- package/dist/shared/{hx-step-CRNQlmSo.js → hx-step-D15gtcLm.js} +33 -33
- package/dist/shared/hx-step-D15gtcLm.js.map +1 -0
- package/dist/shared/{hx-td-Bra35cH4.js → hx-td-B737T0_c.js} +45 -45
- package/dist/shared/hx-td-B737T0_c.js.map +1 -0
- package/dist/shared/{hx-theme-DP4oPU1i.js → hx-theme-BiyQ7UUK.js} +3 -1
- package/dist/shared/hx-theme-BiyQ7UUK.js.map +1 -0
- package/dist/shared/{toast-factory-BPPnG3mM.js → toast-factory-M373dTcz.js} +28 -28
- package/dist/shared/toast-factory-M373dTcz.js.map +1 -0
- package/package.json +2 -2
- package/dist/shared/hx-code-snippet-B7wUKzyb.js.map +0 -1
- package/dist/shared/hx-rating-C3E3ENJb.js.map +0 -1
- package/dist/shared/hx-step-CRNQlmSo.js.map +0 -1
- package/dist/shared/hx-td-Bra35cH4.js.map +0 -1
- package/dist/shared/hx-theme-DP4oPU1i.js.map +0 -1
- package/dist/shared/toast-factory-BPPnG3mM.js.map +0 -1
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
--hx-status-indicator-label-font-size,
|
|
71
71
|
var(--hx-font-size-sm, var(--hx-text-sm, 0.875rem))
|
|
72
72
|
);
|
|
73
|
-
color: var(--hx-status-indicator-label-color, var(--hx-color-
|
|
73
|
+
color: var(--hx-status-indicator-label-color, var(--hx-color-text-strong, #334155));
|
|
74
74
|
line-height: 1;
|
|
75
75
|
white-space: nowrap;
|
|
76
76
|
}
|
package/dist/css/hx-table.css
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
text-align: start;
|
|
32
32
|
padding: var(--hx-space-2, 0.5rem) var(--hx-space-4, 1rem);
|
|
33
33
|
font-weight: var(--hx-font-weight-semibold, 600);
|
|
34
|
-
color: var(--hx-table-header-color, var(--hx-color-
|
|
34
|
+
color: var(--hx-table-header-color, var(--hx-color-text-strong, #1e293b));
|
|
35
35
|
font-size: var(--hx-font-size-md, 1rem);
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
|
|
48
48
|
/* Header background via CSS vars that cascade through display:contents */
|
|
49
49
|
::slotted(hx-thead) {
|
|
50
|
-
--_hx-table-cell-bg: var(--hx-table-header-bg, var(--hx-color-
|
|
50
|
+
--_hx-table-cell-bg: var(--hx-table-header-bg, var(--hx-color-surface-raised, #f8fafc));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/* Striped variant: set stripe signal on hx-tbody (direct slotted child) so hx-tbody can apply to even rows */
|
|
54
54
|
:host([variant='striped']) ::slotted(hx-tbody) {
|
|
55
|
-
--_hx-table-row-stripe-bg: var(--hx-table-stripe-bg, var(--hx-color-
|
|
55
|
+
--_hx-table-row-stripe-bg: var(--hx-table-stripe-bg, var(--hx-color-surface-raised, #f8fafc));
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/* Hover variant: set hover bg variable on direct slotted section elements */
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
:host([variant='striped']) ::slotted(hx-thead),
|
|
63
63
|
:host([variant='default']) ::slotted(hx-tbody),
|
|
64
64
|
:host([variant='default']) ::slotted(hx-thead) {
|
|
65
|
-
--_hx-table-row-hover-bg: var(--hx-table-row-hover-bg, var(--hx-color-
|
|
65
|
+
--_hx-table-row-hover-bg: var(--hx-table-row-hover-bg, var(--hx-color-surface-raised, #f8fafc));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/* Compact variant: reduced padding signal set on section elements that cascade to cells */
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
--_hx-table-th-position: sticky;
|
|
79
79
|
--_hx-table-th-top: 0;
|
|
80
80
|
--_hx-table-th-z-index: 1;
|
|
81
|
-
--_hx-table-th-bg: var(--hx-table-header-bg, var(--hx-color-
|
|
81
|
+
--_hx-table-th-bg: var(--hx-table-header-bg, var(--hx-color-surface-raised, #f8fafc));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/* ─── Focus ─── */
|
package/dist/css/hx-toast.css
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
gap: var(--hx-space-3, 0.75rem);
|
|
19
19
|
padding: var(--hx-space-3, 0.75rem) var(--hx-space-4, 1rem);
|
|
20
20
|
border-radius: var(--hx-toast-border-radius, var(--hx-border-radius-md, 0.375rem));
|
|
21
|
-
background-color: var(--hx-toast-bg, var(--hx-color-
|
|
22
|
-
color: var(--hx-toast-color, var(--hx-color-
|
|
21
|
+
background-color: var(--hx-toast-bg, var(--hx-color-surface-inverse, #0f172a));
|
|
22
|
+
color: var(--hx-toast-color, var(--hx-color-text-inverse, #ffffff));
|
|
23
23
|
font-family: var(--hx-toast-font-family, var(--hx-font-family-sans, sans-serif));
|
|
24
24
|
font-size: var(--hx-font-size-sm, 0.875rem);
|
|
25
25
|
line-height: var(--hx-line-height-normal, 1.5);
|
|
@@ -46,22 +46,22 @@
|
|
|
46
46
|
|
|
47
47
|
.toast--success {
|
|
48
48
|
--hx-toast-bg: var(--hx-color-success-600, #15803d);
|
|
49
|
-
--hx-toast-color: var(--hx-color-
|
|
49
|
+
--hx-toast-color: var(--hx-color-text-on-success, #ffffff);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.toast--warning {
|
|
53
53
|
--hx-toast-bg: var(--hx-color-warning-500, #d97706);
|
|
54
|
-
--hx-toast-color: var(--hx-color-
|
|
54
|
+
--hx-toast-color: var(--hx-color-text-on-warning, #0f172a);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.toast--danger {
|
|
58
58
|
--hx-toast-bg: var(--hx-color-error-600, #b91c1c);
|
|
59
|
-
--hx-toast-color: var(--hx-color-
|
|
59
|
+
--hx-toast-color: var(--hx-color-text-on-error, #ffffff);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.toast--info {
|
|
63
63
|
--hx-toast-bg: var(--hx-color-primary-600, #1d4ed8);
|
|
64
|
-
--hx-toast-color: var(--hx-color-
|
|
64
|
+
--hx-toast-color: var(--hx-color-text-on-primary, #ffffff);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/* ─── Severity Label (WCAG 1.4.1) ─── */
|
package/dist/css/index.css
CHANGED
package/dist/css/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generated": "2026-04-
|
|
2
|
+
"generated": "2026-04-24T19:28:50.109Z",
|
|
3
3
|
"components": [
|
|
4
4
|
{
|
|
5
5
|
"name": "hx-accordion",
|
|
@@ -517,15 +517,14 @@
|
|
|
517
517
|
"--hx-code-snippet-line-number-color",
|
|
518
518
|
"--hx-code-snippet-padding",
|
|
519
519
|
"--hx-code-snippet-tab-size",
|
|
520
|
-
"--hx-color-
|
|
521
|
-
"--hx-color-
|
|
522
|
-
"--hx-color-neutral-300",
|
|
523
|
-
"--hx-color-neutral-500",
|
|
524
|
-
"--hx-color-neutral-600",
|
|
525
|
-
"--hx-color-neutral-700",
|
|
526
|
-
"--hx-color-neutral-800",
|
|
527
|
-
"--hx-color-neutral-900",
|
|
520
|
+
"--hx-color-border-default",
|
|
521
|
+
"--hx-color-border-strong",
|
|
528
522
|
"--hx-color-primary-400",
|
|
523
|
+
"--hx-color-surface-inverse",
|
|
524
|
+
"--hx-color-surface-sunken",
|
|
525
|
+
"--hx-color-text-inverse",
|
|
526
|
+
"--hx-color-text-muted",
|
|
527
|
+
"--hx-color-text-primary",
|
|
529
528
|
"--hx-filter-brightness-active",
|
|
530
529
|
"--hx-focus-ring-color",
|
|
531
530
|
"--hx-focus-ring-offset",
|
|
@@ -1630,7 +1629,7 @@
|
|
|
1630
1629
|
"file": "hx-rating.css",
|
|
1631
1630
|
"tokens": [
|
|
1632
1631
|
"--hx-border-radius-sm",
|
|
1633
|
-
"--hx-color-
|
|
1632
|
+
"--hx-color-border-strong",
|
|
1634
1633
|
"--hx-color-primary-400",
|
|
1635
1634
|
"--hx-color-warning-300",
|
|
1636
1635
|
"--hx-color-warning-400",
|
|
@@ -1927,12 +1926,12 @@
|
|
|
1927
1926
|
"--hx-border-radius-sm",
|
|
1928
1927
|
"--hx-color-error-50",
|
|
1929
1928
|
"--hx-color-error-700",
|
|
1930
|
-
"--hx-color-neutral-500",
|
|
1931
|
-
"--hx-color-neutral-800",
|
|
1932
|
-
"--hx-color-neutral-900",
|
|
1933
1929
|
"--hx-color-primary-500",
|
|
1934
1930
|
"--hx-color-success-50",
|
|
1935
1931
|
"--hx-color-success-700",
|
|
1932
|
+
"--hx-color-text-muted",
|
|
1933
|
+
"--hx-color-text-primary",
|
|
1934
|
+
"--hx-color-text-strong",
|
|
1936
1935
|
"--hx-font-family-sans",
|
|
1937
1936
|
"--hx-font-size-3xl",
|
|
1938
1937
|
"--hx-font-size-5xl",
|
|
@@ -1975,8 +1974,8 @@
|
|
|
1975
1974
|
"--hx-color-error-500",
|
|
1976
1975
|
"--hx-color-neutral-300",
|
|
1977
1976
|
"--hx-color-neutral-400",
|
|
1978
|
-
"--hx-color-neutral-700",
|
|
1979
1977
|
"--hx-color-success-500",
|
|
1978
|
+
"--hx-color-text-strong",
|
|
1980
1979
|
"--hx-color-warning-500",
|
|
1981
1980
|
"--hx-font-size-sm",
|
|
1982
1981
|
"--hx-space-2",
|
|
@@ -2103,9 +2102,9 @@
|
|
|
2103
2102
|
"name": "hx-table",
|
|
2104
2103
|
"file": "hx-table.css",
|
|
2105
2104
|
"tokens": [
|
|
2106
|
-
"--hx-color-neutral-50",
|
|
2107
|
-
"--hx-color-neutral-700",
|
|
2108
2105
|
"--hx-color-primary-500",
|
|
2106
|
+
"--hx-color-surface-raised",
|
|
2107
|
+
"--hx-color-text-strong",
|
|
2109
2108
|
"--hx-focus-ring-color",
|
|
2110
2109
|
"--hx-focus-ring-offset",
|
|
2111
2110
|
"--hx-focus-ring-width",
|
|
@@ -2372,10 +2371,14 @@
|
|
|
2372
2371
|
"--hx-border-radius-md",
|
|
2373
2372
|
"--hx-border-radius-sm",
|
|
2374
2373
|
"--hx-color-error-600",
|
|
2375
|
-
"--hx-color-neutral-0",
|
|
2376
|
-
"--hx-color-neutral-900",
|
|
2377
2374
|
"--hx-color-primary-600",
|
|
2378
2375
|
"--hx-color-success-600",
|
|
2376
|
+
"--hx-color-surface-inverse",
|
|
2377
|
+
"--hx-color-text-inverse",
|
|
2378
|
+
"--hx-color-text-on-error",
|
|
2379
|
+
"--hx-color-text-on-primary",
|
|
2380
|
+
"--hx-color-text-on-success",
|
|
2381
|
+
"--hx-color-text-on-warning",
|
|
2379
2382
|
"--hx-color-warning-500",
|
|
2380
2383
|
"--hx-focus-ring-offset",
|
|
2381
2384
|
"--hx-focus-ring-width",
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { H as G, a as U } from "./shared/hx-carousel-item-D_dCv61-.js";
|
|
|
13
13
|
import { H as O } from "./shared/hx-checkbox-ZKjOF7_3.js";
|
|
14
14
|
import { H as K } from "./shared/hx-checkbox-group-XjOBHLiP.js";
|
|
15
15
|
import { H as Y } from "./shared/hx-clinical-status-BS5lcddT.js";
|
|
16
|
-
import { H as q } from "./shared/hx-code-snippet-
|
|
16
|
+
import { H as q } from "./shared/hx-code-snippet-DssubcYM.js";
|
|
17
17
|
import { H as J } from "./shared/hx-color-picker-DBaKTVLr.js";
|
|
18
18
|
import { H as Z } from "./shared/hx-combobox-DLwnvHVd.js";
|
|
19
19
|
import { H as oe } from "./shared/hx-container-DVI7sxfX.js";
|
|
@@ -51,7 +51,7 @@ import { H as fo } from "./shared/hx-progress-bar-CJdwAeDg.js";
|
|
|
51
51
|
import { H as ho } from "./shared/hx-progress-ring-3zMwvrwD.js";
|
|
52
52
|
import { H as So } from "./shared/hx-prose-BCtK7YL6.js";
|
|
53
53
|
import { H as To, a as bo } from "./shared/hx-radio-QHrhL908.js";
|
|
54
|
-
import { H as go } from "./shared/hx-rating-
|
|
54
|
+
import { H as go } from "./shared/hx-rating-BO9kl9pb.js";
|
|
55
55
|
import { H as vo } from "./shared/hx-select-BuMvRDkY.js";
|
|
56
56
|
import { H as Eo, a as Do } from "./shared/hx-nav-item-BTMMQv6c.js";
|
|
57
57
|
import { H as wo } from "./shared/hx-skeleton-LxkI0pxr.js";
|
|
@@ -60,21 +60,21 @@ import { H as Mo } from "./shared/hx-spinner-BKjuCdZB.js";
|
|
|
60
60
|
import { H as No } from "./shared/hx-split-button-CEkQqbF9.js";
|
|
61
61
|
import { H as Ao } from "./shared/hx-split-panel-BymHlV5e.js";
|
|
62
62
|
import { H as Go } from "./shared/hx-stack-DGfcOfWJ.js";
|
|
63
|
-
import { H as Vo } from "./shared/hx-stat-
|
|
64
|
-
import { H as Xo } from "./shared/hx-status-indicator-
|
|
65
|
-
import { H as Wo, a as Yo } from "./shared/hx-step-
|
|
63
|
+
import { H as Vo } from "./shared/hx-stat-DTRyLF3a.js";
|
|
64
|
+
import { H as Xo } from "./shared/hx-status-indicator-DIGRGM2G.js";
|
|
65
|
+
import { H as Wo, a as Yo } from "./shared/hx-step-D15gtcLm.js";
|
|
66
66
|
import { H as qo, a as zo } from "./shared/hx-structured-list-CqNbaEXg.js";
|
|
67
67
|
import { H as Qo } from "./shared/hx-style-scope-TDnR8H4O.js";
|
|
68
68
|
import { H as et } from "./shared/hx-switch-CbunfMHW.js";
|
|
69
|
-
import { H as tt, a as rt, b as at, c as it, d as st, e as xt, f as Ht } from "./shared/hx-td-
|
|
69
|
+
import { H as tt, a as rt, b as at, c as it, d as st, e as xt, f as Ht } from "./shared/hx-td-B737T0_c.js";
|
|
70
70
|
import { H as nt, a as pt, b as mt } from "./shared/hx-tab-panel-BIzKfW5i.js";
|
|
71
71
|
import { H as ct } from "./shared/hx-tag-CgnrNnte.js";
|
|
72
72
|
import { H as ht } from "./shared/hx-text-DMC2CPlL.js";
|
|
73
73
|
import { F as St, H as yt } from "./shared/hx-text-input-eSPVURd5.js";
|
|
74
74
|
import { H as bt } from "./shared/hx-textarea-C4DjRmo4.js";
|
|
75
|
-
import { H as gt } from "./shared/hx-theme-
|
|
75
|
+
import { H as gt } from "./shared/hx-theme-BiyQ7UUK.js";
|
|
76
76
|
import { H as vt } from "./shared/hx-time-picker-BtbHX7A4.js";
|
|
77
|
-
import { H as Et, a as Dt, t as kt } from "./shared/toast-factory-
|
|
77
|
+
import { H as Et, a as Dt, t as kt } from "./shared/toast-factory-M373dTcz.js";
|
|
78
78
|
import { H as Bt } from "./shared/hx-toggle-button-FOvw-ebx.js";
|
|
79
79
|
import { H as Ft } from "./shared/hx-tooltip-BoZi2crX.js";
|
|
80
80
|
import { H as Lt } from "./shared/hx-top-nav-Cd9zvv1B.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as r, state as d, customElement as
|
|
1
|
+
import { css as f, html as p, nothing as h } from "lit";
|
|
2
|
+
import { property as r, state as d, customElement as u } from "lit/decorators.js";
|
|
3
3
|
import { classMap as x } from "lit/directives/class-map.js";
|
|
4
|
-
import { H as
|
|
5
|
-
const b =
|
|
4
|
+
import { H as m } from "./helix-element-BNEYeiys.js";
|
|
5
|
+
const b = f`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
8
|
}
|
|
@@ -17,8 +17,8 @@ const b = u`
|
|
|
17
17
|
display: inline;
|
|
18
18
|
font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-mono, monospace));
|
|
19
19
|
font-size: var(--hx-code-snippet-font-size, var(--hx-font-size-sm, 0.875em));
|
|
20
|
-
background-color: var(--hx-code-snippet-inline-bg, var(--hx-color-
|
|
21
|
-
color: var(--hx-code-snippet-inline-color, var(--hx-color-
|
|
20
|
+
background-color: var(--hx-code-snippet-inline-bg, var(--hx-color-surface-sunken, #f1f5f9));
|
|
21
|
+
color: var(--hx-code-snippet-inline-color, var(--hx-color-text-primary, #0f172a));
|
|
22
22
|
padding: var(--hx-code-snippet-inline-padding-y, 0.125em)
|
|
23
23
|
var(--hx-code-snippet-inline-padding-x, 0.375em);
|
|
24
24
|
border-radius: var(--hx-code-snippet-border-radius, var(--hx-border-radius-sm, 0.25rem));
|
|
@@ -28,7 +28,7 @@ const b = u`
|
|
|
28
28
|
|
|
29
29
|
.code-snippet {
|
|
30
30
|
position: relative;
|
|
31
|
-
background-color: var(--hx-code-snippet-bg, var(--hx-color-
|
|
31
|
+
background-color: var(--hx-code-snippet-bg, var(--hx-color-surface-inverse, #0f172a));
|
|
32
32
|
border-radius: var(--hx-code-snippet-border-radius, var(--hx-border-radius-md, 0.375rem));
|
|
33
33
|
overflow: hidden;
|
|
34
34
|
}
|
|
@@ -68,7 +68,7 @@ const b = u`
|
|
|
68
68
|
font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-mono, monospace));
|
|
69
69
|
font-size: var(--hx-code-snippet-font-size, var(--hx-font-size-sm, 0.875rem));
|
|
70
70
|
line-height: var(--hx-line-height-relaxed, 1.75);
|
|
71
|
-
color: var(--hx-code-snippet-color, var(--hx-color-
|
|
71
|
+
color: var(--hx-code-snippet-color, var(--hx-color-text-inverse, #ffffff));
|
|
72
72
|
tab-size: var(--hx-code-snippet-tab-size, 2);
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -82,10 +82,11 @@ const b = u`
|
|
|
82
82
|
min-width: var(--hx-touch-target-min, 2.75rem);
|
|
83
83
|
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
84
84
|
padding: var(--hx-space-1, 0.25rem) var(--hx-space-2, 0.5rem);
|
|
85
|
-
border: var(--hx-border-width-thin, 1px) solid var(--hx-color-
|
|
85
|
+
border: var(--hx-border-width-thin, 1px) solid var(--hx-color-border-strong, #94a3b8);
|
|
86
86
|
border-radius: var(--hx-border-radius-sm, 0.25rem);
|
|
87
|
-
|
|
88
|
-
color: var(--hx-color-
|
|
87
|
+
/* Copy button sits on the always-dark block snippet surface; uses inverse family for contrast on the terminal background. */
|
|
88
|
+
background-color: var(--hx-color-surface-inverse, #0f172a);
|
|
89
|
+
color: var(--hx-color-text-inverse, #ffffff);
|
|
89
90
|
font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-sans, sans-serif));
|
|
90
91
|
font-size: var(--hx-font-size-xs, 0.75rem);
|
|
91
92
|
font-weight: var(--hx-font-weight-medium, 500);
|
|
@@ -100,8 +101,9 @@ const b = u`
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
.code-snippet__copy-button:hover {
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
/* Hover on inverse terminal surface — keep semantic inverse family; border lifts via border-default in inverse context. */
|
|
105
|
+
background-color: var(--hx-color-surface-inverse, #0f172a);
|
|
106
|
+
border-color: var(--hx-color-border-default, #e2e8f0);
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
.code-snippet__copy-button:focus-visible {
|
|
@@ -125,9 +127,10 @@ const b = u`
|
|
|
125
127
|
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
126
128
|
padding: var(--hx-space-2, 0.5rem) var(--hx-space-4, 1rem);
|
|
127
129
|
border: none;
|
|
128
|
-
border-top: var(--hx-border-width-thin, 1px) solid var(--hx-color-
|
|
129
|
-
|
|
130
|
-
color: var(--hx-color-
|
|
130
|
+
border-top: var(--hx-border-width-thin, 1px) solid var(--hx-color-border-strong, #94a3b8);
|
|
131
|
+
/* Expand button is attached to the always-dark block snippet — inverse family maintains the terminal aesthetic. */
|
|
132
|
+
background-color: var(--hx-color-surface-inverse, #0f172a);
|
|
133
|
+
color: var(--hx-color-text-inverse, #ffffff);
|
|
131
134
|
font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-sans, sans-serif));
|
|
132
135
|
font-size: var(--hx-font-size-sm, 0.875rem);
|
|
133
136
|
font-weight: var(--hx-font-weight-medium, 500);
|
|
@@ -137,8 +140,8 @@ const b = u`
|
|
|
137
140
|
}
|
|
138
141
|
|
|
139
142
|
.code-snippet__expand-button:hover {
|
|
140
|
-
background-color: var(--hx-color-
|
|
141
|
-
color: var(--hx-color-
|
|
143
|
+
background-color: var(--hx-color-surface-inverse, #0f172a);
|
|
144
|
+
color: var(--hx-color-text-inverse, #ffffff);
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
.code-snippet__expand-button:focus-visible {
|
|
@@ -153,7 +156,7 @@ const b = u`
|
|
|
153
156
|
display: inline-block;
|
|
154
157
|
min-width: var(--hx-space-8, 2rem);
|
|
155
158
|
padding-inline-end: var(--hx-space-3, 0.75rem);
|
|
156
|
-
color: var(--hx-code-snippet-line-number-color, var(--hx-color-
|
|
159
|
+
color: var(--hx-code-snippet-line-number-color, var(--hx-color-text-muted, #64748b));
|
|
157
160
|
user-select: none;
|
|
158
161
|
text-align: end;
|
|
159
162
|
}
|
|
@@ -204,12 +207,12 @@ const b = u`
|
|
|
204
207
|
border: 0;
|
|
205
208
|
}
|
|
206
209
|
`;
|
|
207
|
-
var v = Object.defineProperty,
|
|
208
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
210
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, t, n, a) => {
|
|
211
|
+
for (var s = a > 1 ? void 0 : a ? y(t, n) : t, l = e.length - 1, c; l >= 0; l--)
|
|
209
212
|
(c = e[l]) && (s = (a ? c(t, n, s) : c(s)) || s);
|
|
210
213
|
return a && s && v(t, n, s), s;
|
|
211
214
|
};
|
|
212
|
-
let o = class extends
|
|
215
|
+
let o = class extends m {
|
|
213
216
|
constructor() {
|
|
214
217
|
super(...arguments), this.language = "", this.inline = !1, this.wrap = !1, this.copyable = !1, this.maxLines = 0, this.lineNumbers = !1, this.labelCopy = "Copy code", this.labelCopied = "Copied!", this.labelShowMore = "Show more", this.labelShowLess = "Show less", this._copied = !1, this._expanded = !1, this._codeText = "", this._copyTimer = null;
|
|
215
218
|
}
|
|
@@ -374,9 +377,9 @@ i([
|
|
|
374
377
|
d()
|
|
375
378
|
], o.prototype, "_codeText", 2);
|
|
376
379
|
o = i([
|
|
377
|
-
|
|
380
|
+
u("hx-code-snippet")
|
|
378
381
|
], o);
|
|
379
382
|
export {
|
|
380
383
|
o as H
|
|
381
384
|
};
|
|
382
|
-
//# sourceMappingURL=hx-code-snippet-
|
|
385
|
+
//# sourceMappingURL=hx-code-snippet-DssubcYM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-code-snippet-DssubcYM.js","sources":["../../src/components/hx-code-snippet/hx-code-snippet.styles.ts","../../src/components/hx-code-snippet/hx-code-snippet.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixCodeSnippetStyles = css`\n :host {\n display: block;\n }\n\n :host([inline]) {\n display: inline;\n }\n\n /* ─── Inline Mode ─── */\n\n .code-snippet--inline {\n display: inline;\n font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-mono, monospace));\n font-size: var(--hx-code-snippet-font-size, var(--hx-font-size-sm, 0.875em));\n background-color: var(--hx-code-snippet-inline-bg, var(--hx-color-surface-sunken, #f1f5f9));\n color: var(--hx-code-snippet-inline-color, var(--hx-color-text-primary, #0f172a));\n padding: var(--hx-code-snippet-inline-padding-y, 0.125em)\n var(--hx-code-snippet-inline-padding-x, 0.375em);\n border-radius: var(--hx-code-snippet-border-radius, var(--hx-border-radius-sm, 0.25rem));\n }\n\n /* ─── Block Mode Container ─── */\n\n .code-snippet {\n position: relative;\n background-color: var(--hx-code-snippet-bg, var(--hx-color-surface-inverse, #0f172a));\n border-radius: var(--hx-code-snippet-border-radius, var(--hx-border-radius-md, 0.375rem));\n overflow: hidden;\n }\n\n /* ─── Hidden Slot ─── */\n\n .code-snippet__slot {\n display: none;\n }\n\n /* ─── Header ─── */\n\n .code-snippet__header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: var(--hx-space-2, 0.5rem) var(--hx-space-2, 0.5rem) 0;\n min-height: var(--hx-space-8, 2rem);\n }\n\n /* ─── Pre / Code ─── */\n\n .code-snippet__pre {\n margin: 0;\n padding: var(--hx-code-snippet-padding, var(--hx-space-4, 1rem));\n overflow-x: auto;\n white-space: pre;\n }\n\n .code-snippet__pre--wrap {\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .code-snippet__code {\n display: block;\n font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-mono, monospace));\n font-size: var(--hx-code-snippet-font-size, var(--hx-font-size-sm, 0.875rem));\n line-height: var(--hx-line-height-relaxed, 1.75);\n color: var(--hx-code-snippet-color, var(--hx-color-text-inverse, #ffffff));\n tab-size: var(--hx-code-snippet-tab-size, 2);\n }\n\n /* ─── Copy Button ─── */\n\n .code-snippet__copy-button {\n display: inline-flex;\n align-items: center;\n gap: var(--hx-space-1, 0.25rem);\n /* WCAG 2.5.5: minimum 44×44px touch target */\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n padding: var(--hx-space-1, 0.25rem) var(--hx-space-2, 0.5rem);\n border: var(--hx-border-width-thin, 1px) solid var(--hx-color-border-strong, #94a3b8);\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n /* Copy button sits on the always-dark block snippet surface; uses inverse family for contrast on the terminal background. */\n background-color: var(--hx-color-surface-inverse, #0f172a);\n color: var(--hx-color-text-inverse, #ffffff);\n font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-sans, sans-serif));\n font-size: var(--hx-font-size-xs, 0.75rem);\n font-weight: var(--hx-font-weight-medium, 500);\n line-height: 1; /* intentional literal: icon/action button needs line-height 1; no token maps to exactly 1 */\n cursor: pointer;\n transition:\n background-color var(--hx-transition-fast, 150ms ease),\n color var(--hx-transition-fast, 150ms ease),\n border-color var(--hx-transition-fast, 150ms ease);\n white-space: nowrap;\n z-index: 1; /* @audit-exception: local stacking context within shadow root */\n }\n\n .code-snippet__copy-button:hover {\n /* Hover on inverse terminal surface — keep semantic inverse family; border lifts via border-default in inverse context. */\n background-color: var(--hx-color-surface-inverse, #0f172a);\n border-color: var(--hx-color-border-default, #e2e8f0);\n }\n\n .code-snippet__copy-button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-focus-ring-color, var(--hx-color-primary-400, #60a5fa));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n .code-snippet__copy-button:active {\n /* Non-standard token — fallback 0.8 applies if token is absent */\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n /* ─── Expand Button ─── */\n\n .code-snippet__expand-button {\n display: block;\n width: 100%;\n /* WCAG 2.5.5: minimum 44×44px touch target */\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n padding: var(--hx-space-2, 0.5rem) var(--hx-space-4, 1rem);\n border: none;\n border-top: var(--hx-border-width-thin, 1px) solid var(--hx-color-border-strong, #94a3b8);\n /* Expand button is attached to the always-dark block snippet — inverse family maintains the terminal aesthetic. */\n background-color: var(--hx-color-surface-inverse, #0f172a);\n color: var(--hx-color-text-inverse, #ffffff);\n font-family: var(--hx-code-snippet-font-family, var(--hx-font-family-sans, sans-serif));\n font-size: var(--hx-font-size-sm, 0.875rem);\n font-weight: var(--hx-font-weight-medium, 500);\n text-align: center;\n cursor: pointer;\n transition: background-color var(--hx-transition-fast, 150ms ease);\n }\n\n .code-snippet__expand-button:hover {\n background-color: var(--hx-color-surface-inverse, #0f172a);\n color: var(--hx-color-text-inverse, #ffffff);\n }\n\n .code-snippet__expand-button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-focus-ring-color, var(--hx-color-primary-400, #60a5fa));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /* ─── Line Numbers ─── */\n\n .code-snippet__line-number {\n display: inline-block;\n min-width: var(--hx-space-8, 2rem);\n padding-inline-end: var(--hx-space-3, 0.75rem);\n color: var(--hx-code-snippet-line-number-color, var(--hx-color-text-muted, #64748b));\n user-select: none;\n text-align: end;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .code-snippet__copy-button {\n transition: none;\n }\n\n .code-snippet__expand-button {\n transition: none;\n }\n }\n\n /* ─── Forced Colors (Windows High Contrast) ─── */\n\n @media (forced-colors: active) {\n .code-snippet {\n border: 1px solid CanvasText;\n }\n\n .code-snippet--inline {\n border: 1px solid CanvasText;\n }\n\n .code-snippet__copy-button {\n border-color: ButtonText;\n color: ButtonText;\n }\n\n .code-snippet__expand-button {\n border-top-color: CanvasText;\n color: ButtonText;\n }\n }\n\n /* ─── Screen-reader only ─── */\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n`;\n","import { html, nothing, TemplateResult } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { HelixElement } from '../../base/index.js';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { helixCodeSnippetStyles } from './hx-code-snippet.styles.js';\n\n/**\n * A styled code block with optional copy button and max-lines truncation.\n * Supports block (`<pre><code>`) and inline (`<code>`) rendering modes.\n * No external syntax highlighting dependency — use the `language` attribute\n * as a hint for consumers integrating their own highlighter via slotted content.\n *\n * @summary Styled code display component with copy-to-clipboard and expand/collapse.\n *\n * @tag hx-code-snippet\n *\n * @slot - Code content as plain text. Note: HTML markup in slot content will be\n * stripped — only text content is extracted. Pre-highlighted HTML is not supported.\n *\n * @fires {CustomEvent<{text: string}>} hx-copy - Dispatched when the copy button is clicked.\n *\n * @csspart base - The outermost container (block: `<div>`, inline: `<code>`).\n * @csspart header - The header bar containing the copy button (block mode only).\n * @csspart code - The `<code>` element containing the content.\n * @csspart copy-button - The copy-to-clipboard button.\n * @csspart expand-button - The \"Show more / Show less\" button.\n *\n * @cssprop [--hx-code-snippet-bg=var(--hx-color-neutral-900,#0f172a)] - Background color.\n * @cssprop [--hx-code-snippet-color=var(--hx-color-neutral-100,#f1f5f9)] - Text color.\n * @cssprop [--hx-code-snippet-font-family=var(--hx-font-family-mono,monospace)] - Font family.\n * @cssprop [--hx-code-snippet-font-size=var(--hx-font-size-sm,0.875rem)] - Font size.\n * @cssprop [--hx-code-snippet-border-radius=var(--hx-border-radius-md,0.375rem)] - Border radius.\n * @cssprop [--hx-code-snippet-padding=var(--hx-space-4,1rem)] - Inner padding (block mode).\n * @cssprop [--hx-border-radius-md] - CSS custom property.\n * @cssprop [--hx-border-radius-sm] - CSS custom property.\n * @cssprop [--hx-border-width-thin] - Width.\n * @cssprop [--hx-code-snippet-inline-bg=var(--hx-color-neutral-100)] - Background color.\n * @cssprop [--hx-code-snippet-inline-color=var(--hx-color-neutral-900)] - Color.\n * @cssprop [--hx-code-snippet-inline-padding-x=0.375em] - Padding.\n * @cssprop [--hx-code-snippet-inline-padding-y=0.125em] - Padding.\n * @cssprop [--hx-code-snippet-line-number-color=var(--hx-color-neutral-500)] - Color.\n * @cssprop [--hx-code-snippet-tab-size=2] - Number of spaces per tab character.\n * @cssprop [--hx-color-neutral-100] - Color.\n * @cssprop [--hx-color-neutral-200] - Color.\n * @cssprop [--hx-color-neutral-300] - Color.\n * @cssprop [--hx-color-neutral-500] - Color.\n * @cssprop [--hx-color-neutral-600] - Color.\n * @cssprop [--hx-color-neutral-700] - Color.\n * @cssprop [--hx-color-neutral-800] - Color.\n * @cssprop [--hx-color-neutral-900] - Color.\n * @cssprop [--hx-color-primary-400] - Color.\n * @cssprop [--hx-filter-brightness-active] - CSS filter.\n * @cssprop [--hx-focus-ring-color] - Color.\n * @cssprop [--hx-focus-ring-offset] - CSS custom property.\n * @cssprop [--hx-focus-ring-width] - Width.\n * @cssprop [--hx-font-family-mono] - Font family.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-font-size-xs] - Font size.\n * @cssprop [--hx-font-weight-medium] - Font weight.\n * @cssprop [--hx-line-height-relaxed] - Line height.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-space-3] - Spacing token.\n * @cssprop [--hx-space-4] - Spacing token.\n * @cssprop [--hx-space-8] - Spacing token.\n * @cssprop [--hx-touch-target-min] - Minimum touch target size.\n * @cssprop [--hx-transition-fast] - Transition timing.\n */\n@customElement('hx-code-snippet')\nexport class HelixCodeSnippet extends HelixElement {\n static override styles = [helixCodeSnippetStyles];\n\n // ─── Public Properties ───\n\n /**\n * Language hint for consumers to apply syntax highlighting.\n * Does not affect rendering directly; it is applied as a `language-*` class\n * on the `<code>` element so external highlighters can target it.\n * @attr language\n */\n @property({ type: String, reflect: true })\n language: string = '';\n\n /**\n * When true, renders as an inline `<code>` element instead of a `<pre><code>` block.\n * @attr inline\n */\n @property({ type: Boolean, reflect: true })\n inline: boolean = false;\n\n /**\n * When true, enables word-wrap in block mode.\n * @attr wrap\n */\n @property({ type: Boolean, reflect: true })\n wrap: boolean = false;\n\n /**\n * When true, shows a copy-to-clipboard button. Add the `copyable` attribute to enable it.\n * @attr copyable\n */\n @property({ type: Boolean, reflect: true })\n copyable: boolean = false;\n\n /**\n * Maximum number of lines to display before showing a \"Show more\" button.\n * Set to 0 (default) to disable truncation.\n * @attr max-lines\n */\n @property({ type: Number, attribute: 'max-lines', reflect: true })\n maxLines: number = 0;\n\n /**\n * When true, prepends line numbers to each displayed line in block mode.\n * Line numbers are rendered as `aria-hidden` spans so screen readers skip them.\n * @attr line-numbers\n */\n @property({ type: Boolean, attribute: 'line-numbers', reflect: true })\n lineNumbers: boolean = false;\n\n /**\n * Label for the copy button in idle state.\n * @attr label-copy\n */\n @property({ type: String, attribute: 'label-copy' })\n labelCopy = 'Copy code';\n\n /**\n * Label for the copy button after successful copy.\n * @attr label-copied\n */\n @property({ type: String, attribute: 'label-copied' })\n labelCopied = 'Copied!';\n\n /**\n * Label for the expand button when content is collapsed.\n * @attr label-show-more\n */\n @property({ type: String, attribute: 'label-show-more' })\n labelShowMore = 'Show more';\n\n /**\n * Label for the expand button when content is expanded.\n * @attr label-show-less\n */\n @property({ type: String, attribute: 'label-show-less' })\n labelShowLess = 'Show less';\n\n // ─── Internal State ───\n\n /** @internal */\n @state() private _copied: boolean = false;\n /** @internal */\n @state() private _expanded: boolean = false;\n /** @internal */\n @state() private _codeText: string = '';\n\n /** @internal */\n private _copyTimer: ReturnType<typeof setTimeout> | null = null;\n\n // ─── Lifecycle ───\n\n override firstUpdated(): void {\n // Prevent flash of empty <code> before slotchange fires by eagerly reading\n // text content from host children that are already present on first render.\n if (!this._codeText) {\n const text = this.textContent?.trim() ?? '';\n if (text) {\n this._codeText = text;\n }\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._copyTimer !== null) {\n clearTimeout(this._copyTimer);\n this._copyTimer = null;\n }\n }\n\n // ─── Event Handlers ───\n\n /** @internal */\n private _handleSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement | null;\n if (!slot) return;\n const nodes = slot.assignedNodes({ flatten: true });\n this._codeText = nodes.map((n) => n.textContent ?? '').join('');\n }\n\n /** @internal */\n private _handleCopy(): void {\n const text = this._codeText;\n\n navigator?.clipboard?.writeText(text).catch(() => {\n // Clipboard API unavailable (non-HTTPS environments such as Drupal staging) — emit event only.\n // Note: navigator.clipboard requires a secure context (HTTPS or localhost).\n // On HTTP, the copy event still fires but the clipboard is not populated.\n });\n\n this.dispatchEvent(\n new CustomEvent<{ text: string }>('hx-copy', {\n bubbles: true,\n composed: true,\n detail: { text },\n }),\n );\n\n this._copied = true;\n if (this._copyTimer !== null) clearTimeout(this._copyTimer);\n this._copyTimer = setTimeout(() => {\n this._copied = false;\n }, 2000);\n }\n\n /** @internal */\n private _handleExpand(): void {\n this._expanded = !this._expanded;\n }\n\n // ─── Helpers ───\n\n /** @internal */\n private _getDisplayLines(): string[] {\n const lines = this._codeText.split('\\n');\n if (!this.maxLines || this.maxLines <= 0 || this._expanded) {\n return lines;\n }\n if (lines.length <= this.maxLines) {\n return lines;\n }\n return lines.slice(0, this.maxLines);\n }\n\n /** @internal */\n private _isTruncated(): boolean {\n if (!this.maxLines || this.maxLines <= 0) return false;\n const lines = this._codeText.split('\\n');\n return lines.length > this.maxLines;\n }\n\n /** @internal */\n private _renderLines(lines: string[]): TemplateResult {\n if (!this.lineNumbers) {\n return html`${lines.join('\\n')}`;\n }\n return html`${lines.map(\n (line, i) =>\n html`<span aria-hidden=\"true\" class=\"code-snippet__line-number\">${i + 1}</span>${line +\n '\\n'}`,\n )}`;\n }\n\n // ─── Render ───\n\n override render(): TemplateResult | typeof nothing {\n if (this.inline) {\n return html`\n <code part=\"base code\" class=\"code-snippet code-snippet--inline\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </code>\n `;\n }\n\n const displayLines = this._getDisplayLines();\n const truncated = this._isTruncated();\n const preLabel = this.language ? `Code snippet: ${this.language}` : 'Code snippet';\n const codeClasses = classMap({\n 'code-snippet__code': true,\n [`language-${this.language}`]: Boolean(this.language),\n });\n\n return html`\n <div part=\"base\" class=\"code-snippet\">\n <div part=\"header\" class=\"code-snippet__header\">\n ${this.copyable\n ? html`\n <button\n part=\"copy-button\"\n class=\"code-snippet__copy-button\"\n type=\"button\"\n aria-label=${this._copied ? this.labelCopied : this.labelCopy}\n @click=${this._handleCopy}\n >\n ${this._copied ? this.labelCopied : this.labelCopy}\n </button>\n `\n : nothing}\n </div>\n\n <!-- Visually-hidden live region announces copy confirmation to assistive technology -->\n <span\n aria-live=\"polite\"\n style=\"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;\"\n >${this._copied ? this.labelCopied : ''}</span\n >\n\n <pre\n role=\"region\"\n aria-label=${preLabel}\n class=${classMap({\n 'code-snippet__pre': true,\n 'code-snippet__pre--wrap': this.wrap,\n })}\n ><code part=\"code\" class=${codeClasses}>${this._renderLines(displayLines)}</code></pre>\n\n <!-- Hidden slot to capture text content for display and copy -->\n <slot class=\"code-snippet__slot\" @slotchange=${this._handleSlotChange}></slot>\n\n ${truncated\n ? html`\n <button\n part=\"expand-button\"\n class=\"code-snippet__expand-button\"\n type=\"button\"\n aria-expanded=${this._expanded ? 'true' : 'false'}\n @click=${this._handleExpand}\n >\n ${this._expanded ? this.labelShowLess : this.labelShowMore}\n </button>\n `\n : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-code-snippet': HelixCodeSnippet;\n }\n}\n"],"names":["helixCodeSnippetStyles","css","HelixCodeSnippet","HelixElement","text","_a","slot","nodes","n","lines","html","line","i","displayLines","truncated","preLabel","codeClasses","classMap","nothing","__decorateClass","property","state","customElement"],"mappings":";;;;AAEO,MAAMA,IAAyBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AA;AAOAiB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAhC/BlB,EAiCX,WAAA,YAAA,CAAA;AAQAiB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,aAAa,SAAS,IAAM;AAAA,GAxCtDlB,EAyCX,WAAA,YAAA,CAAA;AAQAiB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,WAAW,gBAAgB,SAAS,IAAM;AAAA,GAhD1DlB,EAiDX,WAAA,eAAA,CAAA;AAOAiB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAvDxClB,EAwDX,WAAA,aAAA,CAAA;AAOAiB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,GA9D1ClB,EA+DX,WAAA,eAAA,CAAA;AAOAiB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,mBAAmB;AAAA,GArE7ClB,EAsEX,WAAA,iBAAA,CAAA;AAOAiB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,mBAAmB;AAAA,GA5E7ClB,EA6EX,WAAA,iBAAA,CAAA;AAKiBiB,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAlFInB,EAkFM,WAAA,WAAA,CAAA;AAEAiB,EAAA;AAAA,EAAhBE,EAAA;AAAM,GApFInB,EAoFM,WAAA,aAAA,CAAA;AAEAiB,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAtFInB,EAsFM,WAAA,aAAA,CAAA;AAtFNA,IAANiB,EAAA;AAAA,EADNG,EAAc,iBAAiB;AAAA,GACnBpB,CAAA;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css as f, html as d, nothing as p } from "lit";
|
|
2
2
|
import { property as h, state as v, customElement as y } from "lit/decorators.js";
|
|
3
3
|
import { F as _ } from "./FormMixin-B8PXk5RQ.js";
|
|
4
|
-
import { H as
|
|
5
|
-
const
|
|
4
|
+
import { H as g } from "./helix-element-BNEYeiys.js";
|
|
5
|
+
const x = f`
|
|
6
6
|
:host {
|
|
7
7
|
display: inline-block;
|
|
8
8
|
}
|
|
@@ -37,7 +37,7 @@ const g = f`
|
|
|
37
37
|
justify-content: center;
|
|
38
38
|
position: relative;
|
|
39
39
|
cursor: pointer;
|
|
40
|
-
color: var(--hx-rating-empty-color, var(--hx-color-
|
|
40
|
+
color: var(--hx-rating-empty-color, var(--hx-color-border-strong, #cbd5e1));
|
|
41
41
|
line-height: 1;
|
|
42
42
|
min-width: var(--hx-touch-target-min, 2.75rem);
|
|
43
43
|
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
@@ -88,7 +88,7 @@ const g = f`
|
|
|
88
88
|
position: absolute;
|
|
89
89
|
left: 0;
|
|
90
90
|
top: 0;
|
|
91
|
-
color: var(--hx-rating-empty-color, var(--hx-color-
|
|
91
|
+
color: var(--hx-rating-empty-color, var(--hx-color-border-strong, #cbd5e1));
|
|
92
92
|
/* Clip to right 50% for the empty half */
|
|
93
93
|
clip-path: inset(0 0 0 50%);
|
|
94
94
|
}
|
|
@@ -141,11 +141,11 @@ const g = f`
|
|
|
141
141
|
}
|
|
142
142
|
`;
|
|
143
143
|
var w = Object.defineProperty, S = Object.getOwnPropertyDescriptor, n = (e, t, s, o) => {
|
|
144
|
-
for (var r = o > 1 ? void 0 : o ? S(t, s) : t, a = e.length - 1,
|
|
145
|
-
(
|
|
144
|
+
for (var r = o > 1 ? void 0 : o ? S(t, s) : t, a = e.length - 1, i; a >= 0; a--)
|
|
145
|
+
(i = e[a]) && (r = (o ? i(t, s, r) : i(r)) || r);
|
|
146
146
|
return o && r && w(t, s, r), r;
|
|
147
147
|
};
|
|
148
|
-
let
|
|
148
|
+
let l = class extends _(g) {
|
|
149
149
|
constructor() {
|
|
150
150
|
super(...arguments), this.value = 0, this.max = 5, this.precision = 1, this.readonly = !1, this.disabled = !1, this.name = "", this.label = "", this.required = !1, this.labelStar = (e) => e === 1 ? "1 star" : `${e} stars`, this.labelValueText = (e, t) => `${e} out of ${t} stars`, this._hoverValue = null, this._defaultValue = 0;
|
|
151
151
|
}
|
|
@@ -362,10 +362,10 @@ let i = class extends _(x) {
|
|
|
362
362
|
return this.readonly ? d`
|
|
363
363
|
<div part="base" class="base base--readonly" role="img" aria-label=${s}>
|
|
364
364
|
${Array.from({ length: this.max }, (o, r) => {
|
|
365
|
-
const a = r + 1,
|
|
365
|
+
const a = r + 1, i = this._getStarState(a);
|
|
366
366
|
return d`
|
|
367
|
-
<span part="symbol" class="symbol symbol--${
|
|
368
|
-
<slot name="icon" data-state="${
|
|
367
|
+
<span part="symbol" class="symbol symbol--${i}" data-index="${a}">
|
|
368
|
+
<slot name="icon" data-state="${i}">${this._renderStarIcon(i)}</slot>
|
|
369
369
|
</span>
|
|
370
370
|
`;
|
|
371
371
|
})}
|
|
@@ -386,11 +386,11 @@ let i = class extends _(x) {
|
|
|
386
386
|
@mouseleave="${this._handleMouseLeave}"
|
|
387
387
|
>
|
|
388
388
|
${Array.from({ length: this.max }, (o, r) => {
|
|
389
|
-
const a = r + 1,
|
|
389
|
+
const a = r + 1, i = this._getStarState(a);
|
|
390
390
|
return d`
|
|
391
391
|
<span
|
|
392
392
|
part="symbol"
|
|
393
|
-
class="symbol symbol--${
|
|
393
|
+
class="symbol symbol--${i}${this.disabled ? " symbol--disabled" : ""}"
|
|
394
394
|
role="presentation"
|
|
395
395
|
aria-hidden="true"
|
|
396
396
|
data-index="${a}"
|
|
@@ -398,7 +398,7 @@ let i = class extends _(x) {
|
|
|
398
398
|
@mouseenter="${(u) => this._handleSymbolMouseEnter(u, a)}"
|
|
399
399
|
@mousemove="${(u) => this._handleSymbolMouseMove(u, a)}"
|
|
400
400
|
>
|
|
401
|
-
<slot name="icon" data-state="${
|
|
401
|
+
<slot name="icon" data-state="${i}">${this._renderStarIcon(i)}</slot>
|
|
402
402
|
</span>
|
|
403
403
|
`;
|
|
404
404
|
})}
|
|
@@ -415,11 +415,11 @@ let i = class extends _(x) {
|
|
|
415
415
|
@mouseleave="${this._handleMouseLeave}"
|
|
416
416
|
>
|
|
417
417
|
${Array.from({ length: this.max }, (o, r) => {
|
|
418
|
-
const a = r + 1,
|
|
418
|
+
const a = r + 1, i = this._getStarState(a), u = this._isChecked(a), m = this.labelStar(a), b = this.value > 0 ? Math.ceil(this.value) === a : a === 1;
|
|
419
419
|
return d`
|
|
420
420
|
<span
|
|
421
421
|
part="symbol"
|
|
422
|
-
class="symbol symbol--${
|
|
422
|
+
class="symbol symbol--${i}${this.disabled ? " symbol--disabled" : ""}"
|
|
423
423
|
role="radio"
|
|
424
424
|
aria-label="${m}"
|
|
425
425
|
aria-checked="${u ? "true" : "false"}"
|
|
@@ -429,7 +429,7 @@ let i = class extends _(x) {
|
|
|
429
429
|
@mouseenter="${(c) => this._handleSymbolMouseEnter(c, a)}"
|
|
430
430
|
@mousemove="${(c) => this._handleSymbolMouseMove(c, a)}"
|
|
431
431
|
>
|
|
432
|
-
<slot name="icon" data-state="${
|
|
432
|
+
<slot name="icon" data-state="${i}">${this._renderStarIcon(i)}</slot>
|
|
433
433
|
</span>
|
|
434
434
|
`;
|
|
435
435
|
})}
|
|
@@ -437,45 +437,45 @@ let i = class extends _(x) {
|
|
|
437
437
|
`;
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
l.styles = [x];
|
|
441
|
+
l.formAssociated = !0;
|
|
442
442
|
n([
|
|
443
443
|
h({ type: Number, reflect: !0 })
|
|
444
|
-
],
|
|
444
|
+
], l.prototype, "value", 2);
|
|
445
445
|
n([
|
|
446
446
|
h({ type: Number, reflect: !0 })
|
|
447
|
-
],
|
|
447
|
+
], l.prototype, "max", 2);
|
|
448
448
|
n([
|
|
449
449
|
h({ type: Number, reflect: !0 })
|
|
450
|
-
],
|
|
450
|
+
], l.prototype, "precision", 2);
|
|
451
451
|
n([
|
|
452
452
|
h({ type: Boolean, reflect: !0 })
|
|
453
|
-
],
|
|
453
|
+
], l.prototype, "readonly", 2);
|
|
454
454
|
n([
|
|
455
455
|
h({ type: Boolean, reflect: !0 })
|
|
456
|
-
],
|
|
456
|
+
], l.prototype, "disabled", 2);
|
|
457
457
|
n([
|
|
458
458
|
h({ type: String, reflect: !0 })
|
|
459
|
-
],
|
|
459
|
+
], l.prototype, "name", 2);
|
|
460
460
|
n([
|
|
461
461
|
h({ type: String })
|
|
462
|
-
],
|
|
462
|
+
], l.prototype, "label", 2);
|
|
463
463
|
n([
|
|
464
464
|
h({ type: Boolean, reflect: !0 })
|
|
465
|
-
],
|
|
465
|
+
], l.prototype, "required", 2);
|
|
466
466
|
n([
|
|
467
467
|
h({ attribute: !1 })
|
|
468
|
-
],
|
|
468
|
+
], l.prototype, "labelStar", 2);
|
|
469
469
|
n([
|
|
470
470
|
h({ attribute: !1 })
|
|
471
|
-
],
|
|
471
|
+
], l.prototype, "labelValueText", 2);
|
|
472
472
|
n([
|
|
473
473
|
v()
|
|
474
|
-
],
|
|
475
|
-
|
|
474
|
+
], l.prototype, "_hoverValue", 2);
|
|
475
|
+
l = n([
|
|
476
476
|
y("hx-rating")
|
|
477
|
-
],
|
|
477
|
+
], l);
|
|
478
478
|
export {
|
|
479
|
-
|
|
479
|
+
l as H
|
|
480
480
|
};
|
|
481
|
-
//# sourceMappingURL=hx-rating-
|
|
481
|
+
//# sourceMappingURL=hx-rating-BO9kl9pb.js.map
|