@phcdevworks/spectre-components 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +586 -107
  2. package/dist/base-B_9DJkh2.d.cts +38 -0
  3. package/dist/base-B_9DJkh2.d.ts +38 -0
  4. package/dist/button.cjs +252 -90
  5. package/dist/button.cjs.map +1 -1
  6. package/dist/button.d.cts +39 -37
  7. package/dist/button.d.ts +39 -37
  8. package/dist/button.js +252 -90
  9. package/dist/button.js.map +1 -1
  10. package/dist/checkbox.cjs +228 -67
  11. package/dist/checkbox.cjs.map +1 -1
  12. package/dist/checkbox.d.cts +21 -21
  13. package/dist/checkbox.d.ts +21 -21
  14. package/dist/checkbox.js +228 -67
  15. package/dist/checkbox.js.map +1 -1
  16. package/dist/fieldset.cjs +245 -56
  17. package/dist/fieldset.cjs.map +1 -1
  18. package/dist/fieldset.d.cts +35 -14
  19. package/dist/fieldset.d.ts +35 -14
  20. package/dist/fieldset.js +245 -56
  21. package/dist/fieldset.js.map +1 -1
  22. package/dist/form-9cZG1E9P.d.cts +10 -0
  23. package/dist/form-9cZG1E9P.d.ts +10 -0
  24. package/dist/index.cjs +647 -328
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +4 -4
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.js +647 -328
  29. package/dist/index.js.map +1 -1
  30. package/dist/input.cjs +262 -77
  31. package/dist/input.cjs.map +1 -1
  32. package/dist/input.d.cts +72 -40
  33. package/dist/input.d.ts +72 -40
  34. package/dist/input.js +262 -77
  35. package/dist/input.js.map +1 -1
  36. package/dist/label.cjs +217 -55
  37. package/dist/label.cjs.map +1 -1
  38. package/dist/label.d.cts +17 -10
  39. package/dist/label.d.ts +17 -10
  40. package/dist/label.js +217 -55
  41. package/dist/label.js.map +1 -1
  42. package/dist/{projectable-DcnBRiko.d.cts → projectable-CIfxi7dv.d.cts} +1 -1
  43. package/dist/{projectable-SzbPvXfM.d.ts → projectable-Ksv9eoIr.d.ts} +1 -1
  44. package/dist/radio.cjs +248 -67
  45. package/dist/radio.cjs.map +1 -1
  46. package/dist/radio.d.cts +23 -21
  47. package/dist/radio.d.ts +23 -21
  48. package/dist/radio.js +248 -67
  49. package/dist/radio.js.map +1 -1
  50. package/dist/select.cjs +230 -67
  51. package/dist/select.cjs.map +1 -1
  52. package/dist/select.d.cts +27 -27
  53. package/dist/select.d.ts +27 -27
  54. package/dist/select.js +230 -67
  55. package/dist/select.js.map +1 -1
  56. package/dist/textarea.cjs +256 -77
  57. package/dist/textarea.cjs.map +1 -1
  58. package/dist/textarea.d.cts +53 -32
  59. package/dist/textarea.d.ts +53 -32
  60. package/dist/textarea.js +256 -77
  61. package/dist/textarea.js.map +1 -1
  62. package/package.json +22 -12
  63. package/dist/base-DQtCQ-dP.d.cts +0 -22
  64. package/dist/base-DQtCQ-dP.d.ts +0 -22
  65. package/dist/form-iI7vV-3W.d.cts +0 -6
  66. package/dist/form-iI7vV-3W.d.ts +0 -6
package/dist/label.js CHANGED
@@ -1,26 +1,97 @@
1
1
  import { LitElement, nothing, html } from 'lit';
2
2
  import { ifDefined } from 'lit/directives/if-defined.js';
3
+ import { getInputLabelClasses } from '@phcdevworks/spectre-ui';
3
4
 
4
5
  // src/components/label/sp-label.ts
5
6
  var SpectreBaseElement = class extends LitElement {
6
7
  constructor() {
7
8
  super(...arguments);
8
- this.ariaLabel = null;
9
- this.ariaLabelledBy = null;
10
- this.ariaDescribedBy = null;
9
+ this._ariaLabel = null;
10
+ this._ariaLabelledBy = null;
11
+ this._ariaDescribedBy = null;
12
+ this._autocapitalize = "";
13
+ this._spellcheck = null;
14
+ this._title = "";
15
+ this._id = "";
16
+ }
17
+ get ariaLabel() {
18
+ return this._ariaLabel;
19
+ }
20
+ set ariaLabel(value) {
21
+ if (this._ariaLabel === value) {
22
+ return;
23
+ }
24
+ this._ariaLabel = value;
25
+ this._removeHostAttribute("aria-label");
26
+ this.requestUpdate();
27
+ }
28
+ get ariaLabelledBy() {
29
+ return this._ariaLabelledBy;
30
+ }
31
+ set ariaLabelledBy(value) {
32
+ if (this._ariaLabelledBy === value) {
33
+ return;
34
+ }
35
+ this._ariaLabelledBy = value;
36
+ this._removeHostAttribute("aria-labelledby");
37
+ this.requestUpdate();
38
+ }
39
+ get ariaDescribedBy() {
40
+ return this._ariaDescribedBy;
41
+ }
42
+ set ariaDescribedBy(value) {
43
+ if (this._ariaDescribedBy === value) {
44
+ return;
45
+ }
46
+ this._ariaDescribedBy = value;
47
+ this._removeHostAttribute("aria-describedby");
48
+ this.requestUpdate();
49
+ }
50
+ get autocapitalize() {
51
+ return this._autocapitalize;
52
+ }
53
+ set autocapitalize(value) {
54
+ const normalizedValue = value ?? "";
55
+ if (this._autocapitalize === normalizedValue) {
56
+ return;
57
+ }
58
+ this._autocapitalize = normalizedValue;
59
+ this._removeHostAttribute("autocapitalize");
60
+ this.requestUpdate();
61
+ }
62
+ get spellcheck() {
63
+ return this._spellcheck ?? super.spellcheck;
64
+ }
65
+ set spellcheck(value) {
66
+ if (this._spellcheck === value) {
67
+ return;
68
+ }
69
+ this._spellcheck = value ?? null;
70
+ this._removeHostAttribute("spellcheck");
71
+ this.requestUpdate();
72
+ }
73
+ get title() {
74
+ return this._title;
75
+ }
76
+ set title(value) {
77
+ const normalizedValue = value ?? "";
78
+ if (this._title === normalizedValue) {
79
+ return;
80
+ }
81
+ this._title = normalizedValue;
82
+ this._removeHostAttribute("title");
83
+ this.requestUpdate();
11
84
  }
12
85
  get id() {
13
- return this._id ?? "";
86
+ return this._id;
14
87
  }
15
88
  set id(value) {
16
- if ((this._id ?? "") === value) {
89
+ const normalizedValue = value ?? "";
90
+ if (this._id === normalizedValue) {
17
91
  return;
18
92
  }
19
- this._id = value;
20
- const host = this;
21
- if (HTMLElement.prototype.hasAttribute.call(host, "id")) {
22
- HTMLElement.prototype.removeAttribute.call(host, "id");
23
- }
93
+ this._id = normalizedValue;
94
+ this._removeHostAttribute("id");
24
95
  this.requestUpdate();
25
96
  }
26
97
  // Spectre components intentionally render in light DOM so the global
@@ -30,36 +101,121 @@ var SpectreBaseElement = class extends LitElement {
30
101
  }
31
102
  connectedCallback() {
32
103
  super.connectedCallback();
33
- const hostId = super.getAttribute("id");
34
- if (hostId !== null) {
35
- this.id = hostId;
36
- }
104
+ const proxiedAttributes = [
105
+ "id",
106
+ "title",
107
+ "autocapitalize",
108
+ "spellcheck",
109
+ "aria-label",
110
+ "aria-labelledby",
111
+ "aria-describedby"
112
+ ];
113
+ proxiedAttributes.forEach((attr) => {
114
+ const value = super.getAttribute(attr);
115
+ if (value !== null) {
116
+ this.setAttribute(attr, value);
117
+ }
118
+ });
37
119
  }
38
120
  getAttribute(qualifiedName) {
39
- if (qualifiedName === "id") {
40
- return this.id || null;
121
+ switch (qualifiedName) {
122
+ case "id":
123
+ return this.id || null;
124
+ case "title":
125
+ return this.title || null;
126
+ case "autocapitalize":
127
+ return this.autocapitalize || null;
128
+ case "spellcheck":
129
+ return this._spellcheck !== null ? String(this._spellcheck) : null;
130
+ case "aria-label":
131
+ return this.ariaLabel;
132
+ case "aria-labelledby":
133
+ return this.ariaLabelledBy;
134
+ case "aria-describedby":
135
+ return this.ariaDescribedBy;
136
+ default:
137
+ return super.getAttribute(qualifiedName);
41
138
  }
42
- return super.getAttribute(qualifiedName);
43
139
  }
44
140
  hasAttribute(qualifiedName) {
45
- if (qualifiedName === "id") {
46
- return this.id !== "";
141
+ switch (qualifiedName) {
142
+ case "id":
143
+ return this.id !== "";
144
+ case "title":
145
+ return this.title !== "";
146
+ case "autocapitalize":
147
+ return this.autocapitalize !== "";
148
+ case "spellcheck":
149
+ return this._spellcheck !== null;
150
+ case "aria-label":
151
+ return this.ariaLabel !== null;
152
+ case "aria-labelledby":
153
+ return this.ariaLabelledBy !== null;
154
+ case "aria-describedby":
155
+ return this.ariaDescribedBy !== null;
156
+ default:
157
+ return super.hasAttribute(qualifiedName);
47
158
  }
48
- return super.hasAttribute(qualifiedName);
49
159
  }
50
160
  setAttribute(qualifiedName, value) {
51
- if (qualifiedName === "id") {
52
- this.id = value;
53
- return;
161
+ switch (qualifiedName) {
162
+ case "id":
163
+ this.id = value;
164
+ break;
165
+ case "title":
166
+ this.title = value;
167
+ break;
168
+ case "autocapitalize":
169
+ this.autocapitalize = value;
170
+ break;
171
+ case "spellcheck":
172
+ this.spellcheck = value !== "false";
173
+ break;
174
+ case "aria-label":
175
+ this.ariaLabel = value;
176
+ break;
177
+ case "aria-labelledby":
178
+ this.ariaLabelledBy = value;
179
+ break;
180
+ case "aria-describedby":
181
+ this.ariaDescribedBy = value;
182
+ break;
183
+ default:
184
+ super.setAttribute(qualifiedName, value);
54
185
  }
55
- super.setAttribute(qualifiedName, value);
56
186
  }
57
187
  removeAttribute(qualifiedName) {
58
- if (qualifiedName === "id") {
59
- this.id = "";
60
- return;
188
+ switch (qualifiedName) {
189
+ case "id":
190
+ this.id = "";
191
+ break;
192
+ case "title":
193
+ this.title = "";
194
+ break;
195
+ case "autocapitalize":
196
+ this.autocapitalize = "";
197
+ break;
198
+ case "spellcheck":
199
+ this.spellcheck = null;
200
+ break;
201
+ case "aria-label":
202
+ this.ariaLabel = null;
203
+ break;
204
+ case "aria-labelledby":
205
+ this.ariaLabelledBy = null;
206
+ break;
207
+ case "aria-describedby":
208
+ this.ariaDescribedBy = null;
209
+ break;
210
+ default:
211
+ super.removeAttribute(qualifiedName);
212
+ }
213
+ }
214
+ _removeHostAttribute(name) {
215
+ const host = this;
216
+ if (HTMLElement.prototype.hasAttribute.call(host, name)) {
217
+ HTMLElement.prototype.removeAttribute.call(host, name);
61
218
  }
62
- super.removeAttribute(qualifiedName);
63
219
  }
64
220
  get forwardedAriaLabel() {
65
221
  const value = this.ariaLabel?.trim();
@@ -74,11 +230,7 @@ var SpectreBaseElement = class extends LitElement {
74
230
  return value ? value : void 0;
75
231
  }
76
232
  };
77
- SpectreBaseElement.properties = {
78
- ariaLabel: { attribute: "aria-label", type: String },
79
- ariaLabelledBy: { attribute: "aria-labelledby", type: String },
80
- ariaDescribedBy: { attribute: "aria-describedby", type: String }
81
- };
233
+ SpectreBaseElement.properties = {};
82
234
 
83
235
  // src/utils/dom.ts
84
236
  function hasMeaningfulContent(nodes) {
@@ -139,9 +291,9 @@ var SpectreProjectableElement = class extends SpectreBaseElement {
139
291
  }
140
292
  this.contentObserver = new MutationObserver((mutations) => {
141
293
  const isInternalMovement = mutations.every(
142
- (mutation) => Array.from(mutation.removedNodes).every(
294
+ (mutation) => [...mutation.removedNodes].every(
143
295
  (node) => this.isInternalNode(node) || this.contains(node)
144
- ) && Array.from(mutation.addedNodes).every((node) => this.isInternalNode(node))
296
+ ) && [...mutation.addedNodes].every((node) => this.isInternalNode(node))
145
297
  );
146
298
  if (isInternalMovement) {
147
299
  return;
@@ -157,12 +309,25 @@ var SpectreProjectableElement = class extends SpectreBaseElement {
157
309
  this.contentObserver = void 0;
158
310
  }
159
311
  };
160
-
161
- // src/components/label/sp-label.ts
162
312
  var SpectreLabelElement = class extends SpectreProjectableElement {
163
313
  constructor() {
164
314
  super(...arguments);
165
- this.title = "";
315
+ this.disabled = false;
316
+ }
317
+ get isDisabled() {
318
+ return this.disabled ?? false;
319
+ }
320
+ get id() {
321
+ return super.id;
322
+ }
323
+ set id(value) {
324
+ super.id = value;
325
+ }
326
+ get title() {
327
+ return super.title;
328
+ }
329
+ set title(value) {
330
+ super.title = value;
166
331
  }
167
332
  getContentContainer() {
168
333
  return this.querySelector("[data-sp-label-native]");
@@ -181,26 +346,23 @@ var SpectreLabelElement = class extends SpectreProjectableElement {
181
346
  this.getContentContainer()?.blur();
182
347
  }
183
348
  render() {
184
- return html`
185
- <label
186
- aria-describedby=${ifDefined(this.forwardedAriaDescribedBy)}
187
- aria-label=${ifDefined(this.forwardedAriaLabel)}
188
- aria-labelledby=${ifDefined(this.forwardedAriaLabelledBy)}
189
- class='sp-label'
190
- data-sp-label-native
191
- for=${ifDefined(this.htmlFor)}
192
- id=${ifDefined(this.id || void 0)}
193
- tabindex='-1'
194
- title=${ifDefined(this.title || void 0)}
195
- >
196
- ${this.hasProjectedContent ? this.projectedContent : nothing}
197
- </label>
198
- `;
349
+ return html`<label
350
+ aria-describedby="${ifDefined(this.forwardedAriaDescribedBy)}"
351
+ aria-label="${ifDefined(this.forwardedAriaLabel)}"
352
+ aria-labelledby="${ifDefined(this.forwardedAriaLabelledBy)}"
353
+ class="${getInputLabelClasses({ disabled: this.isDisabled })}"
354
+ data-sp-label-native
355
+ for="${ifDefined(this.htmlFor || void 0)}"
356
+ id="${ifDefined(this.id || void 0)}"
357
+ title="${ifDefined(this.title || void 0)}"
358
+ >
359
+ ${this.hasProjectedContent ? this.projectedContent : nothing}
360
+ </label>`;
199
361
  }
200
362
  };
201
363
  SpectreLabelElement.properties = {
202
- htmlFor: { attribute: "for", type: String, reflect: true },
203
- title: { type: String, reflect: true }
364
+ disabled: { type: Boolean, reflect: true },
365
+ htmlFor: { attribute: "for", type: String, reflect: true }
204
366
  };
205
367
  function defineSpectreLabel(tagName = "sp-label") {
206
368
  const existingElement = customElements.get(tagName);
package/dist/label.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/base.ts","../src/utils/dom.ts","../src/utils/projectable.ts","../src/components/label/sp-label.ts"],"names":[],"mappings":";;;;AAEO,IAAM,kBAAA,GAAN,cAAiC,UAAA,CAAW;AAAA,EAA5C,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAOL,IAAA,IAAA,CAAA,SAAA,GAA2B,IAAA;AAC3B,IAAA,IAAA,CAAA,cAAA,GAAgC,IAAA;AAChC,IAAA,IAAA,CAAA,eAAA,GAAiC,IAAA;AAAA,EAAA;AAAA,EAIjC,IAAa,EAAA,GAAa;AACxB,IAAA,OAAO,KAAK,GAAA,IAAO,EAAA;AAAA,EACrB;AAAA,EAEA,IAAa,GAAG,KAAA,EAAe;AAC7B,IAAA,IAAA,CAA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KAAA,IAAS,MAAS,CAAC;AAAA;AAAA,QAAA,EAExC,IAAA,CAAK,mBAAA,GAAsB,IAAA,CAAK,gBAAA,GAAmB,OAAO;AAAA;AAAA,IAAA,CAAA;AAAA,EAGlE;AACF;AA/Ca,mBAAA,CACJ,UAAA,GAAa;AAAA,EAClB,SAAS,EAAE,SAAA,EAAW,OAAO,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA,EAAK;AAAA,EACzD,KAAA,EAAO,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA;AAClC,CAAA;AA6CK,SAAS,kBAAA,CAAmB,UAAU,UAAA,EAAwC;AACnF,EAAA,MAAM,eAAA,GAAkB,cAAA,CAAe,GAAA,CAAI,OAAO,CAAA;AAElD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,OAAO,eAAA;AAAA,EACT;AAEA,EAAA,cAAA,CAAe,MAAA,CAAO,SAAS,mBAAmB,CAAA;AAClD,EAAA,OAAO,mBAAA;AACT","file":"label.js","sourcesContent":["import { LitElement, type PropertyDeclarations } from 'lit';\n\nexport class SpectreBaseElement extends LitElement {\n static properties: PropertyDeclarations = {\n ariaLabel: { attribute: 'aria-label', type: String },\n ariaLabelledBy: { attribute: 'aria-labelledby', type: String },\n ariaDescribedBy: { attribute: 'aria-describedby', type: String },\n };\n\n ariaLabel: string | null = null;\n ariaLabelledBy: string | null = null;\n ariaDescribedBy: string | null = null;\n\n private _id?: string;\n\n override get id(): string {\n return this._id ?? '';\n }\n\n override set id(value: string) {\n if ((this._id ?? '') === value) {\n return;\n }\n\n this._id = value;\n\n const host = this as unknown as HTMLElement;\n if (HTMLElement.prototype.hasAttribute.call(host, 'id')) {\n HTMLElement.prototype.removeAttribute.call(host, 'id');\n }\n\n this.requestUpdate();\n }\n\n // Spectre components intentionally render in light DOM so the global\n // `@phcdevworks/spectre-ui` styling contract can apply directly.\n createRenderRoot(): this {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n const hostId = super.getAttribute('id');\n if (hostId !== null) {\n this.id = hostId;\n }\n }\n\n override getAttribute(qualifiedName: string): string | null {\n if (qualifiedName === 'id') {\n return this.id || null;\n }\n\n return super.getAttribute(qualifiedName);\n }\n\n override hasAttribute(qualifiedName: string): boolean {\n if (qualifiedName === 'id') {\n return this.id !== '';\n }\n\n return super.hasAttribute(qualifiedName);\n }\n\n override setAttribute(qualifiedName: string, value: string): void {\n if (qualifiedName === 'id') {\n this.id = value;\n return;\n }\n\n super.setAttribute(qualifiedName, value);\n }\n\n override removeAttribute(qualifiedName: string): void {\n if (qualifiedName === 'id') {\n this.id = '';\n return;\n }\n\n super.removeAttribute(qualifiedName);\n }\n\n protected get forwardedAriaLabel(): string | undefined {\n const value = this.ariaLabel?.trim();\n return value ? value : undefined;\n }\n\n protected get forwardedAriaLabelledBy(): string | undefined {\n const value = this.ariaLabelledBy?.trim();\n return value ? value : undefined;\n }\n\n protected get forwardedAriaDescribedBy(): string | undefined {\n const value = this.ariaDescribedBy?.trim();\n return value ? value : undefined;\n }\n}\n","export function hasMeaningfulContent(nodes: readonly Node[]): boolean {\n return nodes.some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent?.trim().length ?? 0) > 0;\n }\n\n return false;\n });\n}\n","import { SpectreBaseElement } from './base';\nimport { hasMeaningfulContent } from './dom';\n\nexport abstract class SpectreProjectableElement extends SpectreBaseElement {\n protected projectedContent: Node[] = [];\n private contentObserver?: MutationObserver | undefined;\n\n // Return the native container whose existing children are also treated as\n // projected content sources (e.g. the rendered <button>, <select>, <label>).\n protected abstract getContentContainer(): Element | null;\n\n // Return true if the node was rendered by this component and should not be\n // treated as external projected content.\n protected abstract isInternalNode(node: Node): boolean;\n\n protected get hasProjectedContent(): boolean {\n return hasMeaningfulContent(this.projectedContent);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.syncProjectedContent();\n this.startContentObserver();\n }\n\n override disconnectedCallback(): void {\n this.stopContentObserver();\n super.disconnectedCallback();\n }\n\n protected override update(changedProperties: Map<PropertyKey, unknown>): void {\n this.stopContentObserver();\n super.update(changedProperties);\n this.startContentObserver();\n }\n\n protected syncProjectedContent(): boolean {\n const nextProjectedContent: Node[] = [];\n const sourceNodes = [\n ...this.childNodes,\n ...(this.getContentContainer()?.childNodes ?? []),\n ];\n\n sourceNodes.forEach((node) => {\n if (!this.isInternalNode(node) && !nextProjectedContent.includes(node)) {\n nextProjectedContent.push(node);\n }\n });\n\n const hasChanged =\n nextProjectedContent.length !== this.projectedContent.length ||\n nextProjectedContent.some((node, index) => node !== this.projectedContent[index]);\n\n if (hasChanged) {\n this.projectedContent = nextProjectedContent;\n }\n\n return hasChanged;\n }\n\n private startContentObserver(): void {\n if (this.contentObserver) {\n return;\n }\n\n this.contentObserver = new MutationObserver((mutations) => {\n const isInternalMovement = mutations.every((mutation) =>\n Array.from(mutation.removedNodes).every(\n (node) => this.isInternalNode(node) || this.contains(node),\n ) &&\n Array.from(mutation.addedNodes).every((node) => this.isInternalNode(node)),\n );\n\n if (isInternalMovement) {\n return;\n }\n\n if (this.syncProjectedContent()) {\n this.requestUpdate();\n }\n });\n\n this.contentObserver.observe(this, { childList: true });\n }\n\n private stopContentObserver(): void {\n this.contentObserver?.disconnect();\n this.contentObserver = undefined;\n }\n}\n","import { html, nothing } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { SpectreProjectableElement } from '../../utils/projectable';\n\nexport interface SpectreLabelProps {\n ariaLabel?: string | null;\n ariaLabelledBy?: string | null;\n ariaDescribedBy?: string | null;\n htmlFor?: string;\n title?: string;\n}\n\nexport class SpectreLabelElement extends SpectreProjectableElement implements SpectreLabelProps {\n static properties = {\n htmlFor: { attribute: 'for', type: String, reflect: true },\n title: { type: String, reflect: true },\n };\n\n htmlFor?: string;\n override title = '';\n\n protected override getContentContainer(): Element | null {\n return this.querySelector('[data-sp-label-native]');\n }\n\n protected override isInternalNode(node: Node): boolean {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n\n const el = node as Element;\n return el.hasAttribute('data-sp-label-native');\n }\n\n override focus(options?: FocusOptions): void {\n (this.getContentContainer() as HTMLLabelElement | null)?.focus(options);\n }\n\n override blur(): void {\n (this.getContentContainer() as HTMLLabelElement | null)?.blur();\n }\n\n override render() {\n return html`\n <label\n aria-describedby=${ifDefined(this.forwardedAriaDescribedBy)}\n aria-label=${ifDefined(this.forwardedAriaLabel)}\n aria-labelledby=${ifDefined(this.forwardedAriaLabelledBy)}\n class='sp-label'\n data-sp-label-native\n for=${ifDefined(this.htmlFor)}\n id=${ifDefined(this.id || undefined)}\n tabindex='-1'\n title=${ifDefined(this.title || undefined)}\n >\n ${this.hasProjectedContent ? this.projectedContent : nothing}\n </label>\n `;\n }\n}\n\nexport function defineSpectreLabel(tagName = 'sp-label'): typeof SpectreLabelElement {\n const existingElement = customElements.get(tagName);\n\n if (existingElement) {\n return existingElement as unknown as typeof SpectreLabelElement;\n }\n\n customElements.define(tagName, SpectreLabelElement);\n return SpectreLabelElement;\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/base.ts","../src/utils/dom.ts","../src/utils/projectable.ts","../src/components/label/sp-label.ts"],"names":[],"mappings":";;;;;AAEO,IAAM,kBAAA,GAAN,cAAiC,UAAA,CAAW;AAAA,EAA5C,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAGL,IAAA,IAAA,CAAQ,UAAA,GAA4B,IAAA;AACpC,IAAA,IAAA,CAAQ,eAAA,GAAiC,IAAA;AACzC,IAAA,IAAA,CAAQ,gBAAA,GAAkC,IAAA;AAC1C,IAAA,IAAA,CAAQ,eAAA,GAAkB,EAAA;AAC1B,IAAA,IAAA,CAAQ,WAAA,GAA8B,IAAA;AACtC,IAAA,IAAA,CAAQ,MAAA,GAAS,EAAA;AACjB,IAAA,IAAA,CAAQ,GAAA,GAAM,EAAA;AAAA,EAAA;AAAA,E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AE,SAAA,EAAW,OAAO,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA;AACtD,CAAA;AA8DK,SAAS,kBAAA,CAAmB,UAAU,UAAA,EAAwC;AACnF,EAAA,MAAM,eAAA,GAAkB,cAAA,CAAe,GAAA,CAAI,OAAO,CAAA;AAElD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,OAAO,eAAA;AAAA,EACT;AAEA,EAAA,cAAA,CAAe,MAAA,CAAO,SAAS,mBAAmB,CAAA;AAClD,EAAA,OAAO,mBAAA;AACT","file":"label.js","sourcesContent":["import { LitElement, type PropertyDeclarations } from 'lit';\n\nexport class SpectreBaseElement extends LitElement {\n static properties: PropertyDeclarations = {};\n\n private _ariaLabel: string | null = null;\n private _ariaLabelledBy: string | null = null;\n private _ariaDescribedBy: string | null = null;\n private _autocapitalize = '';\n private _spellcheck: boolean | null = null;\n private _title = '';\n private _id = '';\n\n get ariaLabel(): string | null {\n return this._ariaLabel;\n }\n\n set ariaLabel(value: string | null) {\n if (this._ariaLabel === value) {\n return;\n }\n this._ariaLabel = value;\n this._removeHostAttribute('aria-label');\n this.requestUpdate();\n }\n\n get ariaLabelledBy(): string | null {\n return this._ariaLabelledBy;\n }\n\n set ariaLabelledBy(value: string | null) {\n if (this._ariaLabelledBy === value) {\n return;\n }\n this._ariaLabelledBy = value;\n this._removeHostAttribute('aria-labelledby');\n this.requestUpdate();\n }\n\n get ariaDescribedBy(): string | null {\n return this._ariaDescribedBy;\n }\n\n set ariaDescribedBy(value: string | null) {\n if (this._ariaDescribedBy === value) {\n return;\n }\n this._ariaDescribedBy = value;\n this._removeHostAttribute('aria-describedby');\n this.requestUpdate();\n }\n\n override get autocapitalize(): string {\n return this._autocapitalize;\n }\n\n override set autocapitalize(value: string | undefined | null) {\n const normalizedValue = value ?? '';\n if (this._autocapitalize === normalizedValue) {\n return;\n }\n this._autocapitalize = normalizedValue;\n this._removeHostAttribute('autocapitalize');\n this.requestUpdate();\n }\n\n override get spellcheck(): boolean {\n return this._spellcheck ?? super.spellcheck;\n }\n\n override set spellcheck(value: boolean | undefined | null) {\n if (this._spellcheck === value) {\n return;\n }\n this._spellcheck = value ?? null;\n this._removeHostAttribute('spellcheck');\n this.requestUpdate();\n }\n\n override get title(): string {\n return this._title;\n }\n\n override set title(value: string | undefined | null) {\n const normalizedValue = value ?? '';\n if (this._title === normalizedValue) {\n return;\n }\n this._title = normalizedValue;\n this._removeHostAttribute('title');\n this.requestUpdate();\n }\n\n override get id(): string {\n return this._id;\n }\n\n override set id(value: string | undefined | null) {\n const normalizedValue = value ?? '';\n if (this._id === normalizedValue) {\n return;\n }\n this._id = normalizedValue;\n this._removeHostAttribute('id');\n this.requestUpdate();\n }\n\n // Spectre components intentionally render in light DOM so the global\n // `@phcdevworks/spectre-ui` styling contract can apply directly.\n createRenderRoot(): this {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n const proxiedAttributes = [\n 'id',\n 'title',\n 'autocapitalize',\n 'spellcheck',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n ];\n\n proxiedAttributes.forEach((attr) => {\n const value = super.getAttribute(attr);\n if (value !== null) {\n this.setAttribute(attr, value);\n }\n });\n }\n\n override getAttribute(qualifiedName: string): string | null {\n switch (qualifiedName) {\n case 'id':\n return this.id || null;\n case 'title':\n return this.title || null;\n case 'autocapitalize':\n return this.autocapitalize || null;\n case 'spellcheck':\n return this._spellcheck !== null ? String(this._spellcheck) : null;\n case 'aria-label':\n return this.ariaLabel;\n case 'aria-labelledby':\n return this.ariaLabelledBy;\n case 'aria-describedby':\n return this.ariaDescribedBy;\n default:\n return super.getAttribute(qualifiedName);\n }\n }\n\n override hasAttribute(qualifiedName: string): boolean {\n switch (qualifiedName) {\n case 'id':\n return this.id !== '';\n case 'title':\n return this.title !== '';\n case 'autocapitalize':\n return this.autocapitalize !== '';\n case 'spellcheck':\n return this._spellcheck !== null;\n case 'aria-label':\n return this.ariaLabel !== null;\n case 'aria-labelledby':\n return this.ariaLabelledBy !== null;\n case 'aria-describedby':\n return this.ariaDescribedBy !== null;\n default:\n return super.hasAttribute(qualifiedName);\n }\n }\n\n override setAttribute(qualifiedName: string, value: string): void {\n switch (qualifiedName) {\n case 'id':\n this.id = value;\n break;\n case 'title':\n this.title = value;\n break;\n case 'autocapitalize':\n this.autocapitalize = value;\n break;\n case 'spellcheck':\n this.spellcheck = value !== 'false';\n break;\n case 'aria-label':\n this.ariaLabel = value;\n break;\n case 'aria-labelledby':\n this.ariaLabelledBy = value;\n break;\n case 'aria-describedby':\n this.ariaDescribedBy = value;\n break;\n default:\n super.setAttribute(qualifiedName, value);\n }\n }\n\n override removeAttribute(qualifiedName: string): void {\n switch (qualifiedName) {\n case 'id':\n this.id = '';\n break;\n case 'title':\n this.title = '';\n break;\n case 'autocapitalize':\n this.autocapitalize = '';\n break;\n case 'spellcheck':\n this.spellcheck = null;\n break;\n case 'aria-label':\n this.ariaLabel = null;\n break;\n case 'aria-labelledby':\n this.ariaLabelledBy = null;\n break;\n case 'aria-describedby':\n this.ariaDescribedBy = null;\n break;\n default:\n super.removeAttribute(qualifiedName);\n }\n }\n\n private _removeHostAttribute(name: string): void {\n const host = this as unknown as HTMLElement;\n if (HTMLElement.prototype.hasAttribute.call(host, name)) {\n // Use the native removeAttribute to avoid our own overridden version\n // which would reset the internal state.\n HTMLElement.prototype.removeAttribute.call(host, name);\n }\n }\n\n protected get forwardedAriaLabel(): string | undefined {\n const value = this.ariaLabel?.trim();\n return value ? value : undefined;\n }\n\n protected get forwardedAriaLabelledBy(): string | undefined {\n const value = this.ariaLabelledBy?.trim();\n return value ? value : undefined;\n }\n\n protected get forwardedAriaDescribedBy(): string | undefined {\n const value = this.ariaDescribedBy?.trim();\n return value ? value : undefined;\n }\n}\n","export function hasMeaningfulContent(nodes: readonly Node[]): boolean {\n return nodes.some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent?.trim().length ?? 0) > 0;\n }\n\n return false;\n });\n}\n","import { SpectreBaseElement } from './base';\nimport { hasMeaningfulContent } from './dom';\n\nexport abstract class SpectreProjectableElement extends SpectreBaseElement {\n protected projectedContent: Node[] = [];\n private contentObserver?: MutationObserver | undefined;\n\n // Return the native container whose existing children are also treated as\n // projected content sources (e.g. the rendered <button>, <select>, <label>).\n protected abstract getContentContainer(): Element | null;\n\n // Return true if the node was rendered by this component and should not be\n // treated as external projected content.\n protected abstract isInternalNode(node: Node): boolean;\n\n protected get hasProjectedContent(): boolean {\n return hasMeaningfulContent(this.projectedContent);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.syncProjectedContent();\n this.startContentObserver();\n }\n\n override disconnectedCallback(): void {\n this.stopContentObserver();\n super.disconnectedCallback();\n }\n\n protected override update(changedProperties: Map<PropertyKey, unknown>): void {\n this.stopContentObserver();\n super.update(changedProperties);\n this.startContentObserver();\n }\n\n protected syncProjectedContent(): boolean {\n const nextProjectedContent: Node[] = [];\n const sourceNodes = [\n ...this.childNodes,\n ...(this.getContentContainer()?.childNodes ?? []),\n ];\n\n sourceNodes.forEach((node) => {\n if (!this.isInternalNode(node) && !nextProjectedContent.includes(node)) {\n nextProjectedContent.push(node);\n }\n });\n\n const hasChanged =\n nextProjectedContent.length !== this.projectedContent.length ||\n nextProjectedContent.some((node, index) => node !== this.projectedContent[index]);\n\n if (hasChanged) {\n this.projectedContent = nextProjectedContent;\n }\n\n return hasChanged;\n }\n\n private startContentObserver(): void {\n if (this.contentObserver) {\n return;\n }\n\n this.contentObserver = new MutationObserver((mutations) => {\n const isInternalMovement = mutations.every((mutation) =>\n [...mutation.removedNodes].every(\n (node) => this.isInternalNode(node) || this.contains(node),\n ) &&\n [...mutation.addedNodes].every((node) => this.isInternalNode(node)),\n );\n\n if (isInternalMovement) {\n return;\n }\n\n if (this.syncProjectedContent()) {\n this.requestUpdate();\n }\n });\n\n this.contentObserver.observe(this, { childList: true });\n }\n\n private stopContentObserver(): void {\n this.contentObserver?.disconnect();\n this.contentObserver = undefined;\n }\n}\n","import { html, nothing } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { SpectreProjectableElement } from '../../utils/projectable';\n\nimport { getInputLabelClasses } from '@phcdevworks/spectre-ui';\n\nexport interface SpectreLabelProps {\n ariaLabel?: string | null;\n ariaLabelledBy?: string | null;\n ariaDescribedBy?: string | null;\n disabled?: boolean | undefined;\n id?: string | null | undefined;\n htmlFor?: string | undefined;\n title?: string | null | undefined;\n}\n\nexport class SpectreLabelElement extends SpectreProjectableElement implements SpectreLabelProps {\n static properties = {\n disabled: { type: Boolean, reflect: true },\n htmlFor: { attribute: 'for', type: String, reflect: true },\n };\n\n disabled = false;\n htmlFor: string | undefined;\n\n private get isDisabled(): boolean {\n return this.disabled ?? false;\n }\n\n override get id(): string {\n return super.id;\n }\n\n override set id(value: string | null | undefined) {\n super.id = value;\n }\n\n override get title(): string {\n return super.title;\n }\n\n override set title(value: string | null | undefined) {\n super.title = value;\n }\n\n protected override getContentContainer(): Element | null {\n return this.querySelector('[data-sp-label-native]');\n }\n\n protected override isInternalNode(node: Node): boolean {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n\n const el = node as Element;\n return el.hasAttribute('data-sp-label-native');\n }\n\n override focus(options?: FocusOptions): void {\n (this.getContentContainer() as HTMLLabelElement | null)?.focus(options);\n }\n\n override blur(): void {\n (this.getContentContainer() as HTMLLabelElement | null)?.blur();\n }\n\n override render() {\n return html`<label\n aria-describedby=\"${ifDefined(this.forwardedAriaDescribedBy)}\"\n aria-label=\"${ifDefined(this.forwardedAriaLabel)}\"\n aria-labelledby=\"${ifDefined(this.forwardedAriaLabelledBy)}\"\n class=\"${getInputLabelClasses({ disabled: this.isDisabled })}\"\n data-sp-label-native\n for=\"${ifDefined(this.htmlFor || undefined)}\"\n id=\"${ifDefined(this.id || undefined)}\"\n title=\"${ifDefined(this.title || undefined)}\"\n >\n ${this.hasProjectedContent ? this.projectedContent : nothing}\n </label>`;\n }\n}\n\nexport function defineSpectreLabel(tagName = 'sp-label'): typeof SpectreLabelElement {\n const existingElement = customElements.get(tagName);\n\n if (existingElement) {\n return existingElement as unknown as typeof SpectreLabelElement;\n }\n\n customElements.define(tagName, SpectreLabelElement);\n return SpectreLabelElement;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { S as SpectreBaseElement } from './base-DQtCQ-dP.cjs';
1
+ import { S as SpectreBaseElement } from './base-B_9DJkh2.cjs';
2
2
 
3
3
  declare abstract class SpectreProjectableElement extends SpectreBaseElement {
4
4
  protected projectedContent: Node[];
@@ -1,4 +1,4 @@
1
- import { S as SpectreBaseElement } from './base-DQtCQ-dP.js';
1
+ import { S as SpectreBaseElement } from './base-B_9DJkh2.js';
2
2
 
3
3
  declare abstract class SpectreProjectableElement extends SpectreBaseElement {
4
4
  protected projectedContent: Node[];