@object-ui/components 17.2.0 → 17.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1890 -0
- package/README.md +23 -31
- package/dist/custom/combobox.d.ts +12 -2
- package/dist/custom/fullscreen-editor.d.ts +56 -0
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/navigation-overlay.d.ts +7 -1
- package/dist/index.css +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3226 -2880
- package/dist/index.umd.cjs +6 -6
- package/dist/lib/close-label.d.ts +50 -0
- package/dist/lib/sidebar-cookie.d.ts +55 -0
- package/dist/renderers/action/action-bar.d.ts +3 -3
- package/dist/renderers/action/action-button.d.ts +12 -2
- package/dist/renderers/action/action-group.d.ts +10 -4
- package/dist/renderers/action/action-icon.d.ts +10 -2
- package/dist/renderers/action/action-menu.d.ts +20 -2
- package/dist/renderers/action/auto-trigger.d.ts +20 -0
- package/dist/renderers/action/visibility-gate.d.ts +81 -0
- package/dist/renderers/basic/record-picker.d.ts +10 -1
- package/dist/renderers/complex/data-table.d.ts +100 -4
- package/dist/renderers/layout/containers.d.ts +2 -1
- package/dist/ui/command.d.ts +1 -1
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ pnpm shadcn:check
|
|
|
27
27
|
pnpm shadcn:update button --backup
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
**📚 See [
|
|
30
|
+
**📚 See [README_SHADCN_SYNC.md](./README_SHADCN_SYNC.md) for the complete guide.**
|
|
31
31
|
|
|
32
32
|
## Installation
|
|
33
33
|
|
|
@@ -38,33 +38,36 @@ npm install @object-ui/components @object-ui/react @object-ui/core
|
|
|
38
38
|
**Peer Dependencies:**
|
|
39
39
|
- `react` ^18.0.0 || ^19.0.0
|
|
40
40
|
- `react-dom` ^18.0.0 || ^19.0.0
|
|
41
|
-
- `tailwindcss` ^
|
|
41
|
+
- `tailwindcss` ^4.2.1
|
|
42
42
|
|
|
43
43
|
## Setup
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
There is no `tailwind.config.js` step. This package is Tailwind 4, which is
|
|
46
|
+
configured in CSS: it has no such file of its own, and consuming it does not need
|
|
47
|
+
one on your side either.
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
### 1. Import Styles
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
module.exports = {
|
|
51
|
-
content: [
|
|
52
|
-
'./src/**/*.{js,jsx,ts,tsx}',
|
|
53
|
-
'./node_modules/@object-ui/components/**/*.{js,ts,jsx,tsx}'
|
|
54
|
-
],
|
|
55
|
-
// ... your config
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 2. Import Styles
|
|
60
|
-
|
|
61
|
-
Add to your main CSS file:
|
|
51
|
+
Add to your main CSS file, after your own Tailwind entry:
|
|
62
52
|
|
|
63
53
|
```css
|
|
64
|
-
@import '
|
|
54
|
+
@import 'tailwindcss';
|
|
55
|
+
@import '@object-ui/components/style.css';
|
|
65
56
|
```
|
|
66
57
|
|
|
67
|
-
|
|
58
|
+
`style.css` is the stylesheet this package compiles at build time from its own
|
|
59
|
+
sources. It already carries every utility its components use **and** the theme
|
|
60
|
+
tokens those utilities are built on — `bg-primary`, `border-input`, `ring-ring`
|
|
61
|
+
and the rest of the Shadcn palette — so importing it is the whole of the styling
|
|
62
|
+
setup.
|
|
63
|
+
|
|
64
|
+
You do **not** add a `@source` line for `node_modules/@object-ui/components`.
|
|
65
|
+
Pointing Tailwind at the published files generates the shape-only utilities a
|
|
66
|
+
second time and still cannot produce the themed ones, because the `@theme` block
|
|
67
|
+
they come from lives in this package's unpublished source. Your own Tailwind
|
|
68
|
+
entry goes on generating the classes your own source uses, as it always did.
|
|
69
|
+
|
|
70
|
+
### 2. Register Components
|
|
68
71
|
|
|
69
72
|
```tsx
|
|
70
73
|
import { registerDefaultRenderers } from '@object-ui/components'
|
|
@@ -209,18 +212,7 @@ registerRenderer('custom-button', CustomButton)
|
|
|
209
212
|
|
|
210
213
|
## API Reference
|
|
211
214
|
|
|
212
|
-
See [full documentation](https://objectui.org/
|
|
213
|
-
|
|
214
|
-
<!-- release-metadata:v3.3.0 -->
|
|
215
|
-
|
|
216
|
-
## Compatibility
|
|
217
|
-
|
|
218
|
-
- **React:** 18.x or 19.x
|
|
219
|
-
- **Node.js:** ≥ 18
|
|
220
|
-
- **TypeScript:** ≥ 5.0 (strict mode)
|
|
221
|
-
- **`@objectstack/spec`:** ^3.3.0
|
|
222
|
-
- **`@objectstack/client`:** ^3.3.0
|
|
223
|
-
- **Tailwind CSS:** ≥ 3.4 (for packages with UI)
|
|
215
|
+
See [full documentation](https://objectui.org/docs/components) for detailed API reference.
|
|
224
216
|
|
|
225
217
|
## Links
|
|
226
218
|
|
|
@@ -10,7 +10,17 @@ export interface ComboboxOption {
|
|
|
10
10
|
value: string;
|
|
11
11
|
label: string;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Beyond its own named props, the combobox accepts standard button attributes
|
|
15
|
+
* (`id`, `aria-*`, `data-*`, handlers, …) and forwards them to the trigger —
|
|
16
|
+
* the focusable `role="combobox"` button a user and their screen reader
|
|
17
|
+
* actually interact with. Without this seam a field widget rendering a
|
|
18
|
+
* Combobox had no element to deliver `aria-invalid` / `aria-describedby` to
|
|
19
|
+
* after a validation failure (objectui#3318; the same reason #3306 routes the
|
|
20
|
+
* select's pass-through onto `SelectTrigger`). `value` / `onChange` are
|
|
21
|
+
* omitted: this component's own `value` / `onValueChange` contract owns them.
|
|
22
|
+
*/
|
|
23
|
+
export interface ComboboxProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value" | "onChange"> {
|
|
14
24
|
options: ComboboxOption[];
|
|
15
25
|
value?: string;
|
|
16
26
|
onValueChange?: (value: string) => void;
|
|
@@ -20,4 +30,4 @@ export interface ComboboxProps {
|
|
|
20
30
|
className?: string;
|
|
21
31
|
disabled?: boolean;
|
|
22
32
|
}
|
|
23
|
-
export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled, }: ComboboxProps): React.JSX.Element;
|
|
33
|
+
export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled, ...triggerProps }: ComboboxProps): React.JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FullscreenEditorProps {
|
|
3
|
+
/**
|
|
4
|
+
* The committed value. Seeds the draft each time the dialog opens — read at
|
|
5
|
+
* open time, not held, so a value that changes underneath while the dialog is
|
|
6
|
+
* closed is picked up on the next open.
|
|
7
|
+
*/
|
|
8
|
+
value: string;
|
|
9
|
+
/** Called once with the draft when the user confirms. Gated — see above. */
|
|
10
|
+
onCommit: (next: string) => void;
|
|
11
|
+
/** Field label — the dialog title and part of the toggle's accessible name. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Namespace for this surface's fullscreen test ids:
|
|
15
|
+
* `<prefix>-fullscreen-toggle` / `-dialog` / `-save`. One form can contain a
|
|
16
|
+
* textarea AND a markdown field, so a single shared id would leave a test
|
|
17
|
+
* unable to say which surface it had found. The injected editor's own test id
|
|
18
|
+
* belongs to `children` for the same reason.
|
|
19
|
+
*/
|
|
20
|
+
testIdPrefix: string;
|
|
21
|
+
/**
|
|
22
|
+
* The host field is shown plainly and is not editable. Renders NO affordance
|
|
23
|
+
* at all — see the `readOnly` / `disabled` section above for why this is not
|
|
24
|
+
* a disabled toggle.
|
|
25
|
+
*
|
|
26
|
+
* **Producers**: the form renderer's built-in `textarea` branch, which
|
|
27
|
+
* resolves it from the field's static `readonly` and from a `readonlyWhen`
|
|
28
|
+
* CEL rule. The registered widgets early-return a read-only display before
|
|
29
|
+
* they render this component, so they never pass it.
|
|
30
|
+
*/
|
|
31
|
+
readOnly?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The host field is not interactive. Disables the toggle, the "Done" button
|
|
34
|
+
* and the write-back, and is handed to `children` so the host's own editor
|
|
35
|
+
* renders inert too.
|
|
36
|
+
*
|
|
37
|
+
* **Producer**: the form renderer computes `disabled || fieldDisabled ||
|
|
38
|
+
* isSubmitting || optionGroupGated` and both forwards it to registered
|
|
39
|
+
* widgets and applies it on the built-in branch.
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The editor itself, rendered inside the dialog body against the draft. The
|
|
44
|
+
* host passes the SAME editor it renders inline.
|
|
45
|
+
*
|
|
46
|
+
* The third argument is this component's `disabled`, and the host is expected
|
|
47
|
+
* to put it on the control it renders: only the host knows which element its
|
|
48
|
+
* editor's disabled state belongs on. Ignoring it is not a write-back hole —
|
|
49
|
+
* `onCommit` is gated here regardless — but it does leave a control that looks
|
|
50
|
+
* editable while the field is not, so every in-repo host applies it.
|
|
51
|
+
*/
|
|
52
|
+
children: (draft: string, setDraft: (next: string) => void, disabled: boolean) => React.ReactNode;
|
|
53
|
+
/** Optional footer status for the draft (e.g. a character counter). */
|
|
54
|
+
footer?: (draft: string) => React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
export declare function FullscreenEditor({ value, onCommit, label, testIdPrefix, readOnly, disabled, children, footer, }: FullscreenEditorProps): React.JSX.Element | null;
|
package/dist/custom/index.d.ts
CHANGED
|
@@ -53,7 +53,13 @@ export interface NavigationOverlayProps {
|
|
|
53
53
|
* When omitted, the expand button is not rendered.
|
|
54
54
|
*/
|
|
55
55
|
onExpand?: () => void;
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Optional label for the expand button (accessible name & tooltip).
|
|
58
|
+
*
|
|
59
|
+
* When omitted the overlay resolves `detail.openAsFullPage` from the session
|
|
60
|
+
* locale (English when no `I18nProvider` is mounted) — it is no longer a
|
|
61
|
+
* hardcoded English literal (objectstack#5506).
|
|
62
|
+
*/
|
|
57
63
|
expandLabel?: string;
|
|
58
64
|
/**
|
|
59
65
|
* Optional storage key for persisting the user's manually-resized drawer
|
package/dist/index.css
CHANGED
|
@@ -443,6 +443,9 @@
|
|
|
443
443
|
.left-\[50\%\] {
|
|
444
444
|
left: 50%;
|
|
445
445
|
}
|
|
446
|
+
.isolate {
|
|
447
|
+
isolation: isolate;
|
|
448
|
+
}
|
|
446
449
|
.z-10 {
|
|
447
450
|
z-index: 10;
|
|
448
451
|
}
|
|
@@ -1259,6 +1262,12 @@
|
|
|
1259
1262
|
--tw-translate-y: -50%;
|
|
1260
1263
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1261
1264
|
}
|
|
1265
|
+
.scale-0 {
|
|
1266
|
+
--tw-scale-x: 0%;
|
|
1267
|
+
--tw-scale-y: 0%;
|
|
1268
|
+
--tw-scale-z: 0%;
|
|
1269
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
1270
|
+
}
|
|
1262
1271
|
.scale-75 {
|
|
1263
1272
|
--tw-scale-x: 75%;
|
|
1264
1273
|
--tw-scale-y: 75%;
|
|
@@ -2445,6 +2454,10 @@
|
|
|
2445
2454
|
.italic {
|
|
2446
2455
|
font-style: italic;
|
|
2447
2456
|
}
|
|
2457
|
+
.ordinal {
|
|
2458
|
+
--tw-ordinal: ordinal;
|
|
2459
|
+
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
|
|
2460
|
+
}
|
|
2448
2461
|
.tabular-nums {
|
|
2449
2462
|
--tw-numeric-spacing: tabular-nums;
|
|
2450
2463
|
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
|
|
@@ -2573,6 +2586,10 @@
|
|
|
2573
2586
|
--tw-blur: blur(8px);
|
|
2574
2587
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
2575
2588
|
}
|
|
2589
|
+
.invert {
|
|
2590
|
+
--tw-invert: invert(100%);
|
|
2591
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
2592
|
+
}
|
|
2576
2593
|
.filter {
|
|
2577
2594
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
2578
2595
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { cn } from './lib/utils';
|
|
|
2
2
|
export { renderChildren } from './lib/utils';
|
|
3
3
|
export { cva } from 'class-variance-authority';
|
|
4
4
|
export { getLazyIcon, isLucideIconName, LazyIcon, toKebabIconName } from './lib/lazy-icon';
|
|
5
|
+
export { hasDeclaredVisibilityGate } from './renderers/action/visibility-gate';
|
|
5
6
|
export { registerPlaceholders } from './renderers/placeholders';
|
|
6
7
|
export { GridFieldAuthoringProvider, useGridFieldAuthoring, type GridFieldAuthoring, } from './context/gridFieldAuthoring';
|
|
7
8
|
export * from './ui';
|