@spectrum-web-components/theme 0.49.0-beta.1 → 0.49.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.
@@ -0,0 +1,483 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "sp-theme.js",
8
+ "declarations": [],
9
+ "exports": [
10
+ {
11
+ "kind": "custom-element-definition",
12
+ "name": "sp-theme",
13
+ "declaration": {
14
+ "name": "Theme",
15
+ "module": "/src/Theme.js"
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "kind": "javascript-module",
22
+ "path": "src/Theme.js",
23
+ "declarations": [
24
+ {
25
+ "kind": "class",
26
+ "description": "",
27
+ "name": "Theme",
28
+ "slots": [
29
+ {
30
+ "description": "Content on which to apply the CSS Custom Properties defined by the current theme configuration",
31
+ "name": ""
32
+ }
33
+ ],
34
+ "members": [
35
+ {
36
+ "kind": "field",
37
+ "name": "themeFragmentsByKind",
38
+ "type": {
39
+ "text": "ThemeFragmentMap"
40
+ },
41
+ "privacy": "private",
42
+ "static": true,
43
+ "default": "new Map()"
44
+ },
45
+ {
46
+ "kind": "field",
47
+ "name": "defaultFragments",
48
+ "type": {
49
+ "text": "Set<FragmentName>"
50
+ },
51
+ "privacy": "private",
52
+ "static": true,
53
+ "default": "new Set(['spectrum'])"
54
+ },
55
+ {
56
+ "kind": "field",
57
+ "name": "templateElement",
58
+ "type": {
59
+ "text": "HTMLTemplateElement | undefined"
60
+ },
61
+ "privacy": "private",
62
+ "static": true
63
+ },
64
+ {
65
+ "kind": "field",
66
+ "name": "instances",
67
+ "type": {
68
+ "text": "Set<Theme>"
69
+ },
70
+ "privacy": "private",
71
+ "static": true,
72
+ "default": "new Set()"
73
+ },
74
+ {
75
+ "kind": "field",
76
+ "name": "VERSION",
77
+ "static": true,
78
+ "default": "version"
79
+ },
80
+ {
81
+ "kind": "field",
82
+ "name": "_dir",
83
+ "type": {
84
+ "text": "'ltr' | 'rtl' | ''"
85
+ },
86
+ "default": "''"
87
+ },
88
+ {
89
+ "kind": "field",
90
+ "name": "dir",
91
+ "type": {
92
+ "text": "\"ltr\" | \"rtl\" | \"\""
93
+ },
94
+ "description": "Reading direction of the content scoped to this `sp-theme` element.",
95
+ "attribute": "dir"
96
+ },
97
+ {
98
+ "kind": "field",
99
+ "name": "shadowRoot",
100
+ "type": {
101
+ "text": "ShadowRootWithAdoptedStyleSheets"
102
+ },
103
+ "privacy": "public"
104
+ },
105
+ {
106
+ "kind": "field",
107
+ "name": "_system",
108
+ "type": {
109
+ "text": "SystemVariant | ''"
110
+ },
111
+ "privacy": "private",
112
+ "default": "'spectrum'"
113
+ },
114
+ {
115
+ "kind": "field",
116
+ "name": "system",
117
+ "type": {
118
+ "text": "\"spectrum\" | \"express\""
119
+ },
120
+ "description": "The Spectrum system that is applied to the content scoped to this `sp-theme` element.\n\nA value is requried.",
121
+ "attribute": "system"
122
+ },
123
+ {
124
+ "kind": "field",
125
+ "name": "theme",
126
+ "type": {
127
+ "text": "SystemVariant | ''"
128
+ }
129
+ },
130
+ {
131
+ "kind": "field",
132
+ "name": "_color",
133
+ "type": {
134
+ "text": "Color | ''"
135
+ },
136
+ "privacy": "private",
137
+ "default": "''"
138
+ },
139
+ {
140
+ "kind": "field",
141
+ "name": "color",
142
+ "type": {
143
+ "text": "\"lightest\" | \"light\" | \"dark\" | \"darkest\" | \"\""
144
+ },
145
+ "description": "The Spectrum color stops to apply to content scoped by this `sp-theme` element.\n\nA value is requried.",
146
+ "attribute": "color"
147
+ },
148
+ {
149
+ "kind": "field",
150
+ "name": "_scale",
151
+ "type": {
152
+ "text": "Scale | ''"
153
+ },
154
+ "privacy": "private",
155
+ "default": "''"
156
+ },
157
+ {
158
+ "kind": "field",
159
+ "name": "scale",
160
+ "type": {
161
+ "text": "\"medium\" | \"large\" | \"\""
162
+ },
163
+ "description": "The Spectrum platform scale to apply to content scoped by this `sp-theme` element.\n\nA value is requried.",
164
+ "attribute": "scale"
165
+ },
166
+ {
167
+ "kind": "field",
168
+ "name": "template",
169
+ "type": {
170
+ "text": "HTMLTemplateElement"
171
+ },
172
+ "privacy": "private",
173
+ "static": true,
174
+ "readonly": true
175
+ },
176
+ {
177
+ "kind": "field",
178
+ "name": "_systemContextConsumers",
179
+ "privacy": "private",
180
+ "default": "new Map<\n HTMLElement,\n [SystemContextCallback, () => void]\n >()",
181
+ "description": "Stores system context consumers and their associated callbacks.\n\nThis Map associates each consumer component (HTMLElement) with a tuple containing:\n- The `SystemContextCallback` function to be invoked with the system context.\n- An `unsubscribe` function to remove the consumer from the Map when it's no longer needed."
182
+ },
183
+ {
184
+ "kind": "method",
185
+ "name": "_handleSystemContext",
186
+ "privacy": "private",
187
+ "return": {
188
+ "type": {
189
+ "text": "void"
190
+ }
191
+ },
192
+ "parameters": [
193
+ {
194
+ "name": "event",
195
+ "type": {
196
+ "text": "CustomEvent<{ callback: SystemContextCallback }>"
197
+ },
198
+ "description": "The custom event containing the callback function to provide the system context."
199
+ }
200
+ ],
201
+ "description": "Handles the 'sp-system-context' event dispatched by descendant components requesting the system context.\n\nThis method registers the requesting component's callback and provides the current system context to it.\nIt also manages the unsubscribe mechanism to clean up when the component is disconnected."
202
+ },
203
+ {
204
+ "kind": "field",
205
+ "name": "updateComplete",
206
+ "type": {
207
+ "text": "Promise<boolean>"
208
+ },
209
+ "privacy": "public"
210
+ },
211
+ {
212
+ "kind": "field",
213
+ "name": "__resolve",
214
+ "type": {
215
+ "text": "(compelted: boolean) => void"
216
+ },
217
+ "privacy": "private"
218
+ },
219
+ {
220
+ "kind": "method",
221
+ "name": "__createDeferredPromise",
222
+ "privacy": "private",
223
+ "return": {
224
+ "type": {
225
+ "text": "Promise<boolean>"
226
+ }
227
+ }
228
+ },
229
+ {
230
+ "kind": "method",
231
+ "name": "startManagingContentDirection",
232
+ "privacy": "public",
233
+ "return": {
234
+ "type": {
235
+ "text": "void"
236
+ }
237
+ },
238
+ "parameters": [
239
+ {
240
+ "name": "el",
241
+ "type": {
242
+ "text": "HTMLElement"
243
+ }
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "kind": "method",
249
+ "name": "stopManagingContentDirection",
250
+ "privacy": "public",
251
+ "return": {
252
+ "type": {
253
+ "text": "void"
254
+ }
255
+ },
256
+ "parameters": [
257
+ {
258
+ "name": "el",
259
+ "type": {
260
+ "text": "HTMLElement"
261
+ }
262
+ }
263
+ ]
264
+ },
265
+ {
266
+ "kind": "field",
267
+ "name": "trackedChildren",
268
+ "type": {
269
+ "text": "Set<HTMLElement>"
270
+ },
271
+ "privacy": "private",
272
+ "default": "new Set()"
273
+ },
274
+ {
275
+ "kind": "field",
276
+ "name": "_updateRequested",
277
+ "type": {
278
+ "text": "boolean"
279
+ },
280
+ "privacy": "private",
281
+ "default": "false"
282
+ },
283
+ {
284
+ "kind": "method",
285
+ "name": "shouldAdoptStyles",
286
+ "privacy": "private",
287
+ "return": {
288
+ "type": {
289
+ "text": "Promise<void>"
290
+ }
291
+ }
292
+ },
293
+ {
294
+ "kind": "method",
295
+ "name": "adoptStyles",
296
+ "privacy": "protected",
297
+ "return": {
298
+ "type": {
299
+ "text": "void"
300
+ }
301
+ }
302
+ },
303
+ {
304
+ "kind": "method",
305
+ "name": "registerThemeFragment",
306
+ "static": true,
307
+ "return": {
308
+ "type": {
309
+ "text": "void"
310
+ }
311
+ },
312
+ "parameters": [
313
+ {
314
+ "name": "name",
315
+ "type": {
316
+ "text": "FragmentName"
317
+ }
318
+ },
319
+ {
320
+ "name": "kind",
321
+ "type": {
322
+ "text": "FragmentType"
323
+ }
324
+ },
325
+ {
326
+ "name": "styles",
327
+ "type": {
328
+ "text": "CSSResultGroup"
329
+ }
330
+ }
331
+ ]
332
+ },
333
+ {
334
+ "kind": "field",
335
+ "name": "_contextConsumers",
336
+ "privacy": "private",
337
+ "default": "new Map<\n HTMLElement,\n [ProvideLang['callback'], () => void]\n >()"
338
+ },
339
+ {
340
+ "kind": "method",
341
+ "name": "_provideContext",
342
+ "privacy": "private",
343
+ "return": {
344
+ "type": {
345
+ "text": "void"
346
+ }
347
+ }
348
+ },
349
+ {
350
+ "kind": "method",
351
+ "name": "_provideSystemContext",
352
+ "privacy": "private",
353
+ "return": {
354
+ "type": {
355
+ "text": "void"
356
+ }
357
+ },
358
+ "description": "Provides the current system context to all registered consumers.\n\nThis method iterates over all registered system context consumers and invokes their callbacks,\npassing the current system variant and the unsubscribe function. This ensures that any component\nconsuming the system context receives the updated system variant when the `system` (or `theme`) attribute changes."
359
+ },
360
+ {
361
+ "kind": "method",
362
+ "name": "_handleContextPresence",
363
+ "privacy": "private",
364
+ "return": {
365
+ "type": {
366
+ "text": "void"
367
+ }
368
+ },
369
+ "parameters": [
370
+ {
371
+ "name": "event",
372
+ "type": {
373
+ "text": "CustomEvent<ProvideLang>"
374
+ }
375
+ }
376
+ ]
377
+ }
378
+ ],
379
+ "attributes": [
380
+ {
381
+ "name": "color",
382
+ "type": {
383
+ "text": "\"lightest\" | \"light\" | \"dark\" | \"darkest\" | \"\""
384
+ },
385
+ "description": "The Spectrum color stops to apply to content scoped by this `sp-theme` element.\n\nA value is requried.",
386
+ "fieldName": "color"
387
+ },
388
+ {
389
+ "name": "scale",
390
+ "type": {
391
+ "text": "\"medium\" | \"large\" | \"\""
392
+ },
393
+ "description": "The Spectrum platform scale to apply to content scoped by this `sp-theme` element.\n\nA value is requried.",
394
+ "fieldName": "scale"
395
+ },
396
+ {
397
+ "name": "lang",
398
+ "type": {
399
+ "text": "string"
400
+ },
401
+ "description": "The language of the content scoped to this `sp-theme` element, see: <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang\" target=\"_blank\">MDN reference</a>.",
402
+ "default": "\"\""
403
+ },
404
+ {
405
+ "name": "dir",
406
+ "type": {
407
+ "text": "\"ltr\" | \"rtl\" | \"\""
408
+ },
409
+ "description": "Reading direction of the content scoped to this `sp-theme` element.",
410
+ "fieldName": "dir"
411
+ },
412
+ {
413
+ "name": "system",
414
+ "type": {
415
+ "text": "\"spectrum\" | \"express\""
416
+ },
417
+ "description": "The Spectrum system that is applied to the content scoped to this `sp-theme` element.\n\nA value is requried.",
418
+ "fieldName": "system"
419
+ },
420
+ {
421
+ "name": "theme"
422
+ }
423
+ ],
424
+ "superclass": {
425
+ "name": "HTMLElement"
426
+ },
427
+ "tagName": "sp-theme",
428
+ "customElement": true
429
+ }
430
+ ],
431
+ "exports": [
432
+ {
433
+ "kind": "js",
434
+ "name": "ProvideLang",
435
+ "declaration": {
436
+ "name": "ProvideLang",
437
+ "module": "src/Theme.js"
438
+ }
439
+ },
440
+ {
441
+ "kind": "js",
442
+ "name": "ThemeFragmentMap",
443
+ "declaration": {
444
+ "name": "ThemeFragmentMap",
445
+ "module": "src/Theme.js"
446
+ }
447
+ },
448
+ {
449
+ "kind": "js",
450
+ "name": "Color",
451
+ "declaration": {
452
+ "name": "Color",
453
+ "module": "src/Theme.js"
454
+ }
455
+ },
456
+ {
457
+ "kind": "js",
458
+ "name": "Scale",
459
+ "declaration": {
460
+ "name": "Scale",
461
+ "module": "src/Theme.js"
462
+ }
463
+ },
464
+ {
465
+ "kind": "js",
466
+ "name": "SystemVariant",
467
+ "declaration": {
468
+ "name": "SystemVariant",
469
+ "module": "src/Theme.js"
470
+ }
471
+ },
472
+ {
473
+ "kind": "js",
474
+ "name": "Theme",
475
+ "declaration": {
476
+ "name": "Theme",
477
+ "module": "src/Theme.js"
478
+ }
479
+ }
480
+ ]
481
+ }
482
+ ]
483
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/theme",
3
- "version": "0.49.0-beta.1",
3
+ "version": "0.49.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -237,8 +237,8 @@
237
237
  "lit-html"
238
238
  ],
239
239
  "dependencies": {
240
- "@spectrum-web-components/base": "^0.49.0-beta.1",
241
- "@spectrum-web-components/styles": "^0.49.0-beta.1"
240
+ "@spectrum-web-components/base": "^0.49.0",
241
+ "@spectrum-web-components/styles": "^0.49.0"
242
242
  },
243
243
  "types": "./src/index.d.ts",
244
244
  "customElements": "custom-elements.json",
@@ -265,5 +265,5 @@
265
265
  "./src/spectrum-two/themes.js",
266
266
  "./src/spectrum-two/themes-*.js"
267
267
  ],
268
- "gitHead": "74ee2c5b1276e8e4f768566a1c3c4e263a7eb8b3"
268
+ "gitHead": "088e84caa1e2f723d735b011608ca0a3411e2149"
269
269
  }