@stackone/malachite 2.87.0 → 2.88.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.
@@ -1,91 +1,92 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as R } from "react";
3
- import { ButtonSpinner as k } from "./ButtonSpinner.js";
4
- import G from "./CustomIcons/CaretDownIcon.js";
5
- import M from "./CustomIcons/CaretUpIcon.js";
6
- import { getIconOnlySizeClasses as $, getIconSizeClass as D } from "./buttonSizing.js";
7
- import { getSizeClasses as T, getVariantClasses as _, getDefaultRadiusClass as z } from "./buttonStyles.js";
8
- const A = "relative rounded-e-none border-e-0 focus-visible:z-[1]", U = "relative rounded-s-none border-s-0 before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-current before:opacity-25", V = R(
1
+ import { jsxs as y, jsx as e } from "react/jsx-runtime";
2
+ import k, { forwardRef as M } from "react";
3
+ import { ButtonSpinner as A } from "./ButtonSpinner.js";
4
+ import D from "./CustomIcons/CaretDownIcon.js";
5
+ import G from "./CustomIcons/CaretUpIcon.js";
6
+ import { getIconOnlySizeClasses as T, getIconSizeClass as z } from "./buttonSizing.js";
7
+ import { getSizeClasses as U, getVariantClasses as V, getDefaultRadiusClass as q } from "./buttonStyles.js";
8
+ const F = "relative rounded-e-none border-e-0 focus-visible:z-[1]", H = "relative rounded-s-none border-s-0 before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-current before:opacity-25", J = M(
9
9
  ({
10
- variant: p = "filled",
10
+ variant: g = "filled",
11
11
  size: t = "medium",
12
- children: b,
13
- leading: n,
14
- trailing: r,
15
- onClick: C,
12
+ children: s,
13
+ leading: o,
14
+ trailing: l,
15
+ onClick: h,
16
16
  type: x = "button",
17
- loading: o = !1,
18
- disabled: h = !1,
19
- flexGrow: l = !1,
20
- menuLabel: N,
21
- menuOpen: a,
17
+ loading: i = !1,
18
+ disabled: N = !1,
19
+ flexGrow: n = !1,
20
+ menuLabel: v,
21
+ menuOpen: c,
22
22
  onMenuClick: S,
23
- menuIcon: g,
24
- menuHasPopup: v = !0,
25
- menuRef: y,
26
- menuTrigger: i,
27
- className: c = "",
28
- style: I
29
- }, j) => {
30
- const s = h || o, B = z(t, !1), f = _(p, B), m = s ? "cursor-not-allowed" : "", E = [
23
+ menuIcon: I,
24
+ menuHasPopup: j = !0,
25
+ menuRef: w,
26
+ menuTrigger: f,
27
+ className: m = "",
28
+ style: B
29
+ }, E) => {
30
+ const r = N || i, u = k.Children.toArray(s), a = n && u.length > 0 && u.every((C) => typeof C == "string" || typeof C == "number"), R = q(t, !1), p = V(g, R), d = r ? "cursor-not-allowed" : "", _ = [
31
31
  "flex items-center justify-center",
32
- T(t),
33
- f,
34
- A,
35
- l ? "flex-1" : "",
36
- m
37
- ].filter(Boolean).join(" "), w = [
32
+ a ? "min-w-0" : "",
33
+ U(t),
34
+ p,
35
+ F,
36
+ n ? "flex-1" : "",
37
+ d
38
+ ].filter(Boolean).join(" "), $ = [
38
39
  "flex items-center justify-center p-0",
39
- $(t),
40
- f,
41
- U,
42
- D(t),
43
- m
44
- ].filter(Boolean).join(" "), u = /* @__PURE__ */ e(
40
+ T(t),
41
+ p,
42
+ H,
43
+ z(t),
44
+ d
45
+ ].filter(Boolean).join(" "), b = /* @__PURE__ */ e(
45
46
  "button",
46
47
  {
47
- ref: y,
48
+ ref: w,
48
49
  type: "button",
49
- disabled: s,
50
- "aria-label": N,
51
- "aria-haspopup": v ? "menu" : void 0,
52
- "aria-expanded": a,
50
+ disabled: r,
51
+ "aria-label": v,
52
+ "aria-haspopup": j ? "menu" : void 0,
53
+ "aria-expanded": c,
53
54
  onClick: S,
54
- className: w,
55
- children: g ?? (a ? /* @__PURE__ */ e(M, {}) : /* @__PURE__ */ e(G, {}))
55
+ className: $,
56
+ children: I ?? (c ? /* @__PURE__ */ e(G, {}) : /* @__PURE__ */ e(D, {}))
56
57
  }
57
58
  );
58
- return /* @__PURE__ */ d(
59
+ return /* @__PURE__ */ y(
59
60
  "span",
60
61
  {
61
- className: `inline-flex items-stretch${l ? " w-full" : ""}${c ? ` ${c}` : ""}`,
62
- style: I,
62
+ className: `inline-flex items-stretch${a ? " min-w-0" : ""}${n ? " w-full" : ""}${m ? ` ${m}` : ""}`,
63
+ style: B,
63
64
  children: [
64
- /* @__PURE__ */ d(
65
+ /* @__PURE__ */ y(
65
66
  "button",
66
67
  {
67
- ref: j,
68
+ ref: E,
68
69
  type: x,
69
- disabled: s,
70
- onClick: C,
71
- className: E,
70
+ disabled: r,
71
+ onClick: h,
72
+ className: _,
72
73
  children: [
73
- n ? /* @__PURE__ */ e("span", { className: "btn-leading inline-flex shrink-0 items-center me-2", children: n }) : null,
74
- o ? /* @__PURE__ */ e(k, {}) : null,
75
- b,
76
- r ? /* @__PURE__ */ e("span", { className: "btn-trailing inline-flex shrink-0 items-center ms-2", children: r }) : null
74
+ o ? /* @__PURE__ */ e("span", { className: "btn-leading inline-flex shrink-0 items-center me-2", children: o }) : null,
75
+ i ? /* @__PURE__ */ e(A, {}) : null,
76
+ a ? /* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: s }) : s,
77
+ l ? /* @__PURE__ */ e("span", { className: "btn-trailing inline-flex shrink-0 items-center ms-2", children: l }) : null
77
78
  ]
78
79
  }
79
80
  ),
80
- i ? i(u) : u
81
+ f ? f(b) : b
81
82
  ]
82
83
  }
83
84
  );
84
85
  }
85
86
  );
86
- V.displayName = "SplitButton";
87
+ J.displayName = "SplitButton";
87
88
  export {
88
- V as SplitButton,
89
- V as default
89
+ J as SplitButton,
90
+ J as default
90
91
  };
91
92
  //# sourceMappingURL=SplitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SplitButton.js","sources":["../../src/components/SplitButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { ButtonSize, ButtonVariant } from './Button';\nimport ButtonSpinner from './ButtonSpinner';\nimport CaretDownIcon from './CustomIcons/CaretDownIcon';\nimport CaretUpIcon from './CustomIcons/CaretUpIcon';\nimport { getIconOnlySizeClasses, getIconSizeClass } from './buttonSizing';\nimport { getDefaultRadiusClass, getSizeClasses, getVariantClasses } from './buttonStyles';\n\nexport interface SplitButtonProps {\n variant?: Exclude<ButtonVariant, 'row-outline'>;\n size?: ButtonSize;\n children?: React.ReactNode;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** The trigger segment is always `type=\"button\"`. */\n type?: 'button' | 'submit' | 'reset';\n loading?: boolean;\n disabled?: boolean;\n flexGrow?: boolean;\n /** Accessible name of the chevron segment. */\n menuLabel: string;\n /** Drives `aria-expanded`; the chevron points up while open. */\n menuOpen?: boolean;\n onMenuClick?: React.MouseEventHandler<HTMLButtonElement>;\n menuIcon?: React.ReactNode;\n /** `false` for a trigger that opens something other than a menu. */\n menuHasPopup?: boolean;\n menuRef?: React.Ref<HTMLButtonElement>;\n /** Wraps the trigger segment, e.g. as a `Popover`'s `trigger`. */\n menuTrigger?: (segment: React.ReactElement) => React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\n// The seam is the trigger's own text colour, so it reads on every variant.\nconst MAIN_SEGMENT = 'relative rounded-e-none border-e-0 focus-visible:z-[1]';\nconst TRIGGER_SEGMENT =\n 'relative rounded-s-none border-s-0 before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-current before:opacity-25';\n\n/** A primary action and a menu trigger in one pill; each segment is its own button. */\nexport const SplitButton = forwardRef<HTMLButtonElement, SplitButtonProps>(\n (\n {\n variant = 'filled',\n size = 'medium',\n children,\n leading,\n trailing,\n onClick,\n type = 'button',\n loading = false,\n disabled = false,\n flexGrow = false,\n menuLabel,\n menuOpen,\n onMenuClick,\n menuIcon,\n menuHasPopup = true,\n menuRef,\n menuTrigger,\n className = '',\n style,\n },\n ref,\n ) => {\n const isInactive = disabled || loading;\n const radiusClass = getDefaultRadiusClass(size, false);\n const variantClasses = getVariantClasses(variant, radiusClass);\n const inactiveClass = isInactive ? 'cursor-not-allowed' : '';\n\n const mainClasses = [\n 'flex items-center justify-center',\n getSizeClasses(size),\n variantClasses,\n MAIN_SEGMENT,\n flexGrow ? 'flex-1' : '',\n inactiveClass,\n ]\n .filter(Boolean)\n .join(' ');\n\n const triggerClasses = [\n 'flex items-center justify-center p-0',\n getIconOnlySizeClasses(size),\n variantClasses,\n TRIGGER_SEGMENT,\n getIconSizeClass(size),\n inactiveClass,\n ]\n .filter(Boolean)\n .join(' ');\n\n const trigger = (\n <button\n ref={menuRef}\n type=\"button\"\n disabled={isInactive}\n aria-label={menuLabel}\n aria-haspopup={menuHasPopup ? 'menu' : undefined}\n aria-expanded={menuOpen}\n onClick={onMenuClick}\n className={triggerClasses}\n >\n {menuIcon ?? (menuOpen ? <CaretUpIcon /> : <CaretDownIcon />)}\n </button>\n );\n\n return (\n <span\n className={`inline-flex items-stretch${flexGrow ? ' w-full' : ''}${className ? ` ${className}` : ''}`}\n style={style}\n >\n <button\n ref={ref}\n type={type}\n disabled={isInactive}\n onClick={onClick}\n className={mainClasses}\n >\n {leading ? (\n <span className=\"btn-leading inline-flex shrink-0 items-center me-2\">\n {leading}\n </span>\n ) : null}\n {loading ? <ButtonSpinner /> : null}\n {children}\n {trailing ? (\n <span className=\"btn-trailing inline-flex shrink-0 items-center ms-2\">\n {trailing}\n </span>\n ) : null}\n </button>\n {menuTrigger ? menuTrigger(trigger) : trigger}\n </span>\n );\n },\n);\n\nSplitButton.displayName = 'SplitButton';\n\nexport default SplitButton;\n"],"names":["MAIN_SEGMENT","TRIGGER_SEGMENT","SplitButton","forwardRef","variant","size","children","leading","trailing","onClick","type","loading","disabled","flexGrow","menuLabel","menuOpen","onMenuClick","menuIcon","menuHasPopup","menuRef","menuTrigger","className","style","ref","isInactive","radiusClass","getDefaultRadiusClass","variantClasses","getVariantClasses","inactiveClass","mainClasses","getSizeClasses","triggerClasses","getIconOnlySizeClasses","getIconSizeClass","trigger","jsx","CaretUpIcon","CaretDownIcon","js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,GAAA,CAAA,CAAY,sBAAMC,GAAA,EAAc;AAAA,MAAA;AAAA,IAAA;AAIlE,WACI,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,4BAA4B1B,IAAW,YAAY,EAAE,GAAGQ,IAAY,IAAIA,CAAS,KAAK,EAAE;AAAA,QACnG,OAAAC;AAAA,QAEA,UAAA;AAAA,UAAA,gBAAAiB;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,KAAAhB;AAAA,cACA,MAAAb;AAAA,cACA,UAAUc;AAAA,cACV,SAAAf;AAAA,cACA,WAAWqB;AAAA,cAEV,UAAA;AAAA,gBAAAvB,IACG,gBAAA6B,EAAC,QAAA,EAAK,WAAU,sDACX,aACL,IACA;AAAA,gBACHzB,IAAU,gBAAAyB,EAACI,GAAA,CAAA,CAAc,IAAK;AAAA,gBAC9BlC;AAAA,gBACAE,IACG,gBAAA4B,EAAC,QAAA,EAAK,WAAU,uDACX,aACL,IACA;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAEPhB,IAAcA,EAAYe,CAAO,IAAIA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlD;AACJ;AAEAjC,EAAY,cAAc;"}
1
+ {"version":3,"file":"SplitButton.js","sources":["../../src/components/SplitButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { ButtonSize, ButtonVariant } from './Button';\nimport ButtonSpinner from './ButtonSpinner';\nimport CaretDownIcon from './CustomIcons/CaretDownIcon';\nimport CaretUpIcon from './CustomIcons/CaretUpIcon';\nimport { getIconOnlySizeClasses, getIconSizeClass } from './buttonSizing';\nimport { getDefaultRadiusClass, getSizeClasses, getVariantClasses } from './buttonStyles';\n\nexport interface SplitButtonProps {\n variant?: Exclude<ButtonVariant, 'row-outline'>;\n size?: ButtonSize;\n children?: React.ReactNode;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** The trigger segment is always `type=\"button\"`. */\n type?: 'button' | 'submit' | 'reset';\n loading?: boolean;\n disabled?: boolean;\n flexGrow?: boolean;\n /** Accessible name of the chevron segment. */\n menuLabel: string;\n /** Drives `aria-expanded`; the chevron points up while open. */\n menuOpen?: boolean;\n onMenuClick?: React.MouseEventHandler<HTMLButtonElement>;\n menuIcon?: React.ReactNode;\n /** `false` for a trigger that opens something other than a menu. */\n menuHasPopup?: boolean;\n menuRef?: React.Ref<HTMLButtonElement>;\n /** Wraps the trigger segment, e.g. as a `Popover`'s `trigger`. */\n menuTrigger?: (segment: React.ReactElement) => React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\n// The seam is the trigger's own text colour, so it reads on every variant.\nconst MAIN_SEGMENT = 'relative rounded-e-none border-e-0 focus-visible:z-[1]';\nconst TRIGGER_SEGMENT =\n 'relative rounded-s-none border-s-0 before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-current before:opacity-25';\n\n/** A primary action and a menu trigger in one pill; each segment is its own button. */\nexport const SplitButton = forwardRef<HTMLButtonElement, SplitButtonProps>(\n (\n {\n variant = 'filled',\n size = 'medium',\n children,\n leading,\n trailing,\n onClick,\n type = 'button',\n loading = false,\n disabled = false,\n flexGrow = false,\n menuLabel,\n menuOpen,\n onMenuClick,\n menuIcon,\n menuHasPopup = true,\n menuRef,\n menuTrigger,\n className = '',\n style,\n },\n ref,\n ) => {\n const isInactive = disabled || loading;\n const label = React.Children.toArray(children);\n const truncates =\n flexGrow &&\n label.length > 0 &&\n label.every((c) => typeof c === 'string' || typeof c === 'number');\n const radiusClass = getDefaultRadiusClass(size, false);\n const variantClasses = getVariantClasses(variant, radiusClass);\n const inactiveClass = isInactive ? 'cursor-not-allowed' : '';\n\n const mainClasses = [\n 'flex items-center justify-center',\n truncates ? 'min-w-0' : '',\n getSizeClasses(size),\n variantClasses,\n MAIN_SEGMENT,\n flexGrow ? 'flex-1' : '',\n inactiveClass,\n ]\n .filter(Boolean)\n .join(' ');\n\n const triggerClasses = [\n 'flex items-center justify-center p-0',\n getIconOnlySizeClasses(size),\n variantClasses,\n TRIGGER_SEGMENT,\n getIconSizeClass(size),\n inactiveClass,\n ]\n .filter(Boolean)\n .join(' ');\n\n const trigger = (\n <button\n ref={menuRef}\n type=\"button\"\n disabled={isInactive}\n aria-label={menuLabel}\n aria-haspopup={menuHasPopup ? 'menu' : undefined}\n aria-expanded={menuOpen}\n onClick={onMenuClick}\n className={triggerClasses}\n >\n {menuIcon ?? (menuOpen ? <CaretUpIcon /> : <CaretDownIcon />)}\n </button>\n );\n\n return (\n <span\n className={`inline-flex items-stretch${truncates ? ' min-w-0' : ''}${flexGrow ? ' w-full' : ''}${className ? ` ${className}` : ''}`}\n style={style}\n >\n <button\n ref={ref}\n type={type}\n disabled={isInactive}\n onClick={onClick}\n className={mainClasses}\n >\n {leading ? (\n <span className=\"btn-leading inline-flex shrink-0 items-center me-2\">\n {leading}\n </span>\n ) : null}\n {loading ? <ButtonSpinner /> : null}\n {truncates ? <span className=\"min-w-0 truncate\">{children}</span> : children}\n {trailing ? (\n <span className=\"btn-trailing inline-flex shrink-0 items-center ms-2\">\n {trailing}\n </span>\n ) : null}\n </button>\n {menuTrigger ? menuTrigger(trigger) : trigger}\n </span>\n );\n },\n);\n\nSplitButton.displayName = 'SplitButton';\n\nexport default SplitButton;\n"],"names":["MAIN_SEGMENT","TRIGGER_SEGMENT","SplitButton","forwardRef","variant","size","children","leading","trailing","onClick","type","loading","disabled","flexGrow","menuLabel","menuOpen","onMenuClick","menuIcon","menuHasPopup","menuRef","menuTrigger","className","style","ref","isInactive","label","React","truncates","c","radiusClass","getDefaultRadiusClass","variantClasses","getVariantClasses","inactiveClass","mainClasses","getSizeClasses","triggerClasses","getIconOnlySizeClasses","getIconSizeClass","trigger","jsx","CaretUpIcon","CaretDownIcon","jsxs","ButtonSpinner"],"mappings":";;;;;;;AAoCA,MAAMA,IAAe,0DACfC,IACF,sIAGSC,IAAcC;AAAA,EACvB,CACI;AAAA,IACI,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SAASC;AAAA,QACT,WAAWoB;AAAA,QAEV,gBAAarB,IAAW,gBAAAyB,EAACC,GAAA,CAAA,CAAY,sBAAMC,GAAA,EAAc;AAAA,MAAA;AAAA,IAAA;AAIlE,WACI,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,4BAA4BhB,IAAY,aAAa,EAAE,GAAGd,IAAW,YAAY,EAAE,GAAGQ,IAAY,IAAIA,CAAS,KAAK,EAAE;AAAA,QACjI,OAAAC;AAAA,QAEA,UAAA;AAAA,UAAA,gBAAAqB;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,KAAApB;AAAA,cACA,MAAAb;AAAA,cACA,UAAUc;AAAA,cACV,SAAAf;AAAA,cACA,WAAWyB;AAAA,cAEV,UAAA;AAAA,gBAAA3B,IACG,gBAAAiC,EAAC,QAAA,EAAK,WAAU,sDACX,aACL,IACA;AAAA,gBACH7B,IAAU,gBAAA6B,EAACI,GAAA,CAAA,CAAc,IAAK;AAAA,gBAC9BjB,IAAY,gBAAAa,EAAC,QAAA,EAAK,WAAU,oBAAoB,UAAAlC,GAAS,IAAUA;AAAA,gBACnEE,IACG,gBAAAgC,EAAC,QAAA,EAAK,WAAU,uDACX,aACL,IACA;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAEPpB,IAAcA,EAAYmB,CAAO,IAAIA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlD;AACJ;AAEArC,EAAY,cAAc;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as E } from "react/jsx-runtime";
2
- import me, { useRef as L, useEffect as be } from "react";
3
- import { DisclosureArrow as pe } from "./DisclosureArrow.js";
2
+ import be, { useRef as D, useEffect as pe } from "react";
3
+ import { DisclosureArrow as me } from "./DisclosureArrow.js";
4
4
  import { paintOnChild as he } from "./asChild.js";
5
5
  import { FOCUS_RING_INSET as Z, FOCUS_RING_INSET_OVERLAY_HIDDEN as ge } from "./focusRing.js";
6
6
  import { resolveRel as J } from "./linkRel.js";
@@ -19,37 +19,37 @@ const Ne = {
19
19
  }, Re = {
20
20
  success: "var(--malachite-tag-success-foreground)",
21
21
  error: "var(--malachite-tag-error-foreground)"
22
- }, ye = "opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100", ke = (r) => {
23
- var c;
24
- const n = r.getRootNode(), e = ((c = n.getSelection) == null ? void 0 : c.call(n)) ?? r.ownerDocument.getSelection();
22
+ }, ye = "opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100", _e = (r) => {
23
+ var i;
24
+ const n = r.getRootNode(), e = ((i = n.getSelection) == null ? void 0 : i.call(n)) ?? r.ownerDocument.getSelection();
25
25
  if (!e || e.isCollapsed)
26
26
  return !1;
27
- for (let l = 0; l < e.rangeCount; l += 1)
28
- if (e.getRangeAt(l).intersectsNode(r))
27
+ for (let s = 0; s < e.rangeCount; s += 1)
28
+ if (e.getRangeAt(s).intersectsNode(r))
29
29
  return !0;
30
30
  return !1;
31
- }, _e = (r) => new r.constructor("click", r), Oe = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)", ee = (r) => {
31
+ }, ke = (r) => new r.constructor("click", r), Te = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)", ee = (r) => {
32
32
  const {
33
33
  children: n,
34
34
  divider: a = !1,
35
35
  disabled: e = !1,
36
- selected: c,
37
- selection: l,
36
+ selected: i,
37
+ selection: s,
38
38
  tone: d = "default",
39
39
  inset: w = "none",
40
- className: m = "",
40
+ className: b = "",
41
41
  style: C
42
- } = r, s = r.asChild === !0, {
43
- onClick: i,
44
- href: b,
45
- target: p,
46
- rel: $,
47
- trailing: I,
42
+ } = r, l = r.asChild === !0, {
43
+ onClick: c,
44
+ href: p,
45
+ target: m,
46
+ rel: I,
47
+ trailing: $,
48
48
  revealTrailing: P,
49
49
  leading: y,
50
50
  dimmed: B,
51
51
  role: u
52
- } = s ? {} : r, h = xe(b), F = s ? void 0 : r["aria-label"], U = s ? void 0 : r["aria-labelledby"], te = s ? void 0 : r.tabIndex, j = !!(i || h), ae = e && (j || s) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", oe = d !== "default", ne = Se[d], G = !s && M(I), k = Ne[w], ce = k ? "" : "p-0", W = [
52
+ } = l ? {} : r, h = xe(p), F = l ? void 0 : r["aria-label"], U = l ? void 0 : r["aria-labelledby"], te = l ? void 0 : r.tabIndex, j = !!(c || h), ae = e && (j || l) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", oe = d !== "default", ne = Se[d], G = !l && M($), _ = Ne[w], ie = _ ? "" : "p-0", W = [
53
53
  "w-full text-left border-0",
54
54
  ne,
55
55
  a ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
@@ -58,46 +58,46 @@ const Ne = {
58
58
  "appearance-none",
59
59
  oe ? "" : "bg-transparent",
60
60
  e ? "" : "cursor-pointer"
61
- ], X = (t) => [W, ...t, k, m].filter(Boolean).join(" "), le = l ? l !== "announce" : u !== "checkbox", ie = l !== "tint", f = G && !!i && !h && !e, K = L(null), V = L(null), g = L(!1), se = (t) => {
61
+ ], X = (t) => [W, ...t, _, b].filter(Boolean).join(" "), le = s ? s !== "announce" : u !== "checkbox", ce = s !== "tint", f = G && !!c && !h && !e, z = D(null), K = D(null), g = D(!1), se = (t) => {
62
62
  g.current = t.target !== t.currentTarget;
63
63
  }, de = (t) => {
64
64
  g.current || (g.current = t.target !== t.currentTarget);
65
65
  };
66
- be(() => {
67
- const t = K.current;
66
+ pe(() => {
67
+ const t = z.current;
68
68
  if (!f || !t)
69
69
  return;
70
70
  const S = (v) => {
71
71
  const A = g.current;
72
72
  g.current = !1;
73
- const D = V.current;
74
- !D || v.target !== t || A || v.detail <= 1 && !v.shiftKey && ke(t) || (v.stopPropagation(), D.focus({ preventScroll: !0 }), D.dispatchEvent(_e(v)));
73
+ const L = K.current;
74
+ !L || v.target !== t || A || v.detail <= 1 && !v.shiftKey && _e(t) || (v.stopPropagation(), L.focus({ preventScroll: !0 }), L.dispatchEvent(ke(v)));
75
75
  };
76
76
  return t.addEventListener("click", S), () => t.removeEventListener("click", S);
77
77
  }, [f]);
78
- const ue = c === !0 && le ? {
78
+ const ue = i === !0 && le ? {
79
79
  backgroundImage: `linear-gradient(${Q}, ${Q})`,
80
80
  color: Ce,
81
- ...ie ? { boxShadow: `inset 2px 0 0 ${we}` } : {},
81
+ ...ce ? { boxShadow: `inset 2px 0 0 ${we}` } : {},
82
82
  ...Ee
83
- } : {}, _ = Re[d], N = { ..._ ? {
84
- color: _,
85
- "--malachite-ctx-text-primary": _
86
- } : {}, ...ue, ...C }, O = u === "checkbox" && c === "mixed" ? "mixed" : u === "radio" || u === "checkbox" ? c === !0 : void 0, z = O === void 0 && c === !0 ? !0 : void 0, Y = {
83
+ } : {}, k = Re[d], N = { ...k ? {
84
+ color: k,
85
+ "--malachite-ctx-text-primary": k
86
+ } : {}, ...ue, ...C }, T = u === "checkbox" && i === "mixed" ? "mixed" : u === "radio" || u === "checkbox" ? i === !0 : void 0, V = T === void 0 && i === !0 ? !0 : void 0, Y = {
87
87
  role: u,
88
- "aria-checked": O,
89
- "aria-current": z,
88
+ "aria-checked": T,
89
+ "aria-current": V,
90
90
  "aria-label": F,
91
91
  "aria-labelledby": U,
92
92
  "aria-disabled": u && e ? !0 : void 0
93
93
  };
94
- if (s)
94
+ if (l)
95
95
  return he(n, X([]), N);
96
96
  const R = {
97
97
  role: u,
98
98
  tabIndex: te,
99
- "aria-checked": O,
100
- "aria-current": z,
99
+ "aria-checked": T,
100
+ "aria-current": V,
101
101
  "aria-label": F,
102
102
  "aria-labelledby": U
103
103
  }, fe = M(y), q = y !== void 0 || B !== void 0, x = q ? /* @__PURE__ */ E("span", { className: "flex w-full min-w-0 items-center gap-[12px]", children: [
@@ -105,7 +105,7 @@ const Ne = {
105
105
  /* @__PURE__ */ o(
106
106
  "span",
107
107
  {
108
- className: `flex flex-1 min-w-0 items-center transition-opacity ${B ? "opacity-60" : ""}`,
108
+ className: `grid flex-1 min-w-0 grid-cols-[minmax(0,1fr)] transition-opacity ${B ? "opacity-60" : ""}`,
109
109
  children: n
110
110
  }
111
111
  )
@@ -125,9 +125,9 @@ const Ne = {
125
125
  "a",
126
126
  {
127
127
  href: h,
128
- target: p,
129
- rel: J($, p),
130
- onClick: i,
128
+ target: m,
129
+ rel: J(I, m),
130
+ onClick: c,
131
131
  className: `${S} no-underline text-inherit`,
132
132
  "data-malachite-row-control": "",
133
133
  ...R,
@@ -136,12 +136,12 @@ const Ne = {
136
136
  t
137
137
  ]
138
138
  }
139
- ) : i ? /* @__PURE__ */ E(
139
+ ) : c ? /* @__PURE__ */ E(
140
140
  "button",
141
141
  {
142
- ref: V,
142
+ ref: K,
143
143
  type: "button",
144
- onClick: i,
144
+ onClick: c,
145
145
  disabled: e,
146
146
  className: S,
147
147
  "data-malachite-row-control": "",
@@ -159,14 +159,14 @@ const Ne = {
159
159
  W,
160
160
  "relative flex items-center",
161
161
  f ? "cursor-pointer" : "",
162
- k,
162
+ _,
163
163
  P ? "group/row" : "",
164
- m
164
+ b
165
165
  ].filter(Boolean).join(" "),
166
166
  style: N,
167
167
  "data-malachite-row": "",
168
168
  "data-disabled": e ? "" : void 0,
169
- ref: K,
169
+ ref: z,
170
170
  role: f ? "presentation" : void 0,
171
171
  onPointerDownCapture: f ? se : void 0,
172
172
  onPointerUpCapture: f ? de : void 0,
@@ -177,119 +177,123 @@ const Ne = {
177
177
  {
178
178
  className: `shrink-0 flex items-center ${f ? "cursor-default" : ""} ${P ? ye : ""}`,
179
179
  "data-malachite-row-slot": "",
180
- children: I
180
+ children: $
181
181
  }
182
182
  )
183
183
  ]
184
184
  }
185
185
  );
186
186
  }
187
- const T = X(
188
- j ? [...H, ce, Z] : []
187
+ const O = X(
188
+ j ? [...H, ie, Z] : []
189
189
  );
190
190
  return h && !e ? /* @__PURE__ */ o(
191
191
  "a",
192
192
  {
193
193
  href: h,
194
- target: p,
195
- rel: J($, p),
196
- onClick: i,
197
- className: `${T} no-underline text-inherit ${q ? "block" : ""}`,
194
+ target: m,
195
+ rel: J(I, m),
196
+ onClick: c,
197
+ className: `${O} no-underline text-inherit ${q ? "block" : ""}`,
198
198
  style: N,
199
199
  ...R,
200
200
  children: x
201
201
  }
202
- ) : i ? /* @__PURE__ */ o(
202
+ ) : c ? /* @__PURE__ */ o(
203
203
  "button",
204
204
  {
205
205
  type: "button",
206
- onClick: i,
206
+ onClick: c,
207
207
  disabled: e,
208
- className: T,
208
+ className: O,
209
209
  style: N,
210
210
  ...R,
211
211
  children: x
212
212
  }
213
- ) : /* @__PURE__ */ o("div", { className: T, style: N, ...Y, children: x });
214
- }, Te = ({ children: r, className: n = "", style: a }) => /* @__PURE__ */ o("div", { className: n, style: a, onClick: (e) => e.stopPropagation(), children: r }), He = 39, Ae = Object.assign(
213
+ ) : /* @__PURE__ */ o("div", { className: O, style: N, ...Y, children: x });
214
+ }, Oe = ({ children: r, className: n = "", style: a }) => /* @__PURE__ */ o("div", { className: n, style: a, onClick: (e) => e.stopPropagation(), children: r }), Xe = 39, Ae = Object.assign(
215
215
  ({
216
216
  header: r,
217
217
  children: n,
218
218
  expanded: a,
219
219
  onToggle: e,
220
- sticky: c = !1,
221
- stickyTopOffset: l = 0,
220
+ sticky: i = !1,
221
+ stickyTopOffset: s = 0,
222
222
  divider: d = !1,
223
223
  tone: w = "default",
224
- "aria-label": m,
224
+ "aria-label": b,
225
225
  className: C = "",
226
- style: s
226
+ style: l
227
227
  }) => {
228
- const i = me.useId(), b = e ? () => e(!a) : void 0;
229
- return /* @__PURE__ */ E(ee, { divider: d, tone: w, className: C, style: s, children: [
228
+ const c = be.useId(), p = e ? () => e(!a) : void 0;
229
+ return /* @__PURE__ */ E(ee, { divider: d, tone: w, className: C, style: l, children: [
230
230
  /* @__PURE__ */ E(
231
231
  "div",
232
232
  {
233
- className: `group flex items-center w-full ${b ? "cursor-pointer" : ""} ${c && a ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
234
- style: c && a ? { top: l } : void 0,
235
- onClick: b,
233
+ className: `group flex items-center w-full ${p ? "cursor-pointer" : ""} ${i && a ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
234
+ style: i && a ? { top: s } : void 0,
235
+ onClick: p,
236
236
  role: "presentation",
237
237
  children: [
238
- /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center pl-[16px] pr-[12px]", children: b && /* @__PURE__ */ o(
238
+ /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center pl-[16px] pr-[12px]", children: p && /* @__PURE__ */ o(
239
239
  "button",
240
240
  {
241
241
  type: "button",
242
242
  className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${Z}`,
243
243
  "aria-expanded": a,
244
- "aria-controls": i,
245
- "aria-label": m,
246
- onClick: (p) => {
247
- p.stopPropagation(), b();
244
+ "aria-controls": c,
245
+ "aria-label": b,
246
+ onClick: (m) => {
247
+ m.stopPropagation(), p();
248
248
  },
249
- children: /* @__PURE__ */ o(pe, { expanded: a })
249
+ children: /* @__PURE__ */ o(me, { expanded: a })
250
250
  }
251
251
  ) }),
252
252
  r
253
253
  ]
254
254
  }
255
255
  ),
256
- a && /* @__PURE__ */ o("div", { id: i, children: n })
256
+ a && /* @__PURE__ */ o("div", { id: c, children: n })
257
257
  ] });
258
258
  },
259
- { Controls: Te }
260
- ), De = {
259
+ { Controls: Oe }
260
+ ), Le = {
261
261
  default: "bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]",
262
262
  highlight: "bg-[var(--malachite-card-warm-background,rgb(244,242,240))]"
263
- }, re = ({
263
+ }, De = "relative after:pointer-events-none after:absolute after:-inset-px after:z-[9] after:rounded-[inherit] after:border after:border-solid after:[border-color:inherit] after:content-['']", re = ({
264
264
  children: r,
265
265
  padding: n = !1,
266
266
  overflow: a = "hidden",
267
267
  tone: e = "default",
268
- shadow: c = e !== "highlight",
269
- role: l,
268
+ shadow: i = e !== "highlight",
269
+ role: s,
270
270
  "aria-label": d,
271
271
  "aria-labelledby": w,
272
- className: m = "",
272
+ className: b = "",
273
273
  style: C
274
- }) => /* @__PURE__ */ o(
275
- "div",
276
- {
277
- className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${a === "clip" ? "overflow-clip" : a === "visible" ? "overflow-visible" : "overflow-hidden"} ${De[e]} ${n ? "py-3 px-4" : ""} ${m}`,
278
- style: {
279
- ...c ? { boxShadow: Oe } : {},
280
- ...ve,
281
- ...C
282
- },
283
- role: l,
284
- "aria-label": d,
285
- "aria-labelledby": w,
286
- children: r
287
- }
288
- );
274
+ }) => {
275
+ const l = a === "clip" && !i && e === "default";
276
+ return /* @__PURE__ */ o(
277
+ "div",
278
+ {
279
+ className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${l ? "overflow-visible" : a === "clip" ? "overflow-clip" : a === "visible" ? "overflow-visible" : "overflow-hidden"} ${Le[e]} ${n ? "py-3 px-4" : ""} ${l ? De : ""} ${b}`,
280
+ style: {
281
+ ...i ? { boxShadow: Te } : {},
282
+ ...l ? { clipPath: "inset(0 round var(--malachite-radius-xxl, 14px))" } : {},
283
+ ...ve,
284
+ ...C
285
+ },
286
+ role: s,
287
+ "aria-label": d,
288
+ "aria-labelledby": w,
289
+ children: r
290
+ }
291
+ );
292
+ };
289
293
  re.Row = ee;
290
294
  re.ExpandableRow = Ae;
291
295
  export {
292
- He as EXPANDABLE_ROW_LEAD_PX,
296
+ Xe as EXPANDABLE_ROW_LEAD_PX,
293
297
  re as Surface,
294
298
  Ae as SurfaceExpandableRow,
295
299
  ee as SurfaceRow,