@nysds/nys-badge 1.19.3 → 1.20.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/dist/index.d.ts +1 -0
- package/dist/nys-badge.d.ts +125 -0
- package/dist/nys-badge.figma.d.ts +1 -0
- package/dist/nys-badge.js +83 -47
- package/dist/nys-badge.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./nys-badge";
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-icon";
|
|
3
|
+
/**
|
|
4
|
+
* A compact label for status, counts, or categorization. Supports semantic intents with auto-selected icons.
|
|
5
|
+
*
|
|
6
|
+
* Use badges to highlight metadata like status ("Approved"), counts ("3 new"), or categories.
|
|
7
|
+
* Set `intent` to apply semantic meaning. Add `prefixIcon` or `suffixIcon` as boolean for default icons,
|
|
8
|
+
* or pass icon name strings for custom icons.
|
|
9
|
+
*
|
|
10
|
+
* @summary Compact label for status, counts, or categorization with semantic styling.
|
|
11
|
+
* @element nys-badge
|
|
12
|
+
*
|
|
13
|
+
* @example Basic
|
|
14
|
+
* ```html
|
|
15
|
+
* <nys-badge label="Basic badge"></nys-badge>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example Error Intent
|
|
19
|
+
* ```html
|
|
20
|
+
* <nys-badge label="Error" intent="error" prefixIcon></nys-badge>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Warning Intent
|
|
24
|
+
* ```html
|
|
25
|
+
* <nys-badge label="Warning" intent="warning" prefixIcon></nys-badge>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Success Intent
|
|
29
|
+
* ```html
|
|
30
|
+
* <nys-badge label="Success" intent="success" prefixIcon></nys-badge>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example Strong Neutral
|
|
34
|
+
* ```html
|
|
35
|
+
* <nys-badge variant="strong" label="Neutral" prefixIcon></nys-badge>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example Strong Error
|
|
39
|
+
* ```html
|
|
40
|
+
* <nys-badge variant="strong" label="Error" intent="error" prefixIcon></nys-badge>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example Strong Warning
|
|
44
|
+
* ```html
|
|
45
|
+
* <nys-badge variant="strong" label="Warning" intent="warning" prefixIcon></nys-badge>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Strong Success
|
|
49
|
+
* ```html
|
|
50
|
+
* <nys-badge variant="strong" label="Success" intent="success" prefixIcon></nys-badge>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example Custom Prefix Icon
|
|
54
|
+
* ```html
|
|
55
|
+
* <nys-badge label="Custom prefixIcon" prefixIcon="check"></nys-badge>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example Custom Suffix Icon
|
|
59
|
+
* ```html
|
|
60
|
+
* <nys-badge label="Custom suffixIcon" suffixIcon="check"></nys-badge>
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Size Small
|
|
64
|
+
* ```html
|
|
65
|
+
* <nys-badge label="Small" size="sm"></nys-badge>
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example Screen reader text
|
|
69
|
+
* ```html
|
|
70
|
+
* <nys-badge intent="warning" label="Caution" prefixIcon srText="concern"></nys-badge>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare class NysBadge extends NysElement {
|
|
74
|
+
static styles: import("lit").CSSResult;
|
|
75
|
+
/** Unique identifier. */
|
|
76
|
+
id: string;
|
|
77
|
+
/** Name attribute for form association. */
|
|
78
|
+
name: string;
|
|
79
|
+
/**
|
|
80
|
+
* Badge size: `sm` (smaller text) or `md` (default).
|
|
81
|
+
* @default "md"
|
|
82
|
+
*/
|
|
83
|
+
size: "sm" | "md";
|
|
84
|
+
/**
|
|
85
|
+
* Semantic intent affecting color: `neutral`, `error`, `success`, or `warning`.
|
|
86
|
+
* @default "neutral"
|
|
87
|
+
*/
|
|
88
|
+
intent: "neutral" | "error" | "success" | "warning";
|
|
89
|
+
/** Secondary label displayed before the main label. */
|
|
90
|
+
prefixLabel: string;
|
|
91
|
+
/** Primary label text displayed in the badge. */
|
|
92
|
+
label: string;
|
|
93
|
+
/** Screen reader text appended after the label for additional context. */
|
|
94
|
+
srText: string;
|
|
95
|
+
variant: "strong" | "";
|
|
96
|
+
private _prefixIcon;
|
|
97
|
+
get prefixIcon(): string | boolean;
|
|
98
|
+
set prefixIcon(value: string | boolean);
|
|
99
|
+
private _suffixIcon;
|
|
100
|
+
get suffixIcon(): string | boolean;
|
|
101
|
+
set suffixIcon(value: string | boolean);
|
|
102
|
+
/**
|
|
103
|
+
* Lifecycle methods
|
|
104
|
+
* --------------------------------------------------------------------------
|
|
105
|
+
*/
|
|
106
|
+
connectedCallback(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Functions
|
|
109
|
+
* --------------------------------------------------------------------------
|
|
110
|
+
*/
|
|
111
|
+
private static readonly DEFAULT_ICONS;
|
|
112
|
+
private static readonly INTENT_SR_TEXT;
|
|
113
|
+
/**
|
|
114
|
+
* Resolves the screen-reader-only text describing the badge's semantic intent.
|
|
115
|
+
* Returns null when no intent description should be announced.
|
|
116
|
+
*/
|
|
117
|
+
private resolveIntentSrText;
|
|
118
|
+
/**
|
|
119
|
+
* Resolves which icon should be rendered.
|
|
120
|
+
* @param icon The icon property value (string or boolean)
|
|
121
|
+
* @returns Icon name or null if no icon should be rendered
|
|
122
|
+
*/
|
|
123
|
+
private resolveIcon;
|
|
124
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/nys-badge.js
CHANGED
|
@@ -1,24 +1,46 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as g, unsafeCSS as d, html as f } from "lit";
|
|
2
|
+
import { property as t } from "lit/decorators.js";
|
|
3
|
+
import "@nysds/nys-icon";
|
|
3
4
|
/*!
|
|
4
5
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
5
6
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
7
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
8
|
*
|
|
8
|
-
* Badge Component v1.
|
|
9
|
+
* Badge Component v1.20.0
|
|
9
10
|
* Part of the New York State Design System
|
|
10
11
|
* Repository: https://github.com/its-hcd/nysds
|
|
11
12
|
* License: MIT
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
/*!
|
|
15
|
+
* New York State Design System v1.20.0
|
|
16
|
+
* Description: A design system for New York State's digital products.
|
|
17
|
+
* Repository: https://github.com/its-hcd/nysds
|
|
18
|
+
* License: MIT
|
|
19
|
+
*/
|
|
20
|
+
let b = 0;
|
|
21
|
+
function p(c) {
|
|
22
|
+
return `${c}-${Date.now()}-${b++}`;
|
|
23
|
+
}
|
|
24
|
+
const h = (c) => {
|
|
25
|
+
class e extends c {
|
|
26
|
+
get idPrefix() {
|
|
27
|
+
return this.localName || "nys-element";
|
|
28
|
+
}
|
|
29
|
+
ensureId() {
|
|
30
|
+
this.id || (this.id = p(this.idPrefix));
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback(), this.ensureId();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return e;
|
|
37
|
+
}, u = /* @__PURE__ */ h(g), _ = ':host{--_nys-badge-width: fit-content;--_nys-badge-height: var(--nys-size-600, 48px);--_nys-badge-radius: var(--nys-radius-round, 1776px);--_nys-badge-padding: var(--nys-space-2-px, 2px) var(--nys-space-100, 8px);--_nys-badge-gap: var(--nys-space-50, 4px);--_nys-badge-color: var(--nys-color-ink, #000000);--_nys-badge-background-color: var(--nys-color-base-weak, #f6f6f6);--_nys-badge-border-color: var(--nys-color-base, #62666a);--_nys-badge-border-width: var(--nys-border-width-sm, 1px);--_nys-badge-font-size: var(--nys-font-size-ui-sm, 14px);--_nys-badge-font-weight: var(--nys-font-weight-semibold, 600);--_nys-badge-line-height: var(--nys-font-lineheight-ui-sm, 24px);--_nys-badge-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-badge-prefix-font-weight: var(--nys-font-weight-regular, 400)}:host([size=sm]){--_nys-badge-font-size: var(--nys-font-size-ui-xs, 12px);--_nys-badge-line-height: var(--nys-font-lineheight-ui-xs, 20px)}:host([intent=neutral]){--_nys-badge-background-color: var(--nys-color-base-weak, #f6f6f6);--_nys-badge-border-color: var(--nys-color-base, #62666a)}:host([intent=error]){--_nys-badge-background-color: var(--nys-color-error-weak, #f7eaea);--_nys-badge-border-color: var(--nys-color-error-strong, #721c1c)}:host([intent=success]){--_nys-badge-background-color: var(--nys-color-success-weak, #e8f1ea);--_nys-badge-border-color: var(--nys-color-success-strong, #0f3d18)}:host([intent=warning]){--_nys-badge-background-color: var(--nys-color-warning-weak, #fefae5);--_nys-badge-border-color: var(--nys-color-warning-strong, #6a5700)}:host([variant=strong]){--_nys-badge-background-color: var(--_nys-badge-border-color);--_nys-badge-color: var(--nys-color-white, #ffffff)}:host([variant=strong]) .nys-badge{--nys-icon-color: var(--nys-color-white, #ffffff)}:host([variant=strong][intent=success]){--_nys-badge-border-color: var(--nys-color-success, #1e752e)}:host([variant=strong][intent=warning]){--_nys-badge-border-color: var(--nys-color-warning, #face00);--_nys-badge-color: var(--nys-color-ink, #000000)}:host([variant=strong][intent=warning]) .nys-badge{--nys-icon-color: var(--nys-color-ink, #000000)}.nys-badge{display:flex;width:fit-content;align-items:center;justify-content:center;gap:var(--_nys-badge-gap);padding:var(--_nys-badge-padding);border:var(--_nys-badge-border-width) solid var(--_nys-badge-border-color);background-color:var(--_nys-badge-background-color);color:var(--_nys-badge-color);border-radius:var(--_nys-badge-radius);font-family:var(--_nys-badge-font-family);font-size:var(--_nys-badge-font-size);font-weight:var(--_nys-badge-font-weight);line-height:var(--_nys-badge-line-height);cursor:default;--nys-icon-color: var(--_nys-badge-border-color)}.nys-badge__prefix{font-weight:var(--_nys-badge-prefix-font-weight)}.nys-badge__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}';
|
|
38
|
+
var x = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (c, e, r, i) => {
|
|
39
|
+
for (var a = i > 1 ? void 0 : i ? v(e, r) : e, l = c.length - 1, y; l >= 0; l--)
|
|
40
|
+
(y = c[l]) && (a = (i ? y(e, r, a) : y(a)) || a);
|
|
41
|
+
return i && a && x(e, r, a), a;
|
|
42
|
+
}, s;
|
|
43
|
+
const n = (s = class extends u {
|
|
22
44
|
constructor() {
|
|
23
45
|
super(...arguments), this.id = "", this.name = "", this.size = "md", this.intent = "neutral", this.prefixLabel = "", this.label = "", this.srText = "", this.variant = "", this._prefixIcon = "", this._suffixIcon = "";
|
|
24
46
|
}
|
|
@@ -39,11 +61,18 @@ const n = (o = class extends l {
|
|
|
39
61
|
* --------------------------------------------------------------------------
|
|
40
62
|
*/
|
|
41
63
|
connectedCallback() {
|
|
42
|
-
super.connectedCallback()
|
|
64
|
+
super.connectedCallback();
|
|
43
65
|
const e = this.getAttribute("prefixicon");
|
|
44
66
|
e !== null && this.prefixIcon === "" && (this.prefixIcon = e);
|
|
45
|
-
const
|
|
46
|
-
|
|
67
|
+
const r = this.getAttribute("suffixicon");
|
|
68
|
+
r !== null && this.suffixIcon === "" && (this.suffixIcon = r);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Resolves the screen-reader-only text describing the badge's semantic intent.
|
|
72
|
+
* Returns null when no intent description should be announced.
|
|
73
|
+
*/
|
|
74
|
+
resolveIntentSrText() {
|
|
75
|
+
return this.srText ? null : s.INTENT_SR_TEXT[this.intent] ?? null;
|
|
47
76
|
}
|
|
48
77
|
/**
|
|
49
78
|
* Resolves which icon should be rendered.
|
|
@@ -51,64 +80,71 @@ const n = (o = class extends l {
|
|
|
51
80
|
* @returns Icon name or null if no icon should be rendered
|
|
52
81
|
*/
|
|
53
82
|
resolveIcon(e) {
|
|
54
|
-
return e === !0 ?
|
|
83
|
+
return e === !0 ? s.DEFAULT_ICONS[this.intent] ?? "info" : typeof e == "string" && e.trim() !== "" ? e : null;
|
|
55
84
|
}
|
|
56
85
|
render() {
|
|
57
|
-
const e = this.resolveIcon(this.prefixIcon),
|
|
58
|
-
return
|
|
86
|
+
const e = this.resolveIcon(this.prefixIcon), r = this.resolveIcon(this.suffixIcon), i = this.resolveIntentSrText();
|
|
87
|
+
return f`
|
|
59
88
|
<mark class="nys-badge">
|
|
60
|
-
${e ?
|
|
61
|
-
${this.prefixLabel ?
|
|
89
|
+
${e ? f`<nys-icon size="16" name=${e}></nys-icon>` : ""}
|
|
90
|
+
${this.prefixLabel ? f`<div class="nys-badge__prefix">${this.prefixLabel}</div>` : ""}
|
|
62
91
|
<div class="nys-badge__label">
|
|
92
|
+
${i ? f`<span class="nys-badge__sr-only"
|
|
93
|
+
>${i + ": "}</span
|
|
94
|
+
>` : ""}
|
|
63
95
|
${this.label}
|
|
64
|
-
${this.srText ?
|
|
96
|
+
${this.srText ? f`<span class="nys-badge__sr-only"
|
|
65
97
|
>${": " + this.srText}</span
|
|
66
98
|
>` : ""}
|
|
67
99
|
</div>
|
|
68
100
|
|
|
69
|
-
${
|
|
101
|
+
${r ? f`<nys-icon size="16" name=${r}></nys-icon>` : ""}
|
|
70
102
|
</mark>
|
|
71
103
|
`;
|
|
72
104
|
}
|
|
73
|
-
},
|
|
105
|
+
}, s.styles = d(_), s.DEFAULT_ICONS = {
|
|
74
106
|
neutral: "info",
|
|
75
107
|
error: "emergency_home",
|
|
76
108
|
success: "check_circle",
|
|
77
109
|
warning: "warning"
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
110
|
+
}, s.INTENT_SR_TEXT = {
|
|
111
|
+
error: "Error",
|
|
112
|
+
success: "Success",
|
|
113
|
+
warning: "Warning"
|
|
114
|
+
}, s);
|
|
115
|
+
o([
|
|
116
|
+
t({ type: String, reflect: !0 })
|
|
81
117
|
], n.prototype, "id", 2);
|
|
82
|
-
|
|
83
|
-
|
|
118
|
+
o([
|
|
119
|
+
t({ type: String, reflect: !0 })
|
|
84
120
|
], n.prototype, "name", 2);
|
|
85
|
-
|
|
86
|
-
|
|
121
|
+
o([
|
|
122
|
+
t({ type: String, reflect: !0 })
|
|
87
123
|
], n.prototype, "size", 2);
|
|
88
|
-
|
|
89
|
-
|
|
124
|
+
o([
|
|
125
|
+
t({ type: String, reflect: !0 })
|
|
90
126
|
], n.prototype, "intent", 2);
|
|
91
|
-
|
|
92
|
-
|
|
127
|
+
o([
|
|
128
|
+
t({ type: String })
|
|
93
129
|
], n.prototype, "prefixLabel", 2);
|
|
94
|
-
|
|
95
|
-
|
|
130
|
+
o([
|
|
131
|
+
t({ type: String })
|
|
96
132
|
], n.prototype, "label", 2);
|
|
97
|
-
|
|
98
|
-
|
|
133
|
+
o([
|
|
134
|
+
t({ type: String })
|
|
99
135
|
], n.prototype, "srText", 2);
|
|
100
|
-
|
|
101
|
-
|
|
136
|
+
o([
|
|
137
|
+
t({ type: String, reflect: !0 })
|
|
102
138
|
], n.prototype, "variant", 2);
|
|
103
|
-
|
|
104
|
-
|
|
139
|
+
o([
|
|
140
|
+
t({ type: String, attribute: "prefixicon" })
|
|
105
141
|
], n.prototype, "prefixIcon", 1);
|
|
106
|
-
|
|
107
|
-
|
|
142
|
+
o([
|
|
143
|
+
t({ type: String, attribute: "suffixicon" })
|
|
108
144
|
], n.prototype, "suffixIcon", 1);
|
|
109
|
-
let
|
|
110
|
-
customElements.get("nys-badge") || customElements.define("nys-badge",
|
|
145
|
+
let m = n;
|
|
146
|
+
customElements.get("nys-badge") || customElements.define("nys-badge", m);
|
|
111
147
|
export {
|
|
112
|
-
|
|
148
|
+
m as NysBadge
|
|
113
149
|
};
|
|
114
150
|
//# sourceMappingURL=nys-badge.js.map
|
package/dist/nys-badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nys-badge.js","sources":["../src/nys-badge.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-badge.scss?inline\";\n\nlet badgeIdCounter = 0;\n\n/**\n * A compact label for status, counts, or categorization. Supports semantic intents with auto-selected icons.\n *\n * Use badges to highlight metadata like status (\"Approved\"), counts (\"3 new\"), or categories.\n * Set `intent` to apply semantic meaning. Add `prefixIcon` or `suffixIcon` as boolean for default icons,\n * or pass icon name strings for custom icons.\n *\n * @summary Compact label for status, counts, or categorization with semantic styling.\n * @element nys-badge\n *\n * @example Basic\n * ```html\n * <nys-badge label=\"Basic badge\"></nys-badge>\n * ```\n *\n * @example Error Intent\n * ```html\n * <nys-badge label=\"Error\" intent=\"error\" prefixIcon></nys-badge>\n * ```\n *\n * @example Warning Intent\n * ```html\n * <nys-badge label=\"Warning\" intent=\"warning\" prefixIcon></nys-badge>\n * ```\n *\n * @example Success Intent\n * ```html\n * <nys-badge label=\"Success\" intent=\"success\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Neutral\n * ```html\n * <nys-badge variant=\"strong\" label=\"Neutral\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Error\n * ```html\n * <nys-badge variant=\"strong\" label=\"Error\" intent=\"error\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Warning\n * ```html\n * <nys-badge variant=\"strong\" label=\"Warning\" intent=\"warning\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Success\n * ```html\n * <nys-badge variant=\"strong\" label=\"Success\" intent=\"success\" prefixIcon></nys-badge>\n * ```\n *\n * @example Custom Prefix Icon\n * ```html\n * <nys-badge label=\"Custom prefixIcon\" prefixIcon=\"check\"></nys-badge>\n * ```\n *\n * @example Custom Suffix Icon\n * ```html\n * <nys-badge label=\"Custom suffixIcon\" suffixIcon=\"check\"></nys-badge>\n * ```\n *\n * @example Size Small\n * ```html\n * <nys-badge label=\"Small\" size=\"sm\"></nys-badge>\n * ```\n *\n * @example Screen reader text\n * ```html\n * <nys-badge intent=\"warning\" label=\"Caution\" prefixIcon srText=\"concern\"></nys-badge>\n * ```\n */\n\nexport class NysBadge extends LitElement {\n static styles = unsafeCSS(styles);\n\n /** Unique identifier. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name attribute for form association. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /**\n * Badge size: `sm` (smaller text) or `md` (default).\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n /**\n * Semantic intent affecting color: `neutral`, `error`, `success`, or `warning`.\n * @default \"neutral\"\n */\n @property({ type: String, reflect: true }) intent:\n | \"neutral\"\n | \"error\"\n | \"success\"\n | \"warning\" = \"neutral\";\n\n /** Secondary label displayed before the main label. */\n @property({ type: String }) prefixLabel = \"\";\n\n /** Primary label text displayed in the badge. */\n @property({ type: String }) label = \"\";\n\n /** Screen reader text appended after the label for additional context. */\n @property({ type: String }) srText = \"\";\n\n @property({ type: String, reflect: true }) variant: \"strong\" | \"\" = \"\";\n\n // Icons (string or boolean)\n private _prefixIcon: string | boolean = \"\";\n @property({ type: String, attribute: \"prefixicon\" })\n get prefixIcon(): string | boolean {\n return this._prefixIcon;\n }\n set prefixIcon(value: string | boolean) {\n if (value === \"\" || value === null) {\n // boolean attribute without value → true\n this._prefixIcon = true;\n } else if (value === \"false\" || value === false) {\n this._prefixIcon = \"\";\n } else {\n this._prefixIcon = value;\n }\n }\n\n private _suffixIcon: string | boolean = \"\";\n @property({ type: String, attribute: \"suffixicon\" })\n get suffixIcon(): string | boolean {\n return this._suffixIcon;\n }\n set suffixIcon(value: string | boolean) {\n if (value === \"\" || value === null) {\n this._suffixIcon = true;\n } else if (value === \"false\" || value === false) {\n this._suffixIcon = \"\";\n } else {\n this._suffixIcon = value;\n }\n }\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.id) {\n this.id = `nys-badge-${Date.now()}-${badgeIdCounter++}`;\n }\n\n const attr = this.getAttribute(\"prefixicon\");\n if (attr !== null && this.prefixIcon === \"\") {\n this.prefixIcon = attr;\n }\n\n const suffixAttr = this.getAttribute(\"suffixicon\");\n if (suffixAttr !== null && this.suffixIcon === \"\") {\n this.suffixIcon = suffixAttr;\n }\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n // Map of default icons by intent\n private static readonly DEFAULT_ICONS: Record<string, string> = {\n neutral: \"info\",\n error: \"emergency_home\",\n success: \"check_circle\",\n warning: \"warning\",\n };\n\n /**\n * Resolves which icon should be rendered.\n * @param icon The icon property value (string or boolean)\n * @returns Icon name or null if no icon should be rendered\n */\n private resolveIcon(icon: string | boolean): string | null {\n if (icon === true) {\n return NysBadge.DEFAULT_ICONS[this.intent] ?? \"info\";\n }\n if (typeof icon === \"string\" && icon.trim() !== \"\") {\n return icon;\n }\n return null;\n }\n\n render() {\n const prefixIconName = this.resolveIcon(this.prefixIcon);\n const suffixIconName = this.resolveIcon(this.suffixIcon);\n\n return html`\n <mark class=\"nys-badge\">\n ${prefixIconName\n ? html`<nys-icon size=\"16\" name=${prefixIconName}></nys-icon>`\n : \"\"}\n ${this.prefixLabel\n ? html`<div class=\"nys-badge__prefix\">${this.prefixLabel}</div>`\n : \"\"}\n <div class=\"nys-badge__label\">\n ${this.label}\n ${this.srText\n ? html`<span class=\"nys-badge__sr-only\"\n >${\": \" + this.srText}</span\n >`\n : \"\"}\n </div>\n\n ${suffixIconName\n ? html`<nys-icon size=\"16\" name=${suffixIconName}></nys-icon>`\n : \"\"}\n </mark>\n `;\n }\n}\n\nif (!customElements.get(\"nys-badge\")) {\n customElements.define(\"nys-badge\", NysBadge);\n}\n"],"names":["badgeIdCounter","_NysBadge","_a","LitElement","value","attr","suffixAttr","icon","prefixIconName","suffixIconName","html","unsafeCSS","styles","__decorateClass","property","NysBadge"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,IAAIA,IAAiB;;AAyEd,MAAMC,KAANC,IAAA,cAAuBC,EAAW;AAAA,EAAlC,cAAA;AAAA,UAAA,GAAA,SAAA,GAIsC,KAAA,KAAK,IAGL,KAAA,OAAO,IAMP,KAAA,OAAoB,MAMpB,KAAA,SAI3B,WAGY,KAAA,cAAc,IAGd,KAAA,QAAQ,IAGR,KAAA,SAAS,IAEM,KAAA,UAAyB,IAGpE,KAAQ,cAAgC,IAgBxC,KAAQ,cAAgC;AAAA,EAAA;AAAA,EAdxC,IAAI,aAA+B;AACjC,WAAO,KAAK;AAAA,EACd;AAAA,EACA,IAAI,WAAWC,GAAyB;AACtC,IAAIA,MAAU,MAAMA,MAAU,OAE5B,KAAK,cAAc,KACVA,MAAU,WAAWA,MAAU,KACxC,KAAK,cAAc,KAEnB,KAAK,cAAcA;AAAA,EAEvB;AAAA,EAIA,IAAI,aAA+B;AACjC,WAAO,KAAK;AAAA,EACd;AAAA,EACA,IAAI,WAAWA,GAAyB;AACtC,IAAIA,MAAU,MAAMA,MAAU,OAC5B,KAAK,cAAc,KACVA,MAAU,WAAWA,MAAU,KACxC,KAAK,cAAc,KAEnB,KAAK,cAAcA;AAAA,EAEvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,oBAAoB;AAClB,UAAM,kBAAA,GAED,KAAK,OACR,KAAK,KAAK,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AS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAb9Bb,EAagC,WAAA,QAAA,CAAA;AAMAY,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAnB9Bb,EAmBgC,WAAA,UAAA,CAAA;AAOfY,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA1Bfb,EA0BiB,WAAA,eAAA,CAAA;AAGAY,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA7Bfb,EA6BiB,WAAA,SAAA,CAAA;AAGAY,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAhCfb,EAgCiB,WAAA,UAAA,CAAA;AAEeY,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAlC9Bb,EAkCgC,WAAA,WAAA,CAAA;AAKvCY,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAtCxCb,EAuCP,WAAA,cAAA,CAAA;AAgBAY,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAtDxCb,EAuDP,WAAA,cAAA,CAAA;AAvDC,IAAMc,IAANd;AAoJF,eAAe,IAAI,WAAW,KACjC,eAAe,OAAO,aAAac,CAAQ;"}
|
|
1
|
+
{"version":3,"file":"nys-badge.js","sources":["../../internals/dist/index.js","../src/nys-badge.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.20.0\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nlet y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, A = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction R(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction _(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction E(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction V(e, t, n) {\n const i = d(n), r = _(t);\n i.length ? e.setAttribute(r, E(i).join(\" \")) : e.removeAttribute(r);\n}\nfunction x(e, t, n, i, r) {\n const s = d(i), a = p[n], l = t;\n if (a && R(t)) {\n l[a] = s.length ? s : null;\n return;\n }\n const o = A[n];\n if (!o) return;\n const c = r ?? (s.length ? s.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst g = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, n) {\n const i = d(n), r = g[t], s = C[t], a = e;\n if (r && r in e && (a[r] = i.length ? i : null), !s) return;\n const l = i.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(s, l) : e.removeAttribute(s);\n}\nconst b = (e) => {\n class t extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return t;\n}, P = /* @__PURE__ */ b(u), h = (e) => {\n class t extends b(e) {\n constructor() {\n super(...arguments), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\")\n try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(i, r) {\n const s = this.internals;\n if (s && i in s) {\n s[i] = r;\n return;\n }\n const a = v(i);\n r === null ? this.removeAttribute(a) : this.setAttribute(a, r);\n }\n reflectDefaultSemantics() {\n const i = this.defaultRole;\n i && this.setHostAria(\"role\", i);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return t;\n};\nfunction v(e) {\n if (e === \"role\") return \"role\";\n const t = e.replace(/^aria/, \"\");\n return \"aria-\" + t.charAt(0).toLowerCase() + t.slice(1);\n}\nconst T = /* @__PURE__ */ h(u), I = (e) => {\n const n = class n extends h(e) {\n setFormValue(r) {\n this.internals?.setFormValue(r ?? null);\n }\n setValidityFromState(r, s, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(r).some(Boolean);\n o ? l.setValidity(r, s ?? \"Invalid value\", a) : l.setValidity({}), this.setHostAria(\"ariaInvalid\", o ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.clearValidity();\n }\n };\n n.formAssociated = !0;\n let t = n;\n return t;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const t = e.tagName.toLowerCase(), n = /* @__PURE__ */ new Set(), i = (r) => {\n r.querySelectorAll(\"*\").forEach((s) => {\n const a = s.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && n.add(a), s.shadowRoot && i(s.shadowRoot);\n });\n };\n return e.shadowRoot && i(e.shadowRoot), i(e), [...n].sort();\n}\nexport {\n I as FormControlMixin,\n b as IdentifiedMixin,\n P as NysElement,\n w as NysFormControlElement,\n T as NysReflectsAriaElement,\n h as ReflectsAriaMixin,\n V as associateControl,\n L as associateControlRefs,\n x as associateHost,\n O as findUnregisteredChildren,\n f as generateId,\n R as supportsElementRefs\n};\n//# sourceMappingURL=index.js.map\n","import { html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { NysElement } from \"@nysds/internals\";\n// This element is rendered inside this component's shadow DOM (prefix/suffix\n// icons), so it must be registered whenever nys-badge is used. Importing it\n// here (intentional side effect) guarantees it always renders.\nimport \"@nysds/nys-icon\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-badge.scss?inline\";\n\n/**\n * A compact label for status, counts, or categorization. Supports semantic intents with auto-selected icons.\n *\n * Use badges to highlight metadata like status (\"Approved\"), counts (\"3 new\"), or categories.\n * Set `intent` to apply semantic meaning. Add `prefixIcon` or `suffixIcon` as boolean for default icons,\n * or pass icon name strings for custom icons.\n *\n * @summary Compact label for status, counts, or categorization with semantic styling.\n * @element nys-badge\n *\n * @example Basic\n * ```html\n * <nys-badge label=\"Basic badge\"></nys-badge>\n * ```\n *\n * @example Error Intent\n * ```html\n * <nys-badge label=\"Error\" intent=\"error\" prefixIcon></nys-badge>\n * ```\n *\n * @example Warning Intent\n * ```html\n * <nys-badge label=\"Warning\" intent=\"warning\" prefixIcon></nys-badge>\n * ```\n *\n * @example Success Intent\n * ```html\n * <nys-badge label=\"Success\" intent=\"success\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Neutral\n * ```html\n * <nys-badge variant=\"strong\" label=\"Neutral\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Error\n * ```html\n * <nys-badge variant=\"strong\" label=\"Error\" intent=\"error\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Warning\n * ```html\n * <nys-badge variant=\"strong\" label=\"Warning\" intent=\"warning\" prefixIcon></nys-badge>\n * ```\n *\n * @example Strong Success\n * ```html\n * <nys-badge variant=\"strong\" label=\"Success\" intent=\"success\" prefixIcon></nys-badge>\n * ```\n *\n * @example Custom Prefix Icon\n * ```html\n * <nys-badge label=\"Custom prefixIcon\" prefixIcon=\"check\"></nys-badge>\n * ```\n *\n * @example Custom Suffix Icon\n * ```html\n * <nys-badge label=\"Custom suffixIcon\" suffixIcon=\"check\"></nys-badge>\n * ```\n *\n * @example Size Small\n * ```html\n * <nys-badge label=\"Small\" size=\"sm\"></nys-badge>\n * ```\n *\n * @example Screen reader text\n * ```html\n * <nys-badge intent=\"warning\" label=\"Caution\" prefixIcon srText=\"concern\"></nys-badge>\n * ```\n */\n\nexport class NysBadge extends NysElement {\n static styles = unsafeCSS(styles);\n\n /** Unique identifier. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name attribute for form association. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /**\n * Badge size: `sm` (smaller text) or `md` (default).\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n /**\n * Semantic intent affecting color: `neutral`, `error`, `success`, or `warning`.\n * @default \"neutral\"\n */\n @property({ type: String, reflect: true }) intent:\n | \"neutral\"\n | \"error\"\n | \"success\"\n | \"warning\" = \"neutral\";\n\n /** Secondary label displayed before the main label. */\n @property({ type: String }) prefixLabel = \"\";\n\n /** Primary label text displayed in the badge. */\n @property({ type: String }) label = \"\";\n\n /** Screen reader text appended after the label for additional context. */\n @property({ type: String }) srText = \"\";\n\n @property({ type: String, reflect: true }) variant: \"strong\" | \"\" = \"\";\n\n // Icons (string or boolean)\n private _prefixIcon: string | boolean = \"\";\n @property({ type: String, attribute: \"prefixicon\" })\n get prefixIcon(): string | boolean {\n return this._prefixIcon;\n }\n set prefixIcon(value: string | boolean) {\n if (value === \"\" || value === null) {\n // boolean attribute without value → true\n this._prefixIcon = true;\n } else if (value === \"false\" || value === false) {\n this._prefixIcon = \"\";\n } else {\n this._prefixIcon = value;\n }\n }\n\n private _suffixIcon: string | boolean = \"\";\n @property({ type: String, attribute: \"suffixicon\" })\n get suffixIcon(): string | boolean {\n return this._suffixIcon;\n }\n set suffixIcon(value: string | boolean) {\n if (value === \"\" || value === null) {\n this._suffixIcon = true;\n } else if (value === \"false\" || value === false) {\n this._suffixIcon = \"\";\n } else {\n this._suffixIcon = value;\n }\n }\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n\n connectedCallback() {\n // super.connectedCallback() (NysElement) auto-assigns an id when\n // one is not provided, preserving the \"nys-badge-<ts>-<n>\" shape. A badge is\n // static, non-interactive label content, so no host role is reflected\n // (defaultRole stays null).\n super.connectedCallback();\n\n const attr = this.getAttribute(\"prefixicon\");\n if (attr !== null && this.prefixIcon === \"\") {\n this.prefixIcon = attr;\n }\n\n const suffixAttr = this.getAttribute(\"suffixicon\");\n if (suffixAttr !== null && this.suffixIcon === \"\") {\n this.suffixIcon = suffixAttr;\n }\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n // Map of default icons by intent\n private static readonly DEFAULT_ICONS: Record<string, string> = {\n neutral: \"info\",\n error: \"emergency_home\",\n success: \"check_circle\",\n warning: \"warning\",\n };\n\n // WCAG 1.4.1 (Use of Color): intent is otherwise conveyed only by color and a\n // decorative (aria-hidden) icon. Provide a screen-reader-only text alternative\n // so the semantic meaning is not color-only. Skipped for \"neutral\" (no\n // semantic meaning) and when the author supplies their own srText override.\n private static readonly INTENT_SR_TEXT: Record<string, string> = {\n error: \"Error\",\n success: \"Success\",\n warning: \"Warning\",\n };\n\n /**\n * Resolves the screen-reader-only text describing the badge's semantic intent.\n * Returns null when no intent description should be announced.\n */\n private resolveIntentSrText(): string | null {\n if (this.srText) return null; // author-provided text takes precedence\n return NysBadge.INTENT_SR_TEXT[this.intent] ?? null;\n }\n\n /**\n * Resolves which icon should be rendered.\n * @param icon The icon property value (string or boolean)\n * @returns Icon name or null if no icon should be rendered\n */\n private resolveIcon(icon: string | boolean): string | null {\n if (icon === true) {\n return NysBadge.DEFAULT_ICONS[this.intent] ?? \"info\";\n }\n if (typeof icon === \"string\" && icon.trim() !== \"\") {\n return icon;\n }\n return null;\n }\n\n render() {\n const prefixIconName = this.resolveIcon(this.prefixIcon);\n const suffixIconName = this.resolveIcon(this.suffixIcon);\n const intentSrText = this.resolveIntentSrText();\n\n return html`\n <mark class=\"nys-badge\">\n ${prefixIconName\n ? html`<nys-icon size=\"16\" name=${prefixIconName}></nys-icon>`\n : \"\"}\n ${this.prefixLabel\n ? html`<div class=\"nys-badge__prefix\">${this.prefixLabel}</div>`\n : \"\"}\n <div class=\"nys-badge__label\">\n ${intentSrText\n ? html`<span class=\"nys-badge__sr-only\"\n >${intentSrText + \": \"}</span\n >`\n : \"\"}\n ${this.label}\n ${this.srText\n ? html`<span class=\"nys-badge__sr-only\"\n >${\": \" + this.srText}</span\n >`\n : \"\"}\n </div>\n\n ${suffixIconName\n ? html`<nys-icon size=\"16\" name=${suffixIconName}></nys-icon>`\n : \"\"}\n </mark>\n `;\n }\n}\n\nif (!customElements.get(\"nys-badge\")) {\n customElements.define(\"nys-badge\", NysBadge);\n}\n"],"names":["LitElement","unsafeCSS","html","property","y","f","e","b","t","P","u","_NysBadge","_a","NysElement","value","attr","suffixAttr","icon","prefixIconName","suffixIconName","intentSrText","styles","__decorateClass","NysBadge"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AAqDK,MAACG,IAAI,CAACD,MAAM;AAAA,EACf,MAAME,UAAUF,EAAE;AAAA,IAChB,IAAI,WAAW;AACb,aAAO,KAAK,aAAa;AAAA,IAC3B;AAAA,IACA,WAAW;AACT,WAAK,OAAO,KAAK,KAAKD,EAAE,KAAK,QAAQ;AAAA,IACvC;AAAA,IACA,oBAAoB;AAClB,YAAM,kBAAiB,GAAI,KAAK,SAAQ;AAAA,IAC1C;AAAA,EACJ;AACE,SAAOG;AACT,GAAGC,IAAoB,gBAAAF,EAAEG,CAAC;;;;;;ACKnB,MA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A,CAAA;AAOfW,EAAA;AAAA,EAA3BnB,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA1BfQ,EA0BiB,WAAA,eAAA,CAAA;AAGAW,EAAA;AAAA,EAA3BnB,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA7BfQ,EA6BiB,WAAA,SAAA,CAAA;AAGAW,EAAA;AAAA,EAA3BnB,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAhCfQ,EAgCiB,WAAA,UAAA,CAAA;AAEeW,EAAA;AAAA,EAA1CnB,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAlC9BQ,EAkCgC,WAAA,WAAA,CAAA;AAKvCW,EAAA;AAAA,EADHnB,EAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAtCxCQ,EAuCP,WAAA,cAAA,CAAA;AAgBAW,EAAA;AAAA,EADHnB,EAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAtDxCQ,EAuDP,WAAA,cAAA,CAAA;AAvDC,IAAMY,IAANZ;AA6KF,eAAe,IAAI,WAAW,KACjC,eAAe,OAAO,aAAaY,CAAQ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/nys-badge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "The Badge component from the NYS Design System.",
|
|
5
5
|
"module": "dist/nys-badge.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
"lit-analyze": "lit-analyzer '**/*.ts'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@nysds/nys-icon": "^1.
|
|
26
|
+
"@nysds/nys-icon": "^1.20.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@nysds/internals": "^1.20.0",
|
|
29
30
|
"lit": "^3.3.1",
|
|
30
31
|
"typescript": "^5.9.3",
|
|
31
32
|
"vite": "^7.3.1"
|