@stackone/malachite 2.100.0 → 2.101.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
@@ -101,6 +101,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
101
101
  - **`Keycap`** — One key on a keyboard, drawn as a cap — `esc`, `⌘`, a caret, or a sigil a user types to scope a search. Renders a `<kbd>`, or a button as soon as either `onClick` or `disabled` is passed — `disabled={false}` included, since naming the prop at all is the statement that the cap is a control. `SidePanelNavFooter` is built on it.
102
102
  - **`CollapsibleSection`** — Collapsible sunken-card section (title - subtitle header, disclosure arrow right) for stacked detail sections in side panels and detail pages. A preset over `Accordion`’s `sunken` variant.
103
103
  - **`KeyValueList`** — Bordered card of label/value rows (`KeyValueList.Row`) for entity details: fixed-width secondary labels, free-form values, row dividers. `truncate` keeps a long value (an ID) to one line with an ellipsis at the cell width and a tooltip only when it is actually cut off — the value itself when it is text, else the row’s `tooltip` (`null` turns it off). For inline content only: a Tag or AppLogo is clipped without an ellipsis, so use its own truncate, as with `CodeText truncate`. `size="small"` tightens the rows for a list inside a dialog or panel. _Key props:_ `size` (`small` | `medium`), `label`, `truncate`, `tooltip`.
104
+ - **`KeyValueStrip`** — Label/value cells side by side in one sunken band, divided by rules (`KeyValueStrip.Item`), for the facts under a side panel’s header. Cells share the width equally and text values are small, in medium weight. `truncate` keeps a value to one line with an ellipsis and, for text, a tooltip only when it is cut off; with `truncate`, a given `tooltip` always shows, since it may say more than the value (a full id behind a shortened one), and `null` turns it off. `prefix` (an icon) and `suffix` (a copy button) stay whole while the value truncates. For a vertical list of rows use `KeyValueList`. _Key props:_ `aria-label`, `label`, `truncate`, `tooltip`, `prefix`, `suffix`.
104
105
 
105
106
  ## Buttons & actions
106
107
 
@@ -135,7 +136,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
135
136
  ## Typography
136
137
 
137
138
  - **`ClampText`** — Clamps text to N lines; expands to full text on hover/focus with a height animation. Wrapping markdown? Pass `variant="flow"` to the `Typography.MarkdownBlock` inside it, or the clamp counts blocks instead of lines.
138
- - **`Typography`** — Text primitives — use these instead of raw colour tokens on `<span>`s. Includes `Typography.Text`, `Typography.SecondaryText`, `Typography.EllipsisText`, etc., with size/weight/color props. `Typography.Text`'s `size` runs `xsmall` (11px), `12`, `small` (13px), `medium` (14px) and up; `12` is off the named ladder, like the theme's `15`, for a secondary line under a 14px label. `wrap={false}` keeps a `Typography.Text` on one line. `Typography.Text` takes `font="sans" | "heading" | "body" | "mono"`, and `as` (`p`, `h1`–`h6`) for a heading or paragraph that keeps its look; `Typography.CodeText` takes `variant="inline"` for a chip mid-sentence; `Typography.MarkdownBlock` takes `variant="flow"` for use inside `ClampText`, `variant="inline"` for one line of inline syntax set inside another component (no autolinks, images as alt text), `links="inert"` to draw links without an anchor inside a button, `renderLink` to send root-relative links (`/path`, never `//host`) through the app’s router in the same tab while every other link still opens in a new one — without it every link opens in a new tab, and `normalizeSource` for machine-generated descriptions that omit blank lines between blocks. `Typography.PathText` draws one line of path segments (`segments`, root first, each `{ text, tone, minChars }` with `tone` `default` | `secondary`) joined by a `separator` that is never cut: the segments give way in order, each down to `minChars` (2) characters, so the last stays whole the longest, and a cut never leaves a space before its ellipsis, which `text-overflow` does. The full path is always the accessible name and shows in a tooltip only when something is cut (`tooltip`, `tooltipPlacement`, `tooltipSuppressed` while the menu it labels is open). It measures with canvas text metrics against a shared ResizeObserver, so it costs no layout read per instance. `Typography.EllipsisText` takes a `size` and a `fontWeight` (Text's scale) so a truncating label can match the text beside it, and shows its `tooltip` on every hover unless `tooltipWhenTruncated` is set, which limits it to text that is actually cut off — for a tooltip that repeats the label, where a tooltip carrying something the label does not say should keep the default. `inline` wraps the text in a span rather than a div, for inside a clickable `Surface.Row`.
139
+ - **`Typography`** — Text primitives — use these instead of raw colour tokens on `<span>`s. Includes `Typography.Text`, `Typography.SecondaryText`, `Typography.EllipsisText`, etc., with size/weight/color props. `Typography.Text`'s `size` runs `xsmall` (11px), `12`, `small` (13px), `medium` (14px) and up; `12` is off the named ladder, like the theme's `15`, for a secondary line under a 14px label. `wrap={false}` keeps a `Typography.Text` on one line. `Typography.Text` takes `font="sans" | "heading" | "body" | "mono"`, and `as` (`p`, `h1`–`h6`) for a heading or paragraph that keeps its look; `Typography.CodeText` takes `variant="inline"` for a chip mid-sentence; `Typography.MarkdownBlock` takes `variant="flow"` for use inside `ClampText`, `variant="inline"` for one line of inline syntax set inside another component (no autolinks, images as alt text), `links="inert"` to draw links without an anchor inside a button, `renderLink` to send root-relative links (`/path`, never `//host`) through the app’s router in the same tab while every other link still opens in a new one — without it every link opens in a new tab, and `normalizeSource` for machine-generated descriptions that omit blank lines between blocks. `Typography.PathText` draws one line of path segments (`segments`, root first, each `{ text, tone, minChars }` with `tone` `default` | `secondary`) joined by a `separator` that is never cut: the segments give way in order, each down to `minChars` (2) characters, so the last stays whole the longest, and a cut never leaves a space before its ellipsis, which `text-overflow` does. The full path is always the accessible name and shows in a tooltip only when something is cut (`tooltip`, `tooltipPlacement`, `tooltipSuppressed` while the menu it labels is open). It measures with canvas text metrics against a shared ResizeObserver, so it costs no layout read per instance. `Typography.EllipsisText` takes a `size` and a `fontWeight` (Text's scale) so a truncating label can match the text beside it, and shows its `tooltip` on every hover unless `tooltipWhenTruncated` is set, which limits it to text that is actually cut off — for a tooltip that repeats the label, where a tooltip carrying something the label does not say should keep the default. `tooltipDelay` sets the seconds before it opens, and `focusableTrigger` makes the text a tab stop that opens it on focus, for a tooltip that says what the text does not (ignored with `tooltipWhenTruncated`). `inline` wraps the text in a span rather than a div, for inside a clickable `Surface.Row`.
139
140
 
140
141
  ## Theming & utility
141
142
 
@@ -1,7 +1,8 @@
1
- import { jsx as a, jsxs as x } from "react/jsx-runtime";
2
- import { createContext as s, useContext as p, Children as n } from "react";
3
- import m from "./Typography/EllipsisText.js";
4
- const c = {
1
+ import { jsx as r, jsxs as x } from "react/jsx-runtime";
2
+ import { createContext as m, useContext as p } from "react";
3
+ import s from "./Typography/EllipsisText.js";
4
+ import { textOf as c } from "./childrenText.js";
5
+ const n = {
5
6
  small: {
6
7
  row: "min-h-[36px]",
7
8
  label: "w-[140px] px-[12px] py-[8px]",
@@ -12,61 +13,58 @@ const c = {
12
13
  label: "w-[200px] p-[16px]",
13
14
  value: "py-[16px] pr-[16px]"
14
15
  }
15
- }, i = s("medium"), u = (e) => typeof e == "string" || typeof e == "number", b = (e) => {
16
- const r = n.toArray(e);
17
- return r.length > 0 && r.every(u) ? r.join("") : void 0;
18
- }, f = ({
19
- label: e,
20
- className: r = "",
21
- children: t,
22
- truncate: d = !1,
16
+ }, d = m("medium"), b = ({
17
+ label: t,
18
+ className: a = "",
19
+ children: e,
20
+ truncate: i = !1,
23
21
  tooltip: o
24
22
  }) => {
25
- const l = c[p(i)];
23
+ const l = n[p(d)];
26
24
  return /* @__PURE__ */ x(
27
25
  "div",
28
26
  {
29
- className: `flex ${l.row} w-full items-start border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0 ${r}`,
27
+ className: `flex ${l.row} w-full items-start border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0 ${a}`,
30
28
  children: [
31
- /* @__PURE__ */ a(
29
+ /* @__PURE__ */ r(
32
30
  "dt",
33
31
  {
34
32
  className: `m-0 shrink-0 ${l.label} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-secondary)]`,
35
- children: e
33
+ children: t
36
34
  }
37
35
  ),
38
- /* @__PURE__ */ a(
36
+ /* @__PURE__ */ r(
39
37
  "dd",
40
38
  {
41
39
  className: `m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] ${l.value} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-primary)]`,
42
- children: d ? /* @__PURE__ */ a(
43
- m,
40
+ children: i ? /* @__PURE__ */ r(
41
+ s,
44
42
  {
45
43
  maxWidth: "100%",
46
- tooltip: o !== void 0 ? o : b(t),
44
+ tooltip: o !== void 0 ? o : c(e),
47
45
  tooltipWhenTruncated: !0,
48
- children: t
46
+ children: e
49
47
  }
50
- ) : t
48
+ ) : e
51
49
  }
52
50
  )
53
51
  ]
54
52
  }
55
53
  );
56
- }, h = ({
57
- className: e = "",
58
- children: r,
59
- size: t = "medium"
60
- }) => /* @__PURE__ */ a(i.Provider, { value: t, children: /* @__PURE__ */ a(
54
+ }, u = ({
55
+ className: t = "",
56
+ children: a,
57
+ size: e = "medium"
58
+ }) => /* @__PURE__ */ r(d.Provider, { value: e, children: /* @__PURE__ */ r(
61
59
  "dl",
62
60
  {
63
- className: `m-0 flex w-full flex-col overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] ${e}`,
64
- children: r
61
+ className: `m-0 flex w-full flex-col overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] ${t}`,
62
+ children: a
65
63
  }
66
64
  ) });
67
- h.Row = f;
65
+ u.Row = b;
68
66
  export {
69
- h as KeyValueList,
70
- h as default
67
+ u as KeyValueList,
68
+ u as default
71
69
  };
72
70
  //# sourceMappingURL=KeyValueList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeyValueList.js","sources":["../../src/components/KeyValueList.tsx"],"sourcesContent":["import React, { Children, createContext, useContext } from 'react';\nimport EllipsisText from './Typography/EllipsisText';\n\nexport type KeyValueListSize = 'small' | 'medium';\n\nexport interface KeyValueListProps {\n className?: string;\n children: React.ReactNode;\n /** `small` tightens the rows for a list inside a dialog or panel. */\n size?: KeyValueListSize;\n}\n\nexport interface KeyValueListRowProps {\n label: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n /**\n * Keep the value to one line, cut with an ellipsis at the cell's width. For inline content:\n * block/flex children (Tag, AppLogo) are clipped without an ellipsis, so use their own truncate.\n */\n truncate?: boolean;\n /**\n * Shown on hover/focus when a `truncate` value is actually cut off. Defaults to the value\n * itself when it is text (strings/numbers); give one for any other value, or none is shown.\n * Pass `null` to turn the tooltip off.\n */\n tooltip?: React.ReactNode;\n}\n\nconst SIZE_ROW: Record<KeyValueListSize, { row: string; label: string; value: string }> = {\n small: {\n row: 'min-h-[36px]',\n label: 'w-[140px] px-[12px] py-[8px]',\n value: 'py-[8px] pr-[12px]',\n },\n medium: {\n row: 'min-h-[52px]',\n label: 'w-[200px] p-[16px]',\n value: 'py-[16px] pr-[16px]',\n },\n};\n\nconst SizeContext = createContext<KeyValueListSize>('medium');\n\nconst isText = (node: React.ReactNode): node is string | number =>\n typeof node === 'string' || typeof node === 'number';\n\nconst textOf = (children: React.ReactNode): string | undefined => {\n const parts = Children.toArray(children);\n return parts.length > 0 && parts.every(isText) ? parts.join('') : undefined;\n};\n\nconst Row: React.FC<KeyValueListRowProps> = ({\n label,\n className = '',\n children,\n truncate = false,\n tooltip,\n}) => {\n const size = SIZE_ROW[useContext(SizeContext)];\n return (\n <div\n className={`flex ${size.row} w-full items-start border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0 ${className}`}\n >\n <dt\n className={`m-0 shrink-0 ${size.label} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-secondary)]`}\n >\n {label}\n </dt>\n <dd\n className={`m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] ${size.value} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-primary)]`}\n >\n {truncate ? (\n <EllipsisText\n maxWidth=\"100%\"\n tooltip={tooltip !== undefined ? tooltip : textOf(children)}\n tooltipWhenTruncated\n >\n {children}\n </EllipsisText>\n ) : (\n children\n )}\n </dd>\n </div>\n );\n};\n\nconst KeyValueList: React.FC<KeyValueListProps> & { Row: typeof Row } = ({\n className = '',\n children,\n size = 'medium',\n}) => (\n <SizeContext.Provider value={size}>\n <dl\n className={`m-0 flex w-full flex-col overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] ${className}`}\n >\n {children}\n </dl>\n </SizeContext.Provider>\n);\n\nKeyValueList.Row = Row;\n\nexport default KeyValueList;\nexport { KeyValueList };\n"],"names":["SIZE_ROW","SizeContext","createContext","isText","node","textOf","children","parts","Children","Row","label","className","truncate","tooltip","size","useContext","jsxs","jsx","EllipsisText","KeyValueList"],"mappings":";;;AA6BA,MAAMA,IAAoF;AAAA,EACtF,OAAO;AAAA,IACH,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAEX,QAAQ;AAAA,IACJ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEf,GAEMC,IAAcC,EAAgC,QAAQ,GAEtDC,IAAS,CAACC,MACZ,OAAOA,KAAS,YAAY,OAAOA,KAAS,UAE1CC,IAAS,CAACC,MAAkD;AAC9D,QAAMC,IAAQC,EAAS,QAAQF,CAAQ;AACvC,SAAOC,EAAM,SAAS,KAAKA,EAAM,MAAMJ,CAAM,IAAII,EAAM,KAAK,EAAE,IAAI;AACtE,GAEME,IAAsC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAL;AAAA,EACA,UAAAM,IAAW;AAAA,EACX,SAAAC;AACJ,MAAM;AACF,QAAMC,IAAOd,EAASe,EAAWd,CAAW,CAAC;AAC7C,SACI,gBAAAe;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,QAAQF,EAAK,GAAG,4GAA4GH,CAAS;AAAA,MAEhJ,UAAA;AAAA,QAAA,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,gBAAgBH,EAAK,KAAK;AAAA,YAEpC,UAAAJ;AAAA,UAAA;AAAA,QAAA;AAAA,QAEL,gBAAAO;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,4DAA4DH,EAAK,KAAK;AAAA,YAEhF,UAAAF,IACG,gBAAAK;AAAA,cAACC;AAAA,cAAA;AAAA,gBACG,UAAS;AAAA,gBACT,SAASL,MAAY,SAAYA,IAAUR,EAAOC,CAAQ;AAAA,gBAC1D,sBAAoB;AAAA,gBAEnB,UAAAA;AAAA,cAAA;AAAA,YAAA,IAGLA;AAAA,UAAA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGZ,GAEMa,IAAkE,CAAC;AAAA,EACrE,WAAAR,IAAY;AAAA,EACZ,UAAAL;AAAA,EACA,MAAAQ,IAAO;AACX,MACI,gBAAAG,EAAChB,EAAY,UAAZ,EAAqB,OAAOa,GACzB,UAAA,gBAAAG;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,uJAAuJN,CAAS;AAAA,IAE1K,UAAAL;AAAA,EAAA;AACL,EAAA,CACJ;AAGJa,EAAa,MAAMV;"}
1
+ {"version":3,"file":"KeyValueList.js","sources":["../../src/components/KeyValueList.tsx"],"sourcesContent":["import React, { createContext, useContext } from 'react';\nimport EllipsisText from './Typography/EllipsisText';\nimport { textOf } from './childrenText';\n\nexport type KeyValueListSize = 'small' | 'medium';\n\nexport interface KeyValueListProps {\n className?: string;\n children: React.ReactNode;\n /** `small` tightens the rows for a list inside a dialog or panel. */\n size?: KeyValueListSize;\n}\n\nexport interface KeyValueListRowProps {\n label: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n /**\n * Keep the value to one line, cut with an ellipsis at the cell's width. For inline content:\n * block/flex children (Tag, AppLogo) are clipped without an ellipsis, so use their own truncate.\n */\n truncate?: boolean;\n /**\n * Shown on hover/focus when a `truncate` value is actually cut off. Defaults to the value\n * itself when it is text (strings/numbers); give one for any other value, or none is shown.\n * Pass `null` to turn the tooltip off.\n */\n tooltip?: React.ReactNode;\n}\n\nconst SIZE_ROW: Record<KeyValueListSize, { row: string; label: string; value: string }> = {\n small: {\n row: 'min-h-[36px]',\n label: 'w-[140px] px-[12px] py-[8px]',\n value: 'py-[8px] pr-[12px]',\n },\n medium: {\n row: 'min-h-[52px]',\n label: 'w-[200px] p-[16px]',\n value: 'py-[16px] pr-[16px]',\n },\n};\n\nconst SizeContext = createContext<KeyValueListSize>('medium');\n\nconst Row: React.FC<KeyValueListRowProps> = ({\n label,\n className = '',\n children,\n truncate = false,\n tooltip,\n}) => {\n const size = SIZE_ROW[useContext(SizeContext)];\n return (\n <div\n className={`flex ${size.row} w-full items-start border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0 ${className}`}\n >\n <dt\n className={`m-0 shrink-0 ${size.label} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-secondary)]`}\n >\n {label}\n </dt>\n <dd\n className={`m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] ${size.value} text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-primary)]`}\n >\n {truncate ? (\n <EllipsisText\n maxWidth=\"100%\"\n tooltip={tooltip !== undefined ? tooltip : textOf(children)}\n tooltipWhenTruncated\n >\n {children}\n </EllipsisText>\n ) : (\n children\n )}\n </dd>\n </div>\n );\n};\n\nconst KeyValueList: React.FC<KeyValueListProps> & { Row: typeof Row } = ({\n className = '',\n children,\n size = 'medium',\n}) => (\n <SizeContext.Provider value={size}>\n <dl\n className={`m-0 flex w-full flex-col overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] ${className}`}\n >\n {children}\n </dl>\n </SizeContext.Provider>\n);\n\nKeyValueList.Row = Row;\n\nexport default KeyValueList;\nexport { KeyValueList };\n"],"names":["SIZE_ROW","SizeContext","createContext","Row","label","className","children","truncate","tooltip","size","useContext","jsxs","jsx","EllipsisText","textOf","KeyValueList"],"mappings":";;;;AA8BA,MAAMA,IAAoF;AAAA,EACtF,OAAO;AAAA,IACH,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAEX,QAAQ;AAAA,IACJ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEf,GAEMC,IAAcC,EAAgC,QAAQ,GAEtDC,IAAsC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,SAAAC;AACJ,MAAM;AACF,QAAMC,IAAOT,EAASU,EAAWT,CAAW,CAAC;AAC7C,SACI,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,QAAQF,EAAK,GAAG,4GAA4GJ,CAAS;AAAA,MAEhJ,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,gBAAgBH,EAAK,KAAK;AAAA,YAEpC,UAAAL;AAAA,UAAA;AAAA,QAAA;AAAA,QAEL,gBAAAQ;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,4DAA4DH,EAAK,KAAK;AAAA,YAEhF,UAAAF,IACG,gBAAAK;AAAA,cAACC;AAAA,cAAA;AAAA,gBACG,UAAS;AAAA,gBACT,SAASL,MAAY,SAAYA,IAAUM,EAAOR,CAAQ;AAAA,gBAC1D,sBAAoB;AAAA,gBAEnB,UAAAA;AAAA,cAAA;AAAA,YAAA,IAGLA;AAAA,UAAA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGZ,GAEMS,IAAkE,CAAC;AAAA,EACrE,WAAAV,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,MAAAG,IAAO;AACX,MACI,gBAAAG,EAACX,EAAY,UAAZ,EAAqB,OAAOQ,GACzB,UAAA,gBAAAG;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,uJAAuJP,CAAS;AAAA,IAE1K,UAAAC;AAAA,EAAA;AACL,EAAA,CACJ;AAGJS,EAAa,MAAMZ;"}
@@ -0,0 +1,66 @@
1
+ import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
+ import x from "./Typography/EllipsisText.js";
3
+ import f from "./Typography/Text.js";
4
+ import { textOf as b } from "./childrenText.js";
5
+ import { isRenderableNode as t } from "./renderableNode.js";
6
+ const h = 0.2, v = ({
7
+ label: o,
8
+ className: s = "",
9
+ children: l,
10
+ truncate: a = !1,
11
+ tooltip: r,
12
+ prefix: i,
13
+ suffix: n
14
+ }) => {
15
+ const m = r !== void 0, d = t(r) ? r : null, c = b(l);
16
+ return /* @__PURE__ */ p(
17
+ "div",
18
+ {
19
+ className: `flex min-w-0 flex-1 basis-0 flex-col gap-[3px] border-0 border-s border-solid border-[var(--malachite-card-border,#e8e8e8)] px-[18px] first:border-s-0 ${s}`,
20
+ children: [
21
+ /* @__PURE__ */ e("dt", { className: "m-0 min-w-0 break-words", children: /* @__PURE__ */ e(f, { size: "xsmall", color: "secondary", children: o }) }),
22
+ /* @__PURE__ */ p("dd", { className: "m-0 flex min-w-0 items-center text-[length:var(--malachite-font-size-small,13px)] leading-[1.5] font-medium text-[var(--malachite-text-primary,#0a0a0a)] [overflow-wrap:anywhere]", children: [
23
+ t(i) && /* @__PURE__ */ e("span", { className: "me-[8px] flex shrink-0 items-center", children: i }),
24
+ a ? /* @__PURE__ */ e(
25
+ x,
26
+ {
27
+ color: "inherit",
28
+ tooltip: m ? d : c,
29
+ tooltipWhenTruncated: !m,
30
+ tooltipDelay: h,
31
+ focusableTrigger: d !== null && !!c,
32
+ children: l
33
+ }
34
+ ) : /* @__PURE__ */ e("span", { className: "min-w-0", children: l }),
35
+ t(n) && /* @__PURE__ */ e("span", { className: "ms-[4px] flex shrink-0 items-center", children: n })
36
+ ] })
37
+ ]
38
+ }
39
+ );
40
+ }, u = ({
41
+ className: o = "",
42
+ children: s,
43
+ "aria-label": l,
44
+ "aria-labelledby": a
45
+ }) => {
46
+ const r = !!(l || a);
47
+ return (
48
+ // A role on the dl would drop its term/definition semantics.
49
+ /* @__PURE__ */ e(
50
+ "div",
51
+ {
52
+ role: r ? "group" : void 0,
53
+ "aria-label": r && l || void 0,
54
+ "aria-labelledby": r && a || void 0,
55
+ className: `w-full ${o}`,
56
+ children: /* @__PURE__ */ e("dl", { className: "m-0 flex w-full rounded-[10px] bg-[var(--malachite-table-background,#f7f7f7)] py-[11px]", children: s })
57
+ }
58
+ )
59
+ );
60
+ };
61
+ u.Item = v;
62
+ export {
63
+ u as KeyValueStrip,
64
+ u as default
65
+ };
66
+ //# sourceMappingURL=KeyValueStrip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyValueStrip.js","sources":["../../src/components/KeyValueStrip.tsx"],"sourcesContent":["import type React from 'react';\nimport EllipsisText from './Typography/EllipsisText';\nimport Text from './Typography/Text';\nimport { textOf } from './childrenText';\nimport { isRenderableNode } from './renderableNode';\n\nexport interface KeyValueStripProps {\n className?: string;\n children: React.ReactNode;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface KeyValueStripItemProps {\n label: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n /** One line with an ellipsis. Block/flex children clip without one, so use their own truncate. */\n truncate?: boolean;\n /**\n * Needs `truncate`. By default a text value shows in full when cut off; a given tooltip always\n * shows and makes a text value a tab stop. `null` turns it off.\n */\n tooltip?: React.ReactNode;\n /** Before the value, never truncated, e.g. an icon. */\n prefix?: React.ReactNode;\n /** After the value, never truncated, e.g. a copy button. */\n suffix?: React.ReactNode;\n}\n\n// Faster than Tooltip's 1s: a strip is read by hovering along it.\nconst TOOLTIP_DELAY_S = 0.2;\n\nconst Item: React.FC<KeyValueStripItemProps> = ({\n label,\n className = '',\n children,\n truncate = false,\n tooltip,\n prefix,\n suffix,\n}) => {\n const ownTooltip = tooltip !== undefined;\n const given = isRenderableNode(tooltip) ? tooltip : null;\n const text = textOf(children);\n return (\n <div\n className={`flex min-w-0 flex-1 basis-0 flex-col gap-[3px] border-0 border-s border-solid border-[var(--malachite-card-border,#e8e8e8)] px-[18px] first:border-s-0 ${className}`}\n >\n <dt className=\"m-0 min-w-0 break-words\">\n <Text size=\"xsmall\" color=\"secondary\">\n {label}\n </Text>\n </dt>\n <dd className=\"m-0 flex min-w-0 items-center text-[length:var(--malachite-font-size-small,13px)] leading-[1.5] font-medium text-[var(--malachite-text-primary,#0a0a0a)] [overflow-wrap:anywhere]\">\n {isRenderableNode(prefix) && (\n <span className=\"me-[8px] flex shrink-0 items-center\">{prefix}</span>\n )}\n {truncate ? (\n <EllipsisText\n color=\"inherit\"\n tooltip={ownTooltip ? given : text}\n tooltipWhenTruncated={!ownTooltip}\n tooltipDelay={TOOLTIP_DELAY_S}\n focusableTrigger={given !== null && !!text}\n >\n {children}\n </EllipsisText>\n ) : (\n <span className=\"min-w-0\">{children}</span>\n )}\n {isRenderableNode(suffix) && (\n <span className=\"ms-[4px] flex shrink-0 items-center\">{suffix}</span>\n )}\n </dd>\n </div>\n );\n};\n\n/**\n * Label/value cells in one sunken band, e.g. the facts under a side panel header. Not for table\n * rows: a given tooltip mounts up front.\n */\nconst KeyValueStrip: React.FC<KeyValueStripProps> & { Item: typeof Item } = ({\n className = '',\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}) => {\n const named = !!(ariaLabel || ariaLabelledBy);\n return (\n // A role on the dl would drop its term/definition semantics.\n <div\n role={named ? 'group' : undefined}\n aria-label={named ? ariaLabel || undefined : undefined}\n aria-labelledby={named ? ariaLabelledBy || undefined : undefined}\n className={`w-full ${className}`}\n >\n <dl className=\"m-0 flex w-full rounded-[10px] bg-[var(--malachite-table-background,#f7f7f7)] py-[11px]\">\n {children}\n </dl>\n </div>\n );\n};\n\nKeyValueStrip.Item = Item;\n\nexport default KeyValueStrip;\nexport { KeyValueStrip };\n"],"names":["TOOLTIP_DELAY_S","Item","label","className","children","truncate","tooltip","prefix","suffix","ownTooltip","given","isRenderableNode","text","textOf","jsxs","jsx","Text","EllipsisText","KeyValueStrip","ariaLabel","ariaLabelledBy","named"],"mappings":";;;;;AA+BA,MAAMA,IAAkB,KAElBC,IAAyC,CAAC;AAAA,EAC5C,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AACJ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KAAkB;AAAA,QAC3C,WAAW,UAAUjB,CAAS;AAAA,QAE9B,UAAA,gBAAAY,EAAC,MAAA,EAAG,WAAU,2FACT,UAAAX,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA;AAGZ;AAEAc,EAAc,OAAOjB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PillButton.js","sources":["../../src/components/PillButton.tsx"],"sourcesContent":["import React from 'react';\nimport { FOCUS_RING } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { safeHref } from './safeHref';\n\ntype PillButtonSize = 'xsmall' | 'small' | 'medium';\ntype PillButtonVariant = 'default' | 'inverted';\n/**\n * `tab` squares the top corners so the pill reads as attached to whatever sits above it —\n * a row of controls hanging under an input, rather than free-floating pills.\n */\ntype PillButtonShape = 'pill' | 'tab';\n/**\n * `assistant` is the chrome for AI-authored chips (e.g. `ChangeReview.Jump`): a fixed\n * violet-on-white look with its own border, independent of `variant`/`selected`.\n */\ntype PillButtonTone = 'default' | 'assistant';\n\ninterface PillButtonProps {\n label: string;\n icon?: React.ReactNode;\n className?: string;\n selected?: boolean;\n disabled?: boolean;\n interactive?: boolean;\n size?: PillButtonSize;\n variant?: PillButtonVariant;\n shape?: PillButtonShape;\n tone?: PillButtonTone;\n /** Sits after the label — a caret on a pill that opens a menu. */\n trailingIcon?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Renders the pill as a real anchor, so a link pill keeps cmd-click, copy-link and the status bar. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\nconst BASE_CLASSES =\n 'inline-flex items-center justify-center gap-1.5 font-medium whitespace-nowrap shrink-0 transition-colors duration-150 ease-in-out';\n\nconst SHAPE_CLASSES: Record<PillButtonShape, string> = {\n pill: 'rounded-[var(--malachite-radius-10,10px)]',\n tab: 'rounded-b-[var(--malachite-radius-10,10px)] rounded-t-none',\n};\n\n// Box-sizing is border-box, so trading `border-0` for a 1px border only eats into the padding\n// box — it never grows the element past the `h-[...]` each size already fixes. Only one of these\n// ever applies per render, so there's no `border-0`/`border` class collision to referee.\nconst TONE_BORDER_CLASSES: Record<PillButtonTone, string> = {\n default: 'border-0',\n assistant: 'border border-solid border-[var(--malachite-tag-assistant-border)]',\n};\n\nconst ASSISTANT_COLORS =\n 'bg-[var(--malachite-card-background)] text-[var(--malachite-assistant-foreground)]';\n\nconst SIZE_CLASSES: Record<\n PillButtonSize,\n { text: string; padding: string; paddingWithIcon: string }\n> = {\n // For a row that labels other content rather than being read on its own — a context\n // strip above a chat, say. The only size that drops below the 13px the others share.\n xsmall: {\n text: 'text-[length:var(--malachite-font-size-xsmall,11px)] h-[22px] leading-none',\n padding: 'px-2',\n paddingWithIcon: 'pl-1 pr-1.5',\n },\n small: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-small,28px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n medium: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-medium,32px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n};\n\nconst STATIC_COLORS =\n 'bg-[var(--malachite-pillbutton-static-background)] text-[var(--malachite-pillbutton-static-foreground)]';\n\nconst CLICKABLE_TAIL = 'active:opacity-60 cursor-pointer';\n\nconst VARIANT_COLORS: Record<PillButtonVariant, { base: string; selected: string; hover: string }> =\n {\n default: {\n base: 'bg-[var(--malachite-pillbutton-background)] text-[var(--malachite-pillbutton-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-hover-background)] text-[var(--malachite-pillbutton-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-hover-background)] hover:text-[var(--malachite-pillbutton-hover-foreground)] active:bg-[var(--malachite-pillbutton-pressed-background)] active:text-[var(--malachite-pillbutton-pressed-foreground)]',\n },\n inverted: {\n base: 'bg-[var(--malachite-pillbutton-inverted-background)] text-[var(--malachite-pillbutton-inverted-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-inverted-hover-background)] text-[var(--malachite-pillbutton-inverted-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-inverted-hover-background)] hover:text-[var(--malachite-pillbutton-inverted-hover-foreground)] active:bg-[var(--malachite-pillbutton-inverted-pressed-background)] active:text-[var(--malachite-pillbutton-inverted-pressed-foreground)]',\n },\n };\n\nexport const PillButton: React.FC<PillButtonProps> = ({\n label = 'Label',\n icon,\n className = '',\n selected = false,\n disabled = false,\n interactive = true,\n size = 'small',\n variant = 'default',\n shape = 'pill',\n tone = 'default',\n trailingIcon,\n onClick,\n href,\n target,\n rel,\n}) => {\n const sizeBlock = SIZE_CLASSES[size];\n const padding = icon ? sizeBlock.paddingWithIcon : sizeBlock.padding;\n const variantBlock = VARIANT_COLORS[variant];\n const isInteractiveLook = interactive && !disabled;\n // A rejected href (e.g. `javascript:`) takes the button or static path, never an anchor.\n const linkHref = safeHref(href);\n const isClickable = isInteractiveLook && (!!onClick || !!linkHref);\n const clickableTail = isClickable ? ` ${CLICKABLE_TAIL}` : '';\n\n let colorClasses: string;\n if (tone === 'assistant') {\n // Assistant chips read the same in every interaction state — the click affordance is\n // the shared `active:opacity-60` from `clickableTail`, not a colour swap.\n colorClasses = isClickable ? `${ASSISTANT_COLORS}${clickableTail}` : ASSISTANT_COLORS;\n } else if (!interactive) {\n colorClasses = STATIC_COLORS;\n } else if (selected) {\n colorClasses = isInteractiveLook\n ? `${variantBlock.selected}${clickableTail}`\n : variantBlock.selected;\n } else if (isInteractiveLook) {\n colorClasses = `${variantBlock.base} ${variantBlock.hover}${clickableTail}`;\n } else {\n colorClasses = variantBlock.base;\n }\n\n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed pointer-events-none' : '';\n\n const merged = `${BASE_CLASSES} ${SHAPE_CLASSES[shape]} ${sizeBlock.text} ${padding} ${TONE_BORDER_CLASSES[tone]} ${colorClasses} ${disabledClasses} ${className}`;\n\n const iconSlot = icon ? (\n <span className=\"inline-flex items-center justify-center w-4 h-4 shrink-0 [&>img]:max-w-full [&>img]:max-h-full [&>img]:object-contain\">\n {icon}\n </span>\n ) : null;\n\n const trailingSlot = trailingIcon ? (\n <span className=\"inline-flex shrink-0 items-center justify-center\">{trailingIcon}</span>\n ) : null;\n\n // An anchor cannot be disabled, so a disabled link pill falls through to the static one.\n if (isClickable && linkHref) {\n return (\n <a\n href={linkHref}\n target={target}\n rel={resolveRel(rel, target)}\n className={`${FOCUS_RING} ${merged} no-underline`}\n onClick={onClick}\n >\n {iconSlot}\n {label}\n {trailingSlot}\n </a>\n );\n }\n\n if (isClickable) {\n return (\n <button type=\"button\" className={`${FOCUS_RING} ${merged}`} onClick={onClick}>\n {iconSlot}\n {label}\n {trailingSlot}\n </button>\n );\n }\n\n return (\n <div className={merged}>\n {iconSlot}\n {label}\n {trailingSlot}\n </div>\n );\n};\n\nexport default PillButton;\n"],"names":["BASE_CLASSES","SHAPE_CLASSES","TONE_BORDER_CLASSES","ASSISTANT_COLORS","SIZE_CLASSES","STATIC_COLORS","CLICKABLE_TAIL","VARIANT_COLORS","PillButton","label","icon","className","selected","disabled","interactive","size","variant","shape","tone","trailingIcon","onClick","href","target","rel","sizeBlock","padding","variantBlock","isInteractiveLook","linkHref","safeHref","isClickable","clickableTail","colorClasses","disabledClasses","merged","iconSlot","jsx","trailingSlot","jsxs","resolveRel","FOCUS_RING"],"mappings":";;;;AAsCA,MAAMA,IACF,qIAEEC,IAAiD;AAAA,EACnD,MAAM;AAAA,EACN,KAAK;AACT,GAKMC,IAAsD;AAAA,EACxD,SAAS;AAAA,EACT,WAAW;AACf,GAEMC,IACF,sFAEEC,IAGF;AAAA;AAAA;AAAA,EAGA,QAAQ;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,iBAAiB;AAAA,EAAA;AAAA,EAErB,OAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA,IACT,iBAAiB;AAAA,EAAA;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sDAAsD,IAEnFqB,IAAS,GAAGlC,CAAY,IAAIC,EAAcgB,CAAK,CAAC,IAAIO,EAAU,IAAI,IAAIC,CAAO,IAAIvB,EAAoBgB,CAAI,CAAC,IAAIc,CAAY,IAAIC,CAAe,IAAItB,CAAS,IAE1JwB,IAAWzB,IACb,gBAAA0B,EAAC,UAAK,WAAU,yHACX,aACL,IACA,MAEEC,IAAelB,IACjB,gBAAAiB,EAAC,UAAK,WAAU,oDAAoD,aAAa,IACjF;AAGJ,SAAIN,KAAeF,IAEX,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAMV;AAAA,MACN,QAAAN;AAAA,MACA,KAAKiB,EAAWhB,GAAKD,CAAM;AAAA,MAC3B,WAAW,GAAGkB,CAAU,IAAIN,CAAM;AAAA,MAClC,SAAAd;AAAA,MAEC,UAAA;AAAA,QAAAe;AAAA,QACA1B;AAAA,QACA4B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAKTP,IAEI,gBAAAQ,EAAC,UAAA,EAAO,MAAK,UAAS,WAAW,GAAGE,CAAU,IAAIN,CAAM,IAAI,SAAAd,GACvD,UAAA;AAAA,IAAAe;AAAA,IACA1B;AAAA,IACA4B;AAAA,EAAA,GACL,IAKJ,gBAAAC,EAAC,OAAA,EAAI,WAAWJ,GACX,UAAA;AAAA,IAAAC;AAAA,IACA1B;AAAA,IACA4B;AAAA,EAAA,GACL;AAER;"}
1
+ {"version":3,"file":"PillButton.js","sources":["../../src/components/PillButton.tsx"],"sourcesContent":["import React from 'react';\nimport { FOCUS_RING } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { safeHref } from './safeHref';\n\ntype PillButtonSize = 'xsmall' | 'small' | 'medium';\ntype PillButtonVariant = 'default' | 'inverted';\n/**\n * `tab` squares the top corners so the pill reads as attached to whatever sits above it —\n * a row of controls hanging under an input, rather than free-floating pills.\n */\ntype PillButtonShape = 'pill' | 'tab';\n/**\n * `assistant` is the chrome for AI-authored chips (e.g. `ChangeReview.Jump`): a fixed\n * violet-on-white look with its own border, independent of `variant`/`selected`.\n */\ntype PillButtonTone = 'default' | 'assistant';\n\ninterface PillButtonProps {\n label: string;\n icon?: React.ReactNode;\n className?: string;\n selected?: boolean;\n disabled?: boolean;\n interactive?: boolean;\n size?: PillButtonSize;\n variant?: PillButtonVariant;\n shape?: PillButtonShape;\n tone?: PillButtonTone;\n /** Sits after the label — a caret on a pill that opens a menu. */\n trailingIcon?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Renders the pill as a real anchor, so a link pill keeps cmd-click, copy-link and the status bar. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\nconst BASE_CLASSES =\n 'inline-flex items-center justify-center gap-1.5 font-medium whitespace-nowrap shrink-0 transition-colors duration-150 ease-in-out';\n\nconst SHAPE_CLASSES: Record<PillButtonShape, string> = {\n pill: 'rounded-[var(--malachite-radius-10,10px)]',\n tab: 'rounded-b-[var(--malachite-radius-10,10px)] rounded-t-none',\n};\n\n// Box-sizing is border-box, so trading `border-0` for a 1px border only eats into the padding\n// box — it never grows the element past the fixed height each size already sets. Only one of these\n// ever applies per render, so there's no `border-0`/`border` class collision to referee.\nconst TONE_BORDER_CLASSES: Record<PillButtonTone, string> = {\n default: 'border-0',\n assistant: 'border border-solid border-[var(--malachite-tag-assistant-border)]',\n};\n\nconst ASSISTANT_COLORS =\n 'bg-[var(--malachite-card-background)] text-[var(--malachite-assistant-foreground)]';\n\nconst SIZE_CLASSES: Record<\n PillButtonSize,\n { text: string; padding: string; paddingWithIcon: string }\n> = {\n // For a row that labels other content rather than being read on its own — a context\n // strip above a chat, say. The only size that drops below the 13px the others share.\n xsmall: {\n text: 'text-[length:var(--malachite-font-size-xsmall,11px)] h-[22px] leading-none',\n padding: 'px-2',\n paddingWithIcon: 'pl-1 pr-1.5',\n },\n small: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-small,28px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n medium: {\n text: 'text-[length:var(--malachite-font-size-small,13px)] h-[var(--malachite-control-height-medium,32px)] leading-none',\n padding: 'px-2.5',\n paddingWithIcon: 'pl-1.5 pr-2',\n },\n};\n\nconst STATIC_COLORS =\n 'bg-[var(--malachite-pillbutton-static-background)] text-[var(--malachite-pillbutton-static-foreground)]';\n\nconst CLICKABLE_TAIL = 'active:opacity-60 cursor-pointer';\n\nconst VARIANT_COLORS: Record<PillButtonVariant, { base: string; selected: string; hover: string }> =\n {\n default: {\n base: 'bg-[var(--malachite-pillbutton-background)] text-[var(--malachite-pillbutton-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-hover-background)] text-[var(--malachite-pillbutton-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-hover-background)] hover:text-[var(--malachite-pillbutton-hover-foreground)] active:bg-[var(--malachite-pillbutton-pressed-background)] active:text-[var(--malachite-pillbutton-pressed-foreground)]',\n },\n inverted: {\n base: 'bg-[var(--malachite-pillbutton-inverted-background)] text-[var(--malachite-pillbutton-inverted-foreground)]',\n selected:\n 'bg-[var(--malachite-pillbutton-inverted-hover-background)] text-[var(--malachite-pillbutton-inverted-hover-foreground)]',\n hover: 'hover:bg-[var(--malachite-pillbutton-inverted-hover-background)] hover:text-[var(--malachite-pillbutton-inverted-hover-foreground)] active:bg-[var(--malachite-pillbutton-inverted-pressed-background)] active:text-[var(--malachite-pillbutton-inverted-pressed-foreground)]',\n },\n };\n\nexport const PillButton: React.FC<PillButtonProps> = ({\n label = 'Label',\n icon,\n className = '',\n selected = false,\n disabled = false,\n interactive = true,\n size = 'small',\n variant = 'default',\n shape = 'pill',\n tone = 'default',\n trailingIcon,\n onClick,\n href,\n target,\n rel,\n}) => {\n const sizeBlock = SIZE_CLASSES[size];\n const padding = icon ? sizeBlock.paddingWithIcon : sizeBlock.padding;\n const variantBlock = VARIANT_COLORS[variant];\n const isInteractiveLook = interactive && !disabled;\n // A rejected href (e.g. `javascript:`) takes the button or static path, never an anchor.\n const linkHref = safeHref(href);\n const isClickable = isInteractiveLook && (!!onClick || !!linkHref);\n const clickableTail = isClickable ? ` ${CLICKABLE_TAIL}` : '';\n\n let colorClasses: string;\n if (tone === 'assistant') {\n // Assistant chips read the same in every interaction state — the click affordance is\n // the shared `active:opacity-60` from `clickableTail`, not a colour swap.\n colorClasses = isClickable ? `${ASSISTANT_COLORS}${clickableTail}` : ASSISTANT_COLORS;\n } else if (!interactive) {\n colorClasses = STATIC_COLORS;\n } else if (selected) {\n colorClasses = isInteractiveLook\n ? `${variantBlock.selected}${clickableTail}`\n : variantBlock.selected;\n } else if (isInteractiveLook) {\n colorClasses = `${variantBlock.base} ${variantBlock.hover}${clickableTail}`;\n } else {\n colorClasses = variantBlock.base;\n }\n\n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed pointer-events-none' : '';\n\n const merged = `${BASE_CLASSES} ${SHAPE_CLASSES[shape]} ${sizeBlock.text} ${padding} ${TONE_BORDER_CLASSES[tone]} ${colorClasses} ${disabledClasses} ${className}`;\n\n const iconSlot = icon ? (\n <span className=\"inline-flex items-center justify-center w-4 h-4 shrink-0 [&>img]:max-w-full [&>img]:max-h-full [&>img]:object-contain\">\n {icon}\n </span>\n ) : null;\n\n const trailingSlot = trailingIcon ? (\n <span className=\"inline-flex shrink-0 items-center justify-center\">{trailingIcon}</span>\n ) : null;\n\n // An anchor cannot be disabled, so a disabled link pill falls through to the static one.\n if (isClickable && linkHref) {\n return (\n <a\n href={linkHref}\n target={target}\n rel={resolveRel(rel, target)}\n className={`${FOCUS_RING} ${merged} no-underline`}\n onClick={onClick}\n >\n {iconSlot}\n {label}\n {trailingSlot}\n </a>\n );\n }\n\n if (isClickable) {\n return (\n <button type=\"button\" className={`${FOCUS_RING} ${merged}`} onClick={onClick}>\n {iconSlot}\n {label}\n {trailingSlot}\n </button>\n );\n }\n\n return (\n <div className={merged}>\n {iconSlot}\n {label}\n {trailingSlot}\n </div>\n );\n};\n\nexport default PillButton;\n"],"names":["BASE_CLASSES","SHAPE_CLASSES","TONE_BORDER_CLASSES","ASSISTANT_COLORS","SIZE_CLASSES","STATIC_COLORS","CLICKABLE_TAIL","VARIANT_COLORS","PillButton","label","icon","className","selected","disabled","interactive","size","variant","shape","tone","trailingIcon","onClick","href","target","rel","sizeBlock","padding","variantBlock","isInteractiveLook","linkHref","safeHref","isClickable","clickableTail","colorClasses","disabledClasses","merged","iconSlot","jsx","trailingSlot","jsxs","resolveRel","FOCUS_RING"],"mappings":";;;;AAsCA,MAAMA,IACF,qIAEEC,IAAiD;AAAA,EACnD,MAAM;AAAA,EACN,KAAK;AACT,GAKMC,IAAsD;AAAA,EACxD,SAAS;AAAA,EACT,WAAW;AACf,GAEMC,IACF,sFAEEC,IAGF;AAAA;AAAA;AAAA,EAGA,QAAQ;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,iBAAiB;AAAA,EAAA;AAAA,EAErB,OAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA,IACT,iBAAiB;AAAA,EAAA;AAAA,EAErB,QAAQ;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,iBAAiB;AAAA,EAAA;AAEzB,GAEMC,IACF,2GAEEC,IAAiB,oCAEjBC,IACF;AAAA,EACI,SAAS;AAAA,IACL,MAAM;AAAA,IACN,UACI;AAAA,IACJ,OAAO;AAAA,EAAA;AAAA,EAEX,UAAU;AAAA,IACN,MAAM;AAAA,IACN,UACI;AAAA,IACJ,OAAO;AAAA,EAAA;AAEf,GAESC,IAAwC,CAAC;AAAA,EAClD,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EACd,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EAC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QACA1B;AAAA,QACA4B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAKTP,IAEI,gBAAAQ,EAAC,UAAA,EAAO,MAAK,UAAS,WAAW,GAAGE,CAAU,IAAIN,CAAM,IAAI,SAAAd,GACvD,UAAA;AAAA,IAAAe;AAAA,IACA1B;AAAA,IACA4B;AAAA,EAAA,GACL,IAKJ,gBAAAC,EAAC,OAAA,EAAI,WAAWJ,GACX,UAAA;AAAA,IAAAC;AAAA,IACA1B;AAAA,IACA4B;AAAA,EAAA,GACL;AAER;"}
@@ -67,7 +67,7 @@ const N = {
67
67
  },
68
68
  className: `${w} ${j} ${d.text} ${d.item} ${i} ${x ? "flex-1" : ""} ${e.disabled && !r ? "opacity-50 cursor-not-allowed" : ""}`,
69
69
  style: {
70
- // Inline rather than a `shadow-[...]` class: Tailwind's shadow
70
+ // Inline rather than a Tailwind shadow class: Tailwind's shadow
71
71
  // utilities compose `--tw-shadow-*` custom properties that rely on
72
72
  // document-level @property registration and silently don't paint
73
73
  // inside a shadow root (same caveat as `ring-*`).
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.js","sources":["../../src/components/SegmentedControl.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { FOCUS_RING } from './focusRing';\nimport { nextRovingIndex, rovingTabStop } from './rovingKeys';\n\ntype SegmentedControlSize = 'small' | 'medium' | 'large';\n\ninterface SegmentedControlOption<T extends string = string> {\n value: T;\n label: string;\n icon?: React.ReactNode;\n /**\n * Small mark after the label, e.g. a compact `Tag` naming a saving. It renders inside\n * the segment's `<button>`, so it must not be interactive — no `onClick` or `onRemove`.\n */\n badge?: React.ReactNode;\n disabled?: boolean;\n}\n\ninterface SegmentedControlProps<T extends string = string> {\n options: SegmentedControlOption<T>[];\n /** The selected option's value. A value not present in `options` renders nothing selected. */\n value: T;\n onChange: (value: T) => void;\n size?: SegmentedControlSize;\n /** Stretch the track to its container and split it into equal segments. */\n fullWidth?: boolean;\n /** Disables every segment. Individual segments can also be disabled via `options`. */\n disabled?: boolean;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n}\n\n// The ladder governs a control's outer box. The height therefore sits on the track and\n// the items fill whatever the 4px inset leaves — putting it on the item instead makes a\n// `medium` segmented control 40px tall beside a 32px Dropdown.\nconst SIZE_CLASSES: Record<SegmentedControlSize, { text: string; track: string; item: string }> = {\n small: {\n text: 'text-[length:var(--malachite-font-size-small,13px)]',\n track: 'h-[var(--malachite-control-height-small,28px)]',\n item: 'h-full px-2.5',\n },\n medium: {\n text: 'text-[length:var(--malachite-font-size-small,13px)]',\n track: 'h-[var(--malachite-control-height-medium,32px)]',\n item: 'h-full px-2.5',\n },\n large: {\n text: 'text-[length:var(--malachite-font-size-15,15px)]',\n track: 'h-[var(--malachite-control-height-large,42px)]',\n item: 'h-full px-4',\n },\n};\n\n// Deliberately no `bg-*` here: each state branch below supplies exactly one\n// background-color utility. Both `bg-transparent` and `bg-[var(--…)]` are plain\n// single-class utilities in the same `@layer utilities`, so an element carrying both\n// resolves by stylesheet order — and the arbitrary value loses, silently rendering the\n// selected thumb transparent.\nconst ITEM_BASE =\n 'inline-flex items-center justify-center gap-1.5 rounded-[var(--malachite-radius-10,10px)] border-0 font-medium tracking-[0.13px] whitespace-nowrap transition-colors duration-150 ease-in-out';\n\n/**\n * A rounded track of mutually-exclusive options — the segmented \"one of these\" control.\n *\n * Owns the track background, the selected-thumb chrome and the radiogroup semantics in\n * one place, so consumers never hand-roll a track around `PillButton` (whose `default`\n * variant tokens are tuned for standalone filter pills, not for a sunken track).\n *\n * Selection is conveyed non-visually via `role=\"radio\"` + `aria-checked`, and by a\n * foreground-colour change as well as the thumb, so it does not rest on background\n * colour alone.\n */\nconst SegmentedControl = <T extends string = string>({\n options,\n value,\n onChange,\n size = 'medium',\n fullWidth = false,\n disabled = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n}: SegmentedControlProps<T>) => {\n const itemRefs = useRef<(HTMLButtonElement | null)[]>([]);\n const sizeBlock = SIZE_CLASSES[size];\n\n const selectedIndex = options.findIndex((option) => option.value === value);\n const enabled = options.map((option) => !option.disabled);\n // Roving tabindex: the group is a single tab stop. When the selected option is\n // missing or disabled, the first enabled option takes the stop so the control is\n // still reachable by keyboard.\n const tabStopIndex = rovingTabStop(selectedIndex, enabled);\n\n // Arrow keys move AND select, per the WAI-ARIA radiogroup pattern, from the focused option.\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (disabled) {\n return;\n }\n const focused = itemRefs.current.findIndex((item) => item === event.target);\n const next = nextRovingIndex(event, focused >= 0 ? focused : tabStopIndex, enabled);\n if (next === undefined) {\n return;\n }\n\n // Only once we know we'll act — otherwise Home/End etc. should still scroll.\n event.preventDefault();\n if (options[next].value !== value) {\n onChange(options[next].value);\n }\n itemRefs.current[next]?.focus();\n };\n\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n className={`${\n // One display utility, not two: `flex` and `inline-flex` are both plain\n // `display` utilities, so emitting both would resolve by stylesheet order\n // (same hazard as the background above).\n fullWidth ? 'flex w-full' : 'inline-flex'\n } ${sizeBlock.track} items-center gap-1 p-0.5 rounded-xl bg-[var(--malachite-segmented-control-track-background)] ${\n disabled ? 'opacity-50' : ''\n } ${className}`}\n >\n {options.map((option, index) => {\n const isSelected = option.value === value;\n const isDisabled = disabled || option.disabled;\n const hasBadge =\n option.badge !== undefined && option.badge !== null && option.badge !== false;\n\n let colorClasses: string;\n if (isSelected) {\n colorClasses =\n 'bg-[var(--malachite-segmented-control-selected-background)] text-[var(--malachite-segmented-control-selected-foreground)]';\n } else if (isDisabled) {\n colorClasses =\n 'bg-transparent text-[var(--malachite-segmented-control-item-foreground)]';\n } else {\n colorClasses =\n 'bg-transparent text-[var(--malachite-segmented-control-item-foreground)] hover:text-[var(--malachite-segmented-control-item-hover-foreground)] cursor-pointer';\n }\n\n return (\n <button\n key={option.value}\n ref={(element) => {\n itemRefs.current[index] = element;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n disabled={isDisabled}\n tabIndex={index === tabStopIndex ? 0 : -1}\n onClick={() => {\n // Radios don't toggle off on re-click.\n if (!isDisabled && !isSelected) {\n onChange(option.value);\n }\n }}\n className={`${FOCUS_RING} ${ITEM_BASE} ${sizeBlock.text} ${sizeBlock.item} ${colorClasses} ${\n fullWidth ? 'flex-1' : ''\n } ${option.disabled && !disabled ? 'opacity-50 cursor-not-allowed' : ''}`}\n style={{\n // Inline rather than a `shadow-[...]` class: Tailwind's shadow\n // utilities compose `--tw-shadow-*` custom properties that rely on\n // document-level @property registration and silently don't paint\n // inside a shadow root (same caveat as `ring-*`).\n boxShadow: isSelected\n ? 'var(--malachite-segmented-control-selected-shadow, 0px 1px 5px 0px rgba(0, 0, 0, 0.1))'\n : undefined,\n }}\n >\n {option.icon ? (\n <span className=\"inline-flex items-center justify-center w-4 h-4 shrink-0\">\n {option.icon}\n </span>\n ) : null}\n {option.label}\n {/* The space keeps the name \"Annual Save\" rather than \"AnnualSave\";\n the flex gap already spaces the two visually. */}\n {hasBadge ? ' ' : null}\n {hasBadge ? (\n <span className=\"inline-flex items-center shrink-0\">\n {option.badge}\n </span>\n ) : null}\n </button>\n );\n })}\n </div>\n );\n};\n\nexport default SegmentedControl;\nexport { SegmentedControl };\nexport type { SegmentedControlProps, SegmentedControlOption, SegmentedControlSize };\n"],"names":["SIZE_CLASSES","ITEM_BASE","SegmentedControl","options","value","onChange","size","fullWidth","disabled","ariaLabel","ariaLabelledBy","className","itemRefs","useRef","sizeBlock","selectedIndex","option","enabled","tabStopIndex","rovingTabStop","jsx","event","focused","item","next","nextRovingIndex","_a","index","isSelected","isDisabled","hasBadge","colorClasses","jsxs","element","FOCUS_RING"],"mappings":";;;;AAoCA,MAAMA,IAA4F;AAAA,EAC9F,OAAO;AAAA,IACH,MAAM;AAAA,IACN,OAAO;A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;"}
1
+ {"version":3,"file":"SegmentedControl.js","sources":["../../src/components/SegmentedControl.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { FOCUS_RING } from './focusRing';\nimport { nextRovingIndex, rovingTabStop } from './rovingKeys';\n\ntype SegmentedControlSize = 'small' | 'medium' | 'large';\n\ninterface SegmentedControlOption<T extends string = string> {\n value: T;\n label: string;\n icon?: React.ReactNode;\n /**\n * Small mark after the label, e.g. a compact `Tag` naming a saving. It renders inside\n * the segment's `<button>`, so it must not be interactive — no `onClick` or `onRemove`.\n */\n badge?: React.ReactNode;\n disabled?: boolean;\n}\n\ninterface SegmentedControlProps<T extends string = string> {\n options: SegmentedControlOption<T>[];\n /** The selected option's value. A value not present in `options` renders nothing selected. */\n value: T;\n onChange: (value: T) => void;\n size?: SegmentedControlSize;\n /** Stretch the track to its container and split it into equal segments. */\n fullWidth?: boolean;\n /** Disables every segment. Individual segments can also be disabled via `options`. */\n disabled?: boolean;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n}\n\n// The ladder governs a control's outer box. The height therefore sits on the track and\n// the items fill whatever the 4px inset leaves — putting it on the item instead makes a\n// `medium` segmented control 40px tall beside a 32px Dropdown.\nconst SIZE_CLASSES: Record<SegmentedControlSize, { text: string; track: string; item: string }> = {\n small: {\n text: 'text-[length:var(--malachite-font-size-small,13px)]',\n track: 'h-[var(--malachite-control-height-small,28px)]',\n item: 'h-full px-2.5',\n },\n medium: {\n text: 'text-[length:var(--malachite-font-size-small,13px)]',\n track: 'h-[var(--malachite-control-height-medium,32px)]',\n item: 'h-full px-2.5',\n },\n large: {\n text: 'text-[length:var(--malachite-font-size-15,15px)]',\n track: 'h-[var(--malachite-control-height-large,42px)]',\n item: 'h-full px-4',\n },\n};\n\n// Deliberately no `bg-*` here: each state branch below supplies exactly one\n// background-color utility. Both `bg-transparent` and an arbitrary-value `bg-` are plain\n// single-class utilities in the same `@layer utilities`, so an element carrying both\n// resolves by stylesheet order — and the arbitrary value loses, silently rendering the\n// selected thumb transparent.\nconst ITEM_BASE =\n 'inline-flex items-center justify-center gap-1.5 rounded-[var(--malachite-radius-10,10px)] border-0 font-medium tracking-[0.13px] whitespace-nowrap transition-colors duration-150 ease-in-out';\n\n/**\n * A rounded track of mutually-exclusive options — the segmented \"one of these\" control.\n *\n * Owns the track background, the selected-thumb chrome and the radiogroup semantics in\n * one place, so consumers never hand-roll a track around `PillButton` (whose `default`\n * variant tokens are tuned for standalone filter pills, not for a sunken track).\n *\n * Selection is conveyed non-visually via `role=\"radio\"` + `aria-checked`, and by a\n * foreground-colour change as well as the thumb, so it does not rest on background\n * colour alone.\n */\nconst SegmentedControl = <T extends string = string>({\n options,\n value,\n onChange,\n size = 'medium',\n fullWidth = false,\n disabled = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n}: SegmentedControlProps<T>) => {\n const itemRefs = useRef<(HTMLButtonElement | null)[]>([]);\n const sizeBlock = SIZE_CLASSES[size];\n\n const selectedIndex = options.findIndex((option) => option.value === value);\n const enabled = options.map((option) => !option.disabled);\n // Roving tabindex: the group is a single tab stop. When the selected option is\n // missing or disabled, the first enabled option takes the stop so the control is\n // still reachable by keyboard.\n const tabStopIndex = rovingTabStop(selectedIndex, enabled);\n\n // Arrow keys move AND select, per the WAI-ARIA radiogroup pattern, from the focused option.\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (disabled) {\n return;\n }\n const focused = itemRefs.current.findIndex((item) => item === event.target);\n const next = nextRovingIndex(event, focused >= 0 ? focused : tabStopIndex, enabled);\n if (next === undefined) {\n return;\n }\n\n // Only once we know we'll act — otherwise Home/End etc. should still scroll.\n event.preventDefault();\n if (options[next].value !== value) {\n onChange(options[next].value);\n }\n itemRefs.current[next]?.focus();\n };\n\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n className={`${\n // One display utility, not two: `flex` and `inline-flex` are both plain\n // `display` utilities, so emitting both would resolve by stylesheet order\n // (same hazard as the background above).\n fullWidth ? 'flex w-full' : 'inline-flex'\n } ${sizeBlock.track} items-center gap-1 p-0.5 rounded-xl bg-[var(--malachite-segmented-control-track-background)] ${\n disabled ? 'opacity-50' : ''\n } ${className}`}\n >\n {options.map((option, index) => {\n const isSelected = option.value === value;\n const isDisabled = disabled || option.disabled;\n const hasBadge =\n option.badge !== undefined && option.badge !== null && option.badge !== false;\n\n let colorClasses: string;\n if (isSelected) {\n colorClasses =\n 'bg-[var(--malachite-segmented-control-selected-background)] text-[var(--malachite-segmented-control-selected-foreground)]';\n } else if (isDisabled) {\n colorClasses =\n 'bg-transparent text-[var(--malachite-segmented-control-item-foreground)]';\n } else {\n colorClasses =\n 'bg-transparent text-[var(--malachite-segmented-control-item-foreground)] hover:text-[var(--malachite-segmented-control-item-hover-foreground)] cursor-pointer';\n }\n\n return (\n <button\n key={option.value}\n ref={(element) => {\n itemRefs.current[index] = element;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n disabled={isDisabled}\n tabIndex={index === tabStopIndex ? 0 : -1}\n onClick={() => {\n // Radios don't toggle off on re-click.\n if (!isDisabled && !isSelected) {\n onChange(option.value);\n }\n }}\n className={`${FOCUS_RING} ${ITEM_BASE} ${sizeBlock.text} ${sizeBlock.item} ${colorClasses} ${\n fullWidth ? 'flex-1' : ''\n } ${option.disabled && !disabled ? 'opacity-50 cursor-not-allowed' : ''}`}\n style={{\n // Inline rather than a Tailwind shadow class: Tailwind's shadow\n // utilities compose `--tw-shadow-*` custom properties that rely on\n // document-level @property registration and silently don't paint\n // inside a shadow root (same caveat as `ring-*`).\n boxShadow: isSelected\n ? 'var(--malachite-segmented-control-selected-shadow, 0px 1px 5px 0px rgba(0, 0, 0, 0.1))'\n : undefined,\n }}\n >\n {option.icon ? (\n <span className=\"inline-flex items-center justify-center w-4 h-4 shrink-0\">\n {option.icon}\n </span>\n ) : null}\n {option.label}\n {/* The space keeps the name \"Annual Save\" rather than \"AnnualSave\";\n the flex gap already spaces the two visually. */}\n {hasBadge ? ' ' : null}\n {hasBadge ? (\n <span className=\"inline-flex items-center shrink-0\">\n {option.badge}\n </span>\n ) : null}\n </button>\n );\n })}\n </div>\n );\n};\n\nexport default SegmentedControl;\nexport { SegmentedControl };\nexport type { SegmentedControlProps, SegmentedControlOption, SegmentedControlSize };\n"],"names":["SIZE_CLASSES","ITEM_BASE","SegmentedControl","options","value","onChange","size","fullWidth","disabled","ariaLabel","ariaLabelledBy","className","itemRefs","useRef","sizeBlock","selectedIndex","option","enabled","tabStopIndex","rovingTabStop","jsx","event","focused","item","next","nextRovingIndex","_a","index","isSelected","isDisabled","hasBadge","colorClasses","jsxs","element","FOCUS_RING"],"mappings":";;;;AAoCA,MAAMA,IAA4F;AAAA,EAC9F,OAAO;AAAA,IACH,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAAA,EAEV,QAAQ;AAAA,IACJ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAAA,EAEV,OAAO;AAAA,IACH,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAEd,GAOMC,IACF,iMAaEC,IAAmB,CAA4B;AAAA,EACjD,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,cAAcC;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAC,IAAY;AAChB,MAAgC;AAC5B,QAAMC,IAAWC,EAAqC,EAAE,GAClDC,IAAYd,EAAaM,CAAI,GAE7BS,IAAgBZ,EAAQ,UAAU,CAACa,MAAWA,EAAO,UAAUZ,CAAK,GACpEa,IAAUd,EAAQ,IAAI,CAACa,MAAW,CAACA,EAAO,QAAQ,GAIlDE,IAAeC,EAAcJ,GAAeE,CAAO;AAq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,IAAIjC,CAAS,IAAIa,EAAU,IAAI,IAAIA,EAAU,IAAI,IAAIiB,CAAY,IACrFxB,IAAY,WAAW,EAC3B,IAAIS,EAAO,YAAY,CAACR,IAAW,kCAAkC,EAAE;AAAA,YACvE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAKH,WAAWoB,IACL,2FACA;AAAA,YAAA;AAAA,YAGT,UAAA;AAAA,cAAAZ,EAAO,OACJ,gBAAAI,EAAC,QAAA,EAAK,WAAU,4DACX,UAAAJ,EAAO,MACZ,IACA;AAAA,cACHA,EAAO;AAAA,cAGPc,IAAW,MAAM;AAAA,cACjBA,IACG,gBAAAV,EAAC,QAAA,EAAK,WAAU,qCACX,UAAAJ,EAAO,OACZ,IACA;AAAA,YAAA;AAAA,UAAA;AAAA,UAzCCA,EAAO;AAAA,QAAA;AAAA,MA4CxB,CAAC;AAAA,IAAA;AAAA,EAAA;AAGb;"}
@@ -1,20 +1,20 @@
1
- import { jsx as m, jsxs as G, Fragment as ae } from "react/jsx-runtime";
2
- import F, { useState as y, useRef as u, useCallback as z, useId as se, useEffect as b, useInsertionEffect as le } from "react";
3
- import { createPortal as ce } from "react-dom";
4
- import { FOCUS_RING as fe } from "./focusRing.js";
5
- import { ensureOverlayStyles as de, overlayIdentity as ue } from "./portalOverlay.js";
6
- import { useTopLayer as me } from "./topLayer.js";
7
- import { useFollowTrigger as pe } from "./useFollowTrigger.js";
8
- const he = new RegExp("(?<=[/\\\\.\\-_?&#=:@])"), ge = (r) => r.split(he).map((a, w) => /* @__PURE__ */ G(F.Fragment, { children: [
1
+ import { jsx as m, jsxs as G, Fragment as se } from "react/jsx-runtime";
2
+ import F, { useState as y, useRef as u, useCallback as z, useId as le, useEffect as b, useInsertionEffect as ce } from "react";
3
+ import { createPortal as fe } from "react-dom";
4
+ import { FOCUS_RING as de } from "./focusRing.js";
5
+ import { ensureOverlayStyles as ue, overlayIdentity as me } from "./portalOverlay.js";
6
+ import { useTopLayer as pe } from "./topLayer.js";
7
+ import { useFollowTrigger as he } from "./useFollowTrigger.js";
8
+ const ge = new RegExp("(?<=[/\\\\.\\-_?&#=:@])"), ve = (r) => r.split(ge).map((a, w) => /* @__PURE__ */ G(F.Fragment, { children: [
9
9
  a,
10
10
  /* @__PURE__ */ m("wbr", {})
11
- ] }, w)), ve = {
11
+ ] }, w)), ye = {
12
12
  minWidth: 0,
13
13
  overflow: "hidden"
14
14
  }, U = {
15
15
  flex: 1,
16
16
  minWidth: 0
17
- }, Y = 8, Ie = ({
17
+ }, Y = 8, Le = ({
18
18
  text: r,
19
19
  children: a,
20
20
  delay: w = 1,
@@ -31,38 +31,38 @@ const he = new RegExp("(?<=[/\\\\.\\-_?&#=:@])"), ge = (r) => r.split(he).map((a
31
31
  showOnFocus: c = !0,
32
32
  focusableTrigger: h = !1
33
33
  }) => {
34
- const X = $ || R ? { ...$ ? ve : {}, ...R ? U : {} } : void 0, [t, f] = y(!1), [g, D] = y(h), v = u(null), s = u(null), n = z(() => {
34
+ const X = $ || R ? { ...$ ? ye : {}, ...R ? U : {} } : void 0, [t, f] = y(!1), [D, J] = y(!1), g = D || h, v = u(null), s = u(null), n = z(() => {
35
35
  v.current && (clearTimeout(v.current), v.current = null), s.current !== null && (cancelAnimationFrame(s.current), s.current = null);
36
36
  }, []), B = () => {
37
- D(!0), s.current !== null && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => {
37
+ J(!0), s.current !== null && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => {
38
38
  s.current = null, f(!0);
39
39
  });
40
40
  }, E = u(null), d = u(null);
41
- me(E, t);
42
- const _ = se(), l = r != null && r !== "" && r !== !1, J = (e) => {
41
+ pe(E, t);
42
+ const M = le(), l = r != null && r !== "" && r !== !1, Q = (e) => {
43
43
  e.stopPropagation(), !(!l || o || p && !p()) && (n(), v.current = setTimeout(() => {
44
44
  B();
45
45
  }, w * 1e3));
46
- }, Q = (e) => {
46
+ }, Z = (e) => {
47
47
  e.stopPropagation(), n(), f(!1);
48
- }, M = () => {
48
+ }, _ = () => {
49
49
  !c || !l || o || p && !p() || (n(), B());
50
- }, Z = () => {
50
+ }, ee = () => {
51
51
  n(), f(!1);
52
52
  }, C = u(c);
53
53
  b(() => {
54
54
  var i;
55
55
  const e = c && !C.current;
56
- C.current = c, e && ((i = d.current) != null && i.matches(":focus-within")) && M();
56
+ C.current = c, e && ((i = d.current) != null && i.matches(":focus-within")) && _();
57
57
  });
58
- const [ee, te] = y(o);
59
- o !== ee && (te(o), o && f(!1)), b(() => {
58
+ const [te, ne] = y(o);
59
+ o !== te && (ne(o), o && f(!1)), b(() => {
60
60
  o && n();
61
61
  }, [o, n]);
62
- const [, S] = y({}), ne = z(() => {
62
+ const [, S] = y({}), re = z(() => {
63
63
  n(), f(!1);
64
64
  }, [n]);
65
- pe(t, d, () => S({}), ne), b(() => {
65
+ he(t, d, () => S({}), re), b(() => {
66
66
  if (!t)
67
67
  return () => {
68
68
  n();
@@ -76,7 +76,7 @@ const he = new RegExp("(?<=[/\\\\.\\-_?&#=:@])"), ge = (r) => r.split(he).map((a
76
76
  }, [t, n]), b(() => {
77
77
  t && S({});
78
78
  }, [t]);
79
- const re = () => {
79
+ const oe = () => {
80
80
  if (!d.current)
81
81
  return { display: "none" };
82
82
  const e = d.current.getBoundingClientRect(), i = {
@@ -146,39 +146,39 @@ const he = new RegExp("(?<=[/\\\\.\\-_?&#=:@])"), ge = (r) => r.split(he).map((a
146
146
  transform: `translate(-50%, -100%) ${t ? "scale(1)" : "scale(0.95)"}`
147
147
  };
148
148
  }
149
- }, I = l && g && A ? _ : void 0;
150
- le(() => {
151
- l && g && de();
149
+ }, I = l && g && A ? M : void 0;
150
+ ce(() => {
151
+ l && g && ue();
152
152
  }, [l, g]);
153
- const oe = h ? a : O || !F.isValidElement(a) ? /* @__PURE__ */ m("span", { "aria-describedby": I, style: R ? U : void 0, children: a }) : F.cloneElement(a, {
153
+ const ie = h ? a : O || !F.isValidElement(a) ? /* @__PURE__ */ m("span", { "aria-describedby": I, style: R ? U : void 0, children: a }) : F.cloneElement(a, {
154
154
  "aria-describedby": [a.props["aria-describedby"], I].filter(Boolean).join(" ") || void 0
155
- }), ie = W ? "span" : q, P = h && l && !o && c;
156
- return /* @__PURE__ */ G(ae, { children: [
155
+ }), ae = W ? "span" : q, P = h && l && !o && c;
156
+ return /* @__PURE__ */ G(se, { children: [
157
157
  /* @__PURE__ */ m(
158
- ie,
158
+ ae,
159
159
  {
160
160
  ref: d,
161
- className: `relative ${W ? "inline-flex max-w-full align-middle" : "flex"} items-center${P ? ` ${fe}` : ""}`,
161
+ className: `relative ${W ? "inline-flex max-w-full align-middle" : "flex"} items-center${P ? ` ${de}` : ""}`,
162
162
  style: X,
163
163
  tabIndex: P ? 0 : void 0,
164
164
  "aria-describedby": h ? I : void 0,
165
- onMouseEnter: J,
166
- onMouseLeave: Q,
167
- onFocus: M,
168
- onBlur: Z,
169
- children: oe
165
+ onMouseEnter: Q,
166
+ onMouseLeave: Z,
167
+ onFocus: _,
168
+ onBlur: ee,
169
+ children: ie
170
170
  }
171
171
  ),
172
- l && g && ce(
172
+ l && g && fe(
173
173
  /* @__PURE__ */ m(
174
174
  "div",
175
175
  {
176
176
  ref: E,
177
- id: _,
177
+ id: M,
178
178
  role: "tooltip",
179
179
  "aria-hidden": A ? void 0 : !0,
180
- ...ue("tooltip"),
181
- style: re(),
180
+ ...me("tooltip"),
181
+ style: oe(),
182
182
  children: /* @__PURE__ */ m(
183
183
  "span",
184
184
  {
@@ -186,7 +186,7 @@ const he = new RegExp("(?<=[/\\\\.\\-_?&#=:@])"), ge = (r) => r.split(he).map((a
186
186
  minWidth: 0,
187
187
  overflowWrap: "anywhere"
188
188
  },
189
- children: typeof r == "string" ? ge(r) : r
189
+ children: typeof r == "string" ? ve(r) : r
190
190
  }
191
191
  )
192
192
  }
@@ -196,6 +196,6 @@ const he = new RegExp("(?<=[/\\\\.\\-_?&#=:@])"), ge = (r) => r.split(he).map((a
196
196
  ] });
197
197
  };
198
198
  export {
199
- Ie as default
199
+ Le as default
200
200
  };
201
201
  //# sourceMappingURL=Tooltip.js.map