@mono-lit/helper 0.0.3 → 0.0.5

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 (135) hide show
  1. package/dist/control-tooltip-7vegYmq3.js +678 -0
  2. package/dist/{tooltip-FCMRUSLi.js → control-tooltip-C3rA_nSH.js} +12 -119
  3. package/dist/{data-source-controller-Cf_sMxEh.js → data-source-controller-C6C4ej_M.js} +1 -1
  4. package/dist/{data-source-options-Bk-UoaZV.js → data-source-options-Cz9fVLK8.js} +3 -2
  5. package/dist/{data-source-read-Cuqw3LcP.js → data-source-read-i6CYSUEl.js} +2 -1
  6. package/dist/{excel-DtRpxmxs.js → excel-BPdDt06G.js} +1 -1
  7. package/dist/{export-B91P6J1y.js → export-DgomqI_3.js} +2 -2
  8. package/dist/export.js +2 -2
  9. package/dist/{field-icons-FmyBWa0g.js → field-icons-t8rXRCKs.js} +50 -1
  10. package/dist/field-tooltip-FyMi9vNM.js +266 -0
  11. package/dist/field-tooltip.css_raw-DEctHXKm.js +270 -0
  12. package/dist/field-validation-CHHQi1zl.js +170 -0
  13. package/dist/field-validation.css_raw-B3Iu33rS.js +178 -0
  14. package/dist/index.js +4 -3
  15. package/dist/{index.node-dvrNviMx.js → index.node-DzCuvHLg.js} +1 -1
  16. package/dist/index.node.js +4 -3
  17. package/dist/input-format-GrRCJBqV.js +251 -0
  18. package/dist/input.css_raw-CQu2fAsU.js +5 -0
  19. package/dist/{mono-data-grid-BHlo1IgR.js → mono-data-grid-KDpu4d4_.js} +5 -4
  20. package/dist/{mono-form-controller-IYn0MuUQ.js → mono-form-controller-BkMR8g14.js} +18 -3
  21. package/dist/{reactive-DFCdZbH9.js → normalize-error-BmLbgANw.js} +1 -48
  22. package/dist/nuxt.js +36 -8
  23. package/dist/{popup-portal-HWhkd7oy.js → popup-portal-C8ttHDRX.js} +17 -1
  24. package/dist/{popup-stack-De05Y-mJ.js → popup-stack-C64WCuXq.js} +21 -1
  25. package/dist/src/components/accordion/accordion-core.d.ts +4 -1
  26. package/dist/src/components/accordion/mono-accordion.shadow.d.ts +4 -1
  27. package/dist/src/components/date/date-core.d.ts +3 -0
  28. package/dist/src/components/date/date-types.d.ts +36 -1
  29. package/dist/src/components/drawer/drawer-core.d.ts +1 -0
  30. package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +3 -0
  31. package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +31 -0
  32. package/dist/src/components/form/form-types.d.ts +23 -5
  33. package/dist/src/components/input/index.d.ts +2 -2
  34. package/dist/src/components/input/index.shadow.d.ts +2 -2
  35. package/dist/src/components/input/input-core.d.ts +23 -3
  36. package/dist/src/components/input/input-types.d.ts +84 -9
  37. package/dist/src/components/input/mono-input.d.ts +3 -2
  38. package/dist/src/components/input/mono-input.shadow.d.ts +3 -2
  39. package/dist/src/components/modal/modal-core.d.ts +1 -0
  40. package/dist/src/components/otp/index.d.ts +5 -0
  41. package/dist/src/components/otp/index.shadow.d.ts +6 -0
  42. package/dist/src/components/otp/mono-otp.d.ts +32 -0
  43. package/dist/src/components/otp/mono-otp.shadow.d.ts +30 -0
  44. package/dist/src/components/otp/otp-core.d.ts +91 -0
  45. package/dist/src/components/otp/otp-types.d.ts +161 -0
  46. package/dist/src/components/otp/otp-utils.d.ts +41 -0
  47. package/dist/src/components/select/select-core.d.ts +3 -0
  48. package/dist/src/components/select/select-types.d.ts +31 -0
  49. package/dist/src/components/slider/index.d.ts +5 -0
  50. package/dist/src/components/slider/index.shadow.d.ts +6 -0
  51. package/dist/src/components/slider/mono-slider.d.ts +33 -0
  52. package/dist/src/components/slider/mono-slider.shadow.d.ts +29 -0
  53. package/dist/src/components/slider/slider-core.d.ts +77 -0
  54. package/dist/src/components/slider/slider-math.d.ts +102 -0
  55. package/dist/src/components/slider/slider-types.d.ts +188 -0
  56. package/dist/src/components/tag-input/tag-input-core.d.ts +3 -0
  57. package/dist/src/components/tag-input/tag-input-types.d.ts +31 -0
  58. package/dist/src/components/textarea/textarea-core.d.ts +3 -0
  59. package/dist/src/components/textarea/textarea-types.d.ts +31 -0
  60. package/dist/src/composables/field-bubble.d.ts +34 -0
  61. package/dist/src/composables/field-icons.d.ts +10 -0
  62. package/dist/src/composables/field-tooltip.d.ts +52 -0
  63. package/dist/src/composables/field-validation.d.ts +58 -0
  64. package/dist/src/composables/popup-portal.d.ts +12 -0
  65. package/dist/src/composables/popup-stack.d.ts +21 -0
  66. package/dist/src/entries/index.d.ts +1 -1
  67. package/dist/src/entries/index.node.d.ts +1 -1
  68. package/dist/src/nuxt/index.d.ts +2 -2
  69. package/dist/src/nuxt/ssr-lit/index.d.ts +4 -0
  70. package/dist/ssr-lit/runtime/components/LitWrapper.vue +11 -0
  71. package/dist/ssr-lit/runtime/components/LitWrapperClient.vue +11 -0
  72. package/dist/ssr-lit/runtime/components/LitWrapperServer.vue +38 -0
  73. package/dist/ssr-lit/runtime/plugins/antiFouc.server.js +25 -0
  74. package/dist/ssr-lit/runtime/plugins/hydrateSupport.client.js +4 -0
  75. package/dist/ssr-lit/runtime/plugins/polyfill.client.js +9 -0
  76. package/dist/ssr-lit/runtime/utils/customElements.js +11 -0
  77. package/dist/ssr-lit/runtime/utils/litElementRenderer.js +28 -0
  78. package/dist/{styles-D-ergrfR.js → styles-BODNpZV1.js} +1 -1
  79. package/dist/tooltip-Drekihf5.js +102 -0
  80. package/dist/tooltip-loader-3U9FTOXj.js +20 -0
  81. package/dist/tooltip-loader-Dcp9AUZn.js +23 -0
  82. package/dist/tooltip.js +3 -1
  83. package/dist/ui/accordion.js +16 -3
  84. package/dist/ui/alert.js +2 -2
  85. package/dist/ui/breadcrumb.js +1 -1
  86. package/dist/ui/button-dropdown.js +1 -1
  87. package/dist/ui/chart.js +1 -1
  88. package/dist/ui/date.js +66 -5
  89. package/dist/ui/drawer.js +11 -2
  90. package/dist/ui/dropdown-table.js +60 -5
  91. package/dist/ui/dropdown.js +3 -2
  92. package/dist/ui/file-upload.js +1 -1
  93. package/dist/ui/form.js +1 -1
  94. package/dist/ui/index.css +8857 -3974
  95. package/dist/ui/input.js +362 -260
  96. package/dist/ui/menu.js +1 -1
  97. package/dist/ui/modal.js +11 -2
  98. package/dist/ui/otp.js +835 -0
  99. package/dist/ui/select.js +67 -3
  100. package/dist/ui/shadow/accordion.js +31 -4
  101. package/dist/ui/shadow/alert.js +1 -1
  102. package/dist/ui/shadow/button-dropdown.js +1 -1
  103. package/dist/ui/shadow/chart.js +4 -4
  104. package/dist/ui/shadow/date.js +67 -6
  105. package/dist/ui/shadow/drawer.js +11 -2
  106. package/dist/ui/shadow/dropdown-table.js +62 -7
  107. package/dist/ui/shadow/dropdown.js +3 -2
  108. package/dist/ui/shadow/input.js +367 -261
  109. package/dist/ui/shadow/modal.js +11 -2
  110. package/dist/ui/shadow/otp.js +842 -0
  111. package/dist/ui/shadow/select.js +71 -6
  112. package/dist/ui/shadow/sidebar.js +2 -2
  113. package/dist/ui/shadow/slider.js +1082 -0
  114. package/dist/ui/shadow/table.js +6 -6
  115. package/dist/ui/shadow/tag-input.js +72 -7
  116. package/dist/ui/shadow/textarea.js +63 -2
  117. package/dist/ui/sidebar.js +2 -2
  118. package/dist/ui/slider.js +1079 -0
  119. package/dist/ui/table.js +2 -2
  120. package/dist/ui/tag-input.js +67 -3
  121. package/dist/ui/textarea.js +62 -1
  122. package/dist/ui/theme/luma.css +505 -466
  123. package/dist/ui/theme/lyra.css +505 -466
  124. package/dist/ui/theme/maia.css +501 -466
  125. package/dist/ui/theme/mira.css +505 -466
  126. package/dist/ui/theme/nova.css +503 -466
  127. package/dist/ui/theme/one.css +742 -699
  128. package/dist/ui/theme/rhea.css +506 -466
  129. package/dist/ui/theme/sera.css +507 -466
  130. package/dist/ui/theme/vega.css +495 -466
  131. package/dist/{vite-DcyRlTTf.js → vite-CivRCJaf.js} +2 -0
  132. package/dist/vite.js +1 -1
  133. package/dist/vue.d.ts +10 -0
  134. package/package.json +30 -15
  135. package/dist/input.css_raw-CGESifay.js +0 -5
@@ -0,0 +1,38 @@
1
+ <script>
2
+ import { defineComponent, ssrUtils, mergeProps } from "vue";
3
+ import { ssrRenderVNode, ssrRenderAttrs } from "@vue/server-renderer";
4
+ import { LitElementRenderer } from "@lit-labs/ssr/lib/lit-element-renderer.js";
5
+ import { createLitElementRenderer } from "../utils/litElementRenderer";
6
+ export default defineComponent({
7
+ ssrRender(ctx, push, litWrapperInstance, litWrapperAttrs) {
8
+ const [litElementVNode] = litWrapperInstance.slots.default();
9
+ const litElementTagName = String(litElementVNode.type);
10
+ const litElementVNodeProps = litElementVNode.props || {};
11
+ const renderer = createLitElementRenderer(litElementTagName, litElementVNodeProps);
12
+ if (!renderer) {
13
+ return null;
14
+ }
15
+ try {
16
+ renderer.connectedCallback();
17
+ const attributes = ssrRenderAttrs(mergeProps(litElementVNodeProps, litWrapperAttrs));
18
+ push(
19
+ `<${litElementTagName}${attributes} defer-hydration="true"><template shadowrootmode="open" shadowroot="open">`
20
+ );
21
+ for (const shadowContent of renderer.renderShadow({
22
+ elementRenderers: [LitElementRenderer],
23
+ customElementInstanceStack: [renderer],
24
+ customElementHostStack: [renderer]
25
+ })) {
26
+ push(shadowContent);
27
+ }
28
+ push(`</template>`);
29
+ const litElementChildren = litElementVNode.children ? Array.isArray(litElementVNode.children) ? litElementVNode.children : [litElementVNode.children] : [];
30
+ litElementChildren.forEach((child) => ssrRenderVNode(push, ssrUtils.normalizeVNode(child), litWrapperInstance));
31
+ push(`</${litElementTagName}>`);
32
+ } catch (e) {
33
+ console.error(e);
34
+ return null;
35
+ }
36
+ }
37
+ });
38
+ </script>
@@ -0,0 +1,25 @@
1
+ import { defineNuxtPlugin, useHead } from "#imports";
2
+ export default defineNuxtPlugin(() => {
3
+ useHead({
4
+ style: [
5
+ {
6
+ innerHTML: "body[dsd-pending] { display: none; }"
7
+ }
8
+ ],
9
+ script: [
10
+ {
11
+ children: `
12
+ {
13
+ const hasNativeDsd =
14
+ Object.hasOwnProperty.call(HTMLTemplateElement.prototype, "shadowRootMode") ||
15
+ Object.hasOwnProperty.call(HTMLTemplateElement.prototype, "shadowRoot");
16
+
17
+ if (!hasNativeDsd) {
18
+ document.body.setAttribute('dsd-pending', 'true');
19
+ }
20
+ }`,
21
+ tagPosition: "bodyOpen"
22
+ }
23
+ ]
24
+ });
25
+ });
@@ -0,0 +1,4 @@
1
+ import "@lit-labs/ssr-client/lit-element-hydrate-support.js";
2
+ import { defineNuxtPlugin } from "#imports";
3
+ export default defineNuxtPlugin(() => {
4
+ });
@@ -0,0 +1,9 @@
1
+ import { defineNuxtPlugin } from "#imports";
2
+ export default defineNuxtPlugin(async () => {
3
+ const hasNativeDsd = Object.hasOwnProperty.call(HTMLTemplateElement.prototype, "shadowRootMode") || Object.hasOwnProperty.call(HTMLTemplateElement.prototype, "shadowRoot");
4
+ if (!hasNativeDsd) {
5
+ const { hydrateShadowRoots } = await import("@webcomponents/template-shadowroot/template-shadowroot.js");
6
+ hydrateShadowRoots(document.body);
7
+ document.body.removeAttribute("dsd-pending");
8
+ }
9
+ });
@@ -0,0 +1,11 @@
1
+ export function isCustomElementTag(name) {
2
+ return typeof name === "string" && /-/.test(name);
3
+ }
4
+ export function getCustomElementConstructor(name) {
5
+ if (typeof customElements !== "undefined" && isCustomElementTag(name)) {
6
+ return customElements.get(name) || null;
7
+ } else if (typeof name === "function") {
8
+ return name;
9
+ }
10
+ return null;
11
+ }
@@ -0,0 +1,28 @@
1
+ import { LitElementRenderer } from "@lit-labs/ssr/lib/lit-element-renderer.js";
2
+ import { getCustomElementConstructor, isCustomElementTag } from "./customElements.js";
3
+ export function createLitElementRenderer(tagName, props) {
4
+ if (!isCustomElementTag(tagName)) {
5
+ return null;
6
+ }
7
+ const renderer = new LitElementRenderer(tagName);
8
+ attachPropsToRenderer(renderer, props);
9
+ return renderer;
10
+ }
11
+ function attachPropsToRenderer(renderer, props) {
12
+ const customElementConstructor = getCustomElementConstructor(renderer.tagName);
13
+ if (props) {
14
+ for (const [key, value] of Object.entries(props)) {
15
+ if (customElementConstructor !== null && typeof customElementConstructor !== "string" && key in customElementConstructor.prototype) {
16
+ const isBooleanProp = customElementConstructor.elementProperties.get(key)?.type === Boolean;
17
+ if (isBooleanProp && value === "") {
18
+ renderer.setProperty(key, true);
19
+ } else {
20
+ renderer.setProperty(key, value);
21
+ }
22
+ } else {
23
+ renderer.setAttribute(key, value);
24
+ }
25
+ }
26
+ }
27
+ return renderer;
28
+ }
@@ -20353,4 +20353,4 @@ function toExcelStyle(style) {
20353
20353
  }
20354
20354
 
20355
20355
  //#endregion
20356
- export { flattenInline as a, escapeCellText as c, __toESM as d, toExcelStyle as i, stripDirectives as l, combineStyles as n, parseMarkdown as o, mergeStyles as r, encodeDirective as s, DEFAULT_STYLES as t, __commonJSMin as u };
20356
+ export { flattenInline as a, escapeCellText as c, __exportAll as d, __toESM as f, toExcelStyle as i, stripDirectives as l, combineStyles as n, parseMarkdown as o, mergeStyles as r, encodeDirective as s, DEFAULT_STYLES as t, __commonJSMin as u };
@@ -0,0 +1,102 @@
1
+ import { a as hasLiveDocument, i as destroyAllTooltipControllers, r as createTooltipController, u as setMonoTooltipGlobal } from "./control-tooltip-C3rA_nSH.js";
2
+ import "./tooltip-loader-Dcp9AUZn.js";
3
+
4
+ //#region src/components/tooltip/tooltip-declarative.ts
5
+ /** The two text attributes — `message` is an alias of `content`. */
6
+ const TOOLTIP_ATTRIBUTE_SELECTOR = "[mono-tooltip-content], [mono-tooltip-message]";
7
+ let declarative = null;
8
+ /**
9
+ * Per-element options, from `mono-tooltip-<option>` attributes:
10
+ *
11
+ * | attribute | option |
12
+ * | --- | --- |
13
+ * | `mono-tooltip-content` / `-message` | `content` (text) |
14
+ * | `mono-tooltip-placement` / `-variant` / `-color` / `-size` | same name |
15
+ * | `mono-tooltip-trigger` | `"hover focus"`, `"click"`, … |
16
+ * | `mono-tooltip-delay` | `"300"` or `"300 100"` |
17
+ * | `mono-tooltip-offset` / `-padding` | numbers |
18
+ * | `mono-tooltip-max-width` / `-class` | strings |
19
+ * | `mono-tooltip-arrow` / `-flip` / `-shift` / `-interactive` / `-html` / `-disabled` / `-hide-on-click` | booleans — present = on, `"false"` = off |
20
+ */
21
+ function readTooltipAttributes(el) {
22
+ const get = (name) => el.getAttribute(`mono-tooltip-${name}`);
23
+ const str = (name) => get(name)?.trim() || void 0;
24
+ const bool = (name) => {
25
+ const v = get(name);
26
+ return v === null ? void 0 : v.trim() !== "false";
27
+ };
28
+ const num = (name) => {
29
+ const v = str(name);
30
+ const n = v === void 0 ? NaN : Number(v);
31
+ return Number.isFinite(n) ? n : void 0;
32
+ };
33
+ const list = (name) => str(name)?.split(/[\s,]+/).filter(Boolean);
34
+ const content = get("content") ?? get("message") ?? void 0;
35
+ const delay = list("delay")?.map(Number).filter(Number.isFinite);
36
+ return {
37
+ content,
38
+ placement: str("placement"),
39
+ variant: str("variant"),
40
+ color: str("color"),
41
+ size: str("size"),
42
+ trigger: list("trigger"),
43
+ delay: delay?.length ? delay.length > 1 ? [delay[0], delay[1]] : delay[0] : void 0,
44
+ offset: num("offset"),
45
+ padding: num("padding"),
46
+ maxWidth: str("max-width"),
47
+ class: str("class"),
48
+ arrow: bool("arrow"),
49
+ flip: bool("flip"),
50
+ shift: bool("shift"),
51
+ interactive: bool("interactive"),
52
+ allowHTML: bool("html"),
53
+ disabled: bool("disabled"),
54
+ hideOnClick: bool("hide-on-click")
55
+ };
56
+ }
57
+ /**
58
+ * Set the app-wide tooltip options AND switch on the `mono-tooltip-*` attributes.
59
+ * Call once — usually in `main.ts`:
60
+ *
61
+ * ```ts
62
+ * app.use(createMonoTooltip({ delay: [300, 0] }))
63
+ * // or simply
64
+ * createMonoTooltip()
65
+ * ```
66
+ *
67
+ * The options WIN over the ones passed to `controlMonoTooltip`; an element's own
68
+ * `mono-tooltip-*` attributes win over them. A later call replaces the previous
69
+ * global options wholesale. `attributes: false` keeps the options but turns the
70
+ * declarative attributes off.
71
+ */
72
+ function createMonoTooltip(options = {}) {
73
+ setMonoTooltipGlobal(options);
74
+ const wantAttributes = options.attributes !== false;
75
+ if (wantAttributes && !declarative && hasLiveDocument()) declarative = createTooltipController(TOOLTIP_ATTRIBUTE_SELECTOR, {}, readTooltipAttributes);
76
+ else if (!wantAttributes && declarative) {
77
+ declarative.destroy();
78
+ declarative = null;
79
+ }
80
+ return {
81
+ options: { ...options },
82
+ install() {}
83
+ };
84
+ }
85
+ /**
86
+ * Close and forget every live tooltip controller — the attribute one included
87
+ * (a later `createMonoTooltip()` turns the attributes back on). For tests and a
88
+ * full app teardown; the global options are kept.
89
+ */
90
+ function destroyAllMonoTooltips() {
91
+ destroyAllTooltipControllers();
92
+ declarative = null;
93
+ }
94
+ /** Drop the global options and turn the attributes off (tests, runtime reconfiguration). */
95
+ function resetMonoTooltip() {
96
+ setMonoTooltipGlobal(null);
97
+ declarative?.destroy();
98
+ declarative = null;
99
+ }
100
+
101
+ //#endregion
102
+ export { resetMonoTooltip as a, readTooltipAttributes as i, createMonoTooltip as n, destroyAllMonoTooltips as r, TOOLTIP_ATTRIBUTE_SELECTOR as t };
@@ -0,0 +1,20 @@
1
+ //#region src/components/tooltip/tooltip-loader.ts
2
+ /**
3
+ * Cached loader for the OPTIONAL `@floating-ui/dom` peer (which itself depends on
4
+ * `@floating-ui/core` — both are the consumer's to install).
5
+ *
6
+ * Loaded on the FIRST show, never at import: registering a tooltip in
7
+ * `<script setup>` costs nothing until somebody actually hovers. Externalized by
8
+ * `NEVER_BUNDLE` in `tsdown.config.ts`, so the consumer's bundler resolves and splits it.
9
+ */
10
+ let _floatingPromise = null;
11
+ function loadFloatingUi() {
12
+ _floatingPromise ??= import("@floating-ui/dom").catch((err) => {
13
+ _floatingPromise = null;
14
+ throw new Error("[mono-tooltip] needs the optional peer dependencies \"@floating-ui/dom\" and \"@floating-ui/core\". Install them in your app: pnpm add @floating-ui/dom @floating-ui/core" + (err?.message ? ` (original error: ${err.message})` : ""));
15
+ });
16
+ return _floatingPromise;
17
+ }
18
+
19
+ //#endregion
20
+ export { loadFloatingUi };
@@ -0,0 +1,23 @@
1
+ import { d as __exportAll } from "./styles-BODNpZV1.js";
2
+
3
+ //#region src/components/tooltip/tooltip-loader.ts
4
+ var tooltip_loader_exports = /* @__PURE__ */ __exportAll({ loadFloatingUi: () => loadFloatingUi });
5
+ /**
6
+ * Cached loader for the OPTIONAL `@floating-ui/dom` peer (which itself depends on
7
+ * `@floating-ui/core` — both are the consumer's to install).
8
+ *
9
+ * Loaded on the FIRST show, never at import: registering a tooltip in
10
+ * `<script setup>` costs nothing until somebody actually hovers. Externalized by
11
+ * `NEVER_BUNDLE` in `tsdown.config.ts`, so the consumer's bundler resolves and splits it.
12
+ */
13
+ let _floatingPromise = null;
14
+ function loadFloatingUi() {
15
+ _floatingPromise ??= import("@floating-ui/dom").catch((err) => {
16
+ _floatingPromise = null;
17
+ throw new Error("[mono-tooltip] needs the optional peer dependencies \"@floating-ui/dom\" and \"@floating-ui/core\". Install them in your app: pnpm add @floating-ui/dom @floating-ui/core" + (err?.message ? ` (original error: ${err.message})` : ""));
18
+ });
19
+ return _floatingPromise;
20
+ }
21
+
22
+ //#endregion
23
+ export { tooltip_loader_exports as n, loadFloatingUi as t };
package/dist/tooltip.js CHANGED
@@ -1,3 +1,5 @@
1
- import { a as resetMonoTooltip, c as loadFloatingUi, d as resolveTooltipOptions, i as readTooltipAttributes, l as DEFAULT_TOOLTIP_OPTIONS, n as createMonoTooltip, o as controlMonoTooltip, r as destroyAllMonoTooltips, s as monoTooltip, t as TOOLTIP_ATTRIBUTE_SELECTOR, u as getMonoTooltipGlobal } from "./tooltip-FCMRUSLi.js";
1
+ import { c as getMonoTooltipGlobal, l as resolveTooltipOptions, o as monoTooltip, s as DEFAULT_TOOLTIP_OPTIONS, t as controlMonoTooltip } from "./control-tooltip-C3rA_nSH.js";
2
+ import { t as loadFloatingUi } from "./tooltip-loader-Dcp9AUZn.js";
3
+ import { a as resetMonoTooltip, i as readTooltipAttributes, n as createMonoTooltip, r as destroyAllMonoTooltips, t as TOOLTIP_ATTRIBUTE_SELECTOR } from "./tooltip-Drekihf5.js";
2
4
 
3
5
  export { DEFAULT_TOOLTIP_OPTIONS, TOOLTIP_ATTRIBUTE_SELECTOR, controlMonoTooltip, createMonoTooltip, destroyAllMonoTooltips, getMonoTooltipGlobal, loadFloatingUi, monoTooltip, readTooltipAttributes, resetMonoTooltip, resolveTooltipOptions };
@@ -2,6 +2,7 @@ import { l as monoHostChildNodes } from "../mono-ui-BwUc0L6B.js";
2
2
  import { t as customElement } from "../mono-element-C7vCschg.js";
3
3
  import { a as defineHybridPropAliases, i as defineHybridPropAlias, r as booleanStringConverter, t as __decorate } from "../decorate-DbYFpi8R.js";
4
4
  import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
5
+ import { t as isIconifyClass } from "../icon-ClxnYhBG.js";
5
6
  import { a as parkDetachedNodes, i as guardHostTextContent, s as placeSlotNode } from "../light-slots-DdDdZ6zs.js";
6
7
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
7
8
  import { ref } from "lit/directives/ref.js";
@@ -45,6 +46,7 @@ const MonoAccordionCore = (superClass) => {
45
46
  defineHybridPropAlias(this, "description", "subtitle");
46
47
  this.title = "";
47
48
  this.subtitle = "";
49
+ this.icon = "";
48
50
  /**
49
51
  * Vue support:
50
52
  *
@@ -195,7 +197,17 @@ const MonoAccordionCore = (superClass) => {
195
197
  return Boolean(this.subtitle) || this._hasSubtitleSlotState;
196
198
  }
197
199
  get _hasIconContent() {
198
- return this._hasIconSlotState;
200
+ return this._hasIconSlotState || Boolean(this.icon);
201
+ }
202
+ /**
203
+ * The `icon` prop: an iconify class becomes an empty masked span, anything
204
+ * else is text. The shadow build overrides this with inline SVG (a page
205
+ * utility class cannot reach inside a shadow root).
206
+ */
207
+ _renderIconGlyph() {
208
+ if (!this.icon) return nothing;
209
+ if (isIconifyClass(this.icon)) return html`<span class=${`mono-accordion-iconify ${this.icon}`}></span>`;
210
+ return html`${this.icon}`;
199
211
  }
200
212
  /**
201
213
  * The open state changed. `mno-click` is the historical name; the plain
@@ -243,6 +255,7 @@ const MonoAccordionCore = (superClass) => {
243
255
  __decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "color", void 0);
244
256
  __decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "title", void 0);
245
257
  __decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "subtitle", void 0);
258
+ __decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "icon", void 0);
246
259
  __decorate([property({
247
260
  attribute: "model-value",
248
261
  reflect: true,
@@ -266,7 +279,7 @@ const MonoAccordionCore = (superClass) => {
266
279
 
267
280
  //#endregion
268
281
  //#region \0raw:C:\Users\VCT-DEV\Desktop\libs\packages\helper\src\components\accordion\accordion.css?raw.js
269
- var accordion_css_raw_default = "/* @unocss-include */\r\n\r\n/* =========================================================================\r\n mono-accordion — a port of Basecoat's `.accordion`\r\n (basecoat-css@1.0.2, vega style).\r\n\r\n Styled by ATTRIBUTE, like Basecoat — and the attributes mirror the element's\r\n props one for one, so hand-written markup reads like the Lit / Vue tag:\r\n\r\n <mono-accordion size=\"lg\" color=\"success\" model-value>\r\n <div mono-accordion mono-size=\"lg\" mono-color=\"success\" mono-open>\r\n <button mono-head type=\"button\" aria-expanded=\"true\">\r\n <span mono-glyph>…</span>\r\n <span mono-heading>\r\n <span mono-title>Question</span>\r\n <span mono-subtitle>Sub-text</span>\r\n </span>\r\n <span mono-actions>…</span>\r\n <span mono-arrow><svg …></svg></span>\r\n </button>\r\n <div mono-body role=\"region\"><div>…</div></div>\r\n </div>\r\n\r\n An absent attribute is the prop's default (`:not([mono-size])` = md,\r\n `:not([mono-color])` = primary). The element writes them on its root — the\r\n host in the light build, an inner root `<div>` in the shadow one — plus the\r\n states `mono-open` and `mono-disabled`. The old classes\r\n (`.mono-accordion.md.primary.open`) are still emitted as inert hooks until\r\n 2.0 but no rule here reads them.\r\n\r\n Selector map (ours ≡ upstream):\r\n [mono-accordion-group] ≡ .accordion (flex w-full flex-col; maia /\r\n mira / luma / rhea add the frame, which is\r\n the `-group-*` knobs below)\r\n [mono-accordion] ≡ .accordion > details (not-last:border-b, and\r\n `open:bg-muted/50` on four flavors)\r\n — EXTENSION when standalone: upstream has no\r\n accordion outside a group, so on its own it\r\n keeps this component's frame (border, radius,\r\n shadow-xs). Inside a group the frame moves to\r\n the group and the item flattens to a divider.\r\n [mono-head] ≡ > summary (relative flex w-full items-start\r\n justify-between border border-transparent\r\n cursor-pointer outline-none, rounded-md py-4\r\n text-left text-sm font-medium hover:underline,\r\n focus-visible:ring-3 ring-ring/50 border-ring)\r\n — DEVIATION: a real <button>, so the row is a\r\n button for a11y rather than a <summary> whose\r\n open state the element would have to fight\r\n [mono-glyph] ≡ EXTENSION (the leading icon chip)\r\n [mono-heading] > [mono-title] ≡ the summary's own text\r\n [mono-subtitle] ≡ EXTENSION (a second line under the title;\r\n `[mono-description]` is its old name, and the\r\n element still renders both)\r\n [mono-actions] ≡ EXTENSION (trailing controls in the row)\r\n [mono-arrow] ≡ summary > svg:last-child (text-muted-foreground\r\n ms-auto size-4, rotate-180 while open)\r\n [mono-body] ≡ details > :not(summary) (overflow-hidden,\r\n pt-0 pb-4 text-sm) — plus the animated\r\n collapse, which upstream's <details> gets free\r\n [mono-size]/[mono-color] ≡ EXTENSION (upstream ships one size, no colour)\r\n [mono-disabled] ≡ details[aria-disabled] > summary\r\n (pointer-events-none opacity-50)\r\n\r\n PART NAMES ARE PATH-SCOPED. `[mono-title]`, `[mono-body]`, `[mono-actions]`\r\n and `[mono-icon]` are also card's, dropdown's and button's part names, and an\r\n accordion BODY is a place consumers put cards and buttons. Every rule here is\r\n therefore written as an explicit child path from the root — `:where([mono-accordion]\r\n > [mono-head] > [mono-heading]) > [mono-title]` — so a nested component's parts\r\n are never reached. The `:where()` keeps that path at (0,1,0), the same weight a\r\n one-attribute rule would have, so a `cssClass` utility still wins by source order.\r\n\r\n FLAVORS set `--mono-accordion-{radius,shadow,pad-x-<size>,pad-y-<size>,\r\n title-font-<size>,body-font-<size>,open-bg,group-radius,group-border-width,\r\n arrow-size,ring-width}`; every fallback here is vega's value\r\n (`node scripts/basecoat-styles.mjs --varying \"accordion\"` prints the matrix).\r\n ========================================================================= */\r\n\r\nmono-accordion {\r\n display: block;\r\n}\r\n\r\n/* =========================================\r\n Root — the item\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details — not-last:border-b */\r\n[mono-accordion] {\r\n /* ── the six roles, each a public knob over a Basecoat token ───────────── */\r\n --_mono-accordion-primary: var(--mono-accordion-primary, var(--primary));\r\n --_mono-accordion-secondary: var(--mono-accordion-secondary, var(--secondary-foreground));\r\n --_mono-accordion-success: var(--mono-accordion-success, var(--success));\r\n --_mono-accordion-danger: var(--mono-accordion-danger, var(--destructive));\r\n --_mono-accordion-warning: var(--mono-accordion-warning, var(--warning));\r\n --_mono-accordion-info: var(--mono-accordion-info, var(--info));\r\n --_mono-accordion-teal: var(--mono-accordion-teal, var(--teal));\r\n --_mono-accordion-purple: var(--mono-accordion-purple, var(--purple));\r\n --_mono-accordion-neutral: var(--mono-accordion-neutral, var(--neutral));\r\n --_mono-accordion-dark: var(--mono-accordion-dark, var(--dark));\r\n /* the colour in play — `primary` unless a [mono-color] rule re-points it */\r\n --_mono-accordion-accent: var(--mono-accordion-accent, var(--_mono-accordion-accent-preset, var(--_mono-accordion-primary)));\r\n\r\n /* ── surfaces ──────────────────────────────────────────────────────────── */\r\n --_mono-accordion-bg: var(--mono-accordion-bg, var(--mono-accordion-surface, var(--card)));\r\n --_mono-accordion-text: var(--mono-accordion-text, var(--card-foreground));\r\n --_mono-accordion-border: var(--mono-accordion-border, var(--border));\r\n --_mono-accordion-shadow: var(--mono-accordion-shadow, var(--mono-shadow-xs));\r\n /* `open:bg-muted/50` — vega does NOT tint an open item; maia, mira, luma and\r\n rhea do, and set this knob. `--mono-accordion-head-bg` is the pre-port name,\r\n honoured until 2.0: it tinted the open HEAD, where this tints the open item\r\n (head and body alike), which is what upstream's `open:` variant does. */\r\n /* An OPAQUE fill, not an overlay: it replaces the item's own surface while\r\n open, so a flavor's `bg-muted/50` is written as that mix OVER `--card`.\r\n Defaulting to the item's surface is what makes vega's \"no tint\" a no-op. */\r\n --_mono-accordion-open-bg: var(--mono-accordion-open-bg, var(--mono-accordion-head-bg, var(--_mono-accordion-bg)));\r\n --_mono-accordion-open-border-color: var(--mono-accordion-open-border-color,\r\n color-mix(in oklab, var(--_mono-accordion-accent) 32%, var(--_mono-accordion-border)));\r\n --_mono-accordion-open-shadow: var(--mono-accordion-open-shadow,\r\n 0 3px 14px color-mix(in oklab, var(--_mono-accordion-accent) 9%, transparent));\r\n\r\n /* ── md metrics live on the unqualified root ON PURPOSE ────────────────────\r\n basecoat@1.0.2 styles/vega.css .accordion > details > summary — py-4 text-sm\r\n — DEVIATION: the inline padding is ours. Upstream's summary has none because\r\n its group is edge-to-edge in the page; this item can stand alone inside its\r\n own frame, where text flush against the border reads as a bug. maia / luma /\r\n rhea say `p-4`, which is exactly the value used here. */\r\n --_mono-accordion-pad-x: var(--mono-accordion-pad-x, var(--_mono-accordion-pad-x-preset, var(--mono-accordion-pad-x-md, calc(var(--mono-spacing) * 4))));\r\n --_mono-accordion-pad-y: var(--mono-accordion-pad-y, var(--_mono-accordion-pad-y-preset, var(--mono-accordion-pad-y-md, calc(var(--mono-spacing) * 4))));\r\n --_mono-accordion-radius: var(--mono-accordion-radius, var(--_mono-accordion-radius-preset, var(--mono-accordion-radius-md, var(--mono-radius-md))));\r\n --_mono-accordion-gap: var(--mono-accordion-gap, var(--_mono-accordion-gap-preset, calc(var(--mono-spacing) * 3)));\r\n\r\n /* ── type ──────────────────────────────────────────────────────────────── */\r\n --_mono-accordion-title-font: var(--mono-accordion-title-font, var(--_mono-accordion-title-font-preset, var(--mono-accordion-title-font-md, var(--mono-text-sm))));\r\n --_mono-accordion-title-line-height: var(--mono-accordion-title-line-height, var(--_mono-accordion-title-line-height-preset, var(--mono-text-sm--lh)));\r\n --_mono-accordion-title-weight: var(--mono-accordion-title-weight, var(--mono-font-weight-medium));\r\n /* `hover:underline` — the whole row is the control, so the hover cue is on its\r\n label. A flavor (or a consumer) sets `none` to drop it. */\r\n --_mono-accordion-title-hover-decoration: var(--mono-accordion-title-hover-decoration, underline);\r\n --_mono-accordion-description-font: var(--mono-accordion-description-font, var(--_mono-accordion-description-font-preset, var(--mono-text-xs)));\r\n --_mono-accordion-description-color: var(--mono-accordion-description-color, var(--muted-foreground));\r\n --_mono-accordion-body-font: var(--mono-accordion-body-font, var(--_mono-accordion-body-font-preset, var(--mono-accordion-body-font-md, var(--mono-text-sm))));\r\n --_mono-accordion-body-line-height: var(--mono-accordion-body-line-height, var(--_mono-accordion-body-line-height-preset, var(--mono-text-sm--lh)));\r\n --_mono-accordion-body-color: var(--mono-accordion-body-color, inherit);\r\n\r\n /* ── the chevron — `text-muted-foreground size-4` ──────────────────────── */\r\n --_mono-accordion-arrow-size: var(--mono-accordion-arrow-size, var(--_mono-accordion-arrow-size-preset, calc(var(--mono-spacing) * 4)));\r\n --_mono-accordion-arrow-color: var(--mono-accordion-arrow-color, var(--muted-foreground));\r\n /* EXTENSION: the role reads the open state at a glance. Set it to\r\n `--muted-foreground` for upstream's single-colour chevron. */\r\n --_mono-accordion-arrow-open-color: var(--mono-accordion-arrow-open-color, var(--_mono-accordion-accent));\r\n\r\n /* ── the leading chip (EXTENSION) ──────────────────────────────────────── */\r\n --_mono-accordion-glyph-size: var(--mono-accordion-glyph-size, var(--_mono-accordion-glyph-size-preset, calc(var(--mono-spacing) * 7)));\r\n --_mono-accordion-glyph-radius: var(--mono-accordion-glyph-radius, var(--_mono-accordion-glyph-radius-preset, var(--mono-radius-sm)));\r\n --_mono-accordion-glyph-bg: var(--mono-accordion-glyph-bg, color-mix(in oklab, var(--_mono-accordion-accent) 14%, transparent));\r\n --_mono-accordion-glyph-color: var(--mono-accordion-glyph-color, var(--_mono-accordion-accent));\r\n\r\n /* ── focus — `focus-visible:ring-3 ring-ring/50 border-ring` ───────────── */\r\n --_mono-accordion-ring-color: var(--mono-accordion-ring-color, var(--_mono-accordion-accent));\r\n\r\n /* The head's hover fill. Upstream has none — it underlines the label instead —\r\n so the tint is 0% on vega. A flavor sets the ALPHA (`-head-hover-tint`) and\r\n the wash is built HERE: a flavor writing the colour itself would have to\r\n reference `--_mono-accordion-accent`, which is declared on this element, and\r\n a `:root` declaration that references it is invalid at computed-value time. */\r\n --_mono-accordion-head-hover-bg: var(--mono-accordion-head-hover-bg,\r\n color-mix(in oklab, var(--_mono-accordion-accent) var(--mono-accordion-head-hover-tint, 0%), transparent));\r\n --_mono-accordion-ring-width: var(--mono-accordion-ring-width, var(--mono-ring-width));\r\n /* A slot, so a state can neutralise the resting shadow without `box-shadow: none`. */\r\n --_mono-accordion-ring: 0 0 #0000;\r\n\r\n /* Open/close animation duration, shared by the body collapse and the chevron so\r\n `--mono-accordion-duration: 0s` means a fully instant toggle.\r\n\r\n This is THE lever for a slow open/close. `grid-template-rows: 0fr → 1fr` is the\r\n only animated LAYOUT property in the library, and it re-lays-out the whole slotted\r\n subtree on every frame of the transition, so its cost scales with what is inside\r\n the body — and, because the panel's own height changes, with whatever follows it\r\n in the document too. Measured with ~320-node bodies (Chromium, median of 3), one\r\n open+close cycle: 24.8ms animated vs 3.6ms at `0s` — the animation is ~85% of the\r\n toggle's cost. Set this to `0s` on accordions whose bodies (or whose pages) are\r\n heavy.\r\n\r\n THREE approaches that look like fixes and are NOT. All were built and measured\r\n (Chromium, LayoutDuration + RecalcStyleDuration, min of 9 toggles, two scenarios:\r\n 40 panels with ~320-node bodies, and one small panel above a 2000-row sticky\r\n table). Recorded so nobody spends the afternoon on them again:\r\n\r\n 1. Pin the track to a measured PIXEL height for the transition, so the `fr`\r\n never has to be resolved against content. Landed inside the noise across\r\n three runs (+11%, -2%, -17%) and cost two extra forced layouts per toggle to\r\n measure and release. The per-frame cost is NOT the `fr` resolution — it is\r\n that the row's block size changes at all, which re-lays-out the grid item\r\n however the target size was expressed.\r\n 2. Also give the inner region a definite `height`, so its own constraint space\r\n stops changing and its subtree layout can be cached. No effect either.\r\n 3. Don't animate a layout property at all: snap the box to its final size and\r\n slide the content in on `transform`/`opacity`. A quick CSS prototype looked\r\n like a 50% win, but only because it had no `content-visibility` transition\r\n and so dropped the subtree instantly on close — the close animation was\r\n simply invisible. Made to actually work, it measured 14.6/18.3ms vs\r\n collapse's 20.0/18.4ms on heavy bodies (i.e. unreliable), and 17.4/19.6ms vs\r\n 12.6/12.8ms on the heavy-page scenario — reliably WORSE, because the\r\n transform/opacity pass costs more than the box animation it replaced.\r\n\r\n So `--mono-accordion-duration: 0s` really is the lever, and there is no cleverer\r\n one. Measured against it: heavy bodies 7.0/10.8ms vs 20.0/18.4ms (~45-65% off);\r\n heavy page 11.1/11.7ms vs 12.6/12.8ms (~10% off — on a page like that the\r\n accordion is nearly irrelevant and the page's own weight is the cost). */\r\n --_mono-accordion-duration: var(--mono-accordion-duration, var(--mono-duration));\r\n\r\n display: block;\r\n width: 100%;\r\n font-family: inherit;\r\n color: var(--_mono-accordion-text);\r\n\r\n /* EXTENSION — the standalone frame. Inside a group this is flattened below and\r\n the frame moves to the group, which is upstream's arrangement. */\r\n border: var(--mono-border-width) solid var(--_mono-accordion-border);\r\n border-radius: var(--_mono-accordion-radius);\r\n background: var(--_mono-accordion-bg);\r\n box-shadow: var(--_mono-accordion-shadow);\r\n overflow: hidden;\r\n transition:\r\n border-color var(--mono-duration) var(--mono-ease),\r\n box-shadow var(--mono-duration) var(--mono-ease),\r\n background-color var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion],\r\n:where([mono-accordion]) *,\r\n:where([mono-accordion]) *::before,\r\n:where([mono-accordion]) *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n/* The shadow build renders EVERY region up front (so DSD can project into them\r\n server-side) and marks the ones with nothing in them; the light build renders\r\n only what exists. Hiding them here is what keeps the two builds identical.\r\n\r\n NOT wrapped in `:where()`, unlike the other parts: a region rule is two\r\n attributes strong, so a zero-weight hide would tie and lose on source order. */\r\n[mono-accordion] :is(\r\n [mono-glyph],\r\n [mono-heading],\r\n [mono-title],\r\n [mono-subtitle],\r\n [mono-description],\r\n [mono-actions]\r\n)[mono-empty] {\r\n display: none;\r\n}\r\n\r\n/* =========================================\r\n Group — `.accordion`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion — flex w-full flex-col\r\n The GROUP is consumer markup — the element renders one item, not the list — so\r\n unlike every part below, its pre-port CLASS is public API and keeps working\r\n beside the attribute until 2.0.\r\n The frame knobs are inert on vega (0 width, no radius) and set by the four\r\n flavors whose `.accordion` says `overflow-hidden rounded-2xl border`. */\r\n:is([mono-accordion-group], .mono-accordion-group) {\r\n --_mono-accordion-group-gap: var(--mono-accordion-group-gap, 0px);\r\n --_mono-accordion-group-radius: var(--mono-accordion-group-radius, 0px);\r\n --_mono-accordion-group-border-width: var(--mono-accordion-group-border-width, 0px);\r\n --_mono-accordion-group-border-color: var(--mono-accordion-group-border-color, var(--border));\r\n\r\n display: flex;\r\n width: 100%;\r\n flex-direction: column;\r\n gap: var(--_mono-accordion-group-gap);\r\n box-sizing: border-box;\r\n border: var(--_mono-accordion-group-border-width) solid var(--_mono-accordion-group-border-color);\r\n border-radius: var(--_mono-accordion-group-radius);\r\n overflow: hidden;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details — not-last:border-b\r\n In a group the ITEM stops being a card: the frame is the group's, and all an\r\n item carries is the hairline to the next one.\r\n\r\n TWO selectors for one rule, because the item is not always a child of the\r\n group. Hand-written markup nests `[mono-accordion]` directly, so the `>`\r\n path matches; the ELEMENT puts a custom-element host in between (light) or a\r\n shadow boundary (shadow), which no selector crosses — so it detects the group\r\n itself and writes `mono-grouped` / `mono-last` on its root. */\r\n:where([mono-accordion-group], .mono-accordion-group) > [mono-accordion],\r\n[mono-accordion][mono-grouped] {\r\n border-width: 0;\r\n border-radius: 0;\r\n box-shadow: none;\r\n}\r\n\r\n/* The divider rides the group's own CHILD, whatever that is — the item itself in\r\n hand-written markup, the custom-element host when the element renders it. That\r\n is what makes `:last-child` reliable: the host is a child of the group in both\r\n builds, where the ITEM is one only in raw markup, and an item that asked \"am I\r\n last?\" itself would answer from however many siblings existed when it rendered. */\r\n:where([mono-accordion-group], .mono-accordion-group)\r\n > :is([mono-accordion], mono-accordion, mono-shadow-accordion) {\r\n border-bottom: var(--mono-border-width) solid var(--mono-accordion-border, var(--border));\r\n}\r\n\r\n:where([mono-accordion-group], .mono-accordion-group)\r\n > :is([mono-accordion], mono-accordion, mono-shadow-accordion):last-child {\r\n border-bottom-width: 0;\r\n}\r\n\r\n/* A group with a GAP has separate boxes again, and a divider would float in the\r\n space between them — so a gap is a consumer's own arrangement, not upstream's,\r\n and they set `--mono-accordion-group-gap` knowing the dividers go with it. */\r\n\r\n/* =========================================\r\n Sizes — EXTENSION: Basecoat ships ONE accordion size; md is its `summary`\r\n ========================================= */\r\n\r\n[mono-accordion][mono-size=\"xs\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-xs, calc(var(--mono-spacing) * 2.5));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-xs, calc(var(--mono-spacing) * 2));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-xs, var(--mono-radius-sm));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 1.5);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-xs, var(--mono-text-xs));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-xs);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-xs, var(--mono-text-xs));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 3);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 4.5);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-sm);\r\n}\r\n\r\n[mono-accordion][mono-size=\"sm\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-sm, calc(var(--mono-spacing) * 3));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-sm, calc(var(--mono-spacing) * 3));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-sm, var(--mono-radius-md));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 2);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-sm, var(--mono-text-xs));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-xs);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-sm, var(--mono-text-xs));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 3.5);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 6);\r\n}\r\n\r\n[mono-accordion][mono-size=\"lg\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-lg, calc(var(--mono-spacing) * 5));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-lg, calc(var(--mono-spacing) * 5));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-lg, var(--mono-radius-lg));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 3.5);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-lg, var(--mono-text-base));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-base--lh);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-lg, var(--mono-text-sm));\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 5);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 8);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-md);\r\n}\r\n\r\n[mono-accordion][mono-size=\"xl\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-xl, calc(var(--mono-spacing) * 6));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-xl, calc(var(--mono-spacing) * 6));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-xl, var(--mono-radius-xl));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 4);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-xl, var(--mono-text-lg));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-lg--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-sm);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-xl, var(--mono-text-base));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-base--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 5.5);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 9);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-lg);\r\n}\r\n\r\n[mono-accordion][mono-size=\"xxl\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-xxl, calc(var(--mono-spacing) * 7));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-xxl, calc(var(--mono-spacing) * 7));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-xxl, var(--mono-radius-xl));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 4.5);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-xxl, var(--mono-text-xl));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-xl--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-sm);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-xxl, var(--mono-text-lg));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-lg--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 6);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 10);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-lg);\r\n}\r\n\r\n/* =========================================\r\n Colours — EXTENSION: the role tints the chevron, the ring and the open edge\r\n ========================================= */\r\n\r\n[mono-accordion][mono-color=\"primary\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-primary); }\r\n[mono-accordion][mono-color=\"secondary\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-secondary); }\r\n[mono-accordion][mono-color=\"success\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-success); }\r\n[mono-accordion][mono-color=\"danger\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-danger); }\r\n[mono-accordion][mono-color=\"warning\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-warning); }\r\n[mono-accordion][mono-color=\"info\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-info); }\r\n[mono-accordion][mono-color=\"teal\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-teal); }\r\n[mono-accordion][mono-color=\"purple\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-purple); }\r\n[mono-accordion][mono-color=\"neutral\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-neutral); }\r\n[mono-accordion][mono-color=\"dark\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-dark); }\r\n\r\n/* =========================================\r\n States\r\n ========================================= */\r\n\r\n[mono-accordion][mono-open] {\r\n border-color: var(--_mono-accordion-open-border-color);\r\n box-shadow: var(--_mono-accordion-open-shadow);\r\n background: var(--_mono-accordion-open-bg);\r\n}\r\n\r\n/* In a group the item has no frame to tint — only the open wash survives. */\r\n:where([mono-accordion-group], .mono-accordion-group) > [mono-accordion][mono-open],\r\n[mono-accordion][mono-grouped][mono-open] {\r\n border-color: var(--_mono-accordion-border);\r\n box-shadow: none;\r\n}\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details[aria-disabled='true'] > summary, .accordion > details > summary[aria-disabled='true']\r\n — pointer-events-none opacity-50. DEVIATION: 0.6, this component's pre-port\r\n value, and on the whole item rather than the summary alone (the body is\r\n equally unusable). */\r\n[mono-accordion][mono-disabled] {\r\n opacity: 0.6;\r\n pointer-events: none;\r\n cursor: not-allowed;\r\n}\r\n\r\n/* =========================================\r\n Head — `> summary`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details > summary —\r\n relative flex w-full flex-1 cursor-pointer list-none items-start\r\n justify-between border border-transparent transition-all outline-none */\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > summary — rounded-md py-4\r\n text-left text-sm font-medium hover:underline focus-visible:ring-3\r\n focus-visible:ring-ring/50 focus-visible:border-ring\r\n — DEVIATIONS: a real <button> (so it needs the UA button reset), and\r\n `items-center` rather than `items-start`: this row can carry a glyph chip and\r\n trailing actions, which upstream's text-only summary never does. */\r\n:where([mono-accordion]) > [mono-head] {\r\n position: relative;\r\n display: flex;\r\n width: 100%;\r\n align-items: center;\r\n justify-content: space-between;\r\n gap: var(--_mono-accordion-gap);\r\n padding: var(--_mono-accordion-pad-y) var(--_mono-accordion-pad-x);\r\n border: var(--mono-border-width) solid transparent;\r\n border-radius: var(--_mono-accordion-radius);\r\n background: none;\r\n color: inherit;\r\n font: inherit;\r\n text-align: left;\r\n cursor: pointer;\r\n user-select: none;\r\n outline: none;\r\n appearance: none;\r\n box-shadow: var(--_mono-accordion-ring);\r\n transition:\r\n background-color var(--mono-duration) var(--mono-ease),\r\n border-color var(--mono-duration) var(--mono-ease),\r\n box-shadow var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion] > [mono-head]:focus-visible {\r\n border-color: var(--_mono-accordion-ring-color);\r\n --_mono-accordion-ring: 0 0 0 var(--_mono-accordion-ring-width)\r\n color-mix(in oklab, var(--_mono-accordion-ring-color) var(--mono-ring-alpha), transparent);\r\n}\r\n\r\n/* `hover:underline` — on the label, which is the only text in upstream's summary. */\r\n@media (hover: hover) {\r\n [mono-accordion] > [mono-head]:hover:not(:disabled) {\r\n background: var(--_mono-accordion-head-hover-bg);\r\n }\r\n\r\n [mono-accordion] > [mono-head]:hover:not(:disabled) [mono-title] {\r\n text-decoration-line: var(--_mono-accordion-title-hover-decoration);\r\n }\r\n}\r\n\r\n[mono-accordion] > [mono-head]:disabled {\r\n pointer-events: none;\r\n cursor: not-allowed;\r\n}\r\n\r\n/* =========================================\r\n Leading chip — EXTENSION\r\n ========================================= */\r\n\r\n:where([mono-accordion] > [mono-head]) > [mono-glyph] {\r\n flex-shrink: 0;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: var(--_mono-accordion-glyph-size);\r\n height: var(--_mono-accordion-glyph-size);\r\n border-radius: var(--_mono-accordion-glyph-radius);\r\n background: var(--_mono-accordion-glyph-bg);\r\n color: var(--_mono-accordion-glyph-color);\r\n line-height: 1;\r\n}\r\n\r\n/* The glyph itself fills the chip at 62% — light: the `[data-mono-slot]`\r\n placeholder the svg is moved into; shadow: the projected svg. */\r\n[mono-accordion] > [mono-head] > [mono-glyph] > [data-mono-slot=\"icon\"],\r\n[mono-accordion] > [mono-head] > [mono-glyph] > svg,\r\n[mono-accordion] > [mono-head] > [mono-glyph] slot[name=\"icon\"]::slotted(svg) {\r\n display: block;\r\n width: 62%;\r\n height: 62%;\r\n}\r\n\r\n/* …and the light build's svg fills that placeholder. It used to lean on a global\r\n `[data-mono-slot='icon'] > svg` rule in chip.css; since the Basecoat port that\r\n rule is scoped to chips, and an unsized inline svg falls back to 300×150. */\r\n[mono-accordion] > [mono-head] > [mono-glyph] > [data-mono-slot=\"icon\"] > svg {\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* =========================================\r\n Title + description\r\n ========================================= */\r\n\r\n:where([mono-accordion] > [mono-head]) > [mono-heading] {\r\n flex: 1;\r\n min-width: 0;\r\n display: flex;\r\n flex-direction: column;\r\n gap: calc(var(--mono-spacing) * 0.25);\r\n}\r\n\r\n/* `> slot[name=\"header\"]`: in the shadow build the title/subtitle are the\r\n FALLBACK content of `<slot name=\"header\">`, so they sit one element deeper. */\r\n:where(\r\n [mono-accordion] > [mono-head] > [mono-heading],\r\n [mono-accordion] > [mono-head] > [mono-heading] > slot[name=\"header\"]\r\n) > [mono-title] {\r\n font-size: var(--_mono-accordion-title-font);\r\n line-height: var(--_mono-accordion-title-line-height);\r\n font-weight: var(--_mono-accordion-title-weight);\r\n color: var(--_mono-accordion-text);\r\n}\r\n\r\n:where(\r\n [mono-accordion] > [mono-head] > [mono-heading],\r\n [mono-accordion] > [mono-head] > [mono-heading] > slot[name=\"header\"]\r\n) > :is([mono-subtitle], [mono-description]) {\r\n font-size: var(--_mono-accordion-description-font);\r\n line-height: var(--mono-leading-normal);\r\n color: var(--_mono-accordion-description-color);\r\n}\r\n\r\n:where([mono-accordion] > [mono-head]) > [mono-actions] {\r\n flex-shrink: 0;\r\n display: inline-flex;\r\n align-items: center;\r\n gap: calc(var(--mono-spacing) * 1.5);\r\n}\r\n\r\n/* =========================================\r\n Chevron — `summary > svg:last-child`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > summary > svg:last-child\r\n — text-muted-foreground ms-auto size-4 */\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details > summary > svg:last-child\r\n — pointer-events-none shrink-0 transition-transform */\r\n:where([mono-accordion] > [mono-head]) > [mono-arrow] {\r\n flex-shrink: 0;\r\n margin-inline-start: auto;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: var(--_mono-accordion-arrow-size);\r\n height: var(--_mono-accordion-arrow-size);\r\n color: var(--_mono-accordion-arrow-color);\r\n pointer-events: none;\r\n transition:\r\n rotate var(--_mono-accordion-duration) var(--mono-ease),\r\n color var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion] > [mono-head] > [mono-arrow] > :is(svg, span) {\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details[open] > summary > svg:last-child\r\n — rotate-180 */\r\n[mono-accordion][mono-open] > [mono-head] > [mono-arrow] {\r\n rotate: 180deg;\r\n color: var(--_mono-accordion-arrow-open-color);\r\n}\r\n\r\n/* =========================================\r\n Body — `details > :not(summary)`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details > :not(summary) — overflow-hidden */\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > :not(summary) — pt-0 pb-4 text-sm\r\n A <details> collapses for free; a div has to be animated. The\r\n `grid-template-rows: 0fr → 1fr` trick measures the content's natural height\r\n through the grid track and interpolates the row size, with the vertical padding\r\n and the top border collapsing in lockstep so the entrance feels of-a-piece.\r\n `> * { min-height: 0 }` lets grid items shrink below their intrinsic height when\r\n the row is 0fr — without it the body would refuse to collapse. */\r\n:where([mono-accordion]) > [mono-body] {\r\n display: grid;\r\n grid-template-rows: 0fr;\r\n overflow: hidden;\r\n padding: 0 var(--_mono-accordion-pad-x);\r\n font-size: var(--_mono-accordion-body-font);\r\n line-height: var(--_mono-accordion-body-line-height);\r\n color: var(--_mono-accordion-body-color);\r\n border-top: var(--mono-border-width) solid transparent;\r\n\r\n /* Scope this body's layout/paint work to its own box. Measured effect: neutral on\r\n toggle cost, a modest win on the initial layout of a long list of accordions.\r\n (It is NOT what fixes sibling cost — Chrome already does not re-lay-out sibling\r\n subtrees when one accordion animates; that was measured, not assumed.)\r\n `paint` adds no new clipping — `overflow: hidden` above already clips. `layout`\r\n does make this a containing block + stacking context for absolutely positioned\r\n descendants, which is safe here because that same `overflow: hidden` already\r\n confined them, and mono's own popups are moved to a <body> portal. */\r\n contain: layout paint;\r\n\r\n transition:\r\n grid-template-rows var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-top var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-bottom var(--_mono-accordion-duration) var(--mono-ease),\r\n border-top-color var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion] > [mono-body] > * {\r\n min-width: 0;\r\n min-height: 0;\r\n}\r\n\r\n/* Shadow build: the body's native <slot>s (`body` + the default one) default to\r\n `display: contents` and so have no box — slotted content would become the grid\r\n items directly (un-targetable by `> * { min-height: 0 }`) and keep the\r\n `grid-template-rows: 0fr → 1fr` track from ever collapsing. They sit in ONE\r\n `[mono-body-slots]` block, the single grid item (like the light build's\r\n <span data-mono-slot=\"body\">), so the open/close collapse works. A bare `slot`\r\n child is kept for markup that still renders one. */\r\n[mono-accordion] > [mono-body] > :is(slot, [mono-body-slots]) {\r\n display: block;\r\n min-width: 0;\r\n min-height: 0;\r\n}\r\n\r\n/* Standalone, the item IS the frame, so the open body is separated from the head\r\n by a hairline the way a card's footer is — EXTENSION, and the reason the top\r\n padding is not upstream's `pt-0` here. */\r\n[mono-accordion][mono-open] > [mono-body] {\r\n grid-template-rows: 1fr;\r\n padding-top: var(--_mono-accordion-pad-y);\r\n padding-bottom: var(--_mono-accordion-pad-y);\r\n border-top-color: var(--_mono-accordion-border);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > :not(summary) — pt-0.\r\n In a group the head and its body are one run of text between two dividers,\r\n exactly as upstream renders it, so the top gap and the hairline both go. */\r\n:where([mono-accordion-group], .mono-accordion-group) > [mono-accordion][mono-open] > [mono-body],\r\n[mono-accordion][mono-grouped][mono-open] > [mono-body] {\r\n padding-top: 0;\r\n border-top-color: transparent;\r\n}\r\n\r\n/* A collapsed body is still fully rendered — the `0fr` track only hides it — so\r\n without this every closed accordion keeps its whole slotted subtree in the style,\r\n layout and paint trees. `content-visibility: hidden` drops it entirely.\r\n\r\n What this buys, measured with ~320-node bodies (Chromium, median of 3):\r\n initial layout, 40 panels: 157ms → 18ms, and flat in the panel count\r\n (5 panels: 52ms → 23ms). That is the cost of putting a long list of heavy\r\n accordions on screen at all — e.g. opening a modal that builds N entry forms.\r\n What it does NOT buy: a cheaper toggle. Skipping the subtree means an opening\r\n panel is laid out from scratch, so one open+close costs slightly MORE\r\n (23ms → 31ms at 40 panels). The toggle's real cost is the animation above —\r\n see `--mono-accordion-duration`.\r\n\r\n `allow-discrete` is what makes it safe to animate. Opening flips the property to\r\n `visible` at 0%, so the grid can still measure the content it is expanding to;\r\n closing holds it `visible` until 100%, so the collapse plays out before the content\r\n is dropped. Get that backwards and a closing body vanishes instantly instead of\r\n collapsing.\r\n\r\n Gated behind @supports deliberately. `content-visibility … allow-discrete` inside\r\n the `transition` SHORTHAND is a parse error to a browser without the feature, and a\r\n single bad entry drops the WHOLE declaration — which would take every accordion\r\n transition with it. Inside the guard the shorthand is known to parse, so the list is\r\n restated in full rather than patched with the `transition-behavior` longhand.\r\n Browsers without support keep exactly the previous behaviour.\r\n\r\n Must stay ABOVE the reduced-motion block: @supports adds no specificity, so source\r\n order is the only thing keeping `transition: none` the winner down there. */\r\n@supports (transition-behavior: allow-discrete) {\r\n :where([mono-accordion]) > [mono-body] {\r\n content-visibility: hidden;\r\n /* Must stay `0`, NOT `auto 0`. `content-visibility: hidden` skips this element's\r\n own contents, so its size comes from HERE — and the `auto` keyword's remembered\r\n size is the panel's last OPEN height, which leaves a closed accordion holding\r\n full height with nothing in it. Tried, measured, reverted: a closed body read\r\n 656px instead of collapsing. The scrollbar-stability that `auto` normally buys\r\n does not apply to an element that is itself the skipped one. */\r\n contain-intrinsic-size: 0;\r\n transition:\r\n grid-template-rows var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-top var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-bottom var(--_mono-accordion-duration) var(--mono-ease),\r\n border-top-color var(--mono-duration) var(--mono-ease),\r\n content-visibility var(--_mono-accordion-duration) allow-discrete;\r\n }\r\n\r\n [mono-accordion][mono-open] > [mono-body] {\r\n content-visibility: visible;\r\n }\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n [mono-accordion],\r\n [mono-accordion] > [mono-head],\r\n [mono-accordion] > [mono-head] > [mono-arrow],\r\n [mono-accordion] > [mono-body] {\r\n transition: none;\r\n }\r\n}\r\n";
282
+ var accordion_css_raw_default = "/* @unocss-include */\r\n\r\n/* =========================================================================\r\n mono-accordion — a port of Basecoat's `.accordion`\r\n (basecoat-css@1.0.2, vega style).\r\n\r\n Styled by ATTRIBUTE, like Basecoat — and the attributes mirror the element's\r\n props one for one, so hand-written markup reads like the Lit / Vue tag:\r\n\r\n <mono-accordion size=\"lg\" color=\"success\" model-value>\r\n <div mono-accordion mono-size=\"lg\" mono-color=\"success\" mono-open>\r\n <button mono-head type=\"button\" aria-expanded=\"true\">\r\n <span mono-glyph>…</span>\r\n <span mono-heading>\r\n <span mono-title>Question</span>\r\n <span mono-subtitle>Sub-text</span>\r\n </span>\r\n <span mono-actions>…</span>\r\n <span mono-arrow><svg …></svg></span>\r\n </button>\r\n <div mono-body role=\"region\"><div>…</div></div>\r\n </div>\r\n\r\n An absent attribute is the prop's default (`:not([mono-size])` = md,\r\n `:not([mono-color])` = primary). The element writes them on its root — the\r\n host in the light build, an inner root `<div>` in the shadow one — plus the\r\n states `mono-open` and `mono-disabled`. The old classes\r\n (`.mono-accordion.md.primary.open`) are still emitted as inert hooks until\r\n 2.0 but no rule here reads them.\r\n\r\n Selector map (ours ≡ upstream):\r\n [mono-accordion-group] ≡ .accordion (flex w-full flex-col; maia /\r\n mira / luma / rhea add the frame, which is\r\n the `-group-*` knobs below)\r\n [mono-accordion] ≡ .accordion > details (not-last:border-b, and\r\n `open:bg-muted/50` on four flavors)\r\n — EXTENSION when standalone: upstream has no\r\n accordion outside a group, so on its own it\r\n keeps this component's frame (border, radius,\r\n shadow-xs). Inside a group the frame moves to\r\n the group and the item flattens to a divider.\r\n [mono-head] ≡ > summary (relative flex w-full items-start\r\n justify-between border border-transparent\r\n cursor-pointer outline-none, rounded-md py-4\r\n text-left text-sm font-medium hover:underline,\r\n focus-visible:ring-3 ring-ring/50 border-ring)\r\n — DEVIATION: a real <button>, so the row is a\r\n button for a11y rather than a <summary> whose\r\n open state the element would have to fight\r\n [mono-glyph] ≡ EXTENSION (the leading icon chip)\r\n [mono-heading] > [mono-title] ≡ the summary's own text\r\n [mono-subtitle] ≡ EXTENSION (a second line under the title;\r\n `[mono-description]` is its old name, and the\r\n element still renders both)\r\n [mono-actions] ≡ EXTENSION (trailing controls in the row)\r\n [mono-arrow] ≡ summary > svg:last-child (text-muted-foreground\r\n ms-auto size-4, rotate-180 while open)\r\n [mono-body] ≡ details > :not(summary) (overflow-hidden,\r\n pt-0 pb-4 text-sm) — plus the animated\r\n collapse, which upstream's <details> gets free\r\n [mono-size]/[mono-color] ≡ EXTENSION (upstream ships one size, no colour)\r\n [mono-disabled] ≡ details[aria-disabled] > summary\r\n (pointer-events-none opacity-50)\r\n\r\n PART NAMES ARE PATH-SCOPED. `[mono-title]`, `[mono-body]`, `[mono-actions]`\r\n and `[mono-icon]` are also card's, dropdown's and button's part names, and an\r\n accordion BODY is a place consumers put cards and buttons. Every rule here is\r\n therefore written as an explicit child path from the root — `:where([mono-accordion]\r\n > [mono-head] > [mono-heading]) > [mono-title]` — so a nested component's parts\r\n are never reached. The `:where()` keeps that path at (0,1,0), the same weight a\r\n one-attribute rule would have, so a `cssClass` utility still wins by source order.\r\n\r\n FLAVORS set `--mono-accordion-{radius,shadow,pad-x-<size>,pad-y-<size>,\r\n title-font-<size>,body-font-<size>,open-bg,group-radius,group-border-width,\r\n arrow-size,ring-width}`; every fallback here is vega's value\r\n (`node scripts/basecoat-styles.mjs --varying \"accordion\"` prints the matrix).\r\n ========================================================================= */\r\n\r\nmono-accordion {\r\n display: block;\r\n}\r\n\r\n/* =========================================\r\n Root — the item\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details — not-last:border-b */\r\n[mono-accordion] {\r\n /* ── the six roles, each a public knob over a Basecoat token ───────────── */\r\n --_mono-accordion-primary: var(--mono-accordion-primary, var(--primary));\r\n --_mono-accordion-secondary: var(--mono-accordion-secondary, var(--secondary-foreground));\r\n --_mono-accordion-success: var(--mono-accordion-success, var(--success));\r\n --_mono-accordion-danger: var(--mono-accordion-danger, var(--destructive));\r\n --_mono-accordion-warning: var(--mono-accordion-warning, var(--warning));\r\n --_mono-accordion-info: var(--mono-accordion-info, var(--info));\r\n --_mono-accordion-teal: var(--mono-accordion-teal, var(--teal));\r\n --_mono-accordion-purple: var(--mono-accordion-purple, var(--purple));\r\n --_mono-accordion-neutral: var(--mono-accordion-neutral, var(--neutral));\r\n --_mono-accordion-dark: var(--mono-accordion-dark, var(--dark));\r\n /* the colour in play — `primary` unless a [mono-color] rule re-points it */\r\n --_mono-accordion-accent: var(--mono-accordion-accent, var(--_mono-accordion-accent-preset, var(--_mono-accordion-primary)));\r\n\r\n /* ── surfaces ──────────────────────────────────────────────────────────── */\r\n --_mono-accordion-bg: var(--mono-accordion-bg, var(--mono-accordion-surface, var(--card)));\r\n --_mono-accordion-text: var(--mono-accordion-text, var(--card-foreground));\r\n --_mono-accordion-border: var(--mono-accordion-border, var(--border));\r\n --_mono-accordion-shadow: var(--mono-accordion-shadow, var(--mono-shadow-xs));\r\n /* `open:bg-muted/50` — vega does NOT tint an open item; maia, mira, luma and\r\n rhea do, and set this knob. `--mono-accordion-head-bg` is the pre-port name,\r\n honoured until 2.0: it tinted the open HEAD, where this tints the open item\r\n (head and body alike), which is what upstream's `open:` variant does. */\r\n /* An OPAQUE fill, not an overlay: it replaces the item's own surface while\r\n open, so a flavor's `bg-muted/50` is written as that mix OVER `--card`.\r\n Defaulting to the item's surface is what makes vega's \"no tint\" a no-op. */\r\n --_mono-accordion-open-bg: var(--mono-accordion-open-bg, var(--mono-accordion-head-bg, var(--_mono-accordion-bg)));\r\n --_mono-accordion-open-border-color: var(--mono-accordion-open-border-color,\r\n color-mix(in oklab, var(--_mono-accordion-accent) 32%, var(--_mono-accordion-border)));\r\n --_mono-accordion-open-shadow: var(--mono-accordion-open-shadow,\r\n 0 3px 14px color-mix(in oklab, var(--_mono-accordion-accent) 9%, transparent));\r\n\r\n /* ── md metrics live on the unqualified root ON PURPOSE ────────────────────\r\n basecoat@1.0.2 styles/vega.css .accordion > details > summary — py-4 text-sm\r\n — DEVIATION: the inline padding is ours. Upstream's summary has none because\r\n its group is edge-to-edge in the page; this item can stand alone inside its\r\n own frame, where text flush against the border reads as a bug. maia / luma /\r\n rhea say `p-4`, which is exactly the value used here. */\r\n --_mono-accordion-pad-x: var(--mono-accordion-pad-x, var(--_mono-accordion-pad-x-preset, var(--mono-accordion-pad-x-md, calc(var(--mono-spacing) * 4))));\r\n --_mono-accordion-pad-y: var(--mono-accordion-pad-y, var(--_mono-accordion-pad-y-preset, var(--mono-accordion-pad-y-md, calc(var(--mono-spacing) * 4))));\r\n --_mono-accordion-radius: var(--mono-accordion-radius, var(--_mono-accordion-radius-preset, var(--mono-accordion-radius-md, var(--mono-radius-md))));\r\n --_mono-accordion-gap: var(--mono-accordion-gap, var(--_mono-accordion-gap-preset, calc(var(--mono-spacing) * 3)));\r\n\r\n /* ── type ──────────────────────────────────────────────────────────────── */\r\n --_mono-accordion-title-font: var(--mono-accordion-title-font, var(--_mono-accordion-title-font-preset, var(--mono-accordion-title-font-md, var(--mono-text-sm))));\r\n --_mono-accordion-title-line-height: var(--mono-accordion-title-line-height, var(--_mono-accordion-title-line-height-preset, var(--mono-text-sm--lh)));\r\n --_mono-accordion-title-weight: var(--mono-accordion-title-weight, var(--mono-font-weight-medium));\r\n /* `hover:underline` — the whole row is the control, so the hover cue is on its\r\n label. A flavor (or a consumer) sets `none` to drop it. */\r\n --_mono-accordion-title-hover-decoration: var(--mono-accordion-title-hover-decoration, underline);\r\n --_mono-accordion-description-font: var(--mono-accordion-description-font, var(--_mono-accordion-description-font-preset, var(--mono-text-xs)));\r\n --_mono-accordion-description-color: var(--mono-accordion-description-color, var(--muted-foreground));\r\n --_mono-accordion-body-font: var(--mono-accordion-body-font, var(--_mono-accordion-body-font-preset, var(--mono-accordion-body-font-md, var(--mono-text-sm))));\r\n --_mono-accordion-body-line-height: var(--mono-accordion-body-line-height, var(--_mono-accordion-body-line-height-preset, var(--mono-text-sm--lh)));\r\n --_mono-accordion-body-color: var(--mono-accordion-body-color, inherit);\r\n\r\n /* ── the chevron — `text-muted-foreground size-4` ──────────────────────── */\r\n --_mono-accordion-arrow-size: var(--mono-accordion-arrow-size, var(--_mono-accordion-arrow-size-preset, calc(var(--mono-spacing) * 4)));\r\n --_mono-accordion-arrow-color: var(--mono-accordion-arrow-color, var(--muted-foreground));\r\n /* EXTENSION: the role reads the open state at a glance. Set it to\r\n `--muted-foreground` for upstream's single-colour chevron. */\r\n --_mono-accordion-arrow-open-color: var(--mono-accordion-arrow-open-color, var(--_mono-accordion-accent));\r\n\r\n /* ── the leading chip (EXTENSION) ──────────────────────────────────────── */\r\n --_mono-accordion-glyph-size: var(--mono-accordion-glyph-size, var(--_mono-accordion-glyph-size-preset, calc(var(--mono-spacing) * 7)));\r\n --_mono-accordion-glyph-radius: var(--mono-accordion-glyph-radius, var(--_mono-accordion-glyph-radius-preset, var(--mono-radius-sm)));\r\n --_mono-accordion-glyph-bg: var(--mono-accordion-glyph-bg, color-mix(in oklab, var(--_mono-accordion-accent) 14%, transparent));\r\n --_mono-accordion-glyph-color: var(--mono-accordion-glyph-color, var(--_mono-accordion-accent));\r\n\r\n /* ── focus — `focus-visible:ring-3 ring-ring/50 border-ring` ───────────── */\r\n --_mono-accordion-ring-color: var(--mono-accordion-ring-color, var(--_mono-accordion-accent));\r\n\r\n /* The head's hover fill. Upstream has none — it underlines the label instead —\r\n so the tint is 0% on vega. A flavor sets the ALPHA (`-head-hover-tint`) and\r\n the wash is built HERE: a flavor writing the colour itself would have to\r\n reference `--_mono-accordion-accent`, which is declared on this element, and\r\n a `:root` declaration that references it is invalid at computed-value time. */\r\n --_mono-accordion-head-hover-bg: var(--mono-accordion-head-hover-bg,\r\n color-mix(in oklab, var(--_mono-accordion-accent) var(--mono-accordion-head-hover-tint, 0%), transparent));\r\n --_mono-accordion-ring-width: var(--mono-accordion-ring-width, var(--mono-ring-width));\r\n /* A slot, so a state can neutralise the resting shadow without `box-shadow: none`. */\r\n --_mono-accordion-ring: 0 0 #0000;\r\n\r\n /* Open/close animation duration, shared by the body collapse and the chevron so\r\n `--mono-accordion-duration: 0s` means a fully instant toggle.\r\n\r\n This is THE lever for a slow open/close. `grid-template-rows: 0fr → 1fr` is the\r\n only animated LAYOUT property in the library, and it re-lays-out the whole slotted\r\n subtree on every frame of the transition, so its cost scales with what is inside\r\n the body — and, because the panel's own height changes, with whatever follows it\r\n in the document too. Measured with ~320-node bodies (Chromium, median of 3), one\r\n open+close cycle: 24.8ms animated vs 3.6ms at `0s` — the animation is ~85% of the\r\n toggle's cost. Set this to `0s` on accordions whose bodies (or whose pages) are\r\n heavy.\r\n\r\n THREE approaches that look like fixes and are NOT. All were built and measured\r\n (Chromium, LayoutDuration + RecalcStyleDuration, min of 9 toggles, two scenarios:\r\n 40 panels with ~320-node bodies, and one small panel above a 2000-row sticky\r\n table). Recorded so nobody spends the afternoon on them again:\r\n\r\n 1. Pin the track to a measured PIXEL height for the transition, so the `fr`\r\n never has to be resolved against content. Landed inside the noise across\r\n three runs (+11%, -2%, -17%) and cost two extra forced layouts per toggle to\r\n measure and release. The per-frame cost is NOT the `fr` resolution — it is\r\n that the row's block size changes at all, which re-lays-out the grid item\r\n however the target size was expressed.\r\n 2. Also give the inner region a definite `height`, so its own constraint space\r\n stops changing and its subtree layout can be cached. No effect either.\r\n 3. Don't animate a layout property at all: snap the box to its final size and\r\n slide the content in on `transform`/`opacity`. A quick CSS prototype looked\r\n like a 50% win, but only because it had no `content-visibility` transition\r\n and so dropped the subtree instantly on close — the close animation was\r\n simply invisible. Made to actually work, it measured 14.6/18.3ms vs\r\n collapse's 20.0/18.4ms on heavy bodies (i.e. unreliable), and 17.4/19.6ms vs\r\n 12.6/12.8ms on the heavy-page scenario — reliably WORSE, because the\r\n transform/opacity pass costs more than the box animation it replaced.\r\n\r\n So `--mono-accordion-duration: 0s` really is the lever, and there is no cleverer\r\n one. Measured against it: heavy bodies 7.0/10.8ms vs 20.0/18.4ms (~45-65% off);\r\n heavy page 11.1/11.7ms vs 12.6/12.8ms (~10% off — on a page like that the\r\n accordion is nearly irrelevant and the page's own weight is the cost). */\r\n --_mono-accordion-duration: var(--mono-accordion-duration, var(--mono-duration));\r\n\r\n display: block;\r\n width: 100%;\r\n font-family: inherit;\r\n color: var(--_mono-accordion-text);\r\n\r\n /* EXTENSION — the standalone frame. Inside a group this is flattened below and\r\n the frame moves to the group, which is upstream's arrangement. */\r\n border: var(--mono-border-width) solid var(--_mono-accordion-border);\r\n border-radius: var(--_mono-accordion-radius);\r\n background: var(--_mono-accordion-bg);\r\n box-shadow: var(--_mono-accordion-shadow);\r\n overflow: hidden;\r\n transition:\r\n border-color var(--mono-duration) var(--mono-ease),\r\n box-shadow var(--mono-duration) var(--mono-ease),\r\n background-color var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion],\r\n:where([mono-accordion]) *,\r\n:where([mono-accordion]) *::before,\r\n:where([mono-accordion]) *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n/* The shadow build renders EVERY region up front (so DSD can project into them\r\n server-side) and marks the ones with nothing in them; the light build renders\r\n only what exists. Hiding them here is what keeps the two builds identical.\r\n\r\n NOT wrapped in `:where()`, unlike the other parts: a region rule is two\r\n attributes strong, so a zero-weight hide would tie and lose on source order. */\r\n[mono-accordion] :is(\r\n [mono-glyph],\r\n [mono-heading],\r\n [mono-title],\r\n [mono-subtitle],\r\n [mono-description],\r\n [mono-actions]\r\n)[mono-empty] {\r\n display: none;\r\n}\r\n\r\n/* =========================================\r\n Group — `.accordion`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion — flex w-full flex-col\r\n The GROUP is consumer markup — the element renders one item, not the list — so\r\n unlike every part below, its pre-port CLASS is public API and keeps working\r\n beside the attribute until 2.0.\r\n The frame knobs are inert on vega (0 width, no radius) and set by the four\r\n flavors whose `.accordion` says `overflow-hidden rounded-2xl border`. */\r\n:is([mono-accordion-group], .mono-accordion-group) {\r\n --_mono-accordion-group-gap: var(--mono-accordion-group-gap, 0px);\r\n --_mono-accordion-group-radius: var(--mono-accordion-group-radius, 0px);\r\n --_mono-accordion-group-border-width: var(--mono-accordion-group-border-width, 0px);\r\n --_mono-accordion-group-border-color: var(--mono-accordion-group-border-color, var(--border));\r\n\r\n display: flex;\r\n width: 100%;\r\n flex-direction: column;\r\n gap: var(--_mono-accordion-group-gap);\r\n box-sizing: border-box;\r\n border: var(--_mono-accordion-group-border-width) solid var(--_mono-accordion-group-border-color);\r\n border-radius: var(--_mono-accordion-group-radius);\r\n overflow: hidden;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details — not-last:border-b\r\n In a group the ITEM stops being a card: the frame is the group's, and all an\r\n item carries is the hairline to the next one.\r\n\r\n TWO selectors for one rule, because the item is not always a child of the\r\n group. Hand-written markup nests `[mono-accordion]` directly, so the `>`\r\n path matches; the ELEMENT puts a custom-element host in between (light) or a\r\n shadow boundary (shadow), which no selector crosses — so it detects the group\r\n itself and writes `mono-grouped` / `mono-last` on its root. */\r\n:where([mono-accordion-group], .mono-accordion-group) > [mono-accordion],\r\n[mono-accordion][mono-grouped] {\r\n border-width: 0;\r\n border-radius: 0;\r\n box-shadow: none;\r\n}\r\n\r\n/* The divider rides the group's own CHILD, whatever that is — the item itself in\r\n hand-written markup, the custom-element host when the element renders it. That\r\n is what makes `:last-child` reliable: the host is a child of the group in both\r\n builds, where the ITEM is one only in raw markup, and an item that asked \"am I\r\n last?\" itself would answer from however many siblings existed when it rendered. */\r\n:where([mono-accordion-group], .mono-accordion-group)\r\n > :is([mono-accordion], mono-accordion, mono-shadow-accordion) {\r\n border-bottom: var(--mono-border-width) solid var(--mono-accordion-border, var(--border));\r\n}\r\n\r\n:where([mono-accordion-group], .mono-accordion-group)\r\n > :is([mono-accordion], mono-accordion, mono-shadow-accordion):last-child {\r\n border-bottom-width: 0;\r\n}\r\n\r\n/* A group with a GAP has separate boxes again, and a divider would float in the\r\n space between them — so a gap is a consumer's own arrangement, not upstream's,\r\n and they set `--mono-accordion-group-gap` knowing the dividers go with it. */\r\n\r\n/* =========================================\r\n Sizes — EXTENSION: Basecoat ships ONE accordion size; md is its `summary`\r\n ========================================= */\r\n\r\n[mono-accordion][mono-size=\"xs\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-xs, calc(var(--mono-spacing) * 2.5));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-xs, calc(var(--mono-spacing) * 2));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-xs, var(--mono-radius-sm));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 1.5);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-xs, var(--mono-text-xs));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-xs);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-xs, var(--mono-text-xs));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 3);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 4.5);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-sm);\r\n}\r\n\r\n[mono-accordion][mono-size=\"sm\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-sm, calc(var(--mono-spacing) * 3));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-sm, calc(var(--mono-spacing) * 3));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-sm, var(--mono-radius-md));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 2);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-sm, var(--mono-text-xs));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-xs);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-sm, var(--mono-text-xs));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-xs--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 3.5);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 6);\r\n}\r\n\r\n[mono-accordion][mono-size=\"lg\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-lg, calc(var(--mono-spacing) * 5));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-lg, calc(var(--mono-spacing) * 5));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-lg, var(--mono-radius-lg));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 3.5);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-lg, var(--mono-text-base));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-base--lh);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-lg, var(--mono-text-sm));\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 5);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 8);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-md);\r\n}\r\n\r\n[mono-accordion][mono-size=\"xl\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-xl, calc(var(--mono-spacing) * 6));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-xl, calc(var(--mono-spacing) * 6));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-xl, var(--mono-radius-xl));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 4);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-xl, var(--mono-text-lg));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-lg--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-sm);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-xl, var(--mono-text-base));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-base--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 5.5);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 9);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-lg);\r\n}\r\n\r\n[mono-accordion][mono-size=\"xxl\"] {\r\n --_mono-accordion-pad-x-preset: var(--mono-accordion-pad-x-xxl, calc(var(--mono-spacing) * 7));\r\n --_mono-accordion-pad-y-preset: var(--mono-accordion-pad-y-xxl, calc(var(--mono-spacing) * 7));\r\n --_mono-accordion-radius-preset: var(--mono-accordion-radius-xxl, var(--mono-radius-xl));\r\n --_mono-accordion-gap-preset: calc(var(--mono-spacing) * 4.5);\r\n --_mono-accordion-title-font-preset: var(--mono-accordion-title-font-xxl, var(--mono-text-xl));\r\n --_mono-accordion-title-line-height-preset: var(--mono-text-xl--lh);\r\n --_mono-accordion-description-font-preset: var(--mono-text-sm);\r\n --_mono-accordion-body-font-preset: var(--mono-accordion-body-font-xxl, var(--mono-text-lg));\r\n --_mono-accordion-body-line-height-preset: var(--mono-text-lg--lh);\r\n --_mono-accordion-arrow-size-preset: calc(var(--mono-spacing) * 6);\r\n --_mono-accordion-glyph-size-preset: calc(var(--mono-spacing) * 10);\r\n --_mono-accordion-glyph-radius-preset: var(--mono-radius-lg);\r\n}\r\n\r\n/* =========================================\r\n Colours — EXTENSION: the role tints the chevron, the ring and the open edge\r\n ========================================= */\r\n\r\n[mono-accordion][mono-color=\"primary\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-primary); }\r\n[mono-accordion][mono-color=\"secondary\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-secondary); }\r\n[mono-accordion][mono-color=\"success\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-success); }\r\n[mono-accordion][mono-color=\"danger\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-danger); }\r\n[mono-accordion][mono-color=\"warning\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-warning); }\r\n[mono-accordion][mono-color=\"info\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-info); }\r\n[mono-accordion][mono-color=\"teal\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-teal); }\r\n[mono-accordion][mono-color=\"purple\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-purple); }\r\n[mono-accordion][mono-color=\"neutral\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-neutral); }\r\n[mono-accordion][mono-color=\"dark\"] { --_mono-accordion-accent-preset: var(--_mono-accordion-dark); }\r\n\r\n/* =========================================\r\n States\r\n ========================================= */\r\n\r\n[mono-accordion][mono-open] {\r\n border-color: var(--_mono-accordion-open-border-color);\r\n box-shadow: var(--_mono-accordion-open-shadow);\r\n background: var(--_mono-accordion-open-bg);\r\n}\r\n\r\n/* In a group the item has no frame to tint — only the open wash survives. */\r\n:where([mono-accordion-group], .mono-accordion-group) > [mono-accordion][mono-open],\r\n[mono-accordion][mono-grouped][mono-open] {\r\n border-color: var(--_mono-accordion-border);\r\n box-shadow: none;\r\n}\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details[aria-disabled='true'] > summary, .accordion > details > summary[aria-disabled='true']\r\n — pointer-events-none opacity-50. DEVIATION: 0.6, this component's pre-port\r\n value, and on the whole item rather than the summary alone (the body is\r\n equally unusable). */\r\n[mono-accordion][mono-disabled] {\r\n opacity: 0.6;\r\n pointer-events: none;\r\n cursor: not-allowed;\r\n}\r\n\r\n/* =========================================\r\n Head — `> summary`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details > summary —\r\n relative flex w-full flex-1 cursor-pointer list-none items-start\r\n justify-between border border-transparent transition-all outline-none */\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > summary — rounded-md py-4\r\n text-left text-sm font-medium hover:underline focus-visible:ring-3\r\n focus-visible:ring-ring/50 focus-visible:border-ring\r\n — DEVIATIONS: a real <button> (so it needs the UA button reset), and\r\n `items-center` rather than `items-start`: this row can carry a glyph chip and\r\n trailing actions, which upstream's text-only summary never does. */\r\n:where([mono-accordion]) > [mono-head] {\r\n position: relative;\r\n display: flex;\r\n width: 100%;\r\n align-items: center;\r\n justify-content: space-between;\r\n gap: var(--_mono-accordion-gap);\r\n padding: var(--_mono-accordion-pad-y) var(--_mono-accordion-pad-x);\r\n border: var(--mono-border-width) solid transparent;\r\n border-radius: var(--_mono-accordion-radius);\r\n background: none;\r\n color: inherit;\r\n font: inherit;\r\n text-align: left;\r\n cursor: pointer;\r\n user-select: none;\r\n outline: none;\r\n appearance: none;\r\n box-shadow: var(--_mono-accordion-ring);\r\n transition:\r\n background-color var(--mono-duration) var(--mono-ease),\r\n border-color var(--mono-duration) var(--mono-ease),\r\n box-shadow var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion] > [mono-head]:focus-visible {\r\n border-color: var(--_mono-accordion-ring-color);\r\n --_mono-accordion-ring: 0 0 0 var(--_mono-accordion-ring-width)\r\n color-mix(in oklab, var(--_mono-accordion-ring-color) var(--mono-ring-alpha), transparent);\r\n}\r\n\r\n/* `hover:underline` — on the label, which is the only text in upstream's summary. */\r\n@media (hover: hover) {\r\n [mono-accordion] > [mono-head]:hover:not(:disabled) {\r\n background: var(--_mono-accordion-head-hover-bg);\r\n }\r\n\r\n [mono-accordion] > [mono-head]:hover:not(:disabled) [mono-title] {\r\n text-decoration-line: var(--_mono-accordion-title-hover-decoration);\r\n }\r\n}\r\n\r\n[mono-accordion] > [mono-head]:disabled {\r\n pointer-events: none;\r\n cursor: not-allowed;\r\n}\r\n\r\n/* =========================================\r\n Leading chip — EXTENSION\r\n ========================================= */\r\n\r\n:where([mono-accordion] > [mono-head]) > [mono-glyph] {\r\n flex-shrink: 0;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: var(--_mono-accordion-glyph-size);\r\n height: var(--_mono-accordion-glyph-size);\r\n border-radius: var(--_mono-accordion-glyph-radius);\r\n background: var(--_mono-accordion-glyph-bg);\r\n color: var(--_mono-accordion-glyph-color);\r\n line-height: 1;\r\n}\r\n\r\n/* The glyph itself fills the chip at 62% — light: the `[data-mono-slot]`\r\n placeholder the icon is moved into; shadow: the projected icon. \"Icon\" is an\r\n svg OR an element painted by a class (a UnoCSS/Iconify mask span such as\r\n `<span slot=\"icon\" class=\"i-tabler-filter-search\">`), so the shadow rule takes\r\n any slotted element, not just svg. */\r\n[mono-accordion] > [mono-head] > [mono-glyph] > [data-mono-slot=\"icon\"],\r\n[mono-accordion] > [mono-head] > [mono-glyph] > svg,\r\n[mono-accordion] > [mono-head] > [mono-glyph] slot[name=\"icon\"]::slotted(*),\r\n[mono-accordion] > [mono-head] > [mono-glyph] .mono-accordion-iconify {\r\n display: block;\r\n width: 62%;\r\n height: 62%;\r\n}\r\n\r\n/* …and the light build's icon fills that placeholder (chip.css's\r\n `[data-mono-slot=\"icon\"] > *`). It used to lean on a global\r\n `[data-mono-slot='icon'] > svg` rule in chip.css; since the Basecoat port that\r\n rule is scoped to chips, and an unsized inline svg falls back to 300×150. Only\r\n svg was sized here, so a mask span stayed `display: inline` — its icon-class\r\n `width/height: 1em` did not apply and it rendered 0×0. */\r\n[mono-accordion] > [mono-head] > [mono-glyph] > [data-mono-slot=\"icon\"] > *,\r\n[mono-accordion] > [mono-head] > [mono-glyph] .mono-accordion-iconify > svg {\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* =========================================\r\n Title + description\r\n ========================================= */\r\n\r\n:where([mono-accordion] > [mono-head]) > [mono-heading] {\r\n flex: 1;\r\n min-width: 0;\r\n display: flex;\r\n flex-direction: column;\r\n gap: calc(var(--mono-spacing) * 0.25);\r\n}\r\n\r\n/* `> slot[name=\"header\"]`: in the shadow build the title/subtitle are the\r\n FALLBACK content of `<slot name=\"header\">`, so they sit one element deeper. */\r\n:where(\r\n [mono-accordion] > [mono-head] > [mono-heading],\r\n [mono-accordion] > [mono-head] > [mono-heading] > slot[name=\"header\"]\r\n) > [mono-title] {\r\n font-size: var(--_mono-accordion-title-font);\r\n line-height: var(--_mono-accordion-title-line-height);\r\n font-weight: var(--_mono-accordion-title-weight);\r\n color: var(--_mono-accordion-text);\r\n}\r\n\r\n:where(\r\n [mono-accordion] > [mono-head] > [mono-heading],\r\n [mono-accordion] > [mono-head] > [mono-heading] > slot[name=\"header\"]\r\n) > :is([mono-subtitle], [mono-description]) {\r\n font-size: var(--_mono-accordion-description-font);\r\n line-height: var(--mono-leading-normal);\r\n color: var(--_mono-accordion-description-color);\r\n}\r\n\r\n:where([mono-accordion] > [mono-head]) > [mono-actions] {\r\n flex-shrink: 0;\r\n display: inline-flex;\r\n align-items: center;\r\n gap: calc(var(--mono-spacing) * 1.5);\r\n}\r\n\r\n/* =========================================\r\n Chevron — `summary > svg:last-child`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > summary > svg:last-child\r\n — text-muted-foreground ms-auto size-4 */\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details > summary > svg:last-child\r\n — pointer-events-none shrink-0 transition-transform */\r\n:where([mono-accordion] > [mono-head]) > [mono-arrow] {\r\n flex-shrink: 0;\r\n margin-inline-start: auto;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: var(--_mono-accordion-arrow-size);\r\n height: var(--_mono-accordion-arrow-size);\r\n color: var(--_mono-accordion-arrow-color);\r\n pointer-events: none;\r\n transition:\r\n rotate var(--_mono-accordion-duration) var(--mono-ease),\r\n color var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion] > [mono-head] > [mono-arrow] > :is(svg, span) {\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details[open] > summary > svg:last-child\r\n — rotate-180 */\r\n[mono-accordion][mono-open] > [mono-head] > [mono-arrow] {\r\n rotate: 180deg;\r\n color: var(--_mono-accordion-arrow-open-color);\r\n}\r\n\r\n/* =========================================\r\n Body — `details > :not(summary)`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/accordion.css .accordion > details > :not(summary) — overflow-hidden */\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > :not(summary) — pt-0 pb-4 text-sm\r\n A <details> collapses for free; a div has to be animated. The\r\n `grid-template-rows: 0fr → 1fr` trick measures the content's natural height\r\n through the grid track and interpolates the row size, with the vertical padding\r\n and the top border collapsing in lockstep so the entrance feels of-a-piece.\r\n `> * { min-height: 0 }` lets grid items shrink below their intrinsic height when\r\n the row is 0fr — without it the body would refuse to collapse. */\r\n:where([mono-accordion]) > [mono-body] {\r\n display: grid;\r\n grid-template-rows: 0fr;\r\n overflow: hidden;\r\n padding: 0 var(--_mono-accordion-pad-x);\r\n font-size: var(--_mono-accordion-body-font);\r\n line-height: var(--_mono-accordion-body-line-height);\r\n color: var(--_mono-accordion-body-color);\r\n border-top: var(--mono-border-width) solid transparent;\r\n\r\n /* Scope this body's layout/paint work to its own box. Measured effect: neutral on\r\n toggle cost, a modest win on the initial layout of a long list of accordions.\r\n (It is NOT what fixes sibling cost — Chrome already does not re-lay-out sibling\r\n subtrees when one accordion animates; that was measured, not assumed.)\r\n `paint` adds no new clipping — `overflow: hidden` above already clips. `layout`\r\n does make this a containing block + stacking context for absolutely positioned\r\n descendants, which is safe here because that same `overflow: hidden` already\r\n confined them, and mono's own popups are moved to a <body> portal. */\r\n contain: layout paint;\r\n\r\n transition:\r\n grid-template-rows var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-top var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-bottom var(--_mono-accordion-duration) var(--mono-ease),\r\n border-top-color var(--mono-duration) var(--mono-ease);\r\n}\r\n\r\n[mono-accordion] > [mono-body] > * {\r\n min-width: 0;\r\n min-height: 0;\r\n}\r\n\r\n/* Shadow build: the body's native <slot>s (`body` + the default one) default to\r\n `display: contents` and so have no box — slotted content would become the grid\r\n items directly (un-targetable by `> * { min-height: 0 }`) and keep the\r\n `grid-template-rows: 0fr → 1fr` track from ever collapsing. They sit in ONE\r\n `[mono-body-slots]` block, the single grid item (like the light build's\r\n <span data-mono-slot=\"body\">), so the open/close collapse works. A bare `slot`\r\n child is kept for markup that still renders one. */\r\n[mono-accordion] > [mono-body] > :is(slot, [mono-body-slots]) {\r\n display: block;\r\n min-width: 0;\r\n min-height: 0;\r\n}\r\n\r\n/* Standalone, the item IS the frame, so the open body is separated from the head\r\n by a hairline the way a card's footer is — EXTENSION, and the reason the top\r\n padding is not upstream's `pt-0` here. */\r\n[mono-accordion][mono-open] > [mono-body] {\r\n grid-template-rows: 1fr;\r\n padding-top: var(--_mono-accordion-pad-y);\r\n padding-bottom: var(--_mono-accordion-pad-y);\r\n border-top-color: var(--_mono-accordion-border);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .accordion > details > :not(summary) — pt-0.\r\n In a group the head and its body are one run of text between two dividers,\r\n exactly as upstream renders it, so the top gap and the hairline both go. */\r\n:where([mono-accordion-group], .mono-accordion-group) > [mono-accordion][mono-open] > [mono-body],\r\n[mono-accordion][mono-grouped][mono-open] > [mono-body] {\r\n padding-top: 0;\r\n border-top-color: transparent;\r\n}\r\n\r\n/* A collapsed body is still fully rendered — the `0fr` track only hides it — so\r\n without this every closed accordion keeps its whole slotted subtree in the style,\r\n layout and paint trees. `content-visibility: hidden` drops it entirely.\r\n\r\n What this buys, measured with ~320-node bodies (Chromium, median of 3):\r\n initial layout, 40 panels: 157ms → 18ms, and flat in the panel count\r\n (5 panels: 52ms → 23ms). That is the cost of putting a long list of heavy\r\n accordions on screen at all — e.g. opening a modal that builds N entry forms.\r\n What it does NOT buy: a cheaper toggle. Skipping the subtree means an opening\r\n panel is laid out from scratch, so one open+close costs slightly MORE\r\n (23ms → 31ms at 40 panels). The toggle's real cost is the animation above —\r\n see `--mono-accordion-duration`.\r\n\r\n `allow-discrete` is what makes it safe to animate. Opening flips the property to\r\n `visible` at 0%, so the grid can still measure the content it is expanding to;\r\n closing holds it `visible` until 100%, so the collapse plays out before the content\r\n is dropped. Get that backwards and a closing body vanishes instantly instead of\r\n collapsing.\r\n\r\n Gated behind @supports deliberately. `content-visibility … allow-discrete` inside\r\n the `transition` SHORTHAND is a parse error to a browser without the feature, and a\r\n single bad entry drops the WHOLE declaration — which would take every accordion\r\n transition with it. Inside the guard the shorthand is known to parse, so the list is\r\n restated in full rather than patched with the `transition-behavior` longhand.\r\n Browsers without support keep exactly the previous behaviour.\r\n\r\n Must stay ABOVE the reduced-motion block: @supports adds no specificity, so source\r\n order is the only thing keeping `transition: none` the winner down there. */\r\n@supports (transition-behavior: allow-discrete) {\r\n :where([mono-accordion]) > [mono-body] {\r\n content-visibility: hidden;\r\n /* Must stay `0`, NOT `auto 0`. `content-visibility: hidden` skips this element's\r\n own contents, so its size comes from HERE — and the `auto` keyword's remembered\r\n size is the panel's last OPEN height, which leaves a closed accordion holding\r\n full height with nothing in it. Tried, measured, reverted: a closed body read\r\n 656px instead of collapsing. The scrollbar-stability that `auto` normally buys\r\n does not apply to an element that is itself the skipped one. */\r\n contain-intrinsic-size: 0;\r\n transition:\r\n grid-template-rows var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-top var(--_mono-accordion-duration) var(--mono-ease),\r\n padding-bottom var(--_mono-accordion-duration) var(--mono-ease),\r\n border-top-color var(--mono-duration) var(--mono-ease),\r\n content-visibility var(--_mono-accordion-duration) allow-discrete;\r\n }\r\n\r\n [mono-accordion][mono-open] > [mono-body] {\r\n content-visibility: visible;\r\n }\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n [mono-accordion],\r\n [mono-accordion] > [mono-head],\r\n [mono-accordion] > [mono-head] > [mono-arrow],\r\n [mono-accordion] > [mono-body] {\r\n transition: none;\r\n }\r\n}\r\n";
270
283
 
271
284
  //#endregion
272
285
  //#region src/components/accordion/mono-accordion.ts
@@ -329,7 +342,7 @@ let MonoAccordion = class MonoAccordion extends MonoAccordionCore(LitElement) {
329
342
  if (!this._hasIconContent || this._hasHeaderSlotState) return nothing;
330
343
  return html`
331
344
  <span class=${this._cls("mono-accordion-icon", "icon")} mono-glyph aria-hidden="true">
332
- <span data-mono-slot="icon"></span>
345
+ ${this._hasIconSlotState ? html`<span data-mono-slot="icon"></span>` : this._renderIconGlyph()}
333
346
  </span>
334
347
  `;
335
348
  }
package/dist/ui/alert.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as customElement } from "../mono-element-C7vCschg.js";
2
2
  import { a as defineHybridPropAliases, i as defineHybridPropAlias, r as booleanStringConverter, t as __decorate } from "../decorate-DbYFpi8R.js";
3
- import { a as parkDetachedNodes, n as bucketHasContent, o as placeLightSlots, r as captureLightSlots } from "../light-slots-DdDdZ6zs.js";
4
3
  import { t as isIconifyClass } from "../icon-ClxnYhBG.js";
5
- import { r as closeIcon } from "../field-icons-FmyBWa0g.js";
4
+ import { a as parkDetachedNodes, n as bucketHasContent, o as placeLightSlots, r as captureLightSlots } from "../light-slots-DdDdZ6zs.js";
5
+ import { a as closeIcon } from "../field-icons-t8rXRCKs.js";
6
6
  import { LitElement, html, nothing, unsafeCSS } from "lit";
7
7
  import { property, state } from "lit/decorators.js";
8
8
 
@@ -2,8 +2,8 @@ import { l as monoHostChildNodes } from "../mono-ui-BwUc0L6B.js";
2
2
  import { t as customElement } from "../mono-element-C7vCschg.js";
3
3
  import { a as defineHybridPropAliases, n as arrayHasChanged, r as booleanStringConverter, t as __decorate } from "../decorate-DbYFpi8R.js";
4
4
  import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
5
- import { a as parkDetachedNodes, s as placeSlotNode } from "../light-slots-DdDdZ6zs.js";
6
5
  import { t as isIconifyClass } from "../icon-ClxnYhBG.js";
6
+ import { a as parkDetachedNodes, s as placeSlotNode } from "../light-slots-DdDdZ6zs.js";
7
7
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
8
8
  import { property, state } from "lit/decorators.js";
9
9
 
@@ -4,7 +4,7 @@ import { a as defineHybridPropAliases, o as numberStringConverter, r as booleanS
4
4
  import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
5
5
  import { a as rateLimitHasChanged } from "../rate-limit-e9Jlpl5l.js";
6
6
  import { n as button_css_raw_default } from "../mono-button-CeDB9khW.js";
7
- import { t as PopupPortalController } from "../popup-portal-HWhkd7oy.js";
7
+ import { t as PopupPortalController } from "../popup-portal-C8ttHDRX.js";
8
8
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
9
9
  import { ref } from "lit/directives/ref.js";
10
10
  import { property, state } from "lit/decorators.js";
package/dist/ui/chart.js CHANGED
@@ -6,7 +6,7 @@ import { t as customElement } from "../mono-element-C7vCschg.js";
6
6
  import { a as defineHybridPropAliases, i as defineHybridPropAlias, o as numberStringConverter, r as booleanStringConverter, t as __decorate } from "../decorate-DbYFpi8R.js";
7
7
  import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
8
8
  import { n as toCssSize } from "../css-size-DWAPgQdT.js";
9
- import { a as spinnerIcon, i as refreshIcon } from "../field-icons-FmyBWa0g.js";
9
+ import { c as spinnerIcon, s as refreshIcon } from "../field-icons-t8rXRCKs.js";
10
10
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
11
11
  import { property, query, state } from "lit/decorators.js";
12
12
  import { styleMap } from "lit/directives/style-map.js";