panelui-web 0.10.1 → 0.11.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 (99) hide show
  1. package/dist/components/alert/index.d.ts +15 -8
  2. package/dist/components/alert/index.js +65 -18
  3. package/dist/components/alert-dialog/index.d.ts +9 -3
  4. package/dist/components/alert-dialog/index.js +23 -7
  5. package/dist/components/avatar/index.d.ts +9 -3
  6. package/dist/components/avatar/index.js +34 -10
  7. package/dist/components/badge/index.d.ts +57 -0
  8. package/dist/components/badge/index.js +61 -0
  9. package/dist/components/bar-picker/index.d.ts +8 -1
  10. package/dist/components/bar-picker/index.js +35 -26
  11. package/dist/components/button/index.d.ts +68 -46
  12. package/dist/components/button/index.js +38 -2
  13. package/dist/components/button-group/index.d.ts +11 -5
  14. package/dist/components/button-group/index.js +31 -7
  15. package/dist/components/canvas/index.d.ts +9 -3
  16. package/dist/components/canvas/index.js +53 -25
  17. package/dist/components/card/index.d.ts +13 -7
  18. package/dist/components/card/index.js +45 -17
  19. package/dist/components/checkbox/index.d.ts +73 -0
  20. package/dist/components/checkbox/index.js +100 -0
  21. package/dist/components/chip/index.d.ts +79 -0
  22. package/dist/components/chip/index.js +112 -0
  23. package/dist/components/choice-cards/index.d.ts +11 -5
  24. package/dist/components/choice-cards/index.js +25 -6
  25. package/dist/components/command-dock/index.d.ts +16 -9
  26. package/dist/components/command-dock/index.js +76 -19
  27. package/dist/components/day-grid/index.d.ts +12 -6
  28. package/dist/components/day-grid/index.js +71 -27
  29. package/dist/components/dialog/index.d.ts +19 -12
  30. package/dist/components/dialog/index.js +76 -24
  31. package/dist/components/feedback/index.d.ts +20 -13
  32. package/dist/components/feedback/index.js +83 -27
  33. package/dist/components/field/index.d.ts +85 -0
  34. package/dist/components/field/index.js +90 -0
  35. package/dist/components/flow/index.d.ts +21 -14
  36. package/dist/components/flow/index.js +56 -20
  37. package/dist/components/frame/index.d.ts +17 -11
  38. package/dist/components/frame/index.js +73 -22
  39. package/dist/components/input/index.d.ts +9 -24
  40. package/dist/components/input/index.js +53 -6
  41. package/dist/components/inspector/index.d.ts +69 -63
  42. package/dist/components/inspector/index.js +31 -9
  43. package/dist/components/kpi/index.d.ts +20 -14
  44. package/dist/components/kpi/index.js +111 -36
  45. package/dist/components/label/index.d.ts +10 -4
  46. package/dist/components/label/index.js +39 -9
  47. package/dist/components/lane-board/index.d.ts +15 -9
  48. package/dist/components/lane-board/index.js +97 -57
  49. package/dist/components/menu/index.d.ts +10 -4
  50. package/dist/components/menu/index.js +28 -10
  51. package/dist/components/message/index.d.ts +15 -9
  52. package/dist/components/message/index.js +71 -19
  53. package/dist/components/not-found/index.d.ts +10 -4
  54. package/dist/components/not-found/index.js +48 -12
  55. package/dist/components/planet/index.d.ts +11 -5
  56. package/dist/components/planet/index.js +73 -20
  57. package/dist/components/prompt/index.d.ts +30 -23
  58. package/dist/components/prompt/index.js +148 -52
  59. package/dist/components/radio-group/index.d.ts +124 -0
  60. package/dist/components/radio-group/index.js +216 -0
  61. package/dist/components/range-meter/index.d.ts +9 -3
  62. package/dist/components/range-meter/index.js +61 -27
  63. package/dist/components/rolling-number/index.d.ts +8 -1
  64. package/dist/components/rolling-number/index.js +15 -6
  65. package/dist/components/select/index.d.ts +7 -1
  66. package/dist/components/select/index.js +13 -4
  67. package/dist/components/sheet/index.d.ts +8 -2
  68. package/dist/components/sheet/index.js +27 -15
  69. package/dist/components/slider/index.d.ts +11 -4
  70. package/dist/components/slider/index.js +30 -10
  71. package/dist/components/soundwave/index.d.ts +8 -2
  72. package/dist/components/soundwave/index.js +26 -6
  73. package/dist/components/stat/index.d.ts +13 -7
  74. package/dist/components/stat/index.js +45 -15
  75. package/dist/components/table/index.d.ts +128 -0
  76. package/dist/components/table/index.js +145 -0
  77. package/dist/components/tabs/index.d.ts +7 -1
  78. package/dist/components/tabs/index.js +8 -2
  79. package/dist/components/textarea/index.d.ts +0 -23
  80. package/dist/components/textarea/index.js +22 -5
  81. package/dist/components/tilt-card/index.d.ts +9 -3
  82. package/dist/components/tilt-card/index.js +28 -8
  83. package/dist/components/timeline/index.d.ts +20 -13
  84. package/dist/components/timeline/index.js +166 -59
  85. package/dist/components/toast/dither-text.d.ts +13 -0
  86. package/dist/components/toast/dither-text.js +143 -0
  87. package/dist/components/toast/dither.d.ts +29 -0
  88. package/dist/components/toast/dither.js +153 -0
  89. package/dist/components/toast/index.d.ts +108 -0
  90. package/dist/components/toast/index.js +225 -0
  91. package/dist/components/toolbar/index.d.ts +9 -3
  92. package/dist/components/toolbar/index.js +23 -6
  93. package/dist/components/workbench/index.d.ts +50 -43
  94. package/dist/components/workbench/index.js +77 -20
  95. package/dist/components/xy-pad/index.d.ts +9 -3
  96. package/dist/components/xy-pad/index.js +13 -2
  97. package/dist/index.d.ts +7 -0
  98. package/dist/index.js +7 -0
  99. package/package.json +1 -1
@@ -1,6 +1,35 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * Input — a single line to type into.
5
+ *
6
+ * ```tsx
7
+ * <Input placeholder="you@example.com" type="email" />
8
+ *
9
+ * <Input.Group>
10
+ * <Input.Addon><SearchIcon /></Input.Addon>
11
+ * <Input placeholder="Search" />
12
+ * <Input.Addon align="end"><kbd>⌘K</kbd></Input.Addon>
13
+ * </Input.Group>
14
+ * ```
15
+ *
16
+ * ## The group owns the box
17
+ *
18
+ * On its own, the input draws its border, background and focus ring. Inside
19
+ * `Input.Group`, it drops all three and the group draws them around the input
20
+ * and its addons together, so an icon or a unit reads as part of the field and
21
+ * the ring goes round the whole of it. Pressing an addon that is not a button
22
+ * moves focus into the input.
23
+ *
24
+ * ## Inside a Field
25
+ *
26
+ * Put in a `Field`, the input takes the field's label, description and error
27
+ * without ids passed by hand, and turns invalid when the field does.
28
+ */
29
+ import { Input as BaseInput } from '@base-ui/react/input';
3
30
  import { tv } from 'tailwind-variants';
31
+ import { mergeProps } from '@base-ui/react/merge-props';
32
+ import { useRender } from '@base-ui/react/use-render';
4
33
  const inputVariants = tv({
5
34
  slots: {
6
35
  input: [
@@ -54,17 +83,26 @@ const inputVariants = tv({
54
83
  defaultVariants: { size: 'md', align: 'start' },
55
84
  });
56
85
  /** A single-line field. Every attribute of `<input>` passes through. */
57
- function InputRoot({ size, className, type = 'text', ...props }) {
58
- return (_jsx("input", { type: type, "data-slot": "input", className: inputVariants({ size }).input({ className }), ...props }));
86
+ function InputRoot({ size, className, type = 'text', ref, ...props }) {
87
+ return (_jsx(BaseInput, { type: type, "data-slot": "input", ref: ref, className: inputVariants({ size }).input({ className }), ...props }));
59
88
  }
60
89
  InputRoot.displayName = 'Input';
61
90
  /** Draws one box round an input and its addons. */
62
- function InputGroup({ size, className, ...props }) {
63
- return (_jsx("div", { role: "group", "data-slot": "input-group", "data-size": size ?? 'md', className: inputVariants({ size }).group({ className }), ...props }));
91
+ function InputGroup({ size, className, render, ...props }) {
92
+ return useRender({
93
+ defaultTagName: 'div',
94
+ render,
95
+ props: mergeProps({
96
+ role: 'group',
97
+ 'data-slot': 'input-group',
98
+ 'data-size': size ?? 'md',
99
+ className: inputVariants({ size }).group({ className }),
100
+ }, props),
101
+ });
64
102
  }
65
103
  InputGroup.displayName = 'Input.Group';
66
104
  /** An icon, unit, shortcut or button beside the input, inside its box. */
67
- function InputAddon({ align, className, onMouseDown, ...props }) {
105
+ function InputAddon({ align, className, onMouseDown, render, ...props }) {
68
106
  // A press on the addon's own surface is a press on the field. A button or
69
107
  // link inside it is left to do what it does.
70
108
  const focusField = (event) => {
@@ -79,7 +117,16 @@ function InputAddon({ align, className, onMouseDown, ...props }) {
79
117
  event.preventDefault();
80
118
  input.focus();
81
119
  };
82
- return (_jsx("div", { "data-slot": "input-addon", "data-align": align ?? 'start', className: inputVariants({ align }).addon({ className }), onMouseDown: focusField, ...props }));
120
+ return useRender({
121
+ defaultTagName: 'div',
122
+ render,
123
+ props: mergeProps({
124
+ 'data-slot': 'input-addon',
125
+ 'data-align': align ?? 'start',
126
+ className: inputVariants({ align }).addon({ className }),
127
+ onMouseDown: focusField,
128
+ }, props),
129
+ });
83
130
  }
84
131
  InputAddon.displayName = 'Input.Addon';
85
132
  export const Input = Object.assign(InputRoot, {
@@ -1,49 +1,55 @@
1
1
  import { Tabs } from '@base-ui/react/tabs';
2
2
  import { type ComponentProps, type ReactNode } from 'react';
3
+ import { useRender } from '@base-ui/react/use-render';
4
+ import type { ElementType as RenderElementType } from 'react';
5
+ /** Draws a part as another element, or composes it with a component: `render={<a href="/" />}`. */
6
+ type RenderProp<Tag extends RenderElementType> = {
7
+ render?: useRender.ComponentProps<Tag>['render'];
8
+ };
3
9
  declare const inspectorVariants: import("tailwind-variants").TVReturnType<{
4
10
  [key: string]: {
5
- [key: string]: import("tailwind-merge").ClassNameValue | {
6
- root?: import("tailwind-merge").ClassNameValue;
7
- section?: import("tailwind-merge").ClassNameValue;
8
- marker?: import("tailwind-merge").ClassNameValue;
9
- content?: import("tailwind-merge").ClassNameValue;
10
- scrollbar?: import("tailwind-merge").ClassNameValue;
11
- separator?: import("tailwind-merge").ClassNameValue;
12
- tab?: import("tailwind-merge").ClassNameValue;
13
- tooltip?: import("tailwind-merge").ClassNameValue;
14
- page?: import("tailwind-merge").ClassNameValue;
15
- viewport?: import("tailwind-merge").ClassNameValue;
16
- panel?: import("tailwind-merge").ClassNameValue;
17
- thumb?: import("tailwind-merge").ClassNameValue;
18
- chevron?: import("tailwind-merge").ClassNameValue;
19
- sectionTitle?: import("tailwind-merge").ClassNameValue;
20
- railSeparator?: import("tailwind-merge").ClassNameValue;
21
- sectionAction?: import("tailwind-merge").ClassNameValue;
22
- rail?: import("tailwind-merge").ClassNameValue;
23
- sectionContent?: import("tailwind-merge").ClassNameValue;
11
+ [key: string]: import("tailwind-variants").ClassValue | {
12
+ section?: import("tailwind-variants").ClassValue;
13
+ marker?: import("tailwind-variants").ClassValue;
14
+ root?: import("tailwind-variants").ClassValue;
15
+ content?: import("tailwind-variants").ClassValue;
16
+ scrollbar?: import("tailwind-variants").ClassValue;
17
+ separator?: import("tailwind-variants").ClassValue;
18
+ tab?: import("tailwind-variants").ClassValue;
19
+ tooltip?: import("tailwind-variants").ClassValue;
20
+ page?: import("tailwind-variants").ClassValue;
21
+ viewport?: import("tailwind-variants").ClassValue;
22
+ panel?: import("tailwind-variants").ClassValue;
23
+ thumb?: import("tailwind-variants").ClassValue;
24
+ chevron?: import("tailwind-variants").ClassValue;
25
+ sectionTitle?: import("tailwind-variants").ClassValue;
26
+ railSeparator?: import("tailwind-variants").ClassValue;
27
+ sectionAction?: import("tailwind-variants").ClassValue;
28
+ rail?: import("tailwind-variants").ClassValue;
29
+ sectionContent?: import("tailwind-variants").ClassValue;
24
30
  };
25
31
  };
26
32
  } | {
27
33
  [x: string]: {
28
- [x: string]: import("tailwind-merge").ClassNameValue | {
29
- root?: import("tailwind-merge").ClassNameValue;
30
- section?: import("tailwind-merge").ClassNameValue;
31
- marker?: import("tailwind-merge").ClassNameValue;
32
- content?: import("tailwind-merge").ClassNameValue;
33
- scrollbar?: import("tailwind-merge").ClassNameValue;
34
- separator?: import("tailwind-merge").ClassNameValue;
35
- tab?: import("tailwind-merge").ClassNameValue;
36
- tooltip?: import("tailwind-merge").ClassNameValue;
37
- page?: import("tailwind-merge").ClassNameValue;
38
- viewport?: import("tailwind-merge").ClassNameValue;
39
- panel?: import("tailwind-merge").ClassNameValue;
40
- thumb?: import("tailwind-merge").ClassNameValue;
41
- chevron?: import("tailwind-merge").ClassNameValue;
42
- sectionTitle?: import("tailwind-merge").ClassNameValue;
43
- railSeparator?: import("tailwind-merge").ClassNameValue;
44
- sectionAction?: import("tailwind-merge").ClassNameValue;
45
- rail?: import("tailwind-merge").ClassNameValue;
46
- sectionContent?: import("tailwind-merge").ClassNameValue;
34
+ [x: string]: import("tailwind-variants").ClassValue | {
35
+ section?: import("tailwind-variants").ClassValue;
36
+ marker?: import("tailwind-variants").ClassValue;
37
+ root?: import("tailwind-variants").ClassValue;
38
+ content?: import("tailwind-variants").ClassValue;
39
+ scrollbar?: import("tailwind-variants").ClassValue;
40
+ separator?: import("tailwind-variants").ClassValue;
41
+ tab?: import("tailwind-variants").ClassValue;
42
+ tooltip?: import("tailwind-variants").ClassValue;
43
+ page?: import("tailwind-variants").ClassValue;
44
+ viewport?: import("tailwind-variants").ClassValue;
45
+ panel?: import("tailwind-variants").ClassValue;
46
+ thumb?: import("tailwind-variants").ClassValue;
47
+ chevron?: import("tailwind-variants").ClassValue;
48
+ sectionTitle?: import("tailwind-variants").ClassValue;
49
+ railSeparator?: import("tailwind-variants").ClassValue;
50
+ sectionAction?: import("tailwind-variants").ClassValue;
51
+ rail?: import("tailwind-variants").ClassValue;
52
+ sectionContent?: import("tailwind-variants").ClassValue;
47
53
  };
48
54
  };
49
55
  } | {}, {
@@ -67,25 +73,25 @@ declare const inspectorVariants: import("tailwind-variants").TVReturnType<{
67
73
  separator: string;
68
74
  }, undefined, {
69
75
  [key: string]: {
70
- [key: string]: import("tailwind-merge").ClassNameValue | {
71
- root?: import("tailwind-merge").ClassNameValue;
72
- section?: import("tailwind-merge").ClassNameValue;
73
- marker?: import("tailwind-merge").ClassNameValue;
74
- content?: import("tailwind-merge").ClassNameValue;
75
- scrollbar?: import("tailwind-merge").ClassNameValue;
76
- separator?: import("tailwind-merge").ClassNameValue;
77
- tab?: import("tailwind-merge").ClassNameValue;
78
- tooltip?: import("tailwind-merge").ClassNameValue;
79
- page?: import("tailwind-merge").ClassNameValue;
80
- viewport?: import("tailwind-merge").ClassNameValue;
81
- panel?: import("tailwind-merge").ClassNameValue;
82
- thumb?: import("tailwind-merge").ClassNameValue;
83
- chevron?: import("tailwind-merge").ClassNameValue;
84
- sectionTitle?: import("tailwind-merge").ClassNameValue;
85
- railSeparator?: import("tailwind-merge").ClassNameValue;
86
- sectionAction?: import("tailwind-merge").ClassNameValue;
87
- rail?: import("tailwind-merge").ClassNameValue;
88
- sectionContent?: import("tailwind-merge").ClassNameValue;
76
+ [key: string]: import("tailwind-variants").ClassValue | {
77
+ section?: import("tailwind-variants").ClassValue;
78
+ marker?: import("tailwind-variants").ClassValue;
79
+ root?: import("tailwind-variants").ClassValue;
80
+ content?: import("tailwind-variants").ClassValue;
81
+ scrollbar?: import("tailwind-variants").ClassValue;
82
+ separator?: import("tailwind-variants").ClassValue;
83
+ tab?: import("tailwind-variants").ClassValue;
84
+ tooltip?: import("tailwind-variants").ClassValue;
85
+ page?: import("tailwind-variants").ClassValue;
86
+ viewport?: import("tailwind-variants").ClassValue;
87
+ panel?: import("tailwind-variants").ClassValue;
88
+ thumb?: import("tailwind-variants").ClassValue;
89
+ chevron?: import("tailwind-variants").ClassValue;
90
+ sectionTitle?: import("tailwind-variants").ClassValue;
91
+ railSeparator?: import("tailwind-variants").ClassValue;
92
+ sectionAction?: import("tailwind-variants").ClassValue;
93
+ rail?: import("tailwind-variants").ClassValue;
94
+ sectionContent?: import("tailwind-variants").ClassValue;
89
95
  };
90
96
  };
91
97
  } | {}, {
@@ -107,7 +113,7 @@ declare const inspectorVariants: import("tailwind-variants").TVReturnType<{
107
113
  sectionAction: string;
108
114
  sectionContent: string[];
109
115
  separator: string;
110
- }, import("tailwind-variants").TVReturnType<unknown, {
116
+ }, import("tailwind-variants").TVReturnTypeLike<unknown, {
111
117
  root: string;
112
118
  rail: string[];
113
119
  marker: string[];
@@ -126,7 +132,7 @@ declare const inspectorVariants: import("tailwind-variants").TVReturnType<{
126
132
  sectionAction: string;
127
133
  sectionContent: string[];
128
134
  separator: string;
129
- }, undefined, unknown, unknown, undefined>>;
135
+ }>>;
130
136
  export interface InspectorProps extends Omit<Tabs.Root.Props, 'className' | 'orientation'> {
131
137
  className?: string;
132
138
  }
@@ -161,7 +167,7 @@ declare namespace InspectorTab {
161
167
  export interface InspectorRailSeparatorProps extends ComponentProps<'span'> {
162
168
  }
163
169
  /** A short line between groups of pages on the rail. */
164
- declare function InspectorRailSeparator({ className, ...props }: InspectorRailSeparatorProps): import("react").JSX.Element;
170
+ declare function InspectorRailSeparator({ className, render, ...props }: InspectorRailSeparatorProps & RenderProp<'span'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
165
171
  declare namespace InspectorRailSeparator {
166
172
  var displayName: string;
167
173
  }
@@ -172,7 +178,7 @@ export interface InspectorPanelProps extends ComponentProps<'div'> {
172
178
  * page longer than that scrolls inside it. Without pages, its children are
173
179
  * one page of sections.
174
180
  */
175
- declare function InspectorPanel({ className, children, ...props }: InspectorPanelProps): import("react").JSX.Element;
181
+ declare function InspectorPanel({ className, children, render, ...props }: InspectorPanelProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
176
182
  declare namespace InspectorPanel {
177
183
  var displayName: string;
178
184
  }
@@ -209,7 +215,7 @@ declare namespace InspectorSectionTitle {
209
215
  export interface InspectorSectionActionProps extends ComponentProps<'div'> {
210
216
  }
211
217
  /** What sits at the end of the title's line: the switch for the whole section, or a Reset. */
212
- declare function InspectorSectionAction({ className, ...props }: InspectorSectionActionProps): import("react").JSX.Element;
218
+ declare function InspectorSectionAction({ className, render, ...props }: InspectorSectionActionProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
213
219
  declare namespace InspectorSectionAction {
214
220
  var displayName: string;
215
221
  }
@@ -223,7 +229,7 @@ declare namespace InspectorSectionContent {
223
229
  export interface InspectorSeparatorProps extends ComponentProps<'div'> {
224
230
  }
225
231
  /** A hairline between sections that belong to different things. */
226
- declare function InspectorSeparator({ className, ...props }: InspectorSeparatorProps): import("react").JSX.Element;
232
+ declare function InspectorSeparator({ className, render, ...props }: InspectorSeparatorProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
227
233
  declare namespace InspectorSeparator {
228
234
  var displayName: string;
229
235
  }
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  /**
4
4
  * Inspector — the settings panel beside an editor's canvas: a rail of
5
5
  * icons, each opening a page of titled sections.
@@ -43,6 +43,8 @@ import { Tabs } from '@base-ui/react/tabs';
43
43
  import { Tooltip } from '@base-ui/react/tooltip';
44
44
  import { createContext, useContext } from 'react';
45
45
  import { tv } from 'tailwind-variants';
46
+ import { mergeProps } from '@base-ui/react/merge-props';
47
+ import { useRender } from '@base-ui/react/use-render';
46
48
  const EASE = 'ease-[cubic-bezier(0.3,1.2,0.4,1)]';
47
49
  const inspectorVariants = tv({
48
50
  slots: {
@@ -133,9 +135,13 @@ function InspectorTab({ label, className, children, ...props }) {
133
135
  }
134
136
  InspectorTab.displayName = 'Inspector.Tab';
135
137
  /** A short line between groups of pages on the rail. */
136
- function InspectorRailSeparator({ className, ...props }) {
138
+ function InspectorRailSeparator({ className, render, ...props }) {
137
139
  const slots = inspectorVariants();
138
- return _jsx("span", { "aria-hidden": true, "data-slot": "inspector-rail-separator", className: slots.railSeparator({ className }), ...props });
140
+ return useRender({
141
+ defaultTagName: 'span',
142
+ render,
143
+ props: mergeProps({ 'aria-hidden': true, 'data-slot': 'inspector-rail-separator', className: slots.railSeparator({ className }) }, props),
144
+ });
139
145
  }
140
146
  InspectorRailSeparator.displayName = 'Inspector.RailSeparator';
141
147
  /**
@@ -143,9 +149,17 @@ InspectorRailSeparator.displayName = 'Inspector.RailSeparator';
143
149
  * page longer than that scrolls inside it. Without pages, its children are
144
150
  * one page of sections.
145
151
  */
146
- function InspectorPanel({ className, children, ...props }) {
152
+ function InspectorPanel({ className, children, render, ...props }) {
147
153
  const slots = inspectorVariants();
148
- return (_jsx("div", { "data-slot": "inspector-panel", className: slots.panel({ className }), ...props, children: hasPages(children) ? children : _jsx(Scroll, { children: children }) }));
154
+ return useRender({
155
+ defaultTagName: 'div',
156
+ render,
157
+ props: mergeProps({
158
+ 'data-slot': 'inspector-panel',
159
+ className: slots.panel({ className }),
160
+ children: _jsx(_Fragment, { children: hasPages(children) ? children : _jsx(Scroll, { children: children }) }),
161
+ }, props),
162
+ });
149
163
  }
150
164
  InspectorPanel.displayName = 'Inspector.Panel';
151
165
  /** Whether the panel's children are pages, rather than sections written straight into it. */
@@ -193,10 +207,14 @@ function InspectorSectionTitle({ className, children, ...props }) {
193
207
  }
194
208
  InspectorSectionTitle.displayName = 'Inspector.SectionTitle';
195
209
  /** What sits at the end of the title's line: the switch for the whole section, or a Reset. */
196
- function InspectorSectionAction({ className, ...props }) {
210
+ function InspectorSectionAction({ className, render, ...props }) {
197
211
  useSection('Inspector.SectionAction');
198
212
  const slots = inspectorVariants();
199
- return _jsx("div", { "data-slot": "inspector-section-action", className: slots.sectionAction({ className }), ...props });
213
+ return useRender({
214
+ defaultTagName: 'div',
215
+ render,
216
+ props: mergeProps({ 'data-slot': 'inspector-section-action', className: slots.sectionAction({ className }) }, props),
217
+ });
200
218
  }
201
219
  InspectorSectionAction.displayName = 'Inspector.SectionAction';
202
220
  /** The controls under the title, stacked with an even gap. */
@@ -210,9 +228,13 @@ function InspectorSectionContent({ className, children, ...props }) {
210
228
  }
211
229
  InspectorSectionContent.displayName = 'Inspector.SectionContent';
212
230
  /** A hairline between sections that belong to different things. */
213
- function InspectorSeparator({ className, ...props }) {
231
+ function InspectorSeparator({ className, render, ...props }) {
214
232
  const slots = inspectorVariants();
215
- return _jsx("div", { role: "separator", "data-slot": "inspector-separator", className: slots.separator({ className }), ...props });
233
+ return useRender({
234
+ defaultTagName: 'div',
235
+ render,
236
+ props: mergeProps({ role: 'separator', 'data-slot': 'inspector-separator', className: slots.separator({ className }) }, props),
237
+ });
216
238
  }
217
239
  InspectorSeparator.displayName = 'Inspector.Separator';
218
240
  export const Inspector = Object.assign(InspectorRoot, {
@@ -42,6 +42,12 @@
42
42
  * adds nothing to the JavaScript a page sends.
43
43
  */
44
44
  import type { ComponentProps, ReactNode } from 'react';
45
+ import { useRender } from '@base-ui/react/use-render';
46
+ import type { ElementType as RenderElementType } from 'react';
47
+ /** Draws a part as another element, or composes it with a component: `render={<a href="/" />}`. */
48
+ type RenderProp<Tag extends RenderElementType> = {
49
+ render?: useRender.ComponentProps<Tag>['render'];
50
+ };
45
51
  /** Which of the theme's roles a chart or a bar is drawn in. */
46
52
  export type KpiColor = 'primary' | 'info' | 'success' | 'warning' | 'destructive';
47
53
  /** Which direction of movement is the good news for this metric. */
@@ -52,14 +58,14 @@ export interface KpiProps extends ComponentProps<'div'> {
52
58
  /** Draws the metric as a card of its own. Leave it off inside a frame or a group. */
53
59
  surface?: boolean;
54
60
  }
55
- declare function KpiRoot({ surface, className, ...props }: KpiProps): import("react").JSX.Element;
61
+ declare function KpiRoot({ surface, className, render, ...props }: KpiProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
56
62
  declare namespace KpiRoot {
57
63
  var displayName: string;
58
64
  }
59
65
  export interface KpiHeaderProps extends ComponentProps<'div'> {
60
66
  }
61
67
  /** The row over the number: an icon, the title, and anything at the end. */
62
- declare function KpiHeader({ className, ...props }: KpiHeaderProps): import("react").JSX.Element;
68
+ declare function KpiHeader({ className, render, ...props }: KpiHeaderProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
63
69
  declare namespace KpiHeader {
64
70
  var displayName: string;
65
71
  }
@@ -68,21 +74,21 @@ export interface KpiIconProps extends ComponentProps<'span'> {
68
74
  tone?: KpiTone;
69
75
  }
70
76
  /** A small tile for an icon, at the start of the header. */
71
- declare function KpiIcon({ tone, className, ...props }: KpiIconProps): import("react").JSX.Element;
77
+ declare function KpiIcon({ tone, className, render, ...props }: KpiIconProps & RenderProp<'span'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
72
78
  declare namespace KpiIcon {
73
79
  var displayName: string;
74
80
  }
75
81
  export interface KpiTitleProps extends ComponentProps<'div'> {
76
82
  }
77
83
  /** What the number measures. */
78
- declare function KpiTitle({ className, ...props }: KpiTitleProps): import("react").JSX.Element;
84
+ declare function KpiTitle({ className, render, ...props }: KpiTitleProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
79
85
  declare namespace KpiTitle {
80
86
  var displayName: string;
81
87
  }
82
88
  export interface KpiActionsProps extends ComponentProps<'div'> {
83
89
  }
84
90
  /** Whatever belongs at the end of the header: a period, a badge, a button. */
85
- declare function KpiActions({ className, ...props }: KpiActionsProps): import("react").JSX.Element;
91
+ declare function KpiActions({ className, render, ...props }: KpiActionsProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
86
92
  declare namespace KpiActions {
87
93
  var displayName: string;
88
94
  }
@@ -91,21 +97,21 @@ export interface KpiContentProps extends ComponentProps<'div'> {
91
97
  layout?: 'below' | 'inline';
92
98
  }
93
99
  /** The row the number is in, with a trend or a chart at its other end. */
94
- declare function KpiContent({ layout, className, ...props }: KpiContentProps): import("react").JSX.Element;
100
+ declare function KpiContent({ layout, className, render, ...props }: KpiContentProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
95
101
  declare namespace KpiContent {
96
102
  var displayName: string;
97
103
  }
98
104
  export interface KpiStatProps extends ComponentProps<'div'> {
99
105
  }
100
106
  /** Title, value and trend stacked as one block, for a row with a chart beside it. */
101
- declare function KpiStat({ className, ...props }: KpiStatProps): import("react").JSX.Element;
107
+ declare function KpiStat({ className, render, ...props }: KpiStatProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
102
108
  declare namespace KpiStat {
103
109
  var displayName: string;
104
110
  }
105
111
  export interface KpiValueProps extends ComponentProps<'div'> {
106
112
  }
107
113
  /** The number. */
108
- declare function KpiValue({ className, ...props }: KpiValueProps): import("react").JSX.Element;
114
+ declare function KpiValue({ className, render, ...props }: KpiValueProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
109
115
  declare namespace KpiValue {
110
116
  var displayName: string;
111
117
  }
@@ -127,7 +133,7 @@ export interface KpiTrendProps extends Omit<ComponentProps<'span'>, 'children'>
127
133
  * The change. Colour comes from what the movement means, not from its sign: a
128
134
  * fall in churn is good news and is drawn as good news.
129
135
  */
130
- declare function KpiTrend({ value, format, goodDirection, variant, caption, threshold, className, ...props }: KpiTrendProps): import("react").JSX.Element;
136
+ declare function KpiTrend({ value, format, goodDirection, variant, caption, threshold, className, render, ...props }: KpiTrendProps & RenderProp<'span'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
131
137
  declare namespace KpiTrend {
132
138
  var displayName: string;
133
139
  }
@@ -149,7 +155,7 @@ export interface KpiChartProps extends Omit<ComponentProps<'svg'>, 'children' |
149
155
  strokeWidth?: number;
150
156
  }
151
157
  /** The sparkline: the shape of the number over time, with no axis and no values. */
152
- declare function KpiChart({ data, color, filled, height, inline, strokeWidth, className, style, ...props }: KpiChartProps): import("react").JSX.Element;
158
+ declare function KpiChart({ data, color, filled, height, inline, strokeWidth, className, style, render, ...props }: KpiChartProps & RenderProp<'svg'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
153
159
  declare namespace KpiChart {
154
160
  var displayName: string;
155
161
  }
@@ -166,21 +172,21 @@ export interface KpiProgressProps extends Omit<ComponentProps<'div'>, 'children'
166
172
  color?: KpiColor;
167
173
  }
168
174
  /** Progress towards a target, under the number. */
169
- declare function KpiProgress({ value, maxValue, label, showValueLabel, color, className, ...props }: KpiProgressProps): import("react").JSX.Element;
175
+ declare function KpiProgress({ value, maxValue, label, showValueLabel, color, className, render, ...props }: KpiProgressProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
170
176
  declare namespace KpiProgress {
171
177
  var displayName: string;
172
178
  }
173
179
  export interface KpiFooterProps extends ComponentProps<'div'> {
174
180
  }
175
181
  /** A quiet line under everything: when it was measured, how long is left. */
176
- declare function KpiFooter({ className, ...props }: KpiFooterProps): import("react").JSX.Element;
182
+ declare function KpiFooter({ className, render, ...props }: KpiFooterProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
177
183
  declare namespace KpiFooter {
178
184
  var displayName: string;
179
185
  }
180
186
  export interface KpiSeparatorProps extends ComponentProps<'div'> {
181
187
  }
182
188
  /** A rule between two parts of one card. */
183
- declare function KpiSeparator({ className, ...props }: KpiSeparatorProps): import("react").JSX.Element;
189
+ declare function KpiSeparator({ className, render, ...props }: KpiSeparatorProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
184
190
  declare namespace KpiSeparator {
185
191
  var displayName: string;
186
192
  }
@@ -191,7 +197,7 @@ export interface KpiGroupProps extends ComponentProps<'div'> {
191
197
  surface?: boolean;
192
198
  }
193
199
  /** Several metrics as one panel, with a rule between each and the next. */
194
- declare function KpiGroup({ orientation, surface, className, ...props }: KpiGroupProps): import("react").JSX.Element;
200
+ declare function KpiGroup({ orientation, surface, className, render, ...props }: KpiGroupProps & RenderProp<'div'>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
195
201
  declare namespace KpiGroup {
196
202
  var displayName: string;
197
203
  }