@pie-players/pie-theme 0.3.61 → 0.3.62

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
@@ -95,6 +95,24 @@ Then activate with `scheme="district-high-contrast"` on `pie-theme`.
95
95
 
96
96
  Use `@pie-players/pie-theme/components.css` for shared visual styles that are intentionally reused across multiple PIE custom elements.
97
97
 
98
+ **Players install this stylesheet themselves; hosts do not import it.** Mounting
99
+ `<pie-theme>` does not load it either — that element only writes `--pie-*` custom
100
+ properties. `@pie-players/pie-item-player` bundles the stylesheet as text and
101
+ installs it once per document at import time; see
102
+ [content styles](../item-player/README.md#content-styles) for the host-ownership
103
+ opt-out.
104
+
105
+ Note for players adding this: a plain `import "…/components.css"` does **not**
106
+ work in these packages' library builds. Vite extracts it to an unreferenced
107
+ `dist/assets/*.css` that nothing loads and no exports entry exposes — a silent
108
+ no-op that left authored passage markup unstyled in production. Import the text
109
+ with `?raw` and hand it to `installContentStyles` from
110
+ `@pie-players/pie-players-shared`.
111
+
112
+ `components.css` declares `--pie-content-styles` on `:root` as a presence
113
+ sentinel so players can tell whether an opted-out host actually loaded it. It is
114
+ not a themeable value; do not consume it for styling.
115
+
98
116
  - Theme-owned shared `pie-*` class families include:
99
117
  - `pie-section-player-tools-pnp-debugger*`
100
118
  - `pie-section-player-tools-session-debugger*`
@@ -331,3 +331,276 @@
331
331
  --pie-blue-grey-600: #999999;
332
332
  --pie-blue-grey-900: #e0e0e0;
333
333
  }
334
+
335
+ /* Grey on Light Grey - Learnosity standard */
336
+ [data-color-scheme="grey-on-light-grey"] {
337
+ --pie-text: #4a4a4a;
338
+ --pie-disabled: #757575;
339
+ --pie-disabled-secondary: #8f8f8f;
340
+ --pie-correct: #145c1e;
341
+ --pie-correct-secondary: #dde9de;
342
+ --pie-correct-tertiary: #1a7526;
343
+ --pie-correct-icon: #0e3f15;
344
+ --pie-incorrect: #8c1c1c;
345
+ --pie-incorrect-secondary: #eddcdc;
346
+ --pie-incorrect-icon: #6f1616;
347
+ --pie-missing: #8c1c1c;
348
+ --pie-missing-icon: #33406b;
349
+ --pie-primary: #3d3d3d;
350
+ --pie-primary-light: #6f6f6f;
351
+ --pie-primary-dark: #2b2b2b;
352
+ --pie-faded-primary: #dcdcdc;
353
+ --pie-secondary: #4a4a4a;
354
+ --pie-secondary-light: #8f8f8f;
355
+ --pie-secondary-dark: #2b2b2b;
356
+ --pie-tertiary: #3d3d3d;
357
+ --pie-tertiary-light: #c4c4c4;
358
+ --pie-background: #ebebeb;
359
+ --pie-background-dark: #dcdcdc;
360
+ --pie-secondary-background: #d0d0d0;
361
+ --pie-dropdown-background: #c4c4c4;
362
+ --pie-border: #4a4a4a;
363
+ --pie-border-light: #7a7a7a;
364
+ --pie-border-dark: #2b2b2b;
365
+ --pie-border-gray: #6f6f6f;
366
+ --pie-black: #4a4a4a;
367
+ --pie-white: #ebebeb;
368
+ --pie-focus-checked: #6f6f6f;
369
+ --pie-focus-checked-border: #3d3d3d;
370
+ --pie-focus-unchecked: #e0e0e0;
371
+ --pie-focus-unchecked-border: #4a4a4a;
372
+ --pie-blue-grey-100: #f0f0f0;
373
+ --pie-blue-grey-300: #d0d0d0;
374
+ --pie-blue-grey-600: #6f6f6f;
375
+ --pie-blue-grey-900: #2b2b2b;
376
+ }
377
+
378
+ /* Purple on Light Green - Learnosity standard */
379
+ [data-color-scheme="purple-on-light-green"] {
380
+ --pie-text: #8e2464;
381
+ --pie-disabled: #5f7266;
382
+ --pie-disabled-secondary: #7c8f83;
383
+ --pie-correct: #14591f;
384
+ --pie-correct-secondary: #d8ecdc;
385
+ --pie-correct-tertiary: #1a7328;
386
+ --pie-correct-icon: #0e3d16;
387
+ --pie-incorrect: #8c1c1c;
388
+ --pie-incorrect-secondary: #f0dcdc;
389
+ --pie-incorrect-icon: #6f1616;
390
+ --pie-missing: #8c1c1c;
391
+ --pie-missing-icon: #33406b;
392
+ --pie-primary: #6d1a4c;
393
+ --pie-primary-light: #b3608e;
394
+ --pie-primary-dark: #4f1237;
395
+ --pie-faded-primary: #b8dcc3;
396
+ --pie-secondary: #a02b72;
397
+ --pie-secondary-light: #c76d9d;
398
+ --pie-secondary-dark: #6d1a4c;
399
+ --pie-tertiary: #8e2464;
400
+ --pie-tertiary-light: #e2c6d5;
401
+ --pie-background: #cce8d4;
402
+ --pie-background-dark: #b8dcc3;
403
+ --pie-secondary-background: #a6d0b2;
404
+ --pie-dropdown-background: #94c4a1;
405
+ --pie-border: #8e2464;
406
+ --pie-border-light: #a85a86;
407
+ --pie-border-dark: #4f1237;
408
+ --pie-border-gray: #5f7266;
409
+ --pie-black: #8e2464;
410
+ --pie-white: #cce8d4;
411
+ --pie-focus-checked: #8e2464;
412
+ --pie-focus-checked-border: #6d1a4c;
413
+ --pie-focus-unchecked: #dcefe2;
414
+ --pie-focus-unchecked-border: #8e2464;
415
+ --pie-blue-grey-100: #e2f2e7;
416
+ --pie-blue-grey-300: #a6d0b2;
417
+ --pie-blue-grey-600: #5f7266;
418
+ --pie-blue-grey-900: #4f1237;
419
+ }
420
+
421
+ /* Black on Violet - Learnosity standard */
422
+ [data-color-scheme="black-on-violet"] {
423
+ --pie-text: #000000;
424
+ --pie-disabled: #5c5c5c;
425
+ --pie-disabled-secondary: #7a7a7a;
426
+ --pie-correct: #0d4f16;
427
+ --pie-correct-secondary: #e0cfe6;
428
+ --pie-correct-tertiary: #0f4d17;
429
+ --pie-correct-icon: #093a0f;
430
+ --pie-incorrect: #7d1414;
431
+ --pie-incorrect-secondary: #eccfd0;
432
+ --pie-incorrect-icon: #5c0f0f;
433
+ --pie-missing: #7d1414;
434
+ --pie-missing-icon: #2b2b6b;
435
+ --pie-primary: #4a1259;
436
+ --pie-primary-light: #8e4fa1;
437
+ --pie-primary-dark: #330d3f;
438
+ --pie-faded-primary: #c795d3;
439
+ --pie-secondary: #6d1a7d;
440
+ --pie-secondary-light: #a95cb8;
441
+ --pie-secondary-dark: #4a1259;
442
+ --pie-tertiary: #4a1259;
443
+ --pie-tertiary-light: #e2cbe8;
444
+ --pie-background: #d4a9de;
445
+ --pie-background-dark: #c795d3;
446
+ --pie-secondary-background: #b982c8;
447
+ --pie-dropdown-background: #ac70bd;
448
+ --pie-border: #000000;
449
+ --pie-border-light: #4a4a4a;
450
+ --pie-border-dark: #000000;
451
+ --pie-border-gray: #4a4a4a;
452
+ --pie-black: #000000;
453
+ --pie-white: #d4a9de;
454
+ --pie-focus-checked: #4a1259;
455
+ --pie-focus-checked-border: #330d3f;
456
+ --pie-focus-unchecked: #e2cbe8;
457
+ --pie-focus-unchecked-border: #000000;
458
+ --pie-blue-grey-100: #ece0f0;
459
+ --pie-blue-grey-300: #c795d3;
460
+ --pie-blue-grey-600: #6d5c73;
461
+ --pie-blue-grey-900: #000000;
462
+ }
463
+
464
+ /* Yellow on Navy - Learnosity standard */
465
+ [data-color-scheme="yellow-on-navy"] {
466
+ --pie-text: #ffff55;
467
+ --pie-disabled: #9aa4bd;
468
+ --pie-disabled-secondary: #7d88a3;
469
+ --pie-correct: #7fe08a;
470
+ --pie-correct-secondary: #1d3a24;
471
+ --pie-correct-tertiary: #a0dda9;
472
+ --pie-correct-icon: #a8f0b0;
473
+ --pie-incorrect: #ffbebe;
474
+ --pie-incorrect-secondary: #3d1d1d;
475
+ --pie-incorrect-icon: #ffb3b3;
476
+ --pie-missing: #ffbebe;
477
+ --pie-missing-icon: #b3c2ff;
478
+ --pie-primary: #ffff99;
479
+ --pie-primary-light: #ffffc2;
480
+ --pie-primary-dark: #e0e04a;
481
+ --pie-faded-primary: #2b4576;
482
+ --pie-secondary: #ffd95c;
483
+ --pie-secondary-light: #ffeaa0;
484
+ --pie-secondary-dark: #e0bb3d;
485
+ --pie-tertiary: #ffff99;
486
+ --pie-tertiary-light: #ffffcc;
487
+ --pie-background: #33508a;
488
+ --pie-background-dark: #2b4576;
489
+ --pie-secondary-background: #243a63;
490
+ --pie-dropdown-background: #1d2f50;
491
+ --pie-border: #ffff55;
492
+ --pie-border-light: #c2c266;
493
+ --pie-border-dark: #e0e04a;
494
+ --pie-border-gray: #9aa4bd;
495
+ --pie-black: #ffff55;
496
+ --pie-white: #33508a;
497
+ --pie-focus-checked: #ffff55;
498
+ --pie-focus-checked-border: #e0e04a;
499
+ --pie-focus-unchecked: #243a63;
500
+ --pie-focus-unchecked-border: #ffff55;
501
+ --pie-blue-grey-100: #2b4576;
502
+ --pie-blue-grey-300: #4a6aa8;
503
+ --pie-blue-grey-600: #9aa4bd;
504
+ --pie-blue-grey-900: #ffff55;
505
+ }
506
+
507
+ /* The annotation toolbar's outline defaults to a contrast-checked grey pair of
508
+ * its own rather than --pie-border, because under the DaisyUI bridge that token
509
+ * carries a surface tint that leaves the outline at ~1.1:1. These two rules give
510
+ * the palettes that DO choose a boundary colour deliberately the last word.
511
+ *
512
+ * The dark theme is pinned because the component's light-dark() default follows
513
+ * the declared color-scheme, which pie-theme does not set; without this, a
514
+ * pie-theme dark page would take the light value. The pinned value is therefore
515
+ * the component's dark arm, #949494 -- the light grey. A boundary on a dark
516
+ * surface has to be lighter than it, so this is 6.92:1 on the dark palette's
517
+ * #000000 background, where the dark arm #5c5c5c would sit at 3.14:1 with no
518
+ * margin and drop to 2.37:1 on DaisyUI's dark base.
519
+ */
520
+ [data-theme="dark"],
521
+ pie-theme[theme="dark"] {
522
+ --pie-tool-annotation-toolbar-border: #949494;
523
+ }
524
+
525
+ /* Both annotation marks follow the palette's own colours, because every scheme
526
+ * above picks --pie-border and --pie-primary for maximum contrast against its own
527
+ * background. This must stay after the dark rule: the two selectors have equal
528
+ * specificity, and a scheme can be active on a dark page.
529
+ *
530
+ * The outline cannot fall back to the component greys here. Neither arm covers
531
+ * these palettes: the light arm #5c5c5c fails on yellow-on-blue (2.63:1),
532
+ * light-gray-on-dark-gray (1.89:1) and yellow-on-navy (1.18:1), while the dark arm
533
+ * #949494 fails on rose-on-green (2.71:1), black-on-rose (2.16:1),
534
+ * grey-on-light-grey (2.54:1), purple-on-light-green (2.32:1), black-on-violet
535
+ * (1.52:1) and yellow-on-navy (2.61:1). Several of these backgrounds are mid-tone,
536
+ * so no single grey clears 3:1 on them -- only the palette's own --pie-border does.
537
+ *
538
+ * The underline needs the same hand-off for a different reason. Its component
539
+ * default is keyed on [data-theme], which reports what the *page* declares, not
540
+ * which scheme is active -- so a host that declares itself light while running a
541
+ * dark scheme pins the light default (#4221d5) over a dark background. Both
542
+ * underline states get --pie-primary because within a scheme the background is
543
+ * fixed by the scheme, so one value is correct either way. --pie-primary clears
544
+ * 3:1 on all ten backgrounds, from 5.44:1 on light-gray-on-dark-gray to 19.56:1 on
545
+ * white-on-black.
546
+ *
547
+ * These same three tokens are declared per scheme in color-schemes.ts, so a host
548
+ * using <pie-theme scheme="..."> gets them as inline styles without importing this
549
+ * file. Keep the two in sync.
550
+ *
551
+ * The schemes are named rather than matched with [data-color-scheme], so an id
552
+ * with no block above cannot pull in the :root values, where --pie-border is
553
+ * #9a9a9a and misses 3:1 on white. Add a scheme here when adding one above.
554
+ */
555
+ [data-color-scheme="black-on-white"],
556
+ [data-color-scheme="white-on-black"],
557
+ [data-color-scheme="rose-on-green"],
558
+ [data-color-scheme="yellow-on-blue"],
559
+ [data-color-scheme="black-on-rose"],
560
+ [data-color-scheme="light-gray-on-dark-gray"],
561
+ [data-color-scheme="grey-on-light-grey"],
562
+ [data-color-scheme="purple-on-light-green"],
563
+ [data-color-scheme="black-on-violet"],
564
+ [data-color-scheme="yellow-on-navy"] {
565
+ --pie-tool-annotation-toolbar-border: var(--pie-border);
566
+ }
567
+
568
+ /* The underline keeps the component's own violet pair rather than following the
569
+ * palette accent: #4221d5 and #9c89ec clear 3:1 on nine of the ten backgrounds
570
+ * between them, so only the *selection* was ever wrong. Each scheme is given the
571
+ * arm that suits its own background, and both states get that one value because
572
+ * within a scheme the background is fixed regardless of what data-theme reports.
573
+ *
574
+ * Ratios, light arm / dark arm: black-on-white 8.71 / 2.92, rose-on-green
575
+ * 7.78 / 2.60, black-on-rose 6.20 / 2.07, grey-on-light-grey 7.31 / 2.45,
576
+ * purple-on-light-green 6.66 / 2.23, black-on-violet 4.37 / 1.46,
577
+ * white-on-black 2.41 / 7.20, yellow-on-blue 2.02 / 6.04,
578
+ * light-gray-on-dark-gray 1.45 / 4.33.
579
+ */
580
+ [data-color-scheme="black-on-white"],
581
+ [data-color-scheme="rose-on-green"],
582
+ [data-color-scheme="black-on-rose"],
583
+ [data-color-scheme="grey-on-light-grey"],
584
+ [data-color-scheme="purple-on-light-green"],
585
+ [data-color-scheme="black-on-violet"] {
586
+ --pie-annotation-underline: #4221d5;
587
+ --pie-annotation-underline-dark: #4221d5;
588
+ }
589
+
590
+ [data-color-scheme="white-on-black"],
591
+ [data-color-scheme="yellow-on-blue"],
592
+ [data-color-scheme="light-gray-on-dark-gray"] {
593
+ --pie-annotation-underline: #9c89ec;
594
+ --pie-annotation-underline-dark: #9c89ec;
595
+ }
596
+
597
+ /* yellow-on-navy is the one exception: its #33508a background is mid-tone, and
598
+ * neither arm reaches 3:1 on it (1.10 light, 2.71 dark). Only here does the
599
+ * underline defer to the palette's own accent, #ffff99 at 7.54:1 -- the same
600
+ * deference the outline makes to --pie-border above. This scheme arrived with the
601
+ * later Learnosity palettes, after the violet pair was chosen.
602
+ */
603
+ [data-color-scheme="yellow-on-navy"] {
604
+ --pie-annotation-underline: var(--pie-primary);
605
+ --pie-annotation-underline-dark: var(--pie-primary);
606
+ }
@@ -25,6 +25,9 @@ export const BUILTIN_PIE_COLOR_SCHEMES = [
25
25
  "--pie-border": "#000000",
26
26
  "--pie-border-light": "#666666",
27
27
  "--pie-border-dark": "#000000",
28
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
29
+ "--pie-annotation-underline": "#4221d5",
30
+ "--pie-annotation-underline-dark": "#4221d5",
28
31
  "--pie-button-bg": "#ffffff",
29
32
  "--pie-button-border": "#666666",
30
33
  "--pie-button-color": "#000000",
@@ -56,6 +59,9 @@ export const BUILTIN_PIE_COLOR_SCHEMES = [
56
59
  "--pie-border": "#ffffff",
57
60
  "--pie-border-light": "#cccccc",
58
61
  "--pie-border-dark": "#ffffff",
62
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
63
+ "--pie-annotation-underline": "#9c89ec",
64
+ "--pie-annotation-underline-dark": "#9c89ec",
59
65
  "--pie-button-bg": "#000000",
60
66
  "--pie-button-border": "#cccccc",
61
67
  "--pie-button-color": "#ffffff",
@@ -87,6 +93,9 @@ export const BUILTIN_PIE_COLOR_SCHEMES = [
87
93
  "--pie-border": "#3d0022",
88
94
  "--pie-border-light": "#663344",
89
95
  "--pie-border-dark": "#220011",
96
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
97
+ "--pie-annotation-underline": "#4221d5",
98
+ "--pie-annotation-underline-dark": "#4221d5",
90
99
  "--pie-button-bg": "#ccffcc",
91
100
  "--pie-button-border": "#663344",
92
101
  "--pie-button-color": "#3d0022",
@@ -118,6 +127,9 @@ export const BUILTIN_PIE_COLOR_SCHEMES = [
118
127
  "--pie-border": "#ffff00",
119
128
  "--pie-border-light": "#aaaa66",
120
129
  "--pie-border-dark": "#cccc00",
130
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
131
+ "--pie-annotation-underline": "#9c89ec",
132
+ "--pie-annotation-underline-dark": "#9c89ec",
121
133
  "--pie-button-bg": "#000066",
122
134
  "--pie-button-border": "#aaaa66",
123
135
  "--pie-button-color": "#ffff00",
@@ -149,6 +161,9 @@ export const BUILTIN_PIE_COLOR_SCHEMES = [
149
161
  "--pie-border": "#000000",
150
162
  "--pie-border-light": "#555555",
151
163
  "--pie-border-dark": "#000000",
164
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
165
+ "--pie-annotation-underline": "#4221d5",
166
+ "--pie-annotation-underline-dark": "#4221d5",
152
167
  "--pie-button-bg": "#ffccdd",
153
168
  "--pie-button-border": "#555555",
154
169
  "--pie-button-color": "#000000",
@@ -180,6 +195,9 @@ export const BUILTIN_PIE_COLOR_SCHEMES = [
180
195
  "--pie-border": "#e0e0e0",
181
196
  "--pie-border-light": "#cccccc",
182
197
  "--pie-border-dark": "#ffffff",
198
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
199
+ "--pie-annotation-underline": "#9c89ec",
200
+ "--pie-annotation-underline-dark": "#9c89ec",
183
201
  "--pie-button-bg": "#333333",
184
202
  "--pie-button-border": "#cccccc",
185
203
  "--pie-button-color": "#e0e0e0",
@@ -193,6 +211,142 @@ export const BUILTIN_PIE_COLOR_SCHEMES = [
193
211
  },
194
212
  preview: { bg: "#333333", text: "#e0e0e0", primary: "#aaaaaa" },
195
213
  },
214
+ {
215
+ id: "grey-on-light-grey",
216
+ name: "Grey on Light Grey",
217
+ description: "Low-glare neutral palette",
218
+ variables: {
219
+ "--pie-background": "#ebebeb",
220
+ "--pie-background-dark": "#dcdcdc",
221
+ "--pie-secondary-background": "#d0d0d0",
222
+ "--pie-dropdown-background": "#c4c4c4",
223
+ "--pie-text": "#4a4a4a",
224
+ "--pie-white": "#ebebeb",
225
+ "--pie-black": "#4a4a4a",
226
+ "--pie-primary": "#3d3d3d",
227
+ "--pie-primary-light": "#6f6f6f",
228
+ "--pie-primary-dark": "#2b2b2b",
229
+ "--pie-border": "#4a4a4a",
230
+ "--pie-border-light": "#7a7a7a",
231
+ "--pie-border-dark": "#2b2b2b",
232
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
233
+ "--pie-annotation-underline": "#4221d5",
234
+ "--pie-annotation-underline-dark": "#4221d5",
235
+ "--pie-button-bg": "#ebebeb",
236
+ "--pie-button-border": "#7a7a7a",
237
+ "--pie-button-color": "#4a4a4a",
238
+ "--pie-button-hover-bg": "#dcdcdc",
239
+ "--pie-button-hover-border": "#4a4a4a",
240
+ "--pie-button-hover-color": "#4a4a4a",
241
+ "--pie-button-active-bg": "#d0d0d0",
242
+ "--pie-button-focus-outline": "#3d3d3d",
243
+ "--pie-focus-checked": "#6f6f6f",
244
+ "--pie-focus-checked-border": "#3d3d3d",
245
+ },
246
+ preview: { bg: "#ebebeb", text: "#4a4a4a", primary: "#3d3d3d" },
247
+ },
248
+ {
249
+ id: "purple-on-light-green",
250
+ name: "Purple on Light Green",
251
+ description: "Color blind friendly, low-glare background",
252
+ variables: {
253
+ "--pie-background": "#cce8d4",
254
+ "--pie-background-dark": "#b8dcc3",
255
+ "--pie-secondary-background": "#a6d0b2",
256
+ "--pie-dropdown-background": "#94c4a1",
257
+ "--pie-text": "#8e2464",
258
+ "--pie-white": "#cce8d4",
259
+ "--pie-black": "#8e2464",
260
+ "--pie-primary": "#6d1a4c",
261
+ "--pie-primary-light": "#b3608e",
262
+ "--pie-primary-dark": "#4f1237",
263
+ "--pie-border": "#8e2464",
264
+ "--pie-border-light": "#a85a86",
265
+ "--pie-border-dark": "#4f1237",
266
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
267
+ "--pie-annotation-underline": "#4221d5",
268
+ "--pie-annotation-underline-dark": "#4221d5",
269
+ "--pie-button-bg": "#cce8d4",
270
+ "--pie-button-border": "#a85a86",
271
+ "--pie-button-color": "#8e2464",
272
+ "--pie-button-hover-bg": "#b8dcc3",
273
+ "--pie-button-hover-border": "#8e2464",
274
+ "--pie-button-hover-color": "#8e2464",
275
+ "--pie-button-active-bg": "#a6d0b2",
276
+ "--pie-button-focus-outline": "#6d1a4c",
277
+ "--pie-focus-checked": "#8e2464",
278
+ "--pie-focus-checked-border": "#6d1a4c",
279
+ },
280
+ preview: { bg: "#cce8d4", text: "#8e2464", primary: "#6d1a4c" },
281
+ },
282
+ {
283
+ id: "black-on-violet",
284
+ name: "Black on Violet",
285
+ description: "Cool tinted background",
286
+ variables: {
287
+ "--pie-background": "#d4a9de",
288
+ "--pie-background-dark": "#c795d3",
289
+ "--pie-secondary-background": "#b982c8",
290
+ "--pie-dropdown-background": "#ac70bd",
291
+ "--pie-text": "#000000",
292
+ "--pie-white": "#d4a9de",
293
+ "--pie-black": "#000000",
294
+ "--pie-primary": "#4a1259",
295
+ "--pie-primary-light": "#8e4fa1",
296
+ "--pie-primary-dark": "#330d3f",
297
+ "--pie-border": "#000000",
298
+ "--pie-border-light": "#4a4a4a",
299
+ "--pie-border-dark": "#000000",
300
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
301
+ "--pie-annotation-underline": "#4221d5",
302
+ "--pie-annotation-underline-dark": "#4221d5",
303
+ "--pie-button-bg": "#d4a9de",
304
+ "--pie-button-border": "#4a4a4a",
305
+ "--pie-button-color": "#000000",
306
+ "--pie-button-hover-bg": "#c795d3",
307
+ "--pie-button-hover-border": "#000000",
308
+ "--pie-button-hover-color": "#000000",
309
+ "--pie-button-active-bg": "#b982c8",
310
+ "--pie-button-focus-outline": "#4a1259",
311
+ "--pie-focus-checked": "#4a1259",
312
+ "--pie-focus-checked-border": "#330d3f",
313
+ },
314
+ preview: { bg: "#d4a9de", text: "#000000", primary: "#4a1259" },
315
+ },
316
+ {
317
+ id: "yellow-on-navy",
318
+ name: "Yellow on Navy",
319
+ description: "Strong contrast on a softened dark blue",
320
+ variables: {
321
+ "--pie-background": "#33508a",
322
+ "--pie-background-dark": "#2b4576",
323
+ "--pie-secondary-background": "#243a63",
324
+ "--pie-dropdown-background": "#1d2f50",
325
+ "--pie-text": "#ffff55",
326
+ "--pie-white": "#33508a",
327
+ "--pie-black": "#ffff55",
328
+ "--pie-primary": "#ffff99",
329
+ "--pie-primary-light": "#ffffc2",
330
+ "--pie-primary-dark": "#e0e04a",
331
+ "--pie-border": "#ffff55",
332
+ "--pie-border-light": "#c2c266",
333
+ "--pie-border-dark": "#e0e04a",
334
+ "--pie-tool-annotation-toolbar-border": "var(--pie-border)",
335
+ "--pie-annotation-underline": "var(--pie-primary)",
336
+ "--pie-annotation-underline-dark": "var(--pie-primary)",
337
+ "--pie-button-bg": "#33508a",
338
+ "--pie-button-border": "#c2c266",
339
+ "--pie-button-color": "#ffff55",
340
+ "--pie-button-hover-bg": "#2b4576",
341
+ "--pie-button-hover-border": "#ffff55",
342
+ "--pie-button-hover-color": "#ffff55",
343
+ "--pie-button-active-bg": "#243a63",
344
+ "--pie-button-focus-outline": "#ffff99",
345
+ "--pie-focus-checked": "#ffff55",
346
+ "--pie-focus-checked-border": "#e0e04a",
347
+ },
348
+ preview: { bg: "#33508a", text: "#ffff55", primary: "#ffff99" },
349
+ },
196
350
  ];
197
351
  const builtInSchemeMap = new Map(BUILTIN_PIE_COLOR_SCHEMES.map((scheme) => [scheme.id, scheme]));
198
352
  const customSchemeMap = new Map();
@@ -245,4 +399,3 @@ export function unregisterPieColorScheme(schemeId) {
245
399
  }
246
400
  customSchemeMap.delete(schemeId);
247
401
  }
248
- //# sourceMappingURL=color-schemes.js.map
@@ -232,6 +232,15 @@ span.passage-title:after {
232
232
  font-style: italic;
233
233
  }
234
234
 
235
+ /*
236
+ * Presence sentinel. Players install this stylesheet themselves and read this
237
+ * property to detect whether a host that opted out of installation shipped a
238
+ * copy of its own. Not a themeable value — do not consume it for styling.
239
+ */
240
+ :root {
241
+ --pie-content-styles: 1;
242
+ }
243
+
235
244
  /* PASSAGES */
236
245
 
237
246
  div.passage-title,
@@ -682,209 +691,6 @@ table {
682
691
  border-bottom: 1px solid #d3d3d3;
683
692
  }
684
693
 
685
- /* SECTION PLAYER DEBUGGER OVERLAYS */
686
-
687
- .pie-section-player-tools-pnp-debugger,
688
- .pie-section-player-tools-session-debugger {
689
- position: fixed;
690
- z-index: 100;
691
- overflow: hidden;
692
- background: var(--pie-white, #fff);
693
- border-radius: 0.5rem;
694
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
695
- border: 2px solid var(--pie-border-light, #d1d5db);
696
- color: var(--pie-text, #111827);
697
- }
698
-
699
- .pie-section-player-tools-pnp-debugger {
700
- display: flex;
701
- flex-direction: column;
702
- }
703
-
704
- .pie-section-player-tools-pnp-debugger__header,
705
- .pie-section-player-tools-session-debugger__header {
706
- display: flex;
707
- align-items: center;
708
- justify-content: space-between;
709
- padding: 0.5rem 1rem;
710
- background: var(--pie-secondary-background, #f3f4f6);
711
- border-bottom: 1px solid var(--pie-border-light, #d1d5db);
712
- cursor: move;
713
- user-select: none;
714
- }
715
-
716
- .pie-section-player-tools-pnp-debugger__header-title,
717
- .pie-section-player-tools-session-debugger__header-title {
718
- display: flex;
719
- align-items: center;
720
- gap: 0.5rem;
721
- }
722
-
723
- .pie-section-player-tools-pnp-debugger__title,
724
- .pie-section-player-tools-session-debugger__title {
725
- margin: 0;
726
- font-size: 0.875rem;
727
- font-weight: 700;
728
- }
729
-
730
- .pie-section-player-tools-pnp-debugger__header-actions,
731
- .pie-section-player-tools-session-debugger__header-actions {
732
- display: flex;
733
- gap: 0.25rem;
734
- }
735
-
736
- .pie-section-player-tools-pnp-debugger__icon-button,
737
- .pie-section-player-tools-session-debugger__icon-button {
738
- width: 1.5rem;
739
- height: 1.5rem;
740
- display: inline-flex;
741
- align-items: center;
742
- justify-content: center;
743
- border: none;
744
- border-radius: 9999px;
745
- background: transparent;
746
- color: inherit;
747
- cursor: pointer;
748
- }
749
-
750
- .pie-section-player-tools-pnp-debugger__icon-button:hover,
751
- .pie-section-player-tools-session-debugger__icon-button:hover {
752
- background: rgba(17, 24, 39, 0.08);
753
- }
754
-
755
- .pie-section-player-tools-pnp-debugger__icon-button:focus-visible,
756
- .pie-section-player-tools-session-debugger__icon-button:focus-visible {
757
- outline: 2px solid var(--pie-focus-checked-border, #1976d2);
758
- outline-offset: 1px;
759
- }
760
-
761
- .pie-section-player-tools-pnp-debugger__icon-sm,
762
- .pie-section-player-tools-session-debugger__icon-sm {
763
- width: 1rem;
764
- height: 1rem;
765
- }
766
-
767
- .pie-section-player-tools-pnp-debugger__icon-xs,
768
- .pie-section-player-tools-session-debugger__icon-xs {
769
- width: 0.75rem;
770
- height: 0.75rem;
771
- }
772
-
773
- .pie-section-player-tools-session-debugger__icon-md {
774
- width: 1.25rem;
775
- height: 1.25rem;
776
- flex-shrink: 0;
777
- }
778
-
779
- .pie-section-player-tools-pnp-debugger__content-shell,
780
- .pie-section-player-tools-session-debugger__content-shell {
781
- padding: 1rem;
782
- display: flex;
783
- flex-direction: column;
784
- min-height: 0;
785
- overflow: hidden;
786
- }
787
-
788
- .pie-section-player-tools-pnp-debugger__content,
789
- .pie-section-player-tools-session-debugger__content {
790
- display: flex;
791
- flex-direction: column;
792
- gap: 0.75rem;
793
- flex: 1;
794
- min-height: 0;
795
- }
796
-
797
- .pie-section-player-tools-pnp-debugger__card,
798
- .pie-section-player-tools-session-debugger__card {
799
- background: var(--pie-secondary-background, #f3f4f6);
800
- border-radius: 0.375rem;
801
- padding: 0.75rem;
802
- }
803
-
804
- .pie-section-player-tools-pnp-debugger__card-title,
805
- .pie-section-player-tools-session-debugger__card-title {
806
- font-size: 0.75rem;
807
- font-weight: 600;
808
- margin-bottom: 0.5rem;
809
- }
810
-
811
- .pie-section-player-tools-pnp-debugger__card-pre,
812
- .pie-section-player-tools-session-debugger__card-pre {
813
- background: var(--pie-background-dark, #e5e7eb);
814
- padding: 0.5rem;
815
- border-radius: 0.375rem;
816
- font-size: 0.75rem;
817
- margin: 0;
818
- }
819
-
820
- .pie-section-player-tools-pnp-debugger__card-pre {
821
- overflow-x: auto;
822
- }
823
-
824
- .pie-section-player-tools-session-debugger__card {
825
- display: flex;
826
- flex-direction: column;
827
- flex: 1;
828
- min-height: 0;
829
- }
830
-
831
- .pie-section-player-tools-session-debugger__card-pre {
832
- overflow: auto;
833
- flex: 1;
834
- min-height: 0;
835
- }
836
-
837
- .pie-section-player-tools-session-debugger__section-intro {
838
- margin-bottom: 0.25rem;
839
- }
840
-
841
- .pie-section-player-tools-session-debugger__heading {
842
- font-size: 0.875rem;
843
- font-weight: 700;
844
- }
845
-
846
- .pie-section-player-tools-session-debugger__text-xs {
847
- font-size: 0.75rem;
848
- }
849
-
850
- .pie-section-player-tools-session-debugger__alert {
851
- display: flex;
852
- align-items: center;
853
- gap: 0.5rem;
854
- padding: 0.5rem 0.75rem;
855
- border-radius: 0.375rem;
856
- border: 1px solid transparent;
857
- }
858
-
859
- .pie-section-player-tools-session-debugger__alert--warning {
860
- background: #fef3c7;
861
- border-color: #f59e0b;
862
- color: #92400e;
863
- }
864
-
865
- .pie-section-player-tools-session-debugger__alert--info {
866
- background: #e0f2fe;
867
- border-color: #38bdf8;
868
- color: #0c4a6e;
869
- }
870
-
871
- .pie-section-player-tools-pnp-debugger__resize-handle,
872
- .pie-section-player-tools-session-debugger__resize-handle {
873
- position: absolute;
874
- bottom: 0;
875
- right: 0;
876
- width: 1rem;
877
- height: 1rem;
878
- cursor: se-resize;
879
- }
880
-
881
- .pie-section-player-tools-pnp-debugger__resize-icon,
882
- .pie-section-player-tools-session-debugger__resize-icon {
883
- width: 100%;
884
- height: 100%;
885
- color: color-mix(in srgb, var(--pie-text, #111827) 30%, transparent);
886
- }
887
-
888
694
  /* ANSWER ELIMINATOR */
889
695
 
890
696
  .pie-answer-eliminator-toggle {
package/dist/index.js CHANGED
@@ -5,4 +5,3 @@ export { isThemeMode, isThemeScope, normalizePieThemeVariables, } from "./theme-
5
5
  export { DARK_THEME_VARS, LIGHT_THEME_VARS } from "./theme-defaults.js";
6
6
  export { BUILTIN_PIE_COLOR_SCHEMES, getPieColorScheme, listPieColorSchemes, registerPieColorSchemes, resolvePieColorSchemeVariables, unregisterPieColorScheme, } from "./color-schemes.js";
7
7
  definePieTheme();
8
- //# sourceMappingURL=index.js.map
package/dist/providers.js CHANGED
@@ -160,4 +160,3 @@ export function resolveProviderVariables(args) {
160
160
  }
161
161
  return {};
162
162
  }
163
- //# sourceMappingURL=providers.js.map
@@ -98,4 +98,3 @@ export const DARK_THEME_VARS = {
98
98
  "--pie-button-active-bg": "#4b5563",
99
99
  "--pie-button-focus-outline": "#93c5fd",
100
100
  };
101
- //# sourceMappingURL=theme-defaults.js.map
@@ -200,4 +200,3 @@ export function definePieTheme(tagName = "pie-theme") {
200
200
  }
201
201
  defineThemeElementSafely(tagName, PieThemeElement);
202
202
  }
203
- //# sourceMappingURL=theme-element.js.map
@@ -25,4 +25,3 @@ export function normalizePieThemeVariables(value) {
25
25
  }
26
26
  return output;
27
27
  }
28
- //# sourceMappingURL=theme-types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-theme",
3
- "version": "0.3.61",
3
+ "version": "0.3.62",
4
4
  "type": "module",
5
5
  "description": "Shared PIE theme tokens, css variables, and theme custom element",
6
6
  "license": "MIT",
@@ -40,10 +40,10 @@
40
40
  "typecheck": "tsc -p tsconfig.json --noEmit",
41
41
  "lint": "biome check .",
42
42
  "check": "tsc -p tsconfig.json --noEmit",
43
- "test": "bun test --dom src"
43
+ "test": "bun test --dom tests"
44
44
  },
45
45
  "devDependencies": {
46
- "@biomejs/biome": "^2.4.12",
46
+ "@biomejs/biome": "^2.5.6",
47
47
  "typescript": "^5.9.3"
48
48
  },
49
49
  "homepage": "https://github.com/pie-framework/pie-players/tree/master/packages/theme#readme",
@@ -1 +0,0 @@
1
- {"version":3,"file":"color-schemes.js","sourceRoot":"","sources":["../src/color-schemes.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,0BAA0B,GAE1B,MAAM,kBAAkB,CAAC;AAgB1B,MAAM,CAAC,MAAM,yBAAyB,GAA+B;IACpE;QACC,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,qBAAqB;QAClC,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;KAC/D;IACD;QACC,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,+BAA+B;QAC5C,SAAS,EAAE;YACV,kBAAkB,EAAE,SAAS;YAC7B,uBAAuB,EAAE,SAAS;YAClC,4BAA4B,EAAE,SAAS;YACvC,2BAA2B,EAAE,SAAS;YACtC,YAAY,EAAE,SAAS;YACvB,aAAa,EAAE,SAAS;YACxB,a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AE,CAAC;QACjC,MAAM,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,SAAS;QACV,CAAC;QACD,IAAI,CAAC,SAAS,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YAClD,SAAS;QACV,CAAC;QACD,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;AACF,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACxD,IAAI,CAAC,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO;IACR,CAAC;IACD,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import {\n\tnormalizePieThemeVariables,\n\ttype ThemeVariables,\n} from \"./theme-types.js\";\n\nexport type PieColorSchemePreview = {\n\tbg: string;\n\ttext: string;\n\tprimary: string;\n};\n\nexport type PieColorSchemeDefinition = {\n\tid: string;\n\tname: string;\n\tdescription?: string;\n\tvariables: ThemeVariables;\n\tpreview?: PieColorSchemePreview;\n};\n\nexport const BUILTIN_PIE_COLOR_SCHEMES: PieColorSchemeDefinition[] = [\n\t{\n\t\tid: \"default\",\n\t\tname: \"Default\",\n\t\tdescription: \"Standard PIE colors\",\n\t\tvariables: {},\n\t\tpreview: { bg: \"#ffffff\", text: \"#000000\", primary: \"#3f51b5\" },\n\t},\n\t{\n\t\tid: \"black-on-white\",\n\t\tname: \"Black on White\",\n\t\tdescription: \"High contrast for readability\",\n\t\tvariables: {\n\t\t\t\"--pie-background\": \"#ffffff\",\n\t\t\t\"--pie-background-dark\": \"#f5f5f5\",\n\t\t\t\"--pie-secondary-background\": \"#eeeeee\",\n\t\t\t\"--pie-dropdown-background\": \"#e0e0e0\",\n\t\t\t\"--pie-text\": \"#000000\",\n\t\t\t\"--pie-white\": \"#ffffff\",\n\t\t\t\"--pie-black\": \"#000000\",\n\t\t\t\"--pie-primary\": \"#0000cc\",\n\t\t\t\"--pie-primary-light\": \"#6666ff\",\n\t\t\t\"--pie-primary-dark\": \"#000088\",\n\t\t\t\"--pie-border\": \"#000000\",\n\t\t\t\"--pie-border-light\": \"#666666\",\n\t\t\t\"--pie-border-dark\": \"#000000\",\n\t\t\t\"--pie-button-bg\": \"#ffffff\",\n\t\t\t\"--pie-button-border\": \"#666666\",\n\t\t\t\"--pie-button-color\": \"#000000\",\n\t\t\t\"--pie-button-hover-bg\": \"#f5f5f5\",\n\t\t\t\"--pie-button-hover-border\": \"#000000\",\n\t\t\t\"--pie-button-hover-color\": \"#000000\",\n\t\t\t\"--pie-button-active-bg\": \"#eeeeee\",\n\t\t\t\"--pie-button-focus-outline\": \"#0000cc\",\n\t\t\t\"--pie-focus-checked\": \"#0066ff\",\n\t\t\t\"--pie-focus-checked-border\": \"#0000cc\",\n\t\t},\n\t\tpreview: { bg: \"#ffffff\", text: \"#000000\", primary: \"#0000cc\" },\n\t},\n\t{\n\t\tid: \"white-on-black\",\n\t\tname: \"White on Black\",\n\t\tdescription: \"Inverse high contrast\",\n\t\tvariables: {\n\t\t\t\"--pie-background\": \"#000000\",\n\t\t\t\"--pie-background-dark\": \"#1a1a1a\",\n\t\t\t\"--pie-secondary-background\": \"#222222\",\n\t\t\t\"--pie-dropdown-background\": \"#2a2a2a\",\n\t\t\t\"--pie-text\": \"#ffffff\",\n\t\t\t\"--pie-white\": \"#000000\",\n\t\t\t\"--pie-black\": \"#ffffff\",\n\t\t\t\"--pie-primary\": \"#ffff00\",\n\t\t\t\"--pie-primary-light\": \"#ffff99\",\n\t\t\t\"--pie-primary-dark\": \"#cccc00\",\n\t\t\t\"--pie-border\": \"#ffffff\",\n\t\t\t\"--pie-border-light\": \"#cccccc\",\n\t\t\t\"--pie-border-dark\": \"#ffffff\",\n\t\t\t\"--pie-button-bg\": \"#000000\",\n\t\t\t\"--pie-button-border\": \"#cccccc\",\n\t\t\t\"--pie-button-color\": \"#ffffff\",\n\t\t\t\"--pie-button-hover-bg\": \"#1a1a1a\",\n\t\t\t\"--pie-button-hover-border\": \"#ffffff\",\n\t\t\t\"--pie-button-hover-color\": \"#ffffff\",\n\t\t\t\"--pie-button-active-bg\": \"#222222\",\n\t\t\t\"--pie-button-focus-outline\": \"#ffff00\",\n\t\t\t\"--pie-focus-checked\": \"#ffff00\",\n\t\t\t\"--pie-focus-checked-border\": \"#ffff00\",\n\t\t},\n\t\tpreview: { bg: \"#000000\", text: \"#ffffff\", primary: \"#ffff00\" },\n\t},\n\t{\n\t\tid: \"rose-on-green\",\n\t\tname: \"Rose on Green\",\n\t\tdescription: \"Color blind friendly (protanopia/deuteranopia)\",\n\t\tvariables: {\n\t\t\t\"--pie-background\": \"#ccffcc\",\n\t\t\t\"--pie-background-dark\": \"#aaeedd\",\n\t\t\t\"--pie-secondary-background\": \"#99ddbb\",\n\t\t\t\"--pie-dropdown-background\": \"#88cc99\",\n\t\t\t\"--pie-text\": \"#3d0022\",\n\t\t\t\"--pie-white\": \"#ccffcc\",\n\t\t\t\"--pie-black\": \"#3d0022\",\n\t\t\t\"--pie-primary\": \"#660044\",\n\t\t\t\"--pie-primary-light\": \"#cc6699\",\n\t\t\t\"--pie-primary-dark\": \"#440033\",\n\t\t\t\"--pie-border\": \"#3d0022\",\n\t\t\t\"--pie-border-light\": \"#663344\",\n\t\t\t\"--pie-border-dark\": \"#220011\",\n\t\t\t\"--pie-button-bg\": \"#ccffcc\",\n\t\t\t\"--pie-button-border\": \"#663344\",\n\t\t\t\"--pie-button-color\": \"#3d0022\",\n\t\t\t\"--pie-button-hover-bg\": \"#aaeedd\",\n\t\t\t\"--pie-button-hover-border\": \"#3d0022\",\n\t\t\t\"--pie-button-hover-color\": \"#3d0022\",\n\t\t\t\"--pie-button-active-bg\": \"#99ddbb\",\n\t\t\t\"--pie-button-focus-outline\": \"#660044\",\n\t\t\t\"--pie-focus-checked\": \"#880055\",\n\t\t\t\"--pie-focus-checked-border\": \"#660044\",\n\t\t},\n\t\tpreview: { bg: \"#ccffcc\", text: \"#3d0022\", primary: \"#660044\" },\n\t},\n\t{\n\t\tid: \"yellow-on-blue\",\n\t\tname: \"Yellow on Blue\",\n\t\tdescription: \"Strong contrast scheme\",\n\t\tvariables: {\n\t\t\t\"--pie-background\": \"#000066\",\n\t\t\t\"--pie-background-dark\": \"#000055\",\n\t\t\t\"--pie-secondary-background\": \"#000044\",\n\t\t\t\"--pie-dropdown-background\": \"#000033\",\n\t\t\t\"--pie-text\": \"#ffff00\",\n\t\t\t\"--pie-white\": \"#000066\",\n\t\t\t\"--pie-black\": \"#ffff00\",\n\t\t\t\"--pie-primary\": \"#ffff66\",\n\t\t\t\"--pie-primary-light\": \"#ffffaa\",\n\t\t\t\"--pie-primary-dark\": \"#cccc00\",\n\t\t\t\"--pie-border\": \"#ffff00\",\n\t\t\t\"--pie-border-light\": \"#aaaa66\",\n\t\t\t\"--pie-border-dark\": \"#cccc00\",\n\t\t\t\"--pie-button-bg\": \"#000066\",\n\t\t\t\"--pie-button-border\": \"#aaaa66\",\n\t\t\t\"--pie-button-color\": \"#ffff00\",\n\t\t\t\"--pie-button-hover-bg\": \"#000055\",\n\t\t\t\"--pie-button-hover-border\": \"#ffff00\",\n\t\t\t\"--pie-button-hover-color\": \"#ffff00\",\n\t\t\t\"--pie-button-active-bg\": \"#000044\",\n\t\t\t\"--pie-button-focus-outline\": \"#ffff66\",\n\t\t\t\"--pie-focus-checked\": \"#ffff00\",\n\t\t\t\"--pie-focus-checked-border\": \"#cccc00\",\n\t\t},\n\t\tpreview: { bg: \"#000066\", text: \"#ffff00\", primary: \"#ffff66\" },\n\t},\n\t{\n\t\tid: \"black-on-rose\",\n\t\tname: \"Black on Rose\",\n\t\tdescription: \"Warm tinted background\",\n\t\tvariables: {\n\t\t\t\"--pie-background\": \"#ffccdd\",\n\t\t\t\"--pie-background-dark\": \"#ffb3cc\",\n\t\t\t\"--pie-secondary-background\": \"#ff99bb\",\n\t\t\t\"--pie-dropdown-background\": \"#ff88aa\",\n\t\t\t\"--pie-text\": \"#000000\",\n\t\t\t\"--pie-white\": \"#ffccdd\",\n\t\t\t\"--pie-black\": \"#000000\",\n\t\t\t\"--pie-primary\": \"#880044\",\n\t\t\t\"--pie-primary-light\": \"#dd6699\",\n\t\t\t\"--pie-primary-dark\": \"#550033\",\n\t\t\t\"--pie-border\": \"#000000\",\n\t\t\t\"--pie-border-light\": \"#555555\",\n\t\t\t\"--pie-border-dark\": \"#000000\",\n\t\t\t\"--pie-button-bg\": \"#ffccdd\",\n\t\t\t\"--pie-button-border\": \"#555555\",\n\t\t\t\"--pie-button-color\": \"#000000\",\n\t\t\t\"--pie-button-hover-bg\": \"#ffb3cc\",\n\t\t\t\"--pie-button-hover-border\": \"#000000\",\n\t\t\t\"--pie-button-hover-color\": \"#000000\",\n\t\t\t\"--pie-button-active-bg\": \"#ff99bb\",\n\t\t\t\"--pie-button-focus-outline\": \"#880044\",\n\t\t\t\"--pie-focus-checked\": \"#880044\",\n\t\t\t\"--pie-focus-checked-border\": \"#550033\",\n\t\t},\n\t\tpreview: { bg: \"#ffccdd\", text: \"#000000\", primary: \"#880044\" },\n\t},\n\t{\n\t\tid: \"light-gray-on-dark-gray\",\n\t\tname: \"Light Gray on Dark Gray\",\n\t\tdescription: \"Reduced brightness for light sensitivity\",\n\t\tvariables: {\n\t\t\t\"--pie-background\": \"#333333\",\n\t\t\t\"--pie-background-dark\": \"#2a2a2a\",\n\t\t\t\"--pie-secondary-background\": \"#222222\",\n\t\t\t\"--pie-dropdown-background\": \"#1a1a1a\",\n\t\t\t\"--pie-text\": \"#e0e0e0\",\n\t\t\t\"--pie-white\": \"#333333\",\n\t\t\t\"--pie-black\": \"#e0e0e0\",\n\t\t\t\"--pie-primary\": \"#aaaaaa\",\n\t\t\t\"--pie-primary-light\": \"#cccccc\",\n\t\t\t\"--pie-primary-dark\": \"#888888\",\n\t\t\t\"--pie-border\": \"#e0e0e0\",\n\t\t\t\"--pie-border-light\": \"#cccccc\",\n\t\t\t\"--pie-border-dark\": \"#ffffff\",\n\t\t\t\"--pie-button-bg\": \"#333333\",\n\t\t\t\"--pie-button-border\": \"#cccccc\",\n\t\t\t\"--pie-button-color\": \"#e0e0e0\",\n\t\t\t\"--pie-button-hover-bg\": \"#2a2a2a\",\n\t\t\t\"--pie-button-hover-border\": \"#ffffff\",\n\t\t\t\"--pie-button-hover-color\": \"#e0e0e0\",\n\t\t\t\"--pie-button-active-bg\": \"#222222\",\n\t\t\t\"--pie-button-focus-outline\": \"#aaaaaa\",\n\t\t\t\"--pie-focus-checked\": \"#cccccc\",\n\t\t\t\"--pie-focus-checked-border\": \"#aaaaaa\",\n\t\t},\n\t\tpreview: { bg: \"#333333\", text: \"#e0e0e0\", primary: \"#aaaaaa\" },\n\t},\n];\n\nconst builtInSchemeMap = new Map(\n\tBUILTIN_PIE_COLOR_SCHEMES.map((scheme) => [scheme.id, scheme]),\n);\nconst customSchemeMap = new Map<string, PieColorSchemeDefinition>();\n\nfunction normalizeScheme(\n\tscheme: PieColorSchemeDefinition,\n): PieColorSchemeDefinition | null {\n\tconst id = scheme.id?.trim();\n\tif (!id) {\n\t\treturn null;\n\t}\n\tconst name = scheme.name?.trim() || id;\n\tconst normalizedVars = normalizePieThemeVariables(scheme.variables);\n\tif (Object.keys(normalizedVars).length === 0 && id !== \"default\") {\n\t\tconsole.warn(\n\t\t\t`[pie-theme] color scheme \"${id}\" does not define valid --pie-* variables.`,\n\t\t);\n\t}\n\treturn {\n\t\tid,\n\t\tname,\n\t\tdescription: scheme.description,\n\t\tpreview: scheme.preview,\n\t\tvariables: normalizedVars,\n\t};\n}\n\nexport function listPieColorSchemes(): PieColorSchemeDefinition[] {\n\treturn [...builtInSchemeMap.values(), ...customSchemeMap.values()];\n}\n\nexport function getPieColorScheme(\n\tschemeId: string | null | undefined,\n): PieColorSchemeDefinition | undefined {\n\tif (!schemeId) {\n\t\treturn builtInSchemeMap.get(\"default\");\n\t}\n\treturn customSchemeMap.get(schemeId) ?? builtInSchemeMap.get(schemeId);\n}\n\nexport function resolvePieColorSchemeVariables(\n\tschemeId: string | null | undefined,\n): ThemeVariables {\n\treturn getPieColorScheme(schemeId)?.variables ?? {};\n}\n\nexport function registerPieColorSchemes(\n\tschemes: PieColorSchemeDefinition[],\n\toptions: { overwrite?: boolean } = {},\n): void {\n\tconst overwrite = options.overwrite ?? true;\n\tfor (const rawScheme of schemes) {\n\t\tconst scheme = normalizeScheme(rawScheme);\n\t\tif (!scheme) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!overwrite && customSchemeMap.has(scheme.id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tcustomSchemeMap.set(scheme.id, scheme);\n\t}\n}\n\nexport function unregisterPieColorScheme(schemeId: string): void {\n\tif (!schemeId || builtInSchemeMap.has(schemeId)) {\n\t\treturn;\n\t}\n\tcustomSchemeMap.delete(schemeId);\n}\n"]}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;AAC3C,OAAO,EACN,8BAA8B,EAC9B,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,GAE1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,WAAW,EACX,YAAY,EACZ,0BAA0B,GAI1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EACN,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,8BAA8B,EAC9B,wBAAwB,GAGxB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,EAAE,CAAC","sourcesContent":["import { PieThemeElement, definePieTheme } from \"./theme-element.js\";\n\nexport { PieThemeElement, definePieTheme };\nexport {\n\tDAISYUI_THEME_PROVIDER_ADAPTER,\n\tgetPieThemeProvider,\n\tlistPieThemeProviders,\n\tregisterPieThemeProvider,\n\tresolveProviderVariables,\n\tunregisterPieThemeProvider,\n\ttype ThemeProviderAdapter,\n} from \"./providers.js\";\nexport {\n\tisThemeMode,\n\tisThemeScope,\n\tnormalizePieThemeVariables,\n\ttype ThemeMode,\n\ttype ThemeScope,\n\ttype ThemeVariables,\n} from \"./theme-types.js\";\nexport { DARK_THEME_VARS, LIGHT_THEME_VARS } from \"./theme-defaults.js\";\nexport {\n\tBUILTIN_PIE_COLOR_SCHEMES,\n\tgetPieColorScheme,\n\tlistPieColorSchemes,\n\tregisterPieColorSchemes,\n\tresolvePieColorSchemeVariables,\n\tunregisterPieColorScheme,\n\ttype PieColorSchemeDefinition,\n\ttype PieColorSchemePreview,\n} from \"./color-schemes.js\";\n\ndefinePieTheme();\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,0BAA0B,GAE1B,MAAM,kBAAkB,CAAC;AAQ1B,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAgC,CAAC;AAEtE,SAAS,UAAU,CAAC,KAAa;IAChC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC;AAED,SAAS,iBAAiB,CAAC,IAI1B;IACA,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,sBAAsB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC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CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACzD,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC5C,OAAO,EAAE,CAAC;YACX,CAAC;YACD,OAAO,0BAA0B,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1D,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,qBAAqB,CAAC,MAAM,EAAE,EAAE,CAAC;YACvD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC/B,SAAS;YACV,CAAC;YACD,OAAO,0BAA0B,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,IACC,OAAO,QAAQ,KAAK,WAAW;QAC/B,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe,EACvC,CAAC;QACF,OAAO,iBAAiB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC","sourcesContent":["import {\n\tnormalizePieThemeVariables,\n\ttype ThemeVariables,\n} from \"./theme-types.js\";\n\nexport interface ThemeProviderAdapter {\n\treadonly id: string;\n\tcanRead(target: HTMLElement): boolean;\n\tread(target: HTMLElement): ThemeVariables;\n}\n\nconst themeProviderRegistry = new Map<string, ThemeProviderAdapter>();\n\nfunction trimCssVar(value: string): string | undefined {\n\tconst trimmed = value.trim();\n\treturn trimmed ? trimmed : undefined;\n}\n\nfunction mixResolvedColors(args: {\n\tleft?: string;\n\tright?: string;\n\tleftWeight: string;\n}): string | undefined {\n\tif (!args.left || !args.right) {\n\t\treturn undefined;\n\t}\n\treturn `color-mix(in srgb, ${args.left} ${args.leftWeight}, ${args.right})`;\n}\n\nfunction mapComputedDaisyVars(computed: CSSStyleDeclaration): ThemeVariables {\n\tconst value = (key: string) => trimCssVar(computed.getPropertyValue(key));\n\treturn normalizePieThemeVariables({\n\t\t\"--pie-background\": value(\"--color-base-100\"),\n\t\t\"--pie-background-dark\": value(\"--color-base-200\"),\n\t\t\"--pie-secondary-background\": value(\"--color-base-200\"),\n\t\t\"--pie-dropdown-background\": value(\"--color-base-300\"),\n\t\t\"--pie-text\": value(\"--color-base-content\"),\n\t\t\"--pie-primary\": value(\"--color-primary\"),\n\t\t\"--pie-primary-light\": mixResolvedColors({\n\t\t\tleft: value(\"--color-primary\"),\n\t\t\tright: value(\"--color-base-100\"),\n\t\t\tleftWeight: \"60%\",\n\t\t}),\n\t\t\"--pie-primary-dark\": mixResolvedColors({\n\t\t\tleft: value(\"--color-primary\"),\n\t\t\tright: value(\"--color-base-content\"),\n\t\t\tleftWeight: \"75%\",\n\t\t}),\n\t\t\"--pie-faded-primary\": mixResolvedColors({\n\t\t\tleft: value(\"--color-primary\"),\n\t\t\tright: value(\"--color-base-100\"),\n\t\t\tleftWeight: \"20%\",\n\t\t}),\n\t\t\"--pie-secondary\": value(\"--color-secondary\"),\n\t\t\"--pie-secondary-light\": mixResolvedColors({\n\t\t\tleft: value(\"--color-secondary\"),\n\t\t\tright: value(\"--color-base-100\"),\n\t\t\tleftWeight: \"60%\",\n\t\t}),\n\t\t\"--pie-secondary-dark\": mixResolvedColors({\n\t\t\tleft: value(\"--color-secondary\"),\n\t\t\tright: value(\"--color-base-content\"),\n\t\t\tleftWeight: \"75%\",\n\t\t}),\n\t\t\"--pie-tertiary\": value(\"--color-accent\"),\n\t\t\"--pie-tertiary-light\": mixResolvedColors({\n\t\t\tleft: value(\"--color-accent\"),\n\t\t\tright: value(\"--color-base-100\"),\n\t\t\tleftWeight: \"60%\",\n\t\t}),\n\t\t\"--pie-border\": value(\"--color-base-300\"),\n\t\t\"--pie-border-light\": value(\"--color-base-200\"),\n\t\t\"--pie-border-dark\": value(\"--color-neutral\"),\n\t\t\"--pie-border-gray\": value(\"--color-base-300\"),\n\t\t\"--pie-correct\": value(\"--color-success\"),\n\t\t\"--pie-correct-secondary\": mixResolvedColors({\n\t\t\tleft: value(\"--color-success\"),\n\t\t\tright: value(\"--color-base-100\"),\n\t\t\tleftWeight: \"20%\",\n\t\t}),\n\t\t\"--pie-correct-tertiary\": value(\"--color-success\"),\n\t\t\"--pie-correct-icon\": value(\"--color-success\"),\n\t\t\"--pie-incorrect\": value(\"--color-error\"),\n\t\t\"--pie-incorrect-secondary\": mixResolvedColors({\n\t\t\tleft: value(\"--color-error\"),\n\t\t\tright: value(\"--color-base-100\"),\n\t\t\tleftWeight: \"20%\",\n\t\t}),\n\t\t\"--pie-incorrect-icon\": value(\"--color-error\"),\n\t\t\"--pie-missing\": value(\"--color-error\"),\n\t\t\"--pie-missing-icon\": value(\"--color-error\"),\n\t\t\"--pie-disabled\": value(\"--color-base-300\"),\n\t\t\"--pie-disabled-secondary\": value(\"--color-base-200\"),\n\t\t\"--pie-focus-checked\": mixResolvedColors({\n\t\t\tleft: value(\"--color-primary\"),\n\t\t\tright: value(\"--color-base-100\"),\n\t\t\tleftWeight: \"20%\",\n\t\t}),\n\t\t\"--pie-focus-checked-border\": value(\"--color-primary\"),\n\t\t\"--pie-focus-unchecked\": value(\"--color-base-200\"),\n\t\t\"--pie-focus-unchecked-border\": value(\"--color-base-300\"),\n\t\t\"--pie-blue-grey-100\": value(\"--color-base-100\"),\n\t\t\"--pie-blue-grey-300\": value(\"--color-base-200\"),\n\t\t\"--pie-blue-grey-600\": value(\"--color-base-300\"),\n\t\t\"--pie-blue-grey-900\": value(\"--color-base-content\"),\n\t\t\"--pie-black\": value(\"--color-neutral-content\"),\n\t\t\"--pie-white\": value(\"--color-base-100\"),\n\t\t\"--pie-button-bg\": value(\"--color-base-100\"),\n\t\t\"--pie-button-border\": value(\"--color-base-300\"),\n\t\t\"--pie-button-color\": value(\"--color-base-content\"),\n\t\t\"--pie-button-hover-bg\": value(\"--color-base-200\"),\n\t\t\"--pie-button-hover-border\": value(\"--color-base-300\"),\n\t\t\"--pie-button-hover-color\": value(\"--color-base-content\"),\n\t\t\"--pie-button-active-bg\": value(\"--color-base-300\"),\n\t\t\"--pie-button-focus-outline\": value(\"--color-primary\"),\n\t});\n}\n\nexport const DAISYUI_THEME_PROVIDER_ADAPTER: ThemeProviderAdapter = {\n\tid: \"daisyui\",\n\tcanRead(target) {\n\t\tconst computed = getComputedStyle(target);\n\t\treturn Boolean(\n\t\t\ttrimCssVar(computed.getPropertyValue(\"--color-base-100\")) ||\n\t\t\t\ttrimCssVar(computed.getPropertyValue(\"--color-base-content\")) ||\n\t\t\t\ttrimCssVar(computed.getPropertyValue(\"--color-primary\")),\n\t\t);\n\t},\n\tread(target) {\n\t\treturn mapComputedDaisyVars(getComputedStyle(target));\n\t},\n};\n\nthemeProviderRegistry.set(\n\tDAISYUI_THEME_PROVIDER_ADAPTER.id,\n\tDAISYUI_THEME_PROVIDER_ADAPTER,\n);\n\nexport function registerPieThemeProvider(adapter: ThemeProviderAdapter): void {\n\tif (!adapter?.id) {\n\t\treturn;\n\t}\n\tthemeProviderRegistry.set(adapter.id, adapter);\n}\n\nexport function unregisterPieThemeProvider(providerId: string): void {\n\tif (!providerId) {\n\t\treturn;\n\t}\n\tif (providerId === DAISYUI_THEME_PROVIDER_ADAPTER.id) {\n\t\treturn;\n\t}\n\tthemeProviderRegistry.delete(providerId);\n}\n\nexport function listPieThemeProviders(): ThemeProviderAdapter[] {\n\treturn [...themeProviderRegistry.values()];\n}\n\nexport function getPieThemeProvider(\n\tproviderId: string,\n): ThemeProviderAdapter | undefined {\n\treturn themeProviderRegistry.get(providerId);\n}\n\nexport function resolveProviderVariables(args: {\n\ttarget: HTMLElement;\n\tprovider?: string | null;\n}): ThemeVariables {\n\tconst providerMode = args.provider?.trim() || \"auto\";\n\tconst resolveFromTarget = (target: HTMLElement): ThemeVariables => {\n\t\tif (providerMode && providerMode !== \"auto\") {\n\t\t\tconst provider = themeProviderRegistry.get(providerMode);\n\t\t\tif (!provider || !provider.canRead(target)) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\treturn normalizePieThemeVariables(provider.read(target));\n\t\t}\n\n\t\tfor (const provider of themeProviderRegistry.values()) {\n\t\t\tif (!provider.canRead(target)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn normalizePieThemeVariables(provider.read(target));\n\t\t}\n\t\treturn {};\n\t};\n\n\tconst resolved = resolveFromTarget(args.target);\n\tif (Object.keys(resolved).length > 0) {\n\t\treturn resolved;\n\t}\n\n\tif (\n\t\ttypeof document !== \"undefined\" &&\n\t\targs.target !== document.documentElement\n\t) {\n\t\treturn resolveFromTarget(document.documentElement);\n\t}\n\n\treturn {};\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-defaults.js","sourceRoot":"","sources":["../src/theme-defaults.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAmB;IAC/C,YAAY,EAAE,OAAO;IACrB,gBAAgB,EAAE,MAAM;IACxB,0BAA0B,EAAE,SAAS;IACrC,eAAe,EAAE,SAAS;IAC1B,yBAAyB,EAAE,SAAS;IACpC,wBAAwB,EAAE,SAAS;IACnC,oBAAoB,EAAE,SAAS;IAC/B,iBAAiB,EAAE,SAAS;IAC5B,2BAA2B,EAAE,SAAS;IACtC,sBAAsB,EAAE,SAAS;IACjC,eAAe,EAAE,SAAS;IAC1B,oBAAoB,EAAE,SAAS;IAC/B,eAAe,EAAE,SAAS;IAC1B,qBAAqB,EAAE,SAAS;IAChC,oBAAoB,EAAE,SAAS;IAC/B,qBAAqB,EAAE,SAAS;IAChC,iBAAiB,EAAE,SAAS;IAC5B,uBAAuB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;IAChC,oBAAoB,EAAE,SAAS;IAC/B,qBAAqB,EAAE,SAAS;IAChC,iBAAiB,EAAE,SAAS;IAC5B,uBAAuB,EAAE,SAAS;IAClC,sBAAsB,EAAE,SAAS;IACjC,gBAAgB,EAAE,SAAS;IAC3B,sBAAsB,EAAE,SAAS;IACjC,kBAAkB,EAAE,SAAS;IAC7B,uBAAuB,EAAE,SAAS;IAClC,4BAA4B,EAAE,SAAS;IACvC,2BAA2B,EAAE,SAAS;IACtC,cAAc,EAAE,SAAS;IACzB,oBAAoB,EAAE,SAAS;IAC/B,mBAAmB,EAAE,SAAS;IAC9B,mBAAmB,EAAE,SAAS;IAC9B,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;IACxB,qBAAqB,EAAE,SAAS;IAChC,4BAA4B,EAAE,SAAS;IACvC,uBAAuB,EAAE,SAAS;IAClC,8BAA8B,EAAE,SAAS;IACzC,qBAAqB,EAAE,SAAS;IAChC,qBAAqB,EAAE,SAAS;IAChC,qBAAqB,EAAE,SAAS;IAChC,qBAAqB,EAAE,SAAS;IAChC,kBAAkB,EAAE,GAAG;IACvB,iBAAiB,EAAE,SAAS;IAC5B,qBAAqB,EAAE,SAAS;IAChC,oBAAoB,EAAE,SAAS;IAC/B,uBAAuB,EAAE,SAAS;IAClC,2BAA2B,EAAE,SAAS;IACtC,0BAA0B,EAAE,SAAS;IACrC,wBAAwB,EAAE,SAAS;IACnC,4BAA4B,EAAE,SAAS;CACvC,CAAC","sourcesContent":["import type { ThemeVariables } from \"./theme-types.js\";\n\nexport const LIGHT_THEME_VARS: ThemeVariables = {\n\t\"--pie-text\": \"black\",\n\t\"--pie-disabled\": \"grey\",\n\t\"--pie-disabled-secondary\": \"#ababab\",\n\t\"--pie-correct\": \"#4caf50\",\n\t\"--pie-correct-secondary\": \"#e8f5e9\",\n\t\"--pie-correct-tertiary\": \"#0ea449\",\n\t\"--pie-correct-icon\": \"#087d38\",\n\t\"--pie-incorrect\": \"#ff9800\",\n\t\"--pie-incorrect-secondary\": \"#ffebee\",\n\t\"--pie-incorrect-icon\": \"#bf0d00\",\n\t\"--pie-missing\": \"#d32f2f\",\n\t\"--pie-missing-icon\": \"#6a78a1\",\n\t\"--pie-primary\": \"#3f51b5\",\n\t\"--pie-primary-light\": \"#9fa8da\",\n\t\"--pie-primary-dark\": \"#283593\",\n\t\"--pie-faded-primary\": \"#dcdafb\",\n\t\"--pie-secondary\": \"#f50057\",\n\t\"--pie-secondary-light\": \"#f48fb1\",\n\t\"--pie-secondary-dark\": \"#880e4f\",\n\t\"--pie-tertiary\": \"#146eb3\",\n\t\"--pie-tertiary-light\": \"#d0e2f0\",\n\t\"--pie-background\": \"rgba(255, 255, 255, 0)\",\n\t\"--pie-background-dark\": \"#ecedf1\",\n\t\"--pie-secondary-background\": \"rgba(241, 241, 241, 1)\",\n\t\"--pie-dropdown-background\": \"#e0e1e6\",\n\t\"--pie-border\": \"#9a9a9a\",\n\t\"--pie-border-light\": \"#d1d1d1\",\n\t\"--pie-border-dark\": \"#646464\",\n\t\"--pie-border-gray\": \"#7e8494\",\n\t\"--pie-black\": \"#000000\",\n\t\"--pie-white\": \"#ffffff\",\n\t\"--pie-focus-checked\": \"#bbdefb\",\n\t\"--pie-focus-checked-border\": \"#1565c0\",\n\t\"--pie-focus-unchecked\": \"#e0e0e0\",\n\t\"--pie-focus-unchecked-border\": \"#757575\",\n\t\"--pie-blue-grey-100\": \"#f3f5f7\",\n\t\"--pie-blue-grey-300\": \"#c0c3cf\",\n\t\"--pie-blue-grey-600\": \"#7e8494\",\n\t\"--pie-blue-grey-900\": \"#152452\",\n\t\"--pie-font-scale\": \"1\",\n\t\"--pie-button-bg\": \"#ffffff\",\n\t\"--pie-button-border\": \"#d1d5db\",\n\t\"--pie-button-color\": \"#374151\",\n\t\"--pie-button-hover-bg\": \"#f9fafb\",\n\t\"--pie-button-hover-border\": \"#9ca3af\",\n\t\"--pie-button-hover-color\": \"#111827\",\n\t\"--pie-button-active-bg\": \"#f3f4f6\",\n\t\"--pie-button-focus-outline\": \"#3b82f6\",\n};\n\nexport const DARK_THEME_VARS: ThemeVariables = {\n\t\"--pie-text\": \"#ffffff\",\n\t\"--pie-disabled\": \"#999999\",\n\t\"--pie-disabled-secondary\": \"#777777\",\n\t\"--pie-correct\": \"#00ff00\",\n\t\"--pie-correct-secondary\": \"#003300\",\n\t\"--pie-correct-tertiary\": \"#00cc00\",\n\t\"--pie-correct-icon\": \"#00ff00\",\n\t\"--pie-incorrect\": \"#ff3333\",\n\t\"--pie-incorrect-secondary\": \"#330000\",\n\t\"--pie-incorrect-icon\": \"#ff0000\",\n\t\"--pie-missing\": \"#ff6666\",\n\t\"--pie-missing-icon\": \"#6666ff\",\n\t\"--pie-primary\": \"#ffff00\",\n\t\"--pie-primary-light\": \"#ffff99\",\n\t\"--pie-primary-dark\": \"#cccc00\",\n\t\"--pie-faded-primary\": \"#666600\",\n\t\"--pie-secondary\": \"#ff00ff\",\n\t\"--pie-secondary-light\": \"#ff99ff\",\n\t\"--pie-secondary-dark\": \"#cc00cc\",\n\t\"--pie-tertiary\": \"#00ffff\",\n\t\"--pie-tertiary-light\": \"#99ffff\",\n\t\"--pie-background\": \"#000000\",\n\t\"--pie-background-dark\": \"#1a1a1a\",\n\t\"--pie-secondary-background\": \"#222222\",\n\t\"--pie-dropdown-background\": \"#2a2a2a\",\n\t\"--pie-border\": \"#ffffff\",\n\t\"--pie-border-light\": \"#cccccc\",\n\t\"--pie-border-dark\": \"#ffffff\",\n\t\"--pie-border-gray\": \"#aaaaaa\",\n\t\"--pie-black\": \"#ffffff\",\n\t\"--pie-white\": \"#000000\",\n\t\"--pie-focus-checked\": \"#ffff00\",\n\t\"--pie-focus-checked-border\": \"#ffff00\",\n\t\"--pie-focus-unchecked\": \"#666666\",\n\t\"--pie-focus-unchecked-border\": \"#ffffff\",\n\t\"--pie-blue-grey-100\": \"#2a2a2a\",\n\t\"--pie-blue-grey-300\": \"#555555\",\n\t\"--pie-blue-grey-600\": \"#999999\",\n\t\"--pie-blue-grey-900\": \"#ffffff\",\n\t\"--pie-font-scale\": \"1\",\n\t\"--pie-button-bg\": \"#1f2937\",\n\t\"--pie-button-border\": \"#4b5563\",\n\t\"--pie-button-color\": \"#f9fafb\",\n\t\"--pie-button-hover-bg\": \"#374151\",\n\t\"--pie-button-hover-border\": \"#6b7280\",\n\t\"--pie-button-hover-color\": \"#ffffff\",\n\t\"--pie-button-active-bg\": \"#4b5563\",\n\t\"--pie-button-focus-outline\": \"#93c5fd\",\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-element.js","sourceRoot":"","sources":["../src/theme-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACN,WAAW,EACX,YAAY,GAIZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,eAAe,GACpB,OAAO,WAAW,KAAK,WAAW;IACjC,CAAC,CAAE;KAA0C;IAC7C,CAAC,CAAC,WAAW,CAAC;AAEhB,SAAS,wBAAwB,CAChC,OAAe,EACf,kBAA4C;IAE5C,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,OAAO;IACR,CAAC;IACD,IAAI,CAAC;QACJ,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,WAAW,GAChB,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC;QACrE,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAClD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;AACF,CAAC;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;YACrB,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAClE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACxB,CAAC;QAED,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;YACnD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;YACpE,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAChE,CAAC;IACF,CAAC;CACD;AAED,MAAM,UAAU,cAAc,CAAC,OAAO,GAAG,WAAW;IACnD,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE,CAAC;QAC3C,OAAO;IACR,CAAC;IAED,wBAAwB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import { resolvePieColorSchemeVariables } from \"./color-schemes.js\";\nimport { DARK_THEME_VARS, LIGHT_THEME_VARS } from \"./theme-defaults.js\";\nimport { resolveProviderVariables } from \"./providers.js\";\nimport {\n\tisThemeMode,\n\tisThemeScope,\n\ttype ThemeMode,\n\ttype ThemeScope,\n\ttype ThemeVariables,\n} from \"./theme-types.js\";\n\nconst HTMLElementBase =\n\ttypeof HTMLElement === \"undefined\"\n\t\t? (class {} as unknown as typeof HTMLElement)\n\t\t: HTMLElement;\n\nfunction defineThemeElementSafely(\n\ttagName: string,\n\telementConstructor: CustomElementConstructor,\n): void {\n\tif (customElements.get(tagName)) {\n\t\treturn;\n\t}\n\ttry {\n\t\tcustomElements.define(tagName, elementConstructor);\n\t} catch (error) {\n\t\tconst isDuplicate =\n\t\t\terror instanceof DOMException && error.name === \"NotSupportedError\";\n\t\tif (!isDuplicate || !customElements.get(tagName)) {\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nfunction parseVariableOverrides(value: unknown): ThemeVariables {\n\tif (!value) {\n\t\treturn {};\n\t}\n\n\tif (typeof value === \"string\") {\n\t\ttry {\n\t\t\treturn parseVariableOverrides(JSON.parse(value) as unknown);\n\t\t} catch {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tif (typeof value !== \"object\") {\n\t\treturn {};\n\t}\n\n\tconst output: ThemeVariables = {};\n\tfor (const [key, rawValue] of Object.entries(\n\t\tvalue as Record<string, unknown>,\n\t)) {\n\t\tif (!key.startsWith(\"--\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof rawValue === \"string\") {\n\t\t\toutput[key] = rawValue;\n\t\t} else if (typeof rawValue === \"number\") {\n\t\t\toutput[key] = String(rawValue);\n\t\t}\n\t}\n\treturn output;\n}\n\nexport class PieThemeElement extends HTMLElementBase {\n\tstatic get observedAttributes() {\n\t\treturn [\"theme\", \"scope\", \"provider\", \"scheme\", \"variables\"];\n\t}\n\n\tprivate mediaQuery: MediaQueryList | null = null;\n\tprivate readonly onMediaChange = () => this.applyTheme();\n\tprivate previousKeys = new Set<string>();\n\tprivate variablesOverride: ThemeVariables = {};\n\n\tget theme(): ThemeMode {\n\t\tconst value = this.getAttribute(\"theme\");\n\t\treturn isThemeMode(value) ? value : \"light\";\n\t}\n\n\tset theme(value: ThemeMode) {\n\t\tthis.setAttribute(\"theme\", value);\n\t}\n\n\tget scope(): ThemeScope {\n\t\tconst value = this.getAttribute(\"scope\");\n\t\treturn isThemeScope(value) ? value : \"self\";\n\t}\n\n\tset scope(value: ThemeScope) {\n\t\tthis.setAttribute(\"scope\", value);\n\t}\n\n\tget variables(): ThemeVariables {\n\t\treturn { ...this.variablesOverride };\n\t}\n\n\tset variables(value: ThemeVariables) {\n\t\tthis.variablesOverride = parseVariableOverrides(value);\n\t\tthis.setAttribute(\"variables\", JSON.stringify(this.variablesOverride));\n\t\tthis.applyTheme();\n\t}\n\n\tget provider(): string {\n\t\treturn this.getAttribute(\"provider\")?.trim() || \"auto\";\n\t}\n\n\tset provider(value: string) {\n\t\tthis.setAttribute(\"provider\", value || \"auto\");\n\t}\n\n\tget scheme(): string {\n\t\treturn this.getAttribute(\"scheme\")?.trim() || \"default\";\n\t}\n\n\tset scheme(value: string) {\n\t\tthis.setAttribute(\"scheme\", value || \"default\");\n\t}\n\n\tconnectedCallback() {\n\t\tif (!this.style.display) {\n\t\t\tthis.style.display = \"contents\";\n\t\t}\n\t\tthis.setupAutoThemeListener();\n\t\tthis.applyTheme();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this.mediaQuery) {\n\t\t\tthis.mediaQuery.removeEventListener(\"change\", this.onMediaChange);\n\t\t}\n\t\tthis.mediaQuery = null;\n\n\t\tif (this.scope === \"self\") {\n\t\t\tthis.clearPreviousKeys(this);\n\t\t\tthis.removeAttribute(\"data-theme\");\n\t\t\tthis.removeAttribute(\"data-color-scheme\");\n\t\t}\n\t}\n\n\tattributeChangedCallback(\n\t\tname: string,\n\t\toldValue: string | null,\n\t\tnewValue: string | null,\n\t) {\n\t\tif (oldValue === newValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (name === \"variables\") {\n\t\t\tthis.variablesOverride = parseVariableOverrides(newValue);\n\t\t}\n\n\t\tif (name === \"theme\") {\n\t\t\tthis.setupAutoThemeListener();\n\t\t}\n\n\t\tthis.applyTheme();\n\t}\n\n\tprotected getTarget(): HTMLElement {\n\t\tif (this.scope === \"document\") {\n\t\t\treturn document.documentElement;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected applyTheme() {\n\t\tif (typeof document === \"undefined\" || typeof window === \"undefined\") {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { effectiveTheme, dataTheme } = this.resolveThemeState();\n\t\tconst target = this.getTarget();\n\t\ttarget.setAttribute(\"data-theme\", dataTheme);\n\t\tif (this.scheme && this.scheme !== \"default\") {\n\t\t\ttarget.setAttribute(\"data-color-scheme\", this.scheme);\n\t\t} else {\n\t\t\ttarget.removeAttribute(\"data-color-scheme\");\n\t\t}\n\n\t\tconst themeVars =\n\t\t\teffectiveTheme === \"dark\" ? DARK_THEME_VARS : LIGHT_THEME_VARS;\n\t\tconst providerVars = resolveProviderVariables({\n\t\t\ttarget,\n\t\t\tprovider: this.provider,\n\t\t});\n\t\tconst schemeVars = resolvePieColorSchemeVariables(this.scheme);\n\t\tconst vars = {\n\t\t\t...themeVars,\n\t\t\t...providerVars,\n\t\t\t...schemeVars,\n\t\t\t...this.variablesOverride,\n\t\t};\n\n\t\tthis.clearPreviousKeys(target);\n\t\tfor (const [key, value] of Object.entries(vars)) {\n\t\t\ttarget.style.setProperty(key, value);\n\t\t}\n\t\tthis.previousKeys = new Set(Object.keys(vars));\n\t}\n\n\tprivate resolveThemeState(): {\n\t\teffectiveTheme: \"light\" | \"dark\";\n\t\tdataTheme: string;\n\t} {\n\t\tconst rawTheme = this.getAttribute(\"theme\")?.trim();\n\t\tif (rawTheme === \"auto\") {\n\t\t\tconst prefersDark = window.matchMedia(\n\t\t\t\t\"(prefers-color-scheme: dark)\",\n\t\t\t).matches;\n\t\t\tconst effectiveTheme = prefersDark ? \"dark\" : \"light\";\n\t\t\treturn { effectiveTheme, dataTheme: effectiveTheme };\n\t\t}\n\t\tif (rawTheme === \"dark\" || rawTheme === \"light\") {\n\t\t\treturn { effectiveTheme: rawTheme, dataTheme: rawTheme };\n\t\t}\n\t\t// Non-standard theme ids (for example DaisyUI theme names) map to\n\t\t// light base defaults while still driving provider resolution.\n\t\tif (rawTheme) {\n\t\t\treturn { effectiveTheme: \"light\", dataTheme: rawTheme };\n\t\t}\n\t\treturn { effectiveTheme: \"light\", dataTheme: \"light\" };\n\t}\n\n\tprivate clearPreviousKeys(target: HTMLElement) {\n\t\tfor (const key of this.previousKeys) {\n\t\t\ttarget.style.removeProperty(key);\n\t\t}\n\t}\n\n\tprivate setupAutoThemeListener() {\n\t\tif (typeof window === \"undefined\") {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.mediaQuery) {\n\t\t\tthis.mediaQuery.removeEventListener(\"change\", this.onMediaChange);\n\t\t\tthis.mediaQuery = null;\n\t\t}\n\n\t\tif (this.getAttribute(\"theme\")?.trim() === \"auto\") {\n\t\t\tthis.mediaQuery = window.matchMedia(\"(prefers-color-scheme: dark)\");\n\t\t\tthis.mediaQuery.addEventListener(\"change\", this.onMediaChange);\n\t\t}\n\t}\n}\n\nexport function definePieTheme(tagName = \"pie-theme\") {\n\tif (typeof customElements === \"undefined\") {\n\t\treturn;\n\t}\n\n\tdefineThemeElementSafely(tagName, PieThemeElement);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-types.js","sourceRoot":"","sources":["../src/theme-types.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,WAAW,CAAC,KAAoB;IAC/C,OAAO,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,MAAM,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAoB;IAChD,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,UAAU,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAAc;IACxD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,MAAM,MAAM,GAAmB,EAAE,CAAC;IAClC,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAC3C,KAAgC,CAChC,EAAE,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,SAAS;QACV,CAAC;QACD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAClC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChC,IAAI,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;YACvB,CAAC;QACF,CAAC;aAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACzC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["export type ThemeMode = \"light\" | \"dark\" | \"auto\";\nexport type ThemeScope = \"self\" | \"document\";\nexport type ThemeVariables = Record<string, string>;\n\nexport function isThemeMode(value: string | null): value is ThemeMode {\n\treturn value === \"light\" || value === \"dark\" || value === \"auto\";\n}\n\nexport function isThemeScope(value: string | null): value is ThemeScope {\n\treturn value === \"self\" || value === \"document\";\n}\n\nexport function normalizePieThemeVariables(value: unknown): ThemeVariables {\n\tif (!value || typeof value !== \"object\") {\n\t\treturn {};\n\t}\n\n\tconst output: ThemeVariables = {};\n\tfor (const [key, rawValue] of Object.entries(\n\t\tvalue as Record<string, unknown>,\n\t)) {\n\t\tif (!key.startsWith(\"--pie-\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof rawValue === \"string\") {\n\t\t\tconst trimmed = rawValue.trim();\n\t\t\tif (trimmed) {\n\t\t\t\toutput[key] = trimmed;\n\t\t\t}\n\t\t} else if (typeof rawValue === \"number\") {\n\t\t\toutput[key] = String(rawValue);\n\t\t}\n\t}\n\treturn output;\n}\n"]}