luxen-ui 0.17.0 → 0.18.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 (119) hide show
  1. package/cdn/custom-elements.json +336 -181
  2. package/cdn/elements/alert/alert.d.ts +0 -5
  3. package/cdn/elements/alert/alert.d.ts.map +1 -1
  4. package/cdn/elements/alert/alert.js.map +1 -1
  5. package/cdn/elements/alert-dialog/alert-dialog.d.ts.map +1 -1
  6. package/cdn/elements/alert-dialog/alert-dialog.js +8 -8
  7. package/cdn/elements/alert-dialog/alert-dialog.js.map +1 -1
  8. package/cdn/elements/avatar/avatar.js +3 -3
  9. package/cdn/elements/dropdown-item/dropdown-item.d.ts +4 -0
  10. package/cdn/elements/dropdown-item/dropdown-item.d.ts.map +1 -1
  11. package/cdn/elements/dropdown-item/dropdown-item.js +2 -2
  12. package/cdn/elements/dropdown-item/dropdown-item.js.map +1 -1
  13. package/cdn/elements/form-field/form-field.d.ts.map +1 -1
  14. package/cdn/elements/form-field/form-field.js +1 -1
  15. package/cdn/elements/form-field/form-field.js.map +1 -1
  16. package/cdn/elements/input-otp/input-otp.d.ts.map +1 -1
  17. package/cdn/elements/input-otp/input-otp.js +1 -1
  18. package/cdn/elements/input-otp/input-otp.js.map +1 -1
  19. package/cdn/elements/input-stepper/input-stepper.js +1 -1
  20. package/cdn/elements/input-stepper/input-stepper.js.map +1 -1
  21. package/cdn/elements/prose-editor/prose-editor.d.ts +1 -0
  22. package/cdn/elements/prose-editor/prose-editor.d.ts.map +1 -1
  23. package/cdn/elements/prose-editor/prose-editor.js +8 -8
  24. package/cdn/elements/prose-editor/prose-editor.js.map +1 -1
  25. package/cdn/elements/select/select.js +1 -1
  26. package/cdn/elements/slider/slider.d.ts +0 -5
  27. package/cdn/elements/slider/slider.d.ts.map +1 -1
  28. package/cdn/elements/slider/slider.js.map +1 -1
  29. package/cdn/elements/stories-viewer/stories-viewer.d.ts.map +1 -1
  30. package/cdn/elements/stories-viewer/stories-viewer.js +13 -13
  31. package/cdn/elements/stories-viewer/stories-viewer.js.map +1 -1
  32. package/cdn/elements/story/story.d.ts.map +1 -1
  33. package/cdn/elements/story/story.js +11 -11
  34. package/cdn/elements/story/story.js.map +1 -1
  35. package/cdn/elements/tag/tag.d.ts +51 -2
  36. package/cdn/elements/tag/tag.d.ts.map +1 -1
  37. package/cdn/elements/tag/tag.js +53 -17
  38. package/cdn/elements/tag/tag.js.map +1 -1
  39. package/cdn/elements/tree-item/tree-item.js +6 -6
  40. package/cdn/elements/tree-item/tree-item.js.map +1 -1
  41. package/cdn/shared/styles/button-core.styles.js.map +1 -1
  42. package/cdn/shared/styles/checkbox-appearance.styles.js +1 -1
  43. package/cdn/shared/styles/checkbox-appearance.styles.js.map +1 -1
  44. package/cdn/standalone.css +277 -24
  45. package/cdn/styles/elements/button.css +6 -0
  46. package/cdn/styles/elements/checkbox.css +49 -0
  47. package/cdn/styles/elements/form-field.css +50 -0
  48. package/cdn/styles/elements/input-otp.css +7 -2
  49. package/cdn/styles/elements/input-stepper/default.css +10 -4
  50. package/cdn/styles/elements/input-stepper/rounded.css +6 -2
  51. package/cdn/styles/elements/input.css +19 -1
  52. package/cdn/styles/elements/prose-editor.css +46 -0
  53. package/cdn/styles/elements/radio.css +23 -1
  54. package/cdn/styles/elements/segmented-control.css +26 -7
  55. package/cdn/styles/elements/switch.css +28 -2
  56. package/cdn/styles/preset.css +7 -5
  57. package/cdn/styles/tokens/forms.css +7 -5
  58. package/cdn/styles/tokens.css +7 -5
  59. package/dist/css/elements/button.css +6 -0
  60. package/dist/css/elements/checkbox.css +49 -0
  61. package/dist/css/elements/form-field.css +50 -0
  62. package/dist/css/elements/input-otp.css +7 -2
  63. package/dist/css/elements/input-stepper/default.css +10 -4
  64. package/dist/css/elements/input-stepper/rounded.css +6 -2
  65. package/dist/css/elements/input.css +19 -1
  66. package/dist/css/elements/prose-editor.css +46 -0
  67. package/dist/css/elements/radio.css +23 -1
  68. package/dist/css/elements/segmented-control.css +26 -7
  69. package/dist/css/elements/switch.css +28 -2
  70. package/dist/css/preset.css +7 -5
  71. package/dist/css/tokens/forms.css +7 -5
  72. package/dist/css/tokens.css +7 -5
  73. package/dist/custom-elements.json +336 -181
  74. package/dist/elements/alert/alert.d.ts +0 -5
  75. package/dist/elements/alert/alert.d.ts.map +1 -1
  76. package/dist/elements/alert-dialog/alert-dialog.d.ts.map +1 -1
  77. package/dist/elements/alert-dialog/alert-dialog.js +15 -3
  78. package/dist/elements/dropdown-item/dropdown-item.css +18 -0
  79. package/dist/elements/dropdown-item/dropdown-item.d.ts +4 -0
  80. package/dist/elements/dropdown-item/dropdown-item.d.ts.map +1 -1
  81. package/dist/elements/dropdown-item/dropdown-item.js +11 -2
  82. package/dist/elements/form-field/form-field.d.ts.map +1 -1
  83. package/dist/elements/form-field/form-field.js +5 -3
  84. package/dist/elements/input-otp/input-otp.d.ts.map +1 -1
  85. package/dist/elements/input-otp/input-otp.js +4 -3
  86. package/dist/elements/input-stepper/input-stepper.js +4 -4
  87. package/dist/elements/prose-editor/prose-editor.css +31 -0
  88. package/dist/elements/prose-editor/prose-editor.d.ts +1 -0
  89. package/dist/elements/prose-editor/prose-editor.d.ts.map +1 -1
  90. package/dist/elements/prose-editor/prose-editor.js +1 -0
  91. package/dist/elements/slider/slider.css +6 -0
  92. package/dist/elements/slider/slider.d.ts +0 -5
  93. package/dist/elements/slider/slider.d.ts.map +1 -1
  94. package/dist/elements/stories-viewer/stories-viewer.d.ts.map +1 -1
  95. package/dist/elements/stories-viewer/stories-viewer.js +4 -1
  96. package/dist/elements/story/story.d.ts.map +1 -1
  97. package/dist/elements/story/story.js +9 -4
  98. package/dist/elements/tag/tag.css +202 -16
  99. package/dist/elements/tag/tag.d.ts +51 -2
  100. package/dist/elements/tag/tag.d.ts.map +1 -1
  101. package/dist/elements/tag/tag.js +151 -22
  102. package/dist/elements/tree-item/tree-item.js +2 -2
  103. package/dist/metadata/dropdown-item.json +16 -1
  104. package/dist/metadata/index.json +91 -5
  105. package/dist/metadata/prose-editor.json +5 -0
  106. package/dist/metadata/tag.json +69 -3
  107. package/dist/shared/styles/button-core.css +6 -0
  108. package/dist/shared/styles/checkbox-appearance.css +49 -0
  109. package/dist/templates/elements/checkbox.md +2 -0
  110. package/dist/templates/elements/dropdown.md +52 -0
  111. package/dist/templates/elements/form-field.md +33 -0
  112. package/dist/templates/elements/input.md +1 -1
  113. package/dist/templates/elements/prose-editor.md +2 -1
  114. package/dist/templates/elements/radio.md +2 -0
  115. package/dist/templates/elements/select.md +14 -0
  116. package/dist/templates/elements/tag.md +225 -8
  117. package/dist/templates/elements/textarea.md +1 -1
  118. package/package.json +1 -1
  119. package/vite-plugin.ts +7 -0
@@ -1 +1 @@
1
- {"version":3,"file":"tag.js","names":[],"sources":["../../../src/html/elements/tag/tag.css?inline","../../../src/html/elements/tag/tag.ts"],"sourcesContent":["@layer components {\n :host {\n /* Size defaults (md). A removable tag is always ≥24px tall (target-size). */\n --_height: 1.5rem;\n --_font-size: var(--l-text-xs);\n --_padding-inline: 0.5rem;\n --_gap: 0.25rem;\n\n display: inline-flex;\n vertical-align: middle;\n max-inline-size: 100%;\n }\n\n :host([size='sm']) {\n --_padding-inline: 0.375rem;\n --_gap: 0.125rem;\n }\n\n :host([size='lg']) {\n --_height: 1.75rem;\n --_font-size: var(--l-text-sm);\n --_padding-inline: 0.625rem;\n }\n\n /* Disabled is conveyed by the greyed × button + cursor, NOT by washing out\n * the label — dimming the whole chip with opacity composites the text below\n * the WCAG AA contrast floor (axe flags it; a disabled <button> is exempt but\n * the label span is not). */\n :host([disabled]) .base {\n cursor: not-allowed;\n }\n\n /*\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n 🅲🅷🅸🅿\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n */\n\n .base {\n display: inline-flex;\n align-items: center;\n gap: var(--_gap);\n min-block-size: var(--_height);\n padding-inline: var(--_padding-inline);\n /* Discreet border + hover tint derive from the text color, so they adapt to\n any consumer `--color`. */\n border: 1px solid color-mix(in oklab, currentColor 14%, transparent);\n border-radius: var(--border-radius, var(--l-radius-full));\n background-color: var(--background, var(--l-color-bg-fill-neutral-subtle));\n color: var(--color, var(--l-color-text-neutral));\n font-family: var(--l-font-neo-grotesque);\n font-size: var(--_font-size);\n font-weight: var(--l-font-weight-medium);\n line-height: 1;\n min-inline-size: 0;\n transition:\n background-color 120ms ease,\n border-color 120ms ease;\n }\n\n /* Whole-chip hover: a touch more presence, without competing with the ×. */\n :host(:hover:not([disabled])) .base {\n background-color: color-mix(\n in oklab,\n var(--background, var(--l-color-bg-fill-neutral-subtle)),\n currentColor 7%\n );\n border-color: color-mix(in oklab, currentColor 26%, transparent);\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n ::slotted([slot='prefix']) {\n display: inline-flex;\n flex: none;\n }\n\n /*\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n 🆁🅴🅼🅾🆅🅴 (≥24px target-size, mdi:close mask — mirrors l-close)\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n */\n\n .remove {\n flex: none;\n display: grid;\n place-items: center;\n /* 24px hit target (WCAG 2.5.8); the visible tint circle is inset to ~18px. */\n inline-size: 1.5rem;\n block-size: 1.5rem;\n margin-inline: calc(var(--_gap) * -0.5) calc(var(--_padding-inline) * -0.5);\n padding: 0;\n border: 0;\n border-radius: var(--l-radius-full);\n color: inherit;\n cursor: pointer;\n /* Tint circle behind the glyph — a gradient disc kept smaller than the 24px\n hit area, grown from 0 on hover so it reads as a neat ~18px dot. */\n background: radial-gradient(\n circle at center,\n color-mix(in oklab, currentColor 15%, transparent) 60%,\n transparent 62%\n )\n no-repeat center / 0 0;\n transition:\n scale 120ms ease,\n background-size 140ms ease;\n\n &::after {\n content: '';\n inline-size: 0.875rem;\n block-size: 0.875rem;\n background-color: currentColor;\n opacity: 0.55;\n transition: opacity 120ms ease;\n /* https://pictogrammers.com/library/mdi/icon/close */\n mask: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z\" /></svg>')\n center / contain no-repeat;\n }\n\n &:hover {\n background-size: 1.125rem 1.125rem;\n }\n &:hover::after {\n opacity: 1;\n }\n\n /* Tactile press — the button dips and the disc deepens. */\n &:active {\n scale: 0.86;\n background-image: radial-gradient(\n circle at center,\n color-mix(in oklab, currentColor 26%, transparent) 60%,\n transparent 62%\n );\n }\n\n &:focus-visible {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 1px;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .base,\n .remove,\n .remove::after {\n transition-duration: 0ms;\n }\n .remove:active {\n scale: 1;\n }\n }\n}\n","import { html, nothing, unsafeCSS } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\nimport { LocalizeController } from '../../shared/localize.js';\nimport hostStyles from '../../shared/styles/host.styles.js';\nimport rawStyles from './tag.css?inline';\n\nconst styles = unsafeCSS(rawStyles);\n\nexport type TagSize = 'sm' | 'md' | 'lg';\n\n/**\n * Fired when the user asks to remove the tag — clicking the × button, or\n * pressing Backspace/Delete while it is focused. Cancelable: call\n * `preventDefault()` to keep the tag (the controlling host then manages the\n * list itself); otherwise the tag removes itself from the DOM. Does not bubble.\n */\nexport class TagRemoveEvent extends Event {\n constructor() {\n super('remove', { bubbles: false, composed: false, cancelable: true });\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n remove: TagRemoveEvent;\n }\n}\n\n/**\n * A compact chip for tokens, filters, and multi-select values. Shadow DOM so its\n * styles are self-contained and it renders correctly **anywhere**, including\n * inside another element's shadow root (e.g. the `<l-select>` multi-select\n * trigger).\n *\n * @summary A compact, optionally removable chip.\n *\n * @example\n * ```html\n * <l-tag removable>Design</l-tag>\n * ```\n *\n * @event remove - Fired when the user removes the tag (× click or Backspace/Delete). Cancelable; if not prevented the tag removes itself. Not composed, does not bubble.\n *\n * @slot - The tag label.\n * @slot prefix - Leading content, e.g. an `<l-icon>` or `<l-avatar>`.\n *\n * @csspart base - The chip container.\n * @csspart content - The label wrapper.\n * @csspart remove - The remove button.\n *\n * @cssproperty [--border-radius] - Corner radius. Defaults to a full pill.\n * @cssproperty [--background] - Chip background.\n * @cssproperty [--color] - Text color.\n *\n * @customElement l-tag\n */\nexport class Tag extends LuxenElement {\n static override styles = [hostStyles, styles];\n\n private _localize = new LocalizeController(this);\n\n /** Tag size: `sm`, `md` (default), or `lg`. */\n @property({ reflect: true })\n accessor size: TagSize = 'md';\n\n /** Show a remove button (and enable Backspace/Delete removal). */\n @property({ type: Boolean, reflect: true })\n accessor removable = false;\n\n /** Disable the tag — dims it and blocks removal. */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n private _requestRemove = () => {\n if (this.disabled) return;\n const event = new TagRemoveEvent();\n this.dispatchEvent(event);\n if (!event.defaultPrevented) this.remove();\n };\n\n private _onKeyDown = (e: KeyboardEvent) => {\n if (!this.removable || this.disabled) return;\n if (e.key === 'Backspace' || e.key === 'Delete') {\n e.preventDefault();\n this._requestRemove();\n }\n };\n\n override render() {\n return html`\n <span\n class=\"base\"\n part=\"base\"\n @keydown=${this._onKeyDown}\n >\n <slot name=\"prefix\"></slot>\n <span\n class=\"content\"\n part=\"content\"\n >\n <slot></slot>\n </span>\n ${this.removable\n ? html`<button\n class=\"remove\"\n part=\"remove\"\n type=\"button\"\n ?disabled=${this.disabled}\n aria-label=${this._localize.term('remove')}\n @click=${this._requestRemove}\n ></button>`\n : nothing}\n </span>\n `;\n }\n}\n"],"mappings":"6TCOA,IAAM,EAAS,EAAU,uzFAAS,EAUrB,EAAb,cAAoC,KAAM,CACxC,aAAc,CACZ,MAAM,SAAU,CAAE,QAAS,GAAO,SAAU,GAAO,WAAY,EAAK,CAAC,CACvE,CACF,EAoCa,EAAb,cAAyB,CAAa,8CAGhB,IAAI,EAAmB,IAAI,UAItB,aAIJ,WAID,2BAEW,CAC7B,GAAI,KAAK,SAAU,OACnB,IAAM,EAAQ,IAAI,EAClB,KAAK,cAAc,CAAK,EACnB,EAAM,kBAAkB,KAAK,OAAO,CAC3C,kBAEsB,GAAqB,CACrC,CAAC,KAAK,WAAa,KAAK,WACxB,EAAE,MAAQ,aAAe,EAAE,MAAQ,YACrC,EAAE,eAAe,EACjB,KAAK,eAAe,EAExB,qBA7ByB,CAAC,EAAY,CAAM,SAMnC,MAAA,6CAIA,WAAA,kDAIA,UAAA,0CAiBT,QAAkB,CAChB,MAAO,EAAI;;;;mBAII,KAAK,WAAW;;;;;;;;;UASzB,KAAK,UACH,CAAI;;;;0BAIU,KAAK,SAAS;2BACb,KAAK,UAAU,KAAK,QAAQ,EAAE;uBAClC,KAAK,eAAe;wBAE/B,EAAQ;;KAGlB,CACF,KArDG,EAAS,CAAE,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,KAI1B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,YAAA,IAAA,KAIzC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,WAAA,IAAA"}
1
+ {"version":3,"file":"tag.js","names":[],"sources":["../../../src/html/elements/tag/tag.css?inline","../../../src/html/elements/tag/tag.ts"],"sourcesContent":["@layer components {\n :host {\n /* Size defaults (md). A removable tag is always ≥24px tall (target-size).\n The three public knobs are folded into the private vars here rather than\n at each use site, so an override also carries to what derives from them —\n the toggle's negative inline margins and the × button's spacing math. The\n trio mirrors `.l-button` (`--height` / `--padding-inline` / `--font-size`)\n so a chip can be tuned to a dense filter panel without ::part(base). */\n --_height: var(--height, 1.5rem);\n --_font-size: var(--font-size, var(--l-text-xs));\n --_padding-inline: var(--padding-inline, 0.5rem);\n --_gap: 0.25rem;\n\n /* Skin, resolved once so `[selected]` can swap all three at the source\n instead of re-declaring the properties that consume them. */\n --_background: var(--background, var(--l-color-bg-fill-neutral-subtle));\n --_color: var(--color, var(--l-color-text-neutral));\n --_border-strength: 14%;\n\n display: inline-flex;\n vertical-align: middle;\n max-inline-size: 100%;\n }\n\n :host([size='sm']) {\n --_padding-inline: var(--padding-inline, 0.375rem);\n --_gap: 0.125rem;\n }\n\n :host([size='lg']) {\n --_height: var(--height, 1.75rem);\n --_font-size: var(--font-size, var(--l-text-sm));\n --_padding-inline: var(--padding-inline, 0.625rem);\n }\n\n /* Disabled is conveyed by the greyed × button + cursor, NOT by washing out\n * the label — dimming the whole chip with opacity composites the text below\n * the WCAG AA contrast floor (axe flags it; a disabled <button> is exempt but\n * the label span is not). */\n :host([disabled]) .base {\n cursor: not-allowed;\n }\n\n /*\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n 🅲🅷🅸🅿\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n */\n\n .base {\n display: inline-flex;\n align-items: center;\n gap: var(--_gap);\n min-block-size: var(--_height);\n padding-inline: var(--_padding-inline);\n /* Discreet border + hover tint derive from the text color, so they adapt to\n any consumer `--color`. */\n border: 1px solid color-mix(in oklab, currentColor var(--_border-strength), transparent);\n border-radius: var(--border-radius, var(--l-radius-full));\n background-color: var(--_background);\n color: var(--_color);\n font-family: var(--l-font-neo-grotesque);\n font-size: var(--_font-size);\n font-weight: var(--l-font-weight-medium);\n line-height: 1;\n min-inline-size: 0;\n transition:\n background-color 120ms ease,\n border-color 120ms ease;\n }\n\n /* Whole-chip hover: a touch more presence, without competing with the ×. */\n :host(:hover:not([disabled])) .base {\n background-color: color-mix(in oklab, var(--_background), currentColor 7%);\n border-color: color-mix(\n in oklab,\n currentColor calc(var(--_border-strength) + 12%),\n transparent\n );\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n min-inline-size: 0;\n /* `.base` sets `line-height: 1` so the chip's height comes from its own size\n tokens rather than the document's leading. That makes the line box exactly\n one em tall, and a plain `overflow: hidden` then shears every descender\n (g, j, p, q, y) at all three sizes — measured 1px short.\n\n Fixed by widening the clip rectangle, not the box: growing the line box\n instead (`line-height: normal`) moves the text half a pixel against the ×\n and the prefix icon, since the font's ascent and descent are not\n symmetrical. `clip` keeps the geometry identical and simply paints the\n tails. The margin applies to every side — there are no per-axis longhands\n in any engine yet — but 0.2em of horizontal bleed is invisible next to a\n label that is hard-cut at the edge anyway. */\n overflow: clip;\n overflow-clip-margin: 0.2em;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n ::slotted([slot='prefix']) {\n display: inline-flex;\n flex: none;\n }\n\n /* A count or trailing glyph. It sits in its own slot so `.base`'s gap gives it\n a gutter by construction — the label is a bare text node and can never be\n targeted from the outside. Lighter weight than the medium label, and\n tabular so a column of counts stays aligned. */\n ::slotted([slot='suffix']) {\n flex: none;\n font-weight: var(--l-font-weight-normal);\n font-variant-numeric: tabular-nums;\n }\n\n /*\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n 🆂🅴🅻🅴🅲🆃🅰🅱🅻🅴 (filter chip — toggle button, or a checkbox riding inside)\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n */\n\n :host([selectable]) {\n /* Taller than a display chip at the same `size`: a chip you click is a\n target (WCAG 2.5.8), and this is the dense step between `sm` and `lg` —\n more room, same 12px label, where `lg` would jump the label to body size.\n `--height` / `--font-size` tune it from there. */\n --_height: var(--height, 1.75rem);\n\n /* The selection accent is the same one the library's checkbox, radio and\n switch use, so a chip with a checkbox inside reads as a single control. */\n --_accent: var(--l-form-control-activated-color);\n /* The label is 12px, so it owes 4.5:1 over its own tint — and the raw accent\n misses it on the light one (4.35:1 measured). Darken it there, lighten it\n on the dark tint, and both modes clear 6:1. `color-mix()` resolves\n reliably inside `light-dark()` — `oklch(from …)` does not. */\n --_selected-color: var(\n --selected-color,\n light-dark(\n color-mix(in oklab, var(--_accent), black 14%),\n color-mix(in oklab, var(--_accent), white 45%)\n )\n );\n /* Derived from the text color, so overriding `--selected-color` alone\n repaints the whole chip coherently. Kept at 10%: a consumer accent skips\n the mode correction above, so the tint has to stay pale enough for a\n semantic token (`--l-color-text-success` and friends) to clear 4.5:1 on\n it unaided. The border carries the rest of the emphasis. */\n --_selected-background: var(\n --selected-background,\n color-mix(in oklab, var(--_selected-color) 10%, var(--l-color-surface))\n );\n }\n\n :host([selectable][size='lg']) {\n --_height: var(--height, 2rem);\n }\n\n :host([selectable][selected]) {\n --_background: var(--_selected-background);\n --_color: var(--_selected-color);\n --_border-strength: 45%;\n }\n\n :host([selectable]) .base {\n cursor: pointer;\n /* A chip is tapped, not read: never leave a text selection behind a\n double-click on a filter. */\n user-select: none;\n }\n\n :host([selectable][disabled]) .base {\n cursor: not-allowed;\n }\n\n /* The chip *is* the button. Negative inline margins let it cover `.base`'s\n padding so the whole pill is the target, while `.base` keeps owning the\n border, background, and the × button's spacing math. */\n .toggle {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n align-self: stretch;\n gap: var(--_gap);\n min-inline-size: 0;\n margin-inline: calc(var(--_padding-inline) * -1);\n padding-inline: var(--_padding-inline);\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n text-align: start;\n cursor: inherit;\n }\n\n /* Stop before the × instead of running under it. */\n :host([removable]) .toggle {\n margin-inline-end: 0;\n padding-inline-end: 0;\n }\n\n /* One ring for the whole chip: the inner control is a detail of how the chip\n is operated, not a second thing to focus visually — and the ring drawn\n below fully encloses the box, so the indicator only grows (WCAG 2.4.7 /\n 2.4.13).\n\n Qualified by `:host(…)` on purpose. The shared appearance nests\n `&:focus-visible` under a selector list, so it lands as\n `:is(.l-checkbox, … input[type='checkbox']:not(…)):focus-visible` — 0,3,1,\n which outranks a bare `.checkbox:focus-visible` (0,2,0) and paints a second\n ring around the box. `:host([selectable])` brings this to 0,4,0. */\n :host([selectable]) .toggle:focus-visible,\n :host([selectable]) .checkbox:focus-visible {\n outline: none;\n }\n\n .base:has(:is(.toggle, .checkbox):focus-visible) {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 2px;\n }\n\n /* The skin comes from the shared `.l-checkbox` appearance, applied through\n `cls('checkbox')` rather than a static class literal: `dist` ships that CSS\n as a real file, so a consumer's PostCSS rewrites its selector under a\n renamed `cssPrefix` — a baked `l-checkbox` in the template would stop\n matching it. This rule only carries what is specific to a chip.\n\n The shared appearance sizes the box in `em`, and a UA gives `<input>` its\n own font — inheriting the chip's makes the box track the `size` step. The\n accent follows the selected color, so a themed chip keeps its checkbox in\n the same hue. */\n .checkbox {\n --accent: var(--selected-color, var(--l-form-control-activated-color));\n /* Hover halo — same ratio and same token flip as the light-DOM\n `.l-checkbox`, which keeps this rule out of the shared partial (see\n `css/elements/checkbox.css`). Repeated here rather than moved into the\n partial: `l-tree-item` shares that file and never opted into a glow. */\n --_halo: var(--l-form-control-border-color-hover);\n\n flex: none;\n font: inherit;\n transition-property: background-color, border-color, box-shadow;\n }\n\n .checkbox:checked,\n .checkbox:indeterminate {\n --_halo: var(--accent);\n }\n\n /* Driven by the chip, not by the box: the chip is the label and the whole\n click target, so a halo lighting up only over 15px of a 28px pill would\n read as a glitch. */\n @media (hover: hover) {\n :host([selectable]:not([disabled])) .base:hover .checkbox:not(:disabled) {\n box-shadow: 0 0 0 calc(var(--size) * var(--l-form-control-toggle-halo-ratio))\n color-mix(in oklab, var(--_halo), transparent 84%);\n }\n }\n\n /* Forced colors drop the tint (backgrounds are forced to Canvas), so pin the\n border to the system highlight — otherwise selection becomes invisible. */\n @media (forced-colors: active) {\n :host([selectable][selected]) .base {\n border-color: Highlight;\n }\n }\n\n /*\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n 🆁🅴🅼🅾🆅🅴 (≥24px target-size, mdi:close mask — mirrors l-close)\n ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n */\n\n .remove {\n flex: none;\n display: grid;\n place-items: center;\n /* 24px hit target (WCAG 2.5.8); the visible tint circle is inset to ~18px. */\n inline-size: 1.5rem;\n block-size: 1.5rem;\n margin-inline: calc(var(--_gap) * -0.5) calc(var(--_padding-inline) * -0.5);\n padding: 0;\n border: 0;\n border-radius: var(--l-radius-full);\n color: inherit;\n cursor: pointer;\n /* Tint circle behind the glyph — a gradient disc kept smaller than the 24px\n hit area, grown from 0 on hover so it reads as a neat ~18px dot. */\n background: radial-gradient(\n circle at center,\n color-mix(in oklab, currentColor 15%, transparent) 60%,\n transparent 62%\n )\n no-repeat center / 0 0;\n transition:\n scale 120ms ease,\n background-size 140ms ease;\n\n &::after {\n content: '';\n inline-size: 0.875rem;\n block-size: 0.875rem;\n background-color: currentColor;\n opacity: 0.55;\n transition: opacity 120ms ease;\n /* https://pictogrammers.com/library/mdi/icon/close */\n mask: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z\" /></svg>')\n center / contain no-repeat;\n }\n\n &:hover {\n background-size: 1.125rem 1.125rem;\n }\n &:hover::after {\n opacity: 1;\n }\n\n /* Tactile press — the button dips and the disc deepens. */\n &:active {\n scale: 0.86;\n background-image: radial-gradient(\n circle at center,\n color-mix(in oklab, currentColor 26%, transparent) 60%,\n transparent 62%\n );\n }\n\n &:focus-visible {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 1px;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .base,\n .checkbox,\n .remove,\n .remove::after {\n transition-duration: 0ms;\n }\n .remove:active {\n scale: 1;\n }\n }\n}\n","import { html, nothing, unsafeCSS } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\nimport { LocalizeController } from '../../shared/localize.js';\nimport { cls } from '../../registry.js';\nimport hostStyles from '../../shared/styles/host.styles.js';\nimport checkboxAppearance from '../../shared/styles/checkbox-appearance.styles.js';\nimport rawStyles from './tag.css?inline';\n\nconst styles = unsafeCSS(rawStyles);\n\nexport type TagSize = 'sm' | 'md' | 'lg';\nexport type TagControl = 'none' | 'checkbox';\n\n/**\n * Fired when the user asks to remove the tag — clicking the × button, or\n * pressing Backspace/Delete while it is focused. Cancelable: call\n * `preventDefault()` to keep the tag (the controlling host then manages the\n * list itself); otherwise the tag removes itself from the DOM. Does not bubble.\n */\nexport class TagRemoveEvent extends Event {\n constructor() {\n super('remove', { bubbles: false, composed: false, cancelable: true });\n }\n}\n\n/** Fired when a `selectable` tag is toggled. Bubbles; not composed. */\nexport class TagChangeEvent extends Event {\n readonly selected: boolean;\n constructor(selected: boolean) {\n super('change', { bubbles: true, composed: false, cancelable: false });\n this.selected = selected;\n }\n}\n\ninterface TagEventMap {\n change: TagChangeEvent;\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n remove: TagRemoveEvent;\n }\n}\n\n/**\n * A compact chip for tokens, filters, and multi-select values. Shadow DOM so its\n * styles are self-contained and it renders correctly **anywhere**, including\n * inside another element's shadow root (e.g. the `<l-select>` multi-select\n * trigger).\n *\n * Add `selectable` to turn the chip into a filter control: the tag itself\n * becomes a toggle button (`aria-pressed`), and re-activating a selected tag\n * deselects it — the affordance a radio group cannot offer, so a facet always\n * has a way back to \"all\". Add `control=\"checkbox\"` for a multi-select axis and\n * the library's own checkbox rides inside, with the chip as its label.\n *\n * @summary A compact, optionally removable or selectable chip.\n *\n * @example\n * ```html\n * <l-tag removable>Design</l-tag>\n * <l-tag selectable selected>A3</l-tag>\n * <l-tag selectable control=\"checkbox\">Color <span slot=\"suffix\">79</span></l-tag>\n * ```\n *\n * @event remove - Fired when the user removes the tag (× click or Backspace/Delete). Cancelable; if not prevented the tag removes itself. Not composed, does not bubble.\n * @event change - Fired when a `selectable` tag is toggled. Not cancelable — like the platform's own `change`, and like `l-segmented-control`. Bubbles. Properties: `selected: boolean`. The chip is uncontrolled: it applies the new state before dispatching, so a host that vetoes a toggle (a \"max 3 filters\" rule, an async guard) sets `selected` back in the listener — the revert lands in the same render and is never painted.\n *\n * @slot - The tag label.\n * @slot prefix - Leading content, e.g. an `<l-icon>` or `<l-avatar>`.\n * @slot suffix - Trailing content, e.g. a result count. Gets the chip's own gutter, so no margin is needed.\n *\n * @csspart base - The chip container.\n * @csspart content - The label wrapper.\n * @csspart toggle - The toggle button rendered by `selectable` (not with `control=\"checkbox\"`).\n * @csspart checkbox - The native checkbox rendered by `control=\"checkbox\"`.\n * @csspart remove - The remove button.\n *\n * @cssproperty [--border-radius] - Corner radius. Defaults to a full pill.\n * @cssproperty [--height] - Chip height. Defaults to the `size` step (a selectable chip is taller, to keep a comfortable target).\n * @cssproperty [--font-size] - Label size. Defaults to the `size` step — 12px, or 14px at `size=\"lg\"`. Set it with `--height` to land between the two steps in a dense filter panel.\n * @cssproperty [--padding-inline] - Horizontal padding. Defaults to the `size` step.\n * @cssproperty [--background] - Chip background.\n * @cssproperty [--color] - Text color.\n * @cssproperty [--selected-color] - Text, border, and checkbox accent when selected. Defaults to the library's form-control accent, lightened in dark mode.\n * @cssproperty [--selected-background] - Chip background when selected. Defaults to a tint of `--selected-color`.\n *\n * @customElement l-tag\n */\n// oxlint-disable-next-line typescript/no-unsafe-declaration-merging -- typed addEventListener overloads merged below; no uninitialized properties.\nexport class Tag extends LuxenElement {\n static override styles = [hostStyles, checkboxAppearance, styles];\n\n private _localize = new LocalizeController(this);\n\n /** Tag size: `sm`, `md` (default), or `lg`. */\n @property({ reflect: true })\n accessor size: TagSize = 'md';\n\n /** Show a remove button (and enable Backspace/Delete removal). */\n @property({ type: Boolean, reflect: true })\n accessor removable = false;\n\n /** Make the tag a filter control the user can toggle on and off. */\n @property({ type: Boolean, reflect: true })\n accessor selectable = false;\n\n /** Whether the tag is selected. Reflected, so `[selected]` is styleable. */\n @property({ type: Boolean, reflect: true })\n accessor selected = false;\n\n /**\n * What drives the selection: `none` (default) makes the chip itself a toggle\n * button; `checkbox` renders a checkbox inside and makes the chip its label —\n * the right choice for a multi-select facet. Implies `selectable`.\n */\n @property({ reflect: true })\n accessor control: TagControl = 'none';\n\n /** Disable the tag — dims it and blocks selection and removal. */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n override willUpdate() {\n // A checkbox is only ever rendered on a selectable chip, so the attribute\n // (which every selectable style rule keys off) is derived rather than\n // duplicated in every selector — and in the consumer's markup.\n if (this.control === 'checkbox') this.selectable = true;\n }\n\n override updated() {\n // Re-assert the box, don't rely on the `.checked` binding. Lit dirty-checks\n // a property part against the value it last wrote, and a click has the user\n // agent flip `checked` behind its back — so when a controlling host vetoes\n // the toggle by setting `selected` back to what it already was, Lit sees no\n // change, skips the write, and leaves a checked box on an unselected chip\n // (announced \"checked\" too). Cheap: the query is null on every other path.\n const box = this.renderRoot.querySelector<HTMLInputElement>('.checkbox');\n if (box) box.checked = this.selected;\n }\n\n private _requestRemove = () => {\n if (this.disabled) return;\n const event = new TagRemoveEvent();\n this.dispatchEvent(event);\n if (!event.defaultPrevented) this.remove();\n };\n\n private _onKeyDown = (e: KeyboardEvent) => {\n if (!this.removable || this.disabled) return;\n if (e.key === 'Backspace' || e.key === 'Delete') {\n e.preventDefault();\n this._requestRemove();\n }\n };\n\n private _toggle = () => {\n if (this.disabled) return;\n // Toggling, not setting: re-activating a selected tag releases it.\n this.selected = !this.selected;\n this.dispatchEvent(new TagChangeEvent(this.selected));\n };\n\n private _onCheckboxChange = (e: Event) => {\n this.selected = (e.target as HTMLInputElement).checked;\n this.dispatchEvent(new TagChangeEvent(this.selected));\n };\n\n private _label() {\n return html`\n <slot name=\"prefix\"></slot>\n <span\n class=\"content\"\n part=\"content\"\n >\n <slot></slot>\n </span>\n <slot name=\"suffix\"></slot>\n `;\n }\n\n private _removeButton() {\n return this.removable\n ? html`<button\n class=\"remove\"\n part=\"remove\"\n type=\"button\"\n ?disabled=${this.disabled}\n aria-label=${this._localize.term('remove')}\n @click=${this._requestRemove}\n ></button>`\n : nothing;\n }\n\n override render() {\n if (this.control === 'checkbox') {\n return html`\n <label\n class=\"base\"\n part=\"base\"\n @keydown=${this._onKeyDown}\n >\n <input\n class=\"checkbox ${cls('checkbox')}\"\n part=\"checkbox\"\n type=\"checkbox\"\n .checked=${this.selected}\n ?disabled=${this.disabled}\n @change=${this._onCheckboxChange}\n />\n ${this._label()}${this._removeButton()}\n </label>\n `;\n }\n\n if (this.selectable) {\n return html`\n <span\n class=\"base\"\n part=\"base\"\n @keydown=${this._onKeyDown}\n >\n <button\n class=\"toggle\"\n part=\"toggle\"\n type=\"button\"\n aria-pressed=${this.selected ? 'true' : 'false'}\n ?disabled=${this.disabled}\n @click=${this._toggle}\n >\n ${this._label()}\n </button>\n ${this._removeButton()}\n </span>\n `;\n }\n\n return html`\n <span\n class=\"base\"\n part=\"base\"\n @keydown=${this._onKeyDown}\n >\n ${this._label()}${this._removeButton()}\n </span>\n `;\n }\n}\n\n// Type `addEventListener('change', …)` so listeners receive a `TagChangeEvent`\n// (with `.selected`) instead of a bare `Event`. `change` collides with lib.dom's\n// `GlobalEventHandlersEventMap`, so it can't be augmented globally — the\n// overloads are declaration-merged onto this element's interface instead. The\n// interface MUST come after the class (the CEM analyzer dedups on the first\n// declaration of the name). See `tabs.ts` for the fully-annotated reference.\nexport interface Tag {\n addEventListener<K extends keyof TagEventMap>(\n type: K,\n listener: (this: Tag, ev: TagEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n ): void;\n addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): void;\n removeEventListener<K extends keyof TagEventMap>(\n type: K,\n listener: (this: Tag, ev: TagEventMap[K]) => void,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n}\n"],"mappings":"saCSA,IAAM,EAAS,EAAU,i/JAAS,EAWrB,EAAb,cAAoC,KAAM,CACxC,aAAc,CACZ,MAAM,SAAU,CAAE,QAAS,GAAO,SAAU,GAAO,WAAY,EAAK,CAAC,CACvE,CACF,EAGa,EAAb,cAAoC,KAAM,CAExC,YAAY,EAAmB,CAC7B,MAAM,SAAU,CAAE,QAAS,GAAM,SAAU,GAAO,WAAY,EAAM,CAAC,EACrE,KAAK,SAAW,CAClB,CACF,EA0Da,EAAb,cAAyB,CAAa,8CAGhB,IAAI,EAAmB,IAAI,UAItB,aAIJ,WAIC,WAIF,WAQW,eAIX,2BAoBW,CAC7B,GAAI,KAAK,SAAU,OACnB,IAAM,EAAQ,IAAI,EAClB,KAAK,cAAc,CAAK,EACnB,EAAM,kBAAkB,KAAK,OAAO,CAC3C,kBAEsB,GAAqB,CACrC,CAAC,KAAK,WAAa,KAAK,WACxB,EAAE,MAAQ,aAAe,EAAE,MAAQ,YACrC,EAAE,eAAe,EACjB,KAAK,eAAe,EAExB,mBAEwB,CAClB,KAAK,WAET,KAAK,SAAW,CAAC,KAAK,SACtB,KAAK,cAAc,IAAI,EAAe,KAAK,QAAQ,CAAC,EACtD,yBAE6B,GAAa,CACxC,KAAK,SAAY,EAAE,OAA4B,QAC/C,KAAK,cAAc,IAAI,EAAe,KAAK,QAAQ,CAAC,CACtD,qBA3EyB,CAAC,EAAY,EAAoB,CAAM,SAMvD,MAAA,6CAIA,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K,CAAC,CAAA,EAAA,EAAA,UAAA,UAAA,IAAA,KAI1B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,WAAA,IAAA"}
@@ -1,4 +1,4 @@
1
- import{tagName as e}from"../../registry.js";import{i as t}from"../../chunks/lit.js";import{i as n,t as r}from"../../chunks/decorate.js";import{a as i}from"../../chunks/lit-html.js";import{LuxenElement as a}from"../../shared/luxen-element.js";import o from"../../shared/styles/host.styles.js";import s from"../../shared/styles/checkbox-appearance.styles.js";var c=t(`:host{color:var(--l-color-text-primary);outline:none;font-size:.875rem;line-height:1.5;display:block}:host([disabled]){opacity:.4}:host([disabled]) .item{cursor:not-allowed}.item{align-items:center;gap:var(--item-gap);min-block-size:var(--row-height);padding-inline:var(--row-padding-inline);cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:.375rem;padding-inline-start:calc(var(--indent-size) * var(--_depth,0) + var(--row-padding-inline));transition:background-color .12s,color .12s;display:flex;position:relative}.item:focus-visible,:host(:focus-visible) .item{outline:2px solid var(--l-focus-ring);outline-offset:1px}@media (hover:hover){:host(:not([disabled])) .item:hover{background-color:var(--l-color-bg-state-hover)}}:host([selected]:not([disabled])) .item{background-color:var(--l-color-bg-state-selected)}.expand{inline-size:var(--chevron-size);block-size:var(--chevron-size);color:var(--l-color-text-secondary);cursor:pointer;border-radius:3px;flex:none;place-items:center;display:grid}:host(:not(:state(has-children)):not([lazy])) .expand>slot>svg{display:none}.expand svg{width:100%;height:100%;display:block}:host(:not(:state(checkbox))) .checkbox{display:none}.label{overflow-clip-margin:.375rem;text-overflow:ellipsis;white-space:nowrap;flex:1;align-items:center;gap:.375rem;min-inline-size:0;display:flex;overflow:clip}.label ::slotted(*){min-inline-size:0}.branch{position:relative}.content{padding-inline-start:calc(var(--indent-size) * var(--_depth,0) + var(--row-padding-inline) + var(--chevron-size) + var(--item-gap));padding-inline-end:var(--row-padding-inline);display:block}:host(:state(has-children):not([expanded])) .content,.children{display:none}:host([expanded]) .children{display:block}.branch:before{content:"";border-inline-start:var(--indent-guide-width) var(--indent-guide-style) var(--indent-guide-color);pointer-events:none;inline-size:0;position:absolute;inset-block:0;inset-inline-start:calc(var(--indent-size) * var(--_depth,0) + var(--row-padding-inline) + (var(--chevron-size) / 2) - (var(--indent-guide-width) / 2))}:host(:not([expanded])) .branch:before,:host(:not(:state(has-children))) .branch:before{display:none}.spinner{border:2px solid var(--l-color-border);border-block-start-color:#0000;border-radius:50%;block-size:.875rem;inline-size:.875rem;animation:.7s linear infinite spin}@media (prefers-reduced-motion:reduce){.spinner{animation:none}}@keyframes spin{to{transform:rotate(360deg)}}`),l=class extends Event{constructor(){super(`expand`,{bubbles:!0,composed:!1,cancelable:!1})}},u=class extends Event{constructor(){super(`collapse`,{bubbles:!0,composed:!1,cancelable:!1})}},d=class extends Event{constructor(){super(`lazy-load`,{bubbles:!0,composed:!1,cancelable:!1})}},f=class extends Event{constructor(e,t){super(`selection-toggle`,{bubbles:!0,composed:!1,cancelable:!1}),this.item=e,this.checked=t}},p=class extends a{constructor(...e){super(...e),this._internals=this.attachInternals(),this.#e=!1,this.#t=!1,this.#n=!1,this.#r=!1,this.#i=!1,this.#a=!1,this._showCheckbox=!1,this._depth=0,this._hasChildren=!1,this._onCheckboxChange=e=>{e.stopPropagation();let t=e.target;this.dispatchEvent(new f(this,t.checked))}}static{this.styles=[o,s,c]}#e;get expanded(){return this.#e}set expanded(e){this.#e=e}#t;get selected(){return this.#t}set selected(e){this.#t=e}#n;get indeterminate(){return this.#n}set indeterminate(e){this.#n=e}#r;get disabled(){return this.#r}set disabled(e){this.#r=e}#i;get lazy(){return this.#i}set lazy(e){this.#i=e}#a;get loading(){return this.#a}set loading(e){this.#a=e}set showCheckbox(e){this._showCheckbox=e,this._setState(`checkbox`,e)}get showCheckbox(){return this._showCheckbox}set depth(e){this._depth=e,this.style.setProperty(`--_depth`,String(e))}get depth(){return this._depth}setPosition(e,t,n){this._aria(`ariaLevel`,`aria-level`,String(e)),this._aria(`ariaPosInSet`,`aria-posinset`,String(t)),this._aria(`ariaSetSize`,`aria-setsize`,String(n))}get hasChildren(){return this._hasChildren}getChildrenItems({includeDisabled:t=!0}={}){let n=e(`tree-item`).toUpperCase();return Array.from(this.children).filter(e=>e.tagName===n&&(t||!e.disabled))}isLeaf(){return!this.lazy&&this.getChildrenItems().length===0}getTextLabel(){let e=this.shadowRoot?.querySelector(`slot:not([name])`);return e?e.assignedNodes({flatten:!0}).map(e=>e.textContent??``).join(``).trim():(this.textContent??``).trim()}connectedCallback(){super.connectedCallback(),this._internals.role=`treeitem`,this.hasAttribute(`role`)||this.setAttribute(`role`,`treeitem`),this._childObserver=new MutationObserver(()=>this._syncChildren()),this._childObserver.observe(this,{childList:!0}),this._syncChildren()}disconnectedCallback(){super.disconnectedCallback(),this._childObserver?.disconnect()}updated(e){e.has(`expanded`)&&(this._reflectExpanded(),this.expanded&&this.lazy&&this.dispatchEvent(new d),this.dispatchEvent(this.expanded?new l:new u)),e.has(`selected`)&&this._aria(`ariaSelected`,`aria-selected`,String(this.selected)),e.has(`disabled`)&&this._aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),e.has(`loading`)&&this._aria(`ariaBusy`,`aria-busy`,this.loading?`true`:null)}_reflectExpanded(){this._aria(`ariaExpanded`,`aria-expanded`,this.isLeaf()?null:String(this.expanded))}_aria(e,t,n){this._internals[e]=n,n===null?this.removeAttribute(t):this.setAttribute(t,n)}_setState(e,t){this._internals.states&&(t?this._internals.states.add(e):this._internals.states.delete(e))}_syncChildren(){let t=e(`tree-item`).toUpperCase(),n=0;for(let e of Array.from(this.children))e.tagName===t&&(n++,e.slot!==`children`&&(e.slot=`children`));this._hasChildren=n>0,this._setState(`has-children`,this._hasChildren),!this._hasChildren&&!this.lazy&&this.expanded&&(this.expanded=!1),this._reflectExpanded()}toggle(){this.isLeaf()&&!this.lazy||(this.expanded=!this.expanded)}render(){return i`
1
+ import{cls as e,tagName as t}from"../../registry.js";import{i as n}from"../../chunks/lit.js";import{i as r,t as i}from"../../chunks/decorate.js";import{a}from"../../chunks/lit-html.js";import{LuxenElement as o}from"../../shared/luxen-element.js";import s from"../../shared/styles/host.styles.js";import c from"../../shared/styles/checkbox-appearance.styles.js";var l=n(`:host{color:var(--l-color-text-primary);outline:none;font-size:.875rem;line-height:1.5;display:block}:host([disabled]){opacity:.4}:host([disabled]) .item{cursor:not-allowed}.item{align-items:center;gap:var(--item-gap);min-block-size:var(--row-height);padding-inline:var(--row-padding-inline);cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:.375rem;padding-inline-start:calc(var(--indent-size) * var(--_depth,0) + var(--row-padding-inline));transition:background-color .12s,color .12s;display:flex;position:relative}.item:focus-visible,:host(:focus-visible) .item{outline:2px solid var(--l-focus-ring);outline-offset:1px}@media (hover:hover){:host(:not([disabled])) .item:hover{background-color:var(--l-color-bg-state-hover)}}:host([selected]:not([disabled])) .item{background-color:var(--l-color-bg-state-selected)}.expand{inline-size:var(--chevron-size);block-size:var(--chevron-size);color:var(--l-color-text-secondary);cursor:pointer;border-radius:3px;flex:none;place-items:center;display:grid}:host(:not(:state(has-children)):not([lazy])) .expand>slot>svg{display:none}.expand svg{width:100%;height:100%;display:block}:host(:not(:state(checkbox))) .checkbox{display:none}.label{overflow-clip-margin:.375rem;text-overflow:ellipsis;white-space:nowrap;flex:1;align-items:center;gap:.375rem;min-inline-size:0;display:flex;overflow:clip}.label ::slotted(*){min-inline-size:0}.branch{position:relative}.content{padding-inline-start:calc(var(--indent-size) * var(--_depth,0) + var(--row-padding-inline) + var(--chevron-size) + var(--item-gap));padding-inline-end:var(--row-padding-inline);display:block}:host(:state(has-children):not([expanded])) .content,.children{display:none}:host([expanded]) .children{display:block}.branch:before{content:"";border-inline-start:var(--indent-guide-width) var(--indent-guide-style) var(--indent-guide-color);pointer-events:none;inline-size:0;position:absolute;inset-block:0;inset-inline-start:calc(var(--indent-size) * var(--_depth,0) + var(--row-padding-inline) + (var(--chevron-size) / 2) - (var(--indent-guide-width) / 2))}:host(:not([expanded])) .branch:before,:host(:not(:state(has-children))) .branch:before{display:none}.spinner{border:2px solid var(--l-color-border);border-block-start-color:#0000;border-radius:50%;block-size:.875rem;inline-size:.875rem;animation:.7s linear infinite spin}@media (prefers-reduced-motion:reduce){.spinner{animation:none}}@keyframes spin{to{transform:rotate(360deg)}}`),u=class extends Event{constructor(){super(`expand`,{bubbles:!0,composed:!1,cancelable:!1})}},d=class extends Event{constructor(){super(`collapse`,{bubbles:!0,composed:!1,cancelable:!1})}},f=class extends Event{constructor(){super(`lazy-load`,{bubbles:!0,composed:!1,cancelable:!1})}},p=class extends Event{constructor(e,t){super(`selection-toggle`,{bubbles:!0,composed:!1,cancelable:!1}),this.item=e,this.checked=t}},m=class extends o{constructor(...e){super(...e),this._internals=this.attachInternals(),this.#e=!1,this.#t=!1,this.#n=!1,this.#r=!1,this.#i=!1,this.#a=!1,this._showCheckbox=!1,this._depth=0,this._hasChildren=!1,this._onCheckboxChange=e=>{e.stopPropagation();let t=e.target;this.dispatchEvent(new p(this,t.checked))}}static{this.styles=[s,c,l]}#e;get expanded(){return this.#e}set expanded(e){this.#e=e}#t;get selected(){return this.#t}set selected(e){this.#t=e}#n;get indeterminate(){return this.#n}set indeterminate(e){this.#n=e}#r;get disabled(){return this.#r}set disabled(e){this.#r=e}#i;get lazy(){return this.#i}set lazy(e){this.#i=e}#a;get loading(){return this.#a}set loading(e){this.#a=e}set showCheckbox(e){this._showCheckbox=e,this._setState(`checkbox`,e)}get showCheckbox(){return this._showCheckbox}set depth(e){this._depth=e,this.style.setProperty(`--_depth`,String(e))}get depth(){return this._depth}setPosition(e,t,n){this._aria(`ariaLevel`,`aria-level`,String(e)),this._aria(`ariaPosInSet`,`aria-posinset`,String(t)),this._aria(`ariaSetSize`,`aria-setsize`,String(n))}get hasChildren(){return this._hasChildren}getChildrenItems({includeDisabled:e=!0}={}){let n=t(`tree-item`).toUpperCase();return Array.from(this.children).filter(t=>t.tagName===n&&(e||!t.disabled))}isLeaf(){return!this.lazy&&this.getChildrenItems().length===0}getTextLabel(){let e=this.shadowRoot?.querySelector(`slot:not([name])`);return e?e.assignedNodes({flatten:!0}).map(e=>e.textContent??``).join(``).trim():(this.textContent??``).trim()}connectedCallback(){super.connectedCallback(),this._internals.role=`treeitem`,this.hasAttribute(`role`)||this.setAttribute(`role`,`treeitem`),this._childObserver=new MutationObserver(()=>this._syncChildren()),this._childObserver.observe(this,{childList:!0}),this._syncChildren()}disconnectedCallback(){super.disconnectedCallback(),this._childObserver?.disconnect()}updated(e){e.has(`expanded`)&&(this._reflectExpanded(),this.expanded&&this.lazy&&this.dispatchEvent(new f),this.dispatchEvent(this.expanded?new u:new d)),e.has(`selected`)&&this._aria(`ariaSelected`,`aria-selected`,String(this.selected)),e.has(`disabled`)&&this._aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),e.has(`loading`)&&this._aria(`ariaBusy`,`aria-busy`,this.loading?`true`:null)}_reflectExpanded(){this._aria(`ariaExpanded`,`aria-expanded`,this.isLeaf()?null:String(this.expanded))}_aria(e,t,n){this._internals[e]=n,n===null?this.removeAttribute(t):this.setAttribute(t,n)}_setState(e,t){this._internals.states&&(t?this._internals.states.add(e):this._internals.states.delete(e))}_syncChildren(){let e=t(`tree-item`).toUpperCase(),n=0;for(let t of Array.from(this.children))t.tagName===e&&(n++,t.slot!==`children`&&(t.slot=`children`));this._hasChildren=n>0,this._setState(`has-children`,this._hasChildren),!this._hasChildren&&!this.lazy&&this.expanded&&(this.expanded=!1),this._reflectExpanded()}toggle(){this.isLeaf()&&!this.lazy||(this.expanded=!this.expanded)}render(){return a`
2
2
  <div
3
3
  class="item"
4
4
  part="base"
@@ -8,10 +8,10 @@ import{tagName as e}from"../../registry.js";import{i as t}from"../../chunks/lit.
8
8
  part="expand-button"
9
9
  aria-hidden="true"
10
10
  >
11
- ${this.loading?i`<span
11
+ ${this.loading?a`<span
12
12
  class="spinner"
13
13
  role="status"
14
- ></span>`:this.expanded||this.isLeaf()?i`<slot name="collapse-icon">
14
+ ></span>`:this.expanded||this.isLeaf()?a`<slot name="collapse-icon">
15
15
  <svg
16
16
  viewBox="0 0 16 16"
17
17
  fill="none"
@@ -24,7 +24,7 @@ import{tagName as e}from"../../registry.js";import{i as t}from"../../chunks/lit.
24
24
  stroke-linejoin="round"
25
25
  />
26
26
  </svg>
27
- </slot>`:i`<slot name="expand-icon">
27
+ </slot>`:a`<slot name="expand-icon">
28
28
  <svg
29
29
  viewBox="0 0 16 16"
30
30
  fill="none"
@@ -41,7 +41,7 @@ import{tagName as e}from"../../registry.js";import{i as t}from"../../chunks/lit.
41
41
  </span>
42
42
 
43
43
  <input
44
- class="checkbox l-checkbox"
44
+ class="checkbox ${e(`checkbox`)}"
45
45
  part="checkbox"
46
46
  type="checkbox"
47
47
  tabindex="-1"
@@ -80,5 +80,5 @@ import{tagName as e}from"../../registry.js";import{i as t}from"../../chunks/lit.
80
80
  <slot name="children"></slot>
81
81
  </div>
82
82
  </div>
83
- `}};r([n({type:Boolean,reflect:!0})],p.prototype,`expanded`,null),r([n({type:Boolean,reflect:!0})],p.prototype,`selected`,null),r([n({type:Boolean,reflect:!0})],p.prototype,`indeterminate`,null),r([n({type:Boolean,reflect:!0})],p.prototype,`disabled`,null),r([n({type:Boolean,reflect:!0})],p.prototype,`lazy`,null),r([n({type:Boolean,reflect:!0})],p.prototype,`loading`,null);export{u as CollapseEvent,l as ExpandEvent,d as LazyLoadEvent,p as TreeItem,f as TreeItemSelectionToggleEvent};
83
+ `}};i([r({type:Boolean,reflect:!0})],m.prototype,`expanded`,null),i([r({type:Boolean,reflect:!0})],m.prototype,`selected`,null),i([r({type:Boolean,reflect:!0})],m.prototype,`indeterminate`,null),i([r({type:Boolean,reflect:!0})],m.prototype,`disabled`,null),i([r({type:Boolean,reflect:!0})],m.prototype,`lazy`,null),i([r({type:Boolean,reflect:!0})],m.prototype,`loading`,null);export{d as CollapseEvent,u as ExpandEvent,f as LazyLoadEvent,m as TreeItem,p as TreeItemSelectionToggleEvent};
84
84
  //# sourceMappingURL=tree-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree-item.js","names":[],"sources":["../../../src/html/elements/tree-item/tree-item.css?inline","../../../src/html/elements/tree-item/tree-item.ts"],"sourcesContent":[":host {\n display: block;\n color: var(--l-color-text-primary);\n font-size: 0.875rem;\n line-height: 1.5;\n /* The host is the roving-tabindex focus target, but the visible ring is drawn\n on the inner `.item` row. Suppress the host's UA outline so it doesn't paint\n a second ring around the whole subtree (row + children). */\n outline: none;\n}\n\n:host([disabled]) {\n opacity: 0.4;\n}\n\n:host([disabled]) .item {\n cursor: not-allowed;\n}\n\n.item {\n display: flex;\n align-items: center;\n gap: var(--item-gap);\n min-block-size: var(--row-height);\n padding-inline: var(--row-padding-inline);\n padding-inline-start: calc(var(--indent-size) * var(--_depth, 0) + var(--row-padding-inline));\n border-radius: 0.375rem;\n cursor: pointer;\n user-select: none;\n transition:\n background-color 120ms ease,\n color 120ms ease;\n position: relative;\n}\n\n.item:focus-visible,\n:host(:focus-visible) .item {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 1px;\n}\n\n@media (hover: hover) {\n :host(:not([disabled])) .item:hover {\n background-color: var(--l-color-bg-state-hover);\n }\n}\n\n:host([selected]:not([disabled])) .item {\n background-color: var(--l-color-bg-state-selected);\n}\n\n.expand {\n inline-size: var(--chevron-size);\n block-size: var(--chevron-size);\n display: grid;\n place-items: center;\n flex: none;\n color: var(--l-color-text-secondary);\n border-radius: 3px;\n cursor: pointer;\n}\n\n/* Hide the DEFAULT fallback chevron SVG on a leaf — slotted content\n (user-provided icon, avatar, etc.) remains visible because it lives outside\n the slot in the DOM tree. The `.expand` span keeps its fixed --chevron-size\n so leaf rows stay aligned with branches. */\n:host(:not(:state(has-children)):not([lazy])) .expand > slot > svg {\n display: none;\n}\n\n.expand svg {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* The checkbox appearance comes from the shared `.l-checkbox` skin imported\n above; this rule only governs visibility. */\n:host(:not(:state(checkbox))) .checkbox {\n display: none;\n}\n\n.label {\n flex: 1;\n min-inline-size: 0;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n /* `clip` (not `hidden`) so the label still truncates long text to an ellipsis\n while `overflow-clip-margin` lets a slotted interactive control's hover/focus\n decoration (a row-action button, an `<l-dropdown>` trigger) bleed past the\n row-height label box instead of being cut on its top/bottom/left edges. The\n margin is kept small so the bleed stays imperceptible for text. */\n overflow: clip;\n overflow-clip-margin: 0.375rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.label ::slotted(*) {\n min-inline-size: 0;\n}\n\n/* Wrapper around the content slot + children — anchor for the indent guide. */\n.branch {\n position: relative;\n}\n\n/* Content slot — block area between the row and the children.\n Aligned under the label text: same left offset as the row's label\n (depth indent + row padding + chevron + gap). Visible for leaves (no\n children) and for expanded branches; hidden when a branch is collapsed\n (mirrors the children visibility). */\n.content {\n display: block;\n padding-inline-start: calc(\n var(--indent-size) * var(--_depth, 0) + var(--row-padding-inline) + var(--chevron-size) +\n var(--item-gap)\n );\n padding-inline-end: var(--row-padding-inline);\n}\n\n:host(:state(has-children):not([expanded])) .content {\n display: none;\n}\n\n.children {\n display: none;\n}\n\n:host([expanded]) .children {\n display: block;\n}\n\n/* Vertical indent guide — spans the content + children block, starting\n right below the row so it never overlaps the chevron/avatar.\n The guide's visual centre sits exactly on the parent chevron's centre. */\n.branch::before {\n content: '';\n position: absolute;\n inset-block: 0;\n inset-inline-start: calc(\n var(--indent-size) * var(--_depth, 0) + var(--row-padding-inline) + (var(--chevron-size) / 2) -\n (var(--indent-guide-width) / 2)\n );\n inline-size: 0;\n border-inline-start: var(--indent-guide-width) var(--indent-guide-style) var(--indent-guide-color);\n pointer-events: none;\n}\n\n/* Only render the guide for open branches that have children. */\n:host(:not([expanded])) .branch::before,\n:host(:not(:state(has-children))) .branch::before {\n display: none;\n}\n\n.spinner {\n inline-size: 0.875rem;\n block-size: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--l-color-border);\n border-block-start-color: transparent;\n animation: spin 700ms linear infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation: none;\n }\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n","import { html, unsafeCSS, type PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\nimport { tagName } from '../../registry.js';\nimport hostStyles from '../../shared/styles/host.styles.js';\nimport checkboxAppearance from '../../shared/styles/checkbox-appearance.styles.js';\nimport rawStyles from './tree-item.css?inline';\n\nconst styles = unsafeCSS(rawStyles);\n\n/** Fired when a tree item is expanded. Bubbles; not composed. */\nexport class ExpandEvent extends Event {\n constructor() {\n super('expand', { bubbles: true, composed: false, cancelable: false });\n }\n}\n\n/** Fired when a tree item is collapsed. Bubbles; not composed. */\nexport class CollapseEvent extends Event {\n constructor() {\n super('collapse', { bubbles: true, composed: false, cancelable: false });\n }\n}\n\n/** Fired when a lazy item is expanded for the first time. Bubbles; not composed. */\nexport class LazyLoadEvent extends Event {\n constructor() {\n super('lazy-load', { bubbles: true, composed: false, cancelable: false });\n }\n}\n\n/**\n * Internal contract: a tree-item's checkbox toggle, bubbling to its `<l-tree>`.\n * Not part of the public API — consumers listen on `<l-tree>` for\n * `selection-change` instead.\n */\nexport class TreeItemSelectionToggleEvent extends Event {\n readonly item: TreeItem;\n readonly checked: boolean;\n constructor(item: TreeItem, checked: boolean) {\n super('selection-toggle', { bubbles: true, composed: false, cancelable: false });\n this.item = item;\n this.checked = checked;\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n expand: ExpandEvent;\n collapse: CollapseEvent;\n 'lazy-load': LazyLoadEvent;\n }\n}\n\n/**\n * A node inside `<l-tree>`. Nested `<l-tree-item>` children become sub-nodes.\n *\n * @slot - Label content (kept to a single row).\n * @slot prefix - Leading content before the label (e.g. icon).\n * @slot suffix - Trailing content.\n * @slot expand-icon - Icon shown when the item is collapsed.\n * @slot collapse-icon - Icon shown when the item is expanded.\n * @slot content - Block content that belongs to the item but not to its header row (e.g. comment body, action bar). Hidden when a branch is collapsed.\n *\n * @csspart base - The item row.\n * @csspart expand-button - The chevron toggle area.\n * @csspart checkbox - The native checkbox input.\n * @csspart label - The label container.\n * @csspart branch - Wrapper around the content and children slots; carries the indent guide.\n * @csspart content - The content slot wrapper (block area between the row and the children).\n * @csspart children - The nested items container.\n *\n * @cssproperty [--_depth] - Internal depth index driving indentation. Set by `<l-tree>`.\n *\n * Layout tokens (`--chevron-size`, `--row-height`, `--row-padding-inline`, `--item-gap`) live on `<l-tree>` and cascade down — see its CSS custom properties.\n *\n * @event expand - Fired when the item is expanded.\n * @event collapse - Fired when the item is collapsed.\n * @event lazy-load - Fired when a lazy item is expanded for the first time. Consumers should append children and set `lazy=false`.\n *\n * @customElement l-tree-item\n */\nexport class TreeItem extends LuxenElement {\n static override styles = [hostStyles, checkboxAppearance, styles];\n\n private _internals = this.attachInternals();\n private _childObserver?: MutationObserver;\n\n /** Whether the item is expanded. */\n @property({ type: Boolean, reflect: true })\n accessor expanded = false;\n\n /** Whether the item is selected. */\n @property({ type: Boolean, reflect: true })\n accessor selected = false;\n\n /** Whether the checkbox is indeterminate (some descendants selected). */\n @property({ type: Boolean, reflect: true })\n accessor indeterminate = false;\n\n /** Whether the item is disabled. */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n /** Marks this item as having children that will be loaded on first expand. */\n @property({ type: Boolean, reflect: true })\n accessor lazy = false;\n\n /** Whether the item is currently loading (shows a spinner). */\n @property({ type: Boolean, reflect: true })\n accessor loading = false;\n\n /** Set by `<l-tree>`: whether a checkbox is shown. */\n set showCheckbox(value: boolean) {\n this._showCheckbox = value;\n this._setState('checkbox', value);\n }\n get showCheckbox(): boolean {\n return this._showCheckbox;\n }\n private _showCheckbox = false;\n\n /** Set by `<l-tree>`: depth of the item in the tree (0 = root). */\n set depth(value: number) {\n this._depth = value;\n this.style.setProperty('--_depth', String(value));\n }\n get depth(): number {\n return this._depth;\n }\n private _depth = 0;\n\n /**\n * Set by `<l-tree>`: ARIA position within the tree. `level` is 1-based depth,\n * `posInSet`/`setSize` describe the item's rank among its siblings. These let\n * screen readers announce \"level 2, 3 of 5\" even when `lazy` children keep the\n * full set out of the DOM.\n */\n setPosition(level: number, posInSet: number, setSize: number) {\n this._aria('ariaLevel', 'aria-level', String(level));\n this._aria('ariaPosInSet', 'aria-posinset', String(posInSet));\n this._aria('ariaSetSize', 'aria-setsize', String(setSize));\n }\n\n /** Whether this item has nested tree-item children. */\n get hasChildren(): boolean {\n return this._hasChildren;\n }\n private _hasChildren = false;\n\n /** Returns the child `<l-tree-item>` elements directly under this one. */\n getChildrenItems({ includeDisabled = true } = {}): TreeItem[] {\n const childTag = tagName('tree-item').toUpperCase();\n return (Array.from(this.children) as TreeItem[]).filter(\n (el) => el.tagName === childTag && (includeDisabled || !el.disabled),\n );\n }\n\n /** Returns true if this item has no expandable children. */\n isLeaf(): boolean {\n return !this.lazy && this.getChildrenItems().length === 0;\n }\n\n /** Returns the text label of this item. */\n getTextLabel(): string {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n if (!slot) return (this.textContent ?? '').trim();\n return slot\n .assignedNodes({ flatten: true })\n .map((n) => n.textContent ?? '')\n .join('')\n .trim();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'treeitem';\n // Mirror the role to a DOM attribute too, so `[role=\"treeitem\"]` selectors\n // (CSS, querySelector, Cypress/Playwright CSS) keep matching — the\n // ElementInternals role alone is not attribute-selectable. ARIA states are\n // mirrored the same way in `_aria()` (aria-expanded/selected/disabled/…).\n if (!this.hasAttribute('role')) this.setAttribute('role', 'treeitem');\n this._childObserver = new MutationObserver(() => this._syncChildren());\n this._childObserver.observe(this, { childList: true });\n this._syncChildren();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._childObserver?.disconnect();\n }\n\n override updated(changed: PropertyValues<this>) {\n if (changed.has('expanded')) {\n this._reflectExpanded();\n // Emit lazy-load for ANY transition to expanded (keyboard, chevron,\n // `expandAll()`…), not just `toggle()` — otherwise keyboard users expand a\n // lazy branch with no children and no fetch. Fires while still `lazy`; the\n // consumer appends children and clears `lazy`, so it won't re-fire.\n if (this.expanded && this.lazy) this.dispatchEvent(new LazyLoadEvent());\n this.dispatchEvent(this.expanded ? new ExpandEvent() : new CollapseEvent());\n }\n\n if (changed.has('selected')) {\n this._aria('ariaSelected', 'aria-selected', String(this.selected));\n }\n\n if (changed.has('disabled')) {\n this._aria('ariaDisabled', 'aria-disabled', this.disabled ? 'true' : null);\n }\n\n if (changed.has('loading')) {\n this._aria('ariaBusy', 'aria-busy', this.loading ? 'true' : null);\n }\n }\n\n /** Leaf items omit `aria-expanded` entirely; branches reflect their state. */\n private _reflectExpanded() {\n this._aria('ariaExpanded', 'aria-expanded', this.isLeaf() ? null : String(this.expanded));\n }\n\n /**\n * Write an ARIA state to BOTH ElementInternals (the semantic source, in the\n * accessibility tree) and a content attribute (so `[aria-*]` CSS / query / test\n * selectors keep matching — same belt-and-suspenders as the mirrored `role`).\n * A `null` value clears both.\n */\n private _aria(key: keyof ElementInternals, attr: string, value: string | null) {\n (this._internals as unknown as Record<string, string | null>)[key] = value;\n if (value === null) this.removeAttribute(attr);\n else this.setAttribute(attr, value);\n }\n\n private _setState(name: string, on: boolean) {\n if (!this._internals.states) return;\n if (on) this._internals.states.add(name);\n else this._internals.states.delete(name);\n }\n\n private _syncChildren() {\n // Auto-slot nested tree-items into the `children` slot so they render in the group container,\n // while label text/elements remain in the default slot.\n const childTag = tagName('tree-item').toUpperCase();\n let count = 0;\n for (const child of Array.from(this.children) as HTMLElement[]) {\n if (child.tagName === childTag) {\n count++;\n if (child.slot !== 'children') child.slot = 'children';\n }\n }\n this._hasChildren = count > 0;\n this._setState('has-children', this._hasChildren);\n if (!this._hasChildren && !this.lazy && this.expanded) {\n this.expanded = false;\n }\n this._reflectExpanded();\n }\n\n /** Toggle expand state. Opening a `lazy` item emits `lazy-load` (via `updated`). */\n toggle() {\n if (this.isLeaf() && !this.lazy) return;\n // lazy-load is emitted centrally from `updated()` on the expand transition.\n this.expanded = !this.expanded;\n }\n\n private _onCheckboxChange = (event: Event) => {\n event.stopPropagation();\n const input = event.target as HTMLInputElement;\n this.dispatchEvent(new TreeItemSelectionToggleEvent(this, input.checked));\n };\n\n override render() {\n return html`\n <div\n class=\"item\"\n part=\"base\"\n >\n <span\n class=\"expand\"\n part=\"expand-button\"\n aria-hidden=\"true\"\n >\n ${this.loading\n ? html`<span\n class=\"spinner\"\n role=\"status\"\n ></span>`\n : this.expanded || this.isLeaf()\n ? html`<slot name=\"collapse-icon\">\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M3.5 6l4.5 5 4.5-5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </slot>`\n : html`<slot name=\"expand-icon\">\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M6 3.5l5 4.5-5 4.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </slot>`}\n </span>\n\n <input\n class=\"checkbox l-checkbox\"\n part=\"checkbox\"\n type=\"checkbox\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n .checked=${this.selected}\n .indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n @click=${(e: Event) => e.stopPropagation()}\n @change=${this._onCheckboxChange}\n />\n\n <slot name=\"prefix\"></slot>\n <span\n class=\"label\"\n part=\"label\"\n ><slot></slot\n ></span>\n <slot name=\"suffix\"></slot>\n </div>\n\n <div\n class=\"branch\"\n part=\"branch\"\n >\n <div\n class=\"content\"\n part=\"content\"\n >\n <slot name=\"content\"></slot>\n </div>\n <div\n class=\"children\"\n part=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;;;;;;;;;;;;;yBAaK;;;;;;;;;qBASJ,KAAK,SAAS;2BACR,KAAK,cAAc;sBACxB,KAAK,SAAS;mBAChB,GAAa,EAAE,gBAAgB,EAAE;oBACjC,KAAK,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BzC,CACF,KA/QG,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,WAAA,IAAA,KAIzC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,WAAA,IAAA,KAIzC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,gBAAA,IAAA,KAIzC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,WAAA,IAAA,KAIzC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,KAIzC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,UAAA,IAAA"}
1
+ {"version":3,"file":"tree-item.js","names":[],"sources":["../../../src/html/elements/tree-item/tree-item.css?inline","../../../src/html/elements/tree-item/tree-item.ts"],"sourcesContent":[":host {\n display: block;\n color: var(--l-color-text-primary);\n font-size: 0.875rem;\n line-height: 1.5;\n /* The host is the roving-tabindex focus target, but the visible ring is drawn\n on the inner `.item` row. Suppress the host's UA outline so it doesn't paint\n a second ring around the whole subtree (row + children). */\n outline: none;\n}\n\n:host([disabled]) {\n opacity: 0.4;\n}\n\n:host([disabled]) .item {\n cursor: not-allowed;\n}\n\n.item {\n display: flex;\n align-items: center;\n gap: var(--item-gap);\n min-block-size: var(--row-height);\n padding-inline: var(--row-padding-inline);\n padding-inline-start: calc(var(--indent-size) * var(--_depth, 0) + var(--row-padding-inline));\n border-radius: 0.375rem;\n cursor: pointer;\n user-select: none;\n transition:\n background-color 120ms ease,\n color 120ms ease;\n position: relative;\n}\n\n.item:focus-visible,\n:host(:focus-visible) .item {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 1px;\n}\n\n@media (hover: hover) {\n :host(:not([disabled])) .item:hover {\n background-color: var(--l-color-bg-state-hover);\n }\n}\n\n:host([selected]:not([disabled])) .item {\n background-color: var(--l-color-bg-state-selected);\n}\n\n.expand {\n inline-size: var(--chevron-size);\n block-size: var(--chevron-size);\n display: grid;\n place-items: center;\n flex: none;\n color: var(--l-color-text-secondary);\n border-radius: 3px;\n cursor: pointer;\n}\n\n/* Hide the DEFAULT fallback chevron SVG on a leaf — slotted content\n (user-provided icon, avatar, etc.) remains visible because it lives outside\n the slot in the DOM tree. The `.expand` span keeps its fixed --chevron-size\n so leaf rows stay aligned with branches. */\n:host(:not(:state(has-children)):not([lazy])) .expand > slot > svg {\n display: none;\n}\n\n.expand svg {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* The checkbox appearance comes from the shared `.l-checkbox` skin imported\n above; this rule only governs visibility. */\n:host(:not(:state(checkbox))) .checkbox {\n display: none;\n}\n\n.label {\n flex: 1;\n min-inline-size: 0;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n /* `clip` (not `hidden`) so the label still truncates long text to an ellipsis\n while `overflow-clip-margin` lets a slotted interactive control's hover/focus\n decoration (a row-action button, an `<l-dropdown>` trigger) bleed past the\n row-height label box instead of being cut on its top/bottom/left edges. The\n margin is kept small so the bleed stays imperceptible for text. */\n overflow: clip;\n overflow-clip-margin: 0.375rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.label ::slotted(*) {\n min-inline-size: 0;\n}\n\n/* Wrapper around the content slot + children — anchor for the indent guide. */\n.branch {\n position: relative;\n}\n\n/* Content slot — block area between the row and the children.\n Aligned under the label text: same left offset as the row's label\n (depth indent + row padding + chevron + gap). Visible for leaves (no\n children) and for expanded branches; hidden when a branch is collapsed\n (mirrors the children visibility). */\n.content {\n display: block;\n padding-inline-start: calc(\n var(--indent-size) * var(--_depth, 0) + var(--row-padding-inline) + var(--chevron-size) +\n var(--item-gap)\n );\n padding-inline-end: var(--row-padding-inline);\n}\n\n:host(:state(has-children):not([expanded])) .content {\n display: none;\n}\n\n.children {\n display: none;\n}\n\n:host([expanded]) .children {\n display: block;\n}\n\n/* Vertical indent guide — spans the content + children block, starting\n right below the row so it never overlaps the chevron/avatar.\n The guide's visual centre sits exactly on the parent chevron's centre. */\n.branch::before {\n content: '';\n position: absolute;\n inset-block: 0;\n inset-inline-start: calc(\n var(--indent-size) * var(--_depth, 0) + var(--row-padding-inline) + (var(--chevron-size) / 2) -\n (var(--indent-guide-width) / 2)\n );\n inline-size: 0;\n border-inline-start: var(--indent-guide-width) var(--indent-guide-style) var(--indent-guide-color);\n pointer-events: none;\n}\n\n/* Only render the guide for open branches that have children. */\n:host(:not([expanded])) .branch::before,\n:host(:not(:state(has-children))) .branch::before {\n display: none;\n}\n\n.spinner {\n inline-size: 0.875rem;\n block-size: 0.875rem;\n border-radius: 50%;\n border: 2px solid var(--l-color-border);\n border-block-start-color: transparent;\n animation: spin 700ms linear infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation: none;\n }\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n","import { html, unsafeCSS, type PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { LuxenElement } from '../../shared/luxen-element.js';\nimport { cls, tagName } from '../../registry.js';\nimport hostStyles from '../../shared/styles/host.styles.js';\nimport checkboxAppearance from '../../shared/styles/checkbox-appearance.styles.js';\nimport rawStyles from './tree-item.css?inline';\n\nconst styles = unsafeCSS(rawStyles);\n\n/** Fired when a tree item is expanded. Bubbles; not composed. */\nexport class ExpandEvent extends Event {\n constructor() {\n super('expand', { bubbles: true, composed: false, cancelable: false });\n }\n}\n\n/** Fired when a tree item is collapsed. Bubbles; not composed. */\nexport class CollapseEvent extends Event {\n constructor() {\n super('collapse', { bubbles: true, composed: false, cancelable: false });\n }\n}\n\n/** Fired when a lazy item is expanded for the first time. Bubbles; not composed. */\nexport class LazyLoadEvent extends Event {\n constructor() {\n super('lazy-load', { bubbles: true, composed: false, cancelable: false });\n }\n}\n\n/**\n * Internal contract: a tree-item's checkbox toggle, bubbling to its `<l-tree>`.\n * Not part of the public API — consumers listen on `<l-tree>` for\n * `selection-change` instead.\n */\nexport class TreeItemSelectionToggleEvent extends Event {\n readonly item: TreeItem;\n readonly checked: boolean;\n constructor(item: TreeItem, checked: boolean) {\n super('selection-toggle', { bubbles: true, composed: false, cancelable: false });\n this.item = item;\n this.checked = checked;\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n expand: ExpandEvent;\n collapse: CollapseEvent;\n 'lazy-load': LazyLoadEvent;\n }\n}\n\n/**\n * A node inside `<l-tree>`. Nested `<l-tree-item>` children become sub-nodes.\n *\n * @slot - Label content (kept to a single row).\n * @slot prefix - Leading content before the label (e.g. icon).\n * @slot suffix - Trailing content.\n * @slot expand-icon - Icon shown when the item is collapsed.\n * @slot collapse-icon - Icon shown when the item is expanded.\n * @slot content - Block content that belongs to the item but not to its header row (e.g. comment body, action bar). Hidden when a branch is collapsed.\n *\n * @csspart base - The item row.\n * @csspart expand-button - The chevron toggle area.\n * @csspart checkbox - The native checkbox input.\n * @csspart label - The label container.\n * @csspart branch - Wrapper around the content and children slots; carries the indent guide.\n * @csspart content - The content slot wrapper (block area between the row and the children).\n * @csspart children - The nested items container.\n *\n * @cssproperty [--_depth] - Internal depth index driving indentation. Set by `<l-tree>`.\n *\n * Layout tokens (`--chevron-size`, `--row-height`, `--row-padding-inline`, `--item-gap`) live on `<l-tree>` and cascade down — see its CSS custom properties.\n *\n * @event expand - Fired when the item is expanded.\n * @event collapse - Fired when the item is collapsed.\n * @event lazy-load - Fired when a lazy item is expanded for the first time. Consumers should append children and set `lazy=false`.\n *\n * @customElement l-tree-item\n */\nexport class TreeItem extends LuxenElement {\n static override styles = [hostStyles, checkboxAppearance, styles];\n\n private _internals = this.attachInternals();\n private _childObserver?: MutationObserver;\n\n /** Whether the item is expanded. */\n @property({ type: Boolean, reflect: true })\n accessor expanded = false;\n\n /** Whether the item is selected. */\n @property({ type: Boolean, reflect: true })\n accessor selected = false;\n\n /** Whether the checkbox is indeterminate (some descendants selected). */\n @property({ type: Boolean, reflect: true })\n accessor indeterminate = false;\n\n /** Whether the item is disabled. */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false;\n\n /** Marks this item as having children that will be loaded on first expand. */\n @property({ type: Boolean, reflect: true })\n accessor lazy = false;\n\n /** Whether the item is currently loading (shows a spinner). */\n @property({ type: Boolean, reflect: true })\n accessor loading = false;\n\n /** Set by `<l-tree>`: whether a checkbox is shown. */\n set showCheckbox(value: boolean) {\n this._showCheckbox = value;\n this._setState('checkbox', value);\n }\n get showCheckbox(): boolean {\n return this._showCheckbox;\n }\n private _showCheckbox = false;\n\n /** Set by `<l-tree>`: depth of the item in the tree (0 = root). */\n set depth(value: number) {\n this._depth = value;\n this.style.setProperty('--_depth', String(value));\n }\n get depth(): number {\n return this._depth;\n }\n private _depth = 0;\n\n /**\n * Set by `<l-tree>`: ARIA position within the tree. `level` is 1-based depth,\n * `posInSet`/`setSize` describe the item's rank among its siblings. These let\n * screen readers announce \"level 2, 3 of 5\" even when `lazy` children keep the\n * full set out of the DOM.\n */\n setPosition(level: number, posInSet: number, setSize: number) {\n this._aria('ariaLevel', 'aria-level', String(level));\n this._aria('ariaPosInSet', 'aria-posinset', String(posInSet));\n this._aria('ariaSetSize', 'aria-setsize', String(setSize));\n }\n\n /** Whether this item has nested tree-item children. */\n get hasChildren(): boolean {\n return this._hasChildren;\n }\n private _hasChildren = false;\n\n /** Returns the child `<l-tree-item>` elements directly under this one. */\n getChildrenItems({ includeDisabled = true } = {}): TreeItem[] {\n const childTag = tagName('tree-item').toUpperCase();\n return (Array.from(this.children) as TreeItem[]).filter(\n (el) => el.tagName === childTag && (includeDisabled || !el.disabled),\n );\n }\n\n /** Returns true if this item has no expandable children. */\n isLeaf(): boolean {\n return !this.lazy && this.getChildrenItems().length === 0;\n }\n\n /** Returns the text label of this item. */\n getTextLabel(): string {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n if (!slot) return (this.textContent ?? '').trim();\n return slot\n .assignedNodes({ flatten: true })\n .map((n) => n.textContent ?? '')\n .join('')\n .trim();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'treeitem';\n // Mirror the role to a DOM attribute too, so `[role=\"treeitem\"]` selectors\n // (CSS, querySelector, Cypress/Playwright CSS) keep matching — the\n // ElementInternals role alone is not attribute-selectable. ARIA states are\n // mirrored the same way in `_aria()` (aria-expanded/selected/disabled/…).\n if (!this.hasAttribute('role')) this.setAttribute('role', 'treeitem');\n this._childObserver = new MutationObserver(() => this._syncChildren());\n this._childObserver.observe(this, { childList: true });\n this._syncChildren();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._childObserver?.disconnect();\n }\n\n override updated(changed: PropertyValues<this>) {\n if (changed.has('expanded')) {\n this._reflectExpanded();\n // Emit lazy-load for ANY transition to expanded (keyboard, chevron,\n // `expandAll()`…), not just `toggle()` — otherwise keyboard users expand a\n // lazy branch with no children and no fetch. Fires while still `lazy`; the\n // consumer appends children and clears `lazy`, so it won't re-fire.\n if (this.expanded && this.lazy) this.dispatchEvent(new LazyLoadEvent());\n this.dispatchEvent(this.expanded ? new ExpandEvent() : new CollapseEvent());\n }\n\n if (changed.has('selected')) {\n this._aria('ariaSelected', 'aria-selected', String(this.selected));\n }\n\n if (changed.has('disabled')) {\n this._aria('ariaDisabled', 'aria-disabled', this.disabled ? 'true' : null);\n }\n\n if (changed.has('loading')) {\n this._aria('ariaBusy', 'aria-busy', this.loading ? 'true' : null);\n }\n }\n\n /** Leaf items omit `aria-expanded` entirely; branches reflect their state. */\n private _reflectExpanded() {\n this._aria('ariaExpanded', 'aria-expanded', this.isLeaf() ? null : String(this.expanded));\n }\n\n /**\n * Write an ARIA state to BOTH ElementInternals (the semantic source, in the\n * accessibility tree) and a content attribute (so `[aria-*]` CSS / query / test\n * selectors keep matching — same belt-and-suspenders as the mirrored `role`).\n * A `null` value clears both.\n */\n private _aria(key: keyof ElementInternals, attr: string, value: string | null) {\n (this._internals as unknown as Record<string, string | null>)[key] = value;\n if (value === null) this.removeAttribute(attr);\n else this.setAttribute(attr, value);\n }\n\n private _setState(name: string, on: boolean) {\n if (!this._internals.states) return;\n if (on) this._internals.states.add(name);\n else this._internals.states.delete(name);\n }\n\n private _syncChildren() {\n // Auto-slot nested tree-items into the `children` slot so they render in the group container,\n // while label text/elements remain in the default slot.\n const childTag = tagName('tree-item').toUpperCase();\n let count = 0;\n for (const child of Array.from(this.children) as HTMLElement[]) {\n if (child.tagName === childTag) {\n count++;\n if (child.slot !== 'children') child.slot = 'children';\n }\n }\n this._hasChildren = count > 0;\n this._setState('has-children', this._hasChildren);\n if (!this._hasChildren && !this.lazy && this.expanded) {\n this.expanded = false;\n }\n this._reflectExpanded();\n }\n\n /** Toggle expand state. Opening a `lazy` item emits `lazy-load` (via `updated`). */\n toggle() {\n if (this.isLeaf() && !this.lazy) return;\n // lazy-load is emitted centrally from `updated()` on the expand transition.\n this.expanded = !this.expanded;\n }\n\n private _onCheckboxChange = (event: Event) => {\n event.stopPropagation();\n const input = event.target as HTMLInputElement;\n this.dispatchEvent(new TreeItemSelectionToggleEvent(this, input.checked));\n };\n\n override render() {\n return html`\n <div\n class=\"item\"\n part=\"base\"\n >\n <span\n class=\"expand\"\n part=\"expand-button\"\n aria-hidden=\"true\"\n >\n ${this.loading\n ? html`<span\n class=\"spinner\"\n role=\"status\"\n ></span>`\n : this.expanded || this.isLeaf()\n ? html`<slot name=\"collapse-icon\">\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M3.5 6l4.5 5 4.5-5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </slot>`\n : html`<slot name=\"expand-icon\">\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M6 3.5l5 4.5-5 4.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </slot>`}\n </span>\n\n <input\n class=\"checkbox ${cls('checkbox')}\"\n part=\"checkbox\"\n type=\"checkbox\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n .checked=${this.selected}\n .indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n @click=${(e: Event) => e.stopPropagation()}\n @change=${this._onCheckboxChange}\n />\n\n <slot name=\"prefix\"></slot>\n <span\n class=\"label\"\n part=\"label\"\n ><slot></slot\n ></span>\n <slot name=\"suffix\"></slot>\n </div>\n\n <div\n class=\"branch\"\n part=\"branch\"\n >\n <div\n class=\"content\"\n part=\"content\"\n >\n <slot name=\"content\"></slot>\n </div>\n <div\n class=\"children\"\n part=\"children\"\n role=\"group\"\n >\n <slot name=\"children\"></slot>\n </div>\n </div>\n `;\n }\n}\n"],"mappings":"yWCQA,IAAM,EAAS,EAAU,k6EAAS,EAGrB,EAAb,cAAiC,KAAM,CACrC,aAAc,CACZ,MAAM,SAAU,CAAE,QAAS,GAAM,SAAU,GAAO,WAAY,EAAM,CAAC,CACvE,CACF,EAGa,EAAb,cAAmC,KAAM,CACvC,aAAc,CACZ,MAAM,WAAY,CAAE,QAAS,GAAM,SAAU,GAAO,WAAY,EAAM,CAAC,CACzE,CACF,EAGa,EAAb,cAAmC,KAAM,CACvC,aAAc,CACZ,MAAM,YAAa,CAAE,QAAS,GAAM,SAAU,GAAO,WAAY,EAAM,CAAC,CAC1E,CACF,EAOa,EAAb,cAAkD,KAAM,CAGtD,YAAY,EAAgB,EAAkB,CAC5C,MAAM,mBAAoB,CAAE,QAAS,GAAM,SAAU,GAAO,WAAY,EAAM,CAAC,EAC/E,KAAK,KA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AAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,OAAA,IAAA,KAIzC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAA,EAAA,UAAA,UAAA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"button-core.styles.js","names":[],"sources":["../../../src/html/shared/styles/button-core.css?inline","../../../src/html/shared/styles/button-core.styles.ts"],"sourcesContent":["/*\n * Shared `.l-button` appearance — the single source of truth for the button's\n * base look, primary, and destructive variants. Lives in the HTML tree so it is\n * both:\n * - `@import`ed (and layered) by src/css/elements/button.css for the light-DOM\n * `.l-button`, and\n * - imported `?inline` into shadow-DOM elements (l-alert-dialog) that render\n * their own `.l-button` actions and can't reach the global stylesheet.\n *\n * Intentionally UNLAYERED: the light-DOM import wraps it in `@layer components`\n * via `@import … layer(components)`, while shadow consumers want it unlayered to\n * sit alongside the (also unlayered) dialog styles. Size/icon-only/press-effect\n * variants stay in button.css — shadow actions don't need them.\n */\n.l-button {\n /* Local size scaffolding (referenced by the size variants in button.css). */\n --_button-size-xs: var(--l-size-control-xs); /* 28px */\n --_button-size-sm: var(--l-size-control-sm); /* 32px */\n --_button-size-md: var(--l-size-control-md); /* 36px */\n --_button-size-lg: var(--l-size-control-lg); /* 40px */\n --_button-size-xl: var(--l-size-control-xl); /* 44px */\n\n /* Appearance (default: secondary) */\n --height: var(--_button-size-md);\n --padding-inline: 0.625rem;\n --background-color: var(--l-color-bg-fill-secondary);\n --background-color-active: color-mix(\n in oklab,\n var(--l-color-bg-fill-secondary) 90%,\n var(--l-color-text-primary)\n );\n --background-color-hover: var(--background-color-active);\n --font-size: var(--l-text-sm);\n --text-color: var(--l-color-text-primary);\n --text-color-hover: var(--text-color);\n --border-color: var(--l-color-border);\n --border-color-hover: color-mix(in oklab, var(--l-color-border) 75%, var(--l-color-text-primary));\n\n position: relative;\n display: inline-flex;\n place-items: center;\n justify-content: center;\n gap: calc(var(--spacing) * 2);\n height: var(--height);\n padding-inline: var(--padding-inline);\n border: 1px solid var(--border-color);\n border-radius: calc(var(--height) / 8);\n background: var(--background-color);\n color: var(--text-color);\n outline: none;\n font-size: var(--font-size);\n font-weight: var(--l-font-weight-semibold);\n text-decoration: none;\n user-select: none;\n white-space: nowrap;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n\n transition-property: background-color, color, text-decoration, border-color;\n transition-duration: 150ms;\n\n /* `:disabled` (native) and `[aria-disabled]` (a busy/blocked control kept in\n the tab order) read the same. */\n &:not(:disabled):not([aria-disabled='true']) {\n cursor: pointer;\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n cursor: not-allowed;\n opacity: 0.4;\n }\n\n &:not(:disabled):not([aria-disabled='true']):hover {\n background-color: var(--background-color-hover);\n border-color: var(--border-color-hover);\n color: var(--text-color-hover);\n }\n\n &:not(:disabled):not([aria-disabled='true']):active {\n background-color: var(--background-color-active);\n }\n\n &:focus-visible {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 2px;\n }\n}\n\n.l-button[data-variant='primary'] {\n --background-color: var(--l-color-bg-fill-brand);\n --background-color-active: var(--l-color-bg-fill-brand-active);\n --background-color-hover: var(--l-color-bg-fill-brand-hover);\n --text-color: var(--l-color-text-on-fill-brand);\n --text-color-hover: var(--l-color-text-on-fill-brand);\n --border-color: transparent;\n --border-color-hover: transparent;\n}\n\n/* Soft danger fill: a pale tint with a dark-red label, deepening the tint on\n hover/active. Reads clearly as destructive without the visual shout of a solid\n red — the consequence lives in the copy and the confirmation, not the chrome.\n Derivations mix the soft fill toward the danger text color, so the tint\n deepens in light mode and lightens in dark mode (where soft is near-black). */\n.l-button[data-variant='destructive'] {\n --background-color: var(--l-color-bg-fill-danger-soft);\n --background-color-hover: color-mix(\n in oklab,\n var(--l-color-bg-fill-danger-soft) 80%,\n var(--l-color-text-danger)\n );\n --background-color-active: color-mix(\n in oklab,\n var(--l-color-bg-fill-danger-soft) 65%,\n var(--l-color-text-danger)\n );\n --text-color: var(--l-color-text-danger);\n --text-color-hover: var(--l-color-text-danger);\n --border-color: transparent;\n --border-color-hover: transparent;\n}\n","import { unsafeCSS } from 'lit';\nimport raw from './button-core.css?inline';\n\n/**\n * Wrapper module for the shared `.l-button` appearance. `unsafeCSS()` is called\n * once here so every shadow-DOM element that renders `.l-button` actions\n * (l-alert-dialog, and any future l-confirm/l-prompt) shares one `CSSResult`\n * (one constructed `CSSStyleSheet`, not one per importer).\n */\nexport default unsafeCSS(raw);\n"],"mappings":"wCCSA,IAAA,EAAe,EAAU,8pFAAG"}
1
+ {"version":3,"file":"button-core.styles.js","names":[],"sources":["../../../src/html/shared/styles/button-core.css?inline","../../../src/html/shared/styles/button-core.styles.ts"],"sourcesContent":["/*\n * Shared `.l-button` appearance — the single source of truth for the button's\n * base look, primary, and destructive variants. Lives in the HTML tree so it is\n * both:\n * - `@import`ed (and layered) by src/css/elements/button.css for the light-DOM\n * `.l-button`, and\n * - imported `?inline` into shadow-DOM elements (l-alert-dialog) that render\n * their own `.l-button` actions and can't reach the global stylesheet.\n *\n * Intentionally UNLAYERED: the light-DOM import wraps it in `@layer components`\n * via `@import … layer(components)`, while shadow consumers want it unlayered to\n * sit alongside the (also unlayered) dialog styles. Size/icon-only/press-effect\n * variants stay in button.css — shadow actions don't need them.\n *\n * Shadow consumers must emit the class via `cls('button')`, never a static\n * `class=\"l-button\"` literal: this file ships to dist as a real CSS file, so the\n * CONSUMER's postcss-plugin-prefix rewrites this selector to\n * `.<cssPrefix>-button`, while the vite-plugin's `transform` hook only rewrites\n * `_cssPrefix` in registry.js and never touches template literals in element JS.\n */\n.l-button {\n /* Local size scaffolding (referenced by the size variants in button.css). */\n --_button-size-xs: var(--l-size-control-xs); /* 28px */\n --_button-size-sm: var(--l-size-control-sm); /* 32px */\n --_button-size-md: var(--l-size-control-md); /* 36px */\n --_button-size-lg: var(--l-size-control-lg); /* 40px */\n --_button-size-xl: var(--l-size-control-xl); /* 44px */\n\n /* Appearance (default: secondary) */\n --height: var(--_button-size-md);\n --padding-inline: 0.625rem;\n --background-color: var(--l-color-bg-fill-secondary);\n --background-color-active: color-mix(\n in oklab,\n var(--l-color-bg-fill-secondary) 90%,\n var(--l-color-text-primary)\n );\n --background-color-hover: var(--background-color-active);\n --font-size: var(--l-text-sm);\n --text-color: var(--l-color-text-primary);\n --text-color-hover: var(--text-color);\n --border-color: var(--l-color-border);\n --border-color-hover: color-mix(in oklab, var(--l-color-border) 75%, var(--l-color-text-primary));\n\n position: relative;\n display: inline-flex;\n place-items: center;\n justify-content: center;\n gap: calc(var(--spacing) * 2);\n height: var(--height);\n padding-inline: var(--padding-inline);\n border: 1px solid var(--border-color);\n border-radius: calc(var(--height) / 8);\n background: var(--background-color);\n color: var(--text-color);\n outline: none;\n font-size: var(--font-size);\n font-weight: var(--l-font-weight-semibold);\n text-decoration: none;\n user-select: none;\n white-space: nowrap;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n\n transition-property: background-color, color, text-decoration, border-color;\n transition-duration: 150ms;\n\n /* `:disabled` (native) and `[aria-disabled]` (a busy/blocked control kept in\n the tab order) read the same. */\n &:not(:disabled):not([aria-disabled='true']) {\n cursor: pointer;\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n cursor: not-allowed;\n opacity: 0.4;\n }\n\n &:not(:disabled):not([aria-disabled='true']):hover {\n background-color: var(--background-color-hover);\n border-color: var(--border-color-hover);\n color: var(--text-color-hover);\n }\n\n &:not(:disabled):not([aria-disabled='true']):active {\n background-color: var(--background-color-active);\n }\n\n &:focus-visible {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 2px;\n }\n}\n\n.l-button[data-variant='primary'] {\n --background-color: var(--l-color-bg-fill-brand);\n --background-color-active: var(--l-color-bg-fill-brand-active);\n --background-color-hover: var(--l-color-bg-fill-brand-hover);\n --text-color: var(--l-color-text-on-fill-brand);\n --text-color-hover: var(--l-color-text-on-fill-brand);\n --border-color: transparent;\n --border-color-hover: transparent;\n}\n\n/* Soft danger fill: a pale tint with a dark-red label, deepening the tint on\n hover/active. Reads clearly as destructive without the visual shout of a solid\n red — the consequence lives in the copy and the confirmation, not the chrome.\n Derivations mix the soft fill toward the danger text color, so the tint\n deepens in light mode and lightens in dark mode (where soft is near-black). */\n.l-button[data-variant='destructive'] {\n --background-color: var(--l-color-bg-fill-danger-soft);\n --background-color-hover: color-mix(\n in oklab,\n var(--l-color-bg-fill-danger-soft) 80%,\n var(--l-color-text-danger)\n );\n --background-color-active: color-mix(\n in oklab,\n var(--l-color-bg-fill-danger-soft) 65%,\n var(--l-color-text-danger)\n );\n --text-color: var(--l-color-text-danger);\n --text-color-hover: var(--l-color-text-danger);\n --border-color: transparent;\n --border-color-hover: transparent;\n}\n","import { unsafeCSS } from 'lit';\nimport raw from './button-core.css?inline';\n\n/**\n * Wrapper module for the shared `.l-button` appearance. `unsafeCSS()` is called\n * once here so every shadow-DOM element that renders `.l-button` actions\n * (l-alert-dialog, and any future l-confirm/l-prompt) shares one `CSSResult`\n * (one constructed `CSSStyleSheet`, not one per importer).\n */\nexport default unsafeCSS(raw);\n"],"mappings":"wCCSA,IAAA,EAAe,EAAU,8pFAAG"}
@@ -1,2 +1,2 @@
1
- import{i as e}from"../../chunks/lit.js";var t=e(`@layer components{.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch]){--size:var(--l-form-control-toggle-size);--accent:var(--l-form-control-activated-color);--checkmark:url("data:image/svg+xml;utf8,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"white\\" stroke-width=\\"2.5\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg>");--_dash:url("data:image/svg+xml;utf8,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"white\\" stroke-width=\\"2.5\\" stroke-linecap=\\"round\\"><line x1=\\"5\\" y1=\\"12\\" x2=\\"19\\" y2=\\"12\\"/></svg>");box-sizing:border-box;inline-size:var(--size);block-size:var(--size);appearance:none;border:var(--l-form-control-border-width) solid var(--l-form-control-border-color);border-radius:calc(var(--size) * .2);background-color:var(--l-form-control-background-color);vertical-align:middle;cursor:pointer;background-position:50%;background-repeat:no-repeat;background-size:75%;flex:none;margin:0;padding:0;transition-property:background-color,border-color;transition-duration:.15s}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):checked,:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):indeterminate{border-color:var(--accent);background-color:var(--accent)}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):checked{background-image:var(--checkmark)}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):indeterminate{background-image:var(--_dash)}@media (hover:hover){:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):hover:not(:disabled){border-color:var(--l-form-control-border-color-hover)}}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):focus-visible{outline:2px solid var(--l-focus-ring);outline-offset:2px}@media (forced-colors:active){:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):checked,:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):indeterminate{background-color:highlight;border-color:highlight}}:is(:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):user-invalid,:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch]))[aria-invalid=true]){--accent:var(--l-form-control-border-color-invalid);border-color:var(--l-form-control-border-color-invalid)}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):disabled{cursor:not-allowed;opacity:.4}@media (prefers-reduced-motion:reduce){.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch]){transition-duration:0s}}}`);export{t as default};
1
+ import{i as e}from"../../chunks/lit.js";var t=e(`@layer components{.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch]){--size:var(--l-form-control-toggle-size);--accent:var(--l-form-control-activated-color);--checkmark:url("data:image/svg+xml;utf8,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"white\\" stroke-width=\\"2.5\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><polyline points=\\"20 6 9 17 4 12\\"/></svg>");--_dash:url("data:image/svg+xml;utf8,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"white\\" stroke-width=\\"2.5\\" stroke-linecap=\\"round\\"><line x1=\\"5\\" y1=\\"12\\" x2=\\"19\\" y2=\\"12\\"/></svg>");box-sizing:border-box;inline-size:var(--size);block-size:var(--size);appearance:none;border:var(--l-form-control-border-width) solid var(--l-form-control-border-color);border-radius:calc(var(--size) * .2);background-color:var(--l-form-control-background-color);vertical-align:middle;cursor:pointer;background-position:50%;background-repeat:no-repeat;background-size:75%;flex:none;margin:0;padding:0;transition-property:background-color,border-color;transition-duration:.15s}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):checked,:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):indeterminate{border-color:var(--accent);background-color:var(--accent)}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):checked{background-image:var(--checkmark)}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):indeterminate{background-image:var(--_dash)}@media (hover:hover){:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):hover:not(:disabled){border-color:var(--l-form-control-border-color-hover)}}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):focus-visible{outline:2px solid var(--l-focus-ring);outline-offset:2px}@media (forced-colors:active){:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):checked,:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):indeterminate{background-color:highlight;border-color:highlight}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):disabled{border-color:graytext}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):disabled:is(:checked,:indeterminate){background-color:graytext}}:is(:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):user-invalid,:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch]))[aria-invalid=true]){--accent:var(--l-form-control-border-color-invalid);border-color:var(--l-form-control-border-color-invalid)}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):disabled{cursor:not-allowed}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):disabled:not(:checked,:indeterminate){border-color:var(--l-form-control-disabled-border);background-color:var(--l-form-control-disabled-background)}:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):disabled:is(:checked,:indeterminate){opacity:.4}@media (forced-colors:active){:is(.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch])):disabled:is(:checked,:indeterminate){opacity:1}}@media (prefers-reduced-motion:reduce){.l-checkbox,:where(l-form-field:not([unstyled]))>input[type=checkbox]:not([role=switch]){transition-duration:0s}}}`);export{t as default};
2
2
  //# sourceMappingURL=checkbox-appearance.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-appearance.styles.js","names":[],"sources":["../../../src/html/shared/styles/checkbox-appearance.css?inline","../../../src/html/shared/styles/checkbox-appearance.styles.ts"],"sourcesContent":["/* Shared checkbox appearance — the visual skin behind `.l-checkbox`.\n\n Colocated with its `checkbox-appearance.styles.ts` wrapper so Shadow-DOM\n elements that render their own native checkbox (e.g. `<l-tree-item>` in\n `selection=\"multiple\"`) can pull in the exact same look via `static styles`.\n The global light-DOM `checkbox.css` primitive `@import`s this file too, so\n both surfaces stay in sync. The global `.l-checkbox` class cannot pierce a\n shadow boundary, but the `--l-form-control-*` tokens this rule relies on DO\n inherit across shadow roots.\n\n The checkmark / indeterminate dash are drawn with a `background-image` SVG on\n the input itself — `::before`/`::after` do not paint on replaced elements\n like `<input>`. `background-image` can't read the host's `currentColor`, so\n the glyph color is baked white. This stays legible because the accent\n (`--l-form-control-activated-color`) is a stable color that does not invert\n between light and dark. Override `--checkmark` to swap the icon. */\n\n@layer components {\n .l-checkbox,\n :where(l-form-field:not([unstyled])) > input[type='checkbox']:not([role='switch']) {\n /* Public knobs */\n --size: var(--l-form-control-toggle-size);\n --accent: var(--l-form-control-activated-color);\n --checkmark: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"white\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"/></svg>');\n --_dash: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"white\" stroke-width=\"2.5\" stroke-linecap=\"round\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>');\n\n box-sizing: border-box;\n flex: 0 0 auto;\n inline-size: var(--size);\n block-size: var(--size);\n margin: 0;\n padding: 0;\n appearance: none;\n border: var(--l-form-control-border-width) solid var(--l-form-control-border-color);\n border-radius: calc(var(--size) * 0.2);\n background-color: var(--l-form-control-background-color);\n background-repeat: no-repeat;\n background-position: center;\n background-size: 75%;\n vertical-align: middle;\n cursor: pointer;\n transition-property: background-color, border-color;\n transition-duration: 150ms;\n\n &:checked,\n &:indeterminate {\n border-color: var(--accent);\n background-color: var(--accent);\n }\n\n &:checked {\n background-image: var(--checkmark);\n }\n\n &:indeterminate {\n background-image: var(--_dash);\n }\n\n @media (hover: hover) {\n &:hover:not(:disabled) {\n border-color: var(--l-form-control-border-color-hover);\n }\n }\n\n &:focus-visible {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 2px;\n }\n\n /* High contrast: the checked fill is forced to Canvas, hiding the accent and\n leaving the baked-white glyph invisible — pin the checked box to a system\n color so the checkmark/dash stays legible. */\n @media (forced-colors: active) {\n &:checked,\n &:indeterminate {\n border-color: Highlight;\n background-color: Highlight;\n }\n }\n\n /* Invalid: only after interaction (`:user-invalid`), or forced via\n `aria-invalid` (set by `l-form-field` / server-side validation).\n Overriding `--accent` makes a checked invalid box fill with the error\n color too (not just the border). */\n &:user-invalid,\n &[aria-invalid='true'] {\n --accent: var(--l-form-control-border-color-invalid);\n border-color: var(--l-form-control-border-color-invalid);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .l-checkbox,\n :where(l-form-field:not([unstyled])) > input[type='checkbox']:not([role='switch']) {\n transition-duration: 0ms;\n }\n }\n}\n","import { unsafeCSS } from 'lit';\nimport raw from './checkbox-appearance.css?inline';\n\n/**\n * Shared `.l-checkbox` appearance for Shadow-DOM elements that render their own\n * native checkbox (e.g. `<l-tree-item>` in `selection=\"multiple\"`).\n * Wrapper module: `unsafeCSS()` is called once here so all importers share the\n * same `CSSResult` instance (one constructed `CSSStyleSheet`).\n */\nexport default unsafeCSS(raw);\n"],"mappings":"wCCSA,IAAA,EAAe,EAAU,07FAAG"}
1
+ {"version":3,"file":"checkbox-appearance.styles.js","names":[],"sources":["../../../src/html/shared/styles/checkbox-appearance.css?inline","../../../src/html/shared/styles/checkbox-appearance.styles.ts"],"sourcesContent":["/* Shared checkbox appearance — the visual skin behind `.l-checkbox`.\n\n Colocated with its `checkbox-appearance.styles.ts` wrapper so Shadow-DOM\n elements that render their own native checkbox (e.g. `<l-tree-item>` in\n `selection=\"multiple\"`) can pull in the exact same look via `static styles`.\n The global light-DOM `checkbox.css` primitive `@import`s this file too, so\n both surfaces stay in sync. The global `.l-checkbox` class cannot pierce a\n shadow boundary, but the `--l-form-control-*` tokens this rule relies on DO\n inherit across shadow roots.\n\n Shadow consumers must emit the class via `cls('checkbox')`, never a static\n `class=\"l-checkbox\"` literal. This file ships to dist as a real CSS file and\n is imported `?inline`, so the CONSUMER's Vite runs postcss-plugin-prefix over\n it and rewrites this selector to `.<cssPrefix>-checkbox`. The vite-plugin's\n `transform` hook only rewrites `_cssPrefix` in registry.js — it never touches\n template literals in element JS — so a hardcoded class attribute would stop\n matching the rewritten selector and the checkbox would render unstyled.\n\n The checkmark / indeterminate dash are drawn with a `background-image` SVG on\n the input itself — `::before`/`::after` do not paint on replaced elements\n like `<input>`. `background-image` can't read the host's `currentColor`, so\n the glyph color is baked white. This stays legible because the accent\n (`--l-form-control-activated-color`) is a stable color that does not invert\n between light and dark. Override `--checkmark` to swap the icon. */\n\n@layer components {\n .l-checkbox,\n :where(l-form-field:not([unstyled])) > input[type='checkbox']:not([role='switch']) {\n /* Public knobs */\n --size: var(--l-form-control-toggle-size);\n --accent: var(--l-form-control-activated-color);\n --checkmark: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"white\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"/></svg>');\n --_dash: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"white\" stroke-width=\"2.5\" stroke-linecap=\"round\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>');\n\n box-sizing: border-box;\n flex: 0 0 auto;\n inline-size: var(--size);\n block-size: var(--size);\n margin: 0;\n padding: 0;\n appearance: none;\n border: var(--l-form-control-border-width) solid var(--l-form-control-border-color);\n border-radius: calc(var(--size) * 0.2);\n background-color: var(--l-form-control-background-color);\n background-repeat: no-repeat;\n background-position: center;\n background-size: 75%;\n vertical-align: middle;\n cursor: pointer;\n transition-property: background-color, border-color;\n transition-duration: 150ms;\n\n &:checked,\n &:indeterminate {\n border-color: var(--accent);\n background-color: var(--accent);\n }\n\n &:checked {\n background-image: var(--checkmark);\n }\n\n &:indeterminate {\n background-image: var(--_dash);\n }\n\n @media (hover: hover) {\n &:hover:not(:disabled) {\n border-color: var(--l-form-control-border-color-hover);\n }\n }\n\n &:focus-visible {\n outline: 2px solid var(--l-focus-ring);\n outline-offset: 2px;\n }\n\n /* High contrast: the checked fill is forced to Canvas, hiding the accent and\n leaving the baked-white glyph invisible — pin the checked box to a system\n color so the checkmark/dash stays legible. */\n @media (forced-colors: active) {\n &:checked,\n &:indeterminate {\n border-color: Highlight;\n background-color: Highlight;\n }\n\n &:disabled {\n border-color: GrayText;\n }\n\n &:disabled:is(:checked, :indeterminate) {\n background-color: GrayText;\n }\n }\n\n /* Invalid: only after interaction (`:user-invalid`), or forced via\n `aria-invalid` (set by `l-form-field` / server-side validation).\n Overriding `--accent` makes a checked invalid box fill with the error\n color too (not just the border). */\n &:user-invalid,\n &[aria-invalid='true'] {\n --accent: var(--l-form-control-border-color-invalid);\n border-color: var(--l-form-control-border-color-invalid);\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n /* Unchecked: the same three tokens as `input`/`select`/`textarea`, so a\n checkbox and an input in the same disabled form grey out identically.\n There is no mark here — only a box — so nothing can be washed out. */\n &:disabled:not(:checked, :indeterminate) {\n border-color: var(--l-form-control-disabled-border);\n background-color: var(--l-form-control-disabled-background);\n }\n\n /* Checked: faded rather than greyed. A solid neutral fill keeps the glyph\n crisp but reads as a styled, still-live control; the fade reads as\n \"inactive\" at a glance, which is the message that matters more here.\n The cost is measured and accepted: the checkmark drops to 1.85:1 against\n its own box, and the residual accent tint (1.81:1 against the page) is\n what carries \"this one is checked\". WCAG 1.4.11 exempts inactive\n components, so this is a deliberate trade, not a shortfall.\n\n It assumes the accent is dark enough for the baked-white glyph — the same\n assumption `--l-form-control-activated-color` already documents, and which\n the enabled state depends on just as much (a pale accent scores 1.31:1\n there, before anything is disabled). */\n &:disabled:is(:checked, :indeterminate) {\n opacity: 0.4;\n }\n\n /* Forced colors replaces author colors with the user's palette, so a fade\n would only dim a system color — the box is already GrayText up in the\n forced-colors block above. Placed here, after the fade, because it needs\n to win at equal specificity. */\n @media (forced-colors: active) {\n &:disabled:is(:checked, :indeterminate) {\n opacity: 1;\n }\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .l-checkbox,\n :where(l-form-field:not([unstyled])) > input[type='checkbox']:not([role='switch']) {\n transition-duration: 0ms;\n }\n }\n}\n","import { unsafeCSS } from 'lit';\nimport raw from './checkbox-appearance.css?inline';\n\n/**\n * Shared `.l-checkbox` appearance for Shadow-DOM elements that render their own\n * native checkbox (e.g. `<l-tree-item>` in `selection=\"multiple\"`).\n * Wrapper module: `unsafeCSS()` is called once here so all importers share the\n * same `CSSResult` instance (one constructed `CSSStyleSheet`).\n */\nexport default unsafeCSS(raw);\n"],"mappings":"wCCSA,IAAA,EAAe,EAAU,qvHAAG"}