@stackone/malachite 2.83.1 → 2.84.1

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.
Files changed (41) hide show
  1. package/COMPONENTS.md +3 -3
  2. package/dist/assets/icons/forbidden.svg.js +173 -3
  3. package/dist/assets/icons/forbidden.svg.js.map +1 -1
  4. package/dist/assets/icons/navbar_collapse.svg.js +3 -1
  5. package/dist/assets/icons/navbar_collapse.svg.js.map +1 -1
  6. package/dist/assets/icons/navbar_expand.svg.js +3 -1
  7. package/dist/assets/icons/navbar_expand.svg.js.map +1 -1
  8. package/dist/assets/icons/not_found.svg.js +143 -3
  9. package/dist/assets/icons/not_found.svg.js.map +1 -1
  10. package/dist/assets/icons/required_field_indicator.svg.js +7 -1
  11. package/dist/assets/icons/required_field_indicator.svg.js.map +1 -1
  12. package/dist/assets/icons/source.svg.js +4 -2
  13. package/dist/assets/icons/source.svg.js.map +1 -1
  14. package/dist/assets/icons/webhook_signing_secret.svg.js +3 -1
  15. package/dist/assets/icons/webhook_signing_secret.svg.js.map +1 -1
  16. package/dist/components/Accordion.js +124 -101
  17. package/dist/components/Accordion.js.map +1 -1
  18. package/dist/components/ActionMenu.js +174 -169
  19. package/dist/components/ActionMenu.js.map +1 -1
  20. package/dist/components/Alert.js +31 -31
  21. package/dist/components/Alert.js.map +1 -1
  22. package/dist/components/Button.js.map +1 -1
  23. package/dist/components/PinnedCornerCap.js +23 -0
  24. package/dist/components/PinnedCornerCap.js.map +1 -0
  25. package/dist/components/ShadowEscape.js +49 -78
  26. package/dist/components/ShadowEscape.js.map +1 -1
  27. package/dist/components/Table/Table.js +291 -310
  28. package/dist/components/Table/Table.js.map +1 -1
  29. package/dist/components/actionMenuStyles.js +86 -68
  30. package/dist/components/actionMenuStyles.js.map +1 -1
  31. package/dist/components/buttonStyles.js +2 -0
  32. package/dist/components/buttonStyles.js.map +1 -1
  33. package/dist/components/optionRowStyles.js +10 -9
  34. package/dist/components/optionRowStyles.js.map +1 -1
  35. package/dist/components/usePinned.js +38 -0
  36. package/dist/components/usePinned.js.map +1 -0
  37. package/dist/index.d.ts +23 -1
  38. package/dist/tailwind.css.js +1 -1
  39. package/dist/theme.js +21 -16
  40. package/dist/theme.js.map +1 -1
  41. package/package.json +1 -1
@@ -9,7 +9,7 @@ import q from "./CustomIcons/InfoCircleFilled.js";
9
9
  import G from "./CustomIcons/SparkleIcon.js";
10
10
  import J from "./CustomIcons/WarningCircleFilled.js";
11
11
  import E from "./Typography/MarkdownBlock.js";
12
- import { getTextColor as z, getFontSize as K } from "./Typography/textStyles.js";
12
+ import { getTextColor as k, getFontSize as K } from "./Typography/textStyles.js";
13
13
  const g = (r) => {
14
14
  switch (r) {
15
15
  case "info":
@@ -55,10 +55,10 @@ const g = (r) => {
55
55
  ), V = ({ text: r, emphasis: l }) => {
56
56
  if (!l)
57
57
  return [{ text: r, bold: !1, offset: 0 }];
58
- const t = [], a = (n, s, o) => {
59
- n && t.push({ text: n, bold: s, offset: o });
58
+ const t = [], o = (n, a, s) => {
59
+ n && t.push({ text: n, bold: a, offset: s });
60
60
  }, c = r.split(l);
61
- return c.reduce((n, s, o) => (a(s, !1, n), o < c.length - 1 && a(l, !0, n + s.length), n + s.length + l.length), 0), t;
61
+ return c.reduce((n, a, s) => (o(a, !1, n), s < c.length - 1 && o(l, !0, n + a.length), n + a.length + l.length), 0), t;
62
62
  }, X = ({ address: r, color: l }) => /* @__PURE__ */ e(
63
63
  "code",
64
64
  {
@@ -73,8 +73,8 @@ const g = (r) => {
73
73
  (t) => t.bold ? /* @__PURE__ */ e("strong", { style: { fontWeight: 600 }, children: t.text }, t.offset) : /* @__PURE__ */ e(M.Fragment, { children: t.text }, t.offset)
74
74
  )
75
75
  }
76
- ), Z = new RegExp("^\\p{P}", "u"), j = ({ text: r, type: l, lead: t, address: a, addressSuffix: c, renderLink: n }) => {
77
- const s = z(g(l)), o = /* @__PURE__ */ e(
76
+ ), Z = new RegExp("^\\p{P}", "u"), j = ({ text: r, type: l, lead: t, address: o, addressSuffix: c, renderLink: n }) => {
77
+ const a = k(g(l)), s = /* @__PURE__ */ e(
78
78
  E,
79
79
  {
80
80
  text: r,
@@ -84,17 +84,17 @@ const g = (r) => {
84
84
  renderLink: n
85
85
  }
86
86
  );
87
- return !t && !a ? o : /* @__PURE__ */ i("div", { className: "alert-lead", children: [
87
+ return !t && !o ? s : /* @__PURE__ */ i("div", { className: "alert-lead", children: [
88
88
  t ? /* @__PURE__ */ i(u, { children: [
89
- /* @__PURE__ */ e("strong", { style: { color: s, fontSize: K("small"), fontWeight: 600 }, children: t }),
89
+ /* @__PURE__ */ e("strong", { style: { color: a, fontSize: K("small"), fontWeight: 600 }, children: t }),
90
90
  " "
91
91
  ] }) : null,
92
- o,
93
- a ? /* @__PURE__ */ i(u, { children: [
92
+ s,
93
+ o ? /* @__PURE__ */ i(u, { children: [
94
94
  " ",
95
- /* @__PURE__ */ e(X, { address: a, color: s })
95
+ /* @__PURE__ */ e(X, { address: o, color: a })
96
96
  ] }) : null,
97
- a && c ? /* @__PURE__ */ i(u, { children: [
97
+ o && c ? /* @__PURE__ */ i(u, { children: [
98
98
  Z.test(c) ? "" : " ",
99
99
  /* @__PURE__ */ e(
100
100
  E,
@@ -112,23 +112,23 @@ const g = (r) => {
112
112
  type: r = "info",
113
113
  message: l,
114
114
  hasMargin: t = !0,
115
- className: a,
115
+ className: o,
116
116
  children: c,
117
117
  isExpanded: n,
118
- onToggle: s,
119
- action: o,
118
+ onToggle: a,
119
+ action: s,
120
120
  icon: N,
121
- live: O = !1,
121
+ live: z = !1,
122
122
  renderLink: w,
123
- layout: W = "inline",
124
- lead: C,
125
- address: b,
123
+ layout: O = "inline",
124
+ lead: b,
125
+ address: C,
126
126
  addressSuffix: y,
127
- align: k = "start"
127
+ align: W = "start"
128
128
  }) => {
129
- const d = !!c, p = W === "banner" && !d, v = p && k === "center", _ = O ? r === "error" || r === "warning" ? "alert" : "status" : void 0, [A, B] = P(!1), f = n !== void 0 ? n : A, T = () => {
129
+ const d = !!c, p = O === "banner" && !d, v = p && W === "center", _ = z ? r === "error" || r === "warning" ? "alert" : "status" : void 0, [A, B] = P(!1), f = n !== void 0 ? n : A, T = () => {
130
130
  const x = !f;
131
- n === void 0 && B(x), s == null || s(x);
131
+ n === void 0 && B(x), a == null || a(x);
132
132
  }, I = [
133
133
  "alert-base",
134
134
  `alert-${r}`,
@@ -140,7 +140,7 @@ const g = (r) => {
140
140
  v ? "text-center" : "text-left",
141
141
  p ? "" : d ? "rounded-xl !p-0" : "!px-2.5 !py-1.5",
142
142
  // Slightly more vertical padding for centering
143
- a
143
+ o
144
144
  ].filter(Boolean).join(" "), R = [
145
145
  "flex items-center justify-between w-full",
146
146
  d ? "gap-2 px-2.5 py-1" : "gap-2",
@@ -154,8 +154,8 @@ const g = (r) => {
154
154
  {
155
155
  text: l,
156
156
  type: r,
157
- lead: C,
158
- address: b,
157
+ lead: b,
158
+ address: C,
159
159
  addressSuffix: y,
160
160
  renderLink: w
161
161
  }
@@ -166,7 +166,7 @@ const g = (r) => {
166
166
  // Its own group, so an `action` stays at the end while this sits mid-band.
167
167
  /* @__PURE__ */ e("div", { className: "alert-centred flex-1 flex items-center justify-center gap-[10px]", children: x })
168
168
  ) : x,
169
- o && /* @__PURE__ */ e("div", { className: "alert-action shrink-0 flex items-center", children: o })
169
+ s && /* @__PURE__ */ e("div", { className: "alert-action shrink-0 flex items-center", children: s })
170
170
  ] });
171
171
  }
172
172
  return /* @__PURE__ */ i("div", { className: `${I} alert-expandable`, children: [
@@ -177,8 +177,8 @@ const g = (r) => {
177
177
  j,
178
178
  {
179
179
  text: l,
180
- lead: C,
181
- address: b,
180
+ lead: b,
181
+ address: C,
182
182
  addressSuffix: y,
183
183
  type: r,
184
184
  renderLink: w
@@ -186,7 +186,7 @@ const g = (r) => {
186
186
  ) }) })
187
187
  ] }),
188
188
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
189
- o && /* @__PURE__ */ e("div", { className: "alert-action flex items-center", children: o }),
189
+ s && /* @__PURE__ */ e("div", { className: "alert-action flex items-center", children: s }),
190
190
  /* @__PURE__ */ e(
191
191
  U,
192
192
  {
@@ -195,14 +195,14 @@ const g = (r) => {
195
195
  onClick: T,
196
196
  "aria-label": f ? "Collapse" : "Expand",
197
197
  style: {
198
- color: z(g(r))
198
+ color: k(g(r))
199
199
  },
200
200
  children: f ? /* @__PURE__ */ e($, { style: { minWidth: "13px", minHeight: "13px" } }) : /* @__PURE__ */ e(Y, { style: { minWidth: "13px", minHeight: "13px" } })
201
201
  }
202
202
  )
203
203
  ] })
204
204
  ] }),
205
- f && /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: H, children: /* @__PURE__ */ e("div", { className: "bg-white rounded-[var(--malachite-radius-10,10px)] shadow-[0px_1px_0px_0px_rgba(0,0,0,0.15)] border border-[#e8e8e8] border-solid mx-2 mb-2 max-h-[553px] overflow-y-auto", children: c }) }) })
205
+ f && /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: H, children: /* @__PURE__ */ e("div", { className: "bg-[var(--malachite-card-background,#fff)] rounded-[var(--malachite-radius-10,10px)] [box-shadow:var(--malachite-shadow-default,0px_1px_0px_0px_rgba(0,0,0,0.15))] border border-[var(--malachite-card-border,#e8e8e8)] border-solid mx-2 mb-2 max-h-[553px] overflow-y-auto", children: c }) }) })
206
206
  ] });
207
207
  };
208
208
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../src/components/Alert.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Button, ButtonVariant } from './Button';\nimport CaretDownIcon from './CustomIcons/CaretDownIcon';\nimport CaretUpIcon from './CustomIcons/CaretUpIcon';\nimport CheckCircleFilled from './CustomIcons/CheckCircleFilled';\nimport ErrorCircleFilled from './CustomIcons/ErrorCircleFilled';\nimport InfoCircleFilled from './CustomIcons/InfoCircleFilled';\nimport SparkleIcon from './CustomIcons/SparkleIcon';\nimport WarningCircleFilled from './CustomIcons/WarningCircleFilled';\nimport type { RenderLink } from './PageLayout/types';\nimport MarkdownBlock from './Typography/MarkdownBlock';\nimport type { TextColor } from './Typography/Text';\nimport { getFontSize, getTextColor } from './Typography/textStyles';\n\nexport type AlertType = 'info' | 'success' | 'error' | 'warning' | 'assistant';\n\nexport type AlertLayout = 'inline' | 'banner';\n\nexport interface AlertAddress {\n /** The full address, shown whole in mono; it wraps rather than truncates. */\n text: string;\n /** The part to set in bold, such as the registrable domain; every occurrence is bolded. */\n emphasis?: string;\n}\n\ninterface AlertButtonConfig {\n label: string;\n onClick: () => void;\n variant?: ButtonVariant;\n icon?: React.ReactNode;\n}\n\ninterface AlertProps {\n type?: AlertType;\n message: string;\n hasMargin?: boolean;\n className?: string;\n children?: React.ReactNode;\n isExpanded?: boolean;\n onToggle?: (expanded: boolean) => void;\n /** A control at the end of the alert — a link or button that resolves what it reports. */\n action?: React.ReactNode;\n /** Replaces the type's status icon: an svg painting with `currentColor`, such as a CustomIcon,\n * is drawn in the type's colour at the same size. */\n icon?: React.ReactNode;\n /** Makes its message a live region: `role=\"alert\"` for error and warning, `status` otherwise.\n * Screen readers reliably announce an `alert` as it mounts; a `status` is read when its\n * `message` changes, so keep a live info or success alert mounted. Off by default. */\n live?: boolean;\n /** Routes root-relative links in `message` through the app's router; see `MarkdownBlock`. */\n renderLink?: RenderLink;\n /** `banner`: a 48px page-wide band. Applies only without `children`. */\n layout?: AlertLayout;\n /** `center` gathers a banner's icon and text in the middle of the band, for a wide page. */\n align?: 'start' | 'center';\n /** A bold sentence the message runs on from. Plain text, not markdown. */\n lead?: string;\n /** An address the message runs on into, in mono; `emphasis`, an optional substring such as the registrable domain, is bold wherever it occurs. */\n address?: AlertAddress;\n /** Markdown that runs on after the address; it joins without a space when it opens with any punctuation. */\n addressSuffix?: string;\n}\n\n// Distinct from the imported `getTextColor`, which maps a TextColor to a CSS variable.\n// This maps an AlertType to a TextColor token; both are used in this file.\nconst getAlertTextColor = (alertType: AlertType): TextColor => {\n switch (alertType) {\n case 'info':\n return 'primary';\n case 'success':\n return 'success';\n case 'error':\n return 'error';\n case 'warning':\n return 'warning';\n // The violet is on `.alert-assistant` itself; inheriting it keeps one definition\n // rather than a TextColor token that only this alert would ever name.\n case 'assistant':\n return 'inherit';\n default:\n return 'primary';\n }\n};\n\nconst ICON_STYLE = {\n width: '13px',\n height: '13px',\n flexShrink: 0,\n};\n\nconst ICON_COLOR: Record<AlertType, string> = {\n info: 'var(--malachite-alert-info-foreground)',\n success: 'var(--malachite-alert-success-foreground)',\n error: 'var(--malachite-alert-error-foreground)',\n warning: 'var(--malachite-alert-warning-foreground)',\n assistant: 'var(--malachite-alert-assistant-foreground)',\n};\n\nconst AlertIcon = {\n info: <InfoCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.info }} />,\n success: <CheckCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.success }} />,\n error: <ErrorCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.error }} />,\n warning: <WarningCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.warning }} />,\n // The same sparkle the control that produced the message carries, so the two read as\n // one thread rather than two unrelated affordances.\n assistant: <SparkleIcon style={{ ...ICON_STYLE, color: ICON_COLOR.assistant }} />,\n};\n\nconst BANNER_ICON_STYLE = { ...ICON_STYLE, width: '16px', height: '16px' };\n\nconst statusIcon = (type: AlertType, icon: React.ReactNode, banner = false) => {\n if (!icon && !banner) return AlertIcon[type];\n const style = banner ? BANNER_ICON_STYLE : ICON_STYLE;\n return (\n <span\n className=\"alert-status-icon inline-flex shrink-0 [&_svg]:size-full!\"\n style={{ ...style, color: ICON_COLOR[type] }}\n >\n {icon || AlertIcon[type]}\n </span>\n );\n};\n\ninterface AddressSegment {\n text: string;\n bold: boolean;\n offset: number;\n}\n\n// The text cut at every occurrence of the emphasis, each cut remembering where it started.\nconst addressSegments = ({ text, emphasis }: AlertAddress): AddressSegment[] => {\n if (!emphasis) {\n return [{ text, bold: false, offset: 0 }];\n }\n const segments: AddressSegment[] = [];\n const push = (part: string, bold: boolean, offset: number) => {\n if (part) segments.push({ text: part, bold, offset });\n };\n const cuts = text.split(emphasis);\n cuts.reduce((offset, cut, index) => {\n push(cut, false, offset);\n if (index < cuts.length - 1) push(emphasis, true, offset + cut.length);\n return offset + cut.length + emphasis.length;\n }, 0);\n return segments;\n};\n\nconst AddressText: React.FC<{ address: AlertAddress; color: string }> = ({ address, color }) => (\n <code\n className=\"alert-address\"\n style={{\n fontFamily: 'var(--malachite-font-mono, monospace)',\n fontSize: '0.9em',\n color,\n overflowWrap: 'anywhere',\n }}\n >\n {addressSegments(address).map((segment) =>\n segment.bold ? (\n <strong key={segment.offset} style={{ fontWeight: 600 }}>\n {segment.text}\n </strong>\n ) : (\n <React.Fragment key={segment.offset}>{segment.text}</React.Fragment>\n ),\n )}\n </code>\n);\n\nconst OPENS_WITH_PUNCTUATION = /^\\p{P}/u;\n\nconst SimpleTextRenderer: React.FC<{\n text: string;\n type: AlertType;\n lead?: string;\n address?: AlertAddress;\n addressSuffix?: string;\n renderLink?: RenderLink;\n}> = ({ text, type, lead, address, addressSuffix, renderLink }) => {\n const color = getTextColor(getAlertTextColor(type));\n const message = (\n <MarkdownBlock\n text={text}\n color={getAlertTextColor(type)}\n size=\"small\"\n omitMargin\n renderLink={renderLink}\n />\n );\n if (!lead && !address) {\n return message;\n }\n return (\n <div className=\"alert-lead\">\n {lead ? (\n <>\n <strong style={{ color, fontSize: getFontSize('small'), fontWeight: 600 }}>\n {lead}\n </strong>{' '}\n </>\n ) : null}\n {message}\n {address ? (\n <>\n {' '}\n <AddressText address={address} color={color} />\n </>\n ) : null}\n {address && addressSuffix ? (\n <>\n {OPENS_WITH_PUNCTUATION.test(addressSuffix) ? '' : ' '}\n <MarkdownBlock\n text={addressSuffix}\n color={getAlertTextColor(type)}\n size=\"small\"\n omitMargin\n renderLink={renderLink}\n />\n </>\n ) : null}\n </div>\n );\n};\n\nconst Alert: React.FC<AlertProps> = ({\n type = 'info',\n message,\n hasMargin = true,\n className,\n children,\n isExpanded,\n onToggle,\n action,\n icon,\n live = false,\n renderLink,\n layout = 'inline',\n lead,\n address,\n addressSuffix,\n align = 'start',\n}) => {\n const isExpandable = !!children;\n const banner = layout === 'banner' && !isExpandable;\n const centred = banner && align === 'center';\n const urgent = type === 'error' || type === 'warning';\n const liveRole = live ? (urgent ? 'alert' : 'status') : undefined;\n const [internalExpanded, setInternalExpanded] = useState(false);\n\n // Use controlled state if isExpanded is provided, otherwise use internal state\n const expanded = isExpanded !== undefined ? isExpanded : internalExpanded;\n\n const handleToggle = () => {\n const newExpanded = !expanded;\n if (isExpanded === undefined) {\n // Uncontrolled mode\n setInternalExpanded(newExpanded);\n }\n // Call onToggle if provided (for both controlled and uncontrolled)\n onToggle?.(newExpanded);\n };\n\n const alertClasses = [\n 'alert-base',\n `alert-${type}`,\n 'flex',\n 'w-full', // Ensure full width\n banner\n ? 'alert-banner'\n : isExpandable && expanded\n ? 'flex-col'\n : 'gap-2 items-center min-h-[2rem]',\n !hasMargin ? 'alert-no-margin' : '',\n centred ? 'text-center' : 'text-left',\n banner ? '' : isExpandable ? 'rounded-xl !p-0' : '!px-2.5 !py-1.5', // Slightly more vertical padding for centering\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const headerClasses = [\n 'flex items-center justify-between w-full',\n isExpandable ? 'gap-2 px-2.5 py-1' : 'gap-2',\n isExpandable && expanded ? 'rounded-t-xl' : isExpandable ? 'rounded-xl' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const expandableContentClasses = ['w-full', 'overflow-hidden'].filter(Boolean).join(' ');\n\n // Non-expandable alert (original behavior)\n if (!isExpandable) {\n const content = (\n <>\n {statusIcon(type, icon, banner)}\n <div className={centred ? 'flex items-center' : 'flex-1 flex items-center'}>\n <div className=\"[&>div]:mb-0\" role={liveRole}>\n <SimpleTextRenderer\n text={message}\n type={type}\n lead={lead}\n address={address}\n addressSuffix={addressSuffix}\n renderLink={renderLink}\n />\n </div>\n </div>\n </>\n );\n return (\n <div className={alertClasses}>\n {centred ? (\n // Its own group, so an `action` stays at the end while this sits mid-band.\n <div className=\"alert-centred flex-1 flex items-center justify-center gap-[10px]\">\n {content}\n </div>\n ) : (\n content\n )}\n {action && <div className=\"alert-action shrink-0 flex items-center\">{action}</div>}\n </div>\n );\n }\n\n // Expandable alert\n return (\n <div className={`${alertClasses} alert-expandable`}>\n {/* Header section with title and expand/collapse button */}\n <div className={headerClasses}>\n <div className=\"flex-1 flex gap-2 items-center\">\n {statusIcon(type, icon)}\n <div className=\"flex-1 flex items-center\">\n <div className=\"[&>div]:mb-0\" role={liveRole}>\n <SimpleTextRenderer\n text={message}\n lead={lead}\n address={address}\n addressSuffix={addressSuffix}\n type={type}\n renderLink={renderLink}\n />\n </div>\n </div>\n </div>\n\n {/* Right side buttons container */}\n <div className=\"flex items-center gap-2\">\n {action && <div className=\"alert-action flex items-center\">{action}</div>}\n {/* Expand/collapse button */}\n <Button\n variant=\"no-style\"\n size=\"xsmall\"\n onClick={handleToggle}\n aria-label={expanded ? 'Collapse' : 'Expand'}\n style={{\n color: getTextColor(getAlertTextColor(type)),\n }}\n >\n {expanded ? (\n <CaretUpIcon style={{ minWidth: '13px', minHeight: '13px' }} />\n ) : (\n <CaretDownIcon style={{ minWidth: '13px', minHeight: '13px' }} />\n )}\n </Button>\n </div>\n </div>\n\n {/* Expandable content */}\n {expanded && (\n <>\n <div className={expandableContentClasses}>\n <div className=\"bg-white rounded-[var(--malachite-radius-10,10px)] shadow-[0px_1px_0px_0px_rgba(0,0,0,0.15)] border border-[#e8e8e8] border-solid mx-2 mb-2 max-h-[553px] overflow-y-auto\">\n {children}\n </div>\n </div>\n </>\n )}\n </div>\n );\n};\n\nexport default Alert;\nexport { Alert };\nexport type { AlertButtonConfig };\n"],"names":["getAlertTextColor","alertType","ICON_STYLE","ICON_COLOR","AlertIcon","jsx","InfoCircleFilled","CheckCircleFilled","ErrorCircleFilled","WarningCircleFilled","SparkleIcon","BANNER_ICON_STYLE","statusIcon","type","icon","banner","addressSegments","text","emphasis","segments","push","part","bold","offset","cuts","cut","index","AddressText","address","color","segment","React","OPENS_WITH_PUNCTUATION","SimpleTextRenderer","lead","addressSuffix","renderLink","getTextColor","message","MarkdownBlock","jsxs","Fragment","getFontSize","Alert","hasMargin","className","children","isExpanded","onToggle","action","live","layout","align","isExpandable","centred","liveRole","internalExpanded","setInternalExpanded","useState","expanded","handleToggle","newExpanded","alertClasses","headerClasses","expandableContentClasses","content","Button","CaretUpIcon","CaretDownIcon"],"mappings":";;;;;;;;;;;;AAiEA,MAAMA,IAAoB,CAACC,MAAoC;AAC3D,UAAQA,GAAA;AAAA,IACJ,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA;AAAA,IAGX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAAa;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAChB,GAEMC,IAAwC;AAAA,EAC1C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AACf,GAEMC,IAAY;AAAA,EACd,MAAM,gBAAAC,EAACC,GAAA,EAAiB,OAAO,EAAE,GAAGJ,GAAY,OAAOC,EAAW,KAAA,GAAQ;AAAA,EAC1E,SAAS,gBAAAE,EAACE,GAAA,EAAkB,OAAO,EAAE,GAAGL,GAAY,OAAOC,EAAW,QAAA,GAAW;AAAA,EACjF,OAAO,gBAAAE,EAACG,GAAA,EAAkB,OAAO,EAAE,GAAGN,GAAY,OAAOC,EAAW,MAAA,GAAS;AAAA,EAC7E,SAAS,gBAAAE,EAACI,GAAA,EAAoB,OAAO,EAAE,GAAGP,GAAY,OAAOC,EAAW,QAAA,GAAW;AAAA;AAAA;AAAA,EAGnF,WAAW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AAC4B;AAAA,UAAA;AAAA,YACG,MAAMK;AAAA,YACN,MAAAJ;AAAA,YACA,SAAAN;AAAA,YACA,eAAAO;AAAA,YACA,MAAAtB;AAAA,YACA,YAAAuB;AAAA,UAAA;AAAA,QAAA,GAER,EAAA,CACJ;AAAA,MAAA,GACJ;AAAA,MAGA,gBAAAI,EAAC,OAAA,EAAI,WAAU,2BACV,UAAA;AAAA,QAAAS,KAAU,gBAAA5C,EAAC,OAAA,EAAI,WAAU,kCAAkC,UAAA4C,GAAO;AAAA,QAEnE,gBAAA5C;AAAA,UAAC6D;AAAA,UAAA;AAAA,YACG,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,SAASN;AAAA,YACT,cAAYD,IAAW,aAAa;AAAA,YACpC,OAAO;AAAA,cACH,OAAOtB,EAAarC,EAAkBa,CAAI,CAAC;AAAA,YAAA;AAAA,YAG9C,cACG,gBAAAR,EAAC8D,GAAA,EAAY,OAAO,EAAE,UAAU,QAAQ,WAAW,OAAA,GAAU,IAE7D,gBAAA9D,EAAC+D,KAAc,OAAO,EAAE,UAAU,QAAQ,WAAW,SAAO,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAEvE,EAAA,CACJ;AAAA,IAAA,GACJ;AAAA,IAGCT,KACG,gBAAAtD,EAAAoC,GAAA,EACI,UAAA,gBAAApC,EAAC,OAAA,EAAI,WAAW2D,GACZ,UAAA,gBAAA3D,EAAC,OAAA,EAAI,WAAU,6KACV,UAAAyC,EAAA,CACL,EAAA,CACJ,EAAA,CACJ;AAAA,EAAA,GAER;AAER;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../src/components/Alert.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Button, ButtonVariant } from './Button';\nimport CaretDownIcon from './CustomIcons/CaretDownIcon';\nimport CaretUpIcon from './CustomIcons/CaretUpIcon';\nimport CheckCircleFilled from './CustomIcons/CheckCircleFilled';\nimport ErrorCircleFilled from './CustomIcons/ErrorCircleFilled';\nimport InfoCircleFilled from './CustomIcons/InfoCircleFilled';\nimport SparkleIcon from './CustomIcons/SparkleIcon';\nimport WarningCircleFilled from './CustomIcons/WarningCircleFilled';\nimport type { RenderLink } from './PageLayout/types';\nimport MarkdownBlock from './Typography/MarkdownBlock';\nimport type { TextColor } from './Typography/Text';\nimport { getFontSize, getTextColor } from './Typography/textStyles';\n\nexport type AlertType = 'info' | 'success' | 'error' | 'warning' | 'assistant';\n\nexport type AlertLayout = 'inline' | 'banner';\n\nexport interface AlertAddress {\n /** The full address, shown whole in mono; it wraps rather than truncates. */\n text: string;\n /** The part to set in bold, such as the registrable domain; every occurrence is bolded. */\n emphasis?: string;\n}\n\ninterface AlertButtonConfig {\n label: string;\n onClick: () => void;\n variant?: ButtonVariant;\n icon?: React.ReactNode;\n}\n\ninterface AlertProps {\n type?: AlertType;\n message: string;\n hasMargin?: boolean;\n className?: string;\n children?: React.ReactNode;\n isExpanded?: boolean;\n onToggle?: (expanded: boolean) => void;\n /** A control at the end of the alert — a link or button that resolves what it reports. */\n action?: React.ReactNode;\n /** Replaces the type's status icon: an svg painting with `currentColor`, such as a CustomIcon,\n * is drawn in the type's colour at the same size. */\n icon?: React.ReactNode;\n /** Makes its message a live region: `role=\"alert\"` for error and warning, `status` otherwise.\n * Screen readers reliably announce an `alert` as it mounts; a `status` is read when its\n * `message` changes, so keep a live info or success alert mounted. Off by default. */\n live?: boolean;\n /** Routes root-relative links in `message` through the app's router; see `MarkdownBlock`. */\n renderLink?: RenderLink;\n /** `banner`: a 48px page-wide band. Applies only without `children`. */\n layout?: AlertLayout;\n /** `center` gathers a banner's icon and text in the middle of the band, for a wide page. */\n align?: 'start' | 'center';\n /** A bold sentence the message runs on from. Plain text, not markdown. */\n lead?: string;\n /** An address the message runs on into, in mono; `emphasis`, an optional substring such as the registrable domain, is bold wherever it occurs. */\n address?: AlertAddress;\n /** Markdown that runs on after the address; it joins without a space when it opens with any punctuation. */\n addressSuffix?: string;\n}\n\n// Distinct from the imported `getTextColor`, which maps a TextColor to a CSS variable.\n// This maps an AlertType to a TextColor token; both are used in this file.\nconst getAlertTextColor = (alertType: AlertType): TextColor => {\n switch (alertType) {\n case 'info':\n return 'primary';\n case 'success':\n return 'success';\n case 'error':\n return 'error';\n case 'warning':\n return 'warning';\n // The violet is on `.alert-assistant` itself; inheriting it keeps one definition\n // rather than a TextColor token that only this alert would ever name.\n case 'assistant':\n return 'inherit';\n default:\n return 'primary';\n }\n};\n\nconst ICON_STYLE = {\n width: '13px',\n height: '13px',\n flexShrink: 0,\n};\n\nconst ICON_COLOR: Record<AlertType, string> = {\n info: 'var(--malachite-alert-info-foreground)',\n success: 'var(--malachite-alert-success-foreground)',\n error: 'var(--malachite-alert-error-foreground)',\n warning: 'var(--malachite-alert-warning-foreground)',\n assistant: 'var(--malachite-alert-assistant-foreground)',\n};\n\nconst AlertIcon = {\n info: <InfoCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.info }} />,\n success: <CheckCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.success }} />,\n error: <ErrorCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.error }} />,\n warning: <WarningCircleFilled style={{ ...ICON_STYLE, color: ICON_COLOR.warning }} />,\n // The same sparkle the control that produced the message carries, so the two read as\n // one thread rather than two unrelated affordances.\n assistant: <SparkleIcon style={{ ...ICON_STYLE, color: ICON_COLOR.assistant }} />,\n};\n\nconst BANNER_ICON_STYLE = { ...ICON_STYLE, width: '16px', height: '16px' };\n\nconst statusIcon = (type: AlertType, icon: React.ReactNode, banner = false) => {\n if (!icon && !banner) return AlertIcon[type];\n const style = banner ? BANNER_ICON_STYLE : ICON_STYLE;\n return (\n <span\n className=\"alert-status-icon inline-flex shrink-0 [&_svg]:size-full!\"\n style={{ ...style, color: ICON_COLOR[type] }}\n >\n {icon || AlertIcon[type]}\n </span>\n );\n};\n\ninterface AddressSegment {\n text: string;\n bold: boolean;\n offset: number;\n}\n\n// The text cut at every occurrence of the emphasis, each cut remembering where it started.\nconst addressSegments = ({ text, emphasis }: AlertAddress): AddressSegment[] => {\n if (!emphasis) {\n return [{ text, bold: false, offset: 0 }];\n }\n const segments: AddressSegment[] = [];\n const push = (part: string, bold: boolean, offset: number) => {\n if (part) segments.push({ text: part, bold, offset });\n };\n const cuts = text.split(emphasis);\n cuts.reduce((offset, cut, index) => {\n push(cut, false, offset);\n if (index < cuts.length - 1) push(emphasis, true, offset + cut.length);\n return offset + cut.length + emphasis.length;\n }, 0);\n return segments;\n};\n\nconst AddressText: React.FC<{ address: AlertAddress; color: string }> = ({ address, color }) => (\n <code\n className=\"alert-address\"\n style={{\n fontFamily: 'var(--malachite-font-mono, monospace)',\n fontSize: '0.9em',\n color,\n overflowWrap: 'anywhere',\n }}\n >\n {addressSegments(address).map((segment) =>\n segment.bold ? (\n <strong key={segment.offset} style={{ fontWeight: 600 }}>\n {segment.text}\n </strong>\n ) : (\n <React.Fragment key={segment.offset}>{segment.text}</React.Fragment>\n ),\n )}\n </code>\n);\n\nconst OPENS_WITH_PUNCTUATION = /^\\p{P}/u;\n\nconst SimpleTextRenderer: React.FC<{\n text: string;\n type: AlertType;\n lead?: string;\n address?: AlertAddress;\n addressSuffix?: string;\n renderLink?: RenderLink;\n}> = ({ text, type, lead, address, addressSuffix, renderLink }) => {\n const color = getTextColor(getAlertTextColor(type));\n const message = (\n <MarkdownBlock\n text={text}\n color={getAlertTextColor(type)}\n size=\"small\"\n omitMargin\n renderLink={renderLink}\n />\n );\n if (!lead && !address) {\n return message;\n }\n return (\n <div className=\"alert-lead\">\n {lead ? (\n <>\n <strong style={{ color, fontSize: getFontSize('small'), fontWeight: 600 }}>\n {lead}\n </strong>{' '}\n </>\n ) : null}\n {message}\n {address ? (\n <>\n {' '}\n <AddressText address={address} color={color} />\n </>\n ) : null}\n {address && addressSuffix ? (\n <>\n {OPENS_WITH_PUNCTUATION.test(addressSuffix) ? '' : ' '}\n <MarkdownBlock\n text={addressSuffix}\n color={getAlertTextColor(type)}\n size=\"small\"\n omitMargin\n renderLink={renderLink}\n />\n </>\n ) : null}\n </div>\n );\n};\n\nconst Alert: React.FC<AlertProps> = ({\n type = 'info',\n message,\n hasMargin = true,\n className,\n children,\n isExpanded,\n onToggle,\n action,\n icon,\n live = false,\n renderLink,\n layout = 'inline',\n lead,\n address,\n addressSuffix,\n align = 'start',\n}) => {\n const isExpandable = !!children;\n const banner = layout === 'banner' && !isExpandable;\n const centred = banner && align === 'center';\n const urgent = type === 'error' || type === 'warning';\n const liveRole = live ? (urgent ? 'alert' : 'status') : undefined;\n const [internalExpanded, setInternalExpanded] = useState(false);\n\n // Use controlled state if isExpanded is provided, otherwise use internal state\n const expanded = isExpanded !== undefined ? isExpanded : internalExpanded;\n\n const handleToggle = () => {\n const newExpanded = !expanded;\n if (isExpanded === undefined) {\n // Uncontrolled mode\n setInternalExpanded(newExpanded);\n }\n // Call onToggle if provided (for both controlled and uncontrolled)\n onToggle?.(newExpanded);\n };\n\n const alertClasses = [\n 'alert-base',\n `alert-${type}`,\n 'flex',\n 'w-full', // Ensure full width\n banner\n ? 'alert-banner'\n : isExpandable && expanded\n ? 'flex-col'\n : 'gap-2 items-center min-h-[2rem]',\n !hasMargin ? 'alert-no-margin' : '',\n centred ? 'text-center' : 'text-left',\n banner ? '' : isExpandable ? 'rounded-xl !p-0' : '!px-2.5 !py-1.5', // Slightly more vertical padding for centering\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const headerClasses = [\n 'flex items-center justify-between w-full',\n isExpandable ? 'gap-2 px-2.5 py-1' : 'gap-2',\n isExpandable && expanded ? 'rounded-t-xl' : isExpandable ? 'rounded-xl' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const expandableContentClasses = ['w-full', 'overflow-hidden'].filter(Boolean).join(' ');\n\n // Non-expandable alert (original behavior)\n if (!isExpandable) {\n const content = (\n <>\n {statusIcon(type, icon, banner)}\n <div className={centred ? 'flex items-center' : 'flex-1 flex items-center'}>\n <div className=\"[&>div]:mb-0\" role={liveRole}>\n <SimpleTextRenderer\n text={message}\n type={type}\n lead={lead}\n address={address}\n addressSuffix={addressSuffix}\n renderLink={renderLink}\n />\n </div>\n </div>\n </>\n );\n return (\n <div className={alertClasses}>\n {centred ? (\n // Its own group, so an `action` stays at the end while this sits mid-band.\n <div className=\"alert-centred flex-1 flex items-center justify-center gap-[10px]\">\n {content}\n </div>\n ) : (\n content\n )}\n {action && <div className=\"alert-action shrink-0 flex items-center\">{action}</div>}\n </div>\n );\n }\n\n // Expandable alert\n return (\n <div className={`${alertClasses} alert-expandable`}>\n {/* Header section with title and expand/collapse button */}\n <div className={headerClasses}>\n <div className=\"flex-1 flex gap-2 items-center\">\n {statusIcon(type, icon)}\n <div className=\"flex-1 flex items-center\">\n <div className=\"[&>div]:mb-0\" role={liveRole}>\n <SimpleTextRenderer\n text={message}\n lead={lead}\n address={address}\n addressSuffix={addressSuffix}\n type={type}\n renderLink={renderLink}\n />\n </div>\n </div>\n </div>\n\n {/* Right side buttons container */}\n <div className=\"flex items-center gap-2\">\n {action && <div className=\"alert-action flex items-center\">{action}</div>}\n {/* Expand/collapse button */}\n <Button\n variant=\"no-style\"\n size=\"xsmall\"\n onClick={handleToggle}\n aria-label={expanded ? 'Collapse' : 'Expand'}\n style={{\n color: getTextColor(getAlertTextColor(type)),\n }}\n >\n {expanded ? (\n <CaretUpIcon style={{ minWidth: '13px', minHeight: '13px' }} />\n ) : (\n <CaretDownIcon style={{ minWidth: '13px', minHeight: '13px' }} />\n )}\n </Button>\n </div>\n </div>\n\n {/* Expandable content */}\n {expanded && (\n <>\n <div className={expandableContentClasses}>\n <div className=\"bg-[var(--malachite-card-background,#fff)] rounded-[var(--malachite-radius-10,10px)] [box-shadow:var(--malachite-shadow-default,0px_1px_0px_0px_rgba(0,0,0,0.15))] border border-[var(--malachite-card-border,#e8e8e8)] border-solid mx-2 mb-2 max-h-[553px] overflow-y-auto\">\n {children}\n </div>\n </div>\n </>\n )}\n </div>\n );\n};\n\nexport default Alert;\nexport { Alert };\nexport type { AlertButtonConfig };\n"],"names":["getAlertTextColor","alertType","ICON_STYLE","ICON_COLOR","AlertIcon","jsx","InfoCircleFilled","CheckCircleFilled","ErrorCircleFilled","WarningCircleFilled","SparkleIcon","BANNER_ICON_STYLE","statusIcon","type","icon","banner","addressSegments","text","emphasis","segments","push","part","bold","offset","cuts","cut","index","AddressText","address","color","segment","React","OPENS_WITH_PUNCTUATION","SimpleTextRenderer","lead","addressSuffix","renderLink","getTextColor","message","MarkdownBlock","jsxs","Fragment","getFontSize","Alert","hasMargin","className","children","isExpanded","onToggle","action","live","layout","align","isExpandable","centred","liveRole","internalExpanded","setInternalExpanded","useState","expanded","handleToggle","newExpanded","alertClasses","headerClasses","expandableContentClasses","content","Button","CaretUpIcon","CaretDownIcon"],"mappings":";;;;;;;;;;;;AAiEA,MAAMA,IAAoB,CAACC,MAAoC;AAC3D,UAAQA,GAAA;AAAA,IACJ,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA;AAAA,IAGX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAAa;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAChB,GAEMC,IAAwC;AAAA,EAC1C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AACf,GAEMC,IAAY;AAAA,EACd,MAAM,gBAAAC,EAACC,GAAA,EAAiB,OAAO,EAAE,GAAGJ,GAAY,OAAOC,EAAW,KAAA,GAAQ;AAAA,EAC1E,SAAS,gBAAAE,EAACE,GAAA,EAAkB,OAAO,EAAE,GAAGL,GAAY,OAAOC,EAAW,QAAA,GAAW;AAAA,EACjF,OAAO,gBAAAE,EAACG,GAAA,EAAkB,OAAO,EAAE,GAAGN,GAAY,OAAOC,EAAW,MAAA,GAAS;AAAA,EA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AAI;AAAA,QACtB,gBAAAT,EAAC,SAAI,WAAU,4BACX,4BAAC,OAAA,EAAI,WAAU,gBAAe,MAAMkD,GAChC,UAAA,gBAAAlD;AAAA,UAAC4B;AAAA,UAAA;AAAA,YACG,MAAMK;AAAA,YACN,MAAAJ;AAAA,YACA,SAAAN;AAAA,YACA,eAAAO;AAAA,YACA,MAAAtB;AAAA,YACA,YAAAuB;AAAA,UAAA;AAAA,QAAA,GAER,EAAA,CACJ;AAAA,MAAA,GACJ;AAAA,MAGA,gBAAAI,EAAC,OAAA,EAAI,WAAU,2BACV,UAAA;AAAA,QAAAS,KAAU,gBAAA5C,EAAC,OAAA,EAAI,WAAU,kCAAkC,UAAA4C,GAAO;AAAA,QAEnE,gBAAA5C;AAAA,UAAC6D;AAAA,UAAA;AAAA,YACG,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,SAASN;AAAA,YACT,cAAYD,IAAW,aAAa;AAAA,YACpC,OAAO;AAAA,cACH,OAAOtB,EAAarC,EAAkBa,CAAI,CAAC;AAAA,YAAA;AAAA,YAG9C,cACG,gBAAAR,EAAC8D,GAAA,EAAY,OAAO,EAAE,UAAU,QAAQ,WAAW,OAAA,GAAU,IAE7D,gBAAA9D,EAAC+D,KAAc,OAAO,EAAE,UAAU,QAAQ,WAAW,SAAO,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAEvE,EAAA,CACJ;AAAA,IAAA,GACJ;AAAA,IAGCT,KACG,gBAAAtD,EAAAoC,GAAA,EACI,UAAA,gBAAApC,EAAC,OAAA,EAAI,WAAW2D,GACZ,UAAA,gBAAA3D,EAAC,OAAA,EAAI,WAAU,gRACV,UAAAyC,EAAA,CACL,EAAA,CACJ,EAAA,CACJ;AAAA,EAAA,GAER;AAER;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport ButtonSpinner from './ButtonSpinner';\nimport Tooltip from './Tooltip';\nimport { getIconOnlySizeClasses, getIconSizeClass } from './buttonSizing';\nimport {\n getDefaultRadiusClass,\n getIconGapClass,\n getRadiusClass,\n getSizeClasses,\n getVariantClasses,\n} from './buttonStyles';\nimport { resolveRel } from './linkRel';\n\n// Button variant types matching the old component\nexport type ButtonVariant =\n | 'filled'\n | 'outline'\n /**\n * `outline`'s geometry on a ground of its own. For a button sitting on a tinted or\n * patterned surface, where `outline`'s transparent background lets that surface through\n * and the control stops reading as a button.\n */\n | 'surface'\n /**\n * The violet the assistant is named in elsewhere — for a control that hands work to it, or\n * acts on what it produced. Provenance, not a severity: it says who is being asked, not\n * that anything is wrong.\n */\n | 'assistant'\n | 'destructive'\n | 'success'\n | 'warning'\n | 'error'\n | 'ghost'\n /** Text only, in the accent colour, for a secondary action beside a primary one. */\n | 'quiet'\n | 'no-style';\n\nexport type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large';\n\nexport type ButtonRadius = 'md' | 'lg' | 'xl';\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant: ButtonVariant;\n size?: ButtonSize;\n radius?: ButtonRadius;\n loading?: boolean;\n disabled?: boolean;\n icon?: React.ReactNode;\n iconPosition?: 'start' | 'end';\n /** Before the label at its own size, never squeezed (an avatar); pairs with an end `icon`. */\n leading?: React.ReactNode;\n /** `start` aligns the label to the leading edge and pins an end `icon` to the far edge. */\n contentAlign?: 'center' | 'start';\n /** Fills the container's width. */\n flexGrow?: boolean;\n /** `wide` holds a 120px floor for a primary action. */\n width?: 'auto' | 'wide';\n fill?: boolean;\n tooltip?: string;\n tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';\n iconOnly?: boolean;\n /** Pulls a borderless button out by its own padding, so its label lines up with the text around it. */\n flush?: boolean;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement>;\n /** Renders the button as a real anchor, so a link action is never an <a> nested in a <button>. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\n// The 1px is the transparent border, which `no-style` drops.\nconst FLUSH_MARGIN = '-mx-[calc(var(--btn-px)+1px)]';\nconst FLUSH_MARGIN_BORDERLESS = '-mx-[var(--btn-px)]';\n\nexport const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (\n {\n variant,\n size = 'large',\n radius,\n loading = false,\n disabled = false,\n icon,\n iconPosition = 'start',\n leading,\n contentAlign = 'center',\n flexGrow = false,\n width = 'auto',\n fill = false,\n tooltip,\n tooltipPlacement = 'top',\n iconOnly = false,\n flush = false,\n children,\n className = '',\n href,\n target,\n rel,\n ...props\n },\n ref,\n ) => {\n const radiusClass = radius ? getRadiusClass(radius) : getDefaultRadiusClass(size, iconOnly);\n const isInactive = disabled || loading;\n const alignStart = contentAlign === 'start';\n const baseClasses = [\n alignStart\n ? 'flex items-center justify-start text-left'\n : 'flex items-center justify-center',\n iconOnly ? `p-0 ${getIconOnlySizeClasses(size)}` : getSizeClasses(size),\n getVariantClasses(variant, radiusClass),\n flexGrow ? 'w-full' : '',\n width === 'wide' ? 'min-w-[120px]' : '',\n fill ? 'max-w-full' : '',\n isInactive ? 'cursor-not-allowed' : '',\n tooltip && isInactive ? 'pointer-events-none' : '',\n flush && !iconOnly\n ? variant === 'no-style'\n ? FLUSH_MARGIN_BORDERLESS\n : FLUSH_MARGIN\n : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const label = alignStart ? (\n <span className=\"flex min-w-0 flex-1 items-center\">{children}</span>\n ) : (\n children\n );\n\n const leadingSlot = leading ? (\n <span\n className={\n children\n ? 'btn-leading inline-flex shrink-0 items-center me-2'\n : 'btn-leading inline-flex shrink-0 items-center'\n }\n >\n {leading}\n </span>\n ) : null;\n\n const renderContent = () => {\n if (loading) {\n return (\n <>\n {leadingSlot}\n <ButtonSpinner />\n {label}\n </>\n );\n }\n\n const iconWrapperClasses = `inline-flex items-center shrink-0 ${getIconSizeClass(size)}`;\n\n if (icon && iconPosition === 'start') {\n return (\n <>\n {leadingSlot}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'start')}` : ''}`}\n >\n {icon}\n </span>\n {label}\n </>\n );\n }\n\n if (icon && iconPosition === 'end') {\n return (\n <>\n {leadingSlot}\n {label}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'end')}` : ''}`}\n >\n {icon}\n </span>\n </>\n );\n }\n\n return (\n <>\n {leadingSlot}\n {label}\n </>\n );\n };\n\n // An anchor cannot be disabled, so an inactive link still renders as a <button>.\n const button =\n href && !isInactive ? (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n className={baseClasses}\n {...(props as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {renderContent()}\n </a>\n ) : (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n disabled={isInactive}\n className={baseClasses}\n {...props}\n >\n {renderContent()}\n </button>\n );\n\n if (tooltip) {\n const trigger = isInactive ? (\n <span className={`inline-flex cursor-not-allowed${flexGrow ? ' w-full' : ''}`}>\n {button}\n </span>\n ) : (\n button\n );\n return (\n <Tooltip text={tooltip} placement={tooltipPlacement} fill={flexGrow}>\n {trigger}\n </Tooltip>\n );\n }\n\n return button;\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["FLUSH_MARGIN","FLUSH_MARGIN_BORDERLESS","Button","forwardRef","variant","size","radius","loading","disabled","icon","iconPosition","leading","contentAlign","flexGrow","width","fill","tooltip","tooltipPlacement","iconOnly","flush","children","className","href","target","rel","props","ref","radiusClass","getRadiusClass","getDefaultRadiusClass","isInactive","alignStart","baseClasses","getIconOnlySizeClasses","getSizeClasses","getVariantClasses","label","jsx","leadingSlot","renderContent","jsxs","Fragment","ButtonSpinner","iconWrapperClasses","getIconSizeClass","getIconGapClass","button","resolveRel","Tooltip"],"mappings":";;;;;;;AAyEA,MAAMA,IAAe,iCACfC,IAA0B,uBAEnBC,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AAAA,QACV,WAAWE;AAAA,QACV,GAAGP;AAAA,QAEH,UAAAc,EAAA;AAAA,MAAc;AAAA,IAAA;AAI3B,WAAIvB,IASI,gBAAAqB,EAACW,KAAQ,MAAMhC,GAAS,WAAWC,GAAkB,MAAMJ,GACtD,UATOiB,IACZ,gBAAAO,EAAC,QAAA,EAAK,WAAW,iCAAiCxB,IAAW,YAAY,EAAE,IACtE,UAAAiC,EAAA,CACL,IAEAA,EAIK,CACL,IAIDA;AAAA,EACX;AACJ;AAEA5C,EAAO,cAAc;"}
1
+ {"version":3,"file":"Button.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport ButtonSpinner from './ButtonSpinner';\nimport Tooltip from './Tooltip';\nimport { getIconOnlySizeClasses, getIconSizeClass } from './buttonSizing';\nimport {\n getDefaultRadiusClass,\n getIconGapClass,\n getRadiusClass,\n getSizeClasses,\n getVariantClasses,\n} from './buttonStyles';\nimport { resolveRel } from './linkRel';\n\n// Button variant types matching the old component\nexport type ButtonVariant =\n | 'filled'\n | 'outline'\n /**\n * `outline`'s geometry on a ground of its own. For a button sitting on a tinted or\n * patterned surface, where `outline`'s transparent background lets that surface through\n * and the control stops reading as a button.\n */\n | 'surface'\n /**\n * The violet the assistant is named in elsewhere — for a control that hands work to it, or\n * acts on what it produced. Provenance, not a severity: it says who is being asked, not\n * that anything is wrong.\n */\n | 'assistant'\n | 'destructive'\n | 'success'\n | 'warning'\n | 'error'\n | 'ghost'\n /** Text only, in the accent colour, for a secondary action beside a primary one. */\n | 'quiet'\n /**\n * A recessed grey with secondary text, for a control whose subject is switched off, such as\n * an account set to Not allowed. It stays clickable: `disabled` is for a control that is not.\n */\n | 'muted'\n | 'no-style';\n\nexport type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large';\n\nexport type ButtonRadius = 'md' | 'lg' | 'xl';\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant: ButtonVariant;\n size?: ButtonSize;\n radius?: ButtonRadius;\n loading?: boolean;\n disabled?: boolean;\n icon?: React.ReactNode;\n iconPosition?: 'start' | 'end';\n /** Before the label at its own size, never squeezed (an avatar); pairs with an end `icon`. */\n leading?: React.ReactNode;\n /** `start` aligns the label to the leading edge and pins an end `icon` to the far edge. */\n contentAlign?: 'center' | 'start';\n /** Fills the container's width. */\n flexGrow?: boolean;\n /** `wide` holds a 120px floor for a primary action. */\n width?: 'auto' | 'wide';\n fill?: boolean;\n tooltip?: string;\n tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';\n iconOnly?: boolean;\n /** Pulls a borderless button out by its own padding, so its label lines up with the text around it. */\n flush?: boolean;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement>;\n /** Renders the button as a real anchor, so a link action is never an <a> nested in a <button>. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\n// The 1px is the transparent border, which `no-style` drops.\nconst FLUSH_MARGIN = '-mx-[calc(var(--btn-px)+1px)]';\nconst FLUSH_MARGIN_BORDERLESS = '-mx-[var(--btn-px)]';\n\nexport const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (\n {\n variant,\n size = 'large',\n radius,\n loading = false,\n disabled = false,\n icon,\n iconPosition = 'start',\n leading,\n contentAlign = 'center',\n flexGrow = false,\n width = 'auto',\n fill = false,\n tooltip,\n tooltipPlacement = 'top',\n iconOnly = false,\n flush = false,\n children,\n className = '',\n href,\n target,\n rel,\n ...props\n },\n ref,\n ) => {\n const radiusClass = radius ? getRadiusClass(radius) : getDefaultRadiusClass(size, iconOnly);\n const isInactive = disabled || loading;\n const alignStart = contentAlign === 'start';\n const baseClasses = [\n alignStart\n ? 'flex items-center justify-start text-left'\n : 'flex items-center justify-center',\n iconOnly ? `p-0 ${getIconOnlySizeClasses(size)}` : getSizeClasses(size),\n getVariantClasses(variant, radiusClass),\n flexGrow ? 'w-full' : '',\n width === 'wide' ? 'min-w-[120px]' : '',\n fill ? 'max-w-full' : '',\n isInactive ? 'cursor-not-allowed' : '',\n tooltip && isInactive ? 'pointer-events-none' : '',\n flush && !iconOnly\n ? variant === 'no-style'\n ? FLUSH_MARGIN_BORDERLESS\n : FLUSH_MARGIN\n : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const label = alignStart ? (\n <span className=\"flex min-w-0 flex-1 items-center\">{children}</span>\n ) : (\n children\n );\n\n const leadingSlot = leading ? (\n <span\n className={\n children\n ? 'btn-leading inline-flex shrink-0 items-center me-2'\n : 'btn-leading inline-flex shrink-0 items-center'\n }\n >\n {leading}\n </span>\n ) : null;\n\n const renderContent = () => {\n if (loading) {\n return (\n <>\n {leadingSlot}\n <ButtonSpinner />\n {label}\n </>\n );\n }\n\n const iconWrapperClasses = `inline-flex items-center shrink-0 ${getIconSizeClass(size)}`;\n\n if (icon && iconPosition === 'start') {\n return (\n <>\n {leadingSlot}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'start')}` : ''}`}\n >\n {icon}\n </span>\n {label}\n </>\n );\n }\n\n if (icon && iconPosition === 'end') {\n return (\n <>\n {leadingSlot}\n {label}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'end')}` : ''}`}\n >\n {icon}\n </span>\n </>\n );\n }\n\n return (\n <>\n {leadingSlot}\n {label}\n </>\n );\n };\n\n // An anchor cannot be disabled, so an inactive link still renders as a <button>.\n const button =\n href && !isInactive ? (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n className={baseClasses}\n {...(props as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {renderContent()}\n </a>\n ) : (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n disabled={isInactive}\n className={baseClasses}\n {...props}\n >\n {renderContent()}\n </button>\n );\n\n if (tooltip) {\n const trigger = isInactive ? (\n <span className={`inline-flex cursor-not-allowed${flexGrow ? ' w-full' : ''}`}>\n {button}\n </span>\n ) : (\n button\n );\n return (\n <Tooltip text={tooltip} placement={tooltipPlacement} fill={flexGrow}>\n {trigger}\n </Tooltip>\n );\n }\n\n return button;\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["FLUSH_MARGIN","FLUSH_MARGIN_BORDERLESS","Button","forwardRef","variant","size","radius","loading","disabled","icon","iconPosition","leading","contentAlign","flexGrow","width","fill","tooltip","tooltipPlacement","iconOnly","flush","children","className","href","target","rel","props","ref","radiusClass","getRadiusClass","getDefaultRadiusClass","isInactive","alignStart","baseClasses","getIconOnlySizeClasses","getSizeClasses","getVariantClasses","label","jsx","leadingSlot","renderContent","jsxs","Fragment","ButtonSpinner","iconWrapperClasses","getIconSizeClass","getIconGapClass","button","resolveRel","Tooltip"],"mappings":";;;;;;;AA8EA,MAAMA,IAAe,iCACfC,IAA0B,uBAEnBC,IAASC;AAAA,EAClB,CACI;AAAA,IACI,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,MAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,KAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAEPC,MACC;AACD,UAAMC,IAAcrB,IAASsB,EAAetB,CAAM,IAAIuB,EAAsBxB,GAAMa,CAAQ,GACpFY,IAAatB,KAAYD,GACzBwB,IAAanB,MAAiB,SAC9BoB,IAAc;AAAA,MAChBD,IAC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GAAGM,CAAkB,GAAGvB,IAAW,IAAIyB,EAAgBxC,GAAM,KAAK,CAAC,KAAK,EAAE;AAAA,YAEpF,UAAAI;AAAA,UAAA;AAAA,QAAA;AAAA,MACL,GACJ,IAKJ,gBAAA+B,EAAAC,GAAA,EACK,UAAA;AAAA,QAAAH;AAAA,QACAF;AAAA,MAAA,GACL;AAAA,IAER,GAGMU,IACFxB,KAAQ,CAACQ,IACL,gBAAAO;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAAX;AAAA,QACA,MAAAJ;AAAA,QACA,QAAAC;AAAA,QACA,KAAKwB,EAAWvB,GAAKD,CAAM;AAAA,QAC3B,WAAWS;AAAA,QACV,GAAIP;AAAA,QAEJ,UAAAc,EAAA;AAAA,MAAc;AAAA,IAAA,IAGnB,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAAX;AAAA,QACA,UAAUI;AAAA,QACV,WAAWE;AAAA,QACV,GAAGP;AAAA,QAEH,UAAAc,EAAA;AAAA,MAAc;AAAA,IAAA;AAI3B,WAAIvB,IASI,gBAAAqB,EAACW,KAAQ,MAAMhC,GAAS,WAAWC,GAAkB,MAAMJ,GACtD,UATOiB,IACZ,gBAAAO,EAAC,QAAA,EAAK,WAAW,iCAAiCxB,IAAW,YAAY,EAAE,IACtE,UAAAiC,EAAA,CACL,IAEAA,EAIK,CACL,IAIDA;AAAA,EACX;AACJ;AAEA5C,EAAO,cAAc;"}
@@ -0,0 +1,23 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ const $ = ({ radius: t, surround: e }) => /* @__PURE__ */ n(
3
+ "div",
4
+ {
5
+ "aria-hidden": "true",
6
+ style: {
7
+ position: "absolute",
8
+ top: 0,
9
+ left: 0,
10
+ right: 0,
11
+ height: t,
12
+ pointerEvents: "none",
13
+ background: [
14
+ `radial-gradient(circle ${t} at ${t} ${t}, transparent calc(${t} - 0.5px), ${e} ${t}) top left / ${t} ${t} no-repeat`,
15
+ `radial-gradient(circle ${t} at 0 ${t}, transparent calc(${t} - 0.5px), ${e} ${t}) top right / ${t} ${t} no-repeat`
16
+ ].join(", ")
17
+ }
18
+ }
19
+ );
20
+ export {
21
+ $ as default
22
+ };
23
+ //# sourceMappingURL=PinnedCornerCap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinnedCornerCap.js","sources":["../../src/components/PinnedCornerCap.tsx"],"sourcesContent":["import type React from 'react';\n\n/**\n * Rounds a pinned header's top corners by painting what lies behind its card into them. A plain\n * `border-radius` is invisible on a pinned header: the card behind it paints on, so the notch\n * would only show more card. Its parent must be positioned.\n */\nconst PinnedCornerCap: React.FC<{ radius: string; surround: string }> = ({ radius, surround }) => (\n <div\n aria-hidden=\"true\"\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n height: radius,\n pointerEvents: 'none',\n background: [\n `radial-gradient(circle ${radius} at ${radius} ${radius}, transparent calc(${radius} - 0.5px), ${surround} ${radius}) top left / ${radius} ${radius} no-repeat`,\n `radial-gradient(circle ${radius} at 0 ${radius}, transparent calc(${radius} - 0.5px), ${surround} ${radius}) top right / ${radius} ${radius} no-repeat`,\n ].join(', '),\n }}\n />\n);\n\nexport default PinnedCornerCap;\n"],"names":["PinnedCornerCap","radius","surround","jsx"],"mappings":";AAOA,MAAMA,IAAkE,CAAC,EAAE,QAAAC,GAAQ,UAAAC,QAC/E,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,eAAY;AAAA,IACZ,OAAO;AAAA,MACH,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,MACP,QAAQF;AAAA,MACR,eAAe;AAAA,MACf,YAAY;AAAA,QACR,0BAA0BA,CAAM,OAAOA,CAAM,IAAIA,CAAM,sBAAsBA,CAAM,cAAcC,CAAQ,IAAID,CAAM,gBAAgBA,CAAM,IAAIA,CAAM;AAAA,QACnJ,0BAA0BA,CAAM,SAASA,CAAM,sBAAsBA,CAAM,cAAcC,CAAQ,IAAID,CAAM,iBAAiBA,CAAM,IAAIA,CAAM;AAAA,MAAA,EAC9I,KAAK,IAAI;AAAA,IAAA;AAAA,EACf;AACJ;"}
@@ -1,15 +1,15 @@
1
- import { jsx as f, jsxs as d, Fragment as u } from "react/jsx-runtime";
1
+ import { jsx as d, jsxs as f, Fragment as u } from "react/jsx-runtime";
2
2
  import { useState as h, useRef as b, useEffect as p } from "react";
3
3
  import { createPortal as y } from "react-dom";
4
- import { ensureInterFontFace as g } from "../inter-font.js";
5
- const s = "malachite-form-styles", x = `
4
+ import { ensureInterFontFace as v } from "../inter-font.js";
5
+ const s = "malachite-form-styles", g = `
6
6
  /* Malachite Form Styles - for components outside Shadow DOM */
7
7
 
8
8
  .malachite-form-container {
9
9
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
10
  font-size: 14px;
11
11
  line-height: 1.5;
12
- color: #374151;
12
+ color: var(--malachite-text-primary, #374151);
13
13
  }
14
14
 
15
15
  .malachite-form {
@@ -21,36 +21,36 @@ const s = "malachite-form-styles", x = `
21
21
  margin-top: 1rem;
22
22
  }
23
23
 
24
- /* Basic input styling that matches Tailwind defaults */
25
24
  .malachite-form input,
26
25
  .malachite-form textarea,
27
26
  .malachite-form select {
28
27
  appearance: none;
29
- background-color: #ffffff;
30
- border: 1px solid #d1d5db;
28
+ background-color: var(--malachite-card-background, #ffffff);
29
+ border: 1px solid var(--malachite-primary-border, #d1d5db);
31
30
  border-radius: 0.375rem;
32
31
  padding: 0.5rem 0.75rem;
33
32
  font-size: 0.875rem;
34
33
  line-height: 1.25rem;
35
- color: #111827;
36
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
37
- transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
34
+ color: var(--malachite-text-primary, #111827);
35
+ box-shadow: var(--malachite-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
36
+ transition: border-color 0.15s ease-in-out;
38
37
  width: 100%;
39
38
  }
40
39
 
41
- .malachite-form input:focus,
42
- .malachite-form textarea:focus,
43
- .malachite-form select:focus {
44
- outline: none;
45
- border-color: #3b82f6;
46
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
40
+ /* focusRing.ts's FOCUS_RING, written out: this sheet sits outside the shadow root's Tailwind. */
41
+ .malachite-form input:focus-visible,
42
+ .malachite-form textarea:focus-visible,
43
+ .malachite-form select:focus-visible,
44
+ .malachite-form button:focus-visible {
45
+ outline: 2px solid var(--malachite-text-primary, #0a0a0a);
46
+ outline-offset: 2px;
47
47
  }
48
48
 
49
49
  .malachite-form input:disabled,
50
50
  .malachite-form textarea:disabled,
51
51
  .malachite-form select:disabled {
52
- background-color: #f9fafb;
53
- color: #6b7280;
52
+ background-color: var(--malachite-card-dimmed-background, #f9fafb);
53
+ color: var(--malachite-text-dimmed, #6b7280);
54
54
  cursor: not-allowed;
55
55
  }
56
56
 
@@ -69,98 +69,69 @@ const s = "malachite-form-styles", x = `
69
69
  }
70
70
 
71
71
  .malachite-form button[type="submit"] {
72
- background-color: #3b82f6;
73
- color: #ffffff;
72
+ background-color: var(--malachite-secondary-background, #3b82f6);
73
+ color: var(--malachite-secondary-foreground, #ffffff);
74
+ border-color: var(--malachite-secondary-border, transparent);
74
75
  }
75
76
 
76
77
  .malachite-form button[type="submit"]:hover {
77
- background-color: #2563eb;
78
+ border-color: var(--malachite-secondary-border-hover, transparent);
79
+ background-color: var(--malachite-secondary-background, #2563eb);
80
+ background-color: color-mix(in srgb, var(--malachite-secondary-background, #3b82f6) 85%, var(--malachite-secondary-foreground, #ffffff));
78
81
  }
79
82
 
80
83
  .malachite-form button[type="button"] {
81
- background-color: #ffffff;
82
- color: #374151;
83
- border-color: #d1d5db;
84
+ background-color: var(--malachite-card-background, #ffffff);
85
+ color: var(--malachite-outline-foreground, #374151);
86
+ border-color: var(--malachite-primary-border, #d1d5db);
84
87
  }
85
88
 
86
89
  .malachite-form button[type="button"]:hover {
87
- background-color: #f9fafb;
88
- border-color: #9ca3af;
90
+ background-color: var(--malachite-card-dimmed-background, #f9fafb);
91
+ border-color: var(--malachite-primary-border-hover, #9ca3af);
89
92
  }
90
93
 
91
94
  .malachite-form button:disabled {
92
95
  opacity: 0.5;
93
96
  cursor: not-allowed;
94
97
  }
95
-
96
- /* Dark mode support */
97
- @media (prefers-color-scheme: dark) {
98
- .malachite-form-container {
99
- color: #f3f4f6;
100
- }
101
-
102
- .malachite-form input,
103
- .malachite-form textarea,
104
- .malachite-form select {
105
- background-color: #1f2937;
106
- border-color: #374151;
107
- color: #f3f4f6;
108
- }
109
-
110
- .malachite-form input:focus,
111
- .malachite-form textarea:focus,
112
- .malachite-form select:focus {
113
- border-color: #60a5fa;
114
- box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
115
- }
116
-
117
- .malachite-form button[type="button"] {
118
- background-color: #374151;
119
- color: #f3f4f6;
120
- border-color: #4b5563;
121
- }
122
-
123
- .malachite-form button[type="button"]:hover {
124
- background-color: #4b5563;
125
- }
126
- }
127
- `, w = () => {
98
+ `, x = () => {
128
99
  if (typeof document > "u" || !document.head || document.getElementById(s))
129
100
  return;
130
- const o = document.createElement("style");
131
- o.id = s, o.textContent = x, document.head.appendChild(o);
132
- }, F = ({ children: o, className: n = "" }) => {
133
- const [l, c] = h(null), t = b(null);
101
+ const t = document.createElement("style");
102
+ t.id = s, t.textContent = g, document.head.appendChild(t);
103
+ }, R = ({ children: t, className: n = "" }) => {
104
+ const [i, c] = h(null), r = b(null);
134
105
  return p(() => {
135
- if (g(), w(), t.current) {
136
- let r = t.current, i = !1;
137
- for (; r; ) {
138
- const m = r.getRootNode();
106
+ if (v(), x(), r.current) {
107
+ let a = r.current, l = !1;
108
+ for (; a; ) {
109
+ const m = a.getRootNode();
139
110
  if (m !== document)
140
- i = !0, r = m.host;
111
+ l = !0, a = m.host;
141
112
  else {
142
- const a = r.parentElement || document.body;
143
- if (i) {
113
+ const o = a.parentElement || document.body;
114
+ if (l) {
144
115
  const e = document.createElement("div");
145
116
  return e.className = `malachite-escape-container ${n}`, e.style.cssText = `
146
117
  position: relative;
147
118
  z-index: 1000;
148
- `, a.appendChild(e), c(e), () => {
119
+ `, o.appendChild(e), c(e), () => {
149
120
  e.parentElement && e.parentElement.removeChild(e);
150
121
  };
151
122
  }
152
- c(a);
123
+ c(o);
153
124
  break;
154
125
  }
155
126
  }
156
127
  }
157
- }, [n]), l ? /* @__PURE__ */ d(u, { children: [
158
- /* @__PURE__ */ f("div", { ref: t, style: { display: "none" } }),
159
- y(o, l)
160
- ] }) : /* @__PURE__ */ f("div", { ref: t, style: { display: "none" } });
128
+ }, [n]), i ? /* @__PURE__ */ f(u, { children: [
129
+ /* @__PURE__ */ d("div", { ref: r, style: { display: "none" } }),
130
+ y(t, i)
131
+ ] }) : /* @__PURE__ */ d("div", { ref: r, style: { display: "none" } });
161
132
  };
162
133
  export {
163
- F as ShadowEscape,
164
- F as default
134
+ R as ShadowEscape,
135
+ R as default
165
136
  };
166
137
  //# sourceMappingURL=ShadowEscape.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShadowEscape.js","sources":["../../src/components/ShadowEscape.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { ensureInterFontFace } from '../inter-font';\n\ninterface ShadowEscapeProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst FORM_STYLES_ID = 'malachite-form-styles';\n\n// Form styles as a string - this ensures it works in all build environments\nconst formStyles = `\n/* Malachite Form Styles - for components outside Shadow DOM */\n\n.malachite-form-container {\n font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.5;\n color: #374151;\n}\n\n.malachite-form {\n display: flex;\n flex-direction: column;\n}\n\n.malachite-form .space-y-4 > * + * {\n margin-top: 1rem;\n}\n\n/* Basic input styling that matches Tailwind defaults */\n.malachite-form input,\n.malachite-form textarea,\n.malachite-form select {\n appearance: none;\n background-color: #ffffff;\n border: 1px solid #d1d5db;\n border-radius: 0.375rem;\n padding: 0.5rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: #111827;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n width: 100%;\n}\n\n.malachite-form input:focus,\n.malachite-form textarea:focus,\n.malachite-form select:focus {\n outline: none;\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);\n}\n\n.malachite-form input:disabled,\n.malachite-form textarea:disabled,\n.malachite-form select:disabled {\n background-color: #f9fafb;\n color: #6b7280;\n cursor: not-allowed;\n}\n\n.malachite-form button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.5rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1.25rem;\n border-radius: 0.375rem;\n border: 1px solid transparent;\n cursor: pointer;\n transition: all 0.15s ease-in-out;\n}\n\n.malachite-form button[type=\"submit\"] {\n background-color: #3b82f6;\n color: #ffffff;\n}\n\n.malachite-form button[type=\"submit\"]:hover {\n background-color: #2563eb;\n}\n\n.malachite-form button[type=\"button\"] {\n background-color: #ffffff;\n color: #374151;\n border-color: #d1d5db;\n}\n\n.malachite-form button[type=\"button\"]:hover {\n background-color: #f9fafb;\n border-color: #9ca3af;\n}\n\n.malachite-form button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Dark mode support */\n@media (prefers-color-scheme: dark) {\n .malachite-form-container {\n color: #f3f4f6;\n }\n \n .malachite-form input,\n .malachite-form textarea,\n .malachite-form select {\n background-color: #1f2937;\n border-color: #374151;\n color: #f3f4f6;\n }\n \n .malachite-form input:focus,\n .malachite-form textarea:focus,\n .malachite-form select:focus {\n border-color: #60a5fa;\n box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);\n }\n \n .malachite-form button[type=\"button\"] {\n background-color: #374151;\n color: #f3f4f6;\n border-color: #4b5563;\n }\n \n .malachite-form button[type=\"button\"]:hover {\n background-color: #4b5563;\n }\n}\n`;\n\n/**\n * Adds the escaped-form stylesheet to <head> unless it is already there. The check reads\n * the DOM, not a module-level latch: a latch goes stale the moment anything removes the\n * <style> (a host app clearing <head> between routes, a test resetting the document), and\n * the styles would then never be re-added.\n */\nconst ensureFormStyles = (): void => {\n if (typeof document === 'undefined' || !document.head) {\n return;\n }\n if (document.getElementById(FORM_STYLES_ID)) {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.id = FORM_STYLES_ID;\n styleElement.textContent = formStyles;\n document.head.appendChild(styleElement);\n};\n\n/**\n * ShadowEscape renders its children OUTSIDE the Shadow DOM to avoid React hook issues.\n * This is used internally by form components to escape Shadow DOM boundaries.\n * \n * The component finds the nearest non-shadow DOM ancestor and renders there.\n */\nexport const ShadowEscape: React.FC<ShadowEscapeProps> = ({ children, className = '' }) => {\n const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // Inter @font-face must live in the document so escaped (non-shadow) forms can use it.\n ensureInterFontFace();\n\n ensureFormStyles();\n\n if (markerRef.current) {\n // Find the closest non-shadow DOM ancestor\n let element: Node | null = markerRef.current;\n let isInShadowDOM = false;\n\n // Traverse up the DOM tree to find a non-shadow root container\n while (element) {\n const rootNode = element.getRootNode();\n\n // Check if we're in a shadow root\n if (rootNode !== document) {\n isInShadowDOM = true;\n // We're in a shadow root, find its host\n const shadowRoot = rootNode as ShadowRoot;\n element = shadowRoot.host;\n } else {\n // We found a regular DOM element, use its parent\n const parentElement = element.parentElement || document.body;\n\n if (isInShadowDOM) {\n // Create a container for the escaped content\n const container = document.createElement('div');\n container.className = `malachite-escape-container ${className}`;\n container.style.cssText = `\n position: relative;\n z-index: 1000;\n `;\n\n parentElement.appendChild(container);\n setPortalContainer(container);\n\n // Cleanup function\n return () => {\n if (container.parentElement) {\n container.parentElement.removeChild(container);\n }\n };\n }\n // We're not in Shadow DOM, just render normally\n setPortalContainer(parentElement);\n break;\n }\n }\n }\n }, [className]);\n\n if (!portalContainer) {\n // Render a marker in Shadow DOM while we find the escape container\n return <div ref={markerRef} style={{ display: 'none' }} />;\n }\n\n // Render children outside Shadow DOM\n return (\n <>\n <div ref={markerRef} style={{ display: 'none' }} />\n {createPortal(children, portalContainer)}\n </>\n );\n};\n\nexport default ShadowEscape; "],"names":["FORM_STYLES_ID","formStyles","ensureFormStyles","styleElement","ShadowEscape","children","className","portalContainer","setPortalContainer","useState","markerRef","useRef","useEffect","ensureInterFontFace","element","isInShadowDOM","rootNode","parentElement","container","jsxs","Fragment","jsx","createPortal"],"mappings":";;;;AASA,MAAMA,IAAiB,yBAGjBC,IAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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O,gBAAAc,EAAC,SAAI,KAAKX,GAAW,OAAO,EAAE,SAAS,UAAU;AAUhE;"}
1
+ {"version":3,"file":"ShadowEscape.js","sources":["../../src/components/ShadowEscape.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { ensureInterFontFace } from '../inter-font';\n\ninterface ShadowEscapeProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst FORM_STYLES_ID = 'malachite-form-styles';\n\n// Form styles as a string - this ensures it works in all build environments\nconst formStyles = `\n/* Malachite Form Styles - for components outside Shadow DOM */\n\n.malachite-form-container {\n font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.5;\n color: var(--malachite-text-primary, #374151);\n}\n\n.malachite-form {\n display: flex;\n flex-direction: column;\n}\n\n.malachite-form .space-y-4 > * + * {\n margin-top: 1rem;\n}\n\n.malachite-form input,\n.malachite-form textarea,\n.malachite-form select {\n appearance: none;\n background-color: var(--malachite-card-background, #ffffff);\n border: 1px solid var(--malachite-primary-border, #d1d5db);\n border-radius: 0.375rem;\n padding: 0.5rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: var(--malachite-text-primary, #111827);\n box-shadow: var(--malachite-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n transition: border-color 0.15s ease-in-out;\n width: 100%;\n}\n\n/* focusRing.ts's FOCUS_RING, written out: this sheet sits outside the shadow root's Tailwind. */\n.malachite-form input:focus-visible,\n.malachite-form textarea:focus-visible,\n.malachite-form select:focus-visible,\n.malachite-form button:focus-visible {\n outline: 2px solid var(--malachite-text-primary, #0a0a0a);\n outline-offset: 2px;\n}\n\n.malachite-form input:disabled,\n.malachite-form textarea:disabled,\n.malachite-form select:disabled {\n background-color: var(--malachite-card-dimmed-background, #f9fafb);\n color: var(--malachite-text-dimmed, #6b7280);\n cursor: not-allowed;\n}\n\n.malachite-form button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.5rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1.25rem;\n border-radius: 0.375rem;\n border: 1px solid transparent;\n cursor: pointer;\n transition: all 0.15s ease-in-out;\n}\n\n.malachite-form button[type=\"submit\"] {\n background-color: var(--malachite-secondary-background, #3b82f6);\n color: var(--malachite-secondary-foreground, #ffffff);\n border-color: var(--malachite-secondary-border, transparent);\n}\n\n.malachite-form button[type=\"submit\"]:hover {\n border-color: var(--malachite-secondary-border-hover, transparent);\n background-color: var(--malachite-secondary-background, #2563eb);\n background-color: color-mix(in srgb, var(--malachite-secondary-background, #3b82f6) 85%, var(--malachite-secondary-foreground, #ffffff));\n}\n\n.malachite-form button[type=\"button\"] {\n background-color: var(--malachite-card-background, #ffffff);\n color: var(--malachite-outline-foreground, #374151);\n border-color: var(--malachite-primary-border, #d1d5db);\n}\n\n.malachite-form button[type=\"button\"]:hover {\n background-color: var(--malachite-card-dimmed-background, #f9fafb);\n border-color: var(--malachite-primary-border-hover, #9ca3af);\n}\n\n.malachite-form button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n`;\n\n/**\n * Adds the escaped-form stylesheet to <head> unless it is already there. The check reads\n * the DOM, not a module-level latch: a latch goes stale the moment anything removes the\n * <style> (a host app clearing <head> between routes, a test resetting the document), and\n * the styles would then never be re-added.\n */\nconst ensureFormStyles = (): void => {\n if (typeof document === 'undefined' || !document.head) {\n return;\n }\n if (document.getElementById(FORM_STYLES_ID)) {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.id = FORM_STYLES_ID;\n styleElement.textContent = formStyles;\n document.head.appendChild(styleElement);\n};\n\n/**\n * ShadowEscape renders its children OUTSIDE the Shadow DOM to avoid React hook issues.\n * This is used internally by form components to escape Shadow DOM boundaries.\n *\n * The component finds the nearest non-shadow DOM ancestor and renders there.\n */\nexport const ShadowEscape: React.FC<ShadowEscapeProps> = ({ children, className = '' }) => {\n const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // Inter @font-face must live in the document so escaped (non-shadow) forms can use it.\n ensureInterFontFace();\n\n ensureFormStyles();\n\n if (markerRef.current) {\n // Find the closest non-shadow DOM ancestor\n let element: Node | null = markerRef.current;\n let isInShadowDOM = false;\n\n // Traverse up the DOM tree to find a non-shadow root container\n while (element) {\n const rootNode = element.getRootNode();\n\n // Check if we're in a shadow root\n if (rootNode !== document) {\n isInShadowDOM = true;\n // We're in a shadow root, find its host\n const shadowRoot = rootNode as ShadowRoot;\n element = shadowRoot.host;\n } else {\n // We found a regular DOM element, use its parent\n const parentElement = element.parentElement || document.body;\n\n if (isInShadowDOM) {\n // Create a container for the escaped content\n const container = document.createElement('div');\n container.className = `malachite-escape-container ${className}`;\n container.style.cssText = `\n position: relative;\n z-index: 1000;\n `;\n\n parentElement.appendChild(container);\n setPortalContainer(container);\n\n // Cleanup function\n return () => {\n if (container.parentElement) {\n container.parentElement.removeChild(container);\n }\n };\n }\n // We're not in Shadow DOM, just render normally\n setPortalContainer(parentElement);\n break;\n }\n }\n }\n }, [className]);\n\n if (!portalContainer) {\n // Render a marker in Shadow DOM while we find the escape container\n return <div ref={markerRef} style={{ display: 'none' }} />;\n }\n\n // Render children outside Shadow DOM\n return (\n <>\n <div ref={markerRef} style={{ display: 'none' }} />\n {createPortal(children, portalContainer)}\n </>\n );\n};\n\nexport default ShadowEscape;\n"],"names":["FORM_STYLES_ID","formStyles","ensureFormStyles","styleElement","ShadowEscape","children","className","portalContainer","setPortalContainer","useState","markerRef","useRef","useEffect","ensureInterFontFace","element","isInShadowDOM","rootNode","parentElement","container","jsxs","Fragment","jsx","createPortal"],"mappings":";;;;AASA,MAAMA,IAAiB,yBAGjBC,IAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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