@stackone/malachite 2.81.1 → 2.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LevelMeter.js","sources":["../../src/components/LevelMeter.tsx"],"sourcesContent":["import type React from 'react';\n\nexport type LevelMeterStep = 'on' | 'partial' | 'off';\n\nexport interface LevelMeterProps {\n /** One bar per step, shortest first. */\n steps: readonly LevelMeterStep[];\n /** Only when it stands alone; beside text naming the level it is decorative. */\n label?: string;\n className?: string;\n}\n\nconst BAR_WIDTH_PX = 4;\nconst FIRST_BAR_PX = 6;\nconst BAR_RISE_PX = 3;\n\nconst ON = 'var(--malachite-accent-foreground, rgb(2, 122, 66))';\nconst PARTIAL_FILL = 'var(--malachite-accent-background-glass, rgba(0, 175, 102, 0.08))';\nconst OFF_OUTLINE = 'var(--malachite-text-secondary, rgb(123, 123, 123))';\n\nconst STEP_STYLES: Record<LevelMeterStep, React.CSSProperties> = {\n on: { background: ON, borderColor: ON },\n partial: { background: PARTIAL_FILL, borderColor: ON },\n off: { background: 'transparent', borderColor: OFF_OUTLINE },\n};\n\n// Inline, not Tailwind: menus portal outside the shadow root's stylesheet.\nexport const LevelMeter: React.FC<LevelMeterProps> = ({ steps, label, className }) => (\n <span\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={className}\n style={{\n display: 'inline-flex',\n flexShrink: 0,\n alignItems: 'flex-end',\n gap: 2,\n height: FIRST_BAR_PX + BAR_RISE_PX * Math.max(steps.length - 1, 0),\n }}\n >\n {steps.map((step, index) => (\n <span\n key={index}\n data-step={step}\n style={{\n width: BAR_WIDTH_PX,\n height: FIRST_BAR_PX + BAR_RISE_PX * index,\n borderRadius: 1,\n boxSizing: 'border-box',\n borderWidth: 1,\n borderStyle: 'solid',\n ...STEP_STYLES[step],\n }}\n />\n ))}\n </span>\n);\n\nexport default LevelMeter;\n"],"names":["BAR_WIDTH_PX","FIRST_BAR_PX","BAR_RISE_PX","ON","PARTIAL_FILL","OFF_OUTLINE","STEP_STYLES","LevelMeter","steps","label","className","jsx","step","index"],"mappings":";AAYA,MAAMA,IAAe,GACfC,IAAe,GACfC,IAAc,GAEdC,IAAK,uDACLC,IAAe,qEACfC,IAAc,uDAEdC,IAA2D;AAAA,EAC7D,IAAI,EAAE,YAAYH,GAAI,aAAaA,EAAA;AAAA,EACnC,SAAS,EAAE,YAAYC,GAAc,aAAaD,EAAA;AAAA,EAClD,KAAK,EAAE,YAAY,eAAe,aAAaE,EAAA;AACnD,GAGaE,IAAwC,CAAC,EAAE,OAAAC,GAAO,OAAAC,GAAO,WAAAC,QAClE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,MAAMF,IAAQ,QAAQ;AAAA,IACtB,cAAYA;AAAA,IACZ,eAAaA,IAAQ,SAAY;AAAA,IACjC,WAAAC;AAAA,IACA,OAAO;AAAA,MACH,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,KAAK;AAAA,MACL,QAAQT,IAAeC,IAAc,KAAK,IAAIM,EAAM,SAAS,GAAG,CAAC;AAAA,IAAA;AAAA,IAGpE,UAAAA,EAAM,IAAI,CAACI,GAAMC,MACd,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QAEG,aAAWC;AAAA,QACX,OAAO;AAAA,UACH,OAAOZ;AAAA,UACP,QAAQC,IAAeC,IAAcW;AAAA,UACrC,cAAc;AAAA,UACd,WAAW;AAAA,UACX,aAAa;AAAA,UACb,aAAa;AAAA,UACb,GAAGP,EAAYM,CAAI;AAAA,QAAA;AAAA,MACvB;AAAA,MAVKC;AAAA,IAAA,CAYZ;AAAA,EAAA;AACL;"}
@@ -1,137 +1,135 @@
1
- import { jsx as n, jsxs as u, Fragment as v } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as u, Fragment as v } from "react/jsx-runtime";
2
2
  import { forwardRef as x, useContext as f, useRef as h, useLayoutEffect as b } from "react";
3
3
  import { Button as g } from "./Button.js";
4
- import T from "./Tooltip.js";
5
- import { BORDER as c, NO_SCROLLBAR as N } from "./chromeStyles.js";
6
- import { FOCUS_RING_INSET as y } from "./focusRing.js";
7
- import { isPlainClick as S } from "./linkClick.js";
8
- import { PopoverShownContext as w } from "./popoverTree.js";
9
- import { safeHref as R } from "./safeHref.js";
10
- const F = ({ title: e, action: r, divider: t = !0 }) => /* @__PURE__ */ u(
4
+ import N from "./Tooltip.js";
5
+ import { BORDER as l, NO_SCROLLBAR as y } from "./chromeStyles.js";
6
+ import { FOCUS_RING_INSET as S } from "./focusRing.js";
7
+ import { isPlainClick as w } from "./linkClick.js";
8
+ import { PopoverShownContext as E } from "./popoverTree.js";
9
+ import { safeHref as P } from "./safeHref.js";
10
+ import { scrollRowIntoList as R } from "./scrollRowIntoList.js";
11
+ const M = ({ title: e, action: t, divider: r = !0 }) => /* @__PURE__ */ u(
11
12
  "div",
12
13
  {
13
- className: `flex items-center justify-between border-0 ${t ? `border-b border-solid ${c} px-5 py-4` : "px-5 pt-4 pb-[4px]"} text-[12px] leading-[15px] font-normal text-[var(--malachite-text-dimmed,rgb(161,161,161))]`,
14
+ className: `flex items-center justify-between border-0 ${r ? `border-b border-solid ${l} px-5 py-4` : "px-5 pt-4 pb-[4px]"} text-[12px] leading-[15px] font-normal text-[var(--malachite-text-dimmed,rgb(161,161,161))]`,
14
15
  children: [
15
- /* @__PURE__ */ n("span", { children: e }),
16
- r
16
+ /* @__PURE__ */ o("span", { children: e }),
17
+ t
17
18
  ]
18
19
  }
19
- ), E = '[aria-current]:not([aria-current="false"]):not([aria-current=""]), [aria-selected="true"], [role="radio"][aria-checked="true"]', P = ["aria-current", "aria-selected", "aria-checked"], m = (e) => {
20
- const r = e.querySelector(E);
21
- if (!r)
22
- return !1;
23
- const t = e.getBoundingClientRect().top + e.clientTop, { top: l, bottom: o } = r.getBoundingClientRect(), a = l - t + e.scrollTop, i = o - t + e.scrollTop;
24
- return a < e.scrollTop ? e.scrollTop = a : i > e.scrollTop + e.clientHeight && (e.scrollTop = i - e.clientHeight), !0;
25
- }, U = ({ children: e, scrollToSelected: r = !1 }) => {
26
- const t = f(w), l = h(null);
20
+ ), T = '[aria-current]:not([aria-current="false"]):not([aria-current=""]), [aria-selected="true"], [role="radio"][aria-checked="true"]', C = ["aria-current", "aria-selected", "aria-checked"], m = (e) => {
21
+ const t = e.querySelector(T);
22
+ return t ? (R(e, t), !0) : !1;
23
+ }, q = ({ children: e, scrollToSelected: t = !1 }) => {
24
+ const r = f(E), i = h(null);
27
25
  return b(() => {
28
- const o = l.current;
29
- if (!r || !t || !o || m(o))
26
+ const a = i.current;
27
+ if (!t || !r || !a || m(a))
30
28
  return;
31
- const a = new MutationObserver(() => {
32
- m(o) && a.disconnect();
29
+ const n = new MutationObserver(() => {
30
+ m(a) && n.disconnect();
33
31
  });
34
- return a.observe(o, {
32
+ return n.observe(a, {
35
33
  childList: !0,
36
34
  subtree: !0,
37
35
  attributes: !0,
38
- attributeFilter: P
39
- }), () => a.disconnect();
40
- }, [r, t]), /* @__PURE__ */ n(
36
+ attributeFilter: C
37
+ }), () => n.disconnect();
38
+ }, [t, r]), /* @__PURE__ */ o(
41
39
  "div",
42
40
  {
43
- ref: l,
44
- className: `flex max-h-80 flex-col gap-[2px] overflow-y-auto p-2 ${N}`,
41
+ ref: i,
42
+ className: `flex max-h-80 flex-col gap-[2px] overflow-y-auto p-2 ${y}`,
45
43
  children: e
46
44
  }
47
45
  );
48
- }, C = x(
49
- ({ children: e }, r) => /* @__PURE__ */ n("div", { ref: r, className: `border-0 border-t border-solid ${c} p-2`, children: e })
46
+ }, $ = x(
47
+ ({ children: e }, t) => /* @__PURE__ */ o("div", { ref: t, className: `border-0 border-t border-solid ${l} p-2`, children: e })
50
48
  );
51
- C.displayName = "Popover.Section";
52
- const M = ({ children: e }) => /* @__PURE__ */ n("div", { className: "px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-dimmed,rgb(161,161,161))] select-none", children: e }), q = ({ children: e }) => /* @__PURE__ */ n("div", { className: "px-2 pt-2", children: e }), G = ({ children: e }) => /* @__PURE__ */ n(
49
+ $.displayName = "Popover.Section";
50
+ const G = ({ children: e }) => /* @__PURE__ */ o("div", { className: "px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-dimmed,rgb(161,161,161))] select-none", children: e }), V = ({ children: e }) => /* @__PURE__ */ o("div", { className: "px-2 pt-2", children: e }), W = ({ children: e }) => /* @__PURE__ */ o(
53
51
  "div",
54
52
  {
55
- className: `border-0 border-t border-solid ${c} px-5 py-3 text-[length:var(--malachite-font-size-xsmall,11px)] leading-4 text-[var(--malachite-text-secondary,rgb(123,123,123))]`,
53
+ className: `border-0 border-t border-solid ${l} px-5 py-3 text-[length:var(--malachite-font-size-xsmall,11px)] leading-4 text-[var(--malachite-text-secondary,rgb(123,123,123))]`,
56
54
  children: e
57
55
  }
58
- ), $ = {
56
+ ), O = {
59
57
  default: "text-[var(--malachite-text-secondary,rgb(123,123,123))]",
60
58
  error: "text-[var(--malachite-text-error,rgb(237,53,54))]"
61
- }, O = (e) => e != null && e !== !1 && e !== "", _ = x(
62
- ({ message: e, tone: r = "default", action: t, focusable: l = !1 }, o) => {
63
- const a = O(e);
59
+ }, _ = (e) => e != null && e !== !1 && e !== "", I = x(
60
+ ({ message: e, tone: t = "default", action: r, focusable: i = !1 }, a) => {
61
+ const n = _(e);
64
62
  return /* @__PURE__ */ u(v, { children: [
65
- /* @__PURE__ */ n(
63
+ /* @__PURE__ */ o(
66
64
  "div",
67
65
  {
68
- ref: o,
66
+ ref: a,
69
67
  role: "status",
70
- tabIndex: l ? -1 : void 0,
71
- className: a ? "outline-none" : "sr-only",
72
- children: a && /* @__PURE__ */ n(
68
+ tabIndex: i ? -1 : void 0,
69
+ className: n ? "outline-none" : "sr-only",
70
+ children: n && /* @__PURE__ */ o(
73
71
  "div",
74
72
  {
75
- className: `px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] ${$[r]}`,
73
+ className: `px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] ${O[t]}`,
76
74
  children: e
77
75
  }
78
76
  )
79
77
  }
80
78
  ),
81
- a && t && /* @__PURE__ */ n("div", { className: "px-3 pb-2", children: /* @__PURE__ */ n(
79
+ n && r && /* @__PURE__ */ o("div", { className: "px-3 pb-2", children: /* @__PURE__ */ o(
82
80
  g,
83
81
  {
84
82
  variant: "outline",
85
83
  size: "small",
86
- loading: t.pending,
87
- onClick: t.onClick,
88
- children: t.label
84
+ loading: r.pending,
85
+ onClick: r.onClick,
86
+ children: r.label
89
87
  }
90
88
  ) })
91
89
  ] });
92
90
  }
93
91
  );
94
- _.displayName = "Popover.Status";
95
- const V = ({
92
+ I.displayName = "Popover.Status";
93
+ const X = ({
96
94
  icon: e,
97
- "aria-label": r,
98
- onClick: t,
99
- href: l,
100
- disabled: o = !1,
101
- tooltip: a
95
+ "aria-label": t,
96
+ onClick: r,
97
+ href: i,
98
+ disabled: a = !1,
99
+ tooltip: n
102
100
  }) => {
103
- const i = o ? void 0 : R(l), s = `m-0 inline-flex size-5 items-center justify-center rounded-[var(--malachite-radius-sm,4px)] border-0 bg-transparent p-0 transition-colors duration-150 [&_svg]:size-3! ${o ? "cursor-not-allowed text-[var(--malachite-text-placeholder,rgb(187,187,187))] opacity-50" : "cursor-pointer text-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] hover:text-[var(--malachite-text-secondary,rgb(123,123,123))]"} ${y}`, p = i !== void 0 ? /* @__PURE__ */ n(
101
+ const s = a ? void 0 : P(i), c = `m-0 inline-flex size-5 items-center justify-center rounded-[var(--malachite-radius-sm,4px)] border-0 bg-transparent p-0 transition-colors duration-150 [&_svg]:size-3! ${a ? "cursor-not-allowed text-[var(--malachite-text-placeholder,rgb(187,187,187))] opacity-50" : "cursor-pointer text-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] hover:text-[var(--malachite-text-secondary,rgb(123,123,123))]"} ${S}`, d = s !== void 0 ? /* @__PURE__ */ o(
104
102
  "a",
105
103
  {
106
- href: i,
107
- "aria-label": r,
108
- onClick: (d) => {
109
- S(d) && t && (d.preventDefault(), t());
104
+ href: s,
105
+ "aria-label": t,
106
+ onClick: (p) => {
107
+ w(p) && r && (p.preventDefault(), r());
110
108
  },
111
- className: `no-underline ${s}`,
109
+ className: `no-underline ${c}`,
112
110
  children: e
113
111
  }
114
- ) : /* @__PURE__ */ n(
112
+ ) : /* @__PURE__ */ o(
115
113
  "button",
116
114
  {
117
115
  type: "button",
118
- "aria-label": r,
119
- "aria-disabled": o || void 0,
120
- onClick: o ? void 0 : t,
121
- className: s,
116
+ "aria-label": t,
117
+ "aria-disabled": a || void 0,
118
+ onClick: a ? void 0 : r,
119
+ className: c,
122
120
  children: e
123
121
  }
124
122
  );
125
- return a ? /* @__PURE__ */ n(T, { text: a, children: p }) : p;
123
+ return n ? /* @__PURE__ */ o(N, { text: n, children: d }) : d;
126
124
  };
127
125
  export {
128
- V as PopoverAction,
129
- M as PopoverEmpty,
130
- F as PopoverHeader,
131
- U as PopoverList,
132
- G as PopoverNote,
133
- q as PopoverSearch,
134
- C as PopoverSection,
135
- _ as PopoverStatus
126
+ X as PopoverAction,
127
+ G as PopoverEmpty,
128
+ M as PopoverHeader,
129
+ q as PopoverList,
130
+ W as PopoverNote,
131
+ V as PopoverSearch,
132
+ $ as PopoverSection,
133
+ I as PopoverStatus
136
134
  };
137
135
  //# sourceMappingURL=PopoverParts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverParts.js","sources":["../../src/components/PopoverParts.tsx"],"sourcesContent":["import React, { forwardRef, useContext, useLayoutEffect, useRef } from 'react';\nimport Button from './Button';\nimport Tooltip from './Tooltip';\nimport { BORDER, NO_SCROLLBAR } from './chromeStyles';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { isPlainClick } from './linkClick';\nimport { PopoverShownContext } from './popoverTree';\nimport { safeHref } from './safeHref';\n\nexport interface PopoverHeaderProps {\n title: string;\n action?: React.ReactNode;\n /** `false` drops the rule and sits the header 4px over the list. */\n divider?: boolean;\n}\n\nexport const PopoverHeader: React.FC<PopoverHeaderProps> = ({ title, action, divider = true }) => (\n <div\n className={`flex items-center justify-between border-0 ${divider ? `border-b border-solid ${BORDER} px-5 py-4` : 'px-5 pt-4 pb-[4px]'} text-[12px] leading-[15px] font-normal text-[var(--malachite-text-dimmed,rgb(161,161,161))]`}\n >\n <span>{title}</span>\n {action}\n </div>\n);\n\nconst SELECTED_ROW =\n '[aria-current]:not([aria-current=\"false\"]):not([aria-current=\"\"]), [aria-selected=\"true\"], [role=\"radio\"][aria-checked=\"true\"]';\nconst SELECTION_ATTRIBUTES = ['aria-current', 'aria-selected', 'aria-checked'];\n\n// Not `scrollIntoView`: that also scrolls every scrollable ancestor, the page included.\nconst scrollSelectedRowIntoView = (list: HTMLElement): boolean => {\n const row = list.querySelector<HTMLElement>(SELECTED_ROW);\n if (!row) {\n return false;\n }\n const listTop = list.getBoundingClientRect().top + list.clientTop;\n const { top, bottom } = row.getBoundingClientRect();\n const rowTop = top - listTop + list.scrollTop;\n const rowBottom = bottom - listTop + list.scrollTop;\n if (rowTop < list.scrollTop) {\n list.scrollTop = rowTop;\n } else if (rowBottom > list.scrollTop + list.clientHeight) {\n list.scrollTop = rowBottom - list.clientHeight;\n }\n return true;\n};\n\nexport interface PopoverListProps {\n children: React.ReactNode;\n /**\n * Scrolls the list to its selected row (`aria-current`, `aria-selected` or a checked radio)\n * each time the popover is shown, once that row mounts. Only the list scrolls.\n */\n scrollToSelected?: boolean;\n}\n\nexport const PopoverList: React.FC<PopoverListProps> = ({ children, scrollToSelected = false }) => {\n const shown = useContext(PopoverShownContext);\n const listRef = useRef<HTMLDivElement>(null);\n\n // Before paint, so a shown panel never draws a frame at the top and then jumps.\n useLayoutEffect(() => {\n const list = listRef.current;\n if (!scrollToSelected || !shown || !list || scrollSelectedRowIntoView(list)) {\n return;\n }\n const observer = new MutationObserver(() => {\n if (scrollSelectedRowIntoView(list)) {\n observer.disconnect();\n }\n });\n observer.observe(list, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: SELECTION_ATTRIBUTES,\n });\n return () => observer.disconnect();\n }, [scrollToSelected, shown]);\n\n return (\n <div\n ref={listRef}\n className={`flex max-h-80 flex-col gap-[2px] overflow-y-auto p-2 ${NO_SCROLLBAR}`}\n >\n {children}\n </div>\n );\n};\n\nexport const PopoverSection = forwardRef<HTMLDivElement, { children: React.ReactNode }>(\n ({ children }, ref) => (\n <div ref={ref} className={`border-0 border-t border-solid ${BORDER} p-2`}>\n {children}\n </div>\n ),\n);\nPopoverSection.displayName = 'Popover.Section';\n\nexport const PopoverEmpty: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-dimmed,rgb(161,161,161))] select-none\">\n {children}\n </div>\n);\n\nexport const PopoverSearch: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"px-2 pt-2\">{children}</div>\n);\n\nexport const PopoverNote: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div\n className={`border-0 border-t border-solid ${BORDER} px-5 py-3 text-[length:var(--malachite-font-size-xsmall,11px)] leading-4 text-[var(--malachite-text-secondary,rgb(123,123,123))]`}\n >\n {children}\n </div>\n);\n\nexport type PopoverStatusTone = 'default' | 'error';\n\nexport interface PopoverStatusAction {\n label: string;\n onClick: () => void;\n /** Shows the button's spinner and ignores clicks, e.g. while a retry is in flight. */\n pending?: boolean;\n}\n\nexport interface PopoverStatusProps {\n /**\n * What the panel is waiting on, or why it is empty. Clear it rather than unmount the part:\n * only a region already in the tree announces a new message.\n */\n message?: React.ReactNode;\n tone?: PopoverStatusTone;\n /** A button under the message that resolves it, such as Retry. Shown only with a message. */\n action?: PopoverStatusAction;\n /** Lets the region take focus from script (`tabIndex={-1}`), e.g. from `initialFocus`. */\n focusable?: boolean;\n}\n\nconst STATUS_TONE_TEXT: Record<PopoverStatusTone, string> = {\n default: 'text-[var(--malachite-text-secondary,rgb(123,123,123))]',\n error: 'text-[var(--malachite-text-error,rgb(237,53,54))]',\n};\n\nconst hasMessage = (message: React.ReactNode): boolean =>\n message !== undefined && message !== null && message !== false && message !== '';\n\nexport const PopoverStatus = forwardRef<HTMLDivElement, PopoverStatusProps>(\n ({ message, tone = 'default', action, focusable = false }, ref) => {\n const shown = hasMessage(message);\n return (\n <>\n {/* Stays `status` while empty and for errors: a role or aria-hidden changed with the\n text is not reliably announced. No ring: a focus target, not a control. */}\n <div\n ref={ref}\n role=\"status\"\n tabIndex={focusable ? -1 : undefined}\n className={shown ? 'outline-none' : 'sr-only'}\n >\n {shown && (\n <div\n className={`px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] ${STATUS_TONE_TEXT[tone]}`}\n >\n {message}\n </div>\n )}\n </div>\n {shown && action && (\n <div className=\"px-3 pb-2\">\n <Button\n variant=\"outline\"\n size=\"small\"\n loading={action.pending}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </div>\n )}\n </>\n );\n },\n);\nPopoverStatus.displayName = 'Popover.Status';\n\nexport interface PopoverActionProps {\n icon: React.ReactNode;\n 'aria-label': string;\n onClick?: () => void;\n /** Renders a link; a plain click runs `onClick` instead of following it, when one is given. */\n href?: string;\n disabled?: boolean;\n tooltip?: string;\n}\n\nexport const PopoverAction: React.FC<PopoverActionProps> = ({\n icon,\n 'aria-label': ariaLabel,\n onClick,\n href: rawHref,\n disabled = false,\n tooltip,\n}) => {\n const href = disabled ? undefined : safeHref(rawHref);\n const className = `m-0 inline-flex size-5 items-center justify-center rounded-[var(--malachite-radius-sm,4px)] border-0 bg-transparent p-0 transition-colors duration-150 [&_svg]:size-3! ${disabled ? 'cursor-not-allowed text-[var(--malachite-text-placeholder,rgb(187,187,187))] opacity-50' : `cursor-pointer text-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] hover:text-[var(--malachite-text-secondary,rgb(123,123,123))]`} ${FOCUS_RING_INSET}`;\n const button =\n href !== undefined ? (\n <a\n href={href}\n aria-label={ariaLabel}\n onClick={(event) => {\n if (isPlainClick(event) && onClick) {\n event.preventDefault();\n onClick();\n }\n }}\n className={`no-underline ${className}`}\n >\n {icon}\n </a>\n ) : (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n aria-disabled={disabled || undefined}\n onClick={disabled ? undefined : onClick}\n className={className}\n >\n {icon}\n </button>\n );\n return tooltip ? <Tooltip text={tooltip}>{button}</Tooltip> : button;\n};\n"],"names":["PopoverHeader","title","action","divider","jsxs","BORDER","jsx","SELECTED_ROW","SELECTION_ATTRIBUTES","scrollSelectedRowIntoView","list","row","listTop","top","bottom","rowTop","rowBottom","PopoverList","children","scrollToSelected","shown","useContext","PopoverShownContext","listRef","useRef","useLayoutEffect","observer","NO_SCROLLBAR","PopoverSection","forwardRef","ref","PopoverEmpty","PopoverSearch","PopoverNote","STATUS_TONE_TEXT","hasMessage","message","PopoverStatus","tone","focusable","Fragment","Button","PopoverAction","icon","ariaLabel","onClick","rawHref","disabled","tooltip","href","safeHref","className","FOCUS_RING_INSET","button","event","isPlainClick","Tooltip"],"mappings":";;;;;;;;;AAgBO,MAAMA,IAA8C,CAAC,EAAE,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,IAAU,SACnF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,8CAA8CD,IAAU,yBAAyBE,CAAM,eAAe,oBAAoB;AAAA,IAErI,UAAA;AAAA,MAAA,gBAAAC,EAAC,UAAM,UAAAL,EAAA,CAAM;AAAA,MACZC;AAAA,IAAA;AAAA,EAAA;AACL,GAGEK,IACF,kIACEC,IAAuB,CAAC,gBAAgB,iBAAiB,cAAc,GAGvEC,IAA4B,CAACC,MAA+B;AAC9D,QAAMC,I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ACZ,CACJ;AAAA,IAAA,GAER;AAAA,EAER;AACJ;AACAmC,EAAc,cAAc;AAYrB,MAAMK,IAA8C,CAAC;AAAA,EACxD,MAAAC;AAAA,EACA,cAAcC;AAAA,EACd,SAAAC;AAAA,EACA,MAAMC;AAAA,EACN,UAAAC,IAAW;AAAA,EACX,SAAAC;AACJ,MAAM;AACF,QAAMC,IAAOF,IAAW,SAAYG,EAASJ,CAAO,GAC9CK,IAAY,0KAA0KJ,IAAW,4FAA4F,2MAA2M,IAAIK,CAAgB,IAC5fC,IACFJ,MAAS,SACL,gBAAA3C;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAA2C;AAAA,MACA,cAAYL;AAAA,MACZ,SAAS,CAACU,MAAU;AAChB,QAAIC,EAAaD,CAAK,KAAKT,MACvBS,EAAM,eAAA,GACNT,EAAA;AAAA,MAER;AAAA,MACA,WAAW,gBAAgBM,CAAS;AAAA,MAEnC,UAAAR;AAAA,IAAA;AAAA,EAAA,IAGL,gBAAArC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAK;AAAA,MACL,cAAYsC;AAAA,MACZ,iBAAeG,KAAY;AAAA,MAC3B,SAASA,IAAW,SAAYF;AAAA,MAChC,WAAAM;AAAA,MAEC,UAAAR;AAAA,IAAA;AAAA,EAAA;AAGb,SAAOK,IAAU,gBAAA1C,EAACkD,GAAA,EAAQ,MAAMR,GAAU,aAAO,IAAaK;AAClE;"}
1
+ {"version":3,"file":"PopoverParts.js","sources":["../../src/components/PopoverParts.tsx"],"sourcesContent":["import React, { forwardRef, useContext, useLayoutEffect, useRef } from 'react';\nimport Button from './Button';\nimport Tooltip from './Tooltip';\nimport { BORDER, NO_SCROLLBAR } from './chromeStyles';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { isPlainClick } from './linkClick';\nimport { PopoverShownContext } from './popoverTree';\nimport { safeHref } from './safeHref';\nimport { scrollRowIntoList } from './scrollRowIntoList';\n\nexport interface PopoverHeaderProps {\n title: string;\n action?: React.ReactNode;\n /** `false` drops the rule and sits the header 4px over the list. */\n divider?: boolean;\n}\n\nexport const PopoverHeader: React.FC<PopoverHeaderProps> = ({ title, action, divider = true }) => (\n <div\n className={`flex items-center justify-between border-0 ${divider ? `border-b border-solid ${BORDER} px-5 py-4` : 'px-5 pt-4 pb-[4px]'} text-[12px] leading-[15px] font-normal text-[var(--malachite-text-dimmed,rgb(161,161,161))]`}\n >\n <span>{title}</span>\n {action}\n </div>\n);\n\nconst SELECTED_ROW =\n '[aria-current]:not([aria-current=\"false\"]):not([aria-current=\"\"]), [aria-selected=\"true\"], [role=\"radio\"][aria-checked=\"true\"]';\nconst SELECTION_ATTRIBUTES = ['aria-current', 'aria-selected', 'aria-checked'];\n\n// Not `scrollIntoView`: that also scrolls every scrollable ancestor, the page included.\nconst scrollSelectedRowIntoView = (list: HTMLElement): boolean => {\n const row = list.querySelector<HTMLElement>(SELECTED_ROW);\n if (!row) {\n return false;\n }\n scrollRowIntoList(list, row);\n return true;\n};\n\nexport interface PopoverListProps {\n children: React.ReactNode;\n /**\n * Scrolls the list to its selected row (`aria-current`, `aria-selected` or a checked radio)\n * each time the popover is shown, once that row mounts. Only the list scrolls.\n */\n scrollToSelected?: boolean;\n}\n\nexport const PopoverList: React.FC<PopoverListProps> = ({ children, scrollToSelected = false }) => {\n const shown = useContext(PopoverShownContext);\n const listRef = useRef<HTMLDivElement>(null);\n\n // Before paint, so a shown panel never draws a frame at the top and then jumps.\n useLayoutEffect(() => {\n const list = listRef.current;\n if (!scrollToSelected || !shown || !list || scrollSelectedRowIntoView(list)) {\n return;\n }\n const observer = new MutationObserver(() => {\n if (scrollSelectedRowIntoView(list)) {\n observer.disconnect();\n }\n });\n observer.observe(list, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: SELECTION_ATTRIBUTES,\n });\n return () => observer.disconnect();\n }, [scrollToSelected, shown]);\n\n return (\n <div\n ref={listRef}\n className={`flex max-h-80 flex-col gap-[2px] overflow-y-auto p-2 ${NO_SCROLLBAR}`}\n >\n {children}\n </div>\n );\n};\n\nexport const PopoverSection = forwardRef<HTMLDivElement, { children: React.ReactNode }>(\n ({ children }, ref) => (\n <div ref={ref} className={`border-0 border-t border-solid ${BORDER} p-2`}>\n {children}\n </div>\n ),\n);\nPopoverSection.displayName = 'Popover.Section';\n\nexport const PopoverEmpty: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] text-[var(--malachite-text-dimmed,rgb(161,161,161))] select-none\">\n {children}\n </div>\n);\n\nexport const PopoverSearch: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div className=\"px-2 pt-2\">{children}</div>\n);\n\nexport const PopoverNote: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <div\n className={`border-0 border-t border-solid ${BORDER} px-5 py-3 text-[length:var(--malachite-font-size-xsmall,11px)] leading-4 text-[var(--malachite-text-secondary,rgb(123,123,123))]`}\n >\n {children}\n </div>\n);\n\nexport type PopoverStatusTone = 'default' | 'error';\n\nexport interface PopoverStatusAction {\n label: string;\n onClick: () => void;\n /** Shows the button's spinner and ignores clicks, e.g. while a retry is in flight. */\n pending?: boolean;\n}\n\nexport interface PopoverStatusProps {\n /**\n * What the panel is waiting on, or why it is empty. Clear it rather than unmount the part:\n * only a region already in the tree announces a new message.\n */\n message?: React.ReactNode;\n tone?: PopoverStatusTone;\n /** A button under the message that resolves it, such as Retry. Shown only with a message. */\n action?: PopoverStatusAction;\n /** Lets the region take focus from script (`tabIndex={-1}`), e.g. from `initialFocus`. */\n focusable?: boolean;\n}\n\nconst STATUS_TONE_TEXT: Record<PopoverStatusTone, string> = {\n default: 'text-[var(--malachite-text-secondary,rgb(123,123,123))]',\n error: 'text-[var(--malachite-text-error,rgb(237,53,54))]',\n};\n\nconst hasMessage = (message: React.ReactNode): boolean =>\n message !== undefined && message !== null && message !== false && message !== '';\n\nexport const PopoverStatus = forwardRef<HTMLDivElement, PopoverStatusProps>(\n ({ message, tone = 'default', action, focusable = false }, ref) => {\n const shown = hasMessage(message);\n return (\n <>\n {/* Stays `status` while empty and for errors: a role or aria-hidden changed with the\n text is not reliably announced. No ring: a focus target, not a control. */}\n <div\n ref={ref}\n role=\"status\"\n tabIndex={focusable ? -1 : undefined}\n className={shown ? 'outline-none' : 'sr-only'}\n >\n {shown && (\n <div\n className={`px-3 py-2 text-[length:var(--malachite-font-size-small,13px)] ${STATUS_TONE_TEXT[tone]}`}\n >\n {message}\n </div>\n )}\n </div>\n {shown && action && (\n <div className=\"px-3 pb-2\">\n <Button\n variant=\"outline\"\n size=\"small\"\n loading={action.pending}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </div>\n )}\n </>\n );\n },\n);\nPopoverStatus.displayName = 'Popover.Status';\n\nexport interface PopoverActionProps {\n icon: React.ReactNode;\n 'aria-label': string;\n onClick?: () => void;\n /** Renders a link; a plain click runs `onClick` instead of following it, when one is given. */\n href?: string;\n disabled?: boolean;\n tooltip?: string;\n}\n\nexport const PopoverAction: React.FC<PopoverActionProps> = ({\n icon,\n 'aria-label': ariaLabel,\n onClick,\n href: rawHref,\n disabled = false,\n tooltip,\n}) => {\n const href = disabled ? undefined : safeHref(rawHref);\n const className = `m-0 inline-flex size-5 items-center justify-center rounded-[var(--malachite-radius-sm,4px)] border-0 bg-transparent p-0 transition-colors duration-150 [&_svg]:size-3! ${disabled ? 'cursor-not-allowed text-[var(--malachite-text-placeholder,rgb(187,187,187))] opacity-50' : `cursor-pointer text-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:bg-[var(--malachite-pillbutton-background,rgb(241,241,241))] hover:text-[var(--malachite-text-secondary,rgb(123,123,123))]`} ${FOCUS_RING_INSET}`;\n const button =\n href !== undefined ? (\n <a\n href={href}\n aria-label={ariaLabel}\n onClick={(event) => {\n if (isPlainClick(event) && onClick) {\n event.preventDefault();\n onClick();\n }\n }}\n className={`no-underline ${className}`}\n >\n {icon}\n </a>\n ) : (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n aria-disabled={disabled || undefined}\n onClick={disabled ? undefined : onClick}\n className={className}\n >\n {icon}\n </button>\n );\n return tooltip ? <Tooltip text={tooltip}>{button}</Tooltip> : button;\n};\n"],"names":["PopoverHeader","title","action","divider","jsxs","BORDER","jsx","SELECTED_ROW","SELECTION_ATTRIBUTES","scrollSelectedRowIntoView","list","row","scrollRowIntoList","PopoverList","children","scrollToSelected","shown","useContext","PopoverShownContext","listRef","useRef","useLayoutEffect","observer","NO_SCROLLBAR","PopoverSection","forwardRef","ref","PopoverEmpty","PopoverSearch","PopoverNote","STATUS_TONE_TEXT","hasMessage","message","PopoverStatus","tone","focusable","Fragment","Button","PopoverAction","icon","ariaLabel","onClick","rawHref","disabled","tooltip","href","safeHref","className","FOCUS_RING_INSET","button","event","isPlainClick","Tooltip"],"mappings":";;;;;;;;;;AAiBO,MAAMA,IAA8C,CAAC,EAAE,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,IAAU,SACnF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,8CAA8CD,IAAU,yBAAyBE,CAAM,eAAe,oBAAoB;AAAA,IAErI,UAAA;AAAA,MAAA,gBAAAC,EAAC,UAAM,UAAAL,EAAA,CAAM;AAAA,MACZC;AAAA,IAAA;AAAA,EAAA;AACL,GAGEK,IACF,kIACEC,IAAuB,CAAC,gBAAgB,iBAAiB,cAAc,GAGvEC,IAA4B,CAACC,MAA+B;AAC9D,QAAMC,IAAMD,EAAK,cAA2BH,CAAY;AACxD,SAAKI,KAGLC,EAAkBF,GAAMC,CAAG,GACpB,MAHI;AAIf,GAWaE,IAA0C,CAAC,EAAE,UAAAC,GAAU,kBAAAC,IAAmB,SAAY;AAC/F,QAAMC,IAAQC,EAAWC,CAAmB,GACtCC,IAAUC,EAAuB,IAAI;AAG3C,SAAAC,EAAgB,MAAM;AAClB,UAAMX,IAAOS,EAAQ;AACrB,QAAI,CAACJ,KAAoB,CAACC,KAAS,CAACN,KAAQD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;AAAA,EAAA,IAGL,gBAAAjC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAK;AAAA,MACL,cAAYkC;AAAA,MACZ,iBAAeG,KAAY;AAAA,MAC3B,SAASA,IAAW,SAAYF;AAAA,MAChC,WAAAM;AAAA,MAEC,UAAAR;AAAA,IAAA;AAAA,EAAA;AAGb,SAAOK,IAAU,gBAAAtC,EAAC8C,GAAA,EAAQ,MAAMR,GAAU,aAAO,IAAaK;AAClE;"}
@@ -1,27 +1,41 @@
1
- const l = (o) => o ? [
2
- ...o.querySelectorAll(
3
- 'button[role="menuitem"]:not(:disabled), a[role="menuitem"]'
4
- )
5
- ] : [], s = (o, t) => {
6
- const n = l(o), r = (t === "last" ? n[n.length - 1] : n[0]) ?? o;
7
- r == null || r.focus({ preventScroll: !0 });
8
- }, c = (o, t) => ({
1
+ import { ITEM_CLASS as l } from "./actionMenuStyles.js";
2
+ import { scrollRowIntoList as n } from "./scrollRowIntoList.js";
3
+ const e = (o) => o ? [...o.querySelectorAll(`.${l}:not(:disabled)`)] : [], i = (o, t) => {
4
+ const r = e(o), c = (t === "last" ? r[r.length - 1] : r[0]) ?? o;
5
+ c == null || c.focus({ preventScroll: !0 });
6
+ }, h = (o, t) => {
7
+ const r = e(o).find((c) => c.getAttribute("aria-checked") === "true");
8
+ if (!r) {
9
+ i(o, t);
10
+ return;
11
+ }
12
+ r.focus({ preventScroll: !0 });
13
+ }, g = (o) => {
14
+ const t = e(o).find((r) => r.getAttribute("aria-checked") === "true");
15
+ o && t && n(o, t);
16
+ }, w = (o, t) => ({
9
17
  ArrowDown: "first",
10
18
  ArrowUp: t.startsWith("top") ? "last" : void 0,
11
19
  ArrowRight: t.startsWith("right") ? "first" : void 0
12
- })[o], g = (o, t, n) => {
13
- const r = o.indexOf(t), e = r === -1 ? o.length : r;
20
+ })[o], A = (o, t, r) => {
21
+ const c = o.indexOf(t), s = c === -1 ? o.length : c;
14
22
  return {
15
- ArrowDown: o[(r + 1) % o.length],
16
- ArrowUp: o[(e - 1 + o.length) % o.length],
23
+ ArrowDown: o[(c + 1) % o.length],
24
+ ArrowUp: o[(s - 1 + o.length) % o.length],
17
25
  Home: o[0],
18
26
  End: o[o.length - 1]
19
- }[n];
27
+ }[r];
28
+ }, a = (o) => {
29
+ const t = o == null ? void 0 : o.querySelector(":focus");
30
+ o && t && n(o, t);
20
31
  };
21
32
  export {
22
- c as edgeForTriggerKey,
23
- l as enabledItems,
24
- s as focusEdge,
25
- g as itemForMenuKey
33
+ w as edgeForTriggerKey,
34
+ e as enabledItems,
35
+ i as focusEdge,
36
+ h as focusOpeningItem,
37
+ A as itemForMenuKey,
38
+ g as scrollCheckedIntoView,
39
+ a as scrollFocusedIntoView
26
40
  };
27
41
  //# sourceMappingURL=actionMenuKeyboard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actionMenuKeyboard.js","sources":["../../src/components/actionMenuKeyboard.ts"],"sourcesContent":["import type { ActionMenuPlacement } from './actionMenuTypes';\n\nexport type MenuEdge = 'first' | 'last';\n\nexport const enabledItems = (menu: HTMLElement | null): HTMLElement[] =>\n menu\n ? [\n ...menu.querySelectorAll<HTMLElement>(\n 'button[role=\"menuitem\"]:not(:disabled), a[role=\"menuitem\"]',\n ),\n ]\n : [];\n\nexport const focusEdge = (menu: HTMLElement | null, edge: MenuEdge): void => {\n const items = enabledItems(menu);\n const target = (edge === 'last' ? items[items.length - 1] : items[0]) ?? menu;\n target?.focus({ preventScroll: true });\n};\n\nexport const edgeForTriggerKey = (\n key: string,\n placement: ActionMenuPlacement,\n): MenuEdge | undefined =>\n ({\n ArrowDown: 'first',\n ArrowUp: placement.startsWith('top') ? 'last' : undefined,\n ArrowRight: placement.startsWith('right') ? 'first' : undefined,\n })[key] as MenuEdge | undefined;\n\nexport const itemForMenuKey = (\n items: HTMLElement[],\n current: EventTarget | null,\n key: string,\n): HTMLElement | undefined => {\n const index = items.indexOf(current as HTMLButtonElement);\n const from = index === -1 ? items.length : index;\n return {\n ArrowDown: items[(index + 1) % items.length],\n ArrowUp: items[(from - 1 + items.length) % items.length],\n Home: items[0],\n End: items[items.length - 1],\n }[key];\n};\n"],"names":["enabledItems","menu","focusEdge","edge","items","target","edgeForTriggerKey","key","placement","itemForMenuKey","current","index","from"],"mappings":"AAIO,MAAMA,IAAe,CAACC,MACzBA,IACM;AAAA,EACI,GAAGA,EAAK;AAAA,IACJ;AAAA,EAAA;AAER,IACA,CAAA,GAEGC,IAAY,CAACD,GAA0BE,MAAyB;AACzE,QAAMC,IAAQJ,EAAaC,CAAI,GACzBI,KAAUF,MAAS,SAASC,EAAMA,EAAM,SAAS,CAAC,IAAIA,EAAM,CAAC,MAAMH;AACzE,EAAAI,KAAA,QAAAA,EAAQ,MAAM,EAAE,eAAe,GAAA;AACnC,GAEaC,IAAoB,CAC7BC,GACAC,OAEC;AAAA,EACG,WAAW;AAAA,EACX,SAASA,EAAU,WAAW,KAAK,IAAI,SAAS;AAAA,EAChD,YAAYA,EAAU,WAAW,OAAO,IAAI,UAAU;AAC1D,GAAGD,CAAG,GAEGE,IAAiB,CAC1BL,GACAM,GACAH,MAC0B;AAC1B,QAAMI,IAAQP,EAAM,QAAQM,CAA4B,GAClDE,IAAOD,MAAU,KAAKP,EAAM,SAASO;AAC3C,SAAO;AAAA,IACH,WAAWP,GAAOO,IAAQ,KAAKP,EAAM,MAAM;AAAA,IAC3C,SAASA,GAAOQ,IAAO,IAAIR,EAAM,UAAUA,EAAM,MAAM;AAAA,IACvD,MAAMA,EAAM,CAAC;AAAA,IACb,KAAKA,EAAMA,EAAM,SAAS,CAAC;AAAA,EAAA,EAC7BG,CAAG;AACT;"}
1
+ {"version":3,"file":"actionMenuKeyboard.js","sources":["../../src/components/actionMenuKeyboard.ts"],"sourcesContent":["import { ITEM_CLASS } from './actionMenuStyles';\nimport type { ActionMenuPlacement } from './actionMenuTypes';\nimport { scrollRowIntoList } from './scrollRowIntoList';\n\nexport type MenuEdge = 'first' | 'last';\n\nexport const enabledItems = (menu: HTMLElement | null): HTMLElement[] =>\n menu ? [...menu.querySelectorAll<HTMLElement>(`.${ITEM_CLASS}:not(:disabled)`)] : [];\n\nexport const focusEdge = (menu: HTMLElement | null, edge: MenuEdge): void => {\n const items = enabledItems(menu);\n const target = (edge === 'last' ? items[items.length - 1] : items[0]) ?? menu;\n target?.focus({ preventScroll: true });\n};\n\nexport const focusOpeningItem = (menu: HTMLElement | null, edge: MenuEdge): void => {\n const checked = enabledItems(menu).find((item) => item.getAttribute('aria-checked') === 'true');\n if (!checked) {\n focusEdge(menu, edge);\n return;\n }\n checked.focus({ preventScroll: true });\n};\n\nexport const scrollCheckedIntoView = (menu: HTMLElement | null): void => {\n const checked = enabledItems(menu).find((item) => item.getAttribute('aria-checked') === 'true');\n if (menu && checked) {\n scrollRowIntoList(menu, checked);\n }\n};\n\nexport const edgeForTriggerKey = (\n key: string,\n placement: ActionMenuPlacement,\n): MenuEdge | undefined =>\n ({\n ArrowDown: 'first',\n ArrowUp: placement.startsWith('top') ? 'last' : undefined,\n ArrowRight: placement.startsWith('right') ? 'first' : undefined,\n })[key] as MenuEdge | undefined;\n\nexport const itemForMenuKey = (\n items: HTMLElement[],\n current: EventTarget | null,\n key: string,\n): HTMLElement | undefined => {\n const index = items.indexOf(current as HTMLButtonElement);\n const from = index === -1 ? items.length : index;\n return {\n ArrowDown: items[(index + 1) % items.length],\n ArrowUp: items[(from - 1 + items.length) % items.length],\n Home: items[0],\n End: items[items.length - 1],\n }[key];\n};\n\nexport const scrollFocusedIntoView = (menu: HTMLElement | null): void => {\n const focused = menu?.querySelector<HTMLElement>(':focus');\n if (menu && focused) {\n scrollRowIntoList(menu, focused);\n }\n};\n"],"names":["enabledItems","menu","ITEM_CLASS","focusEdge","edge","items","target","focusOpeningItem","checked","item","scrollCheckedIntoView","scrollRowIntoList","edgeForTriggerKey","key","placement","itemForMenuKey","current","index","from","scrollFocusedIntoView","focused"],"mappings":";;AAMO,MAAMA,IAAe,CAACC,MACzBA,IAAO,CAAC,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;AACT,GAEaM,IAAwB,CAAClB,MAAmC;AACrE,QAAMmB,IAAUnB,KAAA,gBAAAA,EAAM,cAA2B;AACjD,EAAIA,KAAQmB,KACRT,EAAkBV,GAAMmB,CAAO;AAEvC;"}
@@ -1,15 +1,15 @@
1
1
  import { MENU_SPECS as r } from "./floatingMenuGeometry.js";
2
- import { injectStyleSheet as i } from "./injectStyleSheet.js";
3
- import { ensureOverlayStyles as s } from "./portalOverlay.js";
4
- import { SELECTED_ROW_BACKGROUND as l, SELECTED_ROW_FOREGROUND as d } from "./selectedRow.js";
5
- const y = {
2
+ import { injectStyleSheet as d } from "./injectStyleSheet.js";
3
+ import { ensureOverlayStyles as S } from "./portalOverlay.js";
4
+ import { SELECTED_ROW_BACKGROUND as s, SELECTED_ROW_FOREGROUND as h } from "./selectedRow.js";
5
+ const w = {
6
6
  small: { icon: 16, iconBox: "text-[16px] [&_svg]:size-[16px]!" },
7
7
  xsmall: { icon: 11, iconBox: "text-[11px] [&_svg]:size-[11px]!" }
8
- }, O = {
8
+ }, m = {
9
9
  minWidth: 0,
10
10
  overflow: "hidden",
11
11
  textOverflow: "ellipsis"
12
- }, w = {
12
+ }, A = {
13
13
  position: "absolute",
14
14
  width: 1,
15
15
  height: 1,
@@ -17,40 +17,59 @@ const y = {
17
17
  overflow: "hidden",
18
18
  clipPath: "inset(50%)",
19
19
  whiteSpace: "nowrap"
20
- }, m = {
20
+ }, u = {
21
21
  padding: "6px 10px",
22
22
  fontSize: "var(--malachite-font-size-small, 13px)",
23
23
  color: "var(--malachite-text-dimmed, rgb(161, 161, 161))",
24
24
  userSelect: "none"
25
- }, h = {
26
- ...m,
25
+ }, g = {
26
+ ...u,
27
27
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
28
28
  overflow: "hidden",
29
29
  textOverflow: "ellipsis",
30
30
  whiteSpace: "nowrap"
31
- }, u = { display: "inline-flex", flexShrink: 0 }, R = {
32
- ...u,
31
+ }, $ = { color: "inherit", fontSize: "inherit" }, C = {
32
+ ...m,
33
+ display: "flex",
34
+ flexDirection: "column",
35
+ gap: 2
36
+ }, i = {
37
+ ...m,
38
+ whiteSpace: "normal",
39
+ fontSize: "var(--malachite-font-size-xsmall, 11px)"
40
+ }, x = {
41
+ ...i,
42
+ color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
43
+ }, E = { ...i, color: "inherit" }, c = "malachite-actionmenu-item-description", D = (e) => e.danger === "hover" ? i : e.danger || e.current ? E : x, N = {
44
+ display: "inline-flex",
45
+ flexShrink: 0,
46
+ width: 14,
47
+ marginLeft: "auto"
48
+ }, _ = { display: "inline-flex", flexShrink: 0 }, Y = {
49
+ ..._,
33
50
  color: "var(--malachite-text-dimmed, rgb(161, 161, 161))"
34
- }, n = "malachite-actionmenu-item-icon", a = "malachite-actionmenu-item", g = "data-malachite-actionmenu-tag", I = { display: "inline-flex", flexShrink: 0 }, L = { [g]: "" }, x = [
51
+ }, l = "malachite-actionmenu-item-icon", a = "malachite-actionmenu-item", T = "data-malachite-actionmenu-tag", k = { display: "inline-flex", flexShrink: 0 }, M = { [T]: "" }, f = [
35
52
  `.${a} { background: transparent; }`,
36
53
  `.${a}:not(:disabled):hover { background: var(--malachite-card-dimmed-background, rgb(247, 247, 247)); }`,
37
54
  `.${a}:focus-visible { outline: 2px solid var(--malachite-text-primary, rgb(10, 10, 10)); outline-offset: -2px; }`
38
- ], t = `.${a}[data-danger="hover"]`, c = `${t}:not(:disabled):is(:hover, :focus-visible)`, b = [
55
+ ], t = `.${a}[data-danger="hover"]`, n = `${t}:not(:disabled):is(:hover, :focus-visible)`, v = [
39
56
  `${t} { color: var(--malachite-text-primary, rgb(10, 10, 10)); }`,
40
57
  `${t}[data-tone="muted"] { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,
41
- `${t} > .${n} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,
42
- `${t}[aria-current] { color: ${d}; background: ${l}; }`,
43
- `${c} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,
44
- `${c} > .${n} { color: inherit; }`
45
- ], v = () => i("malachite-actionmenu-danger-hover-styles", b), A = () => (s(), v(), i("malachite-actionmenu-item-styles", x)), S = {
58
+ `${t} > .${l} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,
59
+ `${t}[aria-current] { color: ${h}; background: ${s}; }`,
60
+ `${n} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,
61
+ `${n} > .${l} { color: inherit; }`,
62
+ `${t}:not([aria-current]) .${c} { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,
63
+ `${n} .${c} { color: inherit; }`
64
+ ], b = () => d("malachite-actionmenu-danger-hover-styles", v), H = () => (S(), b(), d("malachite-actionmenu-item-styles", f)), p = {
46
65
  default: "var(--malachite-text-primary, rgb(10, 10, 10))",
47
66
  muted: "var(--malachite-text-secondary, rgb(123, 123, 123))"
48
- }, E = (e, o) => {
67
+ }, y = (e, o) => {
49
68
  if (e.danger === !0)
50
69
  return "var(--malachite-text-destructive, rgb(237, 53, 54))";
51
70
  if (e.danger !== "hover")
52
- return e.current ? d : S[o];
53
- }, $ = (e, o = "default") => e.type === "text" ? h : e.type === "divider" ? {
71
+ return e.current ? h : p[o];
72
+ }, z = (e, o = "default") => e.type === "text" ? g : e.type === "divider" ? {
54
73
  height: 1,
55
74
  background: "var(--malachite-card-border, rgb(232, 232, 232))",
56
75
  margin: "4px 0"
@@ -62,8 +81,8 @@ const y = {
62
81
  borderRadius: 8,
63
82
  fontSize: "var(--malachite-font-size-small, 13px)",
64
83
  fontWeight: 400,
65
- color: E(e, o),
66
- background: e.current && e.danger !== "hover" ? l : void 0,
84
+ color: y(e, o),
85
+ background: e.current && e.danger !== "hover" ? s : void 0,
67
86
  cursor: e.disabled ? "not-allowed" : "pointer",
68
87
  opacity: e.disabled ? 0.5 : 1,
69
88
  userSelect: "none",
@@ -74,7 +93,7 @@ const y = {
74
93
  textDecoration: "none",
75
94
  boxSizing: "border-box",
76
95
  width: "100%"
77
- }, N = (e) => ({
96
+ }, G = (e) => ({
78
97
  position: "fixed",
79
98
  top: (e == null ? void 0 : e.top) ?? 0,
80
99
  left: (e == null ? void 0 : e.left) ?? 0,
@@ -93,21 +112,26 @@ const y = {
93
112
  opacity: e ? 1 : 0
94
113
  });
95
114
  export {
96
- m as EMPTY_ITEM_STYLE,
115
+ N as CHECK_SLOT_STYLE,
116
+ c as DESCRIPTION_CLASS,
117
+ u as EMPTY_ITEM_STYLE,
97
118
  a as ITEM_CLASS,
98
- n as ITEM_ICON_CLASS,
99
- u as ITEM_ICON_LAYOUT,
100
- R as ITEM_ICON_STYLE,
101
- O as LABEL_STYLE,
102
- g as TAG_HOST_ATTR,
103
- L as TAG_HOST_PROPS,
104
- I as TAG_HOST_STYLE,
105
- h as TEXT_ITEM_STYLE,
106
- y as TRIGGER_SIZES,
107
- w as VISUALLY_HIDDEN_STYLE,
108
- A as ensureActionMenuStyles,
109
- v as ensureDangerOnHoverStyles,
110
- $ as itemStyle,
111
- N as menuStyle
119
+ l as ITEM_ICON_CLASS,
120
+ _ as ITEM_ICON_LAYOUT,
121
+ Y as ITEM_ICON_STYLE,
122
+ C as ITEM_TEXT_STYLE,
123
+ m as LABEL_STYLE,
124
+ T as TAG_HOST_ATTR,
125
+ M as TAG_HOST_PROPS,
126
+ k as TAG_HOST_STYLE,
127
+ $ as TEXT_ITEM_LABEL_STYLE,
128
+ g as TEXT_ITEM_STYLE,
129
+ w as TRIGGER_SIZES,
130
+ A as VISUALLY_HIDDEN_STYLE,
131
+ D as descriptionStyle,
132
+ H as ensureActionMenuStyles,
133
+ b as ensureDangerOnHoverStyles,
134
+ z as itemStyle,
135
+ G as menuStyle
112
136
  };
113
137
  //# sourceMappingURL=actionMenuStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actionMenuStyles.js","sources":["../../src/components/actionMenuStyles.ts"],"sourcesContent":["import type React from 'react';\nimport type { ActionMenuItem } from './actionMenuTypes';\nimport { MENU_SPECS, type MenuGeometry } from './floatingMenuGeometry';\nimport { injectStyleSheet } from './injectStyleSheet';\nimport { ensureOverlayStyles } from './portalOverlay';\nimport { SELECTED_ROW_BACKGROUND, SELECTED_ROW_FOREGROUND } from './selectedRow';\n\nexport const TRIGGER_SIZES: Record<'small' | 'xsmall', { icon: number; iconBox: string }> = {\n small: { icon: 16, iconBox: 'text-[16px] [&_svg]:size-[16px]!' },\n xsmall: { icon: 11, iconBox: 'text-[11px] [&_svg]:size-[11px]!' },\n};\n\nexport const LABEL_STYLE: React.CSSProperties = {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n};\n\n// Not `sr-only`: the menu portals outside the shadow root's stylesheet.\nexport const VISUALLY_HIDDEN_STYLE: React.CSSProperties = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n overflow: 'hidden',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n};\n\nexport const EMPTY_ITEM_STYLE: React.CSSProperties = {\n padding: '6px 10px',\n fontSize: 'var(--malachite-font-size-small, 13px)',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n userSelect: 'none',\n};\n\nexport const TEXT_ITEM_STYLE: React.CSSProperties = {\n ...EMPTY_ITEM_STYLE,\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n};\n\nexport const ITEM_ICON_LAYOUT: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nexport const ITEM_ICON_STYLE: React.CSSProperties = {\n ...ITEM_ICON_LAYOUT,\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n};\n\nexport const ITEM_ICON_CLASS = 'malachite-actionmenu-item-icon';\n\nexport const ITEM_CLASS = 'malachite-actionmenu-item';\n\nexport const TAG_HOST_ATTR = 'data-malachite-actionmenu-tag' as const;\n\nexport const TAG_HOST_STYLE: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nexport const TAG_HOST_PROPS = { [TAG_HOST_ATTR]: '' };\n\nconst ITEM_RULES = [\n `.${ITEM_CLASS} { background: transparent; }`,\n `.${ITEM_CLASS}:not(:disabled):hover { background: var(--malachite-card-dimmed-background, rgb(247, 247, 247)); }`,\n `.${ITEM_CLASS}:focus-visible { outline: 2px solid var(--malachite-text-primary, rgb(10, 10, 10)); outline-offset: -2px; }`,\n];\n\nconst DANGER_ON_HOVER = `.${ITEM_CLASS}[data-danger=\"hover\"]`;\nconst DANGER_ON_HOVER_ACTIVE = `${DANGER_ON_HOVER}:not(:disabled):is(:hover, :focus-visible)`;\n\nconst DANGER_ON_HOVER_RULES = [\n `${DANGER_ON_HOVER} { color: var(--malachite-text-primary, rgb(10, 10, 10)); }`,\n `${DANGER_ON_HOVER}[data-tone=\"muted\"] { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,\n `${DANGER_ON_HOVER} > .${ITEM_ICON_CLASS} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,\n `${DANGER_ON_HOVER}[aria-current] { color: ${SELECTED_ROW_FOREGROUND}; background: ${SELECTED_ROW_BACKGROUND}; }`,\n `${DANGER_ON_HOVER_ACTIVE} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,\n `${DANGER_ON_HOVER_ACTIVE} > .${ITEM_ICON_CLASS} { color: inherit; }`,\n];\n\nexport const ensureDangerOnHoverStyles = (): CSSStyleSheet | null =>\n injectStyleSheet('malachite-actionmenu-danger-hover-styles', DANGER_ON_HOVER_RULES);\n\nexport const ensureActionMenuStyles = (): CSSStyleSheet | null => {\n ensureOverlayStyles();\n ensureDangerOnHoverStyles();\n return injectStyleSheet('malachite-actionmenu-item-styles', ITEM_RULES);\n};\n\nexport type ActionMenuTone = 'default' | 'muted';\n\nconst ITEM_TEXT: Record<ActionMenuTone, string> = {\n default: 'var(--malachite-text-primary, rgb(10, 10, 10))',\n muted: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n};\n\ntype ActionItem = Exclude<ActionMenuItem, { type: 'text' } | { type: 'divider' }>;\n\nconst actionItemColor = (item: ActionItem, tone: ActionMenuTone): string | undefined => {\n if (item.danger === true) {\n return 'var(--malachite-text-destructive, rgb(237, 53, 54))';\n }\n if (item.danger === 'hover') {\n return undefined;\n }\n if (item.current) {\n return SELECTED_ROW_FOREGROUND;\n }\n return ITEM_TEXT[tone];\n};\n\nexport const itemStyle = (\n item: ActionMenuItem,\n tone: ActionMenuTone = 'default',\n): React.CSSProperties => {\n if (item.type === 'text') {\n return TEXT_ITEM_STYLE;\n }\n if (item.type === 'divider') {\n return {\n height: 1,\n background: 'var(--malachite-card-border, rgb(232, 232, 232))',\n margin: '4px 0',\n };\n }\n return {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n padding: '6px 10px',\n borderRadius: 8,\n fontSize: 'var(--malachite-font-size-small, 13px)',\n fontWeight: 400,\n color: actionItemColor(item, tone),\n background: item.current && item.danger !== 'hover' ? SELECTED_ROW_BACKGROUND : undefined,\n cursor: item.disabled ? 'not-allowed' : 'pointer',\n opacity: item.disabled ? 0.5 : 1,\n userSelect: 'none',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n border: 'none',\n textAlign: 'left',\n textDecoration: 'none',\n boxSizing: 'border-box',\n width: '100%',\n };\n};\n\nexport const menuStyle = (position: MenuGeometry | null): React.CSSProperties => ({\n position: 'fixed',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n width: position?.width,\n maxHeight: position?.maxHeight,\n overflowY: 'auto',\n background: MENU_SPECS.options.background,\n border: MENU_SPECS.options.border,\n borderRadius: MENU_SPECS.options.radius,\n boxShadow: MENU_SPECS.options.shadow,\n padding: MENU_SPECS.options.padding,\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n visibility: position ? 'visible' : 'hidden',\n opacity: position ? 1 : 0,\n});\n"],"names":["TRIGGER_SIZES","LABEL_STYLE","VISUALLY_HIDDEN_STYLE","EMPTY_ITEM_STYLE","TEXT_ITEM_STYLE","ITEM_ICON_LAYOUT","ITEM_ICON_STYLE","ITEM_ICON_CLASS","ITEM_CLASS","TAG_HOST_ATTR","TAG_HOST_STYLE","TAG_HOST_PROPS","ITEM_RULES","DANGER_ON_HOVER","DANGER_ON_HOVER_ACTIVE","DANGER_ON_HOVER_RULES","SELECTED_ROW_FOREGROUND","SELECTED_ROW_BACKGROUND","ensureDangerOnHoverStyles","injectStyleSheet","ensureActionMenuStyles","ensureOverlayStyles","ITEM_TEXT","actionItemColor","item","tone","itemStyle","menuStyle","position","MENU_SPECS"],"mappings":";;;;AAOO,MAAMA,IAA+E;AAAA,EACxF,OAAO,EAAE,MAAM,IAAI,SAAS,mCAAA;AAAA,EAC5B,QAAQ,EAAE,MAAM,IAAI,SAAS,mCAAA;AACjC,GAEaC,IAAmC;AAAA,EAC5C,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAClB,GAGaC,IAA6C;AAAA,EACtD,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAChB,GAEaC,IAAwC;AAAA,EACjD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAChB,GAEaC,IAAuC;AAAA,EAChD,GAAGD;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAChB,GAEaE,IAAwC,EAAE,SAAS,eAAe,YAAY,EAAA,GAE9EC,IAAuC;AAAA,EAChD,GAAGD;AAAA,EACH,OAAO;AACX,GAEaE,IAAkB,kCAElBC,IAAa,6BAEbC,IAAgB,iCAEhBC,IAAsC,EAAE,SAAS,eAAe,YAAY,EAAA,GAE5EC,IAAiB,EAAE,CAACF,CAAa,GAAG,G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AQ;AAAA,EACR,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,OAAO;AAAA,GAIFG,IAAY,CAACC,OAAwD;AAAA,EAC9E,UAAU;AAAA,EACV,MAAKA,KAAA,gBAAAA,EAAU,QAAO;AAAA,EACtB,OAAMA,KAAA,gBAAAA,EAAU,SAAQ;AAAA,EACxB,OAAOA,KAAA,gBAAAA,EAAU;AAAA,EACjB,WAAWA,KAAA,gBAAAA,EAAU;AAAA,EACrB,WAAW;AAAA,EACX,YAAYC,EAAW,QAAQ;AAAA,EAC/B,QAAQA,EAAW,QAAQ;AAAA,EAC3B,cAAcA,EAAW,QAAQ;AAAA,EACjC,WAAWA,EAAW,QAAQ;AAAA,EAC9B,SAASA,EAAW,QAAQ;AAAA,EAC5B,SAAS;AAAA,EACT,eAAe;AAAA,EACf,KAAK;AAAA,EACL,YAAYD,IAAW,YAAY;AAAA,EACnC,SAASA,IAAW,IAAI;AAC5B;"}
1
+ {"version":3,"file":"actionMenuStyles.js","sources":["../../src/components/actionMenuStyles.ts"],"sourcesContent":["import type React from 'react';\nimport type { ActionMenuItem } from './actionMenuTypes';\nimport { MENU_SPECS, type MenuGeometry } from './floatingMenuGeometry';\nimport { injectStyleSheet } from './injectStyleSheet';\nimport { ensureOverlayStyles } from './portalOverlay';\nimport { SELECTED_ROW_BACKGROUND, SELECTED_ROW_FOREGROUND } from './selectedRow';\n\nexport const TRIGGER_SIZES: Record<'small' | 'xsmall', { icon: number; iconBox: string }> = {\n small: { icon: 16, iconBox: 'text-[16px] [&_svg]:size-[16px]!' },\n xsmall: { icon: 11, iconBox: 'text-[11px] [&_svg]:size-[11px]!' },\n};\n\nexport const LABEL_STYLE: React.CSSProperties = {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n};\n\n// Not `sr-only`: the menu portals outside the shadow root's stylesheet.\nexport const VISUALLY_HIDDEN_STYLE: React.CSSProperties = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n overflow: 'hidden',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n};\n\nexport const EMPTY_ITEM_STYLE: React.CSSProperties = {\n padding: '6px 10px',\n fontSize: 'var(--malachite-font-size-small, 13px)',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n userSelect: 'none',\n};\n\nexport const TEXT_ITEM_STYLE: React.CSSProperties = {\n ...EMPTY_ITEM_STYLE,\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n};\n\nexport const TEXT_ITEM_LABEL_STYLE: React.CSSProperties = { color: 'inherit', fontSize: 'inherit' };\n\nexport const ITEM_TEXT_STYLE: React.CSSProperties = {\n ...LABEL_STYLE,\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n};\n\nconst DESCRIPTION_BASE: React.CSSProperties = {\n ...LABEL_STYLE,\n whiteSpace: 'normal',\n fontSize: 'var(--malachite-font-size-xsmall, 11px)',\n};\n\nconst DESCRIPTION_STYLE: React.CSSProperties = {\n ...DESCRIPTION_BASE,\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n};\n\nconst ROW_DESCRIPTION_STYLE: React.CSSProperties = { ...DESCRIPTION_BASE, color: 'inherit' };\n\nexport const DESCRIPTION_CLASS = 'malachite-actionmenu-item-description';\n\nexport const descriptionStyle = (item: ActionItem): React.CSSProperties => {\n if (item.danger === 'hover') {\n return DESCRIPTION_BASE;\n }\n return item.danger || item.current ? ROW_DESCRIPTION_STYLE : DESCRIPTION_STYLE;\n};\n\nexport const CHECK_SLOT_STYLE: React.CSSProperties = {\n display: 'inline-flex',\n flexShrink: 0,\n width: 14,\n marginLeft: 'auto',\n};\n\nexport const ITEM_ICON_LAYOUT: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nexport const ITEM_ICON_STYLE: React.CSSProperties = {\n ...ITEM_ICON_LAYOUT,\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n};\n\nexport const ITEM_ICON_CLASS = 'malachite-actionmenu-item-icon';\n\nexport const ITEM_CLASS = 'malachite-actionmenu-item';\n\nexport const TAG_HOST_ATTR = 'data-malachite-actionmenu-tag' as const;\n\nexport const TAG_HOST_STYLE: React.CSSProperties = { display: 'inline-flex', flexShrink: 0 };\n\nexport const TAG_HOST_PROPS = { [TAG_HOST_ATTR]: '' };\n\nconst ITEM_RULES = [\n `.${ITEM_CLASS} { background: transparent; }`,\n `.${ITEM_CLASS}:not(:disabled):hover { background: var(--malachite-card-dimmed-background, rgb(247, 247, 247)); }`,\n `.${ITEM_CLASS}:focus-visible { outline: 2px solid var(--malachite-text-primary, rgb(10, 10, 10)); outline-offset: -2px; }`,\n];\n\nconst DANGER_ON_HOVER = `.${ITEM_CLASS}[data-danger=\"hover\"]`;\nconst DANGER_ON_HOVER_ACTIVE = `${DANGER_ON_HOVER}:not(:disabled):is(:hover, :focus-visible)`;\n\nconst DANGER_ON_HOVER_RULES = [\n `${DANGER_ON_HOVER} { color: var(--malachite-text-primary, rgb(10, 10, 10)); }`,\n `${DANGER_ON_HOVER}[data-tone=\"muted\"] { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,\n `${DANGER_ON_HOVER} > .${ITEM_ICON_CLASS} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,\n `${DANGER_ON_HOVER}[aria-current] { color: ${SELECTED_ROW_FOREGROUND}; background: ${SELECTED_ROW_BACKGROUND}; }`,\n `${DANGER_ON_HOVER_ACTIVE} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,\n `${DANGER_ON_HOVER_ACTIVE} > .${ITEM_ICON_CLASS} { color: inherit; }`,\n `${DANGER_ON_HOVER}:not([aria-current]) .${DESCRIPTION_CLASS} { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,\n `${DANGER_ON_HOVER_ACTIVE} .${DESCRIPTION_CLASS} { color: inherit; }`,\n];\n\nexport const ensureDangerOnHoverStyles = (): CSSStyleSheet | null =>\n injectStyleSheet('malachite-actionmenu-danger-hover-styles', DANGER_ON_HOVER_RULES);\n\nexport const ensureActionMenuStyles = (): CSSStyleSheet | null => {\n ensureOverlayStyles();\n ensureDangerOnHoverStyles();\n return injectStyleSheet('malachite-actionmenu-item-styles', ITEM_RULES);\n};\n\nexport type ActionMenuTone = 'default' | 'muted';\n\nconst ITEM_TEXT: Record<ActionMenuTone, string> = {\n default: 'var(--malachite-text-primary, rgb(10, 10, 10))',\n muted: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n};\n\ntype ActionItem = Exclude<ActionMenuItem, { type: 'text' } | { type: 'divider' }>;\n\nconst actionItemColor = (item: ActionItem, tone: ActionMenuTone): string | undefined => {\n if (item.danger === true) {\n return 'var(--malachite-text-destructive, rgb(237, 53, 54))';\n }\n if (item.danger === 'hover') {\n return undefined;\n }\n if (item.current) {\n return SELECTED_ROW_FOREGROUND;\n }\n return ITEM_TEXT[tone];\n};\n\nexport const itemStyle = (\n item: ActionMenuItem,\n tone: ActionMenuTone = 'default',\n): React.CSSProperties => {\n if (item.type === 'text') {\n return TEXT_ITEM_STYLE;\n }\n if (item.type === 'divider') {\n return {\n height: 1,\n background: 'var(--malachite-card-border, rgb(232, 232, 232))',\n margin: '4px 0',\n };\n }\n return {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n padding: '6px 10px',\n borderRadius: 8,\n fontSize: 'var(--malachite-font-size-small, 13px)',\n fontWeight: 400,\n color: actionItemColor(item, tone),\n background: item.current && item.danger !== 'hover' ? SELECTED_ROW_BACKGROUND : undefined,\n cursor: item.disabled ? 'not-allowed' : 'pointer',\n opacity: item.disabled ? 0.5 : 1,\n userSelect: 'none',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n border: 'none',\n textAlign: 'left',\n textDecoration: 'none',\n boxSizing: 'border-box',\n width: '100%',\n };\n};\n\nexport const menuStyle = (position: MenuGeometry | null): React.CSSProperties => ({\n position: 'fixed',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n width: position?.width,\n maxHeight: position?.maxHeight,\n overflowY: 'auto',\n background: MENU_SPECS.options.background,\n border: MENU_SPECS.options.border,\n borderRadius: MENU_SPECS.options.radius,\n boxShadow: MENU_SPECS.options.shadow,\n padding: MENU_SPECS.options.padding,\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n visibility: position ? 'visible' : 'hidden',\n opacity: position ? 1 : 0,\n});\n"],"names":["TRIGGER_SIZES","LABEL_STYLE","VISUALLY_HIDDEN_STYLE","EMPTY_ITEM_STYLE","TEXT_ITEM_STYLE","TEXT_ITEM_LABEL_STYLE","ITEM_TEXT_STYLE","DESCRIPTION_BASE","DESCRIPTION_STYLE","ROW_DESCRIPTION_STYLE","DESCRIPTION_CLASS","descriptionStyle","item","CHECK_SLOT_STYLE","ITEM_ICON_LAYOUT","ITEM_ICON_STYLE","ITEM_ICON_CLASS","ITEM_CLASS","TAG_HOST_ATTR","TAG_HOST_STYLE","TAG_HOST_PROPS","ITEM_RULES","DANGER_ON_HOVER","DANGER_ON_HOVER_ACTIVE","DANGER_ON_HOVER_RULES","SELECTED_ROW_FOREGROUND","SELECTED_ROW_BACKGROUND","ensureDangerOnHoverStyles","injectStyleSheet","ensureActionMenuStyles","ensureOverlayStyles","ITEM_TEXT","actionItemColor","tone","itemStyle","menuStyle","position","MENU_SPECS"],"mappings":";;;;AAOO,MAAMA,IAA+E;AAAA,EACxF,OAAO,EAAE,MAAM,IAAI,SAAS,mCAAA;AAAA,EAC5B,QAAQ,EAAE,MAAM,IAAI,SAAS,mCAAA;AACjC,GAEaC,IAAmC;AAAA,EAC5C,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAClB,GAGaC,IAA6C;AAAA,EACtD,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AACh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