@stackone/malachite 2.138.0 → 2.139.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/COMPONENTS.md CHANGED
@@ -12,6 +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. `title` heads it, with dimmed `subtitle` text beside it and `extra` actions at the right of the title row. By default the title and subtitle shrink to whatever `extra` leaves them, and on a framed card are cut short with the full text in a tooltip; `wrapExtra` instead moves `extra` onto a line of its own under them, still at the right, when the title and subtitle together do not fit on one line beside it, and the header grows by that line. On a framed card `wrapExtra` also adds 6px above and below the title row, so an `extra` taller than 32px makes the header taller than 44px even when nothing wraps; use a small or medium control there. Keep text that changes width, such as a live save status, out of a wrapping `extra`, or the header jumps between one line and two as it changes. `variant="framed"` draws the detached `Table`’s frame instead: the title row sits on a grey frame and the children in a bordered section inside it, so a card above a table, such as a chart over a log list, reads as part of the same set. `tone` (`CardTone`, the same `neutral` | `warning` | `error` | `success` as `Modal`’s tray) paints a framed card’s frame in that tray colour, for a verdict card; `neutral` keeps the default grey frame. Tone is colour alone, so the title has to say the outcome. It is a type error on a default card. `dimmed`, `border`, `size`, `glassFooter` and `headerConfig` do not apply to a framed card. A framed card given no children is its title row alone, such as a question with its answer buttons in `extra`. _Key props:_ `variant` (`CardVariant`: `default` | `framed`), `tone` (`CardTone`, framed only), `title`, `subtitle`, `extra`, `wrapExtra`, `padding`, `footer`.
15
+ - **`TileGrid`** — Tiles side by side, as many to a row as fit at 140px each, wrapping below that: a short set of things to pick from, such as AI clients. Each `TileGrid.Tile` is a decorative `icon` such as a logo, then its `title`, then a `description` that wraps rather than being cut, with no action label: the whole tile is one button, or an anchor with `href` (an unsafe scheme is dropped), named by its title and described by its description. `variant="more"` is a dashed tile on the sunken ground for a "See all" that leads past the grid. Name it with `aria-label` or `aria-labelledby` to make it a group. For one card that opens more detail beside its text use `LinkCard`; to choose one option use `ChoiceGroup`. _Key props:_ `aria-label`, `aria-labelledby`, `className`. `TileGrid.Tile`: `title`, `description`, `icon`, `variant` (`TileVariant`: `default` | `more`), `onClick`, `href`, `className`.
15
16
  - **`LinkCard`** — A compact card that opens more about one thing elsewhere on the screen, such as another tab of a side panel: an optional icon, a title coloured by `tone`, a one-line description cut with an ellipsis, optional `trailing` content such as a level scale, and an accent “Open →”. The whole card is one button, or an anchor with `href` (an unsafe scheme such as `javascript:` is dropped); with neither `onClick` nor a safe `href` it is a static card without the action. Tone is colour alone, so the title has to say the outcome. For a resource in a new tab use `ResourceCard`; for a row in a list use `Surface.Row`. _Key props:_ `title`, `description`, `tone` (`LinkCardTone`: `neutral` | `success` | `warning` | `error`), `icon`, `trailing` (both decorative; `trailing` sits inside the control, so never interactive), `actionLabel` (default `Open`), `onClick`, `href`, `className`.
16
17
  - **`ResourceCard`** — A card pointing at a resource elsewhere, such as an SDK’s documentation: a muted icon tile, a title, a description clamped to two lines and a link that opens in a new tab. `ResourceCard.Header` is the icon, title and description on their own, all phrasing content, so a section that opens on them, such as an `Accordion` header, can use it inside its button. _Key props:_ `icon`, `title`, `description`, `href`, `linkLabel` (default `Documentation`), `titleAs` (`h3` | `h4`), `className`. `ResourceCard.Header`: `icon`, `title`, `description`; phrasing content only, so its title is never a heading.
17
18
  - **`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. `address` puts a one-line chip above the count for a copyable address such as a server URL: its `label` is cut short with an ellipsis, and its full `value` shows in a tooltip and is copied on click, without selecting the card. It takes the place of `description`, since the card has room for one or the other. For a row-shaped selectable use `Surface.Row` instead. _Key props:_ `value`, `title`, `titleIcon`, `isDefault`, `variant` (`profile` | `library` | `editing`), `eyebrow`, `status` (`label`, `type`, `tooltip`), `description`, `address` (`label`, `value`), `countLabel`, `actions`, `onDismiss` (`dismissLabel`, `dismissDisabledReason`), `selected`, `loading` (`loadingLabel`, `loadingHint`), `disabled`, `dimmed`, `onSelect`, `tabIndex`, `aria-label`, `className`, `style`.
@@ -1,65 +1,59 @@
1
- import { jsxs as c, Fragment as C, jsx as e } from "react/jsx-runtime";
2
- import { useId as R, useState as E } from "react";
1
+ import { jsxs as i, Fragment as R, jsx as e } from "react/jsx-runtime";
2
+ import { useId as E, useState as C } from "react";
3
3
  import L from "./CustomIcons/ForwardArrowIcon.js";
4
4
  import O from "./TruncatedTooltip.js";
5
- import b from "./Typography/Text.js";
5
+ import u from "./Typography/Text.js";
6
6
  import { getFontSize as A, getTextColor as F } from "./Typography/textStyles.js";
7
- import { ROW_HOVER as _ } from "./chromeStyles.js";
8
- import { devWarning as z } from "./devWarning.js";
9
- import { FOCUS_RING as W, isFocusVisible as D } from "./focusRing.js";
10
- import { isRenderableNode as g } from "./renderableNode.js";
11
- import { safeHref as V } from "./safeHref.js";
12
- const j = {
7
+ import { cardHref as _ } from "./cardHref.js";
8
+ import { ROW_HOVER as z } from "./chromeStyles.js";
9
+ import { FOCUS_RING as D, isFocusVisible as V } from "./focusRing.js";
10
+ import { isRenderableNode as b } from "./renderableNode.js";
11
+ const W = {
13
12
  neutral: "primary",
14
13
  success: "success",
15
14
  warning: "warning",
16
15
  error: "error"
17
- }, d = "flex w-full items-center gap-[12px] rounded-[var(--malachite-radius-10,10px)] border border-solid border-[var(--malachite-card-border,rgb(232,232,232))] bg-[var(--malachite-card-background,rgb(255,255,255))] px-[12px] py-[10px] text-start text-[var(--malachite-text-primary,rgb(10,10,10))] no-underline", v = `cursor-pointer ${_} hover:border-[var(--malachite-secondary-border-hover,rgb(186,186,186))] ${W}`, k = {
16
+ }, c = "flex w-full items-center gap-[12px] rounded-[var(--malachite-radius-10,10px)] border border-solid border-[var(--malachite-card-border,rgb(232,232,232))] bg-[var(--malachite-card-background,rgb(255,255,255))] px-[12px] py-[10px] text-start text-[var(--malachite-text-primary,rgb(10,10,10))] no-underline", g = `cursor-pointer ${z} hover:border-[var(--malachite-secondary-border-hover,rgb(186,186,186))] ${D}`, j = {
18
17
  color: F("secondary"),
19
18
  fontSize: A("xsmall")
20
- }, Z = ({
21
- title: $,
19
+ }, M = ({
20
+ title: w,
22
21
  description: r,
23
- tone: w = "neutral",
24
- icon: m,
25
- trailing: f,
26
- actionLabel: N = "Open",
22
+ tone: v = "neutral",
23
+ icon: d,
24
+ trailing: m,
25
+ actionLabel: $ = "Open",
27
26
  onClick: a,
28
- href: n,
29
- className: o = ""
27
+ href: N,
28
+ className: n = ""
30
29
  }) => {
31
- const t = V(n);
32
- n && !t && z(
33
- `LinkCard.href:${n}`,
34
- `LinkCard dropped the unsafe href "${n}"; without an onClick it is a static card.`
35
- );
36
- const y = !!(t || a), i = R(), p = `${i}-title`, h = `${i}-description`, x = `${i}-action`, [S, s] = E(!1), T = {
37
- onFocus: (I) => s(D(I.currentTarget, !1)),
38
- onPointerDown: () => s(!1),
39
- onBlur: () => s(!1)
40
- }, u = {
41
- "aria-labelledby": `${p} ${x}`,
42
- "aria-describedby": r ? h : void 0,
30
+ const t = _("LinkCard", "card", N), y = !!(t || a), o = E(), f = `${o}-title`, p = `${o}-description`, x = `${o}-action`, [S, l] = C(!1), T = {
31
+ onFocus: (I) => l(V(I.currentTarget, !1)),
32
+ onPointerDown: () => l(!1),
33
+ onBlur: () => l(!1)
34
+ }, h = {
35
+ "aria-labelledby": `${f} ${x}`,
36
+ "aria-describedby": r ? p : void 0,
43
37
  ...T
44
- }, l = /* @__PURE__ */ c(C, { children: [
45
- g(m) && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "flex flex-none items-center", children: m }),
46
- /* @__PURE__ */ c("span", { className: "flex min-w-0 flex-1 flex-col gap-[1px] leading-[15px]", children: [
47
- /* @__PURE__ */ e("span", { id: p, className: "flex min-w-0 [overflow-wrap:anywhere]", children: /* @__PURE__ */ e(
48
- b,
38
+ }, s = /* @__PURE__ */ i(R, { children: [
39
+ b(d) && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "flex flex-none items-center", children: d }),
40
+ /* @__PURE__ */ i("span", { className: "flex min-w-0 flex-1 flex-col gap-[1px] leading-[15px]", children: [
41
+ /* @__PURE__ */ e("span", { id: f, className: "flex min-w-0 [overflow-wrap:anywhere]", children: /* @__PURE__ */ e(
42
+ u,
49
43
  {
50
44
  size: "small",
51
45
  fontWeight: "bold",
52
- color: j[w],
46
+ color: W[v],
53
47
  className: "min-w-0 leading-[17px]",
54
- children: $
48
+ children: w
55
49
  }
56
50
  ) }),
57
51
  r && /* @__PURE__ */ e(
58
52
  "span",
59
53
  {
60
- id: h,
54
+ id: p,
61
55
  className: "flex min-w-0 [overflow-wrap:anywhere]",
62
- style: k,
56
+ style: j,
63
57
  children: S ? r : /* @__PURE__ */ e(
64
58
  O,
65
59
  {
@@ -73,9 +67,9 @@ const j = {
73
67
  }
74
68
  )
75
69
  ] }),
76
- g(f) && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "flex flex-none items-center", children: f }),
77
- y && /* @__PURE__ */ c("span", { className: "flex flex-none items-center gap-[3px] text-[var(--malachite-accent-foreground,rgb(2,122,66))]", children: [
78
- /* @__PURE__ */ e("span", { id: x, className: "flex", children: /* @__PURE__ */ e(b, { size: "xsmall", fontWeight: "semi-bold", color: "inherit", wrap: !1, children: N }) }),
70
+ b(m) && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "flex flex-none items-center", children: m }),
71
+ y && /* @__PURE__ */ i("span", { className: "flex flex-none items-center gap-[3px] text-[var(--malachite-accent-foreground,rgb(2,122,66))]", children: [
72
+ /* @__PURE__ */ e("span", { id: x, className: "flex", children: /* @__PURE__ */ e(u, { size: "xsmall", fontWeight: "semi-bold", color: "inherit", wrap: !1, children: $ }) }),
79
73
  /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "flex", children: /* @__PURE__ */ e(L, { size: 12 }) })
80
74
  ] })
81
75
  ] });
@@ -84,23 +78,23 @@ const j = {
84
78
  {
85
79
  href: t,
86
80
  onClick: a,
87
- ...u,
88
- className: `${d} ${v} ${o}`,
89
- children: l
81
+ ...h,
82
+ className: `${c} ${g} ${n}`,
83
+ children: s
90
84
  }
91
85
  ) : a ? /* @__PURE__ */ e(
92
86
  "button",
93
87
  {
94
88
  type: "button",
95
89
  onClick: a,
96
- ...u,
97
- className: `m-0 appearance-none font-[inherit] ${d} ${v} ${o}`,
98
- children: l
90
+ ...h,
91
+ className: `m-0 appearance-none font-[inherit] ${c} ${g} ${n}`,
92
+ children: s
99
93
  }
100
- ) : /* @__PURE__ */ e("div", { className: `${d} ${o}`, children: l });
94
+ ) : /* @__PURE__ */ e("div", { className: `${c} ${n}`, children: s });
101
95
  };
102
96
  export {
103
- Z as LinkCard,
104
- Z as default
97
+ M as LinkCard,
98
+ M as default
105
99
  };
106
100
  //# sourceMappingURL=LinkCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkCard.js","sources":["../../src/components/LinkCard.tsx"],"sourcesContent":["import type React from 'react';\nimport { useId, useState } from 'react';\nimport ForwardArrowIcon from './CustomIcons/ForwardArrowIcon';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport Text from './Typography/Text';\nimport { getFontSize, getTextColor } from './Typography/textStyles';\nimport { ROW_HOVER } from './chromeStyles';\nimport { devWarning } from './devWarning';\nimport { FOCUS_RING, isFocusVisible } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\n\nexport type LinkCardTone = 'neutral' | 'success' | 'warning' | 'error';\n\nexport interface LinkCardProps {\n title: string;\n /** One line under the title; shown in full on hover, or when a clickable card takes keyboard focus. */\n description?: string;\n /** Colours the title. */\n tone?: LinkCardTone;\n /**\n * Decorative, before the title. Paths are filled with `currentColor`, so colour one through\n * `color`, as `Hexagon` does; a path keeping its own `fill` needs `data-malachite-shape`.\n */\n icon?: React.ReactNode;\n /** Decorative content before the action, e.g. a level scale. Must not be interactive. */\n trailing?: React.ReactNode;\n actionLabel?: string;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Renders a link instead of a button; unsafe schemes are dropped. */\n href?: string;\n className?: string;\n}\n\nconst TITLE_COLOR = {\n neutral: 'primary',\n success: 'success',\n warning: 'warning',\n error: 'error',\n} as const;\n\nconst CARD_CLASSES =\n 'flex w-full items-center gap-[12px] rounded-[var(--malachite-radius-10,10px)] border border-solid border-[var(--malachite-card-border,rgb(232,232,232))] bg-[var(--malachite-card-background,rgb(255,255,255))] px-[12px] py-[10px] text-start text-[var(--malachite-text-primary,rgb(10,10,10))] no-underline';\n\nconst INTERACTIVE_CLASSES = `cursor-pointer ${ROW_HOVER} hover:border-[var(--malachite-secondary-border-hover,rgb(186,186,186))] ${FOCUS_RING}`;\n\nconst DESCRIPTION_STYLE: React.CSSProperties = {\n color: getTextColor('secondary'),\n fontSize: getFontSize('xsmall'),\n};\n\n/** A compact card that opens more detail elsewhere, such as another tab of a panel. */\nconst LinkCard: React.FC<LinkCardProps> = ({\n title,\n description,\n tone = 'neutral',\n icon,\n trailing,\n actionLabel = 'Open',\n onClick,\n href: rawHref,\n className = '',\n}) => {\n const href = safeHref(rawHref);\n if (rawHref && !href) {\n devWarning(\n `LinkCard.href:${rawHref}`,\n `LinkCard dropped the unsafe href \"${rawHref}\"; without an onClick it is a static card.`,\n );\n }\n const interactive = Boolean(href || onClick);\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const actionId = `${id}-action`;\n const [revealed, setRevealed] = useState(false);\n const reveal = {\n onFocus: (event: React.FocusEvent<HTMLElement>) =>\n setRevealed(isFocusVisible(event.currentTarget, false)),\n onPointerDown: () => setRevealed(false),\n onBlur: () => setRevealed(false),\n };\n const labelling = {\n 'aria-labelledby': `${titleId} ${actionId}`,\n 'aria-describedby': description ? descriptionId : undefined,\n ...reveal,\n };\n const body = (\n <>\n {isRenderableNode(icon) && (\n <span aria-hidden=\"true\" className=\"flex flex-none items-center\">\n {icon}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 flex-col gap-[1px] leading-[15px]\">\n <span id={titleId} className=\"flex min-w-0 [overflow-wrap:anywhere]\">\n <Text\n size=\"small\"\n fontWeight=\"bold\"\n color={TITLE_COLOR[tone]}\n className=\"min-w-0 leading-[17px]\"\n >\n {title}\n </Text>\n </span>\n {description && (\n <span\n id={descriptionId}\n className=\"flex min-w-0 [overflow-wrap:anywhere]\"\n style={DESCRIPTION_STYLE}\n >\n {revealed ? (\n description\n ) : (\n <TruncatedTooltip\n text={description}\n delay={1}\n triggerAs=\"span\"\n describesTrigger={false}\n >\n {description}\n </TruncatedTooltip>\n )}\n </span>\n )}\n </span>\n {isRenderableNode(trailing) && (\n <span aria-hidden=\"true\" className=\"flex flex-none items-center\">\n {trailing}\n </span>\n )}\n {interactive && (\n <span className=\"flex flex-none items-center gap-[3px] text-[var(--malachite-accent-foreground,rgb(2,122,66))]\">\n <span id={actionId} className=\"flex\">\n <Text size=\"xsmall\" fontWeight=\"semi-bold\" color=\"inherit\" wrap={false}>\n {actionLabel}\n </Text>\n </span>\n <span aria-hidden=\"true\" className=\"flex\">\n <ForwardArrowIcon size={12} />\n </span>\n </span>\n )}\n </>\n );\n if (href) {\n return (\n <a\n href={href}\n onClick={onClick}\n {...labelling}\n className={`${CARD_CLASSES} ${INTERACTIVE_CLASSES} ${className}`}\n >\n {body}\n </a>\n );\n }\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n {...labelling}\n className={`m-0 appearance-none font-[inherit] ${CARD_CLASSES} ${INTERACTIVE_CLASSES} ${className}`}\n >\n {body}\n </button>\n );\n }\n return <div className={`${CARD_CLASSES} ${className}`}>{body}</div>;\n};\n\nexport default LinkCard;\nexport { LinkCard };\n"],"names":["TITLE_COLOR","CARD_CLASSES","INTERACTIVE_CLASSES","ROW_HOVER","FOCUS_RING","DESCRIPTION_STYLE","getTextColor","getFontSize","LinkCard","title","description","tone","icon","trailing","actionLabel","onClick","rawHref","className","href","safeHref","devWarning","interactive","id","useId","titleId","descriptionId","actionId","revealed","setRevealed","useState","reveal","event","isFocusVisible","labelling","body","jsxs","Fragment","isRenderableNode","jsx","Text","TruncatedTooltip","ForwardArrowIcon"],"mappings":";;;;;;;;;;;AAkCA,MAAMA,IAAc;AAAA,EAChB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA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AuB;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAK;AAAA,MACL,SAAAvB;AAAA,MACC,GAAGkB;AAAA,MACJ,WAAW,sCAAsChC,CAAY,IAAIC,CAAmB,IAAIe,CAAS;AAAA,MAEhG,UAAAiB;AAAA,IAAA;AAAA,EAAA,IAIN,gBAAAI,EAAC,SAAI,WAAW,GAAGrC,CAAY,IAAIgB,CAAS,IAAK,UAAAiB,EAAA,CAAK;AACjE;"}
1
+ {"version":3,"file":"LinkCard.js","sources":["../../src/components/LinkCard.tsx"],"sourcesContent":["import type React from 'react';\nimport { useId, useState } from 'react';\nimport ForwardArrowIcon from './CustomIcons/ForwardArrowIcon';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport Text from './Typography/Text';\nimport { getFontSize, getTextColor } from './Typography/textStyles';\nimport { cardHref } from './cardHref';\nimport { ROW_HOVER } from './chromeStyles';\nimport { FOCUS_RING, isFocusVisible } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\n\nexport type LinkCardTone = 'neutral' | 'success' | 'warning' | 'error';\n\nexport interface LinkCardProps {\n title: string;\n /** One line under the title; shown in full on hover, or when a clickable card takes keyboard focus. */\n description?: string;\n /** Colours the title. */\n tone?: LinkCardTone;\n /**\n * Decorative, before the title. Paths are filled with `currentColor`, so colour one through\n * `color`, as `Hexagon` does; a path keeping its own `fill` needs `data-malachite-shape`.\n */\n icon?: React.ReactNode;\n /** Decorative content before the action, e.g. a level scale. Must not be interactive. */\n trailing?: React.ReactNode;\n actionLabel?: string;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Renders a link instead of a button; unsafe schemes are dropped. */\n href?: string;\n className?: string;\n}\n\nconst TITLE_COLOR = {\n neutral: 'primary',\n success: 'success',\n warning: 'warning',\n error: 'error',\n} as const;\n\nconst CARD_CLASSES =\n 'flex w-full items-center gap-[12px] rounded-[var(--malachite-radius-10,10px)] border border-solid border-[var(--malachite-card-border,rgb(232,232,232))] bg-[var(--malachite-card-background,rgb(255,255,255))] px-[12px] py-[10px] text-start text-[var(--malachite-text-primary,rgb(10,10,10))] no-underline';\n\nconst INTERACTIVE_CLASSES = `cursor-pointer ${ROW_HOVER} hover:border-[var(--malachite-secondary-border-hover,rgb(186,186,186))] ${FOCUS_RING}`;\n\nconst DESCRIPTION_STYLE: React.CSSProperties = {\n color: getTextColor('secondary'),\n fontSize: getFontSize('xsmall'),\n};\n\n/** A compact card that opens more detail elsewhere, such as another tab of a panel. */\nconst LinkCard: React.FC<LinkCardProps> = ({\n title,\n description,\n tone = 'neutral',\n icon,\n trailing,\n actionLabel = 'Open',\n onClick,\n href: rawHref,\n className = '',\n}) => {\n const href = cardHref('LinkCard', 'card', rawHref);\n const interactive = Boolean(href || onClick);\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const actionId = `${id}-action`;\n const [revealed, setRevealed] = useState(false);\n const reveal = {\n onFocus: (event: React.FocusEvent<HTMLElement>) =>\n setRevealed(isFocusVisible(event.currentTarget, false)),\n onPointerDown: () => setRevealed(false),\n onBlur: () => setRevealed(false),\n };\n const labelling = {\n 'aria-labelledby': `${titleId} ${actionId}`,\n 'aria-describedby': description ? descriptionId : undefined,\n ...reveal,\n };\n const body = (\n <>\n {isRenderableNode(icon) && (\n <span aria-hidden=\"true\" className=\"flex flex-none items-center\">\n {icon}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 flex-col gap-[1px] leading-[15px]\">\n <span id={titleId} className=\"flex min-w-0 [overflow-wrap:anywhere]\">\n <Text\n size=\"small\"\n fontWeight=\"bold\"\n color={TITLE_COLOR[tone]}\n className=\"min-w-0 leading-[17px]\"\n >\n {title}\n </Text>\n </span>\n {description && (\n <span\n id={descriptionId}\n className=\"flex min-w-0 [overflow-wrap:anywhere]\"\n style={DESCRIPTION_STYLE}\n >\n {revealed ? (\n description\n ) : (\n <TruncatedTooltip\n text={description}\n delay={1}\n triggerAs=\"span\"\n describesTrigger={false}\n >\n {description}\n </TruncatedTooltip>\n )}\n </span>\n )}\n </span>\n {isRenderableNode(trailing) && (\n <span aria-hidden=\"true\" className=\"flex flex-none items-center\">\n {trailing}\n </span>\n )}\n {interactive && (\n <span className=\"flex flex-none items-center gap-[3px] text-[var(--malachite-accent-foreground,rgb(2,122,66))]\">\n <span id={actionId} className=\"flex\">\n <Text size=\"xsmall\" fontWeight=\"semi-bold\" color=\"inherit\" wrap={false}>\n {actionLabel}\n </Text>\n </span>\n <span aria-hidden=\"true\" className=\"flex\">\n <ForwardArrowIcon size={12} />\n </span>\n </span>\n )}\n </>\n );\n if (href) {\n return (\n <a\n href={href}\n onClick={onClick}\n {...labelling}\n className={`${CARD_CLASSES} ${INTERACTIVE_CLASSES} ${className}`}\n >\n {body}\n </a>\n );\n }\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n {...labelling}\n className={`m-0 appearance-none font-[inherit] ${CARD_CLASSES} ${INTERACTIVE_CLASSES} ${className}`}\n >\n {body}\n </button>\n );\n }\n return <div className={`${CARD_CLASSES} ${className}`}>{body}</div>;\n};\n\nexport default LinkCard;\nexport { LinkCard };\n"],"names":["TITLE_COLOR","CARD_CLASSES","INTERACTIVE_CLASSES","ROW_HOVER","FOCUS_RING","DESCRIPTION_STYLE","getTextColor","getFontSize","LinkCard","title","description","tone","icon","trailing","actionLabel","onClick","rawHref","className","href","cardHref","interactive","id","useId","titleId","descriptionId","actionId","revealed","setRevealed","useState","reveal","event","isFocusVisible","labelling","body","jsxs","Fragment","isRenderableNode","jsx","Text","TruncatedTooltip","ForwardArrowIcon"],"mappings":";;;;;;;;;;AAiCA,MAAMA,IAAc;AAAA,EAChB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAEMC,IACF,kTAEEC,IAAsB,kBAAkBC,CAAS,4EAA4EC,CAAU,IAEvIC,IAAyC;AAAA,EAC3C,OAAOC,EAAa,WAAW;AAAA,EAC/B,UAAUC,EAAY,QAAQ;AAClC,GAGMC,IAAoC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AA,CAAK;AACjE;"}
@@ -0,0 +1,85 @@
1
+ import { jsx as e, jsxs as p, Fragment as g } from "react/jsx-runtime";
2
+ import { useId as T } from "react";
3
+ import b from "./Typography/Text.js";
4
+ import { cardHref as v } from "./cardHref.js";
5
+ import { FOCUS_RING as I } from "./focusRing.js";
6
+ import { isRenderableNode as $ } from "./renderableNode.js";
7
+ const y = 140, N = {
8
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${y}px), 1fr))`
9
+ }, S = "flex w-full flex-col items-start gap-[8px] rounded-[var(--malachite-radius-10,10px)] border border-[var(--malachite-card-border,rgb(232,232,232))] p-[12px] text-start text-[var(--malachite-text-primary,rgb(10,10,10))] no-underline", E = {
10
+ default: "border-solid bg-[var(--malachite-card-background,rgb(255,255,255))]",
11
+ more: "border-dashed bg-[var(--malachite-card-sunken-background,rgb(250,250,250))]"
12
+ }, f = `cursor-pointer transition-colors hover:border-[var(--malachite-secondary-border-hover,rgb(186,186,186))] ${I}`, _ = ({
13
+ href: o,
14
+ onClick: r,
15
+ labelling: a,
16
+ classes: t,
17
+ children: i
18
+ }) => o ? /* @__PURE__ */ e(
19
+ "a",
20
+ {
21
+ href: o,
22
+ onClick: r,
23
+ ...a,
24
+ className: `${t} ${f}`,
25
+ children: i
26
+ }
27
+ ) : /* @__PURE__ */ e(
28
+ "button",
29
+ {
30
+ type: "button",
31
+ onClick: r,
32
+ ...a,
33
+ className: `m-0 appearance-none font-[inherit] ${t} ${f}`,
34
+ children: i
35
+ }
36
+ ), w = ({
37
+ title: o,
38
+ description: r,
39
+ icon: a,
40
+ variant: t = "default",
41
+ onClick: i,
42
+ href: h,
43
+ className: x = ""
44
+ }) => {
45
+ const l = v("TileGrid.Tile", "tile", h), d = T(), n = `${d}-title`, s = `${d}-description`, c = `${S} ${E[t]} ${x}`, u = {
46
+ "aria-labelledby": n,
47
+ "aria-describedby": r ? s : void 0,
48
+ "data-variant": t
49
+ }, m = /* @__PURE__ */ p(g, { children: [
50
+ $(a) && /* @__PURE__ */ e(
51
+ "span",
52
+ {
53
+ "aria-hidden": "true",
54
+ className: "flex size-[26px] flex-none items-center justify-center overflow-hidden",
55
+ children: a
56
+ }
57
+ ),
58
+ /* @__PURE__ */ p("span", { className: "flex min-w-0 flex-col gap-[2px] [overflow-wrap:anywhere]", children: [
59
+ /* @__PURE__ */ e("span", { id: n, children: /* @__PURE__ */ e(b, { size: "small", fontWeight: "semi-bold", children: o }) }),
60
+ r && /* @__PURE__ */ e("span", { id: s, children: /* @__PURE__ */ e(b, { size: "xsmall", color: "secondary", children: r }) })
61
+ ] })
62
+ ] });
63
+ return l || i ? /* @__PURE__ */ e(_, { href: l, onClick: i, labelling: u, classes: c, children: m }) : /* @__PURE__ */ e("div", { "data-variant": t, className: c, children: m });
64
+ }, A = ({
65
+ children: o,
66
+ "aria-label": r,
67
+ "aria-labelledby": a,
68
+ className: t = ""
69
+ }) => /* @__PURE__ */ e(
70
+ "div",
71
+ {
72
+ role: r || a ? "group" : void 0,
73
+ "aria-label": r,
74
+ "aria-labelledby": a,
75
+ className: `grid gap-[8px] ${t}`,
76
+ style: N,
77
+ children: o
78
+ }
79
+ );
80
+ A.Tile = w;
81
+ export {
82
+ A as TileGrid,
83
+ A as default
84
+ };
85
+ //# sourceMappingURL=TileGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TileGrid.js","sources":["../../src/components/TileGrid.tsx"],"sourcesContent":["import type React from 'react';\nimport { useId } from 'react';\nimport Text from './Typography/Text';\nimport { cardHref } from './cardHref';\nimport { FOCUS_RING } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\n\nexport type TileVariant = 'default' | 'more';\n\nexport interface TileGridProps {\n children: React.ReactNode;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n}\n\nexport interface TileProps {\n title: string;\n /** Under the title, wrapping onto as many lines as it needs. */\n description?: string;\n /** Decorative, above the title, such as an app's logo. */\n icon?: React.ReactNode;\n /** `more` is a dashed tile on the sunken ground, for a \"See all\" that leads past the grid. */\n variant?: TileVariant;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Renders a link instead of a button; unsafe schemes are dropped. */\n href?: string;\n className?: string;\n}\n\nconst TILE_MIN_WIDTH = 140;\n\nconst GRID_STYLE: React.CSSProperties = {\n gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${TILE_MIN_WIDTH}px), 1fr))`,\n};\n\nconst TILE_CLASSES =\n 'flex w-full flex-col items-start gap-[8px] rounded-[var(--malachite-radius-10,10px)] border border-[var(--malachite-card-border,rgb(232,232,232))] p-[12px] text-start text-[var(--malachite-text-primary,rgb(10,10,10))] no-underline';\n\nconst VARIANT_CLASSES: Record<TileVariant, string> = {\n default: 'border-solid bg-[var(--malachite-card-background,rgb(255,255,255))]',\n more: 'border-dashed bg-[var(--malachite-card-sunken-background,rgb(250,250,250))]',\n};\n\nconst INTERACTIVE_CLASSES = `cursor-pointer transition-colors hover:border-[var(--malachite-secondary-border-hover,rgb(186,186,186))] ${FOCUS_RING}`;\n\ninterface TileControlProps {\n href?: string;\n onClick?: TileProps['onClick'];\n labelling: React.AriaAttributes & { 'data-variant': TileVariant };\n classes: string;\n children: React.ReactNode;\n}\n\nconst TileControl: React.FC<TileControlProps> = ({\n href,\n onClick,\n labelling,\n classes,\n children,\n}) =>\n href ? (\n <a\n href={href}\n onClick={onClick}\n {...labelling}\n className={`${classes} ${INTERACTIVE_CLASSES}`}\n >\n {children}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={onClick}\n {...labelling}\n className={`m-0 appearance-none font-[inherit] ${classes} ${INTERACTIVE_CLASSES}`}\n >\n {children}\n </button>\n );\n\nconst Tile: React.FC<TileProps> = ({\n title,\n description,\n icon,\n variant = 'default',\n onClick,\n href: rawHref,\n className = '',\n}) => {\n const href = cardHref('TileGrid.Tile', 'tile', rawHref);\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const classes = `${TILE_CLASSES} ${VARIANT_CLASSES[variant]} ${className}`;\n const labelling = {\n 'aria-labelledby': titleId,\n 'aria-describedby': description ? descriptionId : undefined,\n 'data-variant': variant,\n };\n const body = (\n <>\n {isRenderableNode(icon) && (\n <span\n aria-hidden=\"true\"\n className=\"flex size-[26px] flex-none items-center justify-center overflow-hidden\"\n >\n {icon}\n </span>\n )}\n <span className=\"flex min-w-0 flex-col gap-[2px] [overflow-wrap:anywhere]\">\n <span id={titleId}>\n <Text size=\"small\" fontWeight=\"semi-bold\">\n {title}\n </Text>\n </span>\n {description && (\n <span id={descriptionId}>\n <Text size=\"xsmall\" color=\"secondary\">\n {description}\n </Text>\n </span>\n )}\n </span>\n </>\n );\n return href || onClick ? (\n <TileControl href={href} onClick={onClick} labelling={labelling} classes={classes}>\n {body}\n </TileControl>\n ) : (\n <div data-variant={variant} className={classes}>\n {body}\n </div>\n );\n};\n\n/**\n * Tiles side by side, as many to a row as fit at 140px each, wrapping below that: a short set of\n * things to pick from, such as AI clients, each a logo, a title and a description.\n */\nconst TileGrid: React.FC<TileGridProps> & { Tile: React.FC<TileProps> } = ({\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n}) => (\n <div\n role={ariaLabel || ariaLabelledBy ? 'group' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`grid gap-[8px] ${className}`}\n style={GRID_STYLE}\n >\n {children}\n </div>\n);\n\nTileGrid.Tile = Tile;\n\nexport default TileGrid;\nexport { TileGrid };\n"],"names":["TILE_MIN_WIDTH","GRID_STYLE","TILE_CLASSES","VARIANT_CLASSES","INTERACTIVE_CLASSES","FOCUS_RING","TileControl","href","onClick","labelling","classes","children","jsx","Tile","title","description","icon","variant","rawHref","className","cardHref","id","useId","titleId","descriptionId","body","jsxs","Fragment","isRenderableNode","Text","TileGrid","ariaLabel","ariaLabelledBy"],"mappings":";;;;;;AA8BA,MAAMA,IAAiB,KAEjBC,IAAkC;AAAA,EACpC,qBAAqB,qCAAq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MAAA;AAAA,IAAA;AAAA,IAGT,gBAAAU,EAAC,QAAA,EAAK,WAAU,4DACZ,UAAA;AAAA,MAAA,gBAAAd,EAAC,QAAA,EAAK,IAAIW,GACN,UAAA,gBAAAX,EAACiB,GAAA,EAAK,MAAK,SAAQ,YAAW,aACzB,UAAAf,EAAA,CACL,GACJ;AAAA,MACCC,KACG,gBAAAH,EAAC,QAAA,EAAK,IAAIY,GACN,UAAA,gBAAAZ,EAACiB,GAAA,EAAK,MAAK,UAAS,OAAM,aACrB,UAAAd,EAAA,CACL,EAAA,CACJ;AAAA,IAAA,EAAA,CAER;AAAA,EAAA,GACJ;AAEJ,SAAOR,KAAQC,IACX,gBAAAI,EAACN,GAAA,EAAY,MAAAC,GAAY,SAAAC,GAAkB,WAAAC,GAAsB,SAAAC,GAC5D,UAAAe,EAAA,CACL,sBAEC,OAAA,EAAI,gBAAcR,GAAS,WAAWP,GAClC,UAAAe,GACL;AAER,GAMMK,IAAoE,CAAC;AAAA,EACvE,UAAAnB;AAAA,EACA,cAAcoB;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAb,IAAY;AAChB,MACI,gBAAAP;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,MAAMmB,KAAaC,IAAiB,UAAU;AAAA,IAC9C,cAAYD;AAAA,IACZ,mBAAiBC;AAAA,IACjB,WAAW,kBAAkBb,CAAS;AAAA,IACtC,OAAOlB;AAAA,IAEN,UAAAU;AAAA,EAAA;AACL;AAGJmB,EAAS,OAAOjB;"}
@@ -0,0 +1,13 @@
1
+ import { devWarning as e } from "./devWarning.js";
2
+ import { safeHref as o } from "./safeHref.js";
3
+ const n = (t, a, r) => {
4
+ const i = o(r);
5
+ return r && !i && e(
6
+ `${t}.href:${r}`,
7
+ `${t} dropped the unsafe href "${r}"; without an onClick it is a static ${a}.`
8
+ ), i;
9
+ };
10
+ export {
11
+ n as cardHref
12
+ };
13
+ //# sourceMappingURL=cardHref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardHref.js","sources":["../../src/components/cardHref.ts"],"sourcesContent":["import { devWarning } from './devWarning';\nimport { safeHref } from './safeHref';\n\nexport const cardHref = (\n component: string,\n noun: string,\n href: string | undefined,\n): string | undefined => {\n const safe = safeHref(href);\n if (href && !safe) {\n devWarning(\n `${component}.href:${href}`,\n `${component} dropped the unsafe href \"${href}\"; without an onClick it is a static ${noun}.`,\n );\n }\n return safe;\n};\n"],"names":["cardHref","component","noun","href","safe","safeHref","devWarning"],"mappings":";;AAGO,MAAMA,IAAW,CACpBC,GACAC,GACAC,MACqB;AACrB,QAAMC,IAAOC,EAASF,CAAI;AAC1B,SAAIA,KAAQ,CAACC,KACTE;AAAA,IACI,GAAGL,CAAS,SAASE,CAAI;AAAA,IACzB,GAAGF,CAAS,6BAA6BE,CAAI,wCAAwCD,CAAI;AAAA,EAAA,GAG1FE;AACX;"}
package/dist/index.d.ts CHANGED
@@ -6829,6 +6829,37 @@ export declare const ThumbsDownIcon: React.FC<IconProps_116>;
6829
6829
 
6830
6830
  export declare const ThumbsUpIcon: React.FC<IconProps_117>;
6831
6831
 
6832
+ /**
6833
+ * Tiles side by side, as many to a row as fit at 140px each, wrapping below that: a short set of
6834
+ * things to pick from, such as AI clients, each a logo, a title and a description.
6835
+ */
6836
+ export declare const TileGrid: default_2.FC<TileGridProps> & {
6837
+ Tile: default_2.FC<TileProps>;
6838
+ };
6839
+
6840
+ export declare interface TileGridProps {
6841
+ children: default_2.ReactNode;
6842
+ 'aria-label'?: string;
6843
+ 'aria-labelledby'?: string;
6844
+ className?: string;
6845
+ }
6846
+
6847
+ export declare interface TileProps {
6848
+ title: string;
6849
+ /** Under the title, wrapping onto as many lines as it needs. */
6850
+ description?: string;
6851
+ /** Decorative, above the title, such as an app's logo. */
6852
+ icon?: default_2.ReactNode;
6853
+ /** `more` is a dashed tile on the sunken ground, for a "See all" that leads past the grid. */
6854
+ variant?: TileVariant;
6855
+ onClick?: (event: default_2.MouseEvent<HTMLElement>) => void;
6856
+ /** Renders a link instead of a button; unsafe schemes are dropped. */
6857
+ href?: string;
6858
+ className?: string;
6859
+ }
6860
+
6861
+ export declare type TileVariant = 'default' | 'more';
6862
+
6832
6863
  export declare const TimeBarChart: default_2.FC<TimeBarChartProps>;
6833
6864
 
6834
6865
  export declare interface TimeBarChartBucket {