@nysds/nys-label 1.19.2 → 1.19.3
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/nys-label.js +1 -1
- package/dist/nys-label.js.map +1 -1
- package/package.json +7 -4
package/dist/nys-label.js
CHANGED
|
@@ -5,7 +5,7 @@ import { property as l } from "lit/decorators.js";
|
|
|
5
5
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
6
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
7
|
*
|
|
8
|
-
* Label Component v1.19.
|
|
8
|
+
* Label Component v1.19.3
|
|
9
9
|
* Part of the New York State Design System
|
|
10
10
|
* Repository: https://github.com/its-hcd/nysds
|
|
11
11
|
* License: MIT
|
package/dist/nys-label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nys-label.js","sources":["../src/nys-label.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-label.scss?inline\";\n\nlet labelIdCounter = 0;\n\n/**\n * **Internal component.** Renders form labels with description, required/optional flag, and tooltip.\n *\n * Used internally by form components (textinput, select, checkbox, etc.). Not intended for direct use.\n * Handles label association via `for`, displays asterisk for required fields, and integrates tooltips.\n *\n * @
|
|
1
|
+
{"version":3,"file":"nys-label.js","sources":["../src/nys-label.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-label.scss?inline\";\n\nlet labelIdCounter = 0;\n\n/**\n * **Internal component.** Renders form labels with description, required/optional flag, and tooltip.\n *\n * Used internally by form components (textinput, select, checkbox, etc.). Not intended for direct use.\n * Handles label association via `for`, displays asterisk for required fields, and integrates tooltips.\n *\n * @example Basic\n * ```html\n * <nys-label label=\"This is a basic nys-label\"></nys-label>\n * ```\n *\n * @example Required\n * ```html\n * <nys-label label=\"This form is required\" flag=\"required\"></nys-label>\n * ```\n *\n * @example Optional\n * ```html\n * <nys-label label=\"This form is required\" flag=\"optional\"></nys-label>\n * ```\n *\n * @example Description\n * ```html\n * <nys-label label=\"Label Text\" description=\"Description text\"></nys-label>\n * ```\n *\n * @example Description Slot\n * ```html\n * <nys-label label=\"Label Text\">\n * <p slot=\"description\">Rich text description passed in <strong>HERE</strong></p>\n * </nys-label>\n * ```\n *\n * @example With Tooltip\n * ```html\n * <nys-label id=\"label-id\" label=\"This label has a tooltip\"></nys-label>\n * <nys-tooltip for=\"label-id\" text=\"Tooltip text in here\"></nys-tooltip>\n * ```\n *\n * @slot description - Custom HTML description content below the label.\n */\nexport class NysLabel extends LitElement {\n static styles = unsafeCSS(styles);\n\n /** The ID of the label. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Label text displayed above the form field. */\n @property({ type: String }) label = \"\";\n\n /** Helper text displayed below the label. */\n @property({ type: String }) description = \"\";\n\n /** Flag type: `required` shows asterisk, `optional` shows \"(Optional)\". */\n @property({ type: String }) flag = \"\";\n\n /** Adjusts colors for dark backgrounds. */\n @property({ type: Boolean, reflect: true }) inverted = false;\n /** Tooltip text shown on hover/focus of info icon next to label. */\n @property({ type: String }) tooltip = \"\";\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-label-${Date.now()}-${labelIdCounter++}`;\n }\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n /**\n * While most components don't need to listen for this event.\n * Special components like \"nys-fileinput\" and \"nys-toggle\" need to listen for label to execute their specific functionalities.\n */\n private _dispatchLabelClick() {\n this.dispatchEvent(\n new CustomEvent(\"nys-label-click\", { bubbles: true, composed: true }),\n );\n }\n\n render() {\n return html`\n <div class=\"nys-label ${this.inverted ? \"invert\" : \"\"}\">\n <div class=\"nys-label__tooltip-wrapper\">\n <label class=\"nys-label__label\" @click=${this._dispatchLabelClick}\n >${this.label}\n ${this.flag === \"required\"\n ? html`<div class=\"nys-label__required\" aria-hidden=\"true\">\n *\n </div>`\n : \"\"}\n ${this.flag === \"optional\"\n ? html`<div class=\"nys-label__optional\">(Optional)</div>`\n : \"\"}</label\n >\n ${this.tooltip\n ? html`<nys-tooltip\n text=\"${this.tooltip}\"\n position=\"top\"\n focusable\n ?inverted=${this.inverted}\n for=\"tooltip-icon-${this.id}\"\n >\n </nys-tooltip>\n <nys-icon\n id=\"tooltip-icon-${this.id}\"\n name=\"info\"\n size=\"3xl\"\n ></nys-icon> `\n : \"\"}\n </div>\n <p class=\"nys-label__description\" @click=${this._dispatchLabelClick}>\n <slot name=\"description\">${this.description}</slot>\n </p>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-label\")) {\n customElements.define(\"nys-label\", NysLabel);\n}\n"],"names":["labelIdCounter","_NysLabel","LitElement","html","unsafeCSS","styles","NysLabel","__decorateClass","property"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,IAAIA,IAAiB;AA2Cd,MAAMC,IAAN,MAAMA,UAAiBC,EAAW;AAAA,EAAlC,cAAA;AAAA,UAAA,GAAA,SAAA,GAIsC,KAAA,KAAK,IAGpB,KAAA,QAAQ,IAGR,KAAA,cAAc,IAGd,KAAA,OAAO,IAGS,KAAA,WAAW,IAE3B,KAAA,UAAU;AAAA,EAAA;AAAA,EAEtC,oBAAoB;AAClB,UAAM,kBAAA,GACD,KAAK,OACR,KAAK,KAAK,aAAa,KAAK,KAAK,IAAIF,GAAgB;AAAA,EAEzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWQ,sBAAsB;AAC5B,SAAK;AAAA,MACH,IAAI,YAAY,mBAAmB,EAAE,SAAS,IAAM,UAAU,IAAM;AAAA,IAAA;AAAA,EAExE;AAAA,EAEA,SAAS;AACP,WAAOG;AAAA,8BACmB,KAAK,WAAW,WAAW,EAAE;AAAA;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|
|
3
|
+
"version": "1.19.3",
|
|
4
4
|
"description": "The Label component from the NYS Design System.",
|
|
5
5
|
"module": "dist/nys-label.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"lit-analyze": "lit-analyzer '**/*.ts'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@nysds/nys-icon": "^1.19.
|
|
27
|
-
"@nysds/nys-tooltip": "^1.19.
|
|
26
|
+
"@nysds/nys-icon": "^1.19.3",
|
|
27
|
+
"@nysds/nys-tooltip": "^1.19.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"lit": "^3.3.1",
|
|
@@ -41,5 +41,8 @@
|
|
|
41
41
|
],
|
|
42
42
|
"author": "New York State Design System Team",
|
|
43
43
|
"license": "MIT",
|
|
44
|
-
"sideEffects": true
|
|
44
|
+
"sideEffects": true,
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"lit": "^3.3.1"
|
|
47
|
+
}
|
|
45
48
|
}
|