@object-ui/components 17.6.0 → 18.0.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 (72) hide show
  1. package/CHANGELOG.md +9618 -0
  2. package/README.md +27 -3
  3. package/dist/custom/RecordTitleChip.d.ts +4 -3
  4. package/dist/custom/button-group.d.ts +1 -1
  5. package/dist/custom/combobox.d.ts +2 -4
  6. package/dist/custom/dialog-viewport-gutter.d.ts +37 -0
  7. package/dist/custom/empty-state-link.d.ts +63 -0
  8. package/dist/custom/empty.d.ts +16 -4
  9. package/dist/custom/field.d.ts +1 -1
  10. package/dist/custom/filter-builder.d.ts +225 -77
  11. package/dist/custom/grouping-editor.d.ts +4 -0
  12. package/dist/custom/horizontal-overflow.d.ts +18 -0
  13. package/dist/custom/index.d.ts +4 -1
  14. package/dist/custom/item.d.ts +1 -1
  15. package/dist/custom/kbd.d.ts +1 -1
  16. package/dist/custom/mobile-dialog-content.d.ts +22 -1
  17. package/dist/custom/navigation-overlay.d.ts +105 -0
  18. package/dist/custom/refresh-indicator.d.ts +8 -2
  19. package/dist/custom/sort-builder.d.ts +8 -0
  20. package/dist/custom/use-horizontal-overflow.d.ts +36 -0
  21. package/dist/custom/view-states.d.ts +74 -1
  22. package/dist/hooks/related-count-store.d.ts +81 -28
  23. package/dist/index.css +345 -361
  24. package/dist/index.d.ts +11 -3
  25. package/dist/index.js +8480 -6628
  26. package/dist/index.umd.cjs +11 -15
  27. package/dist/lib/close-label.d.ts +1 -2
  28. package/dist/lib/date-fns-locale.d.ts +41 -0
  29. package/dist/lib/inline-markdown.d.ts +64 -0
  30. package/dist/lib/lazy-icon.d.ts +32 -1
  31. package/dist/lib/lucide-record-icon-names.d.ts +30 -0
  32. package/dist/lib/utils.d.ts +113 -0
  33. package/dist/renderers/action/action-bar.d.ts +8 -36
  34. package/dist/renderers/action/action-button.d.ts +15 -4
  35. package/dist/renderers/action/action-group.d.ts +5 -4
  36. package/dist/renderers/action/action-icon.d.ts +12 -2
  37. package/dist/renderers/action/action-menu.d.ts +5 -2
  38. package/dist/renderers/action/auto-trigger.d.ts +19 -4
  39. package/dist/renderers/action/disabled-reason.d.ts +49 -0
  40. package/dist/renderers/action/resolve-icon.d.ts +27 -2
  41. package/dist/renderers/action/static-params.d.ts +71 -0
  42. package/dist/renderers/action/visibility-gate.d.ts +11 -3
  43. package/dist/renderers/basic/data-list.d.ts +2 -1
  44. package/dist/renderers/basic/elements.d.ts +2 -0
  45. package/dist/renderers/basic/html-elements.d.ts +7 -3
  46. package/dist/renderers/basic/readProps.d.ts +60 -0
  47. package/dist/renderers/basic/record-picker.d.ts +3 -2
  48. package/dist/renderers/complex/data-table.d.ts +31 -14
  49. package/dist/renderers/complex/dataTableBindDiagnostic.d.ts +187 -0
  50. package/dist/renderers/layout/box.d.ts +8 -0
  51. package/dist/renderers/layout/containers.d.ts +28 -23
  52. package/dist/renderers/layout/page-block-grid.d.ts +29 -0
  53. package/dist/renderers/layout/page-block-span.d.ts +50 -0
  54. package/dist/renderers/layout/page-description-context.d.ts +14 -0
  55. package/dist/renderers/layout/page-print.d.ts +14 -0
  56. package/dist/renderers/layout/page-region-posture.d.ts +82 -0
  57. package/dist/renderers/layout/react-page.d.ts +4 -0
  58. package/dist/renderers/navigation/sidebar.d.ts +31 -0
  59. package/dist/ui/badge.d.ts +1 -1
  60. package/dist/ui/button.d.ts +1 -1
  61. package/dist/ui/calendar.d.ts +2 -1
  62. package/dist/ui/command.d.ts +7 -7
  63. package/dist/ui/index.d.ts +0 -1
  64. package/dist/ui/input-otp.d.ts +2 -2
  65. package/dist/ui/sheet.d.ts +1 -1
  66. package/dist/ui/sidebar.d.ts +2 -1
  67. package/package.json +14 -15
  68. package/dist/SchemaRenderer.d.ts +0 -4
  69. package/dist/custom/export-progress-dialog.d.ts +0 -43
  70. package/dist/hooks/use-export-job.d.ts +0 -34
  71. package/dist/ui/chart.d.ts +0 -56
  72. package/dist/ui/toast.d.ts +0 -22
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * The page `description` a titled `page:header` draws under its title
4
+ * (objectui#12624).
5
+ *
6
+ * When an authored `page:header` owns the page's `h1`, the page renderer no
7
+ * longer draws the description in its own heading block, which sat ABOVE the
8
+ * regions and so above the title. It hands the description down here instead,
9
+ * and the header draws it after the title, the order the console page header
10
+ * uses. Every page renderer provides a value (null when it draws the
11
+ * description itself), so a page nested in another never reads the outer
12
+ * page's description.
13
+ */
14
+ export declare const PageDescriptionContext: React.Context<React.ReactNode>;
@@ -0,0 +1,14 @@
1
+ import { PageNodeSchema } from '@object-ui/types';
2
+ /** The page's `print` declaration, as the node type carries it from the spec by reference. */
3
+ export type PagePrintDeclaration = NonNullable<PageNodeSchema['print']>;
4
+ /** The DOM attribute `PageRenderer` stamps on the root of a print page; every rule below is scoped to it. */
5
+ export declare const PRINT_PAGE_ATTRIBUTE = "data-print-page";
6
+ /** The DOM attribute on the running-region table `PageRenderer` draws for `repeatHeader` / `repeatFooter`. */
7
+ export declare const PRINT_RUNNING_ATTRIBUTE = "data-print-running";
8
+ /** True when `value` is a `print` declaration object — the one condition under which a page is a print page. */
9
+ export declare function isPagePrintDeclaration(value: unknown): value is PagePrintDeclaration;
10
+ /**
11
+ * Build the print stylesheet for a page that declares `print`. Pure: the same
12
+ * declaration always yields the same text, so it is pinned as text.
13
+ */
14
+ export declare function buildPagePrintStylesheet(print: PagePrintDeclaration): string;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import * as React from 'react';
9
+ /**
10
+ * How a block in a page region should present itself, judged by the region's
11
+ * MEASURED width against the page's (objectui#12703).
12
+ *
13
+ * - `'compact'`: the region is narrower than half the page — the `aside` rail
14
+ * beside `main`, a sidebar, a third of a three-column body. A list block
15
+ * there draws a short list (title, count, two-line rows) instead of the
16
+ * object list's own chrome.
17
+ * - `'full'`: the region is half the page or wider.
18
+ *
19
+ * `null` — the answer outside any page region, and inside one whose width is
20
+ * not known yet (no layout: server render, jsdom, the first render before the
21
+ * measurement lands). A block reads `null` exactly as `'full'`: an unknown
22
+ * width keeps today's full rendering.
23
+ *
24
+ * ⭐ DERIVED, never authored. `@objectstack/spec` declares no posture or
25
+ * `compact` key on a page, a region or a block, and this adds none: the page
26
+ * renderer measures, and a block reads the answer through
27
+ * {@link usePageRegionPosture}. ⛔ Not a viewport breakpoint: a region's
28
+ * width relative to its page is what decides, so the same `aside` is compact
29
+ * on a wide screen and full once the layout stacks it under `main`.
30
+ */
31
+ export type PageRegionPosture = 'compact' | 'full';
32
+ /**
33
+ * The posture a region `regionWidth` wide takes on a page `pageWidth` wide.
34
+ * `null` when either width is unknown (zero, negative or not a number): the
35
+ * caller then keeps the full rendering.
36
+ */
37
+ export declare function pageRegionPostureFor(regionWidth: number, pageWidth: number): PageRegionPosture | null;
38
+ /**
39
+ * The page body's width, as a store a region subscribes to rather than a
40
+ * context VALUE: a value that changed on every resize would re-render every
41
+ * region and the whole block tree under it, while a subscription re-renders a
42
+ * region only when its posture flips.
43
+ */
44
+ export interface PageWidthStore {
45
+ get(): number;
46
+ set(width: number): void;
47
+ subscribe(listener: () => void): () => void;
48
+ }
49
+ /**
50
+ * The page's width store, watching the page body `bodyRef` points at — the
51
+ * element the page's regions are laid out in. Called by `PageRenderer`, the
52
+ * component that RENDERS that element, and handed to {@link PageWidthProvider}.
53
+ *
54
+ * ⚠️ The watch has to run in the component that renders the body element, not
55
+ * in a provider nested inside it: React attaches a host element's ref after
56
+ * the layout effects of the components below it have run, so a provider
57
+ * inside the body would find the ref still empty.
58
+ */
59
+ export declare function usePageWidthStore(bodyRef: React.RefObject<HTMLElement | null>): PageWidthStore;
60
+ /** Publishes the page's width store to every region under it. Rendered by `PageRenderer`. */
61
+ export declare const PageWidthProvider: React.FC<{
62
+ store: PageWidthStore;
63
+ children: React.ReactNode;
64
+ }>;
65
+ /**
66
+ * Measures the region `regionRef` points at against the page width published
67
+ * above it and tells the region's blocks their posture. Rendered by the page
68
+ * renderer's `RegionContent`. It re-renders when the posture flips and at no
69
+ * other resize, and its `children` element is the same one each time, so a
70
+ * flip reaches the blocks that read the posture and nothing else.
71
+ */
72
+ export declare const PageRegionPostureProvider: React.FC<{
73
+ regionRef: React.RefObject<HTMLElement | null>;
74
+ children: React.ReactNode;
75
+ }>;
76
+ /**
77
+ * The posture of the page region this block renders in: `'compact'` when the
78
+ * region is narrower than half the page, `'full'` when it is not, `null`
79
+ * outside a page region or before the width is known — read `null` as
80
+ * `'full'`. Safe outside any provider.
81
+ */
82
+ export declare function usePageRegionPosture(): PageRegionPosture | null;
@@ -25,6 +25,10 @@
25
25
  * expressed in HTML are injected.
26
26
  * - `Block` — escape hatch: `<Block type="object-grid" .../>`.
27
27
  * - `useAdapter` — live data hook: query/create/update objects.
28
+ * - `useDataInvalidation` — the data-invalidation bus reader: a nonce that
29
+ * moves when a write to the named object is reported on the bus. A page
30
+ * names it in the effect that reads through `useAdapter`, so that read
31
+ * re-runs in place (objectui#10887).
28
32
  * - `data` / `variables` — page data + local variables, for convenience.
29
33
  *
30
34
  * Styling — page source is metadata, not build input. A react page styles with
@@ -6,3 +6,34 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  export {};
9
+ /**
10
+ * ⛔ The ten `sidebar-*` node type keys are RETIRED (objectui#10859 batch 8,
11
+ * phase 2d, the seat's fork ruling on that card, by the objectui#10393 /
12
+ * objectui#8760 route): `sidebar-provider`, `sidebar-header`,
13
+ * `sidebar-content`, `sidebar-group`, `sidebar-menu`, `sidebar-menu-item`,
14
+ * `sidebar-menu-button`, `sidebar-footer`, `sidebar-inset` and
15
+ * `sidebar-trigger`. The shadcn components behind them (`SidebarProvider`,
16
+ * `SidebarHeader`, `SidebarMenuButton`, `SidebarTrigger` and the rest) stay
17
+ * exported from `../../ui` for JSX composition; only the node keys went.
18
+ *
19
+ * ## What was here, and why it went
20
+ *
21
+ * Ten registrations in the `ui` namespace, one per shadcn part, each storing
22
+ * `ui:KEY` and the bare `KEY` fallback. (Described rather than quoted: source
23
+ * readers such as `@object-ui/types`' node-slot test take a quoted call in a
24
+ * comment for a live one.) Nine rendered their child list into the matching
25
+ * shadcn part; `sidebar-group` also drew a resolved `label`,
26
+ * `sidebar-menu-button` passed `size` / `tooltip` through the form-control DOM
27
+ * declaration, and `sidebar-trigger` rendered the collapse button and no child
28
+ * list. No `@object-ui/types` arm claims any of them, so `objectui validate`
29
+ * refused each at `type` while the registry mounted it.
30
+ *
31
+ * ## Why unregistering is the whole retirement
32
+ *
33
+ * The mainstream ships one app-level sidebar region, not author-composable
34
+ * parts (the seat's ruling), and nothing wrote these nodes except the four
35
+ * `components-basic-sidebar` catalog documents, rewritten in the same change to
36
+ * the `sidebar` node above, which now supplies its own provider. Re-measured
37
+ * for phase 2d: 0 other producers in source, docs, examples or objectstack, and
38
+ * 0 runtime emission.
39
+ */
@@ -8,7 +8,7 @@ import { VariantProps } from 'class-variance-authority';
8
8
  */
9
9
  import * as React from "react";
10
10
  declare const badgeVariants: (props?: ({
11
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
11
+ variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
12
12
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
13
13
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
14
14
  }
@@ -8,7 +8,7 @@ import { VariantProps } from 'class-variance-authority';
8
8
  */
9
9
  import * as React from "react";
10
10
  declare const buttonVariants: (props?: ({
11
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
11
+ variant?: "link" | "default" | "secondary" | "ghost" | "outline" | "destructive" | null | undefined;
12
12
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
13
13
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
14
14
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -1,4 +1,5 @@
1
1
  import { DayButton, DayPicker } from 'react-day-picker';
2
+ import { CalendarLocaleTagProps } from '../lib/date-fns-locale.js';
2
3
  import { Button } from './button.js';
3
4
  /**
4
5
  * ObjectUI
@@ -8,7 +9,7 @@ import { Button } from './button.js';
8
9
  * LICENSE file in the root directory of this source tree.
9
10
  */
10
11
  import * as React from "react";
11
- declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
12
+ declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, localeTag, ...props }: React.ComponentProps<typeof DayPicker> & CalendarLocaleTagProps & {
12
13
  buttonVariant?: React.ComponentProps<typeof Button>["variant"];
13
14
  }): React.JSX.Element;
14
15
  declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): React.JSX.Element;
@@ -33,7 +33,7 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
33
33
  ref?: React.Ref<HTMLDivElement>;
34
34
  } & {
35
35
  asChild?: boolean;
36
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
36
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
37
37
  label?: string;
38
38
  shouldFilter?: boolean;
39
39
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -49,7 +49,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
49
49
  ref?: React.Ref<HTMLInputElement>;
50
50
  } & {
51
51
  asChild?: boolean;
52
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
52
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
53
53
  value?: string;
54
54
  onValueChange?: (search: string) => void;
55
55
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -59,7 +59,7 @@ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
59
59
  ref?: React.Ref<HTMLDivElement>;
60
60
  } & {
61
61
  asChild?: boolean;
62
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
62
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
63
63
  label?: string;
64
64
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
65
65
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
@@ -68,14 +68,14 @@ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
68
68
  ref?: React.Ref<HTMLDivElement>;
69
69
  } & {
70
70
  asChild?: boolean;
71
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
71
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
72
72
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
73
73
  children?: React.ReactNode;
74
74
  } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
75
75
  ref?: React.Ref<HTMLDivElement>;
76
76
  } & {
77
77
  asChild?: boolean;
78
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "heading" | "value"> & {
78
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
79
79
  heading?: React.ReactNode;
80
80
  value?: string;
81
81
  forceMount?: boolean;
@@ -84,7 +84,7 @@ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<R
84
84
  ref?: React.Ref<HTMLDivElement>;
85
85
  } & {
86
86
  asChild?: boolean;
87
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
87
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
88
88
  alwaysRender?: boolean;
89
89
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
90
90
  declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
@@ -93,7 +93,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
93
93
  ref?: React.Ref<HTMLDivElement>;
94
94
  } & {
95
95
  asChild?: boolean;
96
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
96
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
97
97
  disabled?: boolean;
98
98
  onSelect?: (value: string) => void;
99
99
  value?: string;
@@ -16,7 +16,6 @@ export * from './button.js';
16
16
  export * from './calendar.js';
17
17
  export * from './card.js';
18
18
  export * from './carousel.js';
19
- export * from './chart.js';
20
19
  export * from './checkbox.js';
21
20
  export * from './collapsible.js';
22
21
  export * from './command.js';
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  import * as React from "react";
9
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
9
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
10
10
  value?: string;
11
11
  onChange?: (newValue: string) => unknown;
12
12
  maxLength: number;
@@ -19,7 +19,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
19
19
  } & {
20
20
  render: (props: import('input-otp').RenderProps) => React.ReactNode;
21
21
  children?: never;
22
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
22
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
23
23
  value?: string;
24
24
  onChange?: (newValue: string) => unknown;
25
25
  maxLength: number;
@@ -14,7 +14,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
14
14
  declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
15
15
  declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
16
  declare const sheetVariants: (props?: ({
17
- side?: "left" | "right" | "top" | "bottom" | null | undefined;
17
+ side?: "top" | "bottom" | "left" | "right" | null | undefined;
18
18
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
19
19
  interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
20
20
  hideOverlay?: boolean;
@@ -18,6 +18,7 @@ type SidebarContextProps = {
18
18
  toggleSidebar: () => void;
19
19
  };
20
20
  declare function useSidebar(): SidebarContextProps;
21
+ declare function useOptionalSidebar(): SidebarContextProps | null;
21
22
  declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
22
23
  defaultOpen?: boolean;
23
24
  open?: boolean;
@@ -69,4 +70,4 @@ declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<React.C
69
70
  size?: "sm" | "md";
70
71
  isActive?: boolean;
71
72
  }, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
72
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
73
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, useOptionalSidebar, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/components",
3
- "version": "17.6.0",
3
+ "version": "18.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Standard UI component library for Object UI, built with Shadcn UI + Tailwind CSS",
@@ -26,7 +26,7 @@
26
26
  "./style.css": "./dist/index.css"
27
27
  },
28
28
  "dependencies": {
29
- "@objectstack/spec": "^17.0.0",
29
+ "@objectstack/spec": "^18.0.0",
30
30
  "@radix-ui/react-accordion": "^1.2.20",
31
31
  "@radix-ui/react-alert-dialog": "^1.1.23",
32
32
  "@radix-ui/react-aspect-ratio": "^1.1.15",
@@ -50,7 +50,6 @@
50
50
  "@radix-ui/react-slot": "^1.3.3",
51
51
  "@radix-ui/react-switch": "^1.3.7",
52
52
  "@radix-ui/react-tabs": "^1.1.21",
53
- "@radix-ui/react-toast": "^1.2.23",
54
53
  "@radix-ui/react-toggle": "^1.1.18",
55
54
  "@radix-ui/react-toggle-group": "^1.1.19",
56
55
  "@radix-ui/react-tooltip": "^1.2.16",
@@ -60,22 +59,21 @@
60
59
  "date-fns": "^4.4.0",
61
60
  "embla-carousel-react": "^8.6.0",
62
61
  "input-otp": "^1.4.2",
63
- "lucide-react": "^1.31.0",
62
+ "lucide-react": "^1.43.0",
64
63
  "next-themes": "^0.4.6",
65
64
  "react-day-picker": "^10.0.1",
66
65
  "react-hook-form": "^7.85.0",
67
66
  "react-resizable-panels": "^4.12.2",
68
- "recharts": "3.10.1",
69
67
  "sonner": "^2.0.8",
70
68
  "tailwind-merge": "^3.6.0",
71
69
  "tailwindcss-animate": "^1.0.7",
72
70
  "vaul": "^1.1.2",
73
- "@object-ui/core": "17.6.0",
74
- "@object-ui/i18n": "17.6.0",
75
- "@object-ui/react": "17.6.0",
76
- "@object-ui/types": "17.6.0",
77
- "@object-ui/sdui-parser": "17.6.0",
78
- "@object-ui/react-runtime": "17.6.0"
71
+ "@object-ui/core": "18.0.0",
72
+ "@object-ui/react": "18.0.0",
73
+ "@object-ui/react-runtime": "18.0.0",
74
+ "@object-ui/i18n": "18.0.0",
75
+ "@object-ui/sdui-parser": "18.0.0",
76
+ "@object-ui/types": "18.0.0"
79
77
  },
80
78
  "peerDependencies": {
81
79
  "react": "^18.0.0 || ^19.0.0",
@@ -89,13 +87,15 @@
89
87
  "@types/react-dom": "19.2.4",
90
88
  "@vitejs/plugin-react": "^6.0.5",
91
89
  "autoprefixer": "^10.5.4",
90
+ "jsonc-parser": "^3.3.1",
92
91
  "postcss": "^8.5.26",
93
92
  "shadcn": "^4.18.0",
94
93
  "tailwindcss": "^4.3.3",
95
94
  "typescript": "^6.0.3",
96
95
  "vite": "^8.2.1",
97
96
  "vite-plugin-dts": "^5.0.3",
98
- "zod": "^4.4.3"
97
+ "zod": "^4.4.3",
98
+ "@object-ui/test-support": "17.4.0"
99
99
  },
100
100
  "keywords": [
101
101
  "objectui",
@@ -121,9 +121,8 @@
121
121
  ],
122
122
  "scripts": {
123
123
  "build": "vite build && node scripts/build-css.mjs",
124
- "prebuild": "pnpm --filter @object-ui/types build && pnpm --filter @object-ui/core build && pnpm --filter @object-ui/react build",
125
- "pretest": "pnpm run prebuild",
126
- "test": "vitest run",
124
+ "test": "vitest run --root ../.. packages/components/",
125
+ "test:dist": "OBJECTUI_DIST_PINS=1 vitest run --root ../.. --config vitest.config.mts --project dist",
127
126
  "type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
128
127
  "lint": "eslint ."
129
128
  }
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare const SchemaRenderer: ({ schema }: {
3
- schema: any;
4
- }) => React.JSX.Element | null;
@@ -1,43 +0,0 @@
1
- import { UseExportJobReturn } from '../hooks/use-export-job.js';
2
- /**
3
- * ObjectUI
4
- * Copyright (c) 2024-present ObjectStack Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
- /**
10
- * ExportProgressDialog — UI for the async export job lifecycle.
11
- *
12
- * Pair with `useExportJob` to render a progress bar (determinate when the
13
- * server reports `percentComplete`, indeterminate otherwise), a Cancel button
14
- * while the job is in flight, and a Download button when it completes.
15
- *
16
- * The dialog is fully controlled by the `job` returned from `useExportJob`;
17
- * pass `open`/`onOpenChange` to control its visibility (typically opened by
18
- * the same handler that calls `job.start(...)`).
19
- */
20
- import * as React from 'react';
21
- export interface ExportProgressDialogProps {
22
- /** Visibility, controlled. */
23
- open: boolean;
24
- /** Visibility setter. */
25
- onOpenChange: (open: boolean) => void;
26
- /** Job state object returned from `useExportJob`. */
27
- job: UseExportJobReturn;
28
- /** Optional title override (defaults to 'Exporting…'). */
29
- title?: string;
30
- /** Optional description override. */
31
- description?: string;
32
- /** Default download filename. */
33
- filename?: string;
34
- /** Show the Close button while the job is running. Default true. */
35
- allowCloseWhileRunning?: boolean;
36
- /** Optional className passthrough for the dialog content. */
37
- className?: string;
38
- /** Called after the user clicks Download (after the click resolves). */
39
- onAfterDownload?: () => void;
40
- /** Auto-close the dialog this many ms after a successful download. */
41
- closeAfterDownloadMs?: number;
42
- }
43
- export declare function ExportProgressDialog({ open, onOpenChange, job, title, description, filename, allowCloseWhileRunning, className, onAfterDownload, closeAfterDownloadMs, }: ExportProgressDialogProps): React.JSX.Element;
@@ -1,34 +0,0 @@
1
- import { DataSource, CreateExportJobRequest, ExportJobProgressInfo } from '@object-ui/types';
2
- export interface UseExportJobOptions {
3
- /** Data source providing the optional export-job methods. Required. */
4
- dataSource?: DataSource;
5
- /** Polling cadence while the job is in flight. Default 1500ms. */
6
- pollIntervalMs?: number;
7
- /** Maximum poll attempts before giving up (safety net). Default 600. */
8
- maxAttempts?: number;
9
- /** Called once the job reaches a terminal state. */
10
- onComplete?: (info: ExportJobProgressInfo) => void;
11
- /** Called when the job fails (any non-completed terminal state). */
12
- onError?: (error: Error, info?: ExportJobProgressInfo) => void;
13
- }
14
- export interface UseExportJobReturn {
15
- /** True when a job is in flight (pending/processing). */
16
- isRunning: boolean;
17
- /** Latest progress payload from the server. */
18
- progress: ExportJobProgressInfo | null;
19
- /** Latest terminal error (if any). */
20
- error: Error | null;
21
- /** Whether the data source supports async export (createExportJob present). */
22
- isSupported: boolean;
23
- /** Start a new export job. Returns the job id (or null when unsupported). */
24
- start: (resource: string, request: CreateExportJobRequest) => Promise<string | null>;
25
- /** Cancel the in-flight job (no-op when unsupported). */
26
- cancel: () => Promise<void>;
27
- /** Fetch a fresh download URL for the completed job. */
28
- getDownloadUrl: () => Promise<string | null>;
29
- /** Manually trigger a browser download for the completed job. */
30
- download: (filename?: string) => Promise<boolean>;
31
- /** Reset the local job state (clears progress + error). */
32
- reset: () => void;
33
- }
34
- export declare function useExportJob(opts?: UseExportJobOptions): UseExportJobReturn;
@@ -1,56 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- import * as React from "react";
9
- import * as RechartsPrimitive from "recharts";
10
- declare const THEMES: {
11
- readonly light: "";
12
- readonly dark: ".dark";
13
- };
14
- export type ChartConfig = {
15
- [k in string]: {
16
- label?: React.ReactNode;
17
- icon?: React.ComponentType;
18
- } & ({
19
- color?: string;
20
- theme?: never;
21
- } | {
22
- color?: never;
23
- theme: Record<keyof typeof THEMES, string>;
24
- });
25
- };
26
- declare const ChartContainer: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
27
- config: ChartConfig;
28
- children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
29
- }, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
- declare const ChartStyle: ({ id, config }: {
31
- id: string;
32
- config: ChartConfig;
33
- }) => React.JSX.Element | null;
34
- declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
35
- declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
36
- active?: boolean;
37
- payload?: any[];
38
- label?: string;
39
- hideLabel?: boolean;
40
- hideIndicator?: boolean;
41
- indicator?: "line" | "dot" | "dashed";
42
- nameKey?: string;
43
- labelKey?: string;
44
- labelFormatter?: (value: any, payload: any[]) => React.ReactNode;
45
- labelClassName?: string;
46
- formatter?: (value: any, name?: any, item?: any, index?: number, payload?: any) => React.ReactNode;
47
- color?: string;
48
- }, "ref"> & React.RefAttributes<HTMLDivElement>>;
49
- declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
50
- declare const ChartLegendContent: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
51
- payload?: any[];
52
- verticalAlign?: "top" | "bottom";
53
- hideIcon?: boolean;
54
- nameKey?: string;
55
- }, "ref"> & React.RefAttributes<HTMLDivElement>>;
56
- export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
@@ -1,22 +0,0 @@
1
- import { VariantProps } from 'class-variance-authority';
2
- /**
3
- * ObjectUI
4
- * Copyright (c) 2024-present ObjectStack Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
- import * as React from "react";
10
- import * as ToastPrimitives from "@radix-ui/react-toast";
11
- declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
12
- declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
13
- declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
14
- variant?: "default" | "destructive" | null | undefined;
15
- } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
16
- declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
17
- declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
18
- declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
- declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
- type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
21
- type ToastActionElement = React.ReactElement<typeof ToastAction>;
22
- export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };