@lumx/react 4.16.0-alpha.2 → 4.16.0-alpha.3

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
@@ -4009,14 +4009,14 @@ declare const SelectMultipleField: React.FC<SelectMultipleProps>;
4009
4009
  declare const SelectMultiple: Comp<SelectMultipleProps, HTMLDivElement>;
4010
4010
 
4011
4011
  /**
4012
- * Status of the select dropdown list.
4012
+ * Status of the SelectTextField dropdown list.
4013
4013
  *
4014
4014
  * - `'idle'` — Default state, no loading indicators.
4015
4015
  * - `'loading'` — Full loading: shows skeleton placeholders, hides real options.
4016
4016
  * - `'loadingMore'` — Paginated loading: appends a skeleton after existing options.
4017
4017
  * - `'error'` — Error state: shows an error message in the dropdown.
4018
4018
  */
4019
- type SelectListStatus = 'idle' | 'loading' | 'loadingMore' | 'error';
4019
+ type SelectTextFieldStatus = 'idle' | 'loading' | 'loadingMore' | 'error';
4020
4020
  /**
4021
4021
  * Context passed to the `renderOption` callback alongside the option object.
4022
4022
  * Contains core-computed values that the consumer should forward to `<Combobox.Option>`.
@@ -4061,13 +4061,13 @@ interface BaseSelectProps<O> {
4061
4061
  * section id are grouped together. The id is also used as the default displayed
4062
4062
  * label unless `renderSectionTitle` is provided.
4063
4063
  */
4064
- getSectionId?: Selector<O, string | undefined>;
4064
+ getSectionId?: Selector<O, string>;
4065
4065
  /**
4066
4066
  * Custom section title render function. Receives the section id and the options
4067
4067
  * in that section. Returns custom JSX to display as the section header.
4068
4068
  * When not provided, the section id is used as a plain text label.
4069
4069
  */
4070
- renderSectionTitle?: (sectionId: string | undefined, options: O[]) => JSXElement;
4070
+ renderSectionTitle?: (sectionId: string, options: O[]) => JSXElement;
4071
4071
  }
4072
4072
  /**
4073
4073
  * Shared translation labels for SelectTextField wrappers (React and Vue).
@@ -4138,7 +4138,7 @@ interface BaseSelectTextFieldWrapperProps<O> extends Pick<BaseSelectProps<O>, 'o
4138
4138
  * Status of the dropdown list.
4139
4139
  * @default 'idle'
4140
4140
  */
4141
- listStatus?: SelectListStatus;
4141
+ listStatus?: SelectTextFieldStatus;
4142
4142
  /**
4143
4143
  * Controls how the combobox filters options as the user types.
4144
4144
  *
@@ -4246,7 +4246,7 @@ interface SelectButtonProps$1<O> extends BaseSelectProps<O> {
4246
4246
  * - `'error'` — Error state: shows an error message in the dropdown.
4247
4247
  * @default 'idle'
4248
4248
  */
4249
- listStatus?: SelectListStatus;
4249
+ listStatus?: SelectTextFieldStatus;
4250
4250
  /** Optional translations for screen-reader announcements (loading/empty/error/option count). */
4251
4251
  translations?: SelectButtonTranslations;
4252
4252
  /** Callback fired when the dropdown open state changes. */
@@ -4281,7 +4281,7 @@ type SelectButtonSelectProps<O> = Omit<ReactToJSX<SelectButtonProps$1<O>>, 'rend
4281
4281
  * Forwarded trigger props for a given element `E`, minus the keys that the
4282
4282
  * component manages internally.
4283
4283
  */
4284
- type TriggerProps<E extends ElementType$1> = Omit<NamedProps<React__default.ComponentProps<E>>, OmittedKeys>;
4284
+ type TriggerProps<E extends ElementType$1> = Omit<NamedProps<React__default.ComponentPropsWithoutRef<E>>, OmittedKeys>;
4285
4285
  /**
4286
4286
  * Common base — Select-specific props plus the ARIA / label / popover layer.
4287
4287
  * `as`, `ref`, `selectionType`, `value`, `onChange` are intentionally hoisted
@@ -4299,7 +4299,7 @@ type CommonSelectButtonProps<O> = SelectButtonSelectProps<O> & GenericProps$1 &
4299
4299
  * Status of the dropdown list (loading, error, etc.).
4300
4300
  * @default 'idle'
4301
4301
  */
4302
- listStatus?: SelectListStatus;
4302
+ listStatus?: SelectTextFieldStatus;
4303
4303
  /** Screen-reader translations (loading/empty/error/option count). */
4304
4304
  translations?: SelectButtonTranslations;
4305
4305
  };
@@ -4313,8 +4313,8 @@ type CommonSelectButtonProps<O> = SelectButtonSelectProps<O> & GenericProps$1 &
4313
4313
  * fully replaced and only props valid for that component apply.
4314
4314
  *
4315
4315
  * Discriminated on `selectionType`:
4316
- * - default / `'single'` → `value?: O`, `onChange?: (newValue: O) => void`.
4317
- * - `'multiple'` → `value?: O[]`, `onChange?: (newValue: O[]) => void`.
4316
+ * - default / `'single'` → `value?: O`, `onChange?: (newValue?: O) => void`.
4317
+ * - `'multiple'` → `value?: O[]`, `onChange?: (newValue?: O[]) => void`.
4318
4318
  *
4319
4319
  * `as` and `selectionType` are top-level on this type (rather than buried in
4320
4320
  * an intersection or union member) so that TS can infer `E` from `as` and
@@ -4338,16 +4338,15 @@ type SelectButtonProps<O, E extends ElementType$1 = typeof DefaultButton, S exte
4338
4338
  /** Selected option(s). Shape depends on `selectionType`. */
4339
4339
  value?: S extends 'multiple' ? O[] : O;
4340
4340
  /** Called when the selection changes. Shape depends on `selectionType`. */
4341
- onChange?: S extends 'multiple' ? (newValue: O[]) => void : (newValue: O) => void;
4341
+ onChange?: S extends 'multiple' ? (newValue?: O[]) => void : (newValue?: O) => void;
4342
4342
  };
4343
4343
  /**
4344
4344
  * Single-selection props (`selectionType` defaults to `'single'`).
4345
+ * Backwards-compatible alias — existing consumers do not need to set `selectionType`.
4345
4346
  */
4346
- type SingleSelectButtonProps<O, E extends ElementType$1 = typeof DefaultButton> = NamedProps<SelectButtonProps<O, E, 'single'>>;
4347
- /**
4348
- * Multi-selection props (`selectionType: 'multiple'` is required to opt in).
4349
- */
4350
- type MultipleSelectButtonProps<O, E extends ElementType$1 = typeof DefaultButton> = NamedProps<SelectButtonProps<O, E, 'multiple'>>;
4347
+ type SingleSelectButtonProps<O, E extends ElementType$1 = typeof DefaultButton> = SelectButtonProps<O, E, 'single'>;
4348
+ /** Multi-selection props (`selectionType: 'multiple'` is required to opt in). */
4349
+ type MultipleSelectButtonProps<O, E extends ElementType$1 = typeof DefaultButton> = SelectButtonProps<O, E, 'multiple'>;
4351
4350
 
4352
4351
  /**
4353
4352
  * SelectButton compound component.
@@ -4372,7 +4371,7 @@ interface BaseSelectTextFieldProps<O = any> extends BaseSelectTextFieldWrapperPr
4372
4371
  * in that section. Returns custom JSX to display as the section header.
4373
4372
  * When not provided, the section id is used as a plain text label.
4374
4373
  */
4375
- renderSectionTitle?: (sectionId: string | undefined, options: O[]) => React__default.ReactNode;
4374
+ renderSectionTitle?: (sectionId: string, options: O[]) => React__default.ReactNode;
4376
4375
  /**
4377
4376
  * Callback fired when the search input text changes.
4378
4377
  * Independent of `filter`: both can be used together (e.g. client-side
@@ -5608,4 +5607,4 @@ declare const ThemeProvider: React__default.FC<{
5608
5607
  declare function useTheme(): ThemeContextValue;
5609
5608
 
5610
5609
  export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME$1 as CLASSNAME, COMPONENT_NAME$1 as COMPONENT_NAME, Checkbox, Chip, ChipGroup, Combobox, CommentBlock, CommentBlockVariant, DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSection, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectButton, SelectMultiple, SelectMultipleField, SelectTextField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, CLASSNAME as TIME_PICKER_FIELD_CLASSNAME, COMPONENT_NAME as TIME_PICKER_FIELD_COMPONENT_NAME, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableCellVariant as TableCellVariantType, TableHeader, TableRow, Text, TextField, ThOrder, ThOrder as ThOrderType, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, TimePickerField, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, useFocusPointStyle, useHeadingLevel, useTheme };
5611
- export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CheckboxProps, ChipGroupProps, ChipProps, ComboboxButtonProps, ComboboxInputProps, ComboboxListProps, ComboboxOptionActionProps, ComboboxOptionMoreInfoProps, ComboboxOptionProps, ComboboxOptionSkeletonProps, ComboboxPopoverComponentProps, ComboboxPopoverProps, ComboboxProviderProps, ComboboxSectionProps, ComboboxStateProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GenericBlockSectionProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSectionProps, ListSubheaderProps, MarginAutoAlignment, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverProps, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, RawInputTextProps, RawInputTextareaProps, SelectButtonProps, SelectListStatus as SelectButtonStatus, SelectButtonTranslations, SelectListStatus, SelectMultipleProps, SelectProps, SelectTextFieldProps, SelectListStatus as SelectTextFieldStatus, SelectTextFieldTranslations, SelectionChipGroupProps, SideNavigationItemProps, SideNavigationProps, SingleSelectButtonProps, SingleSelectTextFieldProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, TimePickerFieldProps, ToolbarProps, TooltipPlacement, TooltipProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };
5610
+ export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CheckboxProps, ChipGroupProps, ChipProps, ComboboxButtonProps, ComboboxInputProps, ComboboxListProps, ComboboxOptionActionProps, ComboboxOptionMoreInfoProps, ComboboxOptionProps, ComboboxOptionSkeletonProps, ComboboxPopoverComponentProps, ComboboxPopoverProps, ComboboxProviderProps, ComboboxSectionProps, ComboboxStateProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GenericBlockSectionProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSectionProps, ListSubheaderProps, MarginAutoAlignment, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverProps, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, RawInputTextProps, RawInputTextareaProps, SelectButtonProps, SelectButtonTranslations, SelectMultipleProps, SelectProps, SelectTextFieldProps, SelectTextFieldStatus, SelectTextFieldTranslations, SelectionChipGroupProps, SideNavigationItemProps, SideNavigationProps, SingleSelectButtonProps, SingleSelectTextFieldProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, TimePickerFieldProps, ToolbarProps, TooltipPlacement, TooltipProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };
package/index.js CHANGED
@@ -1687,7 +1687,7 @@ const IconButton$1 = props => {
1687
1687
  size = DEFAULT_PROPS$1a.size,
1688
1688
  ...forwardedProps
1689
1689
  } = props;
1690
- const defaultChildren = image ? /*#__PURE__*/jsx("img", {
1690
+ const iconNode = image ? /*#__PURE__*/jsx("img", {
1691
1691
  // no need to set alt as an aria-label is already set on the button
1692
1692
  alt: "",
1693
1693
  src: image
@@ -1700,7 +1700,12 @@ const IconButton$1 = props => {
1700
1700
  ...forwardedProps,
1701
1701
  'aria-label': label,
1702
1702
  variant: 'icon',
1703
- children: defaultChildren
1703
+ children: /*#__PURE__*/jsxs(Fragment, {
1704
+ children: [iconNode, /*#__PURE__*/jsx("span", {
1705
+ className: visuallyHidden(),
1706
+ children: label
1707
+ })]
1708
+ })
1704
1709
  });
1705
1710
  };
1706
1711
  IconButton$1.displayName = COMPONENT_NAME$1r;
@@ -7111,12 +7116,6 @@ function setupComboboxButton(button, callbacks) {
7111
7116
  return true;
7112
7117
  }
7113
7118
  return false;
7114
- case 'Escape':
7115
- // Close if open; never clear selection (button-mode has no text input).
7116
- if (combobox.isOpen) {
7117
- combobox.setIsOpen(false);
7118
- }
7119
- return true;
7120
7119
  default:
7121
7120
  // Printable characters → typeahead.
7122
7121
  if (isPrintableKey(event)) {
@@ -9163,7 +9162,6 @@ const Popover$1 = (props, {
9163
9162
  [`position-${position}`]: Boolean(position),
9164
9163
  'is-hidden': Boolean(isHidden)
9165
9164
  })),
9166
- hidden: isHidden || undefined,
9167
9165
  style: isHidden ? undefined : popoverStyle,
9168
9166
  "data-popper-placement": position,
9169
9167
  children: [unmountSentinel, /*#__PURE__*/jsxs(ClickAwayProvider, {
@@ -16827,24 +16825,6 @@ function toggleSelection(options, getOptionId, currentValue, selectedOptionId, i
16827
16825
  return updated;
16828
16826
  }
16829
16827
 
16830
- /**
16831
- * Get the display name for a single option value.
16832
- *
16833
- * Resolves the option's display name by trying `getOptionName` first,
16834
- * then falling back to `getOptionId`, returning `''` for nullish values.
16835
- */
16836
- function getOptionDisplayName(value, getOptionName, getOptionId) {
16837
- if (value === undefined || value === null) return '';
16838
- if (getOptionName) {
16839
- const name = getWithSelector(getOptionName, value);
16840
- if (name != null) return String(name);
16841
- }
16842
- if (getOptionId) {
16843
- return String(getWithSelector(getOptionId, value));
16844
- }
16845
- return '';
16846
- }
16847
-
16848
16828
  /**
16849
16829
  * Render options as ComboboxOption elements.
16850
16830
  * Framework-specific components are passed as a second argument.
@@ -16969,7 +16949,7 @@ const SelectButton$2 = (props, {
16969
16949
  * each option to its name and join with `, `. Falsy entries (undefined, empty names)
16970
16950
  * are filtered out so partial state still renders cleanly.
16971
16951
  */
16972
- const displayValue = value != null ? castArray(value).map(v => getOptionDisplayName(v, getOptionName, getOptionId)).filter(Boolean).join(', ') : '';
16952
+ const displayValue = value != null ? castArray(value).map(v => v != null && getWithSelector(getOptionName, v)).filter(Boolean).join(', ') : '';
16973
16953
  return /*#__PURE__*/jsxs(Combobox.Provider, {
16974
16954
  onOpen: onOpen,
16975
16955
  children: [/*#__PURE__*/jsx(Combobox.Button, {
@@ -17098,8 +17078,8 @@ const DefaultButton = forwardRef((props, ref) => /*#__PURE__*/jsx(Button, {
17098
17078
  * fully replaced and only props valid for that component apply.
17099
17079
  *
17100
17080
  * Discriminated on `selectionType`:
17101
- * - default / `'single'` → `value?: O`, `onChange?: (newValue: O) => void`.
17102
- * - `'multiple'` → `value?: O[]`, `onChange?: (newValue: O[]) => void`.
17081
+ * - default / `'single'` → `value?: O`, `onChange?: (newValue?: O) => void`.
17082
+ * - `'multiple'` → `value?: O[]`, `onChange?: (newValue?: O[]) => void`.
17103
17083
  *
17104
17084
  * `as` and `selectionType` are top-level on this type (rather than buried in
17105
17085
  * an intersection or union member) so that TS can infer `E` from `as` and
@@ -17112,11 +17092,10 @@ const DefaultButton = forwardRef((props, ref) => /*#__PURE__*/jsx(Button, {
17112
17092
 
17113
17093
  /**
17114
17094
  * Single-selection props (`selectionType` defaults to `'single'`).
17095
+ * Backwards-compatible alias — existing consumers do not need to set `selectionType`.
17115
17096
  */
17116
17097
 
17117
- /**
17118
- * Multi-selection props (`selectionType: 'multiple'` is required to opt in).
17119
- */
17098
+ /** Multi-selection props (`selectionType: 'multiple'` is required to opt in). */
17120
17099
 
17121
17100
  /**
17122
17101
  * `React.forwardRef` re-typed to preserve our polymorphic generics
@@ -17160,9 +17139,6 @@ const SelectButton$1 = React__default.forwardRef((props, ref) => {
17160
17139
  const next = toggleSelection(options, getOptionId, value, selectedOption?.value, isMultiple);
17161
17140
  onChange?.(next);
17162
17141
  }, [getOptionId, isMultiple, onChange, options, value]);
17163
-
17164
- // If as is defined and not the Button, render as, else render DefaultButton (with mdiMenuDown right icon)
17165
- const buttonAs = as && as !== Button ? as : DefaultButton;
17166
17142
  return SelectButton$2({
17167
17143
  options,
17168
17144
  getOptionId,
@@ -17175,9 +17151,10 @@ const SelectButton$1 = React__default.forwardRef((props, ref) => {
17175
17151
  isMultiselectable: isMultiple,
17176
17152
  label,
17177
17153
  labelDisplayMode,
17154
+ // With no `as`, the default trigger adds the chevron.
17178
17155
  buttonProps: {
17179
17156
  ...buttonProps,
17180
- as: buttonAs,
17157
+ as: as ?? DefaultButton,
17181
17158
  ref
17182
17159
  },
17183
17160
  popoverProps,
@@ -17208,6 +17185,24 @@ const SelectButton = Object.assign(SelectButton$1, {
17208
17185
  Option: ComboboxOption
17209
17186
  });
17210
17187
 
17188
+ /**
17189
+ * Get the display name for a single option value.
17190
+ *
17191
+ * Resolves the option's display name by trying `getOptionName` first,
17192
+ * then falling back to `getOptionId`, returning `''` for nullish values.
17193
+ */
17194
+ function getOptionDisplayName(value, getOptionName, getOptionId) {
17195
+ if (value === undefined || value === null) return '';
17196
+ if (getOptionName) {
17197
+ const name = getWithSelector(getOptionName, value);
17198
+ if (name != null) return String(name);
17199
+ }
17200
+ if (getOptionId) {
17201
+ return String(getWithSelector(getOptionId, value));
17202
+ }
17203
+ return '';
17204
+ }
17205
+
17211
17206
  /**
17212
17207
  * Component display name.
17213
17208
  */