@f-ewald/components 1.37.5 → 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 (73) 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/distribution-chart.js +1 -1
  6. package/dist/distribution-chart.js.map +1 -1
  7. package/dist/dropdown-button.js +1 -1
  8. package/dist/dropdown-button.js.map +1 -1
  9. package/dist/form-select.js +1 -1
  10. package/dist/form-select.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/kanban-board.js +1 -1
  16. package/dist/kanban-board.js.map +1 -1
  17. package/dist/kanban-column.js +1 -1
  18. package/dist/kanban-column.js.map +1 -1
  19. package/dist/link-card.js +1 -1
  20. package/dist/link-card.js.map +1 -1
  21. package/dist/loading-dots.js +1 -1
  22. package/dist/loading-dots.js.map +1 -1
  23. package/dist/multi-select.js +1 -1
  24. package/dist/multi-select.js.map +1 -1
  25. package/dist/photo-gallery.js +3 -3
  26. package/dist/photo-gallery.js.map +1 -1
  27. package/dist/radio-pills.js +1 -1
  28. package/dist/radio-pills.js.map +1 -1
  29. package/dist/range-slider.js +5 -5
  30. package/dist/range-slider.js.map +1 -1
  31. package/dist/scroll-dots.js +1 -1
  32. package/dist/scroll-dots.js.map +1 -1
  33. package/dist/slide-panel.js +1 -1
  34. package/dist/slide-panel.js.map +1 -1
  35. package/dist/stat-meter.js +1 -1
  36. package/dist/stat-meter.js.map +1 -1
  37. package/dist/status-pill.js +1 -1
  38. package/dist/status-pill.js.map +1 -1
  39. package/dist/timeline-entry.js +2 -2
  40. package/dist/timeline-entry.js.map +1 -1
  41. package/dist/tokens.css +17 -1
  42. package/dist/tokens.d.ts +27 -0
  43. package/dist/tokens.d.ts.map +1 -1
  44. package/dist/tokens.js +54 -0
  45. package/dist/tokens.js.map +1 -1
  46. package/dist/ui-button.js +2 -2
  47. package/dist/ui-button.js.map +1 -1
  48. package/dist/user-avatar.js +2 -2
  49. package/dist/user-avatar.js.map +1 -1
  50. package/dist/utils/transport-controls.js +5 -5
  51. package/dist/utils/transport-controls.js.map +1 -1
  52. package/docs/calendar-day.md +1 -0
  53. package/docs/design-language.md +21 -4
  54. package/docs/distribution-chart.md +1 -0
  55. package/docs/dropdown-button.md +1 -0
  56. package/docs/form-select.md +1 -0
  57. package/docs/kanban-board.md +1 -0
  58. package/docs/kanban-column.md +1 -0
  59. package/docs/link-card.md +1 -0
  60. package/docs/loading-dots.md +1 -0
  61. package/docs/multi-select.md +1 -0
  62. package/docs/photo-gallery.md +1 -0
  63. package/docs/radio-pills.md +1 -0
  64. package/docs/range-slider.md +2 -0
  65. package/docs/scroll-dots.md +1 -0
  66. package/docs/slide-panel.md +1 -0
  67. package/docs/stat-meter.md +1 -0
  68. package/docs/status-pill.md +1 -0
  69. package/docs/timeline-entry.md +1 -0
  70. package/docs/ui-button.md +1 -0
  71. package/docs/user-avatar.md +1 -0
  72. package/llms.txt +25 -20
  73. package/package.json +1 -1
@@ -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,IA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A6B;AAMI;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAqB;AAMpD;IAAX,QAAQ,EAAE;4CAAoC;AAMH;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,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: 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;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,WAAW,EAAE;;;;;KAKxD,CAAC;IACJ,CAAC;CACF,CAAA;AAzWa;IAAX,QAAQ,EAAE;+CAAgC;AAG/B;IAAX,QAAQ,EAAE;4CAA6B;AAMI;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAqB;AAMpD;IAAX,QAAQ,EAAE;4CAAoC;AAMH;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,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
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;GA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D,EAAE,mBAAmB;IACzG,sBAAsB,EAAE,uCAAuC,EAAE,iDAAiD;IAClH,wBAAwB,EAAE,6BAA6B,EAAE,8CAA8C;CACxG,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from \"lit\";\n\n/**\n * Design token values, sourced from Tailwind v4's default theme palette.\n * Each entry maps a `--ui-*` custom property name to its default value.\n * These are the same values baked in as `var(--ui-*, <fallback>)` fallbacks\n * throughout component styles, so components render correctly with zero\n * external CSS. Consumers may override any of these by setting the custom\n * property on `:root` or an ancestor element (see `tokens.css`).\n */\nexport const tokenValues: Record<string, string> = {\n // Colors\n \"--ui-primary\": \"#4f46e5\", // indigo-600\n \"--ui-primary-hover\": \"#4338ca\", // indigo-700\n // Button-specific background/border hooks: default to the flat --ui-primary\n // / --ui-danger tokens above unchanged, so those stay the single source of\n // truth for every other component. Overriding just these lets a theme opt\n // ui-button into a gradient (or any other) background without touching\n // component markup; --ui-button-border/--ui-button-danger-border default\n // to transparent (today's look) and are meant to be paired with a shade\n // darker than the gradient's dark stop when one is set. The `-active`\n // variants default to whatever `-background` already resolved to (so a\n // solid override still applies while pressed) — a gradient theme should\n // set them to the same stops in reverse, for a pressed/\"indented\" look.\n \"--ui-button-background\": \"var(--ui-primary, #4f46e5)\",\n \"--ui-button-background-hover\": \"var(--ui-primary-hover, #4338ca)\",\n \"--ui-button-background-active\": \"var(--ui-button-background, var(--ui-primary, #4f46e5))\",\n \"--ui-button-border\": \"transparent\",\n // The bordered, transparent-background secondary variant's equivalents —\n // shared with confirm-dialog's Cancel button, which is the same visual\n // pattern. Defaults reproduce today's literal secondary styling exactly\n // (no background at any state, border colors matching --ui-border /\n // --ui-text-muted), so a theme only needs to override these to make\n // secondary/Cancel buttons match a primary/danger gradient theme.\n \"--ui-button-secondary-background\": \"none\",\n \"--ui-button-secondary-background-hover\": \"none\",\n \"--ui-button-secondary-background-active\": \"var(--ui-button-secondary-background, none)\",\n \"--ui-button-secondary-border\": \"var(--ui-border, #e2e8f0)\",\n \"--ui-button-secondary-border-hover\": \"var(--ui-text-muted, #64748b)\",\n // A muted-gray surface used wherever something already paints\n // --ui-surface-muted as a state indicator in flat mode — button-group's\n // unchecked-segment hover, pagination-nav's button hover, and\n // radio-cards/radio-pills' checked background — which is a genuinely\n // different default than secondary's borderless flat hover, so it can't\n // reuse --ui-button-secondary-background-hover's \"none\" default.\n \"--ui-button-secondary-surface-muted\": \"var(--ui-surface-muted, #f8fafc)\",\n // Shared by both primary/danger — a purely cosmetic gloss/legibility pair,\n // not color-specific, so one token covers both variants. `-highlight` is a\n // full box-shadow value (e.g. `inset 0 1px 0 rgb(255 255 255 / 0.35)`) for\n // a glossy top edge, defaulting to a fully transparent (so invisible)\n // shadow rather than the keyword `none` — some usages combine it with\n // another literal shadow in a comma-separated list, where a bare `none`\n // item is invalid CSS and would zero out the *whole* declaration.\n // `-text-shadow` is a full text-shadow value for label legibility against\n // a gradient's lighter stop, always used standalone, so it keeps `none`.\n \"--ui-button-highlight\": \"0 0 0 0 transparent\",\n \"--ui-button-text-shadow\": \"none\",\n // A solid stand-in for the same accent, for spots that can't render a\n // background gradient at all — a native <input>'s accent-color only\n // accepts a plain color, and a hard-stop background gradient (e.g.\n // range-slider's filled track) can't nest another gradient inside its own\n // color-stop list. Consumers that theme the buttons into a gradient should\n // set this to the gradient's dark stop, so these non-button accents (radio\n // selection indicators, the range-slider track/thumb) stay visually\n // coordinated with it even though they can't literally paint a gradient.\n \"--ui-button-accent\": \"var(--ui-primary, #4f46e5)\",\n \"--ui-info\": \"#0ea5e9\", // sky-500\n \"--ui-info-hover\": \"#0284c7\", // sky-600\n \"--ui-danger\": \"#dc2626\", // red-600\n \"--ui-danger-hover\": \"#b91c1c\", // red-700\n \"--ui-button-danger-background\": \"var(--ui-danger, #dc2626)\",\n \"--ui-button-danger-background-hover\": \"var(--ui-danger-hover, #b91c1c)\",\n \"--ui-button-danger-background-active\":\n \"var(--ui-button-danger-background, var(--ui-danger, #dc2626))\",\n \"--ui-button-danger-border\": \"transparent\",\n \"--ui-success\": \"#16a34a\", // green-600\n \"--ui-warning\": \"#d97706\", // amber-600\n \"--ui-warning-hover\": \"#b45309\", // amber-700\n // toast-notification's per-variant background hooks: default to the flat\n // --ui-success/--ui-danger/--ui-info/--ui-warning tokens unchanged, so\n // those stay the single source of truth for every other component —\n // the same pattern as --ui-button-background/--ui-button-danger-background\n // above. `-highlight`/`-text-shadow` are the same glossy-top-edge /\n // legibility-shadow pair as --ui-button-highlight/--ui-button-text-shadow,\n // kept as separate tokens so a theme can gloss toasts and buttons\n // independently.\n \"--ui-toast-success-background\": \"var(--ui-success, #16a34a)\",\n \"--ui-toast-error-background\": \"var(--ui-danger, #dc2626)\",\n \"--ui-toast-info-background\": \"var(--ui-info, #0ea5e9)\",\n \"--ui-toast-warning-background\": \"var(--ui-warning, #d97706)\",\n \"--ui-toast-highlight\": \"0 0 0 0 transparent\",\n \"--ui-toast-text-shadow\": \"none\",\n // AI accent sweep — the four stops of the animated multi-hue ring\n // ui-button's `ai` modifier draws around a button (and the only place a\n // rainbow reads as meaning \"this action is AI-powered\" rather than a\n // semantic state). Ordered around the color wheel and looping back to\n // stop 1, so the sweep is seamless; --ui-ai-2 is --ui-primary's own\n // indigo, anchoring the ring to the rest of the palette. Overriding these\n // four retunes every AI button at once.\n \"--ui-ai-1\": \"#38bdf8\", // sky-400\n \"--ui-ai-2\": \"#6366f1\", // indigo-500\n \"--ui-ai-3\": \"#d946ef\", // fuchsia-500\n \"--ui-ai-4\": \"#fbbf24\", // amber-400\n \"--ui-on-accent\": \"#ffffff\",\n \"--ui-text\": \"#0f172a\", // slate-900\n \"--ui-text-muted\": \"#64748b\", // slate-500\n \"--ui-border\": \"#e2e8f0\", // slate-200\n \"--ui-surface\": \"#ffffff\", // white\n \"--ui-surface-muted\": \"#f8fafc\", // slate-50\n \"--ui-highlight\": \"#fde68a\", // amber-200 — transient \"just changed\" flash\n \"--ui-tooltip\": \"#0f172a\", // slate-900\n \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.32)\",\n \"--ui-overlay\": \"rgb(15 23 42 / 0.45)\", // slate-900 / 45%\n\n // Shape / depth\n \"--ui-radius\": \"0.5rem\", // rounded-lg\n \"--ui-radius-sm\": \"0.25rem\", // rounded\n \"--ui-shadow\":\n \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\", // shadow-md\n \"--ui-shadow-lg\":\n \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\", // shadow-xl\n \"--ui-focus-ring\": \"0 0 0 3px rgb(79 70 229 / 0.35)\",\n\n // Type\n \"--ui-font\":\n 'ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n \"--ui-font-mono\":\n \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\",\n \"--ui-font-size-lg\": \"1rem\", // text-base\n \"--ui-font-size\": \"0.875rem\", // text-sm\n \"--ui-font-size-sm\": \"0.75rem\", // text-xs\n \"--ui-font-size-xs\": \"0.6875rem\",\n\n // Font weights — the only four weights the system uses.\n \"--ui-font-weight-regular\": \"400\",\n \"--ui-font-weight-medium\": \"500\",\n \"--ui-font-weight-semibold\": \"600\",\n \"--ui-font-weight-bold\": \"700\",\n\n // Line heights — glyph (icon/marker box), tight (headings), normal (body).\n \"--ui-line-height-glyph\": \"1\",\n \"--ui-line-height-tight\": \"1.25\",\n \"--ui-line-height-normal\": \"1.5\",\n\n // Letter spacing / tracking — default and the single widened step.\n \"--ui-tracking-normal\": \"0\",\n \"--ui-tracking-wide\": \"0.04em\",\n};\n\n/**\n * Dark-mode overrides for the same `--ui-*` custom properties, applied by\n * `tokens.css` via `@media (prefers-color-scheme: dark)` and `[data-theme]`\n * (see generate-tokens-css.mjs). Same Tailwind slate scale as the light\n * palette, inverted, with primary/danger/success lightened one step (500\n * instead of 600) for sufficient contrast against dark surfaces. Shape/type\n * tokens are theme-independent and not repeated here.\n */\nexport const darkTokenValues: Record<string, string> = {\n \"--ui-primary\": \"#6366f1\", // indigo-500\n \"--ui-primary-hover\": \"#818cf8\", // indigo-400\n \"--ui-info\": \"#38bdf8\", // sky-400\n \"--ui-info-hover\": \"#7dd3fc\", // sky-300\n \"--ui-danger\": \"#ef4444\", // red-500\n \"--ui-danger-hover\": \"#f87171\", // red-400\n \"--ui-success\": \"#22c55e\", // green-500\n \"--ui-warning\": \"#f59e0b\", // amber-500\n \"--ui-warning-hover\": \"#fbbf24\", // amber-400\n \"--ui-on-accent\": \"#ffffff\",\n \"--ui-text\": \"#f1f5f9\", // slate-100\n \"--ui-text-muted\": \"#94a3b8\", // slate-400\n \"--ui-border\": \"#334155\", // slate-700\n \"--ui-surface\": \"#0f172a\", // slate-900\n \"--ui-surface-muted\": \"#1e293b\", // slate-800\n \"--ui-highlight\": \"#854d0e\", // amber-800 — transient \"just changed\" flash on dark\n \"--ui-tooltip\": \"#020617\", // slate-950\n \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.12)\",\n \"--ui-overlay\": \"rgb(2 6 23 / 0.6)\", // slate-950 / 60%\n \"--ui-focus-ring\": \"0 0 0 3px rgb(99 102 241 / 0.45)\",\n};\n\n/**\n * \"Gradient\" theme overrides, applied via `data-theme=\"gradient\"` on `<html>`\n * (see `generate-tokens-css.mjs`) — forces `color-scheme: light` like the\n * `\"light\"` override and layers a glossy gradient look on top of the flat\n * light palette, using exactly the `--ui-button-*`/`--ui-button-danger-*`/\n * `--ui-button-secondary-*` hooks `ui-button.ts` already reads (see that\n * file's doc comment), plus the `--ui-toast-*` hooks `toast-notification.ts`\n * reads (see its doc comment). Every other token (`--ui-text`, `--ui-surface`,\n * …) is left at its light-mode default — this theme only glosses buttons and\n * toasts by design. Each variant's gradient runs light-to-dark top-to-bottom\n * (`180deg`) across one Tailwind shade step lighter/darker than the flat\n * token so it still reads as \"the same color, glossy\" rather than a\n * different hue; `-hover` shifts the whole pair one shade lighter, `-active`\n * reverses the two stops for a pressed/\"indented\" look, and `-border` is a\n * shade darker than the gradient's dark stop for a defining edge.\n */\nexport const gradientTokenValues: Record<string, string> = {\n \"--ui-button-background\": \"linear-gradient(180deg, #6366f1 0%, #4f46e5 100%)\", // indigo-500 -> 600\n \"--ui-button-background-hover\": \"linear-gradient(180deg, #818cf8 0%, #6366f1 100%)\", // indigo-400 -> 500\n \"--ui-button-background-active\": \"linear-gradient(180deg, #4f46e5 0%, #6366f1 100%)\", // reversed 600 -> 500\n \"--ui-button-border\": \"#4338ca\", // indigo-700\n \"--ui-button-danger-background\": \"linear-gradient(180deg, #ef4444 0%, #dc2626 100%)\", // red-500 -> 600\n \"--ui-button-danger-background-hover\": \"linear-gradient(180deg, #f87171 0%, #ef4444 100%)\", // red-400 -> 500\n \"--ui-button-danger-background-active\": \"linear-gradient(180deg, #dc2626 0%, #ef4444 100%)\", // reversed 600 -> 500\n \"--ui-button-danger-border\": \"#b91c1c\", // red-700\n // Secondary stays neutral gray rather than a saturated hue, matching its\n // flat \"not the primary action\" role, but one shade darker than the\n // original white -> slate-50 pairing: at a small button size, that pair\n // read as flat white with no visible gradient at all. slate-50 -> 100\n // keeps enough contrast to actually look like a gradient while still\n // being clearly lighter/quieter than primary/danger. Border stays\n // slate-300 (a step past the flat slate-200) so its edge still reads\n // against the fill.\n \"--ui-button-secondary-background\": \"linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%)\", // slate-50 -> 100\n \"--ui-button-secondary-background-hover\": \"linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%)\", // slate-100 -> 200\n \"--ui-button-secondary-background-active\": \"linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%)\", // reversed 100 -> 50\n \"--ui-button-secondary-border\": \"#cbd5e1\", // slate-300\n \"--ui-button-secondary-border-hover\": \"#94a3b8\", // slate-400\n \"--ui-button-highlight\": \"inset 0 1px 0 rgb(255 255 255 / 0.35)\", // glossy top edge\n \"--ui-button-text-shadow\": \"0 1px 1px rgb(0 0 0 / 0.25)\", // legibility on primary/danger\n \"--ui-button-accent\": \"#4338ca\", // indigo-700, matches --ui-button-border\n // toast-notification: same light-to-dark, one-shade-step gradient\n // convention as the button variants above; the bottom stop always matches\n // the flat --ui-success/--ui-danger/--ui-info/--ui-warning value exactly.\n \"--ui-toast-success-background\": \"linear-gradient(180deg, #22c55e 0%, #16a34a 100%)\", // green-500 -> 600\n \"--ui-toast-error-background\": \"linear-gradient(180deg, #ef4444 0%, #dc2626 100%)\", // red-500 -> 600\n \"--ui-toast-info-background\": \"linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%)\", // sky-400 -> 500\n \"--ui-toast-warning-background\": \"linear-gradient(180deg, #f59e0b 0%, #d97706 100%)\", // amber-500 -> 600\n \"--ui-toast-highlight\": \"inset 0 1px 0 rgb(255 255 255 / 0.35)\", // glossy top edge, same as --ui-button-highlight\n \"--ui-toast-text-shadow\": \"0 1px 1px rgb(0 0 0 / 0.25)\", // legibility, same as --ui-button-text-shadow\n};\n\n/**\n * Historically a shared `:host { --ui-x: var(--ui-x, fallback); } ` block,\n * re-declaring every token on each component's own host element as a\n * \"materialize the inherited value, or this fallback\" trick. That pattern\n * turned out to be a genuine bug, not a working default: browsers treat\n * `--ui-x: var(--ui-x, ...)` on `:host` as a self-referencing declaration\n * that computes to the guaranteed-invalid value REGARDLESS of what an\n * ancestor (e.g. `:root`) set — the host's own `:host` rule wins the cascade\n * over the ancestor's, so this dropped whatever the app actually set and\n * silently substituted the component's own fallback everywhere. It went\n * unnoticed because every component's fallback happened to equal the\n * intended light-mode value — dark mode (a real, different value at\n * `:root`) exposed it immediately (colors rendering as if no theme were\n * applied at all). Fix: don't redeclare tokens on `:host` — plain\n * inheritance already carries `:root`'s values into every shadow root\n * correctly, and every component already has its own `var(--ui-x, fallback)`\n * at each point of use, so nothing here is needed for the \"zero external\n * CSS\" default to keep working. Kept as an empty export so the existing\n * `static override styles = [tokens, css\\`...\\`]` import in every component\n * keeps compiling.\n */\nexport const tokens = css``;\n"]}
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAA2B;IACjD,SAAS;IACT,cAAc,EAAE,SAAS,EAAE,aAAa;IACxC,oBAAoB,EAAE,SAAS,EAAE,aAAa;IAC9C,4EAA4E;IAC5E,2EAA2E;IAC3E,0EAA0E;IAC1E,uEAAuE;IACvE,yEAAyE;IACzE,wEAAwE;IACxE,sEAAsE;IACtE,uEAAuE;IACvE,wEAAwE;IACxE,wEAAwE;IACxE,wBAAwB,EAAE,4BAA4B;IACtD,8BAA8B,EAAE,kCAAkC;IAClE,+BAA+B,EAAE,yDAAyD;IAC1F,oBAAoB,EAAE,aAAa;IACnC,yEAAyE;IACzE,uEAAuE;IACvE,wEAAwE;IACxE,oEAAoE;IACpE,oEAAoE;IACpE,kEAAkE;IAClE,kCAAkC,EAAE,MAAM;IAC1C,wCAAwC,EAAE,MAAM;IAChD,yCAAyC,EAAE,6CAA6C;IACxF,8BAA8B,EAAE,2BAA2B;IAC3D,oCAAoC,EAAE,+BAA+B;IACrE,8DAA8D;IAC9D,wEAAwE;IACxE,8DAA8D;IAC9D,qEAAqE;IACrE,wEAAwE;IACxE,iEAAiE;IACjE,qCAAqC,EAAE,kCAAkC;IACzE,2EAA2E;IAC3E,2EAA2E;IAC3E,2EAA2E;IAC3E,sEAAsE;IACtE,sEAAsE;IACtE,wEAAwE;IACxE,kEAAkE;IAClE,0EAA0E;IAC1E,yEAAyE;IACzE,uBAAuB,EAAE,qBAAqB;IAC9C,yBAAyB,EAAE,MAAM;IACjC,sEAAsE;IACtE,oEAAoE;IACpE,mEAAmE;IACnE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E,SAAS,EAAE,YAAY;IACvD,oCAAoC,EAAE,SAAS,EAAE,YAAY;IAC7D,6EAA6E;IAC7E,oEAAoE;IACpE,2EAA2E;IAC3E,6EAA6E;IAC7E,sEAAsE;IACtE,yDAAyD;IACzD,qCAAqC,EAAE,6CAA6C;IACpF,uBAAuB,EAAE,uCAAuC,EAAE,kBAAkB;IACpF,yBAAyB,EAAE,6BAA6B,EAAE,+BAA+B;IACzF,oBAAoB,EAAE,SAAS,EAAE,yCAAyC;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,0EAA0E;IAC1E,+BAA+B,EAAE,mDAAmD,EAAE,mBAAmB;IACzG,6BAA6B,EAAE,mDAAmD,EAAE,iBAAiB;IACrG,4BAA4B,EAAE,mDAAmD,EAAE,iBAAiB;IACpG,+BAA+B,EAAE,mDAAmD,EAAE,mBAAmB;IACzG,sBAAsB,EAAE,uCAAuC,EAAE,iDAAiD;IAClH,wBAAwB,EAAE,6BAA6B,EAAE,8CAA8C;CACxG,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,cAAc,EAAE,SAAS,EAAE,+CAA+C;IAC1E,oBAAoB,EAAE,SAAS;IAC/B,iBAAiB,EAAE,mBAAmB,EAAE,wDAAwD;IAChG,aAAa,EAAE,GAAG;IAClB,gBAAgB,EAAE,GAAG;IACrB,kBAAkB,EAAE,GAAG;IACvB,oBAAoB,EAAE,GAAG;IACzB,4EAA4E;IAC5E,0EAA0E;IAC1E,6BAA6B;IAC7B,aAAa,EAAE,gCAAgC;IAC/C,gBAAgB,EAAE,gCAAgC;CACnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from \"lit\";\n\n/**\n * Design token values, sourced from Tailwind v4's default theme palette.\n * Each entry maps a `--ui-*` custom property name to its default value.\n * These are the same values baked in as `var(--ui-*, <fallback>)` fallbacks\n * throughout component styles, so components render correctly with zero\n * external CSS. Consumers may override any of these by setting the custom\n * property on `:root` or an ancestor element (see `tokens.css`).\n */\nexport const tokenValues: Record<string, string> = {\n // Colors\n \"--ui-primary\": \"#4f46e5\", // indigo-600\n \"--ui-primary-hover\": \"#4338ca\", // indigo-700\n // Button-specific background/border hooks: default to the flat --ui-primary\n // / --ui-danger tokens above unchanged, so those stay the single source of\n // truth for every other component. Overriding just these lets a theme opt\n // ui-button into a gradient (or any other) background without touching\n // component markup; --ui-button-border/--ui-button-danger-border default\n // to transparent (today's look) and are meant to be paired with a shade\n // darker than the gradient's dark stop when one is set. The `-active`\n // variants default to whatever `-background` already resolved to (so a\n // solid override still applies while pressed) — a gradient theme should\n // set them to the same stops in reverse, for a pressed/\"indented\" look.\n \"--ui-button-background\": \"var(--ui-primary, #4f46e5)\",\n \"--ui-button-background-hover\": \"var(--ui-primary-hover, #4338ca)\",\n \"--ui-button-background-active\": \"var(--ui-button-background, var(--ui-primary, #4f46e5))\",\n \"--ui-button-border\": \"transparent\",\n // The bordered, transparent-background secondary variant's equivalents —\n // shared with confirm-dialog's Cancel button, which is the same visual\n // pattern. Defaults reproduce today's literal secondary styling exactly\n // (no background at any state, border colors matching --ui-border /\n // --ui-text-muted), so a theme only needs to override these to make\n // secondary/Cancel buttons match a primary/danger gradient theme.\n \"--ui-button-secondary-background\": \"none\",\n \"--ui-button-secondary-background-hover\": \"none\",\n \"--ui-button-secondary-background-active\": \"var(--ui-button-secondary-background, none)\",\n \"--ui-button-secondary-border\": \"var(--ui-border, #e2e8f0)\",\n \"--ui-button-secondary-border-hover\": \"var(--ui-text-muted, #64748b)\",\n // A muted-gray surface used wherever something already paints\n // --ui-surface-muted as a state indicator in flat mode — button-group's\n // unchecked-segment hover, pagination-nav's button hover, and\n // radio-cards/radio-pills' checked background — which is a genuinely\n // different default than secondary's borderless flat hover, so it can't\n // reuse --ui-button-secondary-background-hover's \"none\" default.\n \"--ui-button-secondary-surface-muted\": \"var(--ui-surface-muted, #f8fafc)\",\n // Shared by both primary/danger — a purely cosmetic gloss/legibility pair,\n // not color-specific, so one token covers both variants. `-highlight` is a\n // full box-shadow value (e.g. `inset 0 1px 0 rgb(255 255 255 / 0.35)`) for\n // a glossy top edge, defaulting to a fully transparent (so invisible)\n // shadow rather than the keyword `none` — some usages combine it with\n // another literal shadow in a comma-separated list, where a bare `none`\n // item is invalid CSS and would zero out the *whole* declaration.\n // `-text-shadow` is a full text-shadow value for label legibility against\n // a gradient's lighter stop, always used standalone, so it keeps `none`.\n \"--ui-button-highlight\": \"0 0 0 0 transparent\",\n \"--ui-button-text-shadow\": \"none\",\n // A solid stand-in for the same accent, for spots that can't render a\n // background gradient at all — a native <input>'s accent-color only\n // accepts a plain color, and a hard-stop background gradient (e.g.\n // range-slider's filled track) can't nest another gradient inside its own\n // color-stop list. Consumers that theme the buttons into a gradient should\n // set this to the gradient's dark stop, so these non-button accents (radio\n // selection indicators, the range-slider track/thumb) stay visually\n // coordinated with it even though they can't literally paint a gradient.\n \"--ui-button-accent\": \"var(--ui-primary, #4f46e5)\",\n \"--ui-info\": \"#0ea5e9\", // sky-500\n \"--ui-info-hover\": \"#0284c7\", // sky-600\n \"--ui-danger\": \"#dc2626\", // red-600\n \"--ui-danger-hover\": \"#b91c1c\", // red-700\n \"--ui-button-danger-background\": \"var(--ui-danger, #dc2626)\",\n \"--ui-button-danger-background-hover\": \"var(--ui-danger-hover, #b91c1c)\",\n \"--ui-button-danger-background-active\":\n \"var(--ui-button-danger-background, var(--ui-danger, #dc2626))\",\n \"--ui-button-danger-border\": \"transparent\",\n \"--ui-success\": \"#16a34a\", // green-600\n \"--ui-warning\": \"#d97706\", // amber-600\n \"--ui-warning-hover\": \"#b45309\", // amber-700\n // toast-notification's per-variant background hooks: default to the flat\n // --ui-success/--ui-danger/--ui-info/--ui-warning tokens unchanged, so\n // those stay the single source of truth for every other component —\n // the same pattern as --ui-button-background/--ui-button-danger-background\n // above. `-highlight`/`-text-shadow` are the same glossy-top-edge /\n // legibility-shadow pair as --ui-button-highlight/--ui-button-text-shadow,\n // kept as separate tokens so a theme can gloss toasts and buttons\n // independently.\n \"--ui-toast-success-background\": \"var(--ui-success, #16a34a)\",\n \"--ui-toast-error-background\": \"var(--ui-danger, #dc2626)\",\n \"--ui-toast-info-background\": \"var(--ui-info, #0ea5e9)\",\n \"--ui-toast-warning-background\": \"var(--ui-warning, #d97706)\",\n \"--ui-toast-highlight\": \"0 0 0 0 transparent\",\n \"--ui-toast-text-shadow\": \"none\",\n // AI accent sweep — the four stops of the animated multi-hue ring\n // ui-button's `ai` modifier draws around a button (and the only place a\n // rainbow reads as meaning \"this action is AI-powered\" rather than a\n // semantic state). Ordered around the color wheel and looping back to\n // stop 1, so the sweep is seamless; --ui-ai-2 is --ui-primary's own\n // indigo, anchoring the ring to the rest of the palette. Overriding these\n // four retunes every AI button at once.\n \"--ui-ai-1\": \"#38bdf8\", // sky-400\n \"--ui-ai-2\": \"#6366f1\", // indigo-500\n \"--ui-ai-3\": \"#d946ef\", // fuchsia-500\n \"--ui-ai-4\": \"#fbbf24\", // amber-400\n \"--ui-on-accent\": \"#ffffff\",\n \"--ui-text\": \"#0f172a\", // slate-900\n \"--ui-text-muted\": \"#64748b\", // slate-500\n \"--ui-border\": \"#e2e8f0\", // slate-200\n \"--ui-surface\": \"#ffffff\", // white\n \"--ui-surface-muted\": \"#f8fafc\", // slate-50\n \"--ui-highlight\": \"#fde68a\", // amber-200 — transient \"just changed\" flash\n \"--ui-tooltip\": \"#0f172a\", // slate-900\n \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.32)\",\n \"--ui-overlay\": \"rgb(15 23 42 / 0.45)\", // slate-900 / 45%\n\n // Shape / depth\n \"--ui-radius\": \"0.5rem\", // rounded-lg\n \"--ui-radius-sm\": \"0.25rem\", // rounded\n // Deliberate pill/circle shapes — a chip, an avatar, a slider thumb, a dot.\n // Tokenized rather than hardcoded so a theme that squares the design system\n // (metro) can reach them too; a literal 9999px/50% silently opts that shape\n // out of every theme. Use these only where the shape is the point, not as a\n // heavier --ui-radius.\n \"--ui-radius-pill\": \"9999px\",\n \"--ui-radius-circle\": \"50%\",\n \"--ui-shadow\":\n \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\", // shadow-md\n \"--ui-shadow-lg\":\n \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\", // shadow-xl\n \"--ui-focus-ring\": \"0 0 0 3px rgb(79 70 229 / 0.35)\",\n\n // Type\n \"--ui-font\":\n 'ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n \"--ui-font-mono\":\n \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\",\n \"--ui-font-size-lg\": \"1rem\", // text-base\n \"--ui-font-size\": \"0.875rem\", // text-sm\n \"--ui-font-size-sm\": \"0.75rem\", // text-xs\n \"--ui-font-size-xs\": \"0.6875rem\",\n\n // Font weights — the only four weights the system uses.\n \"--ui-font-weight-regular\": \"400\",\n \"--ui-font-weight-medium\": \"500\",\n \"--ui-font-weight-semibold\": \"600\",\n \"--ui-font-weight-bold\": \"700\",\n\n // Line heights — glyph (icon/marker box), tight (headings), normal (body).\n \"--ui-line-height-glyph\": \"1\",\n \"--ui-line-height-tight\": \"1.25\",\n \"--ui-line-height-normal\": \"1.5\",\n\n // Letter spacing / tracking — default and the single widened step.\n \"--ui-tracking-normal\": \"0\",\n \"--ui-tracking-wide\": \"0.04em\",\n};\n\n/**\n * Dark-mode overrides for the same `--ui-*` custom properties, applied by\n * `tokens.css` via `@media (prefers-color-scheme: dark)` and `[data-theme]`\n * (see generate-tokens-css.mjs). Same Tailwind slate scale as the light\n * palette, inverted, with primary/danger/success lightened one step (500\n * instead of 600) for sufficient contrast against dark surfaces. Shape/type\n * tokens are theme-independent and not repeated here.\n */\nexport const darkTokenValues: Record<string, string> = {\n \"--ui-primary\": \"#6366f1\", // indigo-500\n \"--ui-primary-hover\": \"#818cf8\", // indigo-400\n \"--ui-info\": \"#38bdf8\", // sky-400\n \"--ui-info-hover\": \"#7dd3fc\", // sky-300\n \"--ui-danger\": \"#ef4444\", // red-500\n \"--ui-danger-hover\": \"#f87171\", // red-400\n \"--ui-success\": \"#22c55e\", // green-500\n \"--ui-warning\": \"#f59e0b\", // amber-500\n \"--ui-warning-hover\": \"#fbbf24\", // amber-400\n \"--ui-on-accent\": \"#ffffff\",\n \"--ui-text\": \"#f1f5f9\", // slate-100\n \"--ui-text-muted\": \"#94a3b8\", // slate-400\n \"--ui-border\": \"#334155\", // slate-700\n \"--ui-surface\": \"#0f172a\", // slate-900\n \"--ui-surface-muted\": \"#1e293b\", // slate-800\n \"--ui-highlight\": \"#854d0e\", // amber-800 — transient \"just changed\" flash on dark\n \"--ui-tooltip\": \"#020617\", // slate-950\n \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.12)\",\n \"--ui-overlay\": \"rgb(2 6 23 / 0.6)\", // slate-950 / 60%\n \"--ui-focus-ring\": \"0 0 0 3px rgb(99 102 241 / 0.45)\",\n};\n\n/**\n * \"Gradient\" theme overrides, applied via `data-theme=\"gradient\"` on `<html>`\n * (see `generate-tokens-css.mjs`) — forces `color-scheme: light` like the\n * `\"light\"` override and layers a glossy gradient look on top of the flat\n * light palette, using exactly the `--ui-button-*`/`--ui-button-danger-*`/\n * `--ui-button-secondary-*` hooks `ui-button.ts` already reads (see that\n * file's doc comment), plus the `--ui-toast-*` hooks `toast-notification.ts`\n * reads (see its doc comment). Every other token (`--ui-text`, `--ui-surface`,\n * …) is left at its light-mode default — this theme only glosses buttons and\n * toasts by design. Each variant's gradient runs light-to-dark top-to-bottom\n * (`180deg`) across one Tailwind shade step lighter/darker than the flat\n * token so it still reads as \"the same color, glossy\" rather than a\n * different hue; `-hover` shifts the whole pair one shade lighter, `-active`\n * reverses the two stops for a pressed/\"indented\" look, and `-border` is a\n * shade darker than the gradient's dark stop for a defining edge.\n */\nexport const gradientTokenValues: Record<string, string> = {\n \"--ui-button-background\": \"linear-gradient(180deg, #6366f1 0%, #4f46e5 100%)\", // indigo-500 -> 600\n \"--ui-button-background-hover\": \"linear-gradient(180deg, #818cf8 0%, #6366f1 100%)\", // indigo-400 -> 500\n \"--ui-button-background-active\": \"linear-gradient(180deg, #4f46e5 0%, #6366f1 100%)\", // reversed 600 -> 500\n \"--ui-button-border\": \"#4338ca\", // indigo-700\n \"--ui-button-danger-background\": \"linear-gradient(180deg, #ef4444 0%, #dc2626 100%)\", // red-500 -> 600\n \"--ui-button-danger-background-hover\": \"linear-gradient(180deg, #f87171 0%, #ef4444 100%)\", // red-400 -> 500\n \"--ui-button-danger-background-active\": \"linear-gradient(180deg, #dc2626 0%, #ef4444 100%)\", // reversed 600 -> 500\n \"--ui-button-danger-border\": \"#b91c1c\", // red-700\n // Secondary stays neutral gray rather than a saturated hue, matching its\n // flat \"not the primary action\" role, but one shade darker than the\n // original white -> slate-50 pairing: at a small button size, that pair\n // read as flat white with no visible gradient at all. slate-50 -> 100\n // keeps enough contrast to actually look like a gradient while still\n // being clearly lighter/quieter than primary/danger. Border stays\n // slate-300 (a step past the flat slate-200) so its edge still reads\n // against the fill.\n \"--ui-button-secondary-background\": \"linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%)\", // slate-50 -> 100\n \"--ui-button-secondary-background-hover\": \"linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%)\", // slate-100 -> 200\n \"--ui-button-secondary-background-active\": \"linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%)\", // reversed 100 -> 50\n \"--ui-button-secondary-border\": \"#cbd5e1\", // slate-300\n \"--ui-button-secondary-border-hover\": \"#94a3b8\", // slate-400\n // button-group's unchecked segments, pagination-nav's prev/next buttons, and\n // radio-cards/radio-pills' checked background read this rather than\n // --ui-button-secondary-background (see tokens above). Left flat they were\n // the one \"secondary\" surface that stayed matte while every actual secondary\n // button turned glossy, so it tracks the hover gradient rather than a\n // separate literal that could drift out of step with it.\n \"--ui-button-secondary-surface-muted\": \"var(--ui-button-secondary-background-hover)\",\n \"--ui-button-highlight\": \"inset 0 1px 0 rgb(255 255 255 / 0.35)\", // glossy top edge\n \"--ui-button-text-shadow\": \"0 1px 1px rgb(0 0 0 / 0.25)\", // legibility on primary/danger\n \"--ui-button-accent\": \"#4338ca\", // indigo-700, matches --ui-button-border\n // toast-notification: same light-to-dark, one-shade-step gradient\n // convention as the button variants above; the bottom stop always matches\n // the flat --ui-success/--ui-danger/--ui-info/--ui-warning value exactly.\n \"--ui-toast-success-background\": \"linear-gradient(180deg, #22c55e 0%, #16a34a 100%)\", // green-500 -> 600\n \"--ui-toast-error-background\": \"linear-gradient(180deg, #ef4444 0%, #dc2626 100%)\", // red-500 -> 600\n \"--ui-toast-info-background\": \"linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%)\", // sky-400 -> 500\n \"--ui-toast-warning-background\": \"linear-gradient(180deg, #f59e0b 0%, #d97706 100%)\", // amber-500 -> 600\n \"--ui-toast-highlight\": \"inset 0 1px 0 rgb(255 255 255 / 0.35)\", // glossy top edge, same as --ui-button-highlight\n \"--ui-toast-text-shadow\": \"0 1px 1px rgb(0 0 0 / 0.25)\", // legibility, same as --ui-button-text-shadow\n};\n\n/**\n * \"Metro\" theme overrides, applied via `data-theme=\"metro\"` on `<html>` (see\n * `generate-tokens-css.mjs`) — forces `color-scheme: light` like the `\"light\"`\n * and `\"gradient\"` overrides, and strips the roundness and depth off the flat\n * light palette to leave hard-edged surfaces over a blue accent, after the\n * dense square-cornered look of the early social bookmarking sites.\n *\n * This is the first theme to override shape rather than only color, so the\n * \"shape/type tokens are theme-independent\" rule `darkTokenValues` notes above\n * holds for every theme except this one (see `docs/design-language.md`).\n * Squaring the design system means squaring the deliberate pill and circle\n * shapes too — chips, avatars, dots, slider thumbs — which is why those read\n * `--ui-radius-pill`/`--ui-radius-circle` rather than hardcoding `9999px`/`50%`\n * (a literal would silently opt that shape out of the theme).\n *\n * One residual is genuinely out of reach: `price-history-chart` rounds its bars\n * with an SVG `rx` presentation attribute, which cannot take a `var()`, so\n * those stay slightly rounded under metro.\n *\n * The shadows flatten to a hairline ring rather than to `none`. Dropping them\n * outright would leave `slide-panel` — the only overlay with no border of its\n * own — as an invisible white-on-white edge; every other consumer of\n * `--ui-shadow*` either pairs it with `1px solid var(--ui-border)` or applies\n * it on hover/active over an already-bordered control. A hard 1px ring keeps\n * that separation while removing the blur and the faked depth.\n */\nexport const metroTokenValues: Record<string, string> = {\n \"--ui-primary\": \"#3274d0\", // the del.icio.us blue; no Tailwind equivalent\n \"--ui-primary-hover\": \"#2559a8\",\n \"--ui-focus-ring\": \"0 0 0 2px #3274d0\", // solid and crisp, not the default 3px translucent ring\n \"--ui-radius\": \"0\",\n \"--ui-radius-sm\": \"0\",\n \"--ui-radius-pill\": \"0\",\n \"--ui-radius-circle\": \"0\",\n // Hairline rings (slate-900 at low alpha) rather than blurred drop shadows:\n // separation without depth. -lg is a touch stronger, matching the default\n // pair's relative weighting.\n \"--ui-shadow\": \"0 0 0 1px rgb(15 23 42 / 0.12)\",\n \"--ui-shadow-lg\": \"0 0 0 1px rgb(15 23 42 / 0.18)\",\n};\n\n/**\n * Historically a shared `:host { --ui-x: var(--ui-x, fallback); } ` block,\n * re-declaring every token on each component's own host element as a\n * \"materialize the inherited value, or this fallback\" trick. That pattern\n * turned out to be a genuine bug, not a working default: browsers treat\n * `--ui-x: var(--ui-x, ...)` on `:host` as a self-referencing declaration\n * that computes to the guaranteed-invalid value REGARDLESS of what an\n * ancestor (e.g. `:root`) set — the host's own `:host` rule wins the cascade\n * over the ancestor's, so this dropped whatever the app actually set and\n * silently substituted the component's own fallback everywhere. It went\n * unnoticed because every component's fallback happened to equal the\n * intended light-mode value — dark mode (a real, different value at\n * `:root`) exposed it immediately (colors rendering as if no theme were\n * applied at all). Fix: don't redeclare tokens on `:host` — plain\n * inheritance already carries `:root`'s values into every shadow root\n * correctly, and every component already has its own `var(--ui-x, fallback)`\n * at each point of use, so nothing here is needed for the \"zero external\n * CSS\" default to keep working. Kept as an empty export so the existing\n * `static override styles = [tokens, css\\`...\\`]` import in every component\n * keeps compiling.\n */\nexport const tokens = css``;\n"]}
package/dist/ui-button.js CHANGED
@@ -185,7 +185,7 @@ let UiButton = class UiButton extends LitElement {
185
185
  font-size: var(--ui-font-size-xs, 0.6875rem);
186
186
  }
187
187
  .btn.pill {
188
- border-radius: 999px;
188
+ border-radius: var(--ui-radius-pill, 9999px);
189
189
  }
190
190
  .btn.ai {
191
191
  position: relative;
@@ -241,7 +241,7 @@ let UiButton = class UiButton extends LitElement {
241
241
  }
242
242
  .btn.ai.pill::before,
243
243
  .btn.ai.pill::after {
244
- border-radius: 999px;
244
+ border-radius: var(--ui-radius-pill, 9999px);
245
245
  }
246
246
  .btn.ai:hover::before,
247
247
  .btn.ai:hover::after {
@@ -1 +1 @@
1
- {"version":3,"file":"ui-button.js","sourceRoot":"","sources":["../src/ui-button.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,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAGL,eAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAkOpC,qBAAqB;QACT,YAAO,GAAkB,SAAS,CAAC;QAC/C,+EAA+E;QACnE,SAAI,GAAgB,IAAI,CAAC;QACrC,2FA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Q,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCAAc;AApP/B,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAkSpB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { iconArrowPath } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"danger\";\n\n/**\n * Button (or link styled as one) with an optional leading icon, in three\n * visual weights. Set `href` to render an `<a>` instead of a `<button>` —\n * same styling either way — for cross-page navigation that should look like\n * an action button; a disabled/busy link stays a real `<a>` with\n * `aria-disabled` + `pointer-events: none` rather than losing its href.\n * Put the icon in the `icon` slot and the label in the default slot.\n *\n * Form-associated (`type=\"submit\"`/`\"reset\"`): the actual `<button>` lives in\n * this element's shadow root, which native HTML form association does not\n * cross into from an ancestor light-DOM `<form>`. `type=\"submit\"`/`\"reset\"`\n * is instead wired through `ElementInternals.form` — the same mechanism\n * `address-autocomplete` uses to associate with an ancestor form.\n *\n * `primary`/`danger` backgrounds read `--ui-button-background`/\n * `--ui-button-danger-background` (and their `-hover`/`-active`\n * counterparts), which default to the flat `--ui-primary`/`--ui-danger`\n * tokens unchanged — so `--ui-primary`/`--ui-danger` stay the single source\n * of truth for every other component. A consumer can override just these\n * button-specific tokens with a `linear-gradient(...)` to opt every\n * `ui-button` into a gradient look without touching component markup —\n * `gradientTokenValues` in `tokens.ts` ships exactly this, wired up via\n * `data-theme=\"gradient\"` (see `tokens.css`'s \"Gradient theme\" section) —\n * pairing it with `--ui-button-border`/`--ui-button-danger-border` (default\n * `transparent`) for a defining edge a shade darker than the gradient's dark\n * stop, and setting the `-active` variant's stops in reverse for a\n * pressed/\"indented\" look while the button is held down. `secondary`'s\n * background/border read the equivalent `--ui-button-secondary-*` tokens\n * (shared with `confirm-dialog`'s Cancel button), defaulting to today's\n * transparent/bordered look, so it can be themed into a matching (e.g.\n * white-to-gray) gradient too.\n *\n * `ai` is an orthogonal modifier rather than a fourth variant: it leaves the\n * variant's fill (flat or gradient-themed) untouched and only adds an\n * animated multi-hue ring *outside* the button box — a crisp masked edge\n * plus a blurred bloom behind it that fades out to transparent, so the ring\n * melts into the page instead of ending on a hard line. Both layers are\n * masked into a donut, so nothing is ever painted over the background or\n * label. The ring's four stops are the `--ui-ai-1`…`--ui-ai-4` tokens. It\n * sweeps slowly at rest, faster on hover and while `busy`, holds still while\n * disabled or under `prefers-reduced-motion`, and drops the bloom for a\n * solid `CanvasText` ring in forced-colors mode. The bloom reaches about\n * `0.5rem` past the control, so give an AI button that much clearance from\n * its neighbors and avoid `overflow: hidden` ancestors that would clip it.\n *\n * Do not combine `ai` with `pill` under the gradient theme\n * (`data-theme=\"gradient\"`). That theme defines a button through a darker\n * `--ui-button-border` edge plus a glossy top highlight; a pill's\n * fully-rounded silhouette runs flush against the ring around its entire\n * outline, so that border and gloss read as the inner edge of the rainbow\n * rather than as the button's own shape, and the vertical gradient fill\n * stops reading as a gradient at all. Use `ai` with the default\n * `--ui-radius-sm` corners there, and keep `ai` + `pill` for the flat theme.\n *\n * @element ui-button\n * @slot icon - Optional leading icon (e.g. an inline SVG).\n * @slot - Button label.\n */\n@customElement(\"ui-button\")\nexport class UiButton extends LitElement {\n static formAssociated = true;\n\n #internals = this.attachInternals();\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n }\n .btn {\n display: inline-flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n height: 2rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.5rem 1rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\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 cursor: pointer;\n border: 1px solid transparent;\n text-decoration: none;\n box-sizing: border-box;\n }\n .btn.primary {\n background: var(--ui-button-background, var(--ui-primary, #4f46e5));\n border-color: var(--ui-button-border, transparent);\n color: var(--ui-on-accent, #ffffff);\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n text-shadow: var(--ui-button-text-shadow, none);\n }\n .btn.primary:hover:not(:disabled) {\n background: var(--ui-button-background-hover, var(--ui-primary-hover, #4338ca));\n }\n .btn.primary:active:not(:disabled) {\n background: var(--ui-button-background-active, var(--ui-button-background, var(--ui-primary, #4f46e5)));\n box-shadow: none;\n }\n .btn.secondary {\n background: var(--ui-button-secondary-background, none);\n border-color: var(--ui-button-secondary-border, var(--ui-border, #e2e8f0));\n color: var(--ui-text, #0f172a);\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n .btn.secondary:hover:not(:disabled) {\n background: var(--ui-button-secondary-background-hover, none);\n border-color: var(--ui-button-secondary-border-hover, var(--ui-text-muted, #64748b));\n }\n .btn.secondary:active:not(:disabled) {\n background: var(--ui-button-secondary-background-active, var(--ui-button-secondary-background, none));\n box-shadow: none;\n }\n .btn.danger {\n background: var(--ui-button-danger-background, var(--ui-danger, #dc2626));\n border-color: var(--ui-button-danger-border, transparent);\n color: var(--ui-on-accent, #ffffff);\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n text-shadow: var(--ui-button-text-shadow, none);\n }\n .btn.danger:hover:not(:disabled) {\n background: var(--ui-button-danger-background-hover, var(--ui-danger-hover, #b91c1c));\n }\n .btn.danger:active:not(:disabled) {\n background: var(--ui-button-danger-background-active, var(--ui-button-danger-background, var(--ui-danger, #dc2626)));\n box-shadow: none;\n }\n .btn:disabled,\n .btn[aria-disabled=\"true\"] {\n opacity: 0.6;\n cursor: default;\n pointer-events: none;\n }\n .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 .btn.primary:focus-visible:not(:active),\n .btn.danger:focus-visible:not(:active),\n .btn.secondary:focus-visible:not(:active) {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35)), var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n .btn.sm {\n height: 1.5rem;\n padding: 0.25rem 0.5rem;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n .btn.pill {\n border-radius: 999px;\n }\n .btn.ai {\n position: relative;\n --ai-sweep: linear-gradient(\n 90deg,\n var(--ui-ai-1, #38bdf8),\n var(--ui-ai-2, #6366f1),\n var(--ui-ai-3, #d946ef),\n var(--ui-ai-4, #fbbf24),\n var(--ui-ai-1, #38bdf8)\n );\n }\n /* Two layers, both masked into a donut (everything except the content\n box) so the fill underneath — flat, gradient-themed, or transparent\n secondary — is never painted over: ::before is a blurred bloom that\n fades out to transparent, ::after the crisp edge on top of it. The\n gradient tile is 1.5x the box so most of the hue range is visible at\n once, and one cycle shifts it by exactly one tile, for a seamless\n loop. */\n .btn.ai::before,\n .btn.ai::after {\n content: \"\";\n position: absolute;\n background: var(--ai-sweep);\n background-size: 150% 100%;\n -webkit-mask:\n linear-gradient(#000 0 0) content-box,\n linear-gradient(#000 0 0);\n -webkit-mask-composite: xor;\n mask:\n linear-gradient(#000 0 0) content-box,\n linear-gradient(#000 0 0);\n mask-composite: exclude;\n animation: ai-sweep 4s linear infinite;\n pointer-events: none;\n }\n /* The transparent border is headroom: a mask layer is clipped to the\n border box, so without it the blur's outward spread — the fade —\n would be cut off square again. */\n .btn.ai::before {\n inset: -1rem;\n border: 0.75rem solid transparent;\n padding: 0.25rem;\n border-radius: calc(var(--ui-radius-sm, 0.25rem) + 1rem);\n background-clip: padding-box;\n filter: blur(0.3125rem);\n opacity: 0.6;\n }\n .btn.ai::after {\n inset: -0.125rem;\n padding: 0.125rem;\n border-radius: calc(var(--ui-radius-sm, 0.25rem) + 0.125rem);\n }\n .btn.ai.pill::before,\n .btn.ai.pill::after {\n border-radius: 999px;\n }\n .btn.ai:hover::before,\n .btn.ai:hover::after {\n animation-duration: 1.5s;\n }\n /* A busy AI button keeps sweeping (and speeds up) — the ring reads as\n \"working\"; a plainly disabled one holds still. */\n .btn.ai[aria-busy=\"true\"]::before,\n .btn.ai[aria-busy=\"true\"]::after {\n animation-duration: 1.5s;\n }\n .btn.ai:disabled:not([aria-busy=\"true\"])::before,\n .btn.ai:disabled:not([aria-busy=\"true\"])::after,\n .btn.ai[aria-disabled=\"true\"]:not([aria-busy=\"true\"])::before,\n .btn.ai[aria-disabled=\"true\"]:not([aria-busy=\"true\"])::after {\n animation: none;\n }\n @keyframes ai-sweep {\n to {\n background-position: 300% 0;\n }\n }\n .spin {\n display: inline-flex;\n animation: spin 0.8s linear infinite;\n }\n .spin[hidden] {\n display: none;\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 .btn.ai::before,\n .btn.ai::after,\n .btn.ai:hover::before,\n .btn.ai:hover::after,\n .btn.ai[aria-busy=\"true\"]::before,\n .btn.ai[aria-busy=\"true\"]::after {\n animation: none;\n }\n }\n @media (forced-colors: active) {\n /* Gradients carry no meaning once colors are forced — drop the bloom\n and keep a solid system-colored ring so the AI affordance survives. */\n .btn.ai::before {\n display: none;\n }\n .btn.ai::after {\n background: CanvasText;\n animation: none;\n }\n .btn:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .btn:disabled,\n .btn[aria-disabled=\"true\"] {\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n }\n `,\n ];\n\n /** Visual weight. */\n @property() variant: ButtonVariant = \"primary\";\n /** Size — `sm` reduces height/padding/font-size one step below the default. */\n @property() size: \"sm\" | \"md\" = \"md\";\n /** Renders fully rounded (pill-shaped) corners instead of the default `--ui-radius-sm`. */\n @property({ type: Boolean }) pill = false;\n /** Draws the animated multi-hue \"AI\" ring (crisp edge plus a bloom fading out to transparent) around the button, on top of whatever variant/theme it already uses. */\n @property({ type: Boolean, reflect: true }) ai = false;\n /** Renders an `<a href=\"...\">` instead of a `<button>` when set. */\n @property() href: string | null = null;\n /** Native button `type`. Ignored when `href` is set. */\n @property() type: \"button\" | \"submit\" | \"reset\" = \"button\";\n /** Disables the control and dims it. */\n @property({ type: Boolean }) disabled = false;\n /** Shows a spinner in place of the icon slot and disables the control. */\n @property({ type: Boolean }) busy = false;\n\n /** Drives submit/reset on the ancestor form via ElementInternals, since a shadow-DOM button can't do it natively. */\n private _onClick() {\n if (this.type === \"submit\") this.#internals.form?.requestSubmit();\n else if (this.type === \"reset\") this.#internals.form?.reset();\n }\n\n /** Suppresses navigation while a link-styled button is disabled or busy. */\n private _onLinkClick(e: MouseEvent) {\n if (!this.disabled && !this.busy) return;\n e.preventDefault();\n }\n\n override render() {\n const classes = `btn ${this.variant} ${this.size}${this.pill ? \" pill\" : \"\"}${this.ai ? \" ai\" : \"\"}`;\n const isDisabled = this.disabled || this.busy;\n if (this.href) {\n return html`\n <a\n class=${classes}\n href=${this.href}\n aria-disabled=${isDisabled ? \"true\" : \"false\"}\n aria-busy=${this.busy ? \"true\" : \"false\"}\n @click=${this._onLinkClick}\n >\n <span class=\"spin\" aria-hidden=\"true\" ?hidden=${!this.busy}>${iconArrowPath(14)}</span>\n <slot name=\"icon\" ?hidden=${this.busy}></slot>\n <slot></slot>\n </a>\n `;\n }\n return html`\n <button\n class=${classes}\n type=\"button\"\n ?disabled=${isDisabled}\n aria-busy=${this.busy ? \"true\" : \"false\"}\n @click=${this._onClick}\n >\n <span class=\"spin\" aria-hidden=\"true\" ?hidden=${!this.busy}>${iconArrowPath(14)}</span>\n <slot name=\"icon\" ?hidden=${this.busy}></slot>\n <slot></slot>\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"ui-button\": UiButton;\n }\n}\n"]}
1
+ {"version":3,"file":"ui-button.js","sourceRoot":"","sources":["../src/ui-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,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AE0B,CAAC,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,EAAE,CAAC;oCACnD,IAAI,CAAC,IAAI;;;KAGxC,CAAC;IACJ,CAAC;CACF,CAAA;AA5Da;IAAX,QAAQ,EAAE;yCAAoC;AAEnC;IAAX,QAAQ,EAAE;sCAA0B;AAER;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCAAc;AAEE;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oCAAY;AAE3C;IAAX,QAAQ,EAAE;sCAA4B;AAE3B;IAAX,QAAQ,EAAE;sCAAgD;AAE9B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAkB;AAEjB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCAAc;AApP/B,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAkSpB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { iconArrowPath } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"danger\";\n\n/**\n * Button (or link styled as one) with an optional leading icon, in three\n * visual weights. Set `href` to render an `<a>` instead of a `<button>` —\n * same styling either way — for cross-page navigation that should look like\n * an action button; a disabled/busy link stays a real `<a>` with\n * `aria-disabled` + `pointer-events: none` rather than losing its href.\n * Put the icon in the `icon` slot and the label in the default slot.\n *\n * Form-associated (`type=\"submit\"`/`\"reset\"`): the actual `<button>` lives in\n * this element's shadow root, which native HTML form association does not\n * cross into from an ancestor light-DOM `<form>`. `type=\"submit\"`/`\"reset\"`\n * is instead wired through `ElementInternals.form` — the same mechanism\n * `address-autocomplete` uses to associate with an ancestor form.\n *\n * `primary`/`danger` backgrounds read `--ui-button-background`/\n * `--ui-button-danger-background` (and their `-hover`/`-active`\n * counterparts), which default to the flat `--ui-primary`/`--ui-danger`\n * tokens unchanged — so `--ui-primary`/`--ui-danger` stay the single source\n * of truth for every other component. A consumer can override just these\n * button-specific tokens with a `linear-gradient(...)` to opt every\n * `ui-button` into a gradient look without touching component markup —\n * `gradientTokenValues` in `tokens.ts` ships exactly this, wired up via\n * `data-theme=\"gradient\"` (see `tokens.css`'s \"Gradient theme\" section) —\n * pairing it with `--ui-button-border`/`--ui-button-danger-border` (default\n * `transparent`) for a defining edge a shade darker than the gradient's dark\n * stop, and setting the `-active` variant's stops in reverse for a\n * pressed/\"indented\" look while the button is held down. `secondary`'s\n * background/border read the equivalent `--ui-button-secondary-*` tokens\n * (shared with `confirm-dialog`'s Cancel button), defaulting to today's\n * transparent/bordered look, so it can be themed into a matching (e.g.\n * white-to-gray) gradient too.\n *\n * `ai` is an orthogonal modifier rather than a fourth variant: it leaves the\n * variant's fill (flat or gradient-themed) untouched and only adds an\n * animated multi-hue ring *outside* the button box — a crisp masked edge\n * plus a blurred bloom behind it that fades out to transparent, so the ring\n * melts into the page instead of ending on a hard line. Both layers are\n * masked into a donut, so nothing is ever painted over the background or\n * label. The ring's four stops are the `--ui-ai-1`…`--ui-ai-4` tokens. It\n * sweeps slowly at rest, faster on hover and while `busy`, holds still while\n * disabled or under `prefers-reduced-motion`, and drops the bloom for a\n * solid `CanvasText` ring in forced-colors mode. The bloom reaches about\n * `0.5rem` past the control, so give an AI button that much clearance from\n * its neighbors and avoid `overflow: hidden` ancestors that would clip it.\n *\n * Do not combine `ai` with `pill` under the gradient theme\n * (`data-theme=\"gradient\"`). That theme defines a button through a darker\n * `--ui-button-border` edge plus a glossy top highlight; a pill's\n * fully-rounded silhouette runs flush against the ring around its entire\n * outline, so that border and gloss read as the inner edge of the rainbow\n * rather than as the button's own shape, and the vertical gradient fill\n * stops reading as a gradient at all. Use `ai` with the default\n * `--ui-radius-sm` corners there, and keep `ai` + `pill` for the flat theme.\n *\n * @element ui-button\n * @slot icon - Optional leading icon (e.g. an inline SVG).\n * @slot - Button label.\n */\n@customElement(\"ui-button\")\nexport class UiButton extends LitElement {\n static formAssociated = true;\n\n #internals = this.attachInternals();\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n }\n .btn {\n display: inline-flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n height: 2rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.5rem 1rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\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 cursor: pointer;\n border: 1px solid transparent;\n text-decoration: none;\n box-sizing: border-box;\n }\n .btn.primary {\n background: var(--ui-button-background, var(--ui-primary, #4f46e5));\n border-color: var(--ui-button-border, transparent);\n color: var(--ui-on-accent, #ffffff);\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n text-shadow: var(--ui-button-text-shadow, none);\n }\n .btn.primary:hover:not(:disabled) {\n background: var(--ui-button-background-hover, var(--ui-primary-hover, #4338ca));\n }\n .btn.primary:active:not(:disabled) {\n background: var(--ui-button-background-active, var(--ui-button-background, var(--ui-primary, #4f46e5)));\n box-shadow: none;\n }\n .btn.secondary {\n background: var(--ui-button-secondary-background, none);\n border-color: var(--ui-button-secondary-border, var(--ui-border, #e2e8f0));\n color: var(--ui-text, #0f172a);\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n .btn.secondary:hover:not(:disabled) {\n background: var(--ui-button-secondary-background-hover, none);\n border-color: var(--ui-button-secondary-border-hover, var(--ui-text-muted, #64748b));\n }\n .btn.secondary:active:not(:disabled) {\n background: var(--ui-button-secondary-background-active, var(--ui-button-secondary-background, none));\n box-shadow: none;\n }\n .btn.danger {\n background: var(--ui-button-danger-background, var(--ui-danger, #dc2626));\n border-color: var(--ui-button-danger-border, transparent);\n color: var(--ui-on-accent, #ffffff);\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n text-shadow: var(--ui-button-text-shadow, none);\n }\n .btn.danger:hover:not(:disabled) {\n background: var(--ui-button-danger-background-hover, var(--ui-danger-hover, #b91c1c));\n }\n .btn.danger:active:not(:disabled) {\n background: var(--ui-button-danger-background-active, var(--ui-button-danger-background, var(--ui-danger, #dc2626)));\n box-shadow: none;\n }\n .btn:disabled,\n .btn[aria-disabled=\"true\"] {\n opacity: 0.6;\n cursor: default;\n pointer-events: none;\n }\n .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 .btn.primary:focus-visible:not(:active),\n .btn.danger:focus-visible:not(:active),\n .btn.secondary:focus-visible:not(:active) {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35)), var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n .btn.sm {\n height: 1.5rem;\n padding: 0.25rem 0.5rem;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n .btn.pill {\n border-radius: var(--ui-radius-pill, 9999px);\n }\n .btn.ai {\n position: relative;\n --ai-sweep: linear-gradient(\n 90deg,\n var(--ui-ai-1, #38bdf8),\n var(--ui-ai-2, #6366f1),\n var(--ui-ai-3, #d946ef),\n var(--ui-ai-4, #fbbf24),\n var(--ui-ai-1, #38bdf8)\n );\n }\n /* Two layers, both masked into a donut (everything except the content\n box) so the fill underneath — flat, gradient-themed, or transparent\n secondary — is never painted over: ::before is a blurred bloom that\n fades out to transparent, ::after the crisp edge on top of it. The\n gradient tile is 1.5x the box so most of the hue range is visible at\n once, and one cycle shifts it by exactly one tile, for a seamless\n loop. */\n .btn.ai::before,\n .btn.ai::after {\n content: \"\";\n position: absolute;\n background: var(--ai-sweep);\n background-size: 150% 100%;\n -webkit-mask:\n linear-gradient(#000 0 0) content-box,\n linear-gradient(#000 0 0);\n -webkit-mask-composite: xor;\n mask:\n linear-gradient(#000 0 0) content-box,\n linear-gradient(#000 0 0);\n mask-composite: exclude;\n animation: ai-sweep 4s linear infinite;\n pointer-events: none;\n }\n /* The transparent border is headroom: a mask layer is clipped to the\n border box, so without it the blur's outward spread — the fade —\n would be cut off square again. */\n .btn.ai::before {\n inset: -1rem;\n border: 0.75rem solid transparent;\n padding: 0.25rem;\n border-radius: calc(var(--ui-radius-sm, 0.25rem) + 1rem);\n background-clip: padding-box;\n filter: blur(0.3125rem);\n opacity: 0.6;\n }\n .btn.ai::after {\n inset: -0.125rem;\n padding: 0.125rem;\n border-radius: calc(var(--ui-radius-sm, 0.25rem) + 0.125rem);\n }\n .btn.ai.pill::before,\n .btn.ai.pill::after {\n border-radius: var(--ui-radius-pill, 9999px);\n }\n .btn.ai:hover::before,\n .btn.ai:hover::after {\n animation-duration: 1.5s;\n }\n /* A busy AI button keeps sweeping (and speeds up) — the ring reads as\n \"working\"; a plainly disabled one holds still. */\n .btn.ai[aria-busy=\"true\"]::before,\n .btn.ai[aria-busy=\"true\"]::after {\n animation-duration: 1.5s;\n }\n .btn.ai:disabled:not([aria-busy=\"true\"])::before,\n .btn.ai:disabled:not([aria-busy=\"true\"])::after,\n .btn.ai[aria-disabled=\"true\"]:not([aria-busy=\"true\"])::before,\n .btn.ai[aria-disabled=\"true\"]:not([aria-busy=\"true\"])::after {\n animation: none;\n }\n @keyframes ai-sweep {\n to {\n background-position: 300% 0;\n }\n }\n .spin {\n display: inline-flex;\n animation: spin 0.8s linear infinite;\n }\n .spin[hidden] {\n display: none;\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 .btn.ai::before,\n .btn.ai::after,\n .btn.ai:hover::before,\n .btn.ai:hover::after,\n .btn.ai[aria-busy=\"true\"]::before,\n .btn.ai[aria-busy=\"true\"]::after {\n animation: none;\n }\n }\n @media (forced-colors: active) {\n /* Gradients carry no meaning once colors are forced — drop the bloom\n and keep a solid system-colored ring so the AI affordance survives. */\n .btn.ai::before {\n display: none;\n }\n .btn.ai::after {\n background: CanvasText;\n animation: none;\n }\n .btn:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .btn:disabled,\n .btn[aria-disabled=\"true\"] {\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n }\n `,\n ];\n\n /** Visual weight. */\n @property() variant: ButtonVariant = \"primary\";\n /** Size — `sm` reduces height/padding/font-size one step below the default. */\n @property() size: \"sm\" | \"md\" = \"md\";\n /** Renders fully rounded (pill-shaped) corners instead of the default `--ui-radius-sm`. */\n @property({ type: Boolean }) pill = false;\n /** Draws the animated multi-hue \"AI\" ring (crisp edge plus a bloom fading out to transparent) around the button, on top of whatever variant/theme it already uses. */\n @property({ type: Boolean, reflect: true }) ai = false;\n /** Renders an `<a href=\"...\">` instead of a `<button>` when set. */\n @property() href: string | null = null;\n /** Native button `type`. Ignored when `href` is set. */\n @property() type: \"button\" | \"submit\" | \"reset\" = \"button\";\n /** Disables the control and dims it. */\n @property({ type: Boolean }) disabled = false;\n /** Shows a spinner in place of the icon slot and disables the control. */\n @property({ type: Boolean }) busy = false;\n\n /** Drives submit/reset on the ancestor form via ElementInternals, since a shadow-DOM button can't do it natively. */\n private _onClick() {\n if (this.type === \"submit\") this.#internals.form?.requestSubmit();\n else if (this.type === \"reset\") this.#internals.form?.reset();\n }\n\n /** Suppresses navigation while a link-styled button is disabled or busy. */\n private _onLinkClick(e: MouseEvent) {\n if (!this.disabled && !this.busy) return;\n e.preventDefault();\n }\n\n override render() {\n const classes = `btn ${this.variant} ${this.size}${this.pill ? \" pill\" : \"\"}${this.ai ? \" ai\" : \"\"}`;\n const isDisabled = this.disabled || this.busy;\n if (this.href) {\n return html`\n <a\n class=${classes}\n href=${this.href}\n aria-disabled=${isDisabled ? \"true\" : \"false\"}\n aria-busy=${this.busy ? \"true\" : \"false\"}\n @click=${this._onLinkClick}\n >\n <span class=\"spin\" aria-hidden=\"true\" ?hidden=${!this.busy}>${iconArrowPath(14)}</span>\n <slot name=\"icon\" ?hidden=${this.busy}></slot>\n <slot></slot>\n </a>\n `;\n }\n return html`\n <button\n class=${classes}\n type=\"button\"\n ?disabled=${isDisabled}\n aria-busy=${this.busy ? \"true\" : \"false\"}\n @click=${this._onClick}\n >\n <span class=\"spin\" aria-hidden=\"true\" ?hidden=${!this.busy}>${iconArrowPath(14)}</span>\n <slot name=\"icon\" ?hidden=${this.busy}></slot>\n <slot></slot>\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"ui-button\": UiButton;\n }\n}\n"]}
@@ -37,7 +37,7 @@ let UserAvatar = class UserAvatar extends LitElement {
37
37
  display: inline-flex;
38
38
  }
39
39
  .avatar {
40
- border-radius: 50%;
40
+ border-radius: var(--ui-radius-circle, 50%);
41
41
  /* Match map-circle's 30% white/black vertical depth without tinting images. */
42
42
  background: linear-gradient(
43
43
  to bottom,
@@ -66,7 +66,7 @@ let UserAvatar = class UserAvatar extends LitElement {
66
66
  img {
67
67
  width: 100%;
68
68
  height: 100%;
69
- border-radius: 50%;
69
+ border-radius: var(--ui-radius-circle, 50%);
70
70
  object-fit: cover;
71
71
  }
72
72
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"user-avatar.js","sourceRoot":"","sources":["../src/user-avatar.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;GAQG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ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GAAG,IAAI;UAC1E,SAAS;YACT,CAAC,CAAC,IAAI,CAAA;oBACI,IAAI,CAAC,GAAI;;;uBAGN,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;eACrC;YACL,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;;KAEzD,CAAC;IACJ,CAAC;CACF,CAAA;AA5Ca;IAAX,QAAQ,EAAE;uCAA2B;AAE1B;IAAX,QAAQ,EAAE;wCAA4B;AAE3B;IAAX,QAAQ,EAAE;wCAA4B;AAEtB;IAAhB,KAAK,EAAE;6CAA2B;AAlDxB,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAwFtB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconUserCircle } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Circular avatar. Shows `src` when it loads successfully; falls back to the\n * first letter of `name` (uppercased) if `src` is unset or fails to load\n * (e.g. an expired OAuth profile-photo URL); falls back further to a generic\n * person icon if `name` is also unset. A broken image never leaves a blank\n * circle.\n *\n * @element user-avatar\n */\n@customElement(\"user-avatar\")\nexport class UserAvatar extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n }\n .avatar {\n border-radius: 50%;\n /* Match map-circle's 30% white/black vertical depth without tinting images. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #000000) 100%\n );\n color: var(--ui-on-accent, #ffffff);\n text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);\n display: flex;\n align-items: center;\n justify-content: center;\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 font-weight: var(--ui-font-weight-semibold, 600);\n overflow: hidden;\n flex: 0 0 auto;\n }\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n `,\n ];\n\n /** Image URL to show. Falls back to initials/icon if unset or it fails to load. */\n @property() src: string | null = null;\n /** Source string for the fallback initial (e.g. a display name or email) — first character, uppercased. */\n @property() name: string | null = null;\n /** Diameter in CSS pixels, or a preset name (`xs`=18, `sm`=24, `md`=32, `lg`=48). */\n @property() size: string | number = 32;\n\n @state() private _imgError = false;\n\n private static readonly SIZE_PRESETS: Record<string, number> = {\n xs: 18,\n sm: 24,\n md: 32,\n lg: 48,\n };\n\n /** Resolves the `size` property (number or preset name) to a pixel diameter. */\n private resolveSize(): number {\n const numeric = Number(this.size);\n if (!Number.isNaN(numeric)) return numeric;\n return UserAvatar.SIZE_PRESETS[String(this.size)] ?? 32;\n }\n\n protected override willUpdate(changed: Map<string, unknown>) {\n if (changed.has(\"src\")) this._imgError = false;\n }\n\n override render() {\n const size = this.resolveSize();\n const dim = `${size}px`;\n const showImage = !!this.src && !this._imgError;\n const initial = this.name?.trim()[0]?.toUpperCase();\n return html`\n <span class=\"avatar\" style=\"width:${dim};height:${dim};font-size:${size * 0.42}px\">\n ${showImage\n ? html`<img\n src=${this.src!}\n alt=\"\"\n referrerpolicy=\"no-referrer\"\n @error=${() => (this._imgError = true)}\n />`\n : initial || iconUserCircle(Math.round(size * 0.65))}\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"user-avatar\": UserAvatar;\n }\n}\n"]}
1
+ {"version":3,"file":"user-avatar.js","sourceRoot":"","sources":["../src/user-avatar.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,C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QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;QACpD,OAAO,IAAI,CAAA;0CAC2B,GAAG,WAAW,GAAG,cAAc,IAAI,GAAG,IAAI;UAC1E,SAAS;YACT,CAAC,CAAC,IAAI,CAAA;oBACI,IAAI,CAAC,GAAI;;;uBAGN,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;eACrC;YACL,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;;KAEzD,CAAC;IACJ,CAAC;CACF,CAAA;AA5Ca;IAAX,QAAQ,EAAE;uCAA2B;AAE1B;IAAX,QAAQ,EAAE;wCAA4B;AAE3B;IAAX,QAAQ,EAAE;wCAA4B;AAEtB;IAAhB,KAAK,EAAE;6CAA2B;AAlDxB,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAwFtB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconUserCircle } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Circular avatar. Shows `src` when it loads successfully; falls back to the\n * first letter of `name` (uppercased) if `src` is unset or fails to load\n * (e.g. an expired OAuth profile-photo URL); falls back further to a generic\n * person icon if `name` is also unset. A broken image never leaves a blank\n * circle.\n *\n * @element user-avatar\n */\n@customElement(\"user-avatar\")\nexport class UserAvatar extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n }\n .avatar {\n border-radius: var(--ui-radius-circle, 50%);\n /* Match map-circle's 30% white/black vertical depth without tinting images. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--ui-primary, #4f46e5) 70%, #000000) 100%\n );\n color: var(--ui-on-accent, #ffffff);\n text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);\n display: flex;\n align-items: center;\n justify-content: center;\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 font-weight: var(--ui-font-weight-semibold, 600);\n overflow: hidden;\n flex: 0 0 auto;\n }\n img {\n width: 100%;\n height: 100%;\n border-radius: var(--ui-radius-circle, 50%);\n object-fit: cover;\n }\n `,\n ];\n\n /** Image URL to show. Falls back to initials/icon if unset or it fails to load. */\n @property() src: string | null = null;\n /** Source string for the fallback initial (e.g. a display name or email) — first character, uppercased. */\n @property() name: string | null = null;\n /** Diameter in CSS pixels, or a preset name (`xs`=18, `sm`=24, `md`=32, `lg`=48). */\n @property() size: string | number = 32;\n\n @state() private _imgError = false;\n\n private static readonly SIZE_PRESETS: Record<string, number> = {\n xs: 18,\n sm: 24,\n md: 32,\n lg: 48,\n };\n\n /** Resolves the `size` property (number or preset name) to a pixel diameter. */\n private resolveSize(): number {\n const numeric = Number(this.size);\n if (!Number.isNaN(numeric)) return numeric;\n return UserAvatar.SIZE_PRESETS[String(this.size)] ?? 32;\n }\n\n protected override willUpdate(changed: Map<string, unknown>) {\n if (changed.has(\"src\")) this._imgError = false;\n }\n\n override render() {\n const size = this.resolveSize();\n const dim = `${size}px`;\n const showImage = !!this.src && !this._imgError;\n const initial = this.name?.trim()[0]?.toUpperCase();\n return html`\n <span class=\"avatar\" style=\"width:${dim};height:${dim};font-size:${size * 0.42}px\">\n ${showImage\n ? html`<img\n src=${this.src!}\n alt=\"\"\n referrerpolicy=\"no-referrer\"\n @error=${() => (this._imgError = true)}\n />`\n : initial || iconUserCircle(Math.round(size * 0.65))}\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"user-avatar\": UserAvatar;\n }\n}\n"]}
@@ -29,7 +29,7 @@ export const transportRangeStyles = css `
29
29
  }
30
30
  input[type="range"]::-webkit-slider-runnable-track {
31
31
  height: 0.25rem;
32
- border-radius: 9999px;
32
+ border-radius: var(--ui-radius-pill, 9999px);
33
33
  /* A hard-stop gradient two-tone fill trick — see range-slider.ts for why
34
34
  this reads --ui-button-accent rather than --ui-button-background. */
35
35
  background: linear-gradient(
@@ -42,12 +42,12 @@ export const transportRangeStyles = css `
42
42
  }
43
43
  input[type="range"]::-moz-range-track {
44
44
  height: 0.25rem;
45
- border-radius: 9999px;
45
+ border-radius: var(--ui-radius-pill, 9999px);
46
46
  background: var(--ui-surface-muted, #f8fafc);
47
47
  }
48
48
  input[type="range"]::-moz-range-progress {
49
49
  height: 0.25rem;
50
- border-radius: 9999px;
50
+ border-radius: var(--ui-radius-pill, 9999px);
51
51
  background: var(--ui-button-accent, var(--ui-primary, #4f46e5));
52
52
  }
53
53
  input[type="range"]::-webkit-slider-thumb {
@@ -58,7 +58,7 @@ export const transportRangeStyles = css `
58
58
  /* WebKit centers the thumb on the input's full 1rem box, not the
59
59
  thinner custom track — nudge it up to align, as in range-slider.ts. */
60
60
  transform: translateY(-0.25rem);
61
- border-radius: 50%;
61
+ border-radius: var(--ui-radius-circle, 50%);
62
62
  background: var(--ui-button-background, var(--ui-primary, #4f46e5));
63
63
  border: 2px solid var(--ui-surface, #ffffff);
64
64
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), var(--ui-button-highlight, 0 0 0 0 transparent);
@@ -66,7 +66,7 @@ export const transportRangeStyles = css `
66
66
  input[type="range"]::-moz-range-thumb {
67
67
  width: 0.75rem;
68
68
  height: 0.75rem;
69
- border-radius: 50%;
69
+ border-radius: var(--ui-radius-circle, 50%);
70
70
  background: var(--ui-button-background, var(--ui-primary, #4f46e5));
71
71
  border: 2px solid var(--ui-surface, #ffffff);
72
72
  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":"transport-controls.js","sourceRoot":"","sources":["../../src/utils/transport-controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGtC,CAAC","sourcesContent":["import { css } from \"lit\";\n\n/**\n * Shared `<input type=\"range\">` track/thumb styling for media transport\n * controls (the seek bar and volume slider in `audio-player`/`video-player`).\n * Reuses `range-slider.ts`'s track/fill visual language (a filled portion up\n * to `--range-percent`) so both players get free native keyboard/pointer\n * seeking instead of a custom-built draggable control, matching the \"native\n * semantics before custom ARIA\" rule. Extracted here rather than duplicated\n * because both components need the identical rule set.\n */\nexport const transportRangeStyles = css`\n input[type=\"range\"] {\n -webkit-appearance: none;\n appearance: none;\n /* Width is intentionally left to the consumer (e.g. .seek/.volume in\n audio-player/video-player) — this element+attribute selector has\n higher specificity than a single class rule, so setting a width\n here would win over a component's own narrower class and silently\n stretch every range input (including a fixed-width volume slider)\n to 100%. */\n height: 1rem;\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 input[type=\"range\"]::-webkit-slider-runnable-track {\n height: 0.25rem;\n border-radius: 9999px;\n /* A hard-stop gradient two-tone fill trick — see range-slider.ts for why\n this reads --ui-button-accent rather than --ui-button-background. */\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.25rem;\n border-radius: 9999px;\n background: var(--ui-surface-muted, #f8fafc);\n }\n input[type=\"range\"]::-moz-range-progress {\n height: 0.25rem;\n border-radius: 9999px;\n background: var(--ui-button-accent, var(--ui-primary, #4f46e5));\n }\n input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0.75rem;\n height: 0.75rem;\n /* WebKit centers the thumb on the input's full 1rem box, not the\n thinner custom track — nudge it up to align, as in range-slider.ts. */\n transform: translateY(-0.25rem);\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: 0.75rem;\n height: 0.75rem;\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"]}
1
+ {"version":3,"file":"transport-controls.js","sourceRoot":"","sources":["../../src/utils/transport-controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGtC,CAAC","sourcesContent":["import { css } from \"lit\";\n\n/**\n * Shared `<input type=\"range\">` track/thumb styling for media transport\n * controls (the seek bar and volume slider in `audio-player`/`video-player`).\n * Reuses `range-slider.ts`'s track/fill visual language (a filled portion up\n * to `--range-percent`) so both players get free native keyboard/pointer\n * seeking instead of a custom-built draggable control, matching the \"native\n * semantics before custom ARIA\" rule. Extracted here rather than duplicated\n * because both components need the identical rule set.\n */\nexport const transportRangeStyles = css`\n input[type=\"range\"] {\n -webkit-appearance: none;\n appearance: none;\n /* Width is intentionally left to the consumer (e.g. .seek/.volume in\n audio-player/video-player) — this element+attribute selector has\n higher specificity than a single class rule, so setting a width\n here would win over a component's own narrower class and silently\n stretch every range input (including a fixed-width volume slider)\n to 100%. */\n height: 1rem;\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 input[type=\"range\"]::-webkit-slider-runnable-track {\n height: 0.25rem;\n border-radius: var(--ui-radius-pill, 9999px);\n /* A hard-stop gradient two-tone fill trick — see range-slider.ts for why\n this reads --ui-button-accent rather than --ui-button-background. */\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.25rem;\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.25rem;\n border-radius: var(--ui-radius-pill, 9999px);\n background: var(--ui-button-accent, var(--ui-primary, #4f46e5));\n }\n input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0.75rem;\n height: 0.75rem;\n /* WebKit centers the thumb on the input's full 1rem box, not the\n thinner custom track — nudge it up to align, as in range-slider.ts. */\n transform: translateY(-0.25rem);\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: 0.75rem;\n height: 0.75rem;\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"]}
@@ -69,6 +69,7 @@ _None._
69
69
  | `--ui-line-height-tight` |
70
70
  | `--ui-on-accent` |
71
71
  | `--ui-primary` |
72
+ | `--ui-radius-pill` |
72
73
  | `--ui-radius-sm` |
73
74
  | `--ui-success` |
74
75
  | `--ui-surface` |