@stackone/malachite 2.31.0 → 2.32.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.
package/COMPONENTS.md CHANGED
@@ -12,7 +12,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
12
12
  - **`SurfaceExpandableRow`** — A row that opens to reveal a body (used as `Surface.ExpandableRow`), for a line that carries its own controls. Not `Accordion`, which puts its header inside the toggle button, so a header holding a dropdown or a second button would be invalid: here the row surface takes the click and a cell opts out by wrapping its controls in `ExpandableRow.Controls`, while the arrow stays a real button so the keyboard reaches it. That opt-out is explicit rather than sniffing the event target for an interactive ancestor, because a control rendering into a shadow root retargets the event to its host. `sticky` pins the row while its body scrolls, offset by `stickyTopOffset` for whatever is already pinned above it; it only pins while open, since a closed row has nothing to scroll past. _Key props:_ `header`, `children`, `expanded`, `onToggle`, `sticky`, `stickyTopOffset`, `divider`, `tone`, `aria-label`, `className`, `style`.
13
13
  - **`DisclosureArrow`** — The expand/collapse triangle disclosure UI shares (`Accordion`, `Surface.ExpandableRow`). Owns its colour states so they never drift between usages: `text-primary` when expanded, `text-placeholder` otherwise, and dark on hover inside a `group` ancestor — put `group` on the clickable header or row so that hover state activates. _Key props:_ `expanded`, `size`, `className`.
14
14
  - **`Card`** — Generic content card.
15
- - **`SelectableCard`** — A card that is one option in a radio group — eyebrow, optional status tag, title, description, a count label and a top-right action slot. Use inside a `CardStrip`. Selection is controlled by the consumer: pass `selected`, which drives both the visual treatment and `aria-checked`. A selected card meets the sheet below the way a browser tab meets its toolbar — its bottom corners flare outward onto the strip’s rule — so its outline is one SVG path rather than borders, which would split into two lines at the tangent. `variant` picks the palette: `profile` (green), `library` (neutral) or `editing` (amber, for a profile with unsaved changes). `actions` stands in the card’s top-right corner, on the eyebrow row, and renders outside the control so a menu or icon button inside it stays clickable and keeps its own tab stop. Nothing else marks that corner: the flared outline, the tint and the green eyebrow already say which card is selected, so a radio there would only repeat them. `isDefault` marks the card as the account default with a pin beside the title, named for assistive tech and tooltipped for everyone else — it belongs with the name it qualifies rather than among the actions, which read as things to press. For a row-shaped selectable use `Surface.Row` instead. _Key props:_ `value`, `title`, `titleIcon`, `isDefault`, `variant` (`profile` | `library` | `editing`), `eyebrow`, `status` (`label`, `type`), `description`, `countLabel`, `actions`, `selected`, `loading` (`loadingLabel`, `loadingHint`), `disabled`, `dimmed`, `onSelect`, `tabIndex`, `aria-label`, `className`, `style`.
15
+ - **`SelectableCard`** — A card that is one option in a radio group — eyebrow, optional status tag, title, description, a count label and a top-right action slot. Use inside a `CardStrip`. Selection is controlled by the consumer: pass `selected`, which drives both the visual treatment and `aria-checked`. A selected card meets the sheet below the way a browser tab meets its toolbar — its bottom corners flare outward onto the strip’s rule — so its outline is one SVG path rather than borders, which would split into two lines at the tangent. `variant` picks the palette: `profile` (green), `library` (neutral) or `editing` (amber, for a profile with unsaved changes). `actions` stands in the card’s top-right corner, on the eyebrow row, and renders outside the control so a menu or icon button inside it stays clickable and keeps its own tab stop. Nothing else marks that corner: the flared outline, the tint and the green eyebrow already say which card is selected, so a radio there would only repeat them. `onDismiss` adds an x after `actions`, tinted like the eyebrow so it reads as part of the card — for discarding a draft card; `dismissDisabledReason` disables it and explains why in its tooltip. `isDefault` marks the card as the account default with a pin beside the title, named for assistive tech and tooltipped for everyone else — it belongs with the name it qualifies rather than among the actions, which read as things to press. For a row-shaped selectable use `Surface.Row` instead. _Key props:_ `value`, `title`, `titleIcon`, `isDefault`, `variant` (`profile` | `library` | `editing`), `eyebrow`, `status` (`label`, `type`), `description`, `countLabel`, `actions`, `onDismiss` (`dismissLabel`, `dismissDisabledReason`), `selected`, `loading` (`loadingLabel`, `loadingHint`), `disabled`, `dimmed`, `onSelect`, `tabIndex`, `aria-label`, `className`, `style`.
16
16
  - **`CardStrip`** — Horizontally scrolling radio group of cards, with edge arrows that appear only when the content overflows, an edge fade, scroll-snap and arrow-key navigation matching `SegmentedControl`. Owns interaction only: it finds its options by looking for `role="radio"` descendants carrying `data-value`, so any such child works (`SelectableCard` emits both). Pass a non-selectable terminal tile as `CardStrip.AddTile` — it sits inside the group but outside the radio set, and must be a direct child or it scrolls with the cards. Use `leading` to pin a card that should not scroll away; the strip tells the cards which slot they are in, so a pinned `SelectableCard` drops the left rule the scrolling ones draw. Set `bleed` when the strip sits in a `PageLayout`: the strip stretches past the horizontal padding of the layout so its bottom rule runs the full width of the page card, while the cards stay aligned to the gutter. With no cards at all the strip degenerates to its pinned slots alone — no trough, no scroller and no arrows — with the add tile standing beside `leading` and taking `primary` emphasis automatically, since adding the first card is the only thing on offer. _Key props:_ `value`, `tone` (`profile` | `library` | `editing` — read off the selected card unless set), `onChange`, `children`, `leading`, `arrows`, `fadeEdges`, `snap`, `bleed`, `scrollSelectedIntoView`, `aria-label`, `aria-labelledby`, `className`, `style`. `CardStrip.AddTile`: `label`, `icon`, `onClick`, `disabled`, `emphasis` (`primary` | `secondary` — left to the strip unless set: `primary` while there are no cards, `secondary` once there are), `className`.
17
17
  - **`SplitScreenLayout`** — Two-pane full-screen layout (content + preview/aside) with an optional dismiss button.
18
18
  - **`PageLayout`** — Standard page chrome: a bordered card holding a breadcrumb bar, an optional alert strip, and a header block (subtitle, title + suffix, description) above the page body. Used as `PageLayout.Regular`; `PageLayout.Empty` is the chrome-only variant for pre-auth and error screens, with `headerActions` and `background` slots. Actions are declared as data (`buttons`) rather than children, and any that do not fit collapse into an overflow `ActionMenu` via `OverflowRow`. A client-side-routed app must pass `renderLink` so crumbs and the back button go through its router instead of reloading the document. Both layouts render a `main` landmark, demoted via `role` when the app owns its own. Deliberately not a `Surface` — the page card is 16px and carries no shadow. _Key props:_ `PageLayout.Regular`: `breadcrumbLinks`, `breadcrumbActions`, `renderLink`, `title`, `titleSuffix`, `subtitle`, `description`, `buttons`, `loading`, `centered`, `noPadding`, `contentGap` (`small` | `medium` | `large` | `xlarge`, default `small`), `alert`, `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Empty`: `title`, `centered`, `uniformPadding`, `headerActions`, `background`, `role`, `aria-label`, `aria-labelledby`, `className`, `style`.
@@ -1,70 +1,72 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { useRef as Re, useId as $e } from "react";
3
- import Te from "./CustomIcons/PinIcon.js";
4
- import { Tag as xe } from "./Tag.js";
5
- import ue from "./Tooltip.js";
6
- import M from "./TruncatedTooltip.js";
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { useRef as Ie, useId as ve } from "react";
3
+ import { Button as ye } from "./Button.js";
4
+ import Se from "./CustomIcons/DismissIcon.js";
5
+ import Ne from "./CustomIcons/PinIcon.js";
6
+ import { Tag as Ae } from "./Tag.js";
7
+ import Ce from "./Tooltip.js";
8
+ import Q from "./TruncatedTooltip.js";
7
9
  import p from "./Typography/Text.js";
8
- import { useCardStripSlot as ge } from "./cardStripSlot.js";
9
- import { FOCUS_RING_WITHIN as ve } from "./focusRing.js";
10
- import { useAdoptedStyleSheet as Ie } from "./useAdoptedStyleSheet.js";
11
- const k = 240, K = `${k}px`, Z = "116px", V = "var(--malachite-radius-xxl, 14px)", L = `${V} ${V} 0 0`, u = "var(--malachite-selectable-card-muted-foreground, #7b7b7b)", ye = "var(--malachite-text-secondary, #7b7b7b)", se = "var(--malachite-selectable-card-accent, #047b43)", Ae = "var(--malachite-selectable-card-selected-tint, #e7f8f1)", Ne = "var(--malachite-selectable-card-selected-border, #047b43)", q = 0.7, Se = "var(--malachite-selectable-card-library-selected-tint, #f1f1f1)", Ce = "var(--malachite-selectable-card-library-selected-border, #bbbbbb)", re = "var(--malachite-selectable-card-pending-foreground, #96580a)", ne = "var(--malachite-selectable-card-editing-tint, #f9f2e9)", J = "var(--malachite-selectable-card-selected-surface-end, #ffffff)", Le = "var(--malachite-selectable-card-background, #f1f1f1)", Oe = "1px solid var(--malachite-selectable-card-border, #dddddd)", De = "var(--malachite-selectable-card-hover-background, #e8e8e8)", Pe = 14, s = Pe, b = 2, oe = 116, Fe = 14, ie = 2, dt = s - b / 2, $ = k + s * 2, T = oe + ie + b, ke = (a) => {
12
- const t = b / 2, l = s + t, c = s + k - t, i = t, r = Fe - t;
10
+ import { useCardStripSlot as Le } from "./cardStripSlot.js";
11
+ import { FOCUS_RING_WITHIN as Oe } from "./focusRing.js";
12
+ import { useAdoptedStyleSheet as De } from "./useAdoptedStyleSheet.js";
13
+ const F = 240, ee = `${F}px`, te = "116px", le = "var(--malachite-radius-xxl, 14px)", O = `${le} ${le} 0 0`, b = "var(--malachite-selectable-card-muted-foreground, #7b7b7b)", Pe = "var(--malachite-text-secondary, #7b7b7b)", de = "var(--malachite-selectable-card-accent, #047b43)", ke = "var(--malachite-selectable-card-selected-tint, #e7f8f1)", Be = "var(--malachite-selectable-card-selected-border, #047b43)", ae = 0.7, Fe = "var(--malachite-selectable-card-library-selected-tint, #f1f1f1)", we = "var(--malachite-selectable-card-library-selected-border, #bbbbbb)", pe = "var(--malachite-selectable-card-pending-foreground, #96580a)", he = "var(--malachite-selectable-card-editing-tint, #f9f2e9)", se = "var(--malachite-selectable-card-selected-surface-end, #ffffff)", Ue = "var(--malachite-selectable-card-background, #f1f1f1)", Ye = "1px solid var(--malachite-selectable-card-border, #dddddd)", ze = "var(--malachite-selectable-card-hover-background, #e8e8e8)", Ge = 14, s = Ge, E = 2, fe = 116, We = 14, me = 2, Tt = s - E / 2, x = F + s * 2, T = fe + me + E, He = (l) => {
14
+ const t = E / 2, a = s + t, c = s + F - t, i = t, r = We - t;
13
15
  return [
14
- `M${l - s} ${a}`,
15
- `A${s} ${s} 0 0 0 ${l} ${a - s}`,
16
- `L${l} ${i + r}`,
17
- `A${r} ${r} 0 0 1 ${l + r} ${i}`,
16
+ `M${a - s} ${l}`,
17
+ `A${s} ${s} 0 0 0 ${a} ${l - s}`,
18
+ `L${a} ${i + r}`,
19
+ `A${r} ${r} 0 0 1 ${a + r} ${i}`,
18
20
  `L${c - r} ${i}`,
19
21
  `A${r} ${r} 0 0 1 ${c} ${i + r}`,
20
- `L${c} ${a - s}`,
21
- `A${s} ${s} 0 0 0 ${c + s} ${a}`
22
+ `L${c} ${l - s}`,
23
+ `A${s} ${s} 0 0 0 ${c + s} ${l}`
22
24
  ].join(" ");
23
- }, F = ke(oe + ie / 2), Q = `${F} Z`, g = "malachite-selectable-card-outline", o = "malachite-selectable-card", we = "malachite-selectable-card-style", f = "--malachite-selectable-card-state-outline", m = "--malachite-selectable-card-state-tint", O = {
24
- "background-color": De,
25
+ }, B = He(fe + me / 2), re = `${B} Z`, I = "malachite-selectable-card-outline", n = "malachite-selectable-card", je = "malachite-selectable-card-style", f = "--malachite-selectable-card-state-outline", m = "--malachite-selectable-card-state-tint", D = {
26
+ "background-color": ze,
25
27
  "border-left-color": "transparent"
26
- }, D = {
27
- "background-color": Le
28
28
  }, P = {
29
+ "background-color": Ue
30
+ }, k = {
29
31
  profile: {
30
- resting: D,
31
- hover: O,
32
+ resting: P,
33
+ hover: D,
32
34
  selected: {
33
- [f]: Ne,
34
- [m]: Ae
35
+ [f]: Be,
36
+ [m]: ke
35
37
  }
36
38
  },
37
39
  library: {
38
- resting: D,
39
- hover: O,
40
+ resting: P,
41
+ hover: D,
40
42
  selected: {
41
- [f]: Ce,
42
- [m]: Se
43
+ [f]: we,
44
+ [m]: Fe
43
45
  }
44
46
  },
45
47
  editing: {
46
- resting: D,
47
- hover: O,
48
+ resting: P,
49
+ hover: D,
48
50
  selected: {
49
- [f]: re,
50
- [m]: ne
51
+ [f]: pe,
52
+ [m]: he
51
53
  }
52
54
  }
53
- }, x = { color: ye }, Be = {
55
+ }, g = { color: Pe }, Xe = {
54
56
  profile: {
55
- resting: x,
56
- selected: { color: se, opacity: q }
57
+ resting: g,
58
+ selected: { color: de, opacity: ae }
57
59
  },
58
- library: { resting: x, selected: x },
60
+ library: { resting: g, selected: g },
59
61
  editing: {
60
- resting: x,
61
- selected: { color: re, opacity: q }
62
+ resting: g,
63
+ selected: { color: pe, opacity: ae }
62
64
  }
63
- }, Ue = { "border-left": Oe }, Ge = `
64
- .${o}[data-state='selected'] {
65
+ }, Me = { "border-left": Ye }, Ke = `
66
+ .${n}[data-state='selected'] {
65
67
  z-index: 5;
66
68
  }
67
- .${o} > .${g} {
69
+ .${n} > .${I} {
68
70
  position: absolute;
69
71
  left: -${s}px;
70
72
  top: 0;
@@ -72,280 +74,301 @@ const k = 240, K = `${k}px`, Z = "116px", V = "var(--malachite-radius-xxl, 14px)
72
74
  overflow: visible;
73
75
  pointer-events: none;
74
76
  }
75
- .${o} > *:not(.${g}):not([data-selectable-card-actions]) {
77
+ .${n} > *:not(.${I}):not([data-selectable-card-actions]) {
76
78
  position: relative;
77
79
  z-index: 1;
78
80
  }
79
- .${o} > [data-selectable-card-actions] {
81
+ .${n} > [data-selectable-card-actions] {
80
82
  z-index: 2;
81
- }`, ce = (a) => Object.entries(a).map(([t, l]) => ` ${t}: ${l};`).join(`
82
- `), We = (a, t) => t === "hover" ? `.${o}[data-variant='${a}'][data-state='resting'][data-hoverable]:hover` : `.${o}[data-variant='${a}'][data-state='${t}']`, Ye = (a, t, l) => `${We(a, t)} {
83
- ${ce(l)}
84
- }`, ze = Object.keys(P).flatMap(
85
- (a) => Object.keys(P[a]).map(
86
- (t) => Ye(a, t, P[a][t])
83
+ }`, be = (l) => Object.entries(l).map(([t, a]) => ` ${t}: ${a};`).join(`
84
+ `), Ze = (l, t) => t === "hover" ? `.${n}[data-variant='${l}'][data-state='resting'][data-hoverable]:hover` : `.${n}[data-variant='${l}'][data-state='${t}']`, Ve = (l, t, a) => `${Ze(l, t)} {
85
+ ${be(a)}
86
+ }`, qe = Object.keys(k).flatMap(
87
+ (l) => Object.keys(k[l]).map(
88
+ (t) => Ve(l, t, k[l][t])
87
89
  )
88
90
  ).join(`
89
- `), He = `.${o}[data-pinned='false'][data-state='resting'] {
90
- ${ce(
91
- Ue
91
+ `), Je = `.${n}[data-pinned='false'][data-state='resting'] {
92
+ ${be(
93
+ Me
92
94
  )}
93
- }`, je = `${He}
94
- ${ze}
95
- ${Ge}`, Xe = {
95
+ }`, Qe = `${Je}
96
+ ${qe}
97
+ ${Ke}`, et = {
96
98
  display: "-webkit-box",
97
99
  WebkitLineClamp: 2,
98
100
  WebkitBoxOrient: "vertical",
99
101
  overflow: "hidden",
100
- color: u,
102
+ color: b,
101
103
  lineHeight: 1.6
102
- }, Me = { color: u, letterSpacing: "0.11px" }, w = "var(--malachite-selectable-card-pending-foreground, #96580a)", Ke = { color: w }, Ze = { color: w, opacity: 0.7 }, Ve = 36, qe = 38, ee = {
104
+ }, tt = { color: b, letterSpacing: "0.11px" }, w = "var(--malachite-selectable-card-pending-foreground, #96580a)", lt = { color: w }, at = { color: w, opacity: 0.7 }, st = 36, rt = 38, oe = {
103
105
  color: "var(--malachite-text-primary)"
104
- }, te = "Default profile", Je = 16, Qe = {
105
- color: se,
106
+ }, ot = "inline-flex items-center justify-center [&_svg]:size-[10px]!", nt = { color: b }, ne = "Default profile", it = 16, ct = {
107
+ color: de,
106
108
  display: "inline-flex"
107
- }, ae = () => /* @__PURE__ */ e(ue, { text: te, triggerAs: "span", describesTrigger: !1, children: /* @__PURE__ */ e("span", { role: "img", "aria-label": te, style: Qe, children: /* @__PURE__ */ e(Te, { size: Je }) }) }), le = (a) => {
108
- const t = a.filter((l) => l !== void 0);
109
+ }, ie = () => /* @__PURE__ */ e(Ce, { text: ne, triggerAs: "span", describesTrigger: !1, children: /* @__PURE__ */ e("span", { role: "img", "aria-label": ne, style: ct, children: /* @__PURE__ */ e(Ne, { size: it }) }) }), ce = (l) => {
110
+ const t = l.filter((a) => a !== void 0);
109
111
  return t.length > 0 ? t.join(" ") : void 0;
110
- }, pt = ({
111
- value: a,
112
+ }, gt = ({
113
+ value: l,
112
114
  title: t,
113
- titleIcon: l,
115
+ titleIcon: a,
114
116
  isDefault: c = !1,
115
117
  variant: i = "profile",
116
118
  eyebrow: r,
117
- status: E,
119
+ status: _,
118
120
  description: v,
119
- countLabel: I,
120
- actions: y,
121
+ countLabel: y,
122
+ actions: S,
123
+ onDismiss: R,
124
+ dismissLabel: U = "Dismiss",
125
+ dismissDisabledReason: Y,
121
126
  selected: d = !1,
122
- loading: de = !1,
123
- loadingLabel: pe = "Loading…",
124
- loadingHint: B,
125
- disabled: _ = !1,
126
- dimmed: U = !1,
127
- onSelect: A,
128
- tabIndex: he,
129
- "aria-label": G,
130
- className: W = "",
131
- style: Y
127
+ loading: Ee = !1,
128
+ loadingLabel: _e = "Loading…",
129
+ loadingHint: z,
130
+ disabled: $ = !1,
131
+ dimmed: G = !1,
132
+ onSelect: N,
133
+ tabIndex: Re,
134
+ "aria-label": W,
135
+ className: H = "",
136
+ style: j
132
137
  }) => {
133
- const { pinned: fe } = ge(), me = !d && !_, N = Re(null);
134
- Ie(N, je, we);
135
- const h = `mal-selectable-card-${$e().replace(/[^a-zA-Z0-9_-]/g, "")}`, R = `${h}-outline`, z = `${h}-eyebrow`, H = `${h}-status`, S = `${h}-title`, j = `${h}-description`, X = `${h}-count`, be = G ? void 0 : le([r ? z : void 0, S, E ? H : void 0]), Ee = le([
136
- v ? j : void 0,
137
- I ? X : void 0
138
+ const { pinned: $e } = Le(), ue = !d && !$, A = Ie(null);
139
+ De(A, Qe, je);
140
+ const h = `mal-selectable-card-${ve().replace(/[^a-zA-Z0-9_-]/g, "")}`, u = `${h}-outline`, X = `${h}-eyebrow`, M = `${h}-status`, C = `${h}-title`, K = `${h}-description`, Z = `${h}-count`, xe = W ? void 0 : ce([r ? X : void 0, C, _ ? M : void 0]), Te = ce([
141
+ v ? K : void 0,
142
+ y ? Z : void 0
138
143
  ]);
139
- if (de)
140
- return /* @__PURE__ */ n(
144
+ if (Ee)
145
+ return /* @__PURE__ */ o(
141
146
  "div",
142
147
  {
143
- ref: N,
148
+ ref: A,
144
149
  role: "status",
145
150
  "aria-busy": "true",
146
151
  "aria-live": "polite",
147
152
  "data-variant": "editing",
148
153
  "data-state": "selected",
149
- className: `${o} relative flex shrink-0 flex-col items-center gap-2 px-5 text-center ${W}`.trim(),
154
+ className: `${n} relative flex shrink-0 flex-col items-center gap-2 px-5 text-center ${H}`.trim(),
150
155
  style: {
151
- width: K,
152
- height: Z,
153
- borderRadius: L,
156
+ width: ee,
157
+ height: te,
158
+ borderRadius: O,
154
159
  boxSizing: "border-box",
155
- paddingTop: `${Ve}px`,
156
- paddingBottom: `${qe}px`,
160
+ paddingTop: `${st}px`,
161
+ paddingBottom: `${rt}px`,
157
162
  justifyContent: "center",
158
163
  [f]: w,
159
- [m]: ne,
160
- ...Y
164
+ [m]: he,
165
+ ...j
161
166
  },
162
167
  children: [
163
- /* @__PURE__ */ n(
168
+ /* @__PURE__ */ o(
164
169
  "svg",
165
170
  {
166
- className: g,
167
- width: $,
171
+ className: I,
172
+ width: x,
168
173
  height: T,
169
- viewBox: `0 0 ${$} ${T}`,
174
+ viewBox: `0 0 ${x} ${T}`,
170
175
  fill: "none",
171
176
  "aria-hidden": "true",
172
177
  children: [
173
- /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ n("linearGradient", { id: R, x1: "0", y1: "0", x2: "0", y2: "1", children: [
178
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ o("linearGradient", { id: u, x1: "0", y1: "0", x2: "0", y2: "1", children: [
174
179
  /* @__PURE__ */ e("stop", { offset: "0", style: { stopColor: `var(${m})` } }),
175
- /* @__PURE__ */ e("stop", { offset: "1", style: { stopColor: J } })
180
+ /* @__PURE__ */ e("stop", { offset: "1", style: { stopColor: se } })
176
181
  ] }) }),
177
182
  /* @__PURE__ */ e(
178
183
  "path",
179
184
  {
180
- d: Q,
185
+ d: re,
181
186
  "data-malachite-shape": "",
182
- style: { fill: `url(#${R})` }
187
+ style: { fill: `url(#${u})` }
183
188
  }
184
189
  ),
185
190
  /* @__PURE__ */ e(
186
191
  "path",
187
192
  {
188
- d: F,
193
+ d: B,
189
194
  "data-malachite-shape": "",
190
- strokeWidth: b,
195
+ strokeWidth: E,
191
196
  style: { fill: "none", stroke: `var(${f})` }
192
197
  }
193
198
  )
194
199
  ]
195
200
  }
196
201
  ),
197
- /* @__PURE__ */ e(p, { size: "small", fontWeight: "semi-bold", style: Ke, children: pe }),
198
- B ? /* @__PURE__ */ e(p, { size: "xsmall", fontWeight: "semi-bold", style: Ze, children: B }) : null
202
+ /* @__PURE__ */ e(p, { size: "small", fontWeight: "semi-bold", style: lt, children: _e }),
203
+ z ? /* @__PURE__ */ e(p, { size: "xsmall", fontWeight: "semi-bold", style: at, children: z }) : null
199
204
  ]
200
205
  }
201
206
  );
202
- const C = i === "library", _e = Be[i][d ? "selected" : "resting"];
203
- return /* @__PURE__ */ n(
207
+ const L = i === "library", V = Xe[i][d ? "selected" : "resting"], q = !!S || !!R, J = Y !== void 0, ge = S && R ? "pr-[56px]" : q ? "pr-[26px]" : "pr-1";
208
+ return /* @__PURE__ */ o(
204
209
  "div",
205
210
  {
206
- ref: N,
211
+ ref: A,
207
212
  "data-variant": i,
208
- "data-pinned": fe ? "true" : "false",
213
+ "data-pinned": $e ? "true" : "false",
209
214
  "data-state": d ? "selected" : "resting",
210
- "data-hoverable": me ? "" : void 0,
211
- className: `${o} group relative grid shrink-0 grid-rows-[1fr_auto] ${ve} ${W}`.trim(),
215
+ "data-hoverable": ue ? "" : void 0,
216
+ className: `${n} group relative grid shrink-0 grid-rows-[1fr_auto] ${Oe} ${H}`.trim(),
212
217
  style: {
213
- width: K,
214
- height: Z,
215
- borderRadius: L,
218
+ width: ee,
219
+ height: te,
220
+ borderRadius: O,
216
221
  boxSizing: "border-box",
217
- ...Y
222
+ ...j
218
223
  },
219
224
  children: [
220
- d ? /* @__PURE__ */ n(
225
+ d ? /* @__PURE__ */ o(
221
226
  "svg",
222
227
  {
223
- className: g,
224
- width: $,
228
+ className: I,
229
+ width: x,
225
230
  height: T,
226
- viewBox: `0 0 ${$} ${T}`,
231
+ viewBox: `0 0 ${x} ${T}`,
227
232
  fill: "none",
228
233
  "aria-hidden": "true",
229
234
  children: [
230
- /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ n("linearGradient", { id: R, x1: "0", y1: "0", x2: "0", y2: "1", children: [
235
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ o("linearGradient", { id: u, x1: "0", y1: "0", x2: "0", y2: "1", children: [
231
236
  /* @__PURE__ */ e("stop", { offset: "0", style: { stopColor: `var(${m})` } }),
232
- /* @__PURE__ */ e("stop", { offset: "1", style: { stopColor: J } })
237
+ /* @__PURE__ */ e("stop", { offset: "1", style: { stopColor: se } })
233
238
  ] }) }),
234
239
  /* @__PURE__ */ e(
235
240
  "path",
236
241
  {
237
- d: Q,
242
+ d: re,
238
243
  "data-malachite-shape": "",
239
- style: { fill: `url(#${R})` }
244
+ style: { fill: `url(#${u})` }
240
245
  }
241
246
  ),
242
247
  /* @__PURE__ */ e(
243
248
  "path",
244
249
  {
245
- d: F,
250
+ d: B,
246
251
  "data-malachite-shape": "",
247
- strokeWidth: b,
252
+ strokeWidth: E,
248
253
  style: { fill: "none", stroke: `var(${f})` }
249
254
  }
250
255
  )
251
256
  ]
252
257
  }
253
258
  ) : null,
254
- /* @__PURE__ */ n(
259
+ /* @__PURE__ */ o(
255
260
  "button",
256
261
  {
257
262
  type: "button",
258
263
  role: "radio",
259
- "data-value": a,
264
+ "data-value": l,
260
265
  "aria-checked": d,
261
- "aria-label": G,
262
- "aria-labelledby": be,
263
- "aria-describedby": Ee,
264
- "aria-disabled": _ || void 0,
265
- tabIndex: he ?? (d ? 0 : -1),
266
+ "aria-label": W,
267
+ "aria-labelledby": xe,
268
+ "aria-describedby": Te,
269
+ "aria-disabled": $ || void 0,
270
+ tabIndex: Re ?? (d ? 0 : -1),
266
271
  onClick: () => {
267
- _ || d || A == null || A(a);
272
+ $ || d || N == null || N(l);
268
273
  },
269
- className: `flex min-w-0 appearance-none flex-col border-0 bg-transparent py-0 pt-3 pr-4 pl-4 text-left outline-none ${_ ? "cursor-not-allowed" : "cursor-pointer"}`,
270
- style: { borderRadius: L },
274
+ className: `flex min-w-0 appearance-none flex-col border-0 bg-transparent py-0 pt-3 pr-4 pl-4 text-left outline-none ${$ ? "cursor-not-allowed" : "cursor-pointer"}`,
275
+ style: { borderRadius: O },
271
276
  children: [
272
- /* @__PURE__ */ e(
273
- "div",
274
- {
275
- className: `flex h-[13px] shrink-0 items-center gap-2 ${y ? "pr-[26px]" : "pr-1"}`,
276
- children: /* @__PURE__ */ n("div", { className: "flex min-w-0 items-center gap-1.5", children: [
277
- C ? /* @__PURE__ */ n("span", { id: S, className: "flex min-w-0 items-center gap-1.5", children: [
278
- l ? /* @__PURE__ */ e(
279
- "span",
280
- {
281
- className: "flex shrink-0 items-center",
282
- style: ee,
283
- children: l
284
- }
285
- ) : null,
286
- c ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ e(ae, {}) }) : null,
287
- /* @__PURE__ */ e(M, { text: t, children: /* @__PURE__ */ e(
288
- p,
289
- {
290
- size: "small",
291
- fontWeight: "semi-bold",
292
- style: U ? { color: u } : void 0,
293
- children: t
294
- }
295
- ) })
296
- ] }) : null,
297
- r ? /* @__PURE__ */ e("span", { id: z, className: "flex min-w-0", children: /* @__PURE__ */ e(p, { size: "xsmall", fontWeight: "semi-bold", style: _e, children: r }) }) : null,
298
- E ? /* @__PURE__ */ e("span", { id: H, className: "flex min-w-0", children: /* @__PURE__ */ e(
299
- xe,
300
- {
301
- value: E.label,
302
- type: E.type ?? "default",
303
- textTransform: "none",
304
- paddingSize: "compact"
305
- }
306
- ) }) : null
307
- ] })
308
- }
309
- ),
310
- /* @__PURE__ */ n(
277
+ /* @__PURE__ */ e("div", { className: `flex h-[13px] shrink-0 items-center gap-2 ${ge}`, children: /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-1.5", children: [
278
+ L ? /* @__PURE__ */ o("span", { id: C, className: "flex min-w-0 items-center gap-1.5", children: [
279
+ a ? /* @__PURE__ */ e(
280
+ "span",
281
+ {
282
+ className: "flex shrink-0 items-center",
283
+ style: oe,
284
+ children: a
285
+ }
286
+ ) : null,
287
+ c ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ e(ie, {}) }) : null,
288
+ /* @__PURE__ */ e(Q, { text: t, children: /* @__PURE__ */ e(
289
+ p,
290
+ {
291
+ size: "small",
292
+ fontWeight: "semi-bold",
293
+ style: G ? { color: b } : void 0,
294
+ children: t
295
+ }
296
+ ) })
297
+ ] }) : null,
298
+ r ? /* @__PURE__ */ e("span", { id: X, className: "flex min-w-0", children: /* @__PURE__ */ e(p, { size: "xsmall", fontWeight: "semi-bold", style: V, children: r }) }) : null,
299
+ _ ? /* @__PURE__ */ e("span", { id: M, className: "flex min-w-0", children: /* @__PURE__ */ e(
300
+ Ae,
301
+ {
302
+ value: _.label,
303
+ type: _.type ?? "default",
304
+ textTransform: "none",
305
+ paddingSize: "compact"
306
+ }
307
+ ) }) : null
308
+ ] }) }),
309
+ /* @__PURE__ */ o(
311
310
  "div",
312
311
  {
313
- className: `mt-[11px] flex min-w-0 flex-1 flex-col gap-1 pt-3 ${C ? "justify-end" : "justify-between"}`,
312
+ className: `mt-[11px] flex min-w-0 flex-1 flex-col gap-1 pt-3 ${L ? "justify-end" : "justify-between"}`,
314
313
  children: [
315
- C ? null : /* @__PURE__ */ n("div", { id: S, className: "flex min-w-0 items-center gap-1.5", children: [
316
- l ? /* @__PURE__ */ e(
314
+ L ? null : /* @__PURE__ */ o("div", { id: C, className: "flex min-w-0 items-center gap-1.5", children: [
315
+ a ? /* @__PURE__ */ e(
317
316
  "span",
318
317
  {
319
318
  className: "flex shrink-0 items-center",
320
- style: ee,
321
- children: l
319
+ style: oe,
320
+ children: a
322
321
  }
323
322
  ) : null,
324
- c ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ e(ae, {}) }) : null,
325
- /* @__PURE__ */ e(M, { text: t, children: /* @__PURE__ */ e(
323
+ c ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ e(ie, {}) }) : null,
324
+ /* @__PURE__ */ e(Q, { text: t, children: /* @__PURE__ */ e(
326
325
  p,
327
326
  {
328
327
  size: "small",
329
328
  fontWeight: "semi-bold",
330
- style: U ? { color: u } : void 0,
329
+ style: G ? { color: b } : void 0,
331
330
  children: t
332
331
  }
333
332
  ) })
334
333
  ] }),
335
- v ? /* @__PURE__ */ e("span", { id: j, className: "block min-w-0", children: /* @__PURE__ */ e(p, { size: "xsmall", style: Xe, children: v }) }) : null
334
+ v ? /* @__PURE__ */ e("span", { id: K, className: "block min-w-0", children: /* @__PURE__ */ e(p, { size: "xsmall", style: et, children: v }) }) : null
336
335
  ]
337
336
  }
338
337
  )
339
338
  ]
340
339
  }
341
340
  ),
342
- /* @__PURE__ */ e("span", { id: X, className: "min-w-0 self-end truncate pr-4 pb-3 pl-4", children: I ? /* @__PURE__ */ e(p, { size: "xsmall", fontWeight: "semi-bold", style: Me, children: I }) : null }),
343
- y ? /* @__PURE__ */ e(
341
+ /* @__PURE__ */ e("span", { id: Z, className: "min-w-0 self-end truncate pr-4 pb-3 pl-4", children: y ? /* @__PURE__ */ e(p, { size: "xsmall", fontWeight: "semi-bold", style: tt, children: y }) : null }),
342
+ q ? /* @__PURE__ */ o(
344
343
  "div",
345
344
  {
346
345
  "data-selectable-card-actions": "",
347
346
  className: "absolute top-3 right-4 flex h-[13px] shrink-0 items-center gap-2.5",
348
- children: y
347
+ children: [
348
+ S,
349
+ R ? /* @__PURE__ */ e(
350
+ ye,
351
+ {
352
+ type: "button",
353
+ variant: "ghost",
354
+ size: "xsmall",
355
+ iconOnly: !0,
356
+ "aria-label": U,
357
+ tooltip: Y ?? U,
358
+ disabled: J,
359
+ className: "shrink-0",
360
+ onClick: R,
361
+ children: /* @__PURE__ */ e(
362
+ "span",
363
+ {
364
+ className: ot,
365
+ style: J ? nt : V,
366
+ children: /* @__PURE__ */ e(Se, {})
367
+ }
368
+ )
369
+ }
370
+ ) : null
371
+ ]
349
372
  }
350
373
  ) : null
351
374
  ]
@@ -353,12 +376,12 @@ ${Ge}`, Xe = {
353
376
  );
354
377
  };
355
378
  export {
356
- Pe as CARD_FLARE_PX,
357
- dt as CARD_FLARE_TIP_PX,
358
- k as CARD_WIDTH_PX,
359
- g as FLARE_CLASS,
360
- ie as STRIP_RULE_PX,
361
- pt as SelectableCard,
362
- pt as default
379
+ Ge as CARD_FLARE_PX,
380
+ Tt as CARD_FLARE_TIP_PX,
381
+ F as CARD_WIDTH_PX,
382
+ I as FLARE_CLASS,
383
+ me as STRIP_RULE_PX,
384
+ gt as SelectableCard,
385
+ gt as default
363
386
  };
364
387
  //# sourceMappingURL=SelectableCard.js.map