@lumx/react 4.10.0 → 4.11.0-alpha.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1, Theme as Theme$1, Size as Size$1, Orientation as Orientation$1, Alignment as Alignment$1, AspectRatio as AspectRatio$1, Emphasis as Emphasis$1 } from '@lumx/core/js/constants';
1
+ import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1, Orientation as Orientation$1, Alignment as Alignment$1, Size as Size$1, AspectRatio as AspectRatio$1, Emphasis as Emphasis$1, Theme as Theme$1 } from '@lumx/core/js/constants';
2
2
  export * from '@lumx/core/js/constants';
3
3
  import * as _lumx_core_js_types from '@lumx/core/js/types';
4
4
  import { GenericProps as GenericProps$1, HasTheme as HasTheme$1, ValueOf as ValueOf$1, PropsToOverride, HasAriaDisabled as HasAriaDisabled$1, HasRequiredLinkHref as HasRequiredLinkHref$1, HasClassName as HasClassName$1, HasCloseMode as HasCloseMode$1, JSXElement as JSXElement$1, CommonRef as CommonRef$1, Falsy, HeadingElement as HeadingElement$1, HasAriaLabelOrLabelledBy as HasAriaLabelOrLabelledBy$1 } from '@lumx/core/js/types';
@@ -1018,61 +1018,50 @@ declare const ChipGroup: Comp<ChipGroupProps, HTMLDivElement> & {
1018
1018
  useChipGroupNavigation: useChipGroupNavigationType<any>;
1019
1019
  };
1020
1020
 
1021
- interface SelectionChipGroupProps<O> extends GenericProps$1 {
1022
- /**
1023
- * Option object id selector (either the property name or a function to get the id)
1024
- */
1021
+ /**
1022
+ * Defines the props of the component.
1023
+ */
1024
+ interface SelectionChipGroupProps$1<O> extends HasClassName, HasTheme {
1025
+ /** Option object id selector (either a property name or a function to get the id) */
1025
1026
  getOptionId: Selector<O>;
1026
- /**
1027
- * Option object name selector (either the property name or a function to get the name)
1028
- * Fallbacks on the ID if not defined
1029
- */
1027
+ /** Option object name selector. Falls back to the id if not defined */
1030
1028
  getOptionName?: Selector<O, string | undefined | null>;
1031
- /**
1032
- * Selected options array
1033
- */
1029
+ /** Selected options array */
1034
1030
  value?: O[];
1035
- /**
1036
- * Callback on option array selected
1037
- */
1031
+ /** Label for accessibility (aria-label on the listbox) */
1032
+ label: string;
1033
+ /** Label for the remove action (visually hidden text appended to each chip) */
1034
+ chipRemoveLabel?: string;
1035
+ /** Disabled state for all chips */
1036
+ isDisabled?: boolean;
1037
+ /** Customize chip props per option */
1038
+ getChipProps?: (option: O) => Partial<ChipProps$1>;
1039
+ /** Ref for the container element */
1040
+ ref?: any;
1041
+ }
1042
+
1043
+ /**
1044
+ * Defines the props of the component.
1045
+ */
1046
+ interface SelectionChipGroupProps<O> extends GenericProps$1, ReactToJSX<SelectionChipGroupProps$1<O>> {
1047
+ /** Callback on option array selected */
1038
1048
  onChange?(newValue?: O[]): void;
1039
- /**
1040
- * Input ref to restore focus
1041
- */
1049
+ /** Input ref to restore focus */
1042
1050
  inputRef?: React__default.RefObject<HTMLInputElement>;
1043
- /**
1044
- * Input label, used to generate the chip group aria description
1045
- */
1046
- inputLabel?: string;
1047
- /**
1048
- * Customize how chips should render
1049
- */
1051
+ /** Customize how chips should render (return a <Chip> element to override chip props) */
1050
1052
  renderChip?: (option: O) => React__default.ReactNode;
1051
- /**
1052
- * Scope for tracking purposes
1053
- */
1054
- scope?: string;
1055
- /**
1056
- * LumX theme
1057
- */
1058
- theme?: Theme$1;
1059
- /**
1060
- * Disabled state
1061
- */
1062
- isDisabled?: boolean;
1063
- /** label to be used for accessibility purposes */
1064
- label: string;
1065
- /** callback for generating the tooltip for each individual chip */
1066
- chipTooltipLabel: (chip: string) => string;
1067
1053
  }
1068
1054
  /**
1069
1055
  * SelectionChipGroup component.
1070
1056
  *
1071
1057
  * @param props Component props.
1072
- * @param ref Component ref.
1073
1058
  * @return React element.
1074
1059
  */
1075
- declare const SelectionChipGroup: <O>({ onChange, value, getOptionId, getOptionName, inputRef, inputLabel, renderChip, theme, isDisabled, chipTooltipLabel, label, ...forwardedProps }: SelectionChipGroupProps<O>) => react_jsx_runtime.JSX.Element;
1060
+ declare const SelectionChipGroup: {
1061
+ <O>({ onChange, value, getOptionId, getOptionName, inputRef, renderChip, getChipProps: getChipPropsProp, theme, isDisabled, label, chipRemoveLabel, ...forwardedProps }: SelectionChipGroupProps<O>): react_jsx_runtime.JSX.Element | null;
1062
+ displayName: string;
1063
+ className: "lumx-selection-chip-group";
1064
+ };
1076
1065
 
1077
1066
  type Listener = (evt: KeyboardEvent) => void;
1078
1067
  interface UseKeyboardListNavigationType {
@@ -1781,6 +1770,8 @@ interface InputLabelProps$1 extends HasClassName, HasTheme {
1781
1770
  children: JSXElement;
1782
1771
  /** Native htmlFor property. */
1783
1772
  htmlFor: string;
1773
+ /** Native id property. */
1774
+ id?: string;
1784
1775
  /** Whether the component is required or not. */
1785
1776
  isRequired?: boolean;
1786
1777
  /** ref to the root element */
@@ -1813,6 +1804,8 @@ interface TextFieldProps$1 extends HasClassName, HasTheme, HasAriaDisabled, HasD
1813
1804
  helperId?: string;
1814
1805
  /** Generated error id for accessibility attributes. */
1815
1806
  errorId?: string;
1807
+ /** Generated label id for accessibility attributes (used to link the clear button to the field label). */
1808
+ labelId?: string;
1816
1809
  /** Whether the component is required or not. */
1817
1810
  isRequired?: boolean;
1818
1811
  /** Whether the text field is displayed with valid style or not. */
@@ -1842,7 +1835,7 @@ interface TextFieldProps$1 extends HasClassName, HasTheme, HasAriaDisabled, HasD
1842
1835
  /** Ref to the component root. */
1843
1836
  ref?: CommonRef;
1844
1837
  }
1845
- type TextFieldPropsToOverride = 'input' | 'IconButton' | 'labelProps' | 'textFieldRef' | 'clearButtonProps' | 'helperId' | 'errorId' | 'isAnyDisabled' | 'isFocus';
1838
+ type TextFieldPropsToOverride = 'input' | 'IconButton' | 'labelProps' | 'textFieldRef' | 'clearButtonProps' | 'helperId' | 'errorId' | 'labelId' | 'isAnyDisabled' | 'isFocus';
1846
1839
 
1847
1840
  /**
1848
1841
  * Defines the props of the component.
@@ -1950,13 +1943,22 @@ interface ComboboxInputProps extends TextFieldProps {
1950
1943
  value: string;
1951
1944
  }) => void;
1952
1945
  /**
1953
- * When true (default), the combobox automatically filters options as the user types.
1954
- * Each `Combobox.Option` registers itself and hides when it doesn't match the input value.
1946
+ * Controls how the combobox filters options as the user types.
1955
1947
  *
1956
- * Set to false when you handle filtering yourself (e.g. async search, consumer-side
1957
- * pre-filtering). Options will not be auto-filtered.
1948
+ * - `'auto'` (default) Options are automatically filtered client-side.
1949
+ * - `'manual'` Filtering is the consumer's responsibility.
1950
+ * - `'off'` — Like `'manual'`, but the input is rendered as `readOnly`
1951
+ * and `openOnFocus` defaults to `true`.
1958
1952
  */
1959
- autoFilter?: boolean;
1953
+ filter?: 'auto' | 'manual' | 'off';
1954
+ /**
1955
+ * When true, the combobox opens automatically when the input receives focus.
1956
+ * When false (default, unless `filter` is `'off'`), the combobox only opens
1957
+ * on click, typing, or keyboard navigation.
1958
+ *
1959
+ * @default false (true when filter is 'off')
1960
+ */
1961
+ openOnFocus?: boolean;
1960
1962
  }
1961
1963
 
1962
1964
  /**
@@ -2279,22 +2281,26 @@ interface DatePickerFieldProps extends Omit<TextFieldProps, 'value' | 'onChange'
2279
2281
  */
2280
2282
  declare const DatePickerField: Comp<DatePickerFieldProps, HTMLDivElement>;
2281
2283
 
2282
- /**
2283
- * Defines the props of the component.
2284
- */
2285
- interface DialogProps extends GenericProps$1, HasCloseMode$1 {
2284
+ interface BaseDialogProps {
2286
2285
  /** Footer content. */
2287
- footer?: ReactNode;
2286
+ footer?: JSXElement;
2288
2287
  /** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
2289
2288
  forceFooterDivider?: boolean;
2290
2289
  /** Header content. */
2291
- header?: ReactNode;
2292
- /** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
2290
+ header?: JSXElement;
2291
+ /** Whether the divider between the dialog content and the header is always displayed (instead of showing it on scroll). */
2293
2292
  forceHeaderDivider?: boolean;
2294
2293
  /** Whether the indefinite progress indicator over the dialog content is displayed or not. */
2295
2294
  isLoading?: boolean;
2296
2295
  /** Whether the component is open or not. */
2297
2296
  isOpen?: boolean;
2297
+ }
2298
+ type DialogSizes = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
2299
+
2300
+ /**
2301
+ * Defines the props of the component.
2302
+ */
2303
+ interface DialogProps extends GenericProps$1, HasCloseMode$1, BaseDialogProps {
2298
2304
  /** Reference to the parent element that triggered modal opening (will get back focus on close). */
2299
2305
  parentElement?: RefObject<HTMLElement>;
2300
2306
  /** Reference to the dialog content element. */
@@ -2322,7 +2328,7 @@ interface DialogProps extends GenericProps$1, HasCloseMode$1 {
2322
2328
  /** Children */
2323
2329
  children?: React__default.ReactNode;
2324
2330
  }
2325
- type DialogSizes = Extract<Size$1, 'tiny' | 'regular' | 'big' | 'huge'>;
2331
+
2326
2332
  /**
2327
2333
  * Dialog component.
2328
2334
  *