@stackone/malachite 2.73.0 → 2.74.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,6 +1,6 @@
1
1
  import { jsx as v } from "react/jsx-runtime";
2
- import { FlexDirection as r, FlexAlign as g, FlexJustify as h, FlexGapSize as e } from "./flexTypes.js";
3
- const y = (t) => {
2
+ import { FlexDirection as a, FlexAlign as h, FlexJustify as y, FlexGapSize as e } from "./flexTypes.js";
3
+ const F = (t) => {
4
4
  switch (t) {
5
5
  case e.XSmall:
6
6
  return 8;
@@ -11,23 +11,24 @@ const y = (t) => {
11
11
  case e.Large:
12
12
  return 36;
13
13
  }
14
- }, z = ({
15
- justify: t = h.Center,
16
- align: o = g.Center,
14
+ }, D = ({
15
+ justify: t = y.Center,
16
+ align: o = h.Center,
17
17
  gapSize: i,
18
- direction: a = r.Horizontal,
18
+ direction: r = a.Horizontal,
19
19
  fullHeight: n = !1,
20
20
  grow: s = !1,
21
21
  shrink: c = !1,
22
22
  wrap: f = !1,
23
23
  width: d,
24
- id: x,
25
- children: u,
26
- className: m = ""
24
+ as: x = "div",
25
+ id: u,
26
+ children: m,
27
+ className: p = ""
27
28
  }) => {
28
- const l = i ? y(i) : void 0, p = {
29
+ const l = i ? F(i) : void 0, g = {
29
30
  display: "flex",
30
- flexDirection: a === r.Vertical ? "column" : "row",
31
+ flexDirection: r === a.Vertical ? "column" : "row",
31
32
  flexWrap: f ? "wrap" : void 0,
32
33
  justifyContent: t,
33
34
  alignItems: o,
@@ -37,9 +38,9 @@ const y = (t) => {
37
38
  minWidth: c ? 0 : void 0,
38
39
  width: d || void 0
39
40
  };
40
- return /* @__PURE__ */ v("div", { id: x, className: m, style: p, children: u });
41
+ return /* @__PURE__ */ v(x, { id: u, className: p, style: g, children: m });
41
42
  };
42
43
  export {
43
- z as default
44
+ D as default
44
45
  };
45
46
  //# sourceMappingURL=Flex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexAlign, FlexDirection, FlexGapSize, FlexJustify } from './flexTypes';\n\n\n\n\n\ninterface FlexProps {\n justify?: FlexJustify;\n align?: FlexAlign;\n gapSize?: FlexGapSize;\n direction?: FlexDirection;\n fullHeight?: boolean;\n grow?: boolean;\n shrink?: boolean;\n wrap?: boolean;\n width?: string;\n id?: string;\n children?: React.ReactNode;\n className?: string;\n}\n\nconst getGapSize = (size: FlexGapSize): number => {\n switch (size) {\n case FlexGapSize.XSmall:\n return 8;\n case FlexGapSize.Small:\n return 12;\n case FlexGapSize.Medium:\n return 24;\n case FlexGapSize.Large:\n return 36;\n }\n};\n\nconst Flex: React.FC<FlexProps> = ({\n justify = FlexJustify.Center,\n align = FlexAlign.Center,\n gapSize,\n direction = FlexDirection.Horizontal,\n fullHeight = false,\n grow = false,\n shrink = false,\n wrap = false,\n width,\n id,\n children,\n className = '',\n}) => {\n const gapSizeValue = gapSize ? getGapSize(gapSize) : undefined;\n\n // Convert direction to CSS flex-direction\n const flexDirection = direction === FlexDirection.Vertical ? 'column' : 'row';\n\n const baseStyle: React.CSSProperties = {\n display: 'flex',\n flexDirection,\n flexWrap: wrap ? 'wrap' : undefined,\n justifyContent: justify,\n alignItems: align,\n gap: gapSizeValue ? `${gapSizeValue}px` : undefined,\n height: fullHeight ? '100%' : undefined,\n flex: grow ? 1 : undefined,\n minWidth: shrink ? 0 : undefined,\n width: width || undefined,\n };\n\n return (\n <div id={id} className={className} style={baseStyle}>\n {children}\n </div>\n );\n};\n\nexport default Flex;\n"],"names":["getGapSize","size","FlexGapSize","Flex","justify","FlexJustify","align","FlexAlign","gapSize","direction","FlexDirection","fullHeight","grow","shrink","wrap","width","id","children","className","gapSizeValue","baseStyle"],"mappings":";;AAsBA,MAAMA,IAAa,CAACC,MAA8B;AAC9C,UAAQA,GAAA;AAAA,IACJ,KAAKC,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAA4B,CAAC;AAAA,EAC/B,SAAAC,IAAUC,EAAY;AAAA,EACtB,OAAAC,IAAQC,EAAU;AAAA,EAClB,SAAAC;AAAA,EACA,WAAAC,IAAYC,EAAc;AAAA,EAC1B,YAAAC,IAAa;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MAAM;AACF,QAAMC,IAAeX,IAAUR,EAAWQ,CAAO,IAAI,QAK/CY,IAAiC;AAAA,IACnC,SAAS;AAAA,IACT,eAJkBX,MAAcC,EAAc,WAAW,WAAW;AAAA,IAKpE,UAAUI,IAAO,SAAS;AAAA,IAC1B,gBAAgBV;AAAA,IAChB,YAAYE;AAAA,IACZ,KAAKa,IAAe,GAAGA,CAAY,OAAO;AAAA,IAC1C,QAAQR,IAAa,SAAS;AAAA,IAC9B,MAAMC,IAAO,IAAI;AAAA,IACjB,UAAUC,IAAS,IAAI;AAAA,IACvB,OAAOE,KAAS;AAAA,EAAA;AAGpB,2BACK,OAAA,EAAI,IAAAC,GAAQ,WAAAE,GAAsB,OAAOE,GACrC,UAAAH,GACL;AAER;"}
1
+ {"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexAlign, FlexDirection, FlexGapSize, FlexJustify } from './flexTypes';\n\ninterface FlexProps {\n justify?: FlexJustify;\n align?: FlexAlign;\n gapSize?: FlexGapSize;\n direction?: FlexDirection;\n fullHeight?: boolean;\n grow?: boolean;\n shrink?: boolean;\n wrap?: boolean;\n width?: string;\n id?: string;\n /** `span` for content inside a button, such as a clickable `Surface.Row`. */\n as?: 'div' | 'span';\n children?: React.ReactNode;\n className?: string;\n}\n\nconst getGapSize = (size: FlexGapSize): number => {\n switch (size) {\n case FlexGapSize.XSmall:\n return 8;\n case FlexGapSize.Small:\n return 12;\n case FlexGapSize.Medium:\n return 24;\n case FlexGapSize.Large:\n return 36;\n }\n};\n\nconst Flex: React.FC<FlexProps> = ({\n justify = FlexJustify.Center,\n align = FlexAlign.Center,\n gapSize,\n direction = FlexDirection.Horizontal,\n fullHeight = false,\n grow = false,\n shrink = false,\n wrap = false,\n width,\n as = 'div',\n id,\n children,\n className = '',\n}) => {\n const gapSizeValue = gapSize ? getGapSize(gapSize) : undefined;\n\n // Convert direction to CSS flex-direction\n const flexDirection = direction === FlexDirection.Vertical ? 'column' : 'row';\n\n const baseStyle: React.CSSProperties = {\n display: 'flex',\n flexDirection,\n flexWrap: wrap ? 'wrap' : undefined,\n justifyContent: justify,\n alignItems: align,\n gap: gapSizeValue ? `${gapSizeValue}px` : undefined,\n height: fullHeight ? '100%' : undefined,\n flex: grow ? 1 : undefined,\n minWidth: shrink ? 0 : undefined,\n width: width || undefined,\n };\n\n const Tag = as;\n return (\n <Tag id={id} className={className} style={baseStyle}>\n {children}\n </Tag>\n );\n};\n\nexport default Flex;\n"],"names":["getGapSize","size","FlexGapSize","Flex","justify","FlexJustify","align","FlexAlign","gapSize","direction","FlexDirection","fullHeight","grow","shrink","wrap","width","as","id","children","className","gapSizeValue","baseStyle"],"mappings":";;AAoBA,MAAMA,IAAa,CAACC,MAA8B;AAC9C,UAAQA,GAAA;AAAA,IACJ,KAAKC,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAA4B,CAAC;AAAA,EAC/B,SAAAC,IAAUC,EAAY;AAAA,EACtB,OAAAC,IAAQC,EAAU;AAAA,EAClB,SAAAC;AAAA,EACA,WAAAC,IAAYC,EAAc;AAAA,EAC1B,YAAAC,IAAa;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,IAAAC,IAAK;AAAA,EACL,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MAAM;AACF,QAAMC,IAAeZ,IAAUR,EAAWQ,CAAO,IAAI,QAK/Ca,IAAiC;AAAA,IACnC,SAAS;AAAA,IACT,eAJkBZ,MAAcC,EAAc,WAAW,WAAW;AAAA,IAKpE,UAAUI,IAAO,SAAS;AAAA,IAC1B,gBAAgBV;AAAA,IAChB,YAAYE;AAAA,IACZ,KAAKc,IAAe,GAAGA,CAAY,OAAO;AAAA,IAC1C,QAAQT,IAAa,SAAS;AAAA,IAC9B,MAAMC,IAAO,IAAI;AAAA,IACjB,UAAUC,IAAS,IAAI;AAAA,IACvB,OAAOE,KAAS;AAAA,EAAA;AAIpB,2BADYC,GAEP,EAAI,IAAAC,GAAQ,WAAAE,GAAsB,OAAOE,GACrC,UAAAH,GACL;AAER;"}
@@ -0,0 +1,91 @@
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(
9
+ ({
10
+ variant: p = "filled",
11
+ size: t = "medium",
12
+ children: b,
13
+ leading: n,
14
+ trailing: r,
15
+ onClick: C,
16
+ type: x = "button",
17
+ loading: o = !1,
18
+ disabled: h = !1,
19
+ flexGrow: l = !1,
20
+ menuLabel: N,
21
+ menuOpen: a,
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 = [
31
+ "flex items-center justify-center",
32
+ T(t),
33
+ f,
34
+ A,
35
+ l ? "flex-1" : "",
36
+ m
37
+ ].filter(Boolean).join(" "), w = [
38
+ "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(
45
+ "button",
46
+ {
47
+ ref: y,
48
+ type: "button",
49
+ disabled: s,
50
+ "aria-label": N,
51
+ "aria-haspopup": v ? "menu" : void 0,
52
+ "aria-expanded": a,
53
+ onClick: S,
54
+ className: w,
55
+ children: g ?? (a ? /* @__PURE__ */ e(M, {}) : /* @__PURE__ */ e(G, {}))
56
+ }
57
+ );
58
+ return /* @__PURE__ */ d(
59
+ "span",
60
+ {
61
+ className: `inline-flex items-stretch${l ? " w-full" : ""}${c ? ` ${c}` : ""}`,
62
+ style: I,
63
+ children: [
64
+ /* @__PURE__ */ d(
65
+ "button",
66
+ {
67
+ ref: j,
68
+ type: x,
69
+ disabled: s,
70
+ onClick: C,
71
+ className: E,
72
+ 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
77
+ ]
78
+ }
79
+ ),
80
+ i ? i(u) : u
81
+ ]
82
+ }
83
+ );
84
+ }
85
+ );
86
+ V.displayName = "SplitButton";
87
+ export {
88
+ V as SplitButton,
89
+ V as default
90
+ };
91
+ //# sourceMappingURL=SplitButton.js.map
@@ -0,0 +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?: ButtonVariant;\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","jsxs","ButtonSpinner"],"mappings":";;;;;;;AAoCA,MAAMA,IAAe,0DACfC,IACF,sIAGSC,IAAcC;AAAA,EACvB,CACI;AAAA,IACI,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,EAAA,GAEJC,MACC;AACD,UAAMC,IAAaZ,KAAYD,GACzBc,IAAcC,EAAsBrB,GAAM,EAAK,GAC/CsB,IAAiBC,EAAkBxB,GAASqB,CAAW,GACvDI,IAAgBL,IAAa,uBAAuB,IAEpDM,IAAc;AAAA,MAChB;AAAA,MACAC,EAAe1B,CAAI;AAAA,MACnBsB;AAAA,MACA3B;AAAA,MACAa,IAAW,WAAW;AAAA,MACtBgB;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAEPG,IAAiB;AAAA,MACnB;AAAA,MACAC,EAAuB5B,CAAI;AAAA,MAC3BsB;AAAA,MACA1B;AAAA,MACAiC,EAAiB7B,CAAI;AAAA,MACrBwB;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAEPM,IACF,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAKjB;AAAA,QACL,MAAK;AAAA,QACL,UAAUK;AAAA,QACV,cAAYV;AAAA,QACZ,iBAAeI,IAAe,SAAS;AAAA,QACvC,iBAAeH;AAAA,QACf,SAASC;AAAA,QACT,WAAWgB;AAAA,QAEV,gBAAajB,IAAW,gBAAAqB,EAACC,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,24 +1,24 @@
1
- import { jsx as o, jsxs as _ } from "react/jsx-runtime";
2
- import z from "react";
3
- import { paintOnChild as K } from "./asChild.js";
1
+ import { jsx as o, jsxs as O } from "react/jsx-runtime";
2
+ import K from "react";
4
3
  import { DisclosureArrow as V } from "./DisclosureArrow.js";
5
- import { FOCUS_RING_INSET as B } from "./focusRing.js";
6
- import { resolveRel as L } from "./linkRel.js";
7
- import { safeHref as q } from "./safeHref.js";
4
+ import { paintOnChild as q } from "./asChild.js";
5
+ import { FOCUS_RING_INSET as j } from "./focusRing.js";
6
+ import { resolveRel as I } from "./linkRel.js";
8
7
  import { isRenderableNode as J } from "./renderableNode.js";
9
- import { FOREGROUND_RESET as M, SELECTED_TEXT_CONTEXT as Q, SELECTED_ROW_ACCENT as Y, SELECTED_ROW_FOREGROUND as Z, SELECTED_ROW_BACKGROUND as I } from "./selectedRow.js";
10
- const ee = {
8
+ import { safeHref as M } from "./safeHref.js";
9
+ import { FOREGROUND_RESET as Q, SELECTED_TEXT_CONTEXT as Y, SELECTED_ROW_ACCENT as Z, SELECTED_ROW_FOREGROUND as ee, SELECTED_ROW_BACKGROUND as B } from "./selectedRow.js";
10
+ const ae = {
11
11
  none: "",
12
12
  compact: "px-[16px] py-[8px]"
13
- }, ae = {
13
+ }, re = {
14
14
  default: "",
15
15
  muted: "bg-[var(--malachite-card-dimmed-background)]",
16
16
  success: "bg-[var(--malachite-tag-success-background)]",
17
17
  error: "bg-[var(--malachite-tag-error-background)]"
18
- }, re = {
18
+ }, oe = {
19
19
  success: "var(--malachite-tag-success-foreground)",
20
20
  error: "var(--malachite-tag-error-foreground)"
21
- }, oe = "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", 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)", j = (t) => {
21
+ }, te = "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", le = "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)", F = (t) => {
22
22
  const {
23
23
  children: a,
24
24
  divider: r = !1,
@@ -28,32 +28,32 @@ const ee = {
28
28
  tone: s = "default",
29
29
  inset: m = "none",
30
30
  className: f = "",
31
- style: C
31
+ style: N
32
32
  } = t, c = t.asChild === !0, {
33
33
  onClick: l,
34
34
  href: b,
35
35
  target: u,
36
- rel: O,
37
- trailing: T,
38
- revealTrailing: $,
36
+ rel: T,
37
+ trailing: $,
38
+ revealTrailing: D,
39
39
  role: i
40
- } = c ? {} : t, h = q(b), x = c ? void 0 : t["aria-label"], v = c ? void 0 : t["aria-labelledby"], N = !!(l || h), P = e && (N || c) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", G = s !== "default", U = ae[s], w = !c && J(T), S = ee[m], W = S && !w ? "" : "p-0", D = [
40
+ } = c ? {} : t, h = M(b), x = c ? void 0 : t["aria-label"], v = c ? void 0 : t["aria-labelledby"], y = c ? void 0 : t.tabIndex, w = !!(l || h), G = e && (w || c) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", U = s !== "default", W = re[s], S = !c && J($), R = ae[m], X = R && !S ? "" : "p-0", A = [
41
41
  "w-full text-left border-0",
42
- U,
42
+ W,
43
43
  r ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
44
- P
45
- ].filter(Boolean).join(" "), R = [
46
- N ? `appearance-none ${G ? "" : "bg-transparent"} ${W} ${B}` : "",
47
- N && !e ? "cursor-pointer" : ""
48
- ].filter(Boolean).join(" "), y = [D, R, w ? "" : S, f].filter(Boolean).join(" "), X = n === !0 && (d ? d === "highlight" : i !== "checkbox") ? {
49
- backgroundImage: `linear-gradient(${I}, ${I})`,
50
- color: Z,
51
- boxShadow: `inset 2px 0 0 ${Y}`,
52
- ...Q
53
- } : {}, k = re[s], g = { ...k ? {
54
- color: k,
55
- "--malachite-ctx-text-primary": k
56
- } : {}, ...X, ...C }, p = i === "checkbox" && n === "mixed" ? "mixed" : i === "radio" || i === "checkbox" ? n === !0 : void 0, E = p === void 0 && n === !0 ? !0 : void 0, A = {
44
+ G
45
+ ].filter(Boolean).join(" "), k = [
46
+ w ? `appearance-none ${U ? "" : "bg-transparent"} ${X} ${j}` : "",
47
+ w && !e ? "cursor-pointer" : ""
48
+ ].filter(Boolean).join(" "), C = [A, k, S ? "" : R, f].filter(Boolean).join(" "), H = n === !0 && (d ? d === "highlight" : i !== "checkbox") ? {
49
+ backgroundImage: `linear-gradient(${B}, ${B})`,
50
+ color: ee,
51
+ boxShadow: `inset 2px 0 0 ${Z}`,
52
+ ...Y
53
+ } : {}, _ = oe[s], g = { ..._ ? {
54
+ color: _,
55
+ "--malachite-ctx-text-primary": _
56
+ } : {}, ...H, ...N }, p = i === "checkbox" && n === "mixed" ? "mixed" : i === "radio" || i === "checkbox" ? n === !0 : void 0, E = p === void 0 && n === !0 ? !0 : void 0, L = {
57
57
  role: i,
58
58
  "aria-checked": p,
59
59
  "aria-current": E,
@@ -62,17 +62,18 @@ const ee = {
62
62
  "aria-disabled": i && e ? !0 : void 0
63
63
  };
64
64
  if (c)
65
- return K(a, y, g);
66
- if (w) {
67
- const H = h && !e ? /* @__PURE__ */ o(
65
+ return q(a, C, g);
66
+ if (S) {
67
+ const z = h && !e ? /* @__PURE__ */ o(
68
68
  "a",
69
69
  {
70
70
  href: h,
71
71
  target: u,
72
- rel: L(O, u),
72
+ rel: I(T, u),
73
73
  onClick: l,
74
- className: `${R} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
74
+ className: `${k} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
75
75
  role: i,
76
+ tabIndex: y,
76
77
  "aria-checked": p,
77
78
  "aria-current": E,
78
79
  "aria-label": x,
@@ -85,8 +86,9 @@ const ee = {
85
86
  type: "button",
86
87
  onClick: l,
87
88
  disabled: e,
88
- className: `${R} border-0 flex-1 min-w-0 text-left`,
89
+ className: `${k} border-0 flex-1 min-w-0 text-left`,
89
90
  role: i,
91
+ tabIndex: y,
90
92
  "aria-checked": p,
91
93
  "aria-current": E,
92
94
  "aria-label": x,
@@ -96,26 +98,26 @@ const ee = {
96
98
  ) : (
97
99
  // The set goes here, not on the wrapper: `radio` and `checkbox` make their
98
100
  // descendants presentational, which would bury a control in the trailing slot.
99
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...A, children: a })
101
+ /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...L, children: a })
100
102
  );
101
- return /* @__PURE__ */ _(
103
+ return /* @__PURE__ */ O(
102
104
  "div",
103
105
  {
104
106
  className: [
105
- D,
107
+ A,
106
108
  "flex items-center",
107
- S,
108
- $ ? "group/row" : "",
109
+ R,
110
+ D ? "group/row" : "",
109
111
  f
110
112
  ].filter(Boolean).join(" "),
111
113
  style: g,
112
114
  children: [
113
- H,
115
+ z,
114
116
  /* @__PURE__ */ o(
115
117
  "div",
116
118
  {
117
- className: `shrink-0 flex items-center ${$ ? oe : ""}`,
118
- children: T
119
+ className: `shrink-0 flex items-center ${D ? te : ""}`,
120
+ children: $
119
121
  }
120
122
  )
121
123
  ]
@@ -127,11 +129,12 @@ const ee = {
127
129
  {
128
130
  href: h,
129
131
  target: u,
130
- rel: L(O, u),
132
+ rel: I(T, u),
131
133
  onClick: l,
132
- className: `${y} no-underline text-inherit`,
134
+ className: `${C} no-underline text-inherit`,
133
135
  style: g,
134
136
  role: i,
137
+ tabIndex: y,
135
138
  "aria-checked": p,
136
139
  "aria-current": E,
137
140
  "aria-label": x,
@@ -144,17 +147,18 @@ const ee = {
144
147
  type: "button",
145
148
  onClick: l,
146
149
  disabled: e,
147
- className: y,
150
+ className: C,
148
151
  style: g,
149
152
  role: i,
153
+ tabIndex: y,
150
154
  "aria-checked": p,
151
155
  "aria-current": E,
152
156
  "aria-label": x,
153
157
  "aria-labelledby": v,
154
158
  children: a
155
159
  }
156
- ) : /* @__PURE__ */ o("div", { className: y, style: g, ...A, children: a });
157
- }, le = ({ children: t, className: a = "", style: r }) => /* @__PURE__ */ o("div", { className: a, style: r, onClick: (e) => e.stopPropagation(), children: t }), ve = 39, ie = Object.assign(
160
+ ) : /* @__PURE__ */ o("div", { className: C, style: g, ...L, children: a });
161
+ }, ie = ({ children: t, className: a = "", style: r }) => /* @__PURE__ */ o("div", { className: a, style: r, onClick: (e) => e.stopPropagation(), children: t }), ge = 39, ne = Object.assign(
158
162
  ({
159
163
  header: t,
160
164
  children: a,
@@ -165,12 +169,12 @@ const ee = {
165
169
  divider: s = !1,
166
170
  tone: m = "default",
167
171
  "aria-label": f,
168
- className: C = "",
172
+ className: N = "",
169
173
  style: c
170
174
  }) => {
171
- const l = z.useId(), b = e ? () => e(!r) : void 0;
172
- return /* @__PURE__ */ _(j, { divider: s, tone: m, className: C, style: c, children: [
173
- /* @__PURE__ */ _(
175
+ const l = K.useId(), b = e ? () => e(!r) : void 0;
176
+ return /* @__PURE__ */ O(F, { divider: s, tone: m, className: N, style: c, children: [
177
+ /* @__PURE__ */ O(
174
178
  "div",
175
179
  {
176
180
  className: `group flex items-center w-full ${b ? "cursor-pointer" : ""} ${n && r ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
@@ -182,7 +186,7 @@ const ee = {
182
186
  "button",
183
187
  {
184
188
  type: "button",
185
- className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${B}`,
189
+ className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${j}`,
186
190
  "aria-expanded": r,
187
191
  "aria-controls": l,
188
192
  "aria-label": f,
@@ -199,8 +203,8 @@ const ee = {
199
203
  r && /* @__PURE__ */ o("div", { id: l, children: a })
200
204
  ] });
201
205
  },
202
- { Controls: le }
203
- ), F = ({
206
+ { Controls: ie }
207
+ ), P = ({
204
208
  children: t,
205
209
  padding: a = !1,
206
210
  overflow: r = "hidden",
@@ -213,20 +217,20 @@ const ee = {
213
217
  "div",
214
218
  {
215
219
  className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${r === "clip" ? "overflow-clip" : r === "visible" ? "overflow-visible" : "overflow-hidden"} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${a ? "py-3 px-4" : ""} ${s}`,
216
- style: { boxShadow: te, ...M, ...m },
220
+ style: { boxShadow: le, ...Q, ...m },
217
221
  role: e,
218
222
  "aria-label": n,
219
223
  "aria-labelledby": d,
220
224
  children: t
221
225
  }
222
226
  );
223
- F.Row = j;
224
- F.ExpandableRow = ie;
227
+ P.Row = F;
228
+ P.ExpandableRow = ne;
225
229
  export {
226
- ve as EXPANDABLE_ROW_LEAD_PX,
227
- F as Surface,
228
- ie as SurfaceExpandableRow,
229
- j as SurfaceRow,
230
- F as default
230
+ ge as EXPANDABLE_ROW_LEAD_PX,
231
+ P as Surface,
232
+ ne as SurfaceExpandableRow,
233
+ F as SurfaceRow,
234
+ P as default
231
235
  };
232
236
  //# sourceMappingURL=Surface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React from 'react';\nimport { paintOnChild } from './asChild';\nimport DisclosureArrow from './DisclosureArrow';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { safeHref } from './safeHref';\nimport { isRenderableNode } from './renderableNode';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `announce` leaves the\n * visual to a control inside the row and only sets the ARIA state. Defaults to `announce`\n * under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success` and `error` are for a row that carries\n * an outcome, where the result belongs to the whole line rather than to one cell in it.\n */\n tone?: 'default' | 'muted' | 'success' | 'error';\n /** `compact` is an 8px by 16px inset the row owns. */\n inset?: 'none' | 'compact';\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst INSET_CLASSES: Record<NonNullable<SurfaceRowChromeProps['inset']>, string> = {\n none: '',\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background)]',\n error: 'bg-[var(--malachite-tag-error-background)]',\n};\n\n/**\n * The text an outcome tone carries with it, through the same context channel a selected row\n * uses, so `Typography` inside the row follows the tint instead of staying near-black on it.\n * `color` as well, for row content that is not Typography.\n *\n * Only the outcome tones. `muted` dims its subject rather than recolouring it, and its\n * foreground is the ordinary one.\n */\nconst TONE_FOREGROUNDS: Partial<Record<NonNullable<SurfaceRowProps['tone']>, string>> = {\n success: 'var(--malachite-tag-success-foreground)',\n error: 'var(--malachite-tag-error-foreground)',\n};\n\nexport interface SurfaceRowAsChildProps extends SurfaceRowChromeProps {\n asChild: true;\n children: React.ReactElement;\n}\n\nexport type AnySurfaceRowProps = SurfaceRowProps | SurfaceRowAsChildProps;\n\n// Not `group-hover` or `group-has-[:focus-visible]`: WebKit never applies the first (its\n// `@media (hover: hover)` nested in the group selector) nor the second inside a shadow root,\n// so the control stayed hidden in Safari. An open menu takes focus out of the row into a\n// portal, and would otherwise lose its trigger.\nconst REVEALED_ON_INTERACTION =\n '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';\n\nconst TRIPLE_SHADOW =\n '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)';\n\n/**\n * A single full-bleed row inside a <Surface>. Owns the row chrome — hover\n * highlight, colour transition and an optional bottom divider — so consumers\n * compose their own content inside without re-implementing design-system styling.\n * Pass `onClick`/`href` to make the entire row clickable (rendered as a real\n * button/anchor, so keyboard navigation works natively).\n */\nconst SurfaceRow: React.FC<AnySurfaceRowProps> = (props) => {\n const {\n children,\n divider = false,\n disabled = false,\n selected,\n selection,\n tone = 'default',\n inset = 'none',\n className = '',\n style,\n } = props;\n const asChild = props.asChild === true;\n const {\n onClick,\n href: rawHref,\n target,\n rel,\n trailing,\n revealTrailing,\n role,\n } = asChild ? ({} as SurfaceRowProps) : (props as SurfaceRowProps);\n // A rejected href (e.g. `javascript:`) leaves the row a button or a plain row, never an anchor.\n const href = safeHref(rawHref);\n const ariaLabel = asChild ? undefined : (props as SurfaceRowProps)['aria-label'];\n const ariaLabelledBy = asChild ? undefined : (props as SurfaceRowProps)['aria-labelledby'];\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover =\n disabled && (interactive || asChild)\n ? ''\n : 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]';\n\n // A class, not an inline colour, which would outrank the hover utility. It replaces the\n // button reset's `bg-transparent` rather than joining it: same specificity, so the winner\n // would be whichever Tailwind emitted last.\n const tinted = tone !== 'default';\n const toneClass = TONE_CLASSES[tone];\n\n const hasTrailing = !asChild && isRenderableNode(trailing);\n const insetClass = INSET_CLASSES[inset];\n const controlPadding = insetClass && !hasTrailing ? '' : 'p-0';\n\n const chromeClasses = [\n 'w-full text-left border-0',\n toneClass,\n divider ? 'border-b border-solid border-[var(--malachite-card-border)]' : '',\n hover,\n ]\n .filter(Boolean)\n .join(' ');\n\n const controlClasses = [\n interactive\n ? `appearance-none ${tinted ? '' : 'bg-transparent'} ${controlPadding} ${FOCUS_RING_INSET}`\n : '',\n interactive && !disabled ? 'cursor-pointer' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const classes = [chromeClasses, controlClasses, hasTrailing ? '' : insetClass, className]\n .filter(Boolean)\n .join(' ');\n\n const paints = selection ? selection === 'highlight' : role !== 'checkbox';\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}`,\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, classes, rowStyle);\n }\n\n if (hasTrailing) {\n const control =\n href && !disabled ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left no-underline text-inherit`}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </a>\n ) : onClick ? (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left`}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\n ) : (\n // The set goes here, not on the wrapper: `radio` and `checkbox` make their\n // descendants presentational, which would bury a control in the trailing slot.\n <div className=\"flex-1 min-w-0\" {...rowFallbackAria}>\n {children}\n </div>\n );\n\n return (\n <div\n className={[\n chromeClasses,\n 'flex items-center',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n >\n {trailing}\n </div>\n </div>\n );\n }\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${classes} no-underline text-inherit`}\n style={rowStyle}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </a>\n );\n }\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={classes}\n style={rowStyle}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {children}\n </div>\n );\n};\n\nexport interface SurfaceExpandableRowProps {\n /** The row itself, laid out across the line. May hold its own controls. */\n header: React.ReactNode;\n /** The body, rendered beneath the row while it is open. */\n children?: React.ReactNode;\n expanded: boolean;\n /** Omit for a row that cannot open. The arrow's space is still reserved, so a list of\n * rows stays in one column whether or not each one has a body. */\n onToggle?: (expanded: boolean) => void;\n /**\n * Pins the row while its body scrolls, so a long body never leaves the reader without\n * the line it belongs to. Offset by whatever is already pinned above it.\n */\n sticky?: boolean;\n stickyTopOffset?: number;\n divider?: boolean;\n tone?: SurfaceRowProps['tone'];\n /** Names the disclosure control, which is otherwise only an arrow. */\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Stops a click inside it from toggling the row, for the cells that hold controls.\n *\n * Explicit rather than sniffing the event's target for an interactive ancestor: a control\n * rendering into a shadow root retargets the event to its host, so the sniff would miss\n * exactly the components most likely to sit in a row.\n */\nconst ExpandableRowControls: React.FC<{\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ children, className = '', style }) => (\n <div className={className} style={style} onClick={(event) => event.stopPropagation()}>\n {children}\n </div>\n);\n\n/**\n * A row that opens to reveal a body, for a line that carries its own controls.\n *\n * Not `Accordion`: that puts its header inside the toggle button, so a header holding a\n * dropdown or a second button is invalid. Here the row surface takes the click and a cell\n * opts out with `ExpandableRow.Controls`, while the arrow stays a real button so the\n * keyboard reaches it.\n */\n/**\n * The space before the header: the arrow's own inset, its glyph and the gap after it.\n * Exported so a consumer aligning a column header above these rows offsets by the same\n * amount instead of guessing at it.\n */\nexport const EXPANDABLE_ROW_LEAD_PX = 39;\n\nconst SurfaceExpandableRow: React.FC<SurfaceExpandableRowProps> & {\n Controls: typeof ExpandableRowControls;\n} = Object.assign(\n ({\n header,\n children,\n expanded,\n onToggle,\n sticky = false,\n stickyTopOffset = 0,\n divider = false,\n tone = 'default',\n 'aria-label': ariaLabel,\n className = '',\n style,\n }: SurfaceExpandableRowProps) => {\n const bodyId = React.useId();\n const toggle = onToggle ? () => onToggle(!expanded) : undefined;\n\n return (\n <SurfaceRow divider={divider} tone={tone} className={className} style={style}>\n {/* `group` so the arrow takes its hover state from the whole row. */}\n <div\n className={`group flex items-center w-full ${toggle ? 'cursor-pointer' : ''} ${\n sticky && expanded\n ? 'sticky z-[1] bg-[var(--malachite-card-background)]'\n : ''\n }`}\n style={sticky && expanded ? { top: stickyTopOffset } : undefined}\n // Presentational: the arrow below is the keyboard control, and this only\n // widens the pointer target.\n onClick={toggle}\n role=\"presentation\"\n >\n {/* Reserved whether or not this row opens, so a list stays in one column.\n The inset and gap match Accordion's header. */}\n <span className=\"shrink-0 flex items-center pl-[16px] pr-[12px]\">\n {toggle && (\n <button\n type=\"button\"\n className={`appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${FOCUS_RING_INSET}`}\n aria-expanded={expanded}\n aria-controls={bodyId}\n aria-label={ariaLabel}\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n >\n <DisclosureArrow expanded={expanded} />\n </button>\n )}\n </span>\n {header}\n </div>\n {expanded && <div id={bodyId}>{children}</div>}\n </SurfaceRow>\n );\n },\n { Controls: ExpandableRowControls },\n);\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<AnySurfaceRowProps>;\n ExpandableRow: typeof SurfaceExpandableRow;\n}\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const overflowClass =\n overflow === 'clip'\n ? 'overflow-clip'\n : overflow === 'visible'\n ? 'overflow-visible'\n : 'overflow-hidden';\n return (\n <div\n className={`w-full rounded-[var(--malachite-radius-xxl,14px)] ${overflowClass} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${padding ? 'py-3 px-4' : ''} ${className}`}\n style={{ boxShadow: TRIPLE_SHADOW, ...FOREGROUND_RESET, ...style }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","selected","selection","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","role","href","safeHref","ariaLabel","ariaLabelledBy","interactive","hover","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlClasses","FOCUS_RING_INSET","classes","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","control","jsx","resolveRel","jsxs","ExpandableRowControls","event","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","Surface","padding","overflow","FOREGROUND_RESET"],"mappings":";;;;;;;;;AA4DA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA,EACN,SAAS;AACb,GAmCMC,KAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,KAAkF;AAAA,EACpF,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,KACF,0KAEEC,KACF,yGASEC,IAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,EAAA,IACAT,GACEU,IAAUV,EAAM,YAAY,IAC5B;AAAA,IACF,SAAAW;AAAA,IACA,MAAMC;AAAA,IACN,QAAAC;AAAA,IACA,KAAAC;AAAA,IACA,UAAAC;AAAA,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ER;AAAA,EACA,EAAE,UAAUgD,GAAA;AAChB,GAOMa,IAAW,CAAC;AAAA,EACd,UAAA7D;AAAA,EACA,SAAA8D,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,MAAA/C;AAAA,EACA,cAAcG;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAb,IAAY;AAAA,EACZ,OAAAC;AACJ,MASQ,gBAAAqC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,qDAPfkB,MAAa,SACP,kBACAA,MAAa,YACX,qBACA,iBAGyE,oGAAoGD,IAAU,cAAc,EAAE,IAAIvD,CAAS;AAAA,IACxN,OAAO,EAAE,WAAWV,IAAe,GAAGmE,GAAkB,GAAGxD,EAAA;AAAA,IAC3D,MAAAQ;AAAA,IACA,cAAYG;AAAA,IACZ,mBAAiBC;AAAA,IAEhB,UAAApB;AAAA,EAAA;AAAA;AAKb6D,EAAQ,MAAM/D;AACd+D,EAAQ,gBAAgBV;"}
1
+ {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { paintOnChild } from './asChild';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `announce` leaves the\n * visual to a control inside the row and only sets the ARIA state. Defaults to `announce`\n * under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success` and `error` are for a row that carries\n * an outcome, where the result belongs to the whole line rather than to one cell in it.\n */\n tone?: 'default' | 'muted' | 'success' | 'error';\n /** `compact` is an 8px by 16px inset the row owns. */\n inset?: 'none' | 'compact';\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst INSET_CLASSES: Record<NonNullable<SurfaceRowChromeProps['inset']>, string> = {\n none: '',\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `-1` takes the row out of the Tab order, for a roving radio group. */\n tabIndex?: number;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background)]',\n error: 'bg-[var(--malachite-tag-error-background)]',\n};\n\n/**\n * The text an outcome tone carries with it, through the same context channel a selected row\n * uses, so `Typography` inside the row follows the tint instead of staying near-black on it.\n * `color` as well, for row content that is not Typography.\n *\n * Only the outcome tones. `muted` dims its subject rather than recolouring it, and its\n * foreground is the ordinary one.\n */\nconst TONE_FOREGROUNDS: Partial<Record<NonNullable<SurfaceRowProps['tone']>, string>> = {\n success: 'var(--malachite-tag-success-foreground)',\n error: 'var(--malachite-tag-error-foreground)',\n};\n\nexport interface SurfaceRowAsChildProps extends SurfaceRowChromeProps {\n asChild: true;\n children: React.ReactElement;\n}\n\nexport type AnySurfaceRowProps = SurfaceRowProps | SurfaceRowAsChildProps;\n\n// Not `group-hover` or `group-has-[:focus-visible]`: WebKit never applies the first (its\n// `@media (hover: hover)` nested in the group selector) nor the second inside a shadow root,\n// so the control stayed hidden in Safari. An open menu takes focus out of the row into a\n// portal, and would otherwise lose its trigger.\nconst REVEALED_ON_INTERACTION =\n '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';\n\nconst TRIPLE_SHADOW =\n '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)';\n\n/**\n * A single full-bleed row inside a <Surface>. Owns the row chrome — hover\n * highlight, colour transition and an optional bottom divider — so consumers\n * compose their own content inside without re-implementing design-system styling.\n * Pass `onClick`/`href` to make the entire row clickable (rendered as a real\n * button/anchor, so keyboard navigation works natively).\n */\nconst SurfaceRow: React.FC<AnySurfaceRowProps> = (props) => {\n const {\n children,\n divider = false,\n disabled = false,\n selected,\n selection,\n tone = 'default',\n inset = 'none',\n className = '',\n style,\n } = props;\n const asChild = props.asChild === true;\n const {\n onClick,\n href: rawHref,\n target,\n rel,\n trailing,\n revealTrailing,\n role,\n } = asChild ? ({} as SurfaceRowProps) : (props as SurfaceRowProps);\n // A rejected href (e.g. `javascript:`) leaves the row a button or a plain row, never an anchor.\n const href = safeHref(rawHref);\n const ariaLabel = asChild ? undefined : (props as SurfaceRowProps)['aria-label'];\n const ariaLabelledBy = asChild ? undefined : (props as SurfaceRowProps)['aria-labelledby'];\n const tabIndex = asChild ? undefined : (props as SurfaceRowProps).tabIndex;\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover =\n disabled && (interactive || asChild)\n ? ''\n : 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]';\n\n // A class, not an inline colour, which would outrank the hover utility. It replaces the\n // button reset's `bg-transparent` rather than joining it: same specificity, so the winner\n // would be whichever Tailwind emitted last.\n const tinted = tone !== 'default';\n const toneClass = TONE_CLASSES[tone];\n\n const hasTrailing = !asChild && isRenderableNode(trailing);\n const insetClass = INSET_CLASSES[inset];\n const controlPadding = insetClass && !hasTrailing ? '' : 'p-0';\n\n const chromeClasses = [\n 'w-full text-left border-0',\n toneClass,\n divider ? 'border-b border-solid border-[var(--malachite-card-border)]' : '',\n hover,\n ]\n .filter(Boolean)\n .join(' ');\n\n const controlClasses = [\n interactive\n ? `appearance-none ${tinted ? '' : 'bg-transparent'} ${controlPadding} ${FOCUS_RING_INSET}`\n : '',\n interactive && !disabled ? 'cursor-pointer' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const classes = [chromeClasses, controlClasses, hasTrailing ? '' : insetClass, className]\n .filter(Boolean)\n .join(' ');\n\n const paints = selection ? selection === 'highlight' : role !== 'checkbox';\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}`,\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, classes, rowStyle);\n }\n\n if (hasTrailing) {\n const control =\n href && !disabled ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left no-underline text-inherit`}\n role={role}\n tabIndex={tabIndex}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </a>\n ) : onClick ? (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left`}\n role={role}\n tabIndex={tabIndex}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\n ) : (\n // The set goes here, not on the wrapper: `radio` and `checkbox` make their\n // descendants presentational, which would bury a control in the trailing slot.\n <div className=\"flex-1 min-w-0\" {...rowFallbackAria}>\n {children}\n </div>\n );\n\n return (\n <div\n className={[\n chromeClasses,\n 'flex items-center',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n >\n {trailing}\n </div>\n </div>\n );\n }\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${classes} no-underline text-inherit`}\n style={rowStyle}\n role={role}\n tabIndex={tabIndex}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </a>\n );\n }\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={classes}\n style={rowStyle}\n role={role}\n tabIndex={tabIndex}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {children}\n </div>\n );\n};\n\nexport interface SurfaceExpandableRowProps {\n /** The row itself, laid out across the line. May hold its own controls. */\n header: React.ReactNode;\n /** The body, rendered beneath the row while it is open. */\n children?: React.ReactNode;\n expanded: boolean;\n /** Omit for a row that cannot open. The arrow's space is still reserved, so a list of\n * rows stays in one column whether or not each one has a body. */\n onToggle?: (expanded: boolean) => void;\n /**\n * Pins the row while its body scrolls, so a long body never leaves the reader without\n * the line it belongs to. Offset by whatever is already pinned above it.\n */\n sticky?: boolean;\n stickyTopOffset?: number;\n divider?: boolean;\n tone?: SurfaceRowProps['tone'];\n /** Names the disclosure control, which is otherwise only an arrow. */\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Stops a click inside it from toggling the row, for the cells that hold controls.\n *\n * Explicit rather than sniffing the event's target for an interactive ancestor: a control\n * rendering into a shadow root retargets the event to its host, so the sniff would miss\n * exactly the components most likely to sit in a row.\n */\nconst ExpandableRowControls: React.FC<{\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ children, className = '', style }) => (\n <div className={className} style={style} onClick={(event) => event.stopPropagation()}>\n {children}\n </div>\n);\n\n/**\n * A row that opens to reveal a body, for a line that carries its own controls.\n *\n * Not `Accordion`: that puts its header inside the toggle button, so a header holding a\n * dropdown or a second button is invalid. Here the row surface takes the click and a cell\n * opts out with `ExpandableRow.Controls`, while the arrow stays a real button so the\n * keyboard reaches it.\n */\n/**\n * The space before the header: the arrow's own inset, its glyph and the gap after it.\n * Exported so a consumer aligning a column header above these rows offsets by the same\n * amount instead of guessing at it.\n */\nexport const EXPANDABLE_ROW_LEAD_PX = 39;\n\nconst SurfaceExpandableRow: React.FC<SurfaceExpandableRowProps> & {\n Controls: typeof ExpandableRowControls;\n} = Object.assign(\n ({\n header,\n children,\n expanded,\n onToggle,\n sticky = false,\n stickyTopOffset = 0,\n divider = false,\n tone = 'default',\n 'aria-label': ariaLabel,\n className = '',\n style,\n }: SurfaceExpandableRowProps) => {\n const bodyId = React.useId();\n const toggle = onToggle ? () => onToggle(!expanded) : undefined;\n\n return (\n <SurfaceRow divider={divider} tone={tone} className={className} style={style}>\n {/* `group` so the arrow takes its hover state from the whole row. */}\n <div\n className={`group flex items-center w-full ${toggle ? 'cursor-pointer' : ''} ${\n sticky && expanded\n ? 'sticky z-[1] bg-[var(--malachite-card-background)]'\n : ''\n }`}\n style={sticky && expanded ? { top: stickyTopOffset } : undefined}\n // Presentational: the arrow below is the keyboard control, and this only\n // widens the pointer target.\n onClick={toggle}\n role=\"presentation\"\n >\n {/* Reserved whether or not this row opens, so a list stays in one column.\n The inset and gap match Accordion's header. */}\n <span className=\"shrink-0 flex items-center pl-[16px] pr-[12px]\">\n {toggle && (\n <button\n type=\"button\"\n className={`appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${FOCUS_RING_INSET}`}\n aria-expanded={expanded}\n aria-controls={bodyId}\n aria-label={ariaLabel}\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n >\n <DisclosureArrow expanded={expanded} />\n </button>\n )}\n </span>\n {header}\n </div>\n {expanded && <div id={bodyId}>{children}</div>}\n </SurfaceRow>\n );\n },\n { Controls: ExpandableRowControls },\n);\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<AnySurfaceRowProps>;\n ExpandableRow: typeof SurfaceExpandableRow;\n}\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const overflowClass =\n overflow === 'clip'\n ? 'overflow-clip'\n : overflow === 'visible'\n ? 'overflow-visible'\n : 'overflow-hidden';\n return (\n <div\n className={`w-full rounded-[var(--malachite-radius-xxl,14px)] ${overflowClass} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${padding ? 'py-3 px-4' : ''} ${className}`}\n style={{ boxShadow: TRIPLE_SHADOW, ...FOREGROUND_RESET, ...style }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","selected","selection","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","role","href","safeHref","ariaLabel","ariaLabelledBy","tabIndex","interactive","hover","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlClasses","FOCUS_RING_INSET","classes","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","control","jsx","resolveRel","jsxs","ExpandableRowControls","event","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","Surface","padding","overflow","FOREGROUND_RESET"],"mappings":";;;;;;;;;AA4DA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA,EACN,SAAS;AACb,GAqCMC,KAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,KAAkF;AAAA,EACpF,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,KACF,0KAEEC,KACF,yGASEC,IAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAA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