@stackone/malachite 2.137.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.
@@ -0,0 +1,70 @@
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
+ import { Button as p } from "../Button.js";
3
+ import { Checkbox as g } from "../Checkbox.js";
4
+ import w from "../CustomIcons/SliderIcon.js";
5
+ import { Popover as r } from "../Popover.js";
6
+ import { Surface as v } from "../Surface.js";
7
+ import { Typography as x } from "../Typography/index.js";
8
+ import { devWarning as C } from "../devWarning.js";
9
+ const I = ({
10
+ columns: s,
11
+ visibleKeys: f,
12
+ onVisibleKeysChange: k,
13
+ onReset: n,
14
+ label: l = "Columns"
15
+ }) => {
16
+ const d = new Set(f), o = s.filter((e) => e.hideable === !1 && !d.has(e.key)).map((e) => e.key);
17
+ o.length > 0 && C(
18
+ `table-column-picker-locked:${o.join(",")}`,
19
+ `TableColumnPicker \`visibleKeys\` leaves out ${o.map((e) => `\`${e}\``).join(", ")}, a column with \`hideable: false\`, so the table hides a column the picker shows as locked on. Include its key.`
20
+ );
21
+ const a = (e) => e.hideable === !1 || d.has(e.key), m = s.filter(a).length, b = (e) => k(
22
+ s.filter(
23
+ (i) => i.key === e && i.hideable !== !1 ? !a(i) : a(i)
24
+ ).map((i) => i.key)
25
+ );
26
+ return /* @__PURE__ */ t(
27
+ r,
28
+ {
29
+ "aria-label": l,
30
+ placement: "bottom-end",
31
+ padding: "none",
32
+ trigger: /* @__PURE__ */ t(p, { variant: "outline", size: "small", icon: /* @__PURE__ */ t(w, { size: 12 }), children: l }),
33
+ children: /* @__PURE__ */ c("div", { style: { minWidth: 220 }, children: [
34
+ /* @__PURE__ */ t(
35
+ r.Header,
36
+ {
37
+ title: l,
38
+ action: n ? /* @__PURE__ */ t(p, { variant: "ghost", size: "xsmall", onClick: n, children: "Reset" }) : void 0
39
+ }
40
+ ),
41
+ /* @__PURE__ */ t(r.List, { children: s.map((e) => {
42
+ const i = a(e), y = i && m === 1, h = e.hideable === !1 || y;
43
+ return /* @__PURE__ */ t(
44
+ v.Row,
45
+ {
46
+ role: "checkbox",
47
+ selected: i,
48
+ disabled: h,
49
+ onClick: () => b(e.key),
50
+ leading: /* @__PURE__ */ t(g, { checked: i, presentational: !0 }),
51
+ children: h ? (
52
+ // Says why the row cannot be turned off, in its own name.
53
+ /* @__PURE__ */ c("span", { className: "flex items-center justify-between gap-3 w-full", children: [
54
+ /* @__PURE__ */ t("span", { children: e.title }),
55
+ /* @__PURE__ */ t(x.SecondaryText, { size: "small", children: e.hideable === !1 ? "Always shown" : "Last shown" })
56
+ ] })
57
+ ) : e.title
58
+ },
59
+ e.key
60
+ );
61
+ }) })
62
+ ] })
63
+ }
64
+ );
65
+ };
66
+ export {
67
+ I as TableColumnPicker,
68
+ I as default
69
+ };
70
+ //# sourceMappingURL=TableColumnPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableColumnPicker.js","sources":["../../../src/components/Table/TableColumnPicker.tsx"],"sourcesContent":["import type React from 'react';\nimport Button from '../Button';\nimport Checkbox from '../Checkbox';\nimport SliderIcon from '../CustomIcons/SliderIcon';\nimport Popover from '../Popover';\nimport Surface from '../Surface';\nimport Typography from '../Typography';\nimport { devWarning } from '../devWarning';\n\nexport interface TableColumnPickerColumn {\n key: string;\n title: string;\n /** `false` keeps the column shown: it is listed, checked, says it is always shown, and\n * cannot be turned off. */\n hideable?: boolean;\n}\n\nexport interface TableColumnPickerProps {\n columns: readonly TableColumnPickerColumn[];\n /** The keys shown. Controlled. Include every `hideable: false` column's key, or the table\n * filtering by these hides a column the picker shows locked on. */\n visibleKeys: readonly string[];\n onVisibleKeysChange: (keys: string[]) => void;\n /** Shown in the header, to put the defaults back. */\n onReset?: () => void;\n /** The trigger's text and the panel's name. Default \"Columns\". */\n label?: string;\n}\n\n/**\n * Chooses which of a table's columns show. Filter the `columns` passed to `Table` by\n * `visibleKeys`. Every change hands back the keys in `columns` order, locked columns included,\n * so the table's order never depends on the order they were switched on.\n */\nconst TableColumnPicker: React.FC<TableColumnPickerProps> = ({\n columns,\n visibleKeys,\n onVisibleKeysChange,\n onReset,\n label = 'Columns',\n}) => {\n const visible = new Set(visibleKeys);\n const missingLocked = columns\n .filter((column) => column.hideable === false && !visible.has(column.key))\n .map((column) => column.key);\n if (missingLocked.length > 0) {\n devWarning(\n `table-column-picker-locked:${missingLocked.join(',')}`,\n `TableColumnPicker \\`visibleKeys\\` leaves out ${missingLocked.map((key) => `\\`${key}\\``).join(', ')}, a column with \\`hideable: false\\`, so the table hides a column the picker shows as locked on. Include its key.`,\n );\n }\n const isShown = (column: TableColumnPickerColumn): boolean =>\n column.hideable === false || visible.has(column.key);\n // A table needs a column, so the only one shown cannot be turned off.\n const shownCount = columns.filter(isShown).length;\n // Rebuilt from `columns`, so the keys come back in column order, a locked column always\n // among them, and a key naming no column dropped.\n const toggle = (key: string): void =>\n onVisibleKeysChange(\n columns\n .filter((column) =>\n column.key === key && column.hideable !== false\n ? !isShown(column)\n : isShown(column),\n )\n .map((column) => column.key),\n );\n\n return (\n <Popover\n aria-label={label}\n placement=\"bottom-end\"\n padding=\"none\"\n trigger={\n <Button variant=\"outline\" size=\"small\" icon={<SliderIcon size={12} />}>\n {label}\n </Button>\n }\n >\n <div style={{ minWidth: 220 }}>\n <Popover.Header\n title={label}\n action={\n onReset ? (\n <Button variant=\"ghost\" size=\"xsmall\" onClick={onReset}>\n Reset\n </Button>\n ) : undefined\n }\n />\n <Popover.List>\n {columns.map((column) => {\n const checked = isShown(column);\n const lastShown = checked && shownCount === 1;\n const locked = column.hideable === false || lastShown;\n return (\n <Surface.Row\n key={column.key}\n role=\"checkbox\"\n selected={checked}\n disabled={locked}\n onClick={() => toggle(column.key)}\n leading={<Checkbox checked={checked} presentational />}\n >\n {locked ? (\n // Says why the row cannot be turned off, in its own name.\n <span className=\"flex items-center justify-between gap-3 w-full\">\n <span>{column.title}</span>\n <Typography.SecondaryText size=\"small\">\n {column.hideable === false\n ? 'Always shown'\n : 'Last shown'}\n </Typography.SecondaryText>\n </span>\n ) : (\n column.title\n )}\n </Surface.Row>\n );\n })}\n </Popover.List>\n </div>\n </Popover>\n );\n};\n\nexport default TableColumnPicker;\nexport { TableColumnPicker };\n"],"names":["TableColumnPicker","columns","visibleKeys","onVisibleKeysChange","onReset","label","visible","missingLocked","column","devWarning","key","isShown","shownCount","toggle","jsx","Popover","Button","SliderIcon","checked","lastShown","locked","Surface","Checkbox","jsxs","Typography"],"mappings":";;;;;;;;AAkCA,MAAMA,IAAsD,CAAC;AAAA,EACzD,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC,IAAQ;AACZ,MAAM;AACF,QAAMC,IAAU,IAAI,IAAIJ,CAAW,GAC7BK,IAAgBN,EACjB,OAAO,CAACO,MAAWA,EAAO,aAAa,MAAS,CAACF,EAAQ,IAAIE,EAAO,GAAG,CAAC,EACxE,IAAI,CAACA,MAAWA,EAAO,GAAG;AAC/B,EAAID,EAAc,SAAS,KACvBE;AAAA,IACI,8BAA8BF,EAAc,KAAK,GAAG,CAAC;AAAA,IACrD,gDAAgDA,EAAc,IAAI,CAACG,MAAQ,KAAKA,CAAG,IAAI,EAAE,KAAK,IAAI,CAAC;AAAA,EAAA;AAG3G,QAAMC,IAAU,CAACH,MACbA,EAAO,aAAa,MAASF,EAAQ,IAAIE,EAAO,GAAG,GAEjDI,IAAaX,EAAQ,OAAOU,CAAO,EAAE,QAGrCE,IAAS,CAACH,MACZP;AAAA,IACIF,EACK;AAAA,MAAO,CAACO,MACLA,EAAO,QAAQE,KAAOF,EAAO,aAAa,KACpC,CAACG,EAAQH,CAAM,IACfG,EAAQH,CAAM;AAAA,IAAA,EAEvB,IAAI,CAACA,MAAWA,EAAO,GAAG;AAAA,EAAA;AAGvC,SACI,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,cAAYV;AAAA,MACZ,WAA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;"}
@@ -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,qCAAqCD,CAAc;AAC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AAA;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
@@ -6372,7 +6372,7 @@ export declare interface TabItem {
6372
6372
  content?: default_2.ReactNode;
6373
6373
  }
6374
6374
 
6375
- export declare const Table: <T = Record<string, unknown>>({ columns, data, loading, loadingRowCount, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, error, errorTitle, errorSubTitle, emptyTitle, emptySubTitle, bordered, showHeader, rowKey, scrollHeight, size, rowDensity, layout, headerVariant, title, subtitle, extra, rowClassName, rowVariant, onRow, onClickRow, selectedRowKey, scrollSelectedIntoView, rowSelection, pagination, className, style, stickyHeaderTop, scrollX, rowSection, renderSectionDivider, onVisibleOrderChange, virtual, virtualRowHeightEstimate, virtualScrollElement, }: TableProps<T>) => JSX_2.Element;
6375
+ export declare const Table: <T = Record<string, unknown>>({ columns, data, loading, loadingRowCount, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, error, errorTitle, errorSubTitle, emptyTitle, emptySubTitle, bordered, showHeader, rowKey, scrollHeight, size, rowDensity, layout, headerVariant, title, subtitle, extra, rowClassName, rowVariant, onRow, onClickRow, selectedRowKey, scrollSelectedIntoView, rowSelection, pagination, className, style, stickyHeaderTop, scrollX, rowSection, renderSectionDivider, onVisibleOrderChange, virtual, virtualRowHeightEstimate, virtualScrollElement, expandable: expandableProp, onReachEnd, loadingMore, loadingMoreText, rowThread: rowThreadProp, rowThreadTitle, }: TableProps<T>) => JSX_2.Element;
6376
6376
 
6377
6377
  export declare type TableColumnDefinition<T = Record<string, unknown>> = {
6378
6378
  title: string | default_2.ReactNode;
@@ -6409,8 +6409,51 @@ export declare type TableColumnDefinition<T = Record<string, unknown>> = {
6409
6409
  align?: 'left' | 'center' | 'right';
6410
6410
  };
6411
6411
 
6412
+ /**
6413
+ * Chooses which of a table's columns show. Filter the `columns` passed to `Table` by
6414
+ * `visibleKeys`. Every change hands back the keys in `columns` order, locked columns included,
6415
+ * so the table's order never depends on the order they were switched on.
6416
+ */
6417
+ export declare const TableColumnPicker: default_2.FC<TableColumnPickerProps>;
6418
+
6419
+ export declare interface TableColumnPickerColumn {
6420
+ key: string;
6421
+ title: string;
6422
+ /** `false` keeps the column shown: it is listed, checked, says it is always shown, and
6423
+ * cannot be turned off. */
6424
+ hideable?: boolean;
6425
+ }
6426
+
6427
+ export declare interface TableColumnPickerProps {
6428
+ columns: readonly TableColumnPickerColumn[];
6429
+ /** The keys shown. Controlled. Include every `hideable: false` column's key, or the table
6430
+ * filtering by these hides a column the picker shows locked on. */
6431
+ visibleKeys: readonly string[];
6432
+ onVisibleKeysChange: (keys: string[]) => void;
6433
+ /** Shown in the header, to put the defaults back. */
6434
+ onReset?: () => void;
6435
+ /** The trigger's text and the panel's name. Default "Columns". */
6436
+ label?: string;
6437
+ }
6438
+
6412
6439
  export declare type TableColumns<T = Record<string, unknown>> = TableColumnDefinition<T>[];
6413
6440
 
6441
+ /**
6442
+ * Rows nested under a parent row, such as the calls of one session. Detached header only.
6443
+ * Children follow their parent through a sort and are never sorted among themselves.
6444
+ */
6445
+ export declare type TableExpandable<T = Record<string, unknown>> = {
6446
+ /** The rows under a record. A record with none, or an empty list, gets no toggle. Taken as
6447
+ * pure, like a function `rowKey`: the rows are read again when `data` or the open parents
6448
+ * change, not when a new function is passed. Give children a `rowKey` of their own. */
6449
+ childRows: (record: T) => readonly T[] | undefined;
6450
+ /** The parents shown open, resolved against `rowKey`. Controlled. */
6451
+ expandedRowKeys: readonly default_2.Key[];
6452
+ onExpandedRowKeysChange: (keys: default_2.Key[]) => void;
6453
+ /** Drawn after a parent's first cell, such as a count of its children. */
6454
+ summary?: (record: T, children: readonly T[]) => default_2.ReactNode;
6455
+ };
6456
+
6414
6457
  /** What the table reads from a column's `onHeaderCell`: `onClick`, run from the sort button. */
6415
6458
  export declare interface TableHeaderCellHandlers {
6416
6459
  onClick?: (event: default_2.MouseEvent<HTMLButtonElement>) => void;
@@ -6517,6 +6560,28 @@ declare type TableProps<T = Record<string, unknown>> = {
6517
6560
  * scroll away). Pass the element from state (not a ref) so it arrives after
6518
6561
  * mount. The table body stops scrolling when this is set. */
6519
6562
  virtualScrollElement?: HTMLElement | null;
6563
+ /** Parent rows that open onto child rows. Detached header only; needs a `rowKey`.
6564
+ * Expanded children count as rows everywhere else: `selectedRowKey`, the arrow keys and
6565
+ * `onVisibleOrderChange` all see them. On a focused clickable parent row, right opens it
6566
+ * and left closes it; its toggle button opens and closes it on any row. */
6567
+ expandable?: TableExpandable<T>;
6568
+ /** Called when the last row scrolls within 200px of view, to load the next page onto
6569
+ * `data`. Called once per length of `data`, so a page that adds no rows does not loop;
6570
+ * scrolling away and back, a reload through `loading`, and an `error` clearing each call
6571
+ * it again. Not while `loading`, `loadingMore` or `error`, nor on an empty table.
6572
+ * Detached header only. Leave it out once there is nothing more to load. */
6573
+ onReachEnd?: () => void;
6574
+ /** Draws a trailing row saying more rows are on their way. Detached header only. */
6575
+ loadingMore?: boolean;
6576
+ /** The trailing row's text. Default "Loading more". */
6577
+ loadingMoreText?: string;
6578
+ /** Adds a gutter ahead of the first column threading rows together, such as the calls of
6579
+ * one session. A row it returns nothing for gets an empty gutter. `index` is the row's
6580
+ * rendered position, as everywhere else, so after a sort it is not its place in `data`.
6581
+ * Detached header only. */
6582
+ rowThread?: (record: T, index: number) => TableRowThread | undefined;
6583
+ /** Names the gutter's column for assistive technology. Default "Thread". */
6584
+ rowThreadTitle?: string;
6520
6585
  };
6521
6586
 
6522
6587
  declare type TableRowActions<T = Record<string, unknown>> = {
@@ -6545,6 +6610,28 @@ export declare type TableRowSelection<T = Record<string, unknown>> = {
6545
6610
  selections?: boolean | default_2.ReactNode[];
6546
6611
  };
6547
6612
 
6613
+ /**
6614
+ * One row's place on a thread: a dot in a gutter ahead of the first column, joined by a line to
6615
+ * the rows above and below it on the same thread, such as the calls of one session.
6616
+ */
6617
+ export declare type TableRowThread = {
6618
+ /** Draw the line up to the row above. */
6619
+ joinsAbove: boolean;
6620
+ /** Draw the line down to the row below. */
6621
+ joinsBelow: boolean;
6622
+ /** `lead` marks a thread's first row, `current` the row the thread is focused on. */
6623
+ emphasis?: 'lead' | 'follow' | 'current';
6624
+ } & ({
6625
+ /** Names the dot, and shows as its tooltip. */
6626
+ label?: string;
6627
+ onClick?: never;
6628
+ } | {
6629
+ /** Names the dot's button, which has nothing else to be called by. */
6630
+ label: string;
6631
+ /** Makes the dot a button. */
6632
+ onClick: () => void;
6633
+ });
6634
+
6548
6635
  export declare type TableSize = 'small' | 'medium' | 'large';
6549
6636
 
6550
6637
  export declare type TableType = 'default' | 'compact' | 'bordered';
@@ -6742,6 +6829,37 @@ export declare const ThumbsDownIcon: React.FC<IconProps_116>;
6742
6829
 
6743
6830
  export declare const ThumbsUpIcon: React.FC<IconProps_117>;
6744
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
+
6745
6863
  export declare const TimeBarChart: default_2.FC<TimeBarChartProps>;
6746
6864
 
6747
6865
  export declare interface TimeBarChartBucket {