@phcdevworks/spectre-components 1.7.0 → 1.9.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/README.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @phcdevworks/spectre-components
2
2
 
3
+ `@phcdevworks/spectre-components` is the Lit-based component layer of the
4
+ Spectre system. It implements Spectre's design contracts as reusable,
5
+ accessible, framework-agnostic web components.
6
+
7
+ Maintained by [PHCDevworks](https://go.phcdev.co). It draws on Spectre's
8
+ token and styling contracts to ship drop-in UI primitives, so applications
9
+ that need working components — rather than raw CSS or recipes to assemble
10
+ themselves — can consume Spectre without a framework-specific adapter.
11
+
3
12
  ## Repository Snapshot
4
13
 
5
14
  | Field | Value |
@@ -7,7 +16,7 @@
7
16
  | Project team | `project-design` |
8
17
  | Repository role | Spectre L3a Lit web component layer |
9
18
  | Package/artifact | `@phcdevworks/spectre-components` |
10
- | Current version/status | 1.7.0 |
19
+ | Current version/status | 1.9.0 |
11
20
 
12
21
  ## Standard Workflow
13
22
 
@@ -858,6 +867,25 @@ Renders a `<div>` flex stack backed by the Spectre stack recipe.
858
867
 
859
868
  ---
860
869
 
870
+ ### sp-footer
871
+
872
+ Renders a `<footer>` backed by the Spectre footer recipe.
873
+
874
+ **Attributes**
875
+
876
+ | Attribute | Type | Default | Description |
877
+ | ------------------------- | ------- | ------- | ---------------------------------- |
878
+ | `bordered` | boolean | `false` | Adds a top border |
879
+ | `full-width` | boolean | `false` | Spans full container width |
880
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<footer>` |
881
+
882
+ **Content projection** — children become the footer content (links, legal
883
+ text, etc.).
884
+
885
+ **Internal target** — `[data-sp-footer-native]` selects the native `<footer>`.
886
+
887
+ ---
888
+
861
889
  ### sp-nav
862
890
 
863
891
  Renders a `<nav>` backed by the Spectre nav recipe.
@@ -1086,9 +1114,9 @@ defineSpectreComponents() // registers all sp-* elements
1086
1114
 
1087
1115
  **Interactive constants and types**: `spectreDropdownPlacements`,
1088
1116
  `spectreToastVariants`, `spectreTooltipPlacements`, `SpectreDropdownPlacement`,
1089
- `SpectreToastVariant`, `SpectreTooltipPlacement`, `SpectreNavProps`,
1090
- `SpectreSidebarProps`, `SpectreDropdownProps`, `SpectreModalProps`,
1091
- `SpectreToastProps`, `SpectreTooltipProps`
1117
+ `SpectreToastVariant`, `SpectreTooltipPlacement`, `SpectreFooterProps`,
1118
+ `SpectreNavProps`, `SpectreSidebarProps`, `SpectreDropdownProps`,
1119
+ `SpectreModalProps`, `SpectreToastProps`, `SpectreTooltipProps`
1092
1120
 
1093
1121
  ### Subpath entry points
1094
1122
 
@@ -1121,6 +1149,7 @@ Each entry point registers only that component and exports only its surface:
1121
1149
  | `.../nav` | `sp-nav` | `defineSpectreNav`, `SpectreNavElement`, `SpectreNavProps` |
1122
1150
  | `.../sidebar` | `sp-sidebar` | `defineSpectreSidebar`, `SpectreSidebarElement`, `SpectreSidebarProps` |
1123
1151
  | `.../dropdown` | `sp-dropdown` | `defineSpectreDropdown`, `SpectreDropdownElement`, dropdown constants and types |
1152
+ | `.../footer` | `sp-footer` | `defineSpectreFooter`, `SpectreFooterElement`, `SpectreFooterProps` |
1124
1153
  | `.../modal` | `sp-modal` | `defineSpectreModal`, `SpectreModalElement`, `SpectreModalProps` |
1125
1154
  | `.../toast` | `sp-toast` | `defineSpectreToast`, `SpectreToastElement`, toast constants and types |
1126
1155
  | `.../tooltip` | `sp-tooltip` | `defineSpectreTooltip`, `SpectreTooltipElement`, tooltip constants and types |
@@ -0,0 +1,418 @@
1
+ 'use strict';
2
+
3
+ var lit = require('lit');
4
+ var ifDefined_js = require('lit/directives/if-defined.js');
5
+ var spectreUi = require('@phcdevworks/spectre-ui');
6
+
7
+ // src/components/footer/sp-footer.ts
8
+ var SpectreBaseElement = class extends lit.LitElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this._ariaLabel = null;
12
+ this._ariaLabelledBy = null;
13
+ this._ariaDescribedBy = null;
14
+ this._autocapitalize = "";
15
+ this._autofocus = false;
16
+ this._spellcheck = null;
17
+ this._title = "";
18
+ this._id = "";
19
+ }
20
+ get ariaLabel() {
21
+ return this._ariaLabel;
22
+ }
23
+ set ariaLabel(value) {
24
+ if (this._ariaLabel === value) {
25
+ return;
26
+ }
27
+ this._ariaLabel = value;
28
+ this._removeHostAttribute("aria-label");
29
+ this.requestUpdate();
30
+ }
31
+ get ariaLabelledBy() {
32
+ return this._ariaLabelledBy;
33
+ }
34
+ set ariaLabelledBy(value) {
35
+ if (this._ariaLabelledBy === value) {
36
+ return;
37
+ }
38
+ this._ariaLabelledBy = value;
39
+ this._removeHostAttribute("aria-labelledby");
40
+ this.requestUpdate();
41
+ }
42
+ get ariaDescribedBy() {
43
+ return this._ariaDescribedBy;
44
+ }
45
+ set ariaDescribedBy(value) {
46
+ if (this._ariaDescribedBy === value) {
47
+ return;
48
+ }
49
+ this._ariaDescribedBy = value;
50
+ this._removeHostAttribute("aria-describedby");
51
+ this.requestUpdate();
52
+ }
53
+ get autocapitalize() {
54
+ return this._autocapitalize;
55
+ }
56
+ set autocapitalize(value) {
57
+ const normalizedValue = value ?? "";
58
+ if (this._autocapitalize === normalizedValue) {
59
+ return;
60
+ }
61
+ this._autocapitalize = normalizedValue;
62
+ this._removeHostAttribute("autocapitalize");
63
+ this.requestUpdate();
64
+ }
65
+ get spellcheck() {
66
+ return this._spellcheck ?? super.spellcheck;
67
+ }
68
+ set spellcheck(value) {
69
+ if (this._spellcheck === value) {
70
+ return;
71
+ }
72
+ this._spellcheck = value ?? null;
73
+ this._removeHostAttribute("spellcheck");
74
+ this.requestUpdate();
75
+ }
76
+ get title() {
77
+ return this._title;
78
+ }
79
+ set title(value) {
80
+ const normalizedValue = value ?? "";
81
+ if (this._title === normalizedValue) {
82
+ return;
83
+ }
84
+ this._title = normalizedValue;
85
+ this._removeHostAttribute("title");
86
+ this.requestUpdate();
87
+ }
88
+ get id() {
89
+ return this._id;
90
+ }
91
+ set id(value) {
92
+ const normalizedValue = value ?? "";
93
+ if (this._id === normalizedValue) {
94
+ return;
95
+ }
96
+ this._id = normalizedValue;
97
+ this._removeHostAttribute("id");
98
+ this.requestUpdate();
99
+ }
100
+ get autofocus() {
101
+ return this._autofocus;
102
+ }
103
+ set autofocus(value) {
104
+ const normalizedValue = !!value;
105
+ if (this._autofocus === normalizedValue) {
106
+ return;
107
+ }
108
+ this._autofocus = normalizedValue;
109
+ this._removeHostAttribute("autofocus");
110
+ this.requestUpdate();
111
+ }
112
+ // Spectre components intentionally render in light DOM so the global
113
+ // `@phcdevworks/spectre-ui` styling contract can apply directly.
114
+ createRenderRoot() {
115
+ return this;
116
+ }
117
+ connectedCallback() {
118
+ super.connectedCallback();
119
+ const proxiedAttributes = [
120
+ "id",
121
+ "title",
122
+ "autocapitalize",
123
+ "autofocus",
124
+ "spellcheck",
125
+ "aria-label",
126
+ "aria-labelledby",
127
+ "aria-describedby"
128
+ ];
129
+ proxiedAttributes.forEach((attr) => {
130
+ const value = super.getAttribute(attr);
131
+ if (value !== null) {
132
+ this.setAttribute(attr, value);
133
+ }
134
+ });
135
+ }
136
+ getAttribute(qualifiedName) {
137
+ switch (qualifiedName) {
138
+ case "id":
139
+ return this.id || null;
140
+ case "title":
141
+ return this.title || null;
142
+ case "autocapitalize":
143
+ return this.autocapitalize || null;
144
+ case "autofocus":
145
+ return this.autofocus ? "" : null;
146
+ case "spellcheck":
147
+ return this._spellcheck !== null ? String(this._spellcheck) : null;
148
+ case "aria-label":
149
+ return this.ariaLabel;
150
+ case "aria-labelledby":
151
+ return this.ariaLabelledBy;
152
+ case "aria-describedby":
153
+ return this.ariaDescribedBy;
154
+ default:
155
+ return super.getAttribute(qualifiedName);
156
+ }
157
+ }
158
+ hasAttribute(qualifiedName) {
159
+ switch (qualifiedName) {
160
+ case "id":
161
+ return this.id !== "";
162
+ case "title":
163
+ return this.title !== "";
164
+ case "autocapitalize":
165
+ return this.autocapitalize !== "";
166
+ case "autofocus":
167
+ return this.autofocus;
168
+ case "spellcheck":
169
+ return this._spellcheck !== null;
170
+ case "aria-label":
171
+ return this.ariaLabel !== null;
172
+ case "aria-labelledby":
173
+ return this.ariaLabelledBy !== null;
174
+ case "aria-describedby":
175
+ return this.ariaDescribedBy !== null;
176
+ default:
177
+ return super.hasAttribute(qualifiedName);
178
+ }
179
+ }
180
+ setAttribute(qualifiedName, value) {
181
+ switch (qualifiedName) {
182
+ case "id":
183
+ this.id = value;
184
+ break;
185
+ case "title":
186
+ this.title = value;
187
+ break;
188
+ case "autocapitalize":
189
+ this.autocapitalize = value;
190
+ break;
191
+ case "autofocus":
192
+ this.autofocus = true;
193
+ break;
194
+ case "spellcheck":
195
+ this.spellcheck = value !== "false";
196
+ break;
197
+ case "aria-label":
198
+ this.ariaLabel = value;
199
+ break;
200
+ case "aria-labelledby":
201
+ this.ariaLabelledBy = value;
202
+ break;
203
+ case "aria-describedby":
204
+ this.ariaDescribedBy = value;
205
+ break;
206
+ default:
207
+ super.setAttribute(qualifiedName, value);
208
+ }
209
+ }
210
+ removeAttribute(qualifiedName) {
211
+ switch (qualifiedName) {
212
+ case "id":
213
+ this.id = "";
214
+ break;
215
+ case "title":
216
+ this.title = "";
217
+ break;
218
+ case "autocapitalize":
219
+ this.autocapitalize = "";
220
+ break;
221
+ case "autofocus":
222
+ this.autofocus = false;
223
+ break;
224
+ case "spellcheck":
225
+ this.spellcheck = null;
226
+ break;
227
+ case "aria-label":
228
+ this.ariaLabel = null;
229
+ break;
230
+ case "aria-labelledby":
231
+ this.ariaLabelledBy = null;
232
+ break;
233
+ case "aria-describedby":
234
+ this.ariaDescribedBy = null;
235
+ break;
236
+ default:
237
+ super.removeAttribute(qualifiedName);
238
+ }
239
+ }
240
+ _removeHostAttribute(name) {
241
+ const host = this;
242
+ if (HTMLElement.prototype.hasAttribute.call(host, name)) {
243
+ HTMLElement.prototype.removeAttribute.call(host, name);
244
+ }
245
+ }
246
+ get forwardedAriaLabel() {
247
+ const value = this.ariaLabel?.trim();
248
+ return value ? value : void 0;
249
+ }
250
+ get forwardedAriaLabelledBy() {
251
+ const value = this.ariaLabelledBy?.trim();
252
+ return value ? value : void 0;
253
+ }
254
+ get forwardedAriaDescribedBy() {
255
+ const value = this.ariaDescribedBy?.trim();
256
+ return value ? value : void 0;
257
+ }
258
+ // Subclasses that expose `disabled`/`loading` properties get this disabled
259
+ // calculation for free instead of redeclaring it per component.
260
+ get isDisabled() {
261
+ const self = this;
262
+ return (self.disabled ?? false) || (self.loading ?? false);
263
+ }
264
+ // Subclasses get this for free instead of redeclaring it per component.
265
+ get hasForwardedLabel() {
266
+ return Boolean(this.forwardedAriaLabel || this.forwardedAriaLabelledBy);
267
+ }
268
+ };
269
+ SpectreBaseElement.properties = {};
270
+
271
+ // src/utils/dom.ts
272
+ function hasMeaningfulContent(nodes) {
273
+ return nodes.some((node) => {
274
+ if (node.nodeType === Node.ELEMENT_NODE) {
275
+ return true;
276
+ }
277
+ if (node.nodeType === Node.TEXT_NODE) {
278
+ return (node.textContent?.trim().length ?? 0) > 0;
279
+ }
280
+ return false;
281
+ });
282
+ }
283
+
284
+ // src/utils/projectable.ts
285
+ var SpectreProjectableElement = class extends SpectreBaseElement {
286
+ constructor() {
287
+ super(...arguments);
288
+ this.projectedContent = [];
289
+ }
290
+ get hasProjectedContent() {
291
+ return hasMeaningfulContent(this.projectedContent);
292
+ }
293
+ connectedCallback() {
294
+ super.connectedCallback();
295
+ this.syncProjectedContent();
296
+ this.startContentObserver();
297
+ }
298
+ disconnectedCallback() {
299
+ this.stopContentObserver();
300
+ super.disconnectedCallback();
301
+ }
302
+ update(changedProperties) {
303
+ this.stopContentObserver();
304
+ super.update(changedProperties);
305
+ this.startContentObserver();
306
+ }
307
+ syncProjectedContent() {
308
+ const nextProjectedContent = [];
309
+ const sourceNodes = [
310
+ ...this.childNodes,
311
+ ...this.getContentContainer()?.childNodes ?? []
312
+ ];
313
+ sourceNodes.forEach((node) => {
314
+ if (!this.isInternalNode(node) && !nextProjectedContent.includes(node)) {
315
+ nextProjectedContent.push(node);
316
+ }
317
+ });
318
+ const hasChanged = nextProjectedContent.length !== this.projectedContent.length || nextProjectedContent.some((node, index) => node !== this.projectedContent[index]);
319
+ if (hasChanged) {
320
+ this.projectedContent = nextProjectedContent;
321
+ }
322
+ return hasChanged;
323
+ }
324
+ startContentObserver() {
325
+ if (this.contentObserver) {
326
+ return;
327
+ }
328
+ this.contentObserver = new MutationObserver((mutations) => {
329
+ const isInternalMovement = mutations.every(
330
+ (mutation) => [...mutation.removedNodes].every(
331
+ (node) => this.isInternalNode(node) || this.contains(node)
332
+ ) && [...mutation.addedNodes].every((node) => this.isInternalNode(node))
333
+ );
334
+ if (isInternalMovement) {
335
+ return;
336
+ }
337
+ if (this.syncProjectedContent()) {
338
+ this.requestUpdate();
339
+ }
340
+ });
341
+ this.contentObserver.observe(this, { childList: true });
342
+ }
343
+ stopContentObserver() {
344
+ this.contentObserver?.disconnect();
345
+ this.contentObserver = void 0;
346
+ }
347
+ };
348
+ var SpectreFooterElement = class extends SpectreProjectableElement {
349
+ constructor() {
350
+ super(...arguments);
351
+ this.bordered = false;
352
+ this.fullWidth = false;
353
+ }
354
+ get id() {
355
+ return super.id;
356
+ }
357
+ set id(value) {
358
+ super.id = value;
359
+ }
360
+ get title() {
361
+ return super.title;
362
+ }
363
+ set title(value) {
364
+ super.title = value;
365
+ }
366
+ getContentContainer() {
367
+ return this.querySelector("[data-sp-footer-native]");
368
+ }
369
+ isInternalNode(node) {
370
+ if (node.nodeType !== Node.ELEMENT_NODE) {
371
+ return false;
372
+ }
373
+ const el = node;
374
+ return el.hasAttribute("data-sp-footer-native");
375
+ }
376
+ willUpdate(changedProperties) {
377
+ if (changedProperties.has("bordered") && this.bordered == null) {
378
+ this.bordered = false;
379
+ }
380
+ if (changedProperties.has("fullWidth") && this.fullWidth == null) {
381
+ this.fullWidth = false;
382
+ }
383
+ }
384
+ get footerClasses() {
385
+ return spectreUi.getFooterClasses({
386
+ bordered: this.bordered ?? false,
387
+ fullWidth: this.fullWidth ?? false
388
+ });
389
+ }
390
+ render() {
391
+ return lit.html`<footer
392
+ aria-label="${ifDefined_js.ifDefined(this.forwardedAriaLabel)}"
393
+ class="${this.footerClasses}"
394
+ data-sp-footer-native
395
+ id="${ifDefined_js.ifDefined(this.id || void 0)}"
396
+ title="${ifDefined_js.ifDefined(this.title || void 0)}"
397
+ >
398
+ ${this.hasProjectedContent ? this.projectedContent : lit.nothing}
399
+ </footer>`;
400
+ }
401
+ };
402
+ SpectreFooterElement.properties = {
403
+ bordered: { type: Boolean, reflect: true },
404
+ fullWidth: { attribute: "full-width", type: Boolean, reflect: true }
405
+ };
406
+ function defineSpectreFooter(tagName = "sp-footer") {
407
+ const existingElement = customElements.get(tagName);
408
+ if (existingElement) {
409
+ return existingElement;
410
+ }
411
+ customElements.define(tagName, SpectreFooterElement);
412
+ return SpectreFooterElement;
413
+ }
414
+
415
+ exports.SpectreFooterElement = SpectreFooterElement;
416
+ exports.defineSpectreFooter = defineSpectreFooter;
417
+ //# sourceMappingURL=footer.cjs.map
418
+ //# sourceMappingURL=footer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/base.ts","../src/utils/dom.ts","../src/utils/projectable.ts","../src/components/footer/sp-footer.ts"],"names":["LitElement","getFooterClasses","html","ifDefined","nothing"],"mappings":";;;;;;;AAEO,IAAM,kBAAA,GAAN,cAAiCA,cAAA,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,UAAA,GAAa,KAAA;AACrB,IAAA,IAAA,CAAQ,WAAA,GAA8B,IAAA;AAC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AAC7B,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,oBAAoB,CAAA;AACnD,EAAA,OAAO,oBAAA;AACT","file":"footer.cjs","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 _autofocus = false\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 override get autofocus(): boolean {\n return this._autofocus\n }\n\n override set autofocus(value: boolean | undefined | null) {\n const normalizedValue = !!value\n if (this._autofocus === normalizedValue) {\n return\n }\n this._autofocus = normalizedValue\n this._removeHostAttribute('autofocus')\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 'autofocus',\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 'autofocus':\n return this.autofocus ? '' : 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 'autofocus':\n return this.autofocus\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 'autofocus':\n this.autofocus = true\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 'autofocus':\n this.autofocus = false\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 // Subclasses that expose `disabled`/`loading` properties get this disabled\n // calculation for free instead of redeclaring it per component.\n protected get isDisabled(): boolean {\n const self = this as unknown as { disabled?: boolean; loading?: boolean }\n return (self.disabled ?? false) || (self.loading ?? false)\n }\n\n // Subclasses get this for free instead of redeclaring it per component.\n protected get hasForwardedLabel(): boolean {\n return Boolean(this.forwardedAriaLabel || this.forwardedAriaLabelledBy)\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 { getFooterClasses } from '@phcdevworks/spectre-ui'\n\nexport interface SpectreFooterProps {\n ariaLabel?: string | null\n bordered?: boolean | undefined\n fullWidth?: boolean | undefined\n id?: string | null | undefined\n title?: string | null | undefined\n}\n\nexport class SpectreFooterElement\n extends SpectreProjectableElement\n implements SpectreFooterProps\n{\n static properties = {\n bordered: { type: Boolean, reflect: true },\n fullWidth: { attribute: 'full-width', type: Boolean, reflect: true }\n }\n\n bordered: boolean | undefined = false\n fullWidth: boolean | undefined = false\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-footer-native]')\n }\n\n protected override isInternalNode(node: Node): boolean {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false\n }\n const el = node as Element\n return el.hasAttribute('data-sp-footer-native')\n }\n\n protected override willUpdate(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n if (changedProperties.has('bordered') && this.bordered == null) {\n this.bordered = false\n }\n if (changedProperties.has('fullWidth') && this.fullWidth == null) {\n this.fullWidth = false\n }\n }\n\n private get footerClasses(): string {\n return getFooterClasses({\n bordered: this.bordered ?? false,\n fullWidth: this.fullWidth ?? false\n })\n }\n\n override render() {\n return html`<footer\n aria-label=\"${ifDefined(this.forwardedAriaLabel)}\"\n class=\"${this.footerClasses}\"\n data-sp-footer-native\n id=\"${ifDefined(this.id || undefined)}\"\n title=\"${ifDefined(this.title || undefined)}\"\n >\n ${this.hasProjectedContent ? this.projectedContent : nothing}\n </footer>`\n }\n}\n\nexport function defineSpectreFooter(\n tagName = 'sp-footer'\n): typeof SpectreFooterElement {\n const existingElement = customElements.get(tagName)\n\n if (existingElement) {\n return existingElement as unknown as typeof SpectreFooterElement\n }\n\n customElements.define(tagName, SpectreFooterElement)\n return SpectreFooterElement\n}\n"]}
@@ -0,0 +1,39 @@
1
+ import * as lit_html from 'lit-html';
2
+ import { S as SpectreProjectableElement } from './projectable-DLOn6eaW.cjs';
3
+ import './base-D0s95V2v.cjs';
4
+ import 'lit';
5
+
6
+ interface SpectreFooterProps {
7
+ ariaLabel?: string | null;
8
+ bordered?: boolean | undefined;
9
+ fullWidth?: boolean | undefined;
10
+ id?: string | null | undefined;
11
+ title?: string | null | undefined;
12
+ }
13
+ declare class SpectreFooterElement extends SpectreProjectableElement implements SpectreFooterProps {
14
+ static properties: {
15
+ bordered: {
16
+ type: BooleanConstructor;
17
+ reflect: boolean;
18
+ };
19
+ fullWidth: {
20
+ attribute: string;
21
+ type: BooleanConstructor;
22
+ reflect: boolean;
23
+ };
24
+ };
25
+ bordered: boolean | undefined;
26
+ fullWidth: boolean | undefined;
27
+ get id(): string;
28
+ set id(value: string | null | undefined);
29
+ get title(): string;
30
+ set title(value: string | null | undefined);
31
+ protected getContentContainer(): Element | null;
32
+ protected isInternalNode(node: Node): boolean;
33
+ protected willUpdate(changedProperties: Map<PropertyKey, unknown>): void;
34
+ private get footerClasses();
35
+ render(): lit_html.TemplateResult<1>;
36
+ }
37
+ declare function defineSpectreFooter(tagName?: string): typeof SpectreFooterElement;
38
+
39
+ export { SpectreFooterElement, type SpectreFooterProps, defineSpectreFooter };
@@ -0,0 +1,39 @@
1
+ import * as lit_html from 'lit-html';
2
+ import { S as SpectreProjectableElement } from './projectable-D9YCo9NY.js';
3
+ import './base-D0s95V2v.js';
4
+ import 'lit';
5
+
6
+ interface SpectreFooterProps {
7
+ ariaLabel?: string | null;
8
+ bordered?: boolean | undefined;
9
+ fullWidth?: boolean | undefined;
10
+ id?: string | null | undefined;
11
+ title?: string | null | undefined;
12
+ }
13
+ declare class SpectreFooterElement extends SpectreProjectableElement implements SpectreFooterProps {
14
+ static properties: {
15
+ bordered: {
16
+ type: BooleanConstructor;
17
+ reflect: boolean;
18
+ };
19
+ fullWidth: {
20
+ attribute: string;
21
+ type: BooleanConstructor;
22
+ reflect: boolean;
23
+ };
24
+ };
25
+ bordered: boolean | undefined;
26
+ fullWidth: boolean | undefined;
27
+ get id(): string;
28
+ set id(value: string | null | undefined);
29
+ get title(): string;
30
+ set title(value: string | null | undefined);
31
+ protected getContentContainer(): Element | null;
32
+ protected isInternalNode(node: Node): boolean;
33
+ protected willUpdate(changedProperties: Map<PropertyKey, unknown>): void;
34
+ private get footerClasses();
35
+ render(): lit_html.TemplateResult<1>;
36
+ }
37
+ declare function defineSpectreFooter(tagName?: string): typeof SpectreFooterElement;
38
+
39
+ export { SpectreFooterElement, type SpectreFooterProps, defineSpectreFooter };