@lumx/react 4.17.0 → 4.17.1-alpha.1

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 (4) hide show
  1. package/index.d.ts +68 -22
  2. package/index.js +379 -240
  3. package/index.js.map +1 -1
  4. package/package.json +6 -5
package/index.d.ts CHANGED
@@ -1457,6 +1457,25 @@ declare const Placement: {
1457
1457
  readonly LEFT_START: "left-start";
1458
1458
  };
1459
1459
  type Placement = ValueOf<typeof Placement>;
1460
+ /**
1461
+ * Popover fit anchor width options.
1462
+ */
1463
+ declare const FitAnchorWidth: {
1464
+ readonly MAX_WIDTH: "maxWidth";
1465
+ readonly MIN_WIDTH: "minWidth";
1466
+ readonly WIDTH: "width";
1467
+ };
1468
+ type FitAnchorWidth = ValueOf<typeof FitAnchorWidth>;
1469
+ /**
1470
+ * Popover height/width sizes
1471
+ */
1472
+ declare const POPOVER_SIZES: readonly ["m", "l", "xl", "xxl"];
1473
+
1474
+ /** Viewport-relative height value, e.g. `50vh`. */
1475
+ type VHSize = `${number}vh`;
1476
+ /** Pixel value, e.g. `12px`. */
1477
+ type PXSize = `${number}px`;
1478
+
1460
1479
  /**
1461
1480
  * Offset of the popover.
1462
1481
  */
@@ -1470,15 +1489,26 @@ interface Offset {
1470
1489
  * Popover elevation index.
1471
1490
  */
1472
1491
  type Elevation = 1 | 2 | 3 | 4 | 5;
1473
- /**
1474
- * Popover fit anchor width options.
1475
- */
1476
- declare const FitAnchorWidth: {
1477
- readonly MAX_WIDTH: "maxWidth";
1478
- readonly MIN_WIDTH: "minWidth";
1479
- readonly WIDTH: "width";
1480
- };
1481
- type FitAnchorWidth = ValueOf<typeof FitAnchorWidth>;
1492
+ /** Popover size value — pixel value, or "t-shirt" size token. */
1493
+ type PopoverSize = PXSize | (typeof POPOVER_SIZES)[number];
1494
+ /** Popover height value — extends PopoverSize with viewport-relative unit. */
1495
+ type PopoverHeight = PopoverSize | VHSize;
1496
+ /** Popover width value — same as PopoverSize (pixels or t-shirt only). */
1497
+ type PopoverWidth = PopoverSize;
1498
+ interface PopoverSizes {
1499
+ /** Exact width (pixels or t-shirt size). Combines with `fitToAnchorWidth`: if both target the same CSS property, the explicit prop wins for `width`. */
1500
+ width?: PopoverWidth;
1501
+ /** Minimum width (pixels or t-shirt size). Combines with `fitToAnchorWidth='minWidth'` as `max(anchor, value)`. */
1502
+ minWidth?: PopoverWidth;
1503
+ /** Maximum width (pixels or t-shirt size). Combines with `fitToAnchorWidth='maxWidth'` as `min(anchor, value)`. */
1504
+ maxWidth?: PopoverWidth;
1505
+ /** Exact height (pixels, vh, or t-shirt size). */
1506
+ height?: PopoverHeight;
1507
+ /** Minimum height (pixels, vh, or t-shirt size). */
1508
+ minHeight?: PopoverHeight;
1509
+ /** Maximum height (pixels, vh, or t-shirt size). Combines with `fitWithinViewportHeight` as `min(maxHeight, available)`. */
1510
+ maxHeight?: PopoverHeight;
1511
+ }
1482
1512
 
1483
1513
  /**
1484
1514
  * Shared popover props used by both React and Vue wrappers.
@@ -1508,7 +1538,7 @@ interface PopoverProps$1 extends HasClassName, HasTheme, HasCloseMode {
1508
1538
  * - `width`: popover equal to the anchor.
1509
1539
  */
1510
1540
  fitToAnchorWidth?: FitAnchorWidth | boolean;
1511
- /** Shrink popover if even after flipping there is not enough space. */
1541
+ /** Constrain popover height to avoid overflowing the viewport. */
1512
1542
  fitWithinViewportHeight?: boolean;
1513
1543
  /** Element to focus when opening the popover. */
1514
1544
  focusElement?: CommonRef;
@@ -1541,7 +1571,7 @@ interface PopoverProps$1 extends HasClassName, HasTheme, HasCloseMode {
1541
1571
  * Extends core PopoverProps, overriding ref-typed props with React-specific `RefObject` types
1542
1572
  * and replacing `handleClose` with the React-idiomatic `onClose` callback.
1543
1573
  */
1544
- interface PopoverProps extends GenericProps$1, ReactToJSX<PopoverProps$1, 'anchorRef' | 'as' | 'boundaryRef' | 'focusElement' | 'parentElement' | 'focusTrapZoneElement' | 'className'> {
1574
+ interface PopoverProps extends GenericProps$1, ReactToJSX<PopoverProps$1, 'anchorRef' | 'as' | 'boundaryRef' | 'focusElement' | 'parentElement' | 'focusTrapZoneElement' | 'className'>, PopoverSizes {
1545
1575
  /** Reference to the DOM element used to set the position of the popover. */
1546
1576
  anchorRef: RefObject<HTMLElement>;
1547
1577
  /** Customize the root element. (Must accept ref forwarding and props forwarding!). */
@@ -1832,10 +1862,14 @@ interface ComboboxEventMap {
1832
1862
  }
1833
1863
  /** Callbacks provided by the consumer (React/Vue) to react to combobox state changes. */
1834
1864
  interface ComboboxCallbacks {
1835
- /** Called when an option is selected (click or keyboard). */
1865
+ /**
1866
+ * Called when an option is selected (click or keyboard).
1867
+ * Return `false` to skip the default behaviour of updating the input value via `onChange`.
1868
+ * The combobox will still close normally.
1869
+ */
1836
1870
  onSelect?(option: {
1837
1871
  value: string;
1838
- }): void;
1872
+ }): boolean | void;
1839
1873
  }
1840
1874
  /**
1841
1875
  * Behavioral options for input-mode combobox (autocomplete/filter pattern).
@@ -2529,6 +2563,7 @@ interface DropdownProps extends GenericProps$1 {
2529
2563
  /**
2530
2564
  * Dropdown component.
2531
2565
  *
2566
+ * @deprecated Use `MenuButton` for action-based dropdowns, `SelectButton` for selection-based dropdowns, or `Popover` for lower-level control.
2532
2567
  * @param props Component props.
2533
2568
  * @param ref Component ref.
2534
2569
  * @return React element.
@@ -4336,11 +4371,8 @@ interface SelectButtonProps$1<O> extends BaseSelectProps<O> {
4336
4371
  * The wrapper layer chooses the shape; the core just renders names.
4337
4372
  */
4338
4373
  value?: O | O[];
4339
- /**
4340
- * When `true`, sets `aria-multiselectable="true"` on the listbox so
4341
- * the dropdown stays open after each selection (combobox setup detects this attribute).
4342
- */
4343
- isMultiselectable?: boolean;
4374
+ /** Single or multiple selection */
4375
+ selectionType?: 'single' | 'multiple';
4344
4376
  /** Button label (used for ARIA and when no selection). */
4345
4377
  label: string;
4346
4378
  /** Controls how the label/value is displayed in the button. */
@@ -4388,7 +4420,7 @@ declare const DefaultButton: Comp<ButtonProps, HTMLButtonElement>;
4388
4420
  /** Keys managed internally — never forwarded to the trigger element. */
4389
4421
  type OmittedKeys = 'value' | 'children' | 'role' | 'aria-controls' | 'aria-haspopup' | 'aria-expanded' | 'aria-activedescendant' | 'ref';
4390
4422
  /** Select-specific props common to both single and multi modes. */
4391
- type SelectButtonSelectProps<O> = Omit<ReactToJSX<SelectButtonProps$1<O>>, 'renderOption' | 'buttonProps' | 'value' | 'isMultiselectable'> & {
4423
+ interface SelectButtonSelectProps<O> extends ReactToJSX<SelectButtonProps$1<O>, 'renderOption' | 'buttonProps' | 'value' | 'handleSelect' | 'listProps' | 'infiniteScrollOptions'> {
4392
4424
  /** Called to load more options (infinite scroll). */
4393
4425
  onLoadMore?: () => void;
4394
4426
  /** Called when the dropdown opens or closes. */
@@ -4398,7 +4430,7 @@ type SelectButtonSelectProps<O> = Omit<ReactToJSX<SelectButtonProps$1<O>>, 'rend
4398
4430
  * Props `value`, `isSelected`, `description` and `key` are merged in automatically.
4399
4431
  */
4400
4432
  renderOption?: (option: O, index: number) => React__default.ReactNode;
4401
- };
4433
+ }
4402
4434
  /**
4403
4435
  * Forwarded trigger props for a given element `E`, minus the keys that the
4404
4436
  * component manages internally.
@@ -4546,6 +4578,11 @@ interface MultipleSelectTextFieldProps<O = any> extends BaseSelectTextFieldProps
4546
4578
  }
4547
4579
  /**
4548
4580
  * SelectTextField props — supports both single and multiple selection.
4581
+ * Discriminated on `selectionType`:
4582
+ * - `'single'` → `value?: O`, `onChange?: (newValue?: O) => void`.
4583
+ * - `'multiple'` → `value?: O[]`, `onChange?: (newValue?: O[]) => void`, `renderChip`, `getChipProps`.
4584
+ *
4585
+ * @typeParam O - Option object type, inferred from `options` / `getOptionId`.
4549
4586
  */
4550
4587
  type SelectTextFieldProps<O = any> = SingleSelectTextFieldProps<O> | MultipleSelectTextFieldProps<O>;
4551
4588
 
@@ -5435,7 +5472,16 @@ interface TimePickerFieldWrapperProps {
5435
5472
  */
5436
5473
  maxTime?: Date;
5437
5474
  /**
5438
- * Translations label for clear and show suggestions buttons.
5475
+ * Controls how the time value interacts with `[minTime, maxTime]` bounds.
5476
+ * Typed input is always snapped to bounds on blur.
5477
+ * - `'enforce'`: additionally, the controlled `value` prop is proactively
5478
+ * clamped to bounds on mount and whenever bounds change, calling
5479
+ * `onChange` when adjusted.
5480
+ * - `'on-blur'` (default): only blur snapping applies.
5481
+ */
5482
+ boundsMode?: 'on-blur' | 'enforce';
5483
+ /**
5484
+ * Translation labels for clear and show suggestions buttons.
5439
5485
  */
5440
5486
  translations: TimePickerFieldTranslations;
5441
5487
  }
@@ -5730,4 +5776,4 @@ declare const ThemeProvider: React__default.FC<{
5730
5776
  declare function useTheme(): ThemeContextValue;
5731
5777
 
5732
5778
  export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME$2 as CLASSNAME, COMPONENT_NAME$2 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, MenuButton, ListDivider as MenuDivider, MenuItem, 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 };
5733
- 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, MenuButtonProps, ListDividerProps as MenuDividerProps, MenuItemActionProps, MenuItemProps, 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 };
5779
+ 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, MenuButtonProps, ListDividerProps as MenuDividerProps, MenuItemActionProps, MenuItemProps, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverHeight, PopoverProps, PopoverWidth, 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 };