@f-ewald/components 1.37.4 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +25 -1
  2. package/custom-elements.json +36 -3
  3. package/dist/calendar-day.js +1 -1
  4. package/dist/calendar-day.js.map +1 -1
  5. package/dist/calendar-month.d.ts.map +1 -1
  6. package/dist/calendar-month.js +33 -12
  7. package/dist/calendar-month.js.map +1 -1
  8. package/dist/distribution-chart.js +1 -1
  9. package/dist/distribution-chart.js.map +1 -1
  10. package/dist/dropdown-button.js +1 -1
  11. package/dist/dropdown-button.js.map +1 -1
  12. package/dist/form-select.js +1 -1
  13. package/dist/form-select.js.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/kanban-board.js +1 -1
  19. package/dist/kanban-board.js.map +1 -1
  20. package/dist/kanban-column.js +1 -1
  21. package/dist/kanban-column.js.map +1 -1
  22. package/dist/link-card.js +1 -1
  23. package/dist/link-card.js.map +1 -1
  24. package/dist/loading-dots.js +1 -1
  25. package/dist/loading-dots.js.map +1 -1
  26. package/dist/multi-select.js +1 -1
  27. package/dist/multi-select.js.map +1 -1
  28. package/dist/photo-gallery.js +3 -3
  29. package/dist/photo-gallery.js.map +1 -1
  30. package/dist/radio-pills.js +1 -1
  31. package/dist/radio-pills.js.map +1 -1
  32. package/dist/range-slider.js +5 -5
  33. package/dist/range-slider.js.map +1 -1
  34. package/dist/scroll-dots.js +1 -1
  35. package/dist/scroll-dots.js.map +1 -1
  36. package/dist/slide-panel.js +1 -1
  37. package/dist/slide-panel.js.map +1 -1
  38. package/dist/stat-meter.js +1 -1
  39. package/dist/stat-meter.js.map +1 -1
  40. package/dist/status-pill.js +1 -1
  41. package/dist/status-pill.js.map +1 -1
  42. package/dist/timeline-entry.js +2 -2
  43. package/dist/timeline-entry.js.map +1 -1
  44. package/dist/tokens.css +17 -1
  45. package/dist/tokens.d.ts +27 -0
  46. package/dist/tokens.d.ts.map +1 -1
  47. package/dist/tokens.js +54 -0
  48. package/dist/tokens.js.map +1 -1
  49. package/dist/ui-button.js +2 -2
  50. package/dist/ui-button.js.map +1 -1
  51. package/dist/user-avatar.js +2 -2
  52. package/dist/user-avatar.js.map +1 -1
  53. package/dist/utils/transport-controls.js +5 -5
  54. package/dist/utils/transport-controls.js.map +1 -1
  55. package/docs/calendar-day.md +1 -0
  56. package/docs/design-language.md +21 -4
  57. package/docs/distribution-chart.md +1 -0
  58. package/docs/dropdown-button.md +1 -0
  59. package/docs/form-select.md +1 -0
  60. package/docs/kanban-board.md +1 -0
  61. package/docs/kanban-column.md +1 -0
  62. package/docs/link-card.md +1 -0
  63. package/docs/loading-dots.md +1 -0
  64. package/docs/multi-select.md +1 -0
  65. package/docs/photo-gallery.md +1 -0
  66. package/docs/radio-pills.md +1 -0
  67. package/docs/range-slider.md +2 -0
  68. package/docs/scroll-dots.md +1 -0
  69. package/docs/slide-panel.md +1 -0
  70. package/docs/stat-meter.md +1 -0
  71. package/docs/status-pill.md +1 -0
  72. package/docs/timeline-entry.md +1 -0
  73. package/docs/ui-button.md +1 -0
  74. package/docs/user-avatar.md +1 -0
  75. package/llms.txt +25 -20
  76. package/package.json +1 -1
@@ -64,7 +64,7 @@ let RangeSlider = class RangeSlider extends LitElement {
64
64
  /* Track */
65
65
  input[type="range"]::-webkit-slider-runnable-track {
66
66
  height: 0.375rem;
67
- border-radius: 9999px;
67
+ border-radius: var(--ui-radius-pill, 9999px);
68
68
  /* A hard-stop background gradient used as a two-tone fill trick —
69
69
  its color-stops can't themselves hold a gradient value, so this
70
70
  reads --ui-button-accent (a solid stand-in), not
@@ -79,12 +79,12 @@ let RangeSlider = class RangeSlider extends LitElement {
79
79
  }
80
80
  input[type="range"]::-moz-range-track {
81
81
  height: 0.375rem;
82
- border-radius: 9999px;
82
+ border-radius: var(--ui-radius-pill, 9999px);
83
83
  background: var(--ui-surface-muted, #f8fafc);
84
84
  }
85
85
  input[type="range"]::-moz-range-progress {
86
86
  height: 0.375rem;
87
- border-radius: 9999px;
87
+ border-radius: var(--ui-radius-pill, 9999px);
88
88
  background: var(--ui-button-accent, var(--ui-primary, #4f46e5));
89
89
  }
90
90
  /* Thumb */
@@ -97,7 +97,7 @@ let RangeSlider = class RangeSlider extends LitElement {
97
97
  thinner custom track — nudge it up to align with the track.
98
98
  A transform offset (not margin) so it isn't a spacing-grid value. */
99
99
  transform: translateY(-0.3125rem);
100
- border-radius: 50%;
100
+ border-radius: var(--ui-radius-circle, 50%);
101
101
  background: var(--ui-button-background, var(--ui-primary, #4f46e5));
102
102
  border: 2px solid var(--ui-surface, #ffffff);
103
103
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), var(--ui-button-highlight, 0 0 0 0 transparent);
@@ -105,7 +105,7 @@ let RangeSlider = class RangeSlider extends LitElement {
105
105
  input[type="range"]::-moz-range-thumb {
106
106
  width: 1rem;
107
107
  height: 1rem;
108
- border-radius: 50%;
108
+ border-radius: var(--ui-radius-circle, 50%);
109
109
  background: var(--ui-button-background, var(--ui-primary, #4f46e5));
110
110
  border: 2px solid var(--ui-surface, #ffffff);
111
111
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), var(--ui-button-highlight, 0 0 0 0 transparent);
@@ -1 +1 @@
1
- {"version":3,"file":"range-slider.js","sourceRoot":"","sources":["../src/range-slider.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;;;;;;GAcG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAgHL,qBAAqB;QAC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KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAClH,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA;;;gBAGC,oBAAoB,IAAI,CAAC,QAAQ,GAAG;cACtC,IAAI,CAAC,GAAG;cACR,IAAI,CAAC,GAAG;eACP,IAAI,CAAC,IAAI;iBACP,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;oBACf,IAAI,CAAC,WAAW;iBACnB,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;kBAC7B,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;;KAE5C,CAAC;IACJ,CAAC;CACF,CAAA;AApF6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAS;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAW;AAEV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAU;AAET;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAW;AAET;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAElC;IAAX,QAAQ,EAAE;yCAAW;AAEL;IAAhB,KAAK,EAAE;kDAA+B;AA7H5B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAqMvB","sourcesContent":["import { LitElement, css, html, type PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A form-associated numeric range slider, usable standalone or inside a\n * native `<form>`. Wraps a native `<input type=\"range\">` (kept for its free\n * keyboard, drag, and screen-reader support) restyled to match this\n * package's track/fill visual language (`stat-meter`, `percent-bar-chart`)\n * instead of the browser-default appearance. Purely a value control — no\n * built-in label; wrap in `form-field` for a labeled field, or render a\n * value readout next to it (see the playground example), matching\n * `autocomplete-input`/`form-select`.\n *\n * @element range-slider\n * @fires input - Fires continuously while dragging/typing; detail: `{ value }`.\n * @fires change - Fires once the value is committed (drag released, arrow\n * key released); detail: `{ value }`.\n */\n@customElement(\"range-slider\")\nexport class RangeSlider extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n input[type=\"range\"] {\n -webkit-appearance: none;\n appearance: none;\n width: 100%;\n height: 2rem;\n margin: 0;\n background: transparent;\n cursor: pointer;\n }\n input[type=\"range\"]:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n /* Track */\n input[type=\"range\"]::-webkit-slider-runnable-track {\n height: 0.375rem;\n border-radius: 9999px;\n /* A hard-stop background gradient used as a two-tone fill trick —\n its color-stops can't themselves hold a gradient value, so this\n reads --ui-button-accent (a solid stand-in), not\n --ui-button-background directly. */\n background: linear-gradient(\n to right,\n var(--ui-button-accent, var(--ui-primary, #4f46e5)) 0%,\n var(--ui-button-accent, var(--ui-primary, #4f46e5)) var(--range-percent, 0%),\n var(--ui-surface-muted, #f8fafc) var(--range-percent, 0%),\n var(--ui-surface-muted, #f8fafc) 100%\n );\n }\n input[type=\"range\"]::-moz-range-track {\n height: 0.375rem;\n border-radius: 9999px;\n background: var(--ui-surface-muted, #f8fafc);\n }\n input[type=\"range\"]::-moz-range-progress {\n height: 0.375rem;\n border-radius: 9999px;\n background: var(--ui-button-accent, var(--ui-primary, #4f46e5));\n }\n /* Thumb */\n input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 1rem;\n height: 1rem;\n /* WebKit centers the thumb on the input's full 2rem box, not the\n thinner custom track — nudge it up to align with the track.\n A transform offset (not margin) so it isn't a spacing-grid value. */\n transform: translateY(-0.3125rem);\n border-radius: 50%;\n background: var(--ui-button-background, var(--ui-primary, #4f46e5));\n border: 2px solid var(--ui-surface, #ffffff);\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n input[type=\"range\"]::-moz-range-thumb {\n width: 1rem;\n height: 1rem;\n border-radius: 50%;\n background: var(--ui-button-background, var(--ui-primary, #4f46e5));\n border: 2px solid var(--ui-surface, #ffffff);\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n input[type=\"range\"]:disabled::-webkit-slider-thumb {\n background: var(--ui-text-muted, #64748b);\n }\n input[type=\"range\"]:disabled::-moz-range-thumb {\n background: var(--ui-text-muted, #64748b);\n }\n input[type=\"range\"]:focus-visible {\n outline: none;\n }\n input[type=\"range\"]:focus-visible::-webkit-slider-thumb {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n input[type=\"range\"]:focus-visible::-moz-range-thumb {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n @media (prefers-reduced-motion: no-preference) {\n input[type=\"range\"]::-webkit-slider-thumb {\n transition: box-shadow 120ms ease;\n }\n input[type=\"range\"]::-moz-range-thumb {\n transition: box-shadow 120ms ease;\n }\n }\n @media (forced-colors: active) {\n input[type=\"range\"]::-webkit-slider-runnable-track {\n background: Canvas;\n border: 1px solid CanvasText;\n }\n input[type=\"range\"]::-webkit-slider-thumb {\n background: Highlight;\n border-color: Canvas;\n }\n input[type=\"range\"]:focus-visible::-webkit-slider-thumb {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n `,\n ];\n\n /** Minimum value. */\n @property({ type: Number }) min = 0;\n /** Maximum value. */\n @property({ type: Number }) max = 100;\n /** Step increment. */\n @property({ type: Number }) step = 1;\n /** Current value. */\n @property({ type: Number }) value = 0;\n /** Disables interaction; merged with an ancestor `<fieldset disabled>`. */\n @property({ type: Boolean }) disabled = false;\n /** Form field name. */\n @property() name = \"\";\n\n @state() private _formDisabled = false;\n\n #internals = this.attachInternals();\n #defaultValue = 0;\n\n /** Whether the host or an ancestor fieldset currently disables the control. */\n get #isDisabled(): boolean {\n return this.disabled || this._formDisabled;\n }\n\n get #percent(): number {\n const range = this.max - this.min || 1;\n return ((this.value - this.min) / range) * 100;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (!this.hasUpdated) this.#defaultValue = this.value;\n if (changed.has(\"value\")) this.#internals.setFormValue(String(this.value));\n }\n\n /** Resets to the value present at first render, per the form contract. */\n formResetCallback(): void {\n this.value = this.#defaultValue;\n }\n\n /** Mirrors an ancestor fieldset's disabled state. */\n formDisabledCallback(disabled: boolean): void {\n this._formDisabled = disabled;\n }\n\n /** Restores the value from saved form state (bfcache/autofill). */\n formStateRestoreCallback(state: string | File | FormData | null): void {\n if (typeof state !== \"string\") return;\n const parsed = Number(state);\n if (!Number.isNaN(parsed)) this.value = parsed;\n }\n\n // The native input's own \"input\"/\"change\" events are composed (cross the\n // shadow boundary) — stop them so only our re-dispatched CustomEvent\n // (carrying `detail.value`) reaches consumers, matching text-area.ts's fix\n // for the same issue. Otherwise the native event bubbles out afterwards\n // too, re-invoking the same listener with a plain Event whose `detail` is\n // undefined, crashing consumer code that reads `e.detail.value`.\n #onInput(e: Event): void {\n e.stopPropagation();\n const input = e.target as HTMLInputElement;\n this.value = Number(input.value);\n this.dispatchEvent(new CustomEvent(\"input\", { detail: { value: this.value }, bubbles: true, composed: true }));\n }\n\n #onChange(e: Event): void {\n e.stopPropagation();\n const input = e.target as HTMLInputElement;\n this.value = Number(input.value);\n this.dispatchEvent(new CustomEvent(\"change\", { detail: { value: this.value }, bubbles: true, composed: true }));\n }\n\n override render() {\n return html`\n <input\n type=\"range\"\n style=${`--range-percent: ${this.#percent}%`}\n min=${this.min}\n max=${this.max}\n step=${this.step}\n .value=${String(this.value)}\n ?disabled=${this.#isDisabled}\n @input=${(e: Event) => this.#onInput(e)}\n @change=${(e: Event) => this.#onChange(e)}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"range-slider\": RangeSlider;\n }\n}\n"]}
1
+ {"version":3,"file":"range-slider.js","sourceRoot":"","sources":["../src/range-slider.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;;;;;;GAcG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAgHL,qBAAqB;QACO,QAAG,GAAG,CAAC,CAAC;QACpC,qBAAqB;QACO,QAAG,GAAG,GAAG,CAAC;QACtC,sBAAsB;QACM,SAAI,GAAG,CAAC,CAAC;QACrC,qBAAqB;QACO,UAAK,GAAG,CAAC,CAAC;QACtC,2EAA2E;QAC9C,aAAQ,GAAG,KAAK,CAAC;QAC9C,uBAAuB;QACX,SAAI,GAAG,EAAE,CAAC;QAEL,kBAAa,GAAG,KAAK,CAAC;QAEvC,eAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACpC,kBAAa,GAAG,CAAC,CAAC;IAqEpB,CAAC;aApMQ,mBAAc,GAAG,IAAI,AAAP,CAAQ;aAEb,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwGF;KACF,AA3GqB,CA2GpB;IAiBF,UAAU,CAA0B;IACpC,aAAa,CAAK;IAElB,+EAA+E;IAC/E,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,aAAa,CAAC;IAC7C,CAAC;IAED,IAAI,QAAQ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AW;AAET;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAElC;IAAX,QAAQ,EAAE;yCAAW;AAEL;IAAhB,KAAK,EAAE;kDAA+B;AA7H5B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAqMvB","sourcesContent":["import { LitElement, css, html, type PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A form-associated numeric range slider, usable standalone or inside a\n * native `<form>`. Wraps a native `<input type=\"range\">` (kept for its free\n * keyboard, drag, and screen-reader support) restyled to match this\n * package's track/fill visual language (`stat-meter`, `percent-bar-chart`)\n * instead of the browser-default appearance. Purely a value control — no\n * built-in label; wrap in `form-field` for a labeled field, or render a\n * value readout next to it (see the playground example), matching\n * `autocomplete-input`/`form-select`.\n *\n * @element range-slider\n * @fires input - Fires continuously while dragging/typing; detail: `{ value }`.\n * @fires change - Fires once the value is committed (drag released, arrow\n * key released); detail: `{ value }`.\n */\n@customElement(\"range-slider\")\nexport class RangeSlider extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n input[type=\"range\"] {\n -webkit-appearance: none;\n appearance: none;\n width: 100%;\n height: 2rem;\n margin: 0;\n background: transparent;\n cursor: pointer;\n }\n input[type=\"range\"]:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n /* Track */\n input[type=\"range\"]::-webkit-slider-runnable-track {\n height: 0.375rem;\n border-radius: var(--ui-radius-pill, 9999px);\n /* A hard-stop background gradient used as a two-tone fill trick —\n its color-stops can't themselves hold a gradient value, so this\n reads --ui-button-accent (a solid stand-in), not\n --ui-button-background directly. */\n background: linear-gradient(\n to right,\n var(--ui-button-accent, var(--ui-primary, #4f46e5)) 0%,\n var(--ui-button-accent, var(--ui-primary, #4f46e5)) var(--range-percent, 0%),\n var(--ui-surface-muted, #f8fafc) var(--range-percent, 0%),\n var(--ui-surface-muted, #f8fafc) 100%\n );\n }\n input[type=\"range\"]::-moz-range-track {\n height: 0.375rem;\n border-radius: var(--ui-radius-pill, 9999px);\n background: var(--ui-surface-muted, #f8fafc);\n }\n input[type=\"range\"]::-moz-range-progress {\n height: 0.375rem;\n border-radius: var(--ui-radius-pill, 9999px);\n background: var(--ui-button-accent, var(--ui-primary, #4f46e5));\n }\n /* Thumb */\n input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 1rem;\n height: 1rem;\n /* WebKit centers the thumb on the input's full 2rem box, not the\n thinner custom track — nudge it up to align with the track.\n A transform offset (not margin) so it isn't a spacing-grid value. */\n transform: translateY(-0.3125rem);\n border-radius: var(--ui-radius-circle, 50%);\n background: var(--ui-button-background, var(--ui-primary, #4f46e5));\n border: 2px solid var(--ui-surface, #ffffff);\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n input[type=\"range\"]::-moz-range-thumb {\n width: 1rem;\n height: 1rem;\n border-radius: var(--ui-radius-circle, 50%);\n background: var(--ui-button-background, var(--ui-primary, #4f46e5));\n border: 2px solid var(--ui-surface, #ffffff);\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n input[type=\"range\"]:disabled::-webkit-slider-thumb {\n background: var(--ui-text-muted, #64748b);\n }\n input[type=\"range\"]:disabled::-moz-range-thumb {\n background: var(--ui-text-muted, #64748b);\n }\n input[type=\"range\"]:focus-visible {\n outline: none;\n }\n input[type=\"range\"]:focus-visible::-webkit-slider-thumb {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n input[type=\"range\"]:focus-visible::-moz-range-thumb {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n @media (prefers-reduced-motion: no-preference) {\n input[type=\"range\"]::-webkit-slider-thumb {\n transition: box-shadow 120ms ease;\n }\n input[type=\"range\"]::-moz-range-thumb {\n transition: box-shadow 120ms ease;\n }\n }\n @media (forced-colors: active) {\n input[type=\"range\"]::-webkit-slider-runnable-track {\n background: Canvas;\n border: 1px solid CanvasText;\n }\n input[type=\"range\"]::-webkit-slider-thumb {\n background: Highlight;\n border-color: Canvas;\n }\n input[type=\"range\"]:focus-visible::-webkit-slider-thumb {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n `,\n ];\n\n /** Minimum value. */\n @property({ type: Number }) min = 0;\n /** Maximum value. */\n @property({ type: Number }) max = 100;\n /** Step increment. */\n @property({ type: Number }) step = 1;\n /** Current value. */\n @property({ type: Number }) value = 0;\n /** Disables interaction; merged with an ancestor `<fieldset disabled>`. */\n @property({ type: Boolean }) disabled = false;\n /** Form field name. */\n @property() name = \"\";\n\n @state() private _formDisabled = false;\n\n #internals = this.attachInternals();\n #defaultValue = 0;\n\n /** Whether the host or an ancestor fieldset currently disables the control. */\n get #isDisabled(): boolean {\n return this.disabled || this._formDisabled;\n }\n\n get #percent(): number {\n const range = this.max - this.min || 1;\n return ((this.value - this.min) / range) * 100;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (!this.hasUpdated) this.#defaultValue = this.value;\n if (changed.has(\"value\")) this.#internals.setFormValue(String(this.value));\n }\n\n /** Resets to the value present at first render, per the form contract. */\n formResetCallback(): void {\n this.value = this.#defaultValue;\n }\n\n /** Mirrors an ancestor fieldset's disabled state. */\n formDisabledCallback(disabled: boolean): void {\n this._formDisabled = disabled;\n }\n\n /** Restores the value from saved form state (bfcache/autofill). */\n formStateRestoreCallback(state: string | File | FormData | null): void {\n if (typeof state !== \"string\") return;\n const parsed = Number(state);\n if (!Number.isNaN(parsed)) this.value = parsed;\n }\n\n // The native input's own \"input\"/\"change\" events are composed (cross the\n // shadow boundary) — stop them so only our re-dispatched CustomEvent\n // (carrying `detail.value`) reaches consumers, matching text-area.ts's fix\n // for the same issue. Otherwise the native event bubbles out afterwards\n // too, re-invoking the same listener with a plain Event whose `detail` is\n // undefined, crashing consumer code that reads `e.detail.value`.\n #onInput(e: Event): void {\n e.stopPropagation();\n const input = e.target as HTMLInputElement;\n this.value = Number(input.value);\n this.dispatchEvent(new CustomEvent(\"input\", { detail: { value: this.value }, bubbles: true, composed: true }));\n }\n\n #onChange(e: Event): void {\n e.stopPropagation();\n const input = e.target as HTMLInputElement;\n this.value = Number(input.value);\n this.dispatchEvent(new CustomEvent(\"change\", { detail: { value: this.value }, bubbles: true, composed: true }));\n }\n\n override render() {\n return html`\n <input\n type=\"range\"\n style=${`--range-percent: ${this.#percent}%`}\n min=${this.min}\n max=${this.max}\n step=${this.step}\n .value=${String(this.value)}\n ?disabled=${this.#isDisabled}\n @input=${(e: Event) => this.#onInput(e)}\n @change=${(e: Event) => this.#onChange(e)}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"range-slider\": RangeSlider;\n }\n}\n"]}
@@ -65,7 +65,7 @@ let ScrollDots = class ScrollDots extends LitElement {
65
65
  height: 0.625rem;
66
66
  padding: 0;
67
67
  border: none;
68
- border-radius: 9999px;
68
+ border-radius: var(--ui-radius-pill, 9999px);
69
69
  /* Same lighter-on-top token gradient as map-circle/timeline-entry's
70
70
  dot; the base color is swapped via the private --_dot var. */
71
71
  background: linear-gradient(
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-dots.js","sourceRoot":"","sources":["../src/scroll-dots.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAkBrC;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QACL,qFAAqF;QACr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C,KAAK,CAAC;;KAErC,CAAC;IACJ,CAAC;IAEO,OAAO,CAAC,KAAa;QAC3B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAkB,YAAY,EAAE;YAC7C,MAAM,EAAE,EAAE,KAAK,EAAE;YACjB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AApIiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;yCAA8B;AAGjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAY;AAG3B;IAAX,QAAQ,EAAE;yCAAY;AAGX;IAAX,QAAQ,EAAE;yCAAY;AAXZ,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAsItB;;AAED,SAAS,SAAS,CAAC,IAAoB;IACrC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** One dot on a `scroll-dots` rail. */\nexport interface ScrollDotItem {\n /** Accessible name for the dot's button — the section or slide title. */\n label: string;\n /** Renders the dot smaller and quieter, for a section subordinate to its neighbours. */\n muted?: boolean;\n}\n\n/** A dot, or a bare string as shorthand for `{ label }`. */\nexport type ScrollDotsItem = string | ScrollDotItem;\n\n/** Fired when the user picks a dot. `detail.index` is the 0-based target. */\nexport interface DotSelectDetail {\n index: number;\n}\n\n/**\n * Vertical section navigator for a long scrolled page or a slide deck: one dot\n * per section, the active one drawn as an elongated rounded bar rather than a\n * dot, which is the only cue needed to read position at a glance.\n *\n * Controlled, like `pagination-nav`: it owns no scroll behavior and never\n * reads the scroll position. The consumer sets `active` and moves the page in\n * response to `dot-select` — what counts as the active section differs too much\n * between a snapped deck and an ordinary long page to bake in.\n *\n * Positioning is also the consumer's, since a rail is normally fixed into a\n * reserved gutter that only the page knows the width of.\n *\n * The dots use the same lighter-on-top gradient as `map-circle`/`map-pin`,\n * derived from a single base `color` — a rail beside a map reads as the same\n * family of marks as the pins on it.\n *\n * @element scroll-dots\n * @fires dot-select - The user picked a dot (`detail: { index }`).\n */\n@customElement(\"scroll-dots\")\nexport class ScrollDots extends LitElement {\n /** Dots to render, in document order. A bare string is shorthand for `{ label }`. */\n @property({ attribute: false }) items: ScrollDotsItem[] = [];\n\n /** 0-based index of the active dot. Out-of-range values simply match no dot. */\n @property({ type: Number }) active = 0;\n\n /** Base color the dot gradient is derived from. Empty uses `--ui-primary`. */\n @property() color = \"\";\n\n /** Accessible name for the rail, e.g. \"Journey stops\". */\n @property() label = \"\";\n\n static override styles = [\n tokens,\n css`\n /*\n * will-change promotes the rail to its own compositor layer. A rail is\n * typically fixed over the page's main content — for a map deck, over a\n * WebGL canvas — and without it the browser repaints the dots on the main\n * thread, which flickers and squares off their rounded edges whenever a\n * scroll and an animation are competing for that thread.\n */\n :host {\n display: inline-flex;\n will-change: transform;\n backface-visibility: hidden;\n }\n nav {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.75rem;\n }\n button {\n width: 0.625rem;\n height: 0.625rem;\n padding: 0;\n border: none;\n border-radius: 9999px;\n /* Same lighter-on-top token gradient as map-circle/timeline-entry's\n dot; the base color is swapped via the private --_dot var. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--_dot, var(--ui-text-muted, #64748b)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--_dot, var(--ui-text-muted, #64748b)) 70%, #000000) 100%\n );\n opacity: 0.45;\n cursor: pointer;\n /*\n * Size is deliberately absent: height is a layout property, so\n * transitioning it animates on the main thread, where a concurrent\n * animation elsewhere on the page can starve it down to a couple of\n * frames and render the bar with squared-off edges. The size change\n * snaps; only the compositable properties ease.\n */\n transition: opacity 0.25s ease;\n }\n button.muted {\n width: 0.4rem;\n height: 0.4rem;\n }\n button:hover {\n opacity: 0.8;\n }\n button:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n button.active {\n height: 2.25rem;\n --_dot: var(--_color, var(--ui-primary, #4f46e5));\n opacity: 1;\n }\n @media (forced-colors: active) {\n button {\n background: GrayText;\n opacity: 1;\n }\n button.active {\n background: Highlight;\n }\n button:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n button {\n transition: none;\n }\n }\n `,\n ];\n\n override render() {\n const dots = this.items.map((item, index) => this._renderDot(normalize(item), index));\n return html`\n <nav\n aria-label=${this.label}\n style=${this.color === \"\" ? \"\" : `--_color: ${this.color}`}\n >\n ${dots}\n </nav>\n `;\n }\n\n private _renderDot(item: ScrollDotItem, index: number) {\n const isActive = index === this.active;\n const classes = [item.muted ? \"muted\" : \"\", isActive ? \"active\" : \"\"]\n .filter(Boolean)\n .join(\" \");\n return html`\n <button\n type=\"button\"\n class=${classes}\n aria-label=${item.label}\n title=${item.label}\n aria-current=${String(isActive)}\n @click=${() => this._select(index)}\n ></button>\n `;\n }\n\n private _select(index: number): void {\n this.dispatchEvent(\n new CustomEvent<DotSelectDetail>(\"dot-select\", {\n detail: { index },\n bubbles: true,\n composed: true,\n }),\n );\n }\n}\n\nfunction normalize(item: ScrollDotsItem): ScrollDotItem {\n return typeof item === \"string\" ? { label: item } : item;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"scroll-dots\": ScrollDots;\n }\n}\n"]}
1
+ {"version":3,"file":"scroll-dots.js","sourceRoot":"","sources":["../src/scroll-dots.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,M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AAG,CAAC,CAAC;QACb,OAAO,IAAI,CAAA;;;gBAGC,OAAO;qBACF,IAAI,CAAC,KAAK;gBACf,IAAI,CAAC,KAAK;uBACH,MAAM,CAAC,QAAQ,CAAC;iBACtB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;;KAErC,CAAC;IACJ,CAAC;IAEO,OAAO,CAAC,KAAa;QAC3B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAkB,YAAY,EAAE;YAC7C,MAAM,EAAE,EAAE,KAAK,EAAE;YACjB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AApIiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;yCAA8B;AAGjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAY;AAG3B;IAAX,QAAQ,EAAE;yCAAY;AAGX;IAAX,QAAQ,EAAE;yCAAY;AAXZ,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAsItB;;AAED,SAAS,SAAS,CAAC,IAAoB;IACrC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** One dot on a `scroll-dots` rail. */\nexport interface ScrollDotItem {\n /** Accessible name for the dot's button — the section or slide title. */\n label: string;\n /** Renders the dot smaller and quieter, for a section subordinate to its neighbours. */\n muted?: boolean;\n}\n\n/** A dot, or a bare string as shorthand for `{ label }`. */\nexport type ScrollDotsItem = string | ScrollDotItem;\n\n/** Fired when the user picks a dot. `detail.index` is the 0-based target. */\nexport interface DotSelectDetail {\n index: number;\n}\n\n/**\n * Vertical section navigator for a long scrolled page or a slide deck: one dot\n * per section, the active one drawn as an elongated rounded bar rather than a\n * dot, which is the only cue needed to read position at a glance.\n *\n * Controlled, like `pagination-nav`: it owns no scroll behavior and never\n * reads the scroll position. The consumer sets `active` and moves the page in\n * response to `dot-select` — what counts as the active section differs too much\n * between a snapped deck and an ordinary long page to bake in.\n *\n * Positioning is also the consumer's, since a rail is normally fixed into a\n * reserved gutter that only the page knows the width of.\n *\n * The dots use the same lighter-on-top gradient as `map-circle`/`map-pin`,\n * derived from a single base `color` — a rail beside a map reads as the same\n * family of marks as the pins on it.\n *\n * @element scroll-dots\n * @fires dot-select - The user picked a dot (`detail: { index }`).\n */\n@customElement(\"scroll-dots\")\nexport class ScrollDots extends LitElement {\n /** Dots to render, in document order. A bare string is shorthand for `{ label }`. */\n @property({ attribute: false }) items: ScrollDotsItem[] = [];\n\n /** 0-based index of the active dot. Out-of-range values simply match no dot. */\n @property({ type: Number }) active = 0;\n\n /** Base color the dot gradient is derived from. Empty uses `--ui-primary`. */\n @property() color = \"\";\n\n /** Accessible name for the rail, e.g. \"Journey stops\". */\n @property() label = \"\";\n\n static override styles = [\n tokens,\n css`\n /*\n * will-change promotes the rail to its own compositor layer. A rail is\n * typically fixed over the page's main content — for a map deck, over a\n * WebGL canvas — and without it the browser repaints the dots on the main\n * thread, which flickers and squares off their rounded edges whenever a\n * scroll and an animation are competing for that thread.\n */\n :host {\n display: inline-flex;\n will-change: transform;\n backface-visibility: hidden;\n }\n nav {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.75rem;\n }\n button {\n width: 0.625rem;\n height: 0.625rem;\n padding: 0;\n border: none;\n border-radius: var(--ui-radius-pill, 9999px);\n /* Same lighter-on-top token gradient as map-circle/timeline-entry's\n dot; the base color is swapped via the private --_dot var. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--_dot, var(--ui-text-muted, #64748b)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--_dot, var(--ui-text-muted, #64748b)) 70%, #000000) 100%\n );\n opacity: 0.45;\n cursor: pointer;\n /*\n * Size is deliberately absent: height is a layout property, so\n * transitioning it animates on the main thread, where a concurrent\n * animation elsewhere on the page can starve it down to a couple of\n * frames and render the bar with squared-off edges. The size change\n * snaps; only the compositable properties ease.\n */\n transition: opacity 0.25s ease;\n }\n button.muted {\n width: 0.4rem;\n height: 0.4rem;\n }\n button:hover {\n opacity: 0.8;\n }\n button:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n button.active {\n height: 2.25rem;\n --_dot: var(--_color, var(--ui-primary, #4f46e5));\n opacity: 1;\n }\n @media (forced-colors: active) {\n button {\n background: GrayText;\n opacity: 1;\n }\n button.active {\n background: Highlight;\n }\n button:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n button {\n transition: none;\n }\n }\n `,\n ];\n\n override render() {\n const dots = this.items.map((item, index) => this._renderDot(normalize(item), index));\n return html`\n <nav\n aria-label=${this.label}\n style=${this.color === \"\" ? \"\" : `--_color: ${this.color}`}\n >\n ${dots}\n </nav>\n `;\n }\n\n private _renderDot(item: ScrollDotItem, index: number) {\n const isActive = index === this.active;\n const classes = [item.muted ? \"muted\" : \"\", isActive ? \"active\" : \"\"]\n .filter(Boolean)\n .join(\" \");\n return html`\n <button\n type=\"button\"\n class=${classes}\n aria-label=${item.label}\n title=${item.label}\n aria-current=${String(isActive)}\n @click=${() => this._select(index)}\n ></button>\n `;\n }\n\n private _select(index: number): void {\n this.dispatchEvent(\n new CustomEvent<DotSelectDetail>(\"dot-select\", {\n detail: { index },\n bubbles: true,\n composed: true,\n }),\n );\n }\n}\n\nfunction normalize(item: ScrollDotsItem): ScrollDotItem {\n return typeof item === \"string\" ? { label: item } : item;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"scroll-dots\": ScrollDots;\n }\n}\n"]}
@@ -147,7 +147,7 @@ let SlidePanel = class SlidePanel extends LitElement {
147
147
  width: 2.25rem;
148
148
  height: 0.25rem;
149
149
  background: var(--ui-border, #e2e8f0);
150
- border-radius: 9999px;
150
+ border-radius: var(--ui-radius-pill, 9999px);
151
151
  margin: 0.5rem auto 0;
152
152
  flex: 0 0 auto;
153
153
  }
@@ -1 +1 @@
1
- {"version":3,"file":"slide-panel.js","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAErF;;;;;;;;;;GAUG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QACL,8CAA8C;QACjB,SAAI,GAAG,KAAK,CAAC;QAC1C,2EAA2E;QAC/D,YAAO,GAAG,EAAE,CAAC;QA8HjB,mBAAc,GAAuB,IAAI,CAAC;QAM1C,qBAAgB,GAAG,CAAC,KAAoB,EAAQ,EAAE;YACxD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC;gBAAE,OAAO;YACpD,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,CAAC;IAmDJ,CAAC;aAxLiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACtD,OAAO,IAAI,CAAA;;uBAEQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;;;qBAGzB,aAAa,IAAI,OAAO;0BACnB,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa;sBAC3C,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBACvB,CAAC,IAAI,CAAC,IAAI;;;;;iCAKM,IAAI,CAAC,OAAO,IAAI,OAAO;;sEAEc,IAAI,CAAC,MAAM;uCAC1C,KAAK,CAAC,EAAE,CAAC;;;;;KAK3C,CAAC;IACJ,CAAC;CACF,CAAA;AA5L8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAc;AAE9B;IAAX,QAAQ,EAAE;2CAAc;AAJd,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA8LtB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport { activateLayer, claimEscape, deactivateLayer } from \"./utils/layer-stack.js\";\n\n/**\n * Generic sliding panel shell. Handles positioning, open/close animation,\n * header chrome, and a close button. Body content is provided via the\n * default slot; the consumer controls its own padding and overflow.\n *\n * Desktop: fixed right-side panel that slides from the right.\n * Mobile (≤48rem): bottom-sheet drawer (60vh) — reserved for future use.\n *\n * @element slide-panel\n * @fires panel-close - User clicked the close (✕) button.\n */\n@customElement(\"slide-panel\")\nexport class SlidePanel extends LitElement {\n /** Whether the panel is currently visible. */\n @property({ type: Boolean }) open = false;\n /** Title text shown in the panel header (overridable via slot=\"title\"). */\n @property() heading = \"\";\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .panel {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n width: 20rem;\n z-index: var(--component-layer-z, 20);\n background: var(--ui-surface, #ffffff);\n box-shadow: var(--ui-shadow-lg, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));\n transform: translateX(110%);\n transition: transform 250ms ease;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .panel.open {\n transform: translateX(0);\n }\n .panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n flex: 0 0 auto;\n }\n .panel-title {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size-lg, 1rem);\n line-height: var(--ui-line-height-tight, 1.25);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n color: var(--ui-text, #0f172a);\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-right: 0.5rem;\n }\n .close-btn {\n background: none;\n border: none;\n cursor: pointer;\n width: 2rem;\n height: 2rem;\n padding: 0;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n .close-btn:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .close-btn:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .handle {\n display: none;\n }\n @media (prefers-reduced-motion: reduce) {\n .panel {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .close-btn:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (max-width: 48rem) {\n .panel {\n top: auto;\n right: 0;\n bottom: 0;\n left: 0;\n width: auto;\n height: 60vh;\n border-radius: var(--ui-radius, 0.5rem) var(--ui-radius, 0.5rem) 0 0;\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n transform: translateY(110%);\n }\n .panel.open {\n transform: translateY(0);\n }\n .handle {\n display: block;\n width: 2.25rem;\n height: 0.25rem;\n background: var(--ui-border, #e2e8f0);\n border-radius: 9999px;\n margin: 0.5rem auto 0;\n flex: 0 0 auto;\n }\n .panel-header {\n padding: 0.25rem 0.5rem 0.5rem;\n }\n }\n `,\n ];\n\n private _previousFocus: HTMLElement | null = null;\n\n private _close() {\n this.dispatchEvent(new CustomEvent(\"panel-close\", { bubbles: true, composed: true }));\n }\n\n private _onWindowKeydown = (event: KeyboardEvent): void => {\n if (!this.open || !claimEscape(this, event)) return;\n this._close();\n };\n\n protected override updated(changed: PropertyValues): void {\n if (!changed.has(\"open\")) return;\n if (this.open) {\n activateLayer(this);\n this._previousFocus = document.activeElement as HTMLElement | null;\n window.addEventListener(\"keydown\", this._onWindowKeydown);\n this.shadowRoot?.querySelector<HTMLElement>(\".close-btn\")?.focus();\n return;\n }\n deactivateLayer(this);\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n deactivateLayer(this);\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n this.open = false;\n }\n\n override render() {\n const explicitLabel = this.getAttribute(\"aria-label\");\n return html`\n <div\n class=\"panel ${this.open ? \"open\" : \"\"}\"\n role=\"dialog\"\n aria-modal=\"false\"\n aria-label=${explicitLabel ?? nothing}\n aria-labelledby=${explicitLabel ? nothing : \"panel-title\"}\n aria-hidden=${String(!this.open)}\n ?inert=${!this.open}\n >\n <div class=\"handle\" aria-hidden=\"true\"></div>\n <div class=\"panel-header\">\n <span id=\"panel-title\" class=\"panel-title\">\n <slot name=\"title\">${this.heading || \"Panel\"}</slot>\n </span>\n <button class=\"close-btn\" aria-label=\"Close panel\" @click=${this._close}>\n <span aria-hidden=\"true\">${iconX(18)}</span>\n </button>\n </div>\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"slide-panel\": SlidePanel;\n }\n}\n"]}
1
+ {"version":3,"file":"slide-panel.js","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAErF;;;;;;;;;;GAUG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QACL,8CAA8C;QACjB,SAAI,GAAG,KAAK,CAAC;QAC1C,2EAA2E;QAC/D,YAAO,GAAG,EAAE,CAAC;QA8HjB,mBAAc,GAAuB,IAAI,CAAC;QAM1C,qBAAgB,GAAG,CAAC,KAAoB,EAAQ,EAAE;YACxD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC;gBAAE,OAAO;YACpD,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,CAAC;IAmDJ,CAAC;aAxLiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAK,CAAC;IACpB,CAAC;IAEQ,MAAM;QACb,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACtD,OAAO,IAAI,CAAA;;uBAEQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;;;qBAGzB,aAAa,IAAI,OAAO;0BACnB,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa;sBAC3C,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBACvB,CAAC,IAAI,CAAC,IAAI;;;;;iCAKM,IAAI,CAAC,OAAO,IAAI,OAAO;;sEAEc,IAAI,CAAC,MAAM;uCAC1C,KAAK,CAAC,EAAE,CAAC;;;;;KAK3C,CAAC;IACJ,CAAC;CACF,CAAA;AA5L8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAc;AAE9B;IAAX,QAAQ,EAAE;2CAAc;AAJd,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA8LtB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport { activateLayer, claimEscape, deactivateLayer } from \"./utils/layer-stack.js\";\n\n/**\n * Generic sliding panel shell. Handles positioning, open/close animation,\n * header chrome, and a close button. Body content is provided via the\n * default slot; the consumer controls its own padding and overflow.\n *\n * Desktop: fixed right-side panel that slides from the right.\n * Mobile (≤48rem): bottom-sheet drawer (60vh) — reserved for future use.\n *\n * @element slide-panel\n * @fires panel-close - User clicked the close (✕) button.\n */\n@customElement(\"slide-panel\")\nexport class SlidePanel extends LitElement {\n /** Whether the panel is currently visible. */\n @property({ type: Boolean }) open = false;\n /** Title text shown in the panel header (overridable via slot=\"title\"). */\n @property() heading = \"\";\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .panel {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n width: 20rem;\n z-index: var(--component-layer-z, 20);\n background: var(--ui-surface, #ffffff);\n box-shadow: var(--ui-shadow-lg, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));\n transform: translateX(110%);\n transition: transform 250ms ease;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .panel.open {\n transform: translateX(0);\n }\n .panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n flex: 0 0 auto;\n }\n .panel-title {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size-lg, 1rem);\n line-height: var(--ui-line-height-tight, 1.25);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n color: var(--ui-text, #0f172a);\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-right: 0.5rem;\n }\n .close-btn {\n background: none;\n border: none;\n cursor: pointer;\n width: 2rem;\n height: 2rem;\n padding: 0;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n .close-btn:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .close-btn:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .handle {\n display: none;\n }\n @media (prefers-reduced-motion: reduce) {\n .panel {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .close-btn:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (max-width: 48rem) {\n .panel {\n top: auto;\n right: 0;\n bottom: 0;\n left: 0;\n width: auto;\n height: 60vh;\n border-radius: var(--ui-radius, 0.5rem) var(--ui-radius, 0.5rem) 0 0;\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n transform: translateY(110%);\n }\n .panel.open {\n transform: translateY(0);\n }\n .handle {\n display: block;\n width: 2.25rem;\n height: 0.25rem;\n background: var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-pill, 9999px);\n margin: 0.5rem auto 0;\n flex: 0 0 auto;\n }\n .panel-header {\n padding: 0.25rem 0.5rem 0.5rem;\n }\n }\n `,\n ];\n\n private _previousFocus: HTMLElement | null = null;\n\n private _close() {\n this.dispatchEvent(new CustomEvent(\"panel-close\", { bubbles: true, composed: true }));\n }\n\n private _onWindowKeydown = (event: KeyboardEvent): void => {\n if (!this.open || !claimEscape(this, event)) return;\n this._close();\n };\n\n protected override updated(changed: PropertyValues): void {\n if (!changed.has(\"open\")) return;\n if (this.open) {\n activateLayer(this);\n this._previousFocus = document.activeElement as HTMLElement | null;\n window.addEventListener(\"keydown\", this._onWindowKeydown);\n this.shadowRoot?.querySelector<HTMLElement>(\".close-btn\")?.focus();\n return;\n }\n deactivateLayer(this);\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n deactivateLayer(this);\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n this.open = false;\n }\n\n override render() {\n const explicitLabel = this.getAttribute(\"aria-label\");\n return html`\n <div\n class=\"panel ${this.open ? \"open\" : \"\"}\"\n role=\"dialog\"\n aria-modal=\"false\"\n aria-label=${explicitLabel ?? nothing}\n aria-labelledby=${explicitLabel ? nothing : \"panel-title\"}\n aria-hidden=${String(!this.open)}\n ?inert=${!this.open}\n >\n <div class=\"handle\" aria-hidden=\"true\"></div>\n <div class=\"panel-header\">\n <span id=\"panel-title\" class=\"panel-title\">\n <slot name=\"title\">${this.heading || \"Panel\"}</slot>\n </span>\n <button class=\"close-btn\" aria-label=\"Close panel\" @click=${this._close}>\n <span aria-hidden=\"true\">${iconX(18)}</span>\n </button>\n </div>\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"slide-panel\": SlidePanel;\n }\n}\n"]}
@@ -57,7 +57,7 @@ let StatMeter = class StatMeter extends LitElement {
57
57
  display: block;
58
58
  width: 4rem;
59
59
  height: 0.375rem;
60
- border-radius: 9999px;
60
+ border-radius: var(--ui-radius-pill, 9999px);
61
61
  background: var(--track-color, var(--ui-surface-muted, #f8fafc));
62
62
  overflow: hidden;
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"stat-meter.js","sourceRoot":"","sources":["../src/stat-meter.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;GAOG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAgEL,6DAA6D;QACjD,UAAK,GAAG,EAAE,CAAC;QAEvB,qFAAqF;QACzD,YAAO,GAAkB,IAAI,CAAC;QAE1D,mEAAmE;QACvD,UAAK,GAAG,EAAE,CAAC;QAEvB,kGAAkG;QAC1D,eAAU,GAAG,EAAE,CAAC;IAe1D,CAAC;aAxFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DF;KACF,AA7DqB,CA6DpB;IAcO,MAAM;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;QACzB,MAAM,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACnE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,OAAO,oBAAoB,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,OAAO,GAAG,CAAC;QACxG,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAA;4BACa,IAAI,CAAC,KAAK;6CACO,UAAU,gBAAgB,IAAI,CAAC,KAAK,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG;mCACzF,SAAS;;4BAEhB,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG;KACrD,CAAC;IACJ,CAAC;CACF,CAAA;AAxBa;IAAX,QAAQ,EAAE;wCAAY;AAGK;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAA+B;AAG9C;IAAX,QAAQ,EAAE;wCAAY;AAGiB;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;6CAAiB;AA1E7C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAyFrB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A compact labeled meter for a single percentage reading — e.g. CPU or\n * memory usage in a dashboard header. `percent` may be `null` when no\n * reading is available yet (e.g. the first tick of a polling metric); the\n * bar then renders empty and the value shows an em dash instead of \"0%\".\n *\n * @element stat-meter\n */\n@customElement(\"stat-meter\")\nexport class StatMeter extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n\n .label {\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n color: var(--ui-text-muted, #64748b);\n }\n\n .track {\n display: block;\n width: 4rem;\n height: 0.375rem;\n border-radius: 9999px;\n background: var(--track-color, var(--ui-surface-muted, #f8fafc));\n overflow: hidden;\n }\n\n .fill {\n display: block;\n height: 100%;\n /* Keep the top highlight while softening the dark edge for compact meters. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--fill-color, var(--ui-success, #16a34a)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--fill-color, var(--ui-success, #16a34a)) 80%, #000000) 100%\n );\n transition: width 200ms ease;\n }\n\n .value {\n min-width: 2rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n color: var(--ui-text, #0f172a);\n font-variant-numeric: tabular-nums;\n text-align: right;\n }\n @media (prefers-reduced-motion: reduce) {\n .fill {\n transition: none;\n }\n }\n `,\n ];\n\n /** Short label shown before the bar, e.g. \"CPU\" or \"MEM\". */\n @property() label = \"\";\n\n /** Percentage 0-100. `null` renders an empty bar and a \"—\" value instead of \"0%\". */\n @property({ type: Number }) percent: number | null = null;\n\n /** Fill color override; falls back to the `--ui-success` token. */\n @property() color = \"\";\n\n /** Track (inactive portion) background override; falls back to the `--ui-surface-muted` token. */\n @property({ attribute: \"track-color\" }) trackColor = \"\";\n\n override render() {\n const pct = this.percent;\n const clamped = pct === null ? 0 : Math.min(100, Math.max(0, pct));\n const fillStyle = this.color ? `width: ${clamped}%; --fill-color: ${this.color}` : `width: ${clamped}%`;\n const trackStyle = this.trackColor ? `--track-color: ${this.trackColor}` : \"\";\n return html`\n <span class=\"label\">${this.label}</span>\n <span class=\"track\" role=\"img\" style=${trackStyle} aria-label=\"${this.label} ${pct === null ? \"no reading\" : `${pct}%`}\">\n <span class=\"fill\" style=${fillStyle}></span>\n </span>\n <span class=\"value\">${pct === null ? \"—\" : `${pct}%`}</span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"stat-meter\": StatMeter;\n }\n}\n"]}
1
+ {"version":3,"file":"stat-meter.js","sourceRoot":"","sources":["../src/stat-meter.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;GAOG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAgEL,6DAA6D;QACjD,UAAK,GAAG,EAAE,CAAC;QAEvB,qFAAqF;QACzD,YAAO,GAAkB,IAAI,CAAC;QAE1D,mEAAmE;QACvD,UAAK,GAAG,EAAE,CAAC;QAEvB,kGAAkG;QAC1D,eAAU,GAAG,EAAE,CAAC;IAe1D,CAAC;aAxFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DF;KACF,AA7DqB,CA6DpB;IAcO,MAAM;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;QACzB,MAAM,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACnE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,OAAO,oBAAoB,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,OAAO,GAAG,CAAC;QACxG,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAA;4BACa,IAAI,CAAC,KAAK;6CACO,UAAU,gBAAgB,IAAI,CAAC,KAAK,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG;mCACzF,SAAS;;4BAEhB,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG;KACrD,CAAC;IACJ,CAAC;CACF,CAAA;AAxBa;IAAX,QAAQ,EAAE;wCAAY;AAGK;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAA+B;AAG9C;IAAX,QAAQ,EAAE;wCAAY;AAGiB;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;6CAAiB;AA1E7C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAyFrB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A compact labeled meter for a single percentage reading — e.g. CPU or\n * memory usage in a dashboard header. `percent` may be `null` when no\n * reading is available yet (e.g. the first tick of a polling metric); the\n * bar then renders empty and the value shows an em dash instead of \"0%\".\n *\n * @element stat-meter\n */\n@customElement(\"stat-meter\")\nexport class StatMeter extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n\n .label {\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n color: var(--ui-text-muted, #64748b);\n }\n\n .track {\n display: block;\n width: 4rem;\n height: 0.375rem;\n border-radius: var(--ui-radius-pill, 9999px);\n background: var(--track-color, var(--ui-surface-muted, #f8fafc));\n overflow: hidden;\n }\n\n .fill {\n display: block;\n height: 100%;\n /* Keep the top highlight while softening the dark edge for compact meters. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--fill-color, var(--ui-success, #16a34a)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--fill-color, var(--ui-success, #16a34a)) 80%, #000000) 100%\n );\n transition: width 200ms ease;\n }\n\n .value {\n min-width: 2rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n color: var(--ui-text, #0f172a);\n font-variant-numeric: tabular-nums;\n text-align: right;\n }\n @media (prefers-reduced-motion: reduce) {\n .fill {\n transition: none;\n }\n }\n `,\n ];\n\n /** Short label shown before the bar, e.g. \"CPU\" or \"MEM\". */\n @property() label = \"\";\n\n /** Percentage 0-100. `null` renders an empty bar and a \"—\" value instead of \"0%\". */\n @property({ type: Number }) percent: number | null = null;\n\n /** Fill color override; falls back to the `--ui-success` token. */\n @property() color = \"\";\n\n /** Track (inactive portion) background override; falls back to the `--ui-surface-muted` token. */\n @property({ attribute: \"track-color\" }) trackColor = \"\";\n\n override render() {\n const pct = this.percent;\n const clamped = pct === null ? 0 : Math.min(100, Math.max(0, pct));\n const fillStyle = this.color ? `width: ${clamped}%; --fill-color: ${this.color}` : `width: ${clamped}%`;\n const trackStyle = this.trackColor ? `--track-color: ${this.trackColor}` : \"\";\n return html`\n <span class=\"label\">${this.label}</span>\n <span class=\"track\" role=\"img\" style=${trackStyle} aria-label=\"${this.label} ${pct === null ? \"no reading\" : `${pct}%`}\">\n <span class=\"fill\" style=${fillStyle}></span>\n </span>\n <span class=\"value\">${pct === null ? \"—\" : `${pct}%`}</span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"stat-meter\": StatMeter;\n }\n}\n"]}
@@ -34,7 +34,7 @@ let StatusPill = class StatusPill extends LitElement {
34
34
  display: inline-flex;
35
35
  align-items: center;
36
36
  gap: 0.25rem;
37
- border-radius: 9999px;
37
+ border-radius: var(--ui-radius-pill, 9999px);
38
38
  padding: 0.25rem 0.5rem;
39
39
  font-size: var(--ui-font-size-sm, 0.75rem);
40
40
  font-weight: var(--ui-font-weight-medium, 500);
@@ -1 +1 @@
1
- {"version":3,"file":"status-pill.js","sourceRoot":"","sources":["../src/status-pill.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC;;;;;GAKG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAoEL,kCAAkC;QACtB,UAAK,GAAG,EAAE,CAAC;QACvB,qBAAqB;QACT,UAAK,GAAoB,SAAS,CAAC;QAC/C,sDAAsD;QACzB,YAAO,GAAG,KAAK,CAAC;IAU/C,CAAC;aAlFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8DF;KACF,AAjEqB,CAiEpB;IASO,MAAM;QACb,OAAO,IAAI,CAAA;0BACW,IAAI,CAAC,KAAK;UAC1B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA,yCAAyC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;UAChG,IAAI,CAAC,KAAK;;KAEf,CAAC;IACJ,CAAC;CACF,CAAA;AAda;IAAX,QAAQ,EAAE;yCAAY;AAEX;IAAX,QAAQ,EAAE;yCAAoC;AAElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAiB;AAzElC,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAmFtB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { iconArrowPath } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport type StatusPillColor = \"neutral\" | \"info\" | \"primary\" | \"success\" | \"warning\" | \"danger\";\n\n/**\n * Small colored status pill, optionally with a spinning icon — for task/run\n * states (\"Open\", \"Blocked\", \"Done\") and live-activity indicators (\"Running\").\n *\n * @element status-pill\n */\n@customElement(\"status-pill\")\nexport class StatusPill extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n }\n .pill {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n border-radius: 9999px;\n padding: 0.25rem 0.5rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n white-space: nowrap;\n }\n .pill.neutral {\n background: color-mix(in srgb, var(--ui-text-muted, #64748b) 15%, transparent);\n color: var(--ui-text-muted, #64748b);\n }\n .pill.info {\n background: color-mix(in srgb, var(--ui-info, #0ea5e9) 15%, transparent);\n color: var(--ui-info, #0ea5e9);\n }\n .pill.primary {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 15%, transparent);\n color: var(--ui-primary, #4f46e5);\n }\n .pill.success {\n background: color-mix(in srgb, var(--ui-success, #16a34a) 15%, transparent);\n color: var(--ui-success, #16a34a);\n }\n .pill.warning {\n background: color-mix(in srgb, var(--ui-warning, #d97706) 15%, transparent);\n color: var(--ui-warning, #d97706);\n }\n .pill.danger {\n background: color-mix(in srgb, var(--ui-danger, #dc2626) 15%, transparent);\n color: var(--ui-danger, #dc2626);\n }\n .spin {\n display: inline-flex;\n animation: spin 0.8s linear infinite;\n }\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .spin {\n animation: none;\n }\n }\n `,\n ];\n\n /** Text shown inside the pill. */\n @property() label = \"\";\n /** Color variant. */\n @property() color: StatusPillColor = \"neutral\";\n /** Renders a small spinning icon before the label. */\n @property({ type: Boolean }) spinner = false;\n\n override render() {\n return html`\n <span class=\"pill ${this.color}\">\n ${this.spinner ? html`<span class=\"spin\" aria-hidden=\"true\">${iconArrowPath(14)}</span>` : nothing}\n ${this.label}\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"status-pill\": StatusPill;\n }\n}\n"]}
1
+ {"version":3,"file":"status-pill.js","sourceRoot":"","sources":["../src/status-pill.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC;;;;;GAKG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAoEL,kCAAkC;QACtB,UAAK,GAAG,EAAE,CAAC;QACvB,qBAAqB;QACT,UAAK,GAAoB,SAAS,CAAC;QAC/C,sDAAsD;QACzB,YAAO,GAAG,KAAK,CAAC;IAU/C,CAAC;aAlFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8DF;KACF,AAjEqB,CAiEpB;IASO,MAAM;QACb,OAAO,IAAI,CAAA;0BACW,IAAI,CAAC,KAAK;UAC1B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA,yCAAyC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;UAChG,IAAI,CAAC,KAAK;;KAEf,CAAC;IACJ,CAAC;CACF,CAAA;AAda;IAAX,QAAQ,EAAE;yCAAY;AAEX;IAAX,QAAQ,EAAE;yCAAoC;AAElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAiB;AAzElC,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAmFtB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { iconArrowPath } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport type StatusPillColor = \"neutral\" | \"info\" | \"primary\" | \"success\" | \"warning\" | \"danger\";\n\n/**\n * Small colored status pill, optionally with a spinning icon — for task/run\n * states (\"Open\", \"Blocked\", \"Done\") and live-activity indicators (\"Running\").\n *\n * @element status-pill\n */\n@customElement(\"status-pill\")\nexport class StatusPill extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n }\n .pill {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n border-radius: var(--ui-radius-pill, 9999px);\n padding: 0.25rem 0.5rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n white-space: nowrap;\n }\n .pill.neutral {\n background: color-mix(in srgb, var(--ui-text-muted, #64748b) 15%, transparent);\n color: var(--ui-text-muted, #64748b);\n }\n .pill.info {\n background: color-mix(in srgb, var(--ui-info, #0ea5e9) 15%, transparent);\n color: var(--ui-info, #0ea5e9);\n }\n .pill.primary {\n background: color-mix(in srgb, var(--ui-primary, #4f46e5) 15%, transparent);\n color: var(--ui-primary, #4f46e5);\n }\n .pill.success {\n background: color-mix(in srgb, var(--ui-success, #16a34a) 15%, transparent);\n color: var(--ui-success, #16a34a);\n }\n .pill.warning {\n background: color-mix(in srgb, var(--ui-warning, #d97706) 15%, transparent);\n color: var(--ui-warning, #d97706);\n }\n .pill.danger {\n background: color-mix(in srgb, var(--ui-danger, #dc2626) 15%, transparent);\n color: var(--ui-danger, #dc2626);\n }\n .spin {\n display: inline-flex;\n animation: spin 0.8s linear infinite;\n }\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .spin {\n animation: none;\n }\n }\n `,\n ];\n\n /** Text shown inside the pill. */\n @property() label = \"\";\n /** Color variant. */\n @property() color: StatusPillColor = \"neutral\";\n /** Renders a small spinning icon before the label. */\n @property({ type: Boolean }) spinner = false;\n\n override render() {\n return html`\n <span class=\"pill ${this.color}\">\n ${this.spinner ? html`<span class=\"spin\" aria-hidden=\"true\">${iconArrowPath(14)}</span>` : nothing}\n ${this.label}\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"status-pill\": StatusPill;\n }\n}\n"]}
@@ -130,7 +130,7 @@ let TimelineEntry = class TimelineEntry extends LitElement {
130
130
  width: 0.75rem;
131
131
  height: 0.75rem;
132
132
  transform: translateX(-50%);
133
- border-radius: 9999px;
133
+ border-radius: var(--ui-radius-pill, 9999px);
134
134
  /* Same lighter-on-top token gradient as map-circle/user-avatar; the
135
135
  base color is swapped per the color property via the private
136
136
  --_dot var. */
@@ -165,7 +165,7 @@ let TimelineEntry = class TimelineEntry extends LitElement {
165
165
  display: block;
166
166
  width: 0.75rem;
167
167
  height: 0.75rem;
168
- border-radius: 9999px;
168
+ border-radius: var(--ui-radius-pill, 9999px);
169
169
  /* Opaque backing so the connecting line is masked exactly like it is
170
170
  behind the solid .dot, instead of showing through the ring's
171
171
  hollow center and corners. */
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-entry.js","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,uEAAuE;QAC3D,aAAQ,GAAkB,IAAI,CAAC;QAE3C,iFAAiF;QACrE,UAAK,GAAkB,IAAI,CAAC;QAExC;;;WAGG;QACyC,gBAAW,GAAG,KAAK,CAAC;QAEhE;;;WAGG;QACS,UAAK,GAAoB,SAAS,CAAC;QAE/C;;;WAGG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D;;;;WAIG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D,gEAAgE;QAC/C,iBAAY,GAAG,KAAK,CAAC;QAEtC,6DAA6D;QAC5C,cAAS,GAAG,KAAK,CAAC;I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hB,KAAK,EAAE;mDAA8B;AAGrB;IAAhB,KAAK,EAAE;gDAA2B;AApCxB,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA2WzB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport \"./relative-time.js\";\nimport { tokens } from \"./tokens.js\";\nimport type { StatusPillColor } from \"./status-pill.js\";\n\n/**\n * One event on a `timeline-container`: a dot on the vertical line, an optional\n * headline, a relative timestamp (\"3 hours ago\"), and freely nested content.\n * The connecting line is drawn here — its segment above the dot is hidden on\n * the first entry and the segment below is hidden on the last, so the line caps\n * exactly at the first and last dots. Only meaningful inside a\n * `timeline-container`; demonstrated through it.\n *\n * `datetime` is the entry's one timestamp. A nested element that has its own\n * timestamp prop (e.g. `chat-message`'s `timestamp`) should leave it unset —\n * setting both renders the same time twice.\n *\n * `label` is a free-text alternative for a timeline whose axis is not a wall\n * clock — a year, an era, a phase. It wins over `datetime` when both are set.\n * Slot `label` instead when it needs its own styling, since a property is\n * rendered inside this component's shadow DOM and cannot be reached from\n * outside.\n *\n * `alternating` is set by `timeline-container` and should not be set by hand:\n * it switches the entry to three columns — label, line, body — with the sides\n * swapping on every second entry. The entry fills whatever height it is given,\n * so the line spans it rather than only its content — do not override the\n * host's `display` from outside, since a light-DOM rule beats the `:host`\n * declaration this relies on.\n *\n * The dot's `color` types the entry using the shared status-pill palette —\n * `primary` by default, plus `neutral`, `info`, `success`, `warning`, and\n * `danger`.\n *\n * Set `compact` for dense, one-line system-status entries: it tightens the\n * vertical spacing and renders the content smaller and muted.\n *\n * Set `running` to replace the dot with an animated gray ring spinner,\n * indicating the entry represents in-progress work; `color` has no visible\n * effect while `running` is set.\n *\n * @element timeline-entry\n * @slot headline - Optional headline/title for the event.\n * @slot label - Optional replacement for the `label` property, for a label that\n * needs its own styling.\n * @slot - The event content; nest any elements here.\n */\n@customElement(\"timeline-entry\")\nexport class TimelineEntry extends LitElement {\n /** ISO 8601 or SQLite datetime string, rendered as a relative time. */\n @property() datetime: string | null = null;\n\n /** Free-text label shown in place of the relative time; wins over `datetime`. */\n @property() label: string | null = null;\n\n /**\n * Three-column alternating presentation. Set by `timeline-container` from its\n * own `layout`; setting it directly is not supported.\n */\n @property({ type: Boolean, reflect: true }) alternating = false;\n\n /**\n * Visual type of the entry's dot, from the shared status-pill palette:\n * `primary` (default), `neutral`, `info`, `success`, `warning`, or `danger`.\n */\n @property() color: StatusPillColor = \"primary\";\n\n /**\n * Dense, one-line presentation for system-status entries: tighter vertical\n * spacing and smaller, muted content.\n */\n @property({ type: Boolean, reflect: true }) compact = false;\n\n /**\n * Shows an animated ring spinner in place of the dot, indicating the entry\n * represents in-progress work. Overrides `color` while set — the spinner\n * always uses the muted/gray palette.\n */\n @property({ type: Boolean, reflect: true }) running = false;\n\n /** Whether the headline slot currently has assigned content. */\n @state() private _hasHeadline = false;\n\n /** Whether the label slot currently has assigned content. */\n @state() private _hasLabel = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .entry {\n display: flex;\n gap: 0.75rem;\n }\n .rail {\n position: relative;\n flex: 0 0 auto;\n width: 0.75rem;\n }\n .line {\n position: absolute;\n left: 50%;\n width: 2px;\n transform: translateX(-50%);\n background: var(--ui-border, #e2e8f0);\n }\n .line-top {\n top: 0;\n height: 0.5rem;\n }\n .line-bottom {\n top: 0.5rem;\n bottom: 0;\n }\n .dot {\n position: absolute;\n top: 0.125rem;\n left: 50%;\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-50%);\n border-radius: 9999px;\n /* Same lighter-on-top token gradient as map-circle/user-avatar; the\n base color is swapped per the color property via the private\n --_dot var. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #000000) 100%\n );\n }\n .dot.neutral {\n --_dot: var(--ui-text-muted, #64748b);\n }\n .dot.info {\n --_dot: var(--ui-info, #0ea5e9);\n }\n .dot.primary {\n --_dot: var(--ui-primary, #4f46e5);\n }\n .dot.success {\n --_dot: var(--ui-success, #16a34a);\n }\n .dot.warning {\n --_dot: var(--ui-warning, #d97706);\n }\n .dot.danger {\n --_dot: var(--ui-danger, #dc2626);\n }\n .spinner {\n position: absolute;\n top: 0.125rem;\n left: 0;\n display: block;\n width: 0.75rem;\n height: 0.75rem;\n border-radius: 9999px;\n /* Opaque backing so the connecting line is masked exactly like it is\n behind the solid .dot, instead of showing through the ring's\n hollow center and corners. */\n background: var(--ui-surface, #ffffff);\n }\n .spinner svg {\n display: block;\n width: 100%;\n height: 100%;\n }\n .spinner-track {\n fill: none;\n stroke: color-mix(in srgb, var(--ui-text-muted, #64748b) 25%, transparent);\n stroke-width: 3;\n }\n .spinner-arc {\n fill: none;\n stroke: var(--ui-text-muted, #64748b);\n stroke-width: 3;\n stroke-linecap: round;\n /* r=9 gives a 56.55-unit circumference. Keeping the dash and gap\n total equal to that circumference makes the fixed-length arc loop\n seamlessly while its dash offset advances around the static ring. */\n stroke-dasharray: 42.41 14.14;\n animation: spinner-orbit 0.8s linear infinite;\n }\n @keyframes spinner-orbit {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: -56.55;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .spinner-arc {\n animation: none;\n }\n }\n @media (forced-colors: active) {\n .spinner {\n background: Canvas;\n }\n .spinner-track {\n stroke: GrayText;\n }\n .spinner-arc {\n stroke: CanvasText;\n }\n }\n :host(:first-child) .line-top {\n display: none;\n }\n :host(:last-child) .line-bottom {\n display: none;\n }\n .body {\n flex: 1 1 auto;\n min-width: 0;\n padding-bottom: 1.5rem;\n }\n :host(:last-child) .body {\n padding-bottom: 0;\n }\n .head {\n display: flex;\n align-items: baseline;\n gap: 0.5rem;\n flex-wrap: wrap;\n }\n .headline {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .headline.empty {\n display: none;\n }\n .time {\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text-muted, #64748b);\n }\n .content {\n margin-top: 0.25rem;\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text, #0f172a);\n }\n :host([compact]) .body {\n padding-bottom: 0.5rem;\n }\n :host([compact]:last-child) .body {\n padding-bottom: 0;\n }\n :host([compact]) .content {\n margin-top: 0.125rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n color: var(--ui-text-muted, #64748b);\n }\n .time.empty {\n display: none;\n }\n\n /*\n * Alternating layout. minmax(0, 1fr) rather than a bare 1fr: an\n * auto-sized track grows to its content's minimum width, which would\n * push the middle column - and with it the line and dot - off center.\n */\n /* A grid host so its single auto row stretches to whatever height the\n consumer gives the entry. The line is drawn inside that row, so\n without this it spans only the content and leaves gaps between\n consecutive entries. Flex does not do this: with a content-sized\n height there is no free space for flex-grow to distribute. */\n :host([alternating]) {\n display: grid;\n }\n :host([alternating]) .entry {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n align-items: center;\n column-gap: 1.5rem;\n }\n :host([alternating]) .meta,\n :host([alternating]) .rail,\n :host([alternating]) .body {\n grid-row: 1;\n }\n :host([alternating]) .meta {\n grid-column: 1;\n justify-self: end;\n text-align: right;\n }\n :host([alternating]) .rail {\n grid-column: 2;\n align-self: stretch;\n }\n :host([alternating]) .body {\n grid-column: 3;\n padding: 1.5rem 0;\n }\n :host([alternating]:nth-child(even)) .meta {\n grid-column: 3;\n justify-self: start;\n text-align: left;\n }\n :host([alternating]:nth-child(even)) .body {\n grid-column: 1;\n }\n /* The dot marks the middle of the entry rather than its headline, and\n the line runs the entry's full height so consecutive entries join. */\n :host([alternating]) .dot {\n top: 50%;\n transform: translate(-50%, -50%);\n }\n :host([alternating]) .spinner {\n top: 50%;\n transform: translateY(-50%);\n }\n :host([alternating]) .line-top {\n top: 0;\n height: 50%;\n }\n :host([alternating]) .line-bottom {\n top: 50%;\n bottom: 0;\n }\n :host([alternating]) .time {\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-medium, 500);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n }\n `,\n ];\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute(\"role\")) this.setAttribute(\"role\", \"listitem\");\n }\n\n /**\n * The entry's one time/label element: a slotted label, else the `label`\n * property, else a relative time. Placed inline beside the headline in the\n * default layout and in its own column when alternating.\n */\n private _renderMeta() {\n const fallback =\n this.label !== null && this.label !== \"\"\n ? html`${this.label}`\n : this.datetime\n ? html`<relative-time datetime=${this.datetime}></relative-time>`\n : nothing;\n // Collapsed rather than omitted when there is nothing to show: the slot has\n // to stay in the tree for its slotchange to report late-assigned content,\n // but an empty span would otherwise still claim the head row's gap.\n const empty = fallback === nothing && !this._hasLabel;\n return html`<span class=\"time ${empty ? \"empty\" : \"\"}\">\n <slot name=\"label\" @slotchange=${this._onLabelSlotChange}>${fallback}</slot>\n </span>`;\n }\n\n /** Tracks whether the label slot has content, so an empty one can collapse. */\n private _onLabelSlotChange(event: Event): void {\n this._hasLabel = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n /** Collapses the headline when nothing is slotted so the time sits alone. */\n private _onHeadlineSlotChange(event: Event): void {\n this._hasHeadline = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n override render() {\n return html`\n <div class=\"entry\">\n ${this.alternating ? html`<div class=\"meta\">${this._renderMeta()}</div>` : nothing}\n <div class=\"rail\" aria-hidden=\"true\">\n <span class=\"line line-top\"></span>\n <span class=\"line line-bottom\"></span>\n ${this.running\n ? html`\n <span class=\"spinner\">\n <svg viewBox=\"0 0 24 24\">\n <circle class=\"spinner-track\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <circle class=\"spinner-arc\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n </svg>\n </span>\n `\n : html`<span class=\"dot ${this.color}\"></span>`}\n </div>\n <div class=\"body\">\n <div class=\"head\">\n <span class=\"headline ${this._hasHeadline ? \"\" : \"empty\"}\">\n <slot name=\"headline\" @slotchange=${this._onHeadlineSlotChange}></slot>\n </span>\n ${this.alternating ? nothing : this._renderMeta()}\n </div>\n <div class=\"content\"><slot></slot></div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"timeline-entry\": TimelineEntry;\n }\n}\n"]}
1
+ {"version":3,"file":"timeline-entry.js","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,uEAAuE;QAC3D,aAAQ,GAAkB,IAAI,CAAC;QAE3C,iFAAiF;QACrE,UAAK,GAAkB,IAAI,CAAC;QAExC;;;WAGG;QACyC,gBAAW,GAAG,KAAK,CAAC;QAEhE;;;WAGG;QACS,UAAK,GAAoB,SAAS,CAAC;QAE/C;;;WAGG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D;;;;WAIG;QACyC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CAAC;8CAAiB;AAOhB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAiB;AAG3C;IAAhB,KAAK,EAAE;mDAA8B;AAGrB;IAAhB,KAAK,EAAE;gDAA2B;AApCxB,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA2WzB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport \"./relative-time.js\";\nimport { tokens } from \"./tokens.js\";\nimport type { StatusPillColor } from \"./status-pill.js\";\n\n/**\n * One event on a `timeline-container`: a dot on the vertical line, an optional\n * headline, a relative timestamp (\"3 hours ago\"), and freely nested content.\n * The connecting line is drawn here — its segment above the dot is hidden on\n * the first entry and the segment below is hidden on the last, so the line caps\n * exactly at the first and last dots. Only meaningful inside a\n * `timeline-container`; demonstrated through it.\n *\n * `datetime` is the entry's one timestamp. A nested element that has its own\n * timestamp prop (e.g. `chat-message`'s `timestamp`) should leave it unset —\n * setting both renders the same time twice.\n *\n * `label` is a free-text alternative for a timeline whose axis is not a wall\n * clock — a year, an era, a phase. It wins over `datetime` when both are set.\n * Slot `label` instead when it needs its own styling, since a property is\n * rendered inside this component's shadow DOM and cannot be reached from\n * outside.\n *\n * `alternating` is set by `timeline-container` and should not be set by hand:\n * it switches the entry to three columns — label, line, body — with the sides\n * swapping on every second entry. The entry fills whatever height it is given,\n * so the line spans it rather than only its content — do not override the\n * host's `display` from outside, since a light-DOM rule beats the `:host`\n * declaration this relies on.\n *\n * The dot's `color` types the entry using the shared status-pill palette —\n * `primary` by default, plus `neutral`, `info`, `success`, `warning`, and\n * `danger`.\n *\n * Set `compact` for dense, one-line system-status entries: it tightens the\n * vertical spacing and renders the content smaller and muted.\n *\n * Set `running` to replace the dot with an animated gray ring spinner,\n * indicating the entry represents in-progress work; `color` has no visible\n * effect while `running` is set.\n *\n * @element timeline-entry\n * @slot headline - Optional headline/title for the event.\n * @slot label - Optional replacement for the `label` property, for a label that\n * needs its own styling.\n * @slot - The event content; nest any elements here.\n */\n@customElement(\"timeline-entry\")\nexport class TimelineEntry extends LitElement {\n /** ISO 8601 or SQLite datetime string, rendered as a relative time. */\n @property() datetime: string | null = null;\n\n /** Free-text label shown in place of the relative time; wins over `datetime`. */\n @property() label: string | null = null;\n\n /**\n * Three-column alternating presentation. Set by `timeline-container` from its\n * own `layout`; setting it directly is not supported.\n */\n @property({ type: Boolean, reflect: true }) alternating = false;\n\n /**\n * Visual type of the entry's dot, from the shared status-pill palette:\n * `primary` (default), `neutral`, `info`, `success`, `warning`, or `danger`.\n */\n @property() color: StatusPillColor = \"primary\";\n\n /**\n * Dense, one-line presentation for system-status entries: tighter vertical\n * spacing and smaller, muted content.\n */\n @property({ type: Boolean, reflect: true }) compact = false;\n\n /**\n * Shows an animated ring spinner in place of the dot, indicating the entry\n * represents in-progress work. Overrides `color` while set — the spinner\n * always uses the muted/gray palette.\n */\n @property({ type: Boolean, reflect: true }) running = false;\n\n /** Whether the headline slot currently has assigned content. */\n @state() private _hasHeadline = false;\n\n /** Whether the label slot currently has assigned content. */\n @state() private _hasLabel = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .entry {\n display: flex;\n gap: 0.75rem;\n }\n .rail {\n position: relative;\n flex: 0 0 auto;\n width: 0.75rem;\n }\n .line {\n position: absolute;\n left: 50%;\n width: 2px;\n transform: translateX(-50%);\n background: var(--ui-border, #e2e8f0);\n }\n .line-top {\n top: 0;\n height: 0.5rem;\n }\n .line-bottom {\n top: 0.5rem;\n bottom: 0;\n }\n .dot {\n position: absolute;\n top: 0.125rem;\n left: 50%;\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-50%);\n border-radius: var(--ui-radius-pill, 9999px);\n /* Same lighter-on-top token gradient as map-circle/user-avatar; the\n base color is swapped per the color property via the private\n --_dot var. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #000000) 100%\n );\n }\n .dot.neutral {\n --_dot: var(--ui-text-muted, #64748b);\n }\n .dot.info {\n --_dot: var(--ui-info, #0ea5e9);\n }\n .dot.primary {\n --_dot: var(--ui-primary, #4f46e5);\n }\n .dot.success {\n --_dot: var(--ui-success, #16a34a);\n }\n .dot.warning {\n --_dot: var(--ui-warning, #d97706);\n }\n .dot.danger {\n --_dot: var(--ui-danger, #dc2626);\n }\n .spinner {\n position: absolute;\n top: 0.125rem;\n left: 0;\n display: block;\n width: 0.75rem;\n height: 0.75rem;\n border-radius: var(--ui-radius-pill, 9999px);\n /* Opaque backing so the connecting line is masked exactly like it is\n behind the solid .dot, instead of showing through the ring's\n hollow center and corners. */\n background: var(--ui-surface, #ffffff);\n }\n .spinner svg {\n display: block;\n width: 100%;\n height: 100%;\n }\n .spinner-track {\n fill: none;\n stroke: color-mix(in srgb, var(--ui-text-muted, #64748b) 25%, transparent);\n stroke-width: 3;\n }\n .spinner-arc {\n fill: none;\n stroke: var(--ui-text-muted, #64748b);\n stroke-width: 3;\n stroke-linecap: round;\n /* r=9 gives a 56.55-unit circumference. Keeping the dash and gap\n total equal to that circumference makes the fixed-length arc loop\n seamlessly while its dash offset advances around the static ring. */\n stroke-dasharray: 42.41 14.14;\n animation: spinner-orbit 0.8s linear infinite;\n }\n @keyframes spinner-orbit {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: -56.55;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .spinner-arc {\n animation: none;\n }\n }\n @media (forced-colors: active) {\n .spinner {\n background: Canvas;\n }\n .spinner-track {\n stroke: GrayText;\n }\n .spinner-arc {\n stroke: CanvasText;\n }\n }\n :host(:first-child) .line-top {\n display: none;\n }\n :host(:last-child) .line-bottom {\n display: none;\n }\n .body {\n flex: 1 1 auto;\n min-width: 0;\n padding-bottom: 1.5rem;\n }\n :host(:last-child) .body {\n padding-bottom: 0;\n }\n .head {\n display: flex;\n align-items: baseline;\n gap: 0.5rem;\n flex-wrap: wrap;\n }\n .headline {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .headline.empty {\n display: none;\n }\n .time {\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text-muted, #64748b);\n }\n .content {\n margin-top: 0.25rem;\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text, #0f172a);\n }\n :host([compact]) .body {\n padding-bottom: 0.5rem;\n }\n :host([compact]:last-child) .body {\n padding-bottom: 0;\n }\n :host([compact]) .content {\n margin-top: 0.125rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n color: var(--ui-text-muted, #64748b);\n }\n .time.empty {\n display: none;\n }\n\n /*\n * Alternating layout. minmax(0, 1fr) rather than a bare 1fr: an\n * auto-sized track grows to its content's minimum width, which would\n * push the middle column - and with it the line and dot - off center.\n */\n /* A grid host so its single auto row stretches to whatever height the\n consumer gives the entry. The line is drawn inside that row, so\n without this it spans only the content and leaves gaps between\n consecutive entries. Flex does not do this: with a content-sized\n height there is no free space for flex-grow to distribute. */\n :host([alternating]) {\n display: grid;\n }\n :host([alternating]) .entry {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n align-items: center;\n column-gap: 1.5rem;\n }\n :host([alternating]) .meta,\n :host([alternating]) .rail,\n :host([alternating]) .body {\n grid-row: 1;\n }\n :host([alternating]) .meta {\n grid-column: 1;\n justify-self: end;\n text-align: right;\n }\n :host([alternating]) .rail {\n grid-column: 2;\n align-self: stretch;\n }\n :host([alternating]) .body {\n grid-column: 3;\n padding: 1.5rem 0;\n }\n :host([alternating]:nth-child(even)) .meta {\n grid-column: 3;\n justify-self: start;\n text-align: left;\n }\n :host([alternating]:nth-child(even)) .body {\n grid-column: 1;\n }\n /* The dot marks the middle of the entry rather than its headline, and\n the line runs the entry's full height so consecutive entries join. */\n :host([alternating]) .dot {\n top: 50%;\n transform: translate(-50%, -50%);\n }\n :host([alternating]) .spinner {\n top: 50%;\n transform: translateY(-50%);\n }\n :host([alternating]) .line-top {\n top: 0;\n height: 50%;\n }\n :host([alternating]) .line-bottom {\n top: 50%;\n bottom: 0;\n }\n :host([alternating]) .time {\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-medium, 500);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n }\n `,\n ];\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute(\"role\")) this.setAttribute(\"role\", \"listitem\");\n }\n\n /**\n * The entry's one time/label element: a slotted label, else the `label`\n * property, else a relative time. Placed inline beside the headline in the\n * default layout and in its own column when alternating.\n */\n private _renderMeta() {\n const fallback =\n this.label !== null && this.label !== \"\"\n ? html`${this.label}`\n : this.datetime\n ? html`<relative-time datetime=${this.datetime}></relative-time>`\n : nothing;\n // Collapsed rather than omitted when there is nothing to show: the slot has\n // to stay in the tree for its slotchange to report late-assigned content,\n // but an empty span would otherwise still claim the head row's gap.\n const empty = fallback === nothing && !this._hasLabel;\n return html`<span class=\"time ${empty ? \"empty\" : \"\"}\">\n <slot name=\"label\" @slotchange=${this._onLabelSlotChange}>${fallback}</slot>\n </span>`;\n }\n\n /** Tracks whether the label slot has content, so an empty one can collapse. */\n private _onLabelSlotChange(event: Event): void {\n this._hasLabel = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n /** Collapses the headline when nothing is slotted so the time sits alone. */\n private _onHeadlineSlotChange(event: Event): void {\n this._hasHeadline = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n override render() {\n return html`\n <div class=\"entry\">\n ${this.alternating ? html`<div class=\"meta\">${this._renderMeta()}</div>` : nothing}\n <div class=\"rail\" aria-hidden=\"true\">\n <span class=\"line line-top\"></span>\n <span class=\"line line-bottom\"></span>\n ${this.running\n ? html`\n <span class=\"spinner\">\n <svg viewBox=\"0 0 24 24\">\n <circle class=\"spinner-track\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <circle class=\"spinner-arc\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n </svg>\n </span>\n `\n : html`<span class=\"dot ${this.color}\"></span>`}\n </div>\n <div class=\"body\">\n <div class=\"head\">\n <span class=\"headline ${this._hasHeadline ? \"\" : \"empty\"}\">\n <slot name=\"headline\" @slotchange=${this._onHeadlineSlotChange}></slot>\n </span>\n ${this.alternating ? nothing : this._renderMeta()}\n </div>\n <div class=\"content\"><slot></slot></div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"timeline-entry\": TimelineEntry;\n }\n}\n"]}
package/dist/tokens.css CHANGED
@@ -48,6 +48,8 @@
48
48
  --ui-overlay: rgb(15 23 42 / 0.45);
49
49
  --ui-radius: 0.5rem;
50
50
  --ui-radius-sm: 0.25rem;
51
+ --ui-radius-pill: 9999px;
52
+ --ui-radius-circle: 50%;
51
53
  --ui-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
52
54
  --ui-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
53
55
  --ui-focus-ring: 0 0 0 3px rgb(79 70 229 / 0.35);
@@ -69,7 +71,7 @@
69
71
  }
70
72
 
71
73
  @media (prefers-color-scheme: dark) {
72
- :root:not([data-theme="light"]):not([data-theme="gradient"]) {
74
+ :root:not([data-theme="light"]):not([data-theme="gradient"]):not([data-theme="metro"]) {
73
75
  color-scheme: dark;
74
76
  --ui-primary: #6366f1;
75
77
  --ui-primary-hover: #818cf8;
@@ -137,6 +139,7 @@
137
139
  --ui-button-secondary-background-active: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
138
140
  --ui-button-secondary-border: #cbd5e1;
139
141
  --ui-button-secondary-border-hover: #94a3b8;
142
+ --ui-button-secondary-surface-muted: var(--ui-button-secondary-background-hover);
140
143
  --ui-button-highlight: inset 0 1px 0 rgb(255 255 255 / 0.35);
141
144
  --ui-button-text-shadow: 0 1px 1px rgb(0 0 0 / 0.25);
142
145
  --ui-button-accent: #4338ca;
@@ -147,3 +150,16 @@
147
150
  --ui-toast-highlight: inset 0 1px 0 rgb(255 255 255 / 0.35);
148
151
  --ui-toast-text-shadow: 0 1px 1px rgb(0 0 0 / 0.25);
149
152
  }
153
+
154
+ :root[data-theme="metro"] {
155
+ color-scheme: light;
156
+ --ui-primary: #3274d0;
157
+ --ui-primary-hover: #2559a8;
158
+ --ui-focus-ring: 0 0 0 2px #3274d0;
159
+ --ui-radius: 0;
160
+ --ui-radius-sm: 0;
161
+ --ui-radius-pill: 0;
162
+ --ui-radius-circle: 0;
163
+ --ui-shadow: 0 0 0 1px rgb(15 23 42 / 0.12);
164
+ --ui-shadow-lg: 0 0 0 1px rgb(15 23 42 / 0.18);
165
+ }
package/dist/tokens.d.ts CHANGED
@@ -33,6 +33,33 @@ export declare const darkTokenValues: Record<string, string>;
33
33
  * shade darker than the gradient's dark stop for a defining edge.
34
34
  */
35
35
  export declare const gradientTokenValues: Record<string, string>;
36
+ /**
37
+ * "Metro" theme overrides, applied via `data-theme="metro"` on `<html>` (see
38
+ * `generate-tokens-css.mjs`) — forces `color-scheme: light` like the `"light"`
39
+ * and `"gradient"` overrides, and strips the roundness and depth off the flat
40
+ * light palette to leave hard-edged surfaces over a blue accent, after the
41
+ * dense square-cornered look of the early social bookmarking sites.
42
+ *
43
+ * This is the first theme to override shape rather than only color, so the
44
+ * "shape/type tokens are theme-independent" rule `darkTokenValues` notes above
45
+ * holds for every theme except this one (see `docs/design-language.md`).
46
+ * Squaring the design system means squaring the deliberate pill and circle
47
+ * shapes too — chips, avatars, dots, slider thumbs — which is why those read
48
+ * `--ui-radius-pill`/`--ui-radius-circle` rather than hardcoding `9999px`/`50%`
49
+ * (a literal would silently opt that shape out of the theme).
50
+ *
51
+ * One residual is genuinely out of reach: `price-history-chart` rounds its bars
52
+ * with an SVG `rx` presentation attribute, which cannot take a `var()`, so
53
+ * those stay slightly rounded under metro.
54
+ *
55
+ * The shadows flatten to a hairline ring rather than to `none`. Dropping them
56
+ * outright would leave `slide-panel` — the only overlay with no border of its
57
+ * own — as an invisible white-on-white edge; every other consumer of
58
+ * `--ui-shadow*` either pairs it with `1px solid var(--ui-border)` or applies
59
+ * it on hover/active over an already-bordered control. A hard 1px ring keeps
60
+ * that separation while removing the blur and the faked depth.
61
+ */
62
+ export declare const metroTokenValues: Record<string, string>;
36
63
  /**
37
64
  * Historically a shared `:host { --ui-x: var(--ui-x, fallback); } ` block,
38
65
  * re-declaring every token on each component's own host element as a
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAyI9C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqBlD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkCtD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,yBAAQ,CAAC"}
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgJ9C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqBlD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAyCtD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAanD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,yBAAQ,CAAC"}
package/dist/tokens.js CHANGED
@@ -112,6 +112,13 @@ export const tokenValues = {
112
112
  // Shape / depth
113
113
  "--ui-radius": "0.5rem", // rounded-lg
114
114
  "--ui-radius-sm": "0.25rem", // rounded
115
+ // Deliberate pill/circle shapes — a chip, an avatar, a slider thumb, a dot.
116
+ // Tokenized rather than hardcoded so a theme that squares the design system
117
+ // (metro) can reach them too; a literal 9999px/50% silently opts that shape
118
+ // out of every theme. Use these only where the shape is the point, not as a
119
+ // heavier --ui-radius.
120
+ "--ui-radius-pill": "9999px",
121
+ "--ui-radius-circle": "50%",
115
122
  "--ui-shadow": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", // shadow-md
116
123
  "--ui-shadow-lg": "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)", // shadow-xl
117
124
  "--ui-focus-ring": "0 0 0 3px rgb(79 70 229 / 0.35)",
@@ -203,6 +210,13 @@ export const gradientTokenValues = {
203
210
  "--ui-button-secondary-background-active": "linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%)", // reversed 100 -> 50
204
211
  "--ui-button-secondary-border": "#cbd5e1", // slate-300
205
212
  "--ui-button-secondary-border-hover": "#94a3b8", // slate-400
213
+ // button-group's unchecked segments, pagination-nav's prev/next buttons, and
214
+ // radio-cards/radio-pills' checked background read this rather than
215
+ // --ui-button-secondary-background (see tokens above). Left flat they were
216
+ // the one "secondary" surface that stayed matte while every actual secondary
217
+ // button turned glossy, so it tracks the hover gradient rather than a
218
+ // separate literal that could drift out of step with it.
219
+ "--ui-button-secondary-surface-muted": "var(--ui-button-secondary-background-hover)",
206
220
  "--ui-button-highlight": "inset 0 1px 0 rgb(255 255 255 / 0.35)", // glossy top edge
207
221
  "--ui-button-text-shadow": "0 1px 1px rgb(0 0 0 / 0.25)", // legibility on primary/danger
208
222
  "--ui-button-accent": "#4338ca", // indigo-700, matches --ui-button-border
@@ -216,6 +230,46 @@ export const gradientTokenValues = {
216
230
  "--ui-toast-highlight": "inset 0 1px 0 rgb(255 255 255 / 0.35)", // glossy top edge, same as --ui-button-highlight
217
231
  "--ui-toast-text-shadow": "0 1px 1px rgb(0 0 0 / 0.25)", // legibility, same as --ui-button-text-shadow
218
232
  };
233
+ /**
234
+ * "Metro" theme overrides, applied via `data-theme="metro"` on `<html>` (see
235
+ * `generate-tokens-css.mjs`) — forces `color-scheme: light` like the `"light"`
236
+ * and `"gradient"` overrides, and strips the roundness and depth off the flat
237
+ * light palette to leave hard-edged surfaces over a blue accent, after the
238
+ * dense square-cornered look of the early social bookmarking sites.
239
+ *
240
+ * This is the first theme to override shape rather than only color, so the
241
+ * "shape/type tokens are theme-independent" rule `darkTokenValues` notes above
242
+ * holds for every theme except this one (see `docs/design-language.md`).
243
+ * Squaring the design system means squaring the deliberate pill and circle
244
+ * shapes too — chips, avatars, dots, slider thumbs — which is why those read
245
+ * `--ui-radius-pill`/`--ui-radius-circle` rather than hardcoding `9999px`/`50%`
246
+ * (a literal would silently opt that shape out of the theme).
247
+ *
248
+ * One residual is genuinely out of reach: `price-history-chart` rounds its bars
249
+ * with an SVG `rx` presentation attribute, which cannot take a `var()`, so
250
+ * those stay slightly rounded under metro.
251
+ *
252
+ * The shadows flatten to a hairline ring rather than to `none`. Dropping them
253
+ * outright would leave `slide-panel` — the only overlay with no border of its
254
+ * own — as an invisible white-on-white edge; every other consumer of
255
+ * `--ui-shadow*` either pairs it with `1px solid var(--ui-border)` or applies
256
+ * it on hover/active over an already-bordered control. A hard 1px ring keeps
257
+ * that separation while removing the blur and the faked depth.
258
+ */
259
+ export const metroTokenValues = {
260
+ "--ui-primary": "#3274d0", // the del.icio.us blue; no Tailwind equivalent
261
+ "--ui-primary-hover": "#2559a8",
262
+ "--ui-focus-ring": "0 0 0 2px #3274d0", // solid and crisp, not the default 3px translucent ring
263
+ "--ui-radius": "0",
264
+ "--ui-radius-sm": "0",
265
+ "--ui-radius-pill": "0",
266
+ "--ui-radius-circle": "0",
267
+ // Hairline rings (slate-900 at low alpha) rather than blurred drop shadows:
268
+ // separation without depth. -lg is a touch stronger, matching the default
269
+ // pair's relative weighting.
270
+ "--ui-shadow": "0 0 0 1px rgb(15 23 42 / 0.12)",
271
+ "--ui-shadow-lg": "0 0 0 1px rgb(15 23 42 / 0.18)",
272
+ };
219
273
  /**
220
274
  * Historically a shared `:host { --ui-x: var(--ui-x, fallback); } ` block,
221
275
  * re-declaring every token on each component's own host element as a