@mechane-ai/elements 0.39.0 → 0.41.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.
Files changed (110) hide show
  1. package/NOTICE +11 -19
  2. package/README.md +49 -25
  3. package/dist/accessibility-P89UG9-r.js +25 -0
  4. package/dist/agent.js +1 -0
  5. package/dist/ai.js +50 -44
  6. package/dist/{categorical-values-BECG-J6R.js → categorical-values-DnGR_pQx.js} +3 -3
  7. package/dist/{chart-frame-CJFnI39T.js → chart-frame-BsyI1Zc8.js} +58 -57
  8. package/dist/{chart-input-DwAobO8Y.js → chart-input-r4S3-QCT.js} +2 -2
  9. package/dist/chart-navigation-D7OkLdSx.js +119 -0
  10. package/dist/charts/cartesian.js +560 -583
  11. package/dist/charts/distribution.js +218 -218
  12. package/dist/charts/graph.js +86 -85
  13. package/dist/charts/hierarchy.js +4 -4
  14. package/dist/charts/matrix.js +148 -147
  15. package/dist/charts/timeline.js +77 -76
  16. package/dist/charts.js +2 -2
  17. package/dist/code-block-C4K1sM9O.js +255 -0
  18. package/dist/collections.js +828 -607
  19. package/dist/constants.stylex-BILvnwUk.js +84 -0
  20. package/dist/content/code.js +1 -1
  21. package/dist/content/diff.js +3 -3
  22. package/dist/content/link.js +1 -1
  23. package/dist/content/markdown.js +2 -2
  24. package/dist/content/tree.js +184 -77
  25. package/dist/{content-link-B3ObdyZY.js → content-link-CBDqSvgP.js} +1 -1
  26. package/dist/content.js +1 -1
  27. package/dist/control-styles-D3q_Qyxi.js +179 -0
  28. package/dist/csp.js +14 -1
  29. package/dist/feedback.js +1 -1
  30. package/dist/forms/dates.js +359 -245
  31. package/dist/forms-I-WMHTkr.js +139 -0
  32. package/dist/forms.js +3 -3
  33. package/dist/index.js +1 -1
  34. package/dist/layout.js +271 -241
  35. package/dist/navigation/commands.js +87 -76
  36. package/dist/{navigation-D2_sGy3C.js → navigation-CveMIuXI.js} +1 -1
  37. package/dist/navigation.js +2 -2
  38. package/dist/overlays.js +1 -1
  39. package/dist/packages/ai/src/message-action.d.ts +1 -1
  40. package/dist/packages/charts/src/chart-navigation.d.ts +18 -2
  41. package/dist/packages/charts/src/chart-surface.d.ts +23 -0
  42. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +3 -2
  43. package/dist/packages/collections/src/data-table.d.ts +7 -2
  44. package/dist/packages/collections/src/index.d.ts +4 -1
  45. package/dist/packages/collections/src/query-controls.d.ts +18 -0
  46. package/dist/packages/collections/src/table-query.d.ts +64 -0
  47. package/dist/packages/collections/src/use-collection-controls.d.ts +3 -8
  48. package/dist/packages/content/src/pierre-theme.d.ts +0 -1
  49. package/dist/packages/core/src/actions.d.ts +15 -13
  50. package/dist/packages/core/src/copy-value.d.ts +3 -2
  51. package/dist/packages/core/src/disclosure.d.ts +14 -11
  52. package/dist/packages/feedback/src/notifications.d.ts +15 -15
  53. package/dist/packages/feedback/src/toast.d.ts +9 -3
  54. package/dist/packages/forms/src/combobox.d.ts +31 -41
  55. package/dist/packages/forms/src/dates/event-month.d.ts +17 -0
  56. package/dist/packages/forms/src/dates/index.d.ts +2 -0
  57. package/dist/packages/forms/src/field-styles.d.ts +0 -19
  58. package/dist/packages/forms/src/form-controls.d.ts +26 -24
  59. package/dist/packages/forms/src/forms.d.ts +17 -14
  60. package/dist/packages/forms/src/select-control.d.ts +6 -4
  61. package/dist/packages/forms/src/select.d.ts +14 -18
  62. package/dist/packages/forms/src/selection-state.d.ts +11 -0
  63. package/dist/packages/forms/src/selection-styles.d.ts +3 -0
  64. package/dist/packages/forms/src/selection.d.ts +21 -19
  65. package/dist/packages/foundations/src/agent/index.d.ts +2 -0
  66. package/dist/packages/foundations/src/control-state.d.ts +2 -3
  67. package/dist/packages/foundations/src/control-styles.d.ts +19 -0
  68. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  69. package/dist/packages/foundations/src/csp/provider.d.ts +3 -0
  70. package/dist/packages/foundations/src/style-composition.d.ts +4 -1
  71. package/dist/packages/layout/src/app-shell.d.ts +12 -1
  72. package/dist/packages/layout/src/index.d.ts +1 -1
  73. package/dist/packages/layout/src/navigation-rail.d.ts +15 -2
  74. package/dist/packages/layout/src/resizable.d.ts +2 -2
  75. package/dist/packages/layout/src/sidebar.d.ts +4 -3
  76. package/dist/packages/navigation/src/tab-styles.d.ts +1 -1
  77. package/dist/packages/navigation/src/tabs.d.ts +12 -10
  78. package/dist/packages/overlays/src/alert-dialog.d.ts +19 -13
  79. package/dist/packages/overlays/src/dialog.d.ts +39 -24
  80. package/dist/packages/overlays/src/drawer.d.ts +16 -26
  81. package/dist/packages/overlays/src/menu.d.ts +37 -44
  82. package/dist/packages/overlays/src/overlay-root.d.ts +10 -0
  83. package/dist/packages/overlays/src/popover.d.ts +11 -20
  84. package/dist/packages/overlays/src/preview.d.ts +6 -13
  85. package/dist/packages/overlays/src/tooltip.d.ts +12 -15
  86. package/dist/{pierre-diff-CaPsfQRo.js → pierre-diff-DJ3oOfPX.js} +5 -5
  87. package/dist/{src-DPRmO-JY.js → src-CNV1ewzb.js} +379 -407
  88. package/dist/{src-CSWIG_op.js → src-CQQvXi7a.js} +58 -81
  89. package/dist/{src-DWjAoOyd.js → src-D2OHco8V.js} +42 -41
  90. package/dist/src-DfOAlAd2.js +750 -0
  91. package/dist/src-na2DdkKI.js +561 -0
  92. package/dist/{src-C-Sx37kz.js → src-s3tWwnN4.js} +361 -518
  93. package/dist/styles.js +3 -0
  94. package/dist/{elements.css → styles2.css} +195 -97
  95. package/dist/tokens.js +3 -1
  96. package/dist/{tokens.stylex-CJbIDPB9.js → tokens.stylex-dF5CACEJ.js} +13 -93
  97. package/package.json +8 -9
  98. package/skills/elements-workspace/SKILL.md +12 -0
  99. package/dist/accessibility-C-aIZ1Yx.js +0 -15
  100. package/dist/chart-navigation-CBIeNtJq.js +0 -67
  101. package/dist/code-block-aC0Htt4N.js +0 -184
  102. package/dist/forms-BQQFas9g.js +0 -118
  103. package/dist/foundations.css +0 -7
  104. package/dist/packages/content/src/tree/pierre-tree.d.ts +0 -3
  105. package/dist/pierre-theme-BpNaWn1x.js +0 -126
  106. package/dist/pierre-tree-CYCRjdGG.js +0 -106
  107. package/dist/src-d7EAi61b.js +0 -617
  108. package/dist/src-nkgFDl-g.js +0 -1171
  109. package/dist/style-composition-uYlczSsB.js +0 -9
  110. package/styles.css +0 -2
@@ -1,84 +1,95 @@
1
- import { n as e } from "../forms-BQQFas9g.js";
2
- import { s as t } from "../src-d7EAi61b.js";
3
- import { n } from "../navigation-D2_sGy3C.js";
4
- import "@stylexjs/stylex";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
- import { Autocomplete as a } from "@base-ui/react/autocomplete";
7
- import { useFormatForDisplay as o, useHotkeys as s } from "@tanstack/react-hotkeys";
1
+ import { r as e } from "../control-styles-D3q_Qyxi.js";
2
+ import { s as t } from "../src-na2DdkKI.js";
3
+ import { n } from "../navigation-CveMIuXI.js";
4
+ import * as r from "@stylexjs/stylex";
5
+ import { useEffect as i, useEffectEvent as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { matchesShortcut as c } from "@ui-sdk/core/shortcuts";
8
+ import { Command as l, CommandEmpty as u, CommandInput as d, CommandItem as f, CommandList as p } from "@ui-sdk/react/command";
9
+ import { useShortcutHint as m } from "@ui-sdk/react/shortcuts";
8
10
  // packages/navigation/src/commands/command.tsx
9
- function c({ commands: e, target: t, isEnabled: n }) {
10
- let r = e.flatMap((e) => !n || e.isDisabled === !0 || e.shortcut === void 0 ? [] : [{
11
- hotkey: e.shortcut,
12
- callback: (n) => {
13
- if (n.defaultPrevented || n.repeat || e.shouldRun?.(n) === !1) return;
14
- let r = t !== null && "current" in t ? t.current : t, i = (r?.ownerDocument ?? globalThis.document).querySelectorAll(":is(dialog[open], [role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"], [data-base-ui-popover-popup]):not([data-closed])");
15
- for (let e of i) if (r === null || !e.contains(r)) return;
16
- n.target instanceof Element && n.target.closest("input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])") !== null || (n.preventDefault(), n.stopPropagation(), e.onSelect());
17
- },
18
- options: {
19
- requireReset: !0,
20
- meta: { name: e.label }
21
- }
22
- }]);
23
- s(r, {
24
- target: t,
25
- ignoreInputs: !0,
26
- ignoreDefaultPrevented: !0,
27
- preventDefault: !1,
28
- stopPropagation: !1,
29
- conflictBehavior: "error"
11
+ function h(e) {
12
+ return [
13
+ e.mod === !0 && "mod",
14
+ e.ctrl === !0 && "ctrl",
15
+ e.meta === !0 && "meta",
16
+ e.shift === !0 && "shift",
17
+ e.alt === !0 && "alt",
18
+ e.key
19
+ ].filter(Boolean).join("+");
20
+ }
21
+ function g({ commands: e, target: t, isEnabled: n }) {
22
+ let r = a((t, n) => {
23
+ if (t.defaultPrevented || t.repeat || t.isComposing || t.target instanceof Element && t.target.closest("input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])") !== null) return;
24
+ let r = e.find((e) => e.isDisabled === !0 || e.shortcut === void 0 ? !1 : c(t, h(e.shortcut)) && e.shouldRun?.(t) !== !1);
25
+ if (r === void 0) return;
26
+ let i = n.ownerDocument.querySelectorAll(":is(dialog[open], [role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"], [data-slot=\"popover-content\"]):not([data-closed])");
27
+ for (let e of i) if (e.getClientRects().length > 0 && !e.contains(n)) return;
28
+ t.preventDefault(), t.stopPropagation(), r.onSelect();
30
29
  });
30
+ i(() => {
31
+ let e = t !== null && "current" in t ? t.current : t;
32
+ if (!n || e === null) return;
33
+ let i = e;
34
+ function a(e) {
35
+ r(e, i);
36
+ }
37
+ return e.addEventListener("keydown", a), () => e.removeEventListener("keydown", a);
38
+ }, [n, t]);
31
39
  }
32
- function l({ shortcut: e }) {
33
- let t = o();
34
- return /* @__PURE__ */ r(n, { children: t(e) });
40
+ function _({ shortcut: e }) {
41
+ let { text: t } = m(h(e));
42
+ return /* @__PURE__ */ o(n, { children: t });
35
43
  }
36
- function u({ open: n, onOpenChange: o, title: s, commands: c, trigger: u, placeholder: d = "Search commands…", empty: f = "No matching commands" }) {
37
- return /* @__PURE__ */ i(t.Root, {
44
+ function v({ open: n, onOpenChange: i, title: a, commands: c, trigger: m, placeholder: h = "Search commands…", empty: g = "No matching commands" }) {
45
+ return /* @__PURE__ */ s(t.Root, {
38
46
  open: n,
39
- onOpenChange: o,
40
- children: [u !== void 0 && /* @__PURE__ */ r(t.Trigger, { render: u }), /* @__PURE__ */ i(t.Portal, { children: [/* @__PURE__ */ r(t.Backdrop, { motion: "none" }), /* @__PURE__ */ r(t.Popup, {
41
- motion: "none",
42
- children: /* @__PURE__ */ i("div", {
43
- className: "x78zum5 xdt5ytf x1n8ia3y",
44
- children: [/* @__PURE__ */ r(t.Title, { children: s }), /* @__PURE__ */ i(a.Root, {
45
- items: c,
46
- itemToStringValue: (e) => e.label,
47
- inline: !0,
48
- open: !0,
49
- autoHighlight: "always",
50
- children: [
51
- /* @__PURE__ */ r(a.Input, {
52
- "aria-label": d,
53
- placeholder: d,
54
- render: /* @__PURE__ */ r(e, {})
55
- }),
56
- /* @__PURE__ */ r(a.List, {
57
- className: "x1717udv x1ghz6dp x1sslpiy x1odjw0f xish69e",
58
- children: (e) => /* @__PURE__ */ i(a.Item, {
59
- value: e,
60
- disabled: e.isDisabled,
61
- className: "x78zum5 x9f619 x6s0dn4 xaml1ju x17tes2r x17oiadl xn9t2bk x5g2kb4 x1ok0vyi xbixft xpvm0e4 x1hz01jw xj57cvi xtqrqnz x1778rvt x1ypdohk xf2ykmf x1480za7 xd12npn xwj21n9 x1m8qfh3",
62
- onClick: () => {
63
- o(!1), e.onSelect();
64
- },
65
- children: [/* @__PURE__ */ i("span", {
66
- className: "x98rzlu xeuugli xj0a0fe",
67
- children: [e.label, e.description !== void 0 && /* @__PURE__ */ r("span", {
68
- className: "x1lliihq x153jb6y xy8obcc xas2l8k",
69
- children: e.description
70
- })]
71
- }), e.shortcut !== void 0 && /* @__PURE__ */ r(l, { shortcut: e.shortcut })]
72
- }, e.id)
73
- }),
74
- /* @__PURE__ */ r(a.Empty, {
75
- className: "x1c8xbx5 x153jb6y xtqrqnz xjl7jj",
76
- children: f
77
- })
78
- ]
79
- })]
47
+ onOpenChange: i,
48
+ children: [
49
+ m !== void 0 && /* @__PURE__ */ o(t.Trigger, { render: m }),
50
+ /* @__PURE__ */ o(t.Backdrop, { motion: "none" }),
51
+ /* @__PURE__ */ o(t.Popup, {
52
+ motion: "none",
53
+ children: /* @__PURE__ */ s("div", {
54
+ className: "x78zum5 xdt5ytf x1n8ia3y",
55
+ children: [/* @__PURE__ */ o(t.Title, { children: a }), /* @__PURE__ */ s(l, {
56
+ filter: "contains",
57
+ onAction: (e) => {
58
+ let t = c.find((t) => t.id === e && t.isDisabled !== !0);
59
+ t !== void 0 && (i(!1), t.onSelect());
60
+ },
61
+ className: "x78zum5 xdt5ytf x1n8ia3y",
62
+ children: [
63
+ /* @__PURE__ */ o(d, {
64
+ "aria-label": h,
65
+ placeholder: h,
66
+ ...r.props(e.base, e.field, e.singleLineField, e.textFieldState)
67
+ }),
68
+ /* @__PURE__ */ o(p, {
69
+ className: "x1717udv x1ghz6dp x1sslpiy x1odjw0f xish69e",
70
+ children: c.map((e) => /* @__PURE__ */ s(f, {
71
+ value: e.id,
72
+ label: e.label,
73
+ disabled: e.isDisabled === !0,
74
+ className: "x78zum5 x9f619 x6s0dn4 xaml1ju x17tes2r x17oiadl xn9t2bk x5g2kb4 x1ok0vyi xbixft xpvm0e4 x1hz01jw xj57cvi xtqrqnz x1778rvt x1ypdohk xf2ykmf x1480za7 xd12npn xwj21n9 x1m8qfh3",
75
+ children: [/* @__PURE__ */ s("span", {
76
+ className: "x98rzlu xeuugli xj0a0fe",
77
+ children: [e.label, e.description !== void 0 && /* @__PURE__ */ o("span", {
78
+ className: "x1lliihq x153jb6y xy8obcc xas2l8k",
79
+ children: e.description
80
+ })]
81
+ }), e.shortcut !== void 0 && /* @__PURE__ */ o(_, { shortcut: e.shortcut })]
82
+ }, e.id))
83
+ }),
84
+ /* @__PURE__ */ o(u, {
85
+ className: "x1c8xbx5 x153jb6y xtqrqnz xjl7jj",
86
+ children: g
87
+ })
88
+ ]
89
+ })]
90
+ })
80
91
  })
81
- })] })]
92
+ ]
82
93
  });
83
94
  }
84
- export { u as CommandPalette, l as ShortcutHint, c as useCommandShortcuts };
95
+ export { v as CommandPalette, _ as ShortcutHint, g as useCommandShortcuts };
@@ -1,5 +1,5 @@
1
- import { mergeProps as e } from "@base-ui/react/merge-props";
2
1
  import "@stylexjs/stylex";
2
+ import { mergeProps as e } from "@ui-sdk/react/primitive";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  import { ChevronRight as n } from "lucide-react";
5
5
  // packages/navigation/src/navigation.tsx
@@ -1,3 +1,3 @@
1
- import { n as e, t } from "./navigation-D2_sGy3C.js";
2
- import { a as n, i as r, n as i, r as a, t as o } from "./src-CSWIG_op.js";
1
+ import { n as e, t } from "./navigation-CveMIuXI.js";
2
+ import { a as n, i as r, n as i, r as a, t as o } from "./src-CQQvXi7a.js";
3
3
  export { t as Breadcrumb, o as ContentTabs, e as Kbd, r as PageNavigation, n as PageNavigationPlaceholder, a as SkipLink, i as Tabs };
package/dist/overlays.js CHANGED
@@ -1 +1 @@
1
- export { o as AlertDialog, s as Dialog, a as Drawer, i as Menu, r as Popover, n as Preview, t as Tooltip } from "./src-d7EAi61b.js";
1
+ export { o as AlertDialog, s as Dialog, a as Drawer, i as Menu, r as Popover, n as Preview, t as Tooltip } from "./src-na2DdkKI.js";
@@ -2,7 +2,7 @@ import type { ComponentProps, ReactNode } from 'react';
2
2
  import { IconButton, IconLink } from '../../core/src/index.ts';
3
3
  export type MessageActionProps = {
4
4
  readonly label: string;
5
- } & ((Omit<ComponentProps<typeof IconButton>, 'aria-label' | 'variant' | 'nativeButton'> & {
5
+ } & ((Omit<ComponentProps<typeof IconButton>, 'aria-label' | 'variant'> & {
6
6
  readonly kind?: 'button';
7
7
  }) | (Omit<ComponentProps<typeof IconLink>, 'aria-label'> & {
8
8
  readonly kind: 'link';
@@ -1,4 +1,3 @@
1
- import type { HTMLAttributes } from 'react';
2
1
  import type { ChartSelection } from './chart-frame.tsx';
3
2
  type ChartNavigationItem = {
4
3
  readonly id: string;
@@ -11,7 +10,24 @@ type ChartNavigationInput = {
11
10
  };
12
11
  export declare function useChartNavigation({ title, items, selection }: ChartNavigationInput): {
13
12
  id: string;
14
- props: HTMLAttributes<HTMLElement>;
13
+ props: {
14
+ controls: {
15
+ items: readonly ChartNavigationItem[];
16
+ cursor: string | undefined;
17
+ inspected: string | undefined;
18
+ allowVerticalNavigation: true;
19
+ onInspect: (itemId: string) => void;
20
+ onDismiss: () => void;
21
+ onSelect: ((id: string) => void) | undefined;
22
+ };
23
+ role: "group";
24
+ tabIndex: number | undefined;
25
+ 'aria-label': string;
26
+ 'aria-describedby': string;
27
+ onFocus: () => void;
28
+ onBlur: (event: import("react").FocusEvent<HTMLElement, Element>) => void;
29
+ onPointerLeave: (event: import("react").PointerEvent<HTMLElement>) => void;
30
+ };
15
31
  activeId: string | undefined;
16
32
  label: string | undefined;
17
33
  inspect: (itemId: string) => void;
@@ -0,0 +1,23 @@
1
+ import type { PartProps } from '@ui-sdk/react/primitive';
2
+ import type { ReactNode } from 'react';
3
+ type ChartItem = {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ };
7
+ export type ChartControls = {
8
+ readonly items: ReadonlyArray<ChartItem>;
9
+ readonly cursor: string | undefined;
10
+ readonly inspected: string | undefined;
11
+ readonly allowVerticalNavigation?: boolean;
12
+ readonly onInspect: (id: string) => void;
13
+ readonly onDismiss: () => void;
14
+ readonly onSelect?: ((id: string) => void) | undefined;
15
+ };
16
+ type ChartRoot<Tag extends 'div' | 'p' | 'svg'> = (props: Omit<PartProps<Tag>, 'id' | 'controls'> & {
17
+ id?: string;
18
+ controls: ChartControls;
19
+ }) => ReactNode;
20
+ export declare const ChartSurface: ChartRoot<'div'>;
21
+ export declare const ChartTextSurface: ChartRoot<'p'>;
22
+ export declare const ChartSvgSurface: ChartRoot<'svg'>;
23
+ export {};
@@ -1,5 +1,6 @@
1
1
  import * as stylex from '@stylexjs/stylex';
2
- import type { HTMLAttributes, ReactNode } from 'react';
2
+ import type { ReactNode } from 'react';
3
+ import type { useChartNavigation } from '../chart-navigation.tsx';
3
4
  import type { NumericDomain } from './distribution-input.ts';
4
5
  export declare const distributionGeometry: {
5
6
  readonly height: 160;
@@ -139,7 +140,7 @@ export declare const distributionStyles: Readonly<{
139
140
  }>;
140
141
  }>;
141
142
  type NumericPlotProps = {
142
- readonly navigation?: HTMLAttributes<HTMLElement>;
143
+ readonly navigation: ReturnType<typeof useChartNavigation>['props'];
143
144
  readonly onInspectValue?: (value: number) => void;
144
145
  readonly xDomain: NumericDomain;
145
146
  readonly yDomain: NumericDomain;
@@ -1,4 +1,5 @@
1
1
  import type { ComponentProps, ReactNode } from 'react';
2
+ import type { TableQuery } from './table-query.tsx';
2
3
  type RowSizing = 'fixed' | 'content';
3
4
  export type DataTableColumnRole = 'primary' | 'text' | 'status' | 'number' | 'timestamp' | 'actions';
4
5
  export type DataTableColumnLayout = {
@@ -72,11 +73,12 @@ type OptionalSelection<Row> = SelectionProperties<Row> | {
72
73
  readonly onSelectionChange?: never;
73
74
  readonly selectionLabel?: never;
74
75
  };
75
- export type DataTableProps<Row> = SortProperties<Row> & OptionalSelection<Row> & {
76
+ type TableRowsProps<Row> = SortProperties<Row> & OptionalSelection<Row> & {
76
77
  readonly rows: ReadonlyArray<Row>;
77
78
  readonly getRowId: (row: Row) => string;
78
79
  readonly caption: string;
79
80
  readonly empty: ReactNode;
81
+ readonly filteredEmpty?: ReactNode;
80
82
  readonly rowAction?: DataTableRowAction<Row>;
81
83
  readonly activeRowId?: string | undefined;
82
84
  readonly focusRowId?: string | undefined;
@@ -89,5 +91,8 @@ export type DataTableProps<Row> = SortProperties<Row> & OptionalSelection<Row> &
89
91
  readonly onEndReached?: () => void;
90
92
  readonly footer?: ReactNode;
91
93
  };
92
- export declare function DataTable<Row extends object>({ rows, columns: suppliedColumns, getRowId, caption, empty, sort, onSortChange, selectedIds, onSelectionChange, selectionLabel, rowAction, activeRowId, focusRowId, onRowHighlightChange, hideCaption, hideHeaders, rowSizing, window, endContent, onEndReached, footer, }: DataTableProps<Row>): ReactNode;
94
+ export type DataTableProps<Row> = TableRowsProps<Row> & {
95
+ readonly query: TableQuery<Row>;
96
+ };
97
+ export declare function DataTable<Row extends object>({ query, ...table }: DataTableProps<Row>): ReactNode;
93
98
  export {};
@@ -14,6 +14,9 @@ export { Timestamp } from './timestamp.tsx';
14
14
  export { Timeline } from './timeline.tsx';
15
15
  export type { TimelineProps, TimelineItemProps } from './timeline.tsx';
16
16
  export { useCollectionControls } from './use-collection-controls.tsx';
17
- export type { CollectionSearch, CollectionControlsProps } from './use-collection-controls.tsx';
17
+ export type { CollectionSearch } from './query-controls.tsx';
18
+ export type { CollectionControlsProps } from './use-collection-controls.tsx';
18
19
  export { CollectionFilters } from './collection-filters.tsx';
19
20
  export type { CollectionFilter, FilterOption } from './collection-filters.tsx';
21
+ export { TableQueryFrame, useLocalTableQuery } from './table-query.tsx';
22
+ export type { LocalTableQuery, TableFilterDimension, TableQuery, TableQueryException } from './table-query.tsx';
@@ -0,0 +1,18 @@
1
+ import type { PartProps } from '@ui-sdk/react/primitive';
2
+ import type { ComponentType } from 'react';
3
+ import type { CollectionFilter } from './collection-filters.tsx';
4
+ export type CollectionSearch = {
5
+ readonly value: string;
6
+ readonly onChange: (value: string) => void;
7
+ readonly onSubmit?: () => void;
8
+ readonly label?: string;
9
+ readonly placeholder?: string;
10
+ };
11
+ type QueryOptions = {
12
+ readonly search: CollectionSearch | undefined;
13
+ readonly groups: ReadonlyArray<CollectionFilter>;
14
+ readonly selections: Readonly<Record<string, string>>;
15
+ readonly isDisabled: boolean;
16
+ };
17
+ export declare const QueryControls: ComponentType<Omit<PartProps<'div'>, 'id'> & QueryOptions>;
18
+ export {};
@@ -0,0 +1,64 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CollectionFilter } from './collection-filters.tsx';
3
+ import type { CollectionSearch } from './query-controls.tsx';
4
+ export type TableQueryException = {
5
+ readonly reason: string;
6
+ };
7
+ export type TableFilterDimension<Row> = {
8
+ readonly id: string;
9
+ readonly label: string;
10
+ readonly value: (row: Row) => string;
11
+ readonly formatLabel?: (value: string) => string;
12
+ };
13
+ export type LocalTableQuery<Row> = {
14
+ readonly mode: 'local';
15
+ readonly search: ((row: Row) => string) | TableQueryException;
16
+ readonly filters: ReadonlyArray<TableFilterDimension<Row>> | TableQueryException;
17
+ };
18
+ type ControlledTableQuery = {
19
+ readonly mode: 'controlled';
20
+ readonly search: CollectionSearch | TableQueryException;
21
+ readonly filters: ReadonlyArray<CollectionFilter> | TableQueryException;
22
+ };
23
+ export type TableQuery<Row> = LocalTableQuery<Row> | ControlledTableQuery | {
24
+ readonly mode: 'frame';
25
+ } | ({
26
+ readonly mode: 'static';
27
+ } & TableQueryException);
28
+ type FrameCapability = true | TableQueryException;
29
+ export declare function checkTableQueryException(exception: TableQueryException): void;
30
+ type QueryFrameProps = {
31
+ readonly children: ReactNode;
32
+ } & ({
33
+ readonly search: FrameCapability;
34
+ readonly filters: FrameCapability;
35
+ readonly isFiltered?: boolean;
36
+ } | {
37
+ readonly search?: never;
38
+ readonly filters?: never;
39
+ readonly isFiltered?: never;
40
+ });
41
+ export declare function TableQueryFrame({ search, filters, children, isFiltered }: QueryFrameProps): ReactNode;
42
+ type LocalFilter = Omit<CollectionFilter, 'icon' | 'options'> & {
43
+ readonly options: ReadonlyArray<{
44
+ readonly label: string;
45
+ readonly value: string;
46
+ }>;
47
+ };
48
+ type LocalResult<Row, Search> = {
49
+ readonly rows: ReadonlyArray<Row>;
50
+ readonly search: Search;
51
+ readonly filters: ReadonlyArray<LocalFilter>;
52
+ readonly isFiltered: boolean;
53
+ };
54
+ export declare function useLocalTableQuery<Row>(rows: ReadonlyArray<Row>, query: LocalTableQuery<Row> & {
55
+ readonly search: (row: Row) => string;
56
+ }): LocalResult<Row, CollectionSearch>;
57
+ export declare function useLocalTableQuery<Row>(rows: ReadonlyArray<Row>, query: LocalTableQuery<Row>): LocalResult<Row, CollectionSearch | undefined>;
58
+ export declare function useFrameTableQuery(): boolean;
59
+ export declare function controlledTableControls(query: ControlledTableQuery): {
60
+ search: CollectionSearch | undefined;
61
+ filters: readonly CollectionFilter[];
62
+ isFiltered: boolean;
63
+ };
64
+ export {};
@@ -1,13 +1,8 @@
1
1
  import type { KeyboardEvent, ReactNode } from 'react';
2
2
  import type { CollectionFilter } from './collection-filters.tsx';
3
- export type CollectionSearch = {
4
- readonly value: string;
5
- readonly onChange: (value: string) => void;
6
- readonly onSubmit?: () => void;
7
- readonly label?: string;
8
- readonly placeholder?: string;
9
- };
3
+ import type { CollectionSearch } from './query-controls.tsx';
10
4
  export type CollectionControlsProps = {
5
+ readonly label?: string;
11
6
  readonly search?: CollectionSearch;
12
7
  readonly filters?: ReadonlyArray<CollectionFilter>;
13
8
  readonly filterContent?: (close: () => void) => ReactNode;
@@ -19,7 +14,7 @@ export type CollectionControlsProps = {
19
14
  readonly viewActions?: ReactNode;
20
15
  readonly display?: ReactNode;
21
16
  };
22
- export declare function useCollectionControls({ search, filters, filterContent, chips, viewActions, display, isPlaceholder, isReady, }: CollectionControlsProps & {
17
+ export declare function useCollectionControls({ label, search, filters, filterContent, chips, viewActions, display, isPlaceholder, isReady, }: CollectionControlsProps & {
23
18
  isPlaceholder?: boolean;
24
19
  isReady: boolean;
25
20
  }): {
@@ -33,4 +33,3 @@ export declare const highlightTheme: {
33
33
  };
34
34
  };
35
35
  export declare const pierreCSS: string;
36
- export declare const treeCSS: string;
@@ -1,5 +1,5 @@
1
- import { Button as BaseButton } from '@base-ui/react/button';
2
- import { useRender } from '@base-ui/react/use-render';
1
+ import { Button as SdkButton } from '@ui-sdk/react/button';
2
+ import type { PartProps } from '@ui-sdk/react/primitive';
3
3
  import type { ComponentProps, ReactNode } from 'react';
4
4
  import type { ControlDensity } from '../../foundations/src/control-density.ts';
5
5
  import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
@@ -9,31 +9,33 @@ type PendingProps = {
9
9
  readonly isPending?: boolean;
10
10
  readonly pendingLabel?: string | undefined;
11
11
  };
12
- type ButtonProps = ComponentProps<typeof BaseButton> & PendingProps & {
12
+ type SdkButtonProps = ComponentProps<typeof SdkButton>;
13
+ type SharedButtonProps = Omit<SdkButtonProps, 'children' | 'onClick'> & PendingProps & {
14
+ readonly 'children'?: ReactNode;
15
+ readonly 'onClick'?: SdkButtonProps['onClick'];
16
+ readonly 'data-agent-confirm'?: string;
17
+ readonly 'tone'?: ButtonTone;
18
+ readonly 'density'?: ControlDensity;
19
+ readonly 'xstyle'?: PlacementStyle;
20
+ };
21
+ type ButtonProps = SharedButtonProps & {
13
22
  readonly variant?: ButtonVariant;
14
- readonly tone?: ButtonTone;
15
- readonly density?: ControlDensity;
16
- readonly xstyle?: PlacementStyle;
17
23
  };
18
24
  type IconButtonProps = Omit<ButtonProps, 'aria-label' | 'pendingLabel'> & {
19
25
  readonly 'aria-label': string;
20
26
  };
21
- type IconLinkProps = Omit<useRender.ComponentProps<'a'>, 'aria-label'> & {
27
+ type IconLinkProps = Omit<PartProps<'a'>, 'aria-label' | 'children'> & {
22
28
  readonly 'aria-label': string;
29
+ readonly 'children'?: ReactNode;
23
30
  readonly 'density'?: ControlDensity;
24
31
  readonly 'xstyle'?: PlacementStyle;
25
32
  };
26
- type TextButtonProps = ComponentProps<typeof BaseButton> & PendingProps & {
27
- readonly tone?: ButtonTone;
28
- readonly density?: ControlDensity;
29
- readonly xstyle?: PlacementStyle;
30
- };
31
33
  type TextLinkProps = ComponentProps<'a'> & {
32
34
  readonly xstyle?: PlacementStyle;
33
35
  };
34
36
  export declare function Button(props: ButtonProps): ReactNode;
35
37
  export declare function IconButton({ children, ...props }: IconButtonProps): ReactNode;
36
- export declare function TextButton({ tone, density, isPending, pendingLabel, children, className, style, xstyle, disabled, ...props }: TextButtonProps): ReactNode;
38
+ export declare function TextButton({ tone, density, isPending, pendingLabel, children, className, style, xstyle, onClick, disabled, ...props }: SharedButtonProps): ReactNode;
37
39
  export declare function TextLink({ xstyle, ...props }: TextLinkProps): ReactNode;
38
40
  export declare function IconLink({ children, density, xstyle, render, ref, ...props }: IconLinkProps): ReactNode;
39
41
  export {};
@@ -1,9 +1,10 @@
1
- import { Button as BaseButton } from '@base-ui/react/button';
1
+ import { Button as SdkButton } from '@ui-sdk/react/button';
2
2
  import type { ComponentProps, ReactNode } from 'react';
3
3
  type CopySource = string | (() => string);
4
- type CopyValueProps = Omit<ComponentProps<typeof BaseButton>, 'value'> & {
4
+ type CopyValueProps = Omit<ComponentProps<typeof SdkButton>, 'value' | 'children'> & {
5
5
  readonly value: CopySource;
6
6
  readonly label: string;
7
+ readonly children?: ReactNode;
7
8
  readonly display?: 'value' | 'icon';
8
9
  };
9
10
  export declare function CopyValue({ value, label, display, children, className, style, disabled, onClick, render, ...props }: CopyValueProps): ReactNode;
@@ -1,18 +1,21 @@
1
- import { Accordion as BaseAccordion } from '@base-ui/react/accordion';
2
- import { Collapsible as BaseCollapsible } from '@base-ui/react/collapsible';
1
+ import * as SdkAccordion from '@ui-sdk/react/accordion';
2
+ import * as SdkCollapsible from '@ui-sdk/react/collapsible';
3
3
  import type { ComponentProps, ReactNode } from 'react';
4
4
  import type { OpenStateProperties, ValueStateProperties } from '../../foundations/src/control-state.ts';
5
- type AccordionRootProps<Value> = Omit<BaseAccordion.Root.Props<Value>, 'value' | 'defaultValue' | 'onValueChange'> & ValueStateProperties<Array<Value>, NonNullable<BaseAccordion.Root.Props<Value>['onValueChange']>>;
6
- type AccordionItemProps = ComponentProps<typeof BaseAccordion.Item>;
7
- type AccordionHeaderProps = ComponentProps<typeof BaseAccordion.Header>;
8
- type AccordionTriggerProps = ComponentProps<typeof BaseAccordion.Trigger>;
9
- type AccordionPanelProps = ComponentProps<typeof BaseAccordion.Panel>;
10
- type CollapsibleRootProps = Omit<BaseCollapsible.Root.Props, 'open' | 'defaultOpen' | 'onOpenChange'> & OpenStateProperties<NonNullable<BaseCollapsible.Root.Props['onOpenChange']>>;
11
- type CollapsibleTriggerProps = ComponentProps<typeof BaseCollapsible.Trigger> & {
5
+ type AccordionRootProps<Value extends string> = Omit<ComponentProps<typeof SdkAccordion.Accordion<Value>>, 'value' | 'defaultValue' | 'onValueChange'> & ValueStateProperties<Array<Value>, NonNullable<ComponentProps<typeof SdkAccordion.Accordion<Value>>['onValueChange']>>;
6
+ type AccordionItemProps = ComponentProps<typeof SdkAccordion.AccordionItem<string>>;
7
+ type AccordionHeaderProps = ComponentProps<typeof SdkAccordion.AccordionHeader>;
8
+ type AccordionTriggerProps = Omit<ComponentProps<typeof SdkAccordion.AccordionTrigger>, 'children'> & {
9
+ readonly children?: ReactNode;
10
+ };
11
+ type AccordionPanelProps = ComponentProps<typeof SdkAccordion.AccordionPanel>;
12
+ type CollapsibleRootProps = Omit<ComponentProps<typeof SdkCollapsible.Collapsible>, 'open' | 'defaultOpen' | 'onOpenChange'> & OpenStateProperties<NonNullable<ComponentProps<typeof SdkCollapsible.Collapsible>['onOpenChange']>>;
13
+ type CollapsibleTriggerProps = Omit<ComponentProps<typeof SdkCollapsible.CollapsibleTrigger>, 'children'> & {
14
+ readonly children?: ReactNode;
12
15
  readonly variant?: 'default' | 'inline';
13
16
  };
14
- type CollapsiblePanelProps = ComponentProps<typeof BaseCollapsible.Panel>;
15
- declare function AccordionRoot<Value = string>({ className, style, ...props }: AccordionRootProps<Value>): ReactNode;
17
+ type CollapsiblePanelProps = ComponentProps<typeof SdkCollapsible.CollapsiblePanel>;
18
+ declare function AccordionRoot<Value extends string = string>({ className, style, ...props }: AccordionRootProps<Value>): ReactNode;
16
19
  declare function AccordionItem({ className, style, ...props }: AccordionItemProps): ReactNode;
17
20
  declare function AccordionHeader({ className, style, ...props }: AccordionHeaderProps): ReactNode;
18
21
  declare function AccordionTrigger({ className, style, children, ...props }: AccordionTriggerProps): ReactNode;
@@ -1,8 +1,10 @@
1
- import type { MouseEvent } from 'react';
1
+ import type { ToastActionData, Toaster } from '@ui-sdk/react/toast';
2
+ import type { ReactNode } from 'react';
2
3
  export type ToastId = string | number;
3
4
  export type ToastAction = {
4
5
  readonly label: string;
5
- readonly onClick: (event: MouseEvent<HTMLButtonElement>) => void;
6
+ readonly shouldDismiss?: boolean;
7
+ readonly onClick: NonNullable<ToastActionData['onAction']>;
6
8
  };
7
9
  export type ToastOptions = {
8
10
  readonly title: string;
@@ -18,18 +20,16 @@ export type LoadingToastOptions = ToastOptions & {
18
20
  export type DismissToastOptions = {
19
21
  readonly id: ToastId;
20
22
  };
21
- declare function success(input: ToastOptions): ToastId;
22
- declare function error(input: ToastOptions): ToastId;
23
- declare function info(input: ToastOptions): ToastId;
24
- declare function warning(input: ToastOptions): ToastId;
25
- declare function loading(input: LoadingToastOptions): ToastId;
26
- declare function dismiss({ id }: DismissToastOptions): void;
23
+ export declare const notificationQueues: {
24
+ queueFor: (scope?: string) => Toaster<ReactNode>;
25
+ bind: (scope: string | undefined, queue: Toaster<ReactNode>) => (() => void) | undefined;
26
+ dismiss: (id: string) => void;
27
+ };
27
28
  export declare const toast: {
28
- readonly success: typeof success;
29
- readonly error: typeof error;
30
- readonly info: typeof info;
31
- readonly warning: typeof warning;
32
- readonly loading: typeof loading;
33
- readonly dismiss: typeof dismiss;
29
+ readonly success: (input: ToastOptions) => ToastId;
30
+ readonly error: (input: ToastOptions) => ToastId;
31
+ readonly info: (input: ToastOptions) => ToastId;
32
+ readonly warning: (input: ToastOptions) => ToastId;
33
+ readonly loading: (input: LoadingToastOptions) => ToastId;
34
+ readonly dismiss: ({ id }: DismissToastOptions) => void;
34
35
  };
35
- export {};
@@ -1,6 +1,12 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ToasterProps as SonnerToasterProps } from 'sonner';
3
- export type ToasterProps = Pick<SonnerToasterProps, 'id' | 'position' | 'hotkey' | 'expand' | 'visibleToasts' | 'closeButton' | 'offset' | 'mobileOffset' | 'dir' | 'swipeDirections' | 'containerAriaLabel'> & {
2
+ export type ToasterProps = {
3
+ readonly id?: string;
4
+ readonly side?: 'top' | 'bottom';
5
+ readonly align?: 'start' | 'center' | 'end';
6
+ readonly isExpanded?: boolean;
7
+ readonly visibleToasts?: number;
8
+ readonly showCloseButton?: boolean;
4
9
  readonly closeButtonAriaLabel?: string;
10
+ readonly containerAriaLabel?: string;
5
11
  };
6
- export declare function Toaster({ closeButton, closeButtonAriaLabel, offset, mobileOffset, ...props }: ToasterProps): ReactNode;
12
+ export declare function Toaster({ id, side, align, isExpanded, visibleToasts, showCloseButton, closeButtonAriaLabel, containerAriaLabel, }: ToasterProps): ReactNode;