@object-ui/components 17.1.0 → 17.3.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.
@@ -10,7 +10,17 @@ export interface ComboboxOption {
10
10
  value: string;
11
11
  label: string;
12
12
  }
13
- export interface ComboboxProps {
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;
@@ -8,6 +8,12 @@ import { VariantProps } from 'class-variance-authority';
8
8
  */
9
9
  import * as React from "react";
10
10
  declare const fieldVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
11
+ /**
12
+ * Props for {@link FieldContainer}.
13
+ *
14
+ * Note this one keeps its natural name: the spec does not export `FieldProps`.
15
+ * Only the component itself had to move — see the note on `FieldContainer`.
16
+ */
11
17
  export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof fieldVariants> {
12
18
  label?: React.ReactNode;
13
19
  description?: React.ReactNode;
@@ -15,5 +21,17 @@ export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Varian
15
21
  required?: boolean;
16
22
  htmlFor?: string;
17
23
  }
18
- declare const Field: React.ForwardRefExoticComponent<FieldProps & React.RefAttributes<HTMLDivElement>>;
19
- export { Field };
24
+ /**
25
+ * A labelled form-control wrapper: label, slotted control, description, error.
26
+ *
27
+ * Named `FieldContainer`, not `Field` (objectstack#4115): `@objectstack/spec/data`
28
+ * exports `Field` — an object FIELD's metadata (type, reference_to, options,
29
+ * permissions, …) and its builder namespace — which has nothing to do with this
30
+ * `<div>`. Two unrelated things under one name is the defect that issue exists
31
+ * to remove; `@object-ui/app-shell` already renamed the same kind of collision
32
+ * (`FieldInput` → `ScreenFieldInput`, objectui#3169) for the same reason.
33
+ * `__tests__/share-filter-sort-spec-parity.test.ts` pins that the spec does not
34
+ * own the new name.
35
+ */
36
+ declare const FieldContainer: React.ForwardRefExoticComponent<FieldProps & React.RefAttributes<HTMLDivElement>>;
37
+ export { FieldContainer };
@@ -6,7 +6,23 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  import * as React from "react";
9
- export interface FilterCondition {
9
+ /**
10
+ * One row of the FilterBuilder UI.
11
+ *
12
+ * Deliberately NOT `FilterCondition` (objectstack#4115): the spec owns that
13
+ * name for the RECURSIVE ObjectQL predicate AST — `{ [field]: FieldOperators }`
14
+ * with `$and` / `$or` / `$not` branches — which is a query, not a row. This is
15
+ * one flat `{ field, operator, value }` line plus the React key the list needs,
16
+ * and `operator` here is the builder's own dropdown vocabulary
17
+ * (`FILTER_BUILDER_OPERATORS`), not the spec's `$`-tokens.
18
+ *
19
+ * `@object-ui/types` already renamed its identical concept to
20
+ * `FilterBuilderCondition` (objectui#3068); this is the same thing, so it takes
21
+ * the same name rather than inventing a second dialect. Note the same name is
22
+ * NOT the right answer everywhere: `@object-ui/app-shell`'s `FilterCondition`
23
+ * really was the spec's ObjectQL AST and was re-exported (objectui#3169).
24
+ */
25
+ export interface FilterBuilderCondition {
10
26
  id: string;
11
27
  field: string;
12
28
  operator: string;
@@ -15,7 +31,7 @@ export interface FilterCondition {
15
31
  export interface FilterGroup {
16
32
  id: string;
17
33
  logic: "and" | "or";
18
- conditions: FilterCondition[];
34
+ conditions: FilterBuilderCondition[];
19
35
  }
20
36
  export interface FilterBuilderProps {
21
37
  fields?: Array<{
@@ -129,9 +145,9 @@ interface LookupValuePickerProps {
129
145
  displayField?: string;
130
146
  idField?: string;
131
147
  };
132
- value: FilterCondition["value"];
148
+ value: FilterBuilderCondition["value"];
133
149
  multiple: boolean;
134
- onChange: (value: FilterCondition["value"]) => void;
150
+ onChange: (value: FilterBuilderCondition["value"]) => void;
135
151
  }
136
152
  declare function LookupValuePicker({ field, value, multiple, onChange }: LookupValuePickerProps): React.JSX.Element;
137
153
  export { FilterBuilder, LookupValuePicker };
@@ -53,7 +53,13 @@ export interface NavigationOverlayProps {
53
53
  * When omitted, the expand button is not rendered.
54
54
  */
55
55
  onExpand?: () => void;
56
- /** Optional label for the expand button (accessible name & tooltip). */
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
@@ -1,3 +1,4 @@
1
+ import { SortItem as SpecSortItem } from '@objectstack/spec/shared';
1
2
  /**
2
3
  * ObjectUI
3
4
  * Copyright (c) 2024-present ObjectStack Inc.
@@ -6,10 +7,20 @@
6
7
  * LICENSE file in the root directory of this source tree.
7
8
  */
8
9
  import * as React from "react";
9
- export interface SortItem {
10
+ /**
11
+ * One row of the SortBuilder UI: the spec's `SortItem` (`{ field, order }`)
12
+ * plus the React key this list needs.
13
+ *
14
+ * Derived rather than re-declared (objectstack#4115). The old hand copy agreed
15
+ * with the spec key-for-key, which is the state one spec release away from
16
+ * drifting — a new sort key (`nulls`, say) would have appeared in the spec and
17
+ * silently gone missing here. `id` is the ONE local addition and it is
18
+ * synthetic: `normalize()` mints it, and `SortBuilder`'s change comparison
19
+ * strips it before diffing precisely because it is not part of the contract.
20
+ */
21
+ export interface SortItem extends SpecSortItem {
22
+ /** React key for the row. Synthetic — never part of the emitted sort. */
10
23
  id: string;
11
- field: string;
12
- order: 'asc' | 'desc';
13
24
  }
14
25
  export interface SortBuilderProps {
15
26
  fields?: Array<{
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
  }
@@ -2733,6 +2736,9 @@
2733
2736
  .fade-in-80 {
2734
2737
  --tw-enter-opacity: 0.8;
2735
2738
  }
2739
+ .paused {
2740
+ animation-play-state: paused;
2741
+ }
2736
2742
  .ring-inset {
2737
2743
  --tw-ring-inset: inset;
2738
2744
  }