@stackone/malachite 2.31.1 → 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 +1 -1
- package/dist/components/SelectableCard.js +217 -194
- package/dist/components/SelectableCard.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
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
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
|
9
|
-
import { FOCUS_RING_WITHIN as
|
|
10
|
-
import { useAdoptedStyleSheet as
|
|
11
|
-
const
|
|
12
|
-
const 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${
|
|
15
|
-
`A${s} ${s} 0 0 0 ${
|
|
16
|
-
`L${
|
|
17
|
-
`A${r} ${r} 0 0 1 ${
|
|
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} ${
|
|
21
|
-
`A${s} ${s} 0 0 0 ${c + s} ${
|
|
22
|
+
`L${c} ${l - s}`,
|
|
23
|
+
`A${s} ${s} 0 0 0 ${c + s} ${l}`
|
|
22
24
|
].join(" ");
|
|
23
|
-
},
|
|
24
|
-
"background-color":
|
|
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:
|
|
31
|
-
hover:
|
|
32
|
+
resting: P,
|
|
33
|
+
hover: D,
|
|
32
34
|
selected: {
|
|
33
|
-
[f]:
|
|
34
|
-
[m]:
|
|
35
|
+
[f]: Be,
|
|
36
|
+
[m]: ke
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
39
|
library: {
|
|
38
|
-
resting:
|
|
39
|
-
hover:
|
|
40
|
+
resting: P,
|
|
41
|
+
hover: D,
|
|
40
42
|
selected: {
|
|
41
|
-
[f]:
|
|
42
|
-
[m]:
|
|
43
|
+
[f]: we,
|
|
44
|
+
[m]: Fe
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
47
|
editing: {
|
|
46
|
-
resting:
|
|
47
|
-
hover:
|
|
48
|
+
resting: P,
|
|
49
|
+
hover: D,
|
|
48
50
|
selected: {
|
|
49
|
-
[f]:
|
|
50
|
-
[m]:
|
|
51
|
+
[f]: pe,
|
|
52
|
+
[m]: he
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
},
|
|
55
|
+
}, g = { color: Pe }, Xe = {
|
|
54
56
|
profile: {
|
|
55
|
-
resting:
|
|
56
|
-
selected: { color:
|
|
57
|
+
resting: g,
|
|
58
|
+
selected: { color: de, opacity: ae }
|
|
57
59
|
},
|
|
58
|
-
library: { resting:
|
|
60
|
+
library: { resting: g, selected: g },
|
|
59
61
|
editing: {
|
|
60
|
-
resting:
|
|
61
|
-
selected: { color:
|
|
62
|
+
resting: g,
|
|
63
|
+
selected: { color: pe, opacity: ae }
|
|
62
64
|
}
|
|
63
|
-
},
|
|
64
|
-
.${
|
|
65
|
+
}, Me = { "border-left": Ye }, Ke = `
|
|
66
|
+
.${n}[data-state='selected'] {
|
|
65
67
|
z-index: 5;
|
|
66
68
|
}
|
|
67
|
-
.${
|
|
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
|
-
.${
|
|
77
|
+
.${n} > *:not(.${I}):not([data-selectable-card-actions]) {
|
|
76
78
|
position: relative;
|
|
77
79
|
z-index: 1;
|
|
78
80
|
}
|
|
79
|
-
.${
|
|
81
|
+
.${n} > [data-selectable-card-actions] {
|
|
80
82
|
z-index: 2;
|
|
81
|
-
}`,
|
|
82
|
-
`),
|
|
83
|
-
${
|
|
84
|
-
}`,
|
|
85
|
-
(
|
|
86
|
-
(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
|
-
`),
|
|
90
|
-
${
|
|
91
|
-
|
|
91
|
+
`), Je = `.${n}[data-pinned='false'][data-state='resting'] {
|
|
92
|
+
${be(
|
|
93
|
+
Me
|
|
92
94
|
)}
|
|
93
|
-
}`,
|
|
94
|
-
${
|
|
95
|
-
${
|
|
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:
|
|
102
|
+
color: b,
|
|
101
103
|
lineHeight: 1.6
|
|
102
|
-
},
|
|
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
|
-
},
|
|
105
|
-
color:
|
|
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
|
-
},
|
|
108
|
-
const t =
|
|
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
|
-
},
|
|
111
|
-
value:
|
|
112
|
+
}, gt = ({
|
|
113
|
+
value: l,
|
|
112
114
|
title: t,
|
|
113
|
-
titleIcon:
|
|
115
|
+
titleIcon: a,
|
|
114
116
|
isDefault: c = !1,
|
|
115
117
|
variant: i = "profile",
|
|
116
118
|
eyebrow: r,
|
|
117
|
-
status:
|
|
119
|
+
status: _,
|
|
118
120
|
description: v,
|
|
119
|
-
countLabel:
|
|
120
|
-
actions:
|
|
121
|
+
countLabel: y,
|
|
122
|
+
actions: S,
|
|
123
|
+
onDismiss: R,
|
|
124
|
+
dismissLabel: U = "Dismiss",
|
|
125
|
+
dismissDisabledReason: Y,
|
|
121
126
|
selected: d = !1,
|
|
122
|
-
loading:
|
|
123
|
-
loadingLabel:
|
|
124
|
-
loadingHint:
|
|
125
|
-
disabled:
|
|
126
|
-
dimmed:
|
|
127
|
-
onSelect:
|
|
128
|
-
tabIndex:
|
|
129
|
-
"aria-label":
|
|
130
|
-
className:
|
|
131
|
-
style:
|
|
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:
|
|
134
|
-
|
|
135
|
-
const h = `mal-selectable-card-${
|
|
136
|
-
v ?
|
|
137
|
-
|
|
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 (
|
|
140
|
-
return /* @__PURE__ */
|
|
144
|
+
if (Ee)
|
|
145
|
+
return /* @__PURE__ */ o(
|
|
141
146
|
"div",
|
|
142
147
|
{
|
|
143
|
-
ref:
|
|
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: `${
|
|
154
|
+
className: `${n} relative flex shrink-0 flex-col items-center gap-2 px-5 text-center ${H}`.trim(),
|
|
150
155
|
style: {
|
|
151
|
-
width:
|
|
152
|
-
height:
|
|
153
|
-
borderRadius:
|
|
156
|
+
width: ee,
|
|
157
|
+
height: te,
|
|
158
|
+
borderRadius: O,
|
|
154
159
|
boxSizing: "border-box",
|
|
155
|
-
paddingTop: `${
|
|
156
|
-
paddingBottom: `${
|
|
160
|
+
paddingTop: `${st}px`,
|
|
161
|
+
paddingBottom: `${rt}px`,
|
|
157
162
|
justifyContent: "center",
|
|
158
163
|
[f]: w,
|
|
159
|
-
[m]:
|
|
160
|
-
...
|
|
164
|
+
[m]: he,
|
|
165
|
+
...j
|
|
161
166
|
},
|
|
162
167
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ o(
|
|
164
169
|
"svg",
|
|
165
170
|
{
|
|
166
|
-
className:
|
|
167
|
-
width:
|
|
171
|
+
className: I,
|
|
172
|
+
width: x,
|
|
168
173
|
height: T,
|
|
169
|
-
viewBox: `0 0 ${
|
|
174
|
+
viewBox: `0 0 ${x} ${T}`,
|
|
170
175
|
fill: "none",
|
|
171
176
|
"aria-hidden": "true",
|
|
172
177
|
children: [
|
|
173
|
-
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */
|
|
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:
|
|
180
|
+
/* @__PURE__ */ e("stop", { offset: "1", style: { stopColor: se } })
|
|
176
181
|
] }) }),
|
|
177
182
|
/* @__PURE__ */ e(
|
|
178
183
|
"path",
|
|
179
184
|
{
|
|
180
|
-
d:
|
|
185
|
+
d: re,
|
|
181
186
|
"data-malachite-shape": "",
|
|
182
|
-
style: { fill: `url(#${
|
|
187
|
+
style: { fill: `url(#${u})` }
|
|
183
188
|
}
|
|
184
189
|
),
|
|
185
190
|
/* @__PURE__ */ e(
|
|
186
191
|
"path",
|
|
187
192
|
{
|
|
188
|
-
d:
|
|
193
|
+
d: B,
|
|
189
194
|
"data-malachite-shape": "",
|
|
190
|
-
strokeWidth:
|
|
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:
|
|
198
|
-
|
|
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
|
|
203
|
-
return /* @__PURE__ */
|
|
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:
|
|
211
|
+
ref: A,
|
|
207
212
|
"data-variant": i,
|
|
208
|
-
"data-pinned":
|
|
213
|
+
"data-pinned": $e ? "true" : "false",
|
|
209
214
|
"data-state": d ? "selected" : "resting",
|
|
210
|
-
"data-hoverable":
|
|
211
|
-
className: `${
|
|
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:
|
|
214
|
-
height:
|
|
215
|
-
borderRadius:
|
|
218
|
+
width: ee,
|
|
219
|
+
height: te,
|
|
220
|
+
borderRadius: O,
|
|
216
221
|
boxSizing: "border-box",
|
|
217
|
-
...
|
|
222
|
+
...j
|
|
218
223
|
},
|
|
219
224
|
children: [
|
|
220
|
-
d ? /* @__PURE__ */
|
|
225
|
+
d ? /* @__PURE__ */ o(
|
|
221
226
|
"svg",
|
|
222
227
|
{
|
|
223
|
-
className:
|
|
224
|
-
width:
|
|
228
|
+
className: I,
|
|
229
|
+
width: x,
|
|
225
230
|
height: T,
|
|
226
|
-
viewBox: `0 0 ${
|
|
231
|
+
viewBox: `0 0 ${x} ${T}`,
|
|
227
232
|
fill: "none",
|
|
228
233
|
"aria-hidden": "true",
|
|
229
234
|
children: [
|
|
230
|
-
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */
|
|
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:
|
|
237
|
+
/* @__PURE__ */ e("stop", { offset: "1", style: { stopColor: se } })
|
|
233
238
|
] }) }),
|
|
234
239
|
/* @__PURE__ */ e(
|
|
235
240
|
"path",
|
|
236
241
|
{
|
|
237
|
-
d:
|
|
242
|
+
d: re,
|
|
238
243
|
"data-malachite-shape": "",
|
|
239
|
-
style: { fill: `url(#${
|
|
244
|
+
style: { fill: `url(#${u})` }
|
|
240
245
|
}
|
|
241
246
|
),
|
|
242
247
|
/* @__PURE__ */ e(
|
|
243
248
|
"path",
|
|
244
249
|
{
|
|
245
|
-
d:
|
|
250
|
+
d: B,
|
|
246
251
|
"data-malachite-shape": "",
|
|
247
|
-
strokeWidth:
|
|
252
|
+
strokeWidth: E,
|
|
248
253
|
style: { fill: "none", stroke: `var(${f})` }
|
|
249
254
|
}
|
|
250
255
|
)
|
|
251
256
|
]
|
|
252
257
|
}
|
|
253
258
|
) : null,
|
|
254
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ o(
|
|
255
260
|
"button",
|
|
256
261
|
{
|
|
257
262
|
type: "button",
|
|
258
263
|
role: "radio",
|
|
259
|
-
"data-value":
|
|
264
|
+
"data-value": l,
|
|
260
265
|
"aria-checked": d,
|
|
261
|
-
"aria-label":
|
|
262
|
-
"aria-labelledby":
|
|
263
|
-
"aria-describedby":
|
|
264
|
-
"aria-disabled":
|
|
265
|
-
tabIndex:
|
|
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
|
-
|
|
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 ${
|
|
270
|
-
style: { borderRadius:
|
|
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
|
-
"
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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 ${
|
|
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
|
-
|
|
316
|
-
|
|
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:
|
|
321
|
-
children:
|
|
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(
|
|
325
|
-
/* @__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:
|
|
329
|
+
style: G ? { color: b } : void 0,
|
|
331
330
|
children: t
|
|
332
331
|
}
|
|
333
332
|
) })
|
|
334
333
|
] }),
|
|
335
|
-
v ? /* @__PURE__ */ e("span", { id:
|
|
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:
|
|
343
|
-
|
|
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:
|
|
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
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|