@cube-dev/ui-kit 0.0.0-canary-bef9600 → 0.0.0-canary-e3f8a1a
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/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +11 -5
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +27 -25
- package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -4
- package/dist/components/actions/Menu/styled.js.map +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.d.ts +4 -4
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +3 -3
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +7 -3
- package/dist/components/content/ItemBadge/ItemBadge.js.map +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +28 -15
- package/dist/components/content/Layout/Layout.js.map +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +20 -10
- package/dist/components/content/Layout/LayoutContext.js.map +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +12 -9
- package/dist/components/content/Layout/LayoutFooter.js.map +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.d.ts +14 -14
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +3 -3
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +2 -2
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +5 -5
- package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +26 -6
- package/dist/components/fields/ComboBox/ComboBox.js +1095 -619
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +84 -0
- package/dist/components/fields/ComboBox/comboBoxOptions.js.map +1 -0
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.d.ts +2 -2
- package/dist/components/fields/Input/Input.js +2 -2
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +10 -4
- package/dist/components/fields/ListBox/ListBox.js +293 -143
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +15 -12
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.d.ts +0 -1
- package/dist/components/fields/NumberInput/NumberInput.js +136 -128
- package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +38 -48
- package/dist/components/fields/NumberInput/StepButton.js.map +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.d.ts +1 -2
- package/dist/components/fields/PasswordInput/PasswordInput.js +77 -111
- package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +1 -1
- package/dist/components/fields/Picker/Picker.js +8 -3
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +8 -8
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.d.ts +8 -3
- package/dist/components/fields/SearchInput/SearchInput.js +22 -29
- package/dist/components/fields/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/fields/Select/Select.d.ts +12 -1
- package/dist/components/fields/Select/Select.js +365 -207
- package/dist/components/fields/Select/Select.js.map +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +3 -4
- package/dist/components/fields/Slider/RangeSlider.js.map +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.d.ts +0 -1
- package/dist/components/fields/TextArea/TextArea.js +49 -63
- package/dist/components/fields/TextArea/TextArea.js.map +1 -1
- package/dist/components/fields/TextInput/TextInput.d.ts +1 -1
- package/dist/components/fields/TextInput/TextInput.js +42 -46
- package/dist/components/fields/TextInput/TextInput.js.map +1 -1
- package/dist/components/fields/TextInput/TextInputBase.d.ts +6 -2
- package/dist/components/fields/TextInput/TextInputBase.js +32 -10
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +50 -0
- package/dist/components/fields/TextInput/displayed-validation.js.map +1 -0
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +2 -2
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/index.d.ts +2 -2
- package/dist/components/fields/option-origin-press.js +78 -0
- package/dist/components/fields/option-origin-press.js.map +1 -0
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.d.ts +6 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +3 -2
- package/dist/components/overlays/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +3 -2
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js.map +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +28 -14
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.d.ts +7 -3
- package/dist/components/overlays/Dialog/DialogTrigger.js +149 -132
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +83 -0
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js.map +1 -0
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +3 -2
- package/dist/components/overlays/Modal/Overlay.js.map +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Popover.js.map +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +8 -0
- package/dist/components/overlays/Tooltip/Tooltip.js +16 -22
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.d.ts +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +163 -113
- package/dist/components/overlays/Tooltip/TooltipTrigger.js.map +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/context.js.map +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +6 -5
- package/dist/components/overlays/Tooltip/split-trigger-props.js.map +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +11 -17
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +6 -4
- package/dist/i18n/locales/en-US/uikit.js +6 -4
- package/dist/i18n/locales/en-US/uikit.json.d.ts +3 -1
- package/dist/i18n/locales/es-ES/uikit.js +6 -4
- package/dist/i18n/locales/es-MX/uikit.js +6 -4
- package/dist/i18n/locales/fr-FR/uikit.js +6 -4
- package/dist/i18n/locales/it-IT/uikit.js +6 -4
- package/dist/i18n/locales/ja-JP/uikit.js +6 -4
- package/dist/i18n/locales/nb-NO/uikit.js +6 -4
- package/dist/i18n/locales/pt-BR/uikit.js +6 -4
- package/dist/i18n/locales/pt-PT/uikit.js +6 -4
- package/dist/i18n/locales/sv-SE/uikit.js +6 -4
- package/dist/i18n/locales/vi-VN/uikit.js +6 -4
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +18 -9
- package/dist/utils/react/nullableValue.js.map +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/actions/Button.md +8 -2
- package/docs/components/content/InfoBadge.md +2 -0
- package/docs/components/content/ItemBadge.md +4 -0
- package/docs/components/content/Layout.md +2 -1
- package/docs/components/fields/ComboBox.md +25 -18
- package/docs/components/fields/FilterListBox.md +2 -2
- package/docs/components/fields/FilterPicker.md +2 -2
- package/docs/components/fields/ListBox.md +14 -10
- package/docs/components/fields/NumberInput.md +10 -10
- package/docs/components/fields/PasswordInput.md +6 -7
- package/docs/components/fields/Picker.md +6 -5
- package/docs/components/fields/RadioGroup.md +1 -1
- package/docs/components/fields/SearchInput.md +7 -6
- package/docs/components/fields/Select.md +14 -8
- package/docs/components/fields/TextArea.md +4 -3
- package/docs/components/fields/TextInput.md +13 -6
- package/docs/components/overlays/AlertDialog.md +7 -1
- package/docs/components/overlays/Dialog.md +5 -5
- package/docs/components/overlays/DialogTrigger.md +6 -6
- package/docs/components/overlays/Tooltip.md +17 -6
- package/docs/components/overlays/TooltipTrigger.md +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBox.js","names":["useHover","IconMinus","useVirtualizer","BASE_STYLES","BasePropsWithoutChildren","BaseStyleProps","COLOR_STYLES","ColorStyleProps","mergeStyles","OUTER_STYLES","OuterStyleProps","Styles","tasty","CSSProperties","ForwardedRef","forwardRef","MutableRefObject","ReactElement","ReactNode","RefObject","useEffect","useLayoutEffect","useMemo","useRef","useState","AriaListBoxProps","DropTarget","mergeProps","mergeAriaProps","useDraggableItem","useDropIndicator","useKeyboard","useListBox","useListBoxSection","useOption","Section","BaseSection","DraggableCollectionState","DroppableCollectionState","ListProps","useListState","useWarn","useI18n","CheckIcon","GripVerticalIcon","Icon","SIZE_NAME_TO_KEY","SIZES","useCombinedRefs","useFocus","allowOverlayKeysToPropagate","extractStyles","StyledDivider","StyledFooter","StyledHeader","StyledSectionHeading","CollectionItem","CubeCollectionItemProps","filterCollectionItemProps","filterSelectionItemProps","getValueSelectionState","Item","getValidationMods","getValidationTheme","useFieldProps","wrapWithField","createMockDragState","DraggableListBox","CollectionBase","Key","FieldBaseProps","ListBoxWrapperElement","qa","styles","display","gridColumns","gridRows","flow","gap","position","radius","color","transition","outline","focused","border","valid","invalid","disabled","ListElement","as","padding","listStyle","boxSizing","margin","height","ListBoxScrollElement","overflow","scrollbar","ListBoxItem","disableActionsFocus","all","outlineOffset","cursor","draggable","opacity","gripIcon","ListBoxDropIndicatorElement","zIndex","pointerEvents","Indicator","$","left","right","top","fill","SectionWrapperElement","SectionListElement","ListBoxCheckbox","placeItems","width","flexShrink","ListBoxCheckboxWrapper","placeContent","placeSelf","renderCheckboxIcon","isSelected","isDisabled","isFocused","isHovered","isInvalid","isValid","mods","selected","hovered","CubeListBoxProps","Omit","T","listStyles","optionStyles","optionHighlight","sectionStyles","headingStyles","listGap","selectedKey","selectedKeys","defaultSelectedKey","defaultSelectedKeys","onSelectionChange","key","selectionMode","listRef","HTMLUListElement","disallowEmptySelection","allowDuplicateSelectionEvents","shouldFocusWrap","stateRef","focusOnHover","header","footer","headerStyles","footerStyles","Record","size","disableSelectionToggle","shouldUseVirtualFocus","isFocusWithin","onEscape","isCheckable","onOptionClick","showSelectAll","selectAllLabel","allValueProps","Partial","filter","nodes","Iterable","emptyLabel","shape","isReorderable","onReorder","newOrder","PROP_STYLES","SelectAllOption","label","isIndeterminate","state","lastFocusSourceRef","onClick","propagate","t","hoverProps","resolvedLabel","undefined","markIcon","localRef","HTMLLIElement","checkboxIcon","indeterminate","handleOptionClick","e","current","selectionManager","clickTarget","target","HTMLElement","checkboxElement","querySelector","contains","listboxitem","checkable","toStatelySelection","value","isMultiple","Set","ListBox","props","ref","HTMLDivElement","valuePropsMapper","onChange","fieldProps","Array","isArray","extra","id","labelStyles","isRequired","necessityIndicator","message","description","externalMods","labelSuffix","form","otherProps","forceUpdate","lastSelectedKeyRef","externalSelectionHandler","wrappedOnSelectionChange","keys","prevKey","from","listStateProps","disabledBehavior","selection","defaultSelection","listState","first","selectAllState","rawSelection","collection","disabledKeys","handleSelectAllClick","clearSelection","selectAll","args","keyboardProps","onKeyDown","itemsArray","hasSections","some","i","type","shouldVirtualize","listBoxProps","labelProps","isVirtualized","escapeKeyBehavior","focusProps","isListFocused","scrollRef","rowVirtualizer","count","length","getScrollElement","getItemKey","index","estimateSize","currentItem","XL","overscan","measure","focusedKey","scrollElement","itemElement","CSS","escape","String","scrollTop","viewportHeight","clientHeight","viewportBottom","itemRect","getBoundingClientRect","scrollRect","itemTop","itemBottom","isAlreadyVisible","scrollIntoView","block","behavior","mergedListBoxProps","tabIndex","orderedKeys","map","listGapTokens","listBoxField","dragState","dropState","collectionProps","sections","item","getTotalSize","getVirtualItems","virtualItem","measureElement","transform","start","renderedItems","isFirstSection","push","Option","highlight","isParentDisabled","virtualStyle","virtualRef","virtualIndex","element","has","isDraggable","mockDragState","dragResult","effectiveDragProps","dragProps","isDragging","optionProps","isPressed","descriptionProps","shouldSelectOnPressUp","shouldFocusOnHover","filteredItemProps","effectiveIcon","icon","handleOptionExtras","MouseEvent","setFocusedKey","onKeyUp","ariaSelected","ariaDisabled","role","filteredOptionProps","theme","const","includeValid","listBoxItem","pressed","dragging","rendered","dropPosition","ListBoxDropIndicator","t0","_c","t1","dropIndicatorProps","isHidden","isDropTarget","t2","t3","Symbol","for","t4","ListBoxSectionProps","ListBoxSection","heading","itemProps","headingProps","groupProps","childNodes","node","getItem","node_0","t5","t6","SectionComponent","ListBoxSectionComponent","Object","assign","displayName","defineProperty","enumerable","configurable"],"sources":["../../../../src/components/fields/ListBox/ListBox.tsx"],"sourcesContent":["import { useHover } from '@react-aria/interactions';\nimport { IconMinus } from '@tabler/icons-react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport {\n BASE_STYLES,\n BasePropsWithoutChildren,\n BaseStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n mergeStyles,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n CSSProperties,\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AriaListBoxProps,\n DropTarget,\n mergeProps as mergeAriaProps,\n useDraggableItem,\n useDropIndicator,\n useKeyboard,\n useListBox,\n useListBoxSection,\n useOption,\n} from 'react-aria';\nimport {\n Section as BaseSection,\n DraggableCollectionState,\n DroppableCollectionState,\n ListProps,\n useListState,\n} from 'react-stately';\n\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CheckIcon } from '../../../icons/CheckIcon';\nimport { GripVerticalIcon } from '../../../icons/GripVerticalIcon';\nimport { Icon } from '../../../icons/Icon';\nimport { SIZE_NAME_TO_KEY, SIZES } from '../../../tokens';\nimport { mergeProps, useCombinedRefs } from '../../../utils/react';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { extractStyles } from '../../../utils/styles';\n// Import Menu styled components for header and footer\nimport {\n StyledDivider,\n StyledFooter,\n StyledHeader,\n StyledSectionHeading,\n} from '../../actions/Menu/styled';\nimport {\n CollectionItem,\n CubeCollectionItemProps,\n filterCollectionItemProps,\n filterSelectionItemProps,\n getValueSelectionState,\n} from '../../CollectionItem';\nimport { Item } from '../../content/Item/Item';\nimport {\n getValidationMods,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport { createMockDragState } from '../../shared/DraggableCollection';\n\nimport { DraggableListBox } from './DraggableListBox';\n\nimport type { CollectionBase, Key } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\nconst ListBoxWrapperElement = tasty({\n qa: 'ListBox',\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: 'max-content max-content max-content 1sf max-content',\n flow: 'column',\n gap: 0,\n position: 'relative',\n radius: {\n '': '1cr',\n '[data-shape=\"popover\"]': '(1cr - 1bw)',\n '[data-shape=\"plain\"]': '0',\n },\n color: '#dark-02',\n transition: 'theme',\n outline: {\n '': '#purple-03.0',\n 'invalid & focused': '#danger.50',\n focused: '#purple-03',\n },\n border: {\n '': true,\n focused: '#primary-text',\n valid: '#success-text.50',\n invalid: '#danger-text.50',\n disabled: true,\n '[data-shape=\"plain\"] | [data-shape=\"popover\"] | searchable': false,\n },\n },\n});\n\nconst ListElement = tasty({\n as: 'ul',\n styles: {\n // The space between options. Set from `listGap`, which also hands the\n // same number to the virtualizer.\n '$list-gap': '1bw',\n display: 'block',\n // The space kept below the last option. Padding, so `listStyles` can take\n // it away, and outside the content box, where a virtualized list sets its\n // own height.\n padding: '.5x bottom',\n listStyle: 'none',\n boxSizing: 'content-box',\n margin: {\n '': '.5x .5x 0 .5x',\n '[data-shape=\"plain\"]': '0',\n },\n height: 'max-content',\n },\n});\n\n// NEW: dedicated scroll container for ListBox\nconst ListBoxScrollElement = tasty({\n as: 'div',\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: '1sf',\n overflow: 'auto',\n scrollbar: 'styled',\n },\n});\n\n// Create an extended Item for ListBox options with 'all' modifier support\nconst ListBoxItem = tasty(Item, {\n as: 'li',\n disableActionsFocus: true,\n styles: {\n display: 'grid',\n margin: {\n '': '$list-gap bottom',\n // Mid-drag the last option is followed by a drop indicator, which takes\n // the gap back (`ListBoxDropIndicatorElement`). Not `:has(~ …)`: see\n // AGENTS.md → Styling.\n ':last-child': '0',\n all: '.5x',\n },\n // Inside the option: options sit a hairline apart, so a ring outside one\n // would cover its neighbour, and the scroll box would clip it at the edges.\n outlineOffset: '-1bw',\n Icon: {\n cursor: {\n draggable: 'grab',\n },\n opacity: {\n gripIcon: '.4',\n 'gripIcon & hovered': '1',\n },\n transition: {\n draggable: 'opacity',\n },\n },\n },\n});\n\n// Horizontal drop indicator for DnD reordering\nconst ListBoxDropIndicatorElement = tasty({\n as: 'li',\n styles: {\n zIndex: 10,\n position: 'relative',\n pointerEvents: 'none',\n height: 0,\n // After the last option: cancels the `$list-gap` that option keeps while\n // it is not the last child, so the list holds its height mid-drag. An\n // `optionStyles` margin replaces that gap, and this then overshoots.\n margin: {\n '': 0,\n ':last-child': '(-1 * $list-gap) top',\n },\n opacity: {\n '': 0,\n 'drop-target': 1,\n },\n\n Indicator: {\n $: '>',\n position: 'absolute',\n left: '.5x',\n right: '.5x',\n // Centred in the gap between two options, or on the edge of the list.\n top: {\n '': '(-1px - $list-gap / 2)',\n ':first-child | :last-child': '-1px',\n },\n height: '2px',\n fill: '#primary',\n radius: 'round',\n },\n },\n});\n\nconst SectionWrapperElement = tasty({\n as: 'li',\n styles: {\n display: 'block',\n },\n});\n\nconst SectionListElement = tasty({\n qa: 'ListBoxSectionList',\n as: 'ul',\n styles: {\n display: 'flex',\n gap: '0',\n flow: 'column',\n margin: '0',\n padding: '0',\n listStyle: 'none',\n },\n});\n\n// Checkbox component for multiple selection options\nconst ListBoxCheckbox = tasty({\n as: 'div',\n styles: {\n display: 'grid',\n placeItems: 'center',\n radius: '.5r',\n width: '(2x - 2bw)',\n height: '(2x - 2bw)',\n flexShrink: 0,\n transition: 'theme',\n opacity: {\n '': 0,\n 'selected | indeterminate | hovered | focused': 1,\n },\n fill: {\n '': '#surface',\n 'selected | indeterminate': '#primary',\n 'invalid & !(selected | indeterminate)': '#surface',\n 'invalid & (selected | indeterminate)': '#danger',\n disabled: '#dark.12',\n },\n color: {\n '': '#clear',\n 'selected | indeterminate': '#white',\n },\n border: {\n '': '#dark.30',\n invalid: '#danger',\n 'disabled | ((selected | indeterminate) & !invalid)': '#clear',\n },\n },\n});\n\nconst ListBoxCheckboxWrapper = tasty({\n as: 'div',\n styles: {\n display: 'grid',\n placeItems: 'center',\n placeContent: 'center',\n cursor: '$pointer',\n placeSelf: 'stretch',\n },\n});\n\nfunction renderCheckboxIcon({\n isSelected,\n isDisabled,\n isFocused,\n isHovered,\n isInvalid,\n isValid,\n}: {\n isSelected: boolean;\n isDisabled: boolean;\n isFocused: boolean;\n isHovered: boolean;\n isInvalid?: boolean;\n isValid?: boolean;\n}) {\n const mods = {\n selected: isSelected,\n disabled: isDisabled,\n focused: isFocused,\n hovered: isHovered,\n ...getValidationMods({ isInvalid, isValid }),\n };\n\n return (\n <ListBoxCheckboxWrapper data-element=\"CheckboxWrapper\" mods={mods}>\n <ListBoxCheckbox data-element=\"Checkbox\" mods={mods}>\n <CheckIcon size={12} stroke={3} />\n </ListBoxCheckbox>\n </ListBoxCheckboxWrapper>\n );\n}\n\nexport interface CubeListBoxProps<T>\n extends Omit<\n AriaListBoxProps<T>,\n 'autoFocus' | 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange'\n >,\n CollectionBase<T>,\n FieldBaseProps<Key | readonly Key[] | null | undefined>,\n BasePropsWithoutChildren,\n // The style props `PROP_STYLES` extracts at runtime and the docs list;\n // without these a `height` or `width` worked but failed to type-check.\n BaseStyleProps,\n OuterStyleProps,\n ColorStyleProps {\n /** Custom styles for the list container */\n listStyles?: Styles;\n /** Custom styles for individual options */\n optionStyles?: Styles;\n /**\n * Substring to highlight within each option's (text) children. Typically the\n * current search query. Matching is case-insensitive.\n */\n optionHighlight?: string;\n /** Custom styles for section containers */\n sectionStyles?: Styles;\n /** Custom styles for section headings */\n headingStyles?: Styles;\n /**\n * Space between options, in pixels. Defaults to a hairline (`1bw`). It\n * applies to flat, virtualized, sectioned and reorderable lists alike.\n */\n listGap?: number;\n /** Whether the ListBox is disabled */\n isDisabled?: boolean;\n /** The selected key in controlled single selection mode */\n selectedKey?: Key | null;\n /** The selected keys in controlled multiple selection mode. Use \"all\" to select all items or an array of keys */\n selectedKeys?: 'all' | Key[];\n /** The default selected key in uncontrolled single selection mode */\n defaultSelectedKey?: Key | null;\n /** The default selected keys in uncontrolled multiple selection mode. Use \"all\" to select all items or an array of keys */\n defaultSelectedKeys?: 'all' | Key[];\n /** Callback fired when selection changes */\n onSelectionChange?: (key: Key | null | 'all' | Key[]) => void;\n /** The selection mode of the ListBox */\n selectionMode?: 'single' | 'multiple';\n /** Ref for accessing the list DOM element */\n listRef?: RefObject<HTMLUListElement | null>;\n /** Whether to disallow empty selection */\n disallowEmptySelection?: boolean;\n /**\n * Whether `onSelectionChange` should fire even when the new selection equals the\n * current one (e.g. re-selecting the already-selected item with `disallowEmptySelection`).\n * React Stately suppresses such duplicate events by default. Popover-based wrappers\n * (Picker, FilterPicker) rely on the duplicate event to close the popover on re-select.\n */\n allowDuplicateSelectionEvents?: boolean;\n /** Whether to wrap focus when reaching the end of the list */\n shouldFocusWrap?: boolean;\n /**\n * Ref to access the internal ListState instance.\n * This allows parent components to access selection state and other list functionality.\n */\n stateRef?: RefObject<any | null>;\n\n /**\n * Whether moving the pointer over an option will move DOM focus to that option.\n * Set to false for components that keep DOM focus outside (e.g. searchable FilterListBox).\n * Defaults to true.\n */\n focusOnHover?: boolean;\n /** Custom header content displayed above the list */\n header?: ReactNode;\n /** Custom footer content displayed below the list */\n footer?: ReactNode;\n /** Custom styles for the header */\n headerStyles?: Styles;\n /** Custom styles for the footer */\n footerStyles?: Styles;\n /** Additional modifiers for styling the ListBox */\n mods?: Record<string, boolean>;\n /** Size variant of the ListBox */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * When `true`, clicking an already-selected item keeps it selected instead of toggling it off.\n * Useful when embedding ListBox inside components like ComboBox.\n */\n disableSelectionToggle?: boolean;\n\n /**\n * Whether to use virtual focus for keyboard navigation.\n * When true, DOM focus stays outside individual option elements (useful for searchable lists).\n * Defaults to false for backward compatibility.\n */\n shouldUseVirtualFocus?: boolean;\n\n /**\n * For a list whose focused option is moved from an input outside it, as\n * FilterListBox's search input does: whether focus is within that input's\n * component. The focused option is marked only while it is `true`. Unset, the\n * list's own focus decides, and with `shouldUseVirtualFocus` the focused\n * option is always marked.\n */\n isFocusWithin?: boolean;\n\n /**\n * Callback fired when the user presses Escape key.\n * When provided, this prevents React Aria's default Escape behavior (selection reset).\n */\n onEscape?: () => void;\n\n /**\n * Whether to show checkboxes for multiple selection mode.\n * This adds a checkbox icon to the left of each option.\n */\n isCheckable?: boolean;\n\n /**\n * Callback fired when an option is clicked but not on the checkbox area.\n * Used by FilterPicker to close the popover on non-checkbox clicks.\n */\n onOptionClick?: (key: Key) => void;\n\n /**\n * Whether to show the \"Select All\" option in multiple selection mode.\n * This adds a select all option to the header that allows selecting/deselecting all items.\n */\n showSelectAll?: boolean;\n\n /**\n * Label for the \"Select All\" option. Defaults to \"Select All\".\n */\n selectAllLabel?: ReactNode;\n\n /**\n * Props to apply to the \"Select All\" option.\n */\n allValueProps?: Partial<CubeCollectionItemProps<T>>;\n\n /**\n * Filter function to apply to the collection nodes.\n * Takes an iterable of nodes and returns a filtered iterable.\n * Useful for implementing search/filter functionality.\n */\n filter?: (nodes: Iterable<any>) => Iterable<any>;\n\n /**\n * Label to display when the list is empty (no items available).\n * Defaults to \"No items\".\n */\n emptyLabel?: ReactNode;\n\n /**\n * Visual shape of the ListBox styling.\n * - `card` (default): Standard card styling with border and margin\n * - `plain`: No border, no margin, no radius - suitable for embedded use\n * - `popover`: No border, but keeps margin and radius - suitable for overlay use\n * Defaults to 'card'.\n */\n shape?: 'card' | 'plain' | 'popover';\n\n /**\n * Enable drag-and-drop reordering of list items.\n * When enabled, virtualization is disabled and each item gets a drag handle.\n * @default false\n */\n isReorderable?: boolean;\n\n /**\n * Callback when items are reordered via drag-and-drop.\n * Called with the new array of item keys in their new order.\n */\n onReorder?: (newOrder: string[]) => void;\n}\n\nconst PROP_STYLES = [...BASE_STYLES, ...OUTER_STYLES, ...COLOR_STYLES];\n\nconst SelectAllOption = ({\n label,\n isSelected,\n isIndeterminate,\n isDisabled,\n isCheckable,\n size = 'medium',\n state,\n lastFocusSourceRef,\n onClick,\n allValueProps = {},\n}: {\n label?: ReactNode;\n isSelected: boolean;\n isIndeterminate: boolean;\n isDisabled?: boolean;\n isCheckable?: boolean;\n size?: 'small' | 'medium' | 'large';\n state: any;\n lastFocusSourceRef: MutableRefObject<'keyboard' | 'mouse' | 'other'>;\n onClick: (propagate?: boolean) => void;\n allValueProps?: Partial<CubeCollectionItemProps<any>>;\n}) => {\n const { t } = useI18n();\n const { hoverProps, isHovered } = useHover({ isDisabled });\n const resolvedLabel =\n label === '' || label === undefined || label === null\n ? t('listBox.selectAll', 'Select All')\n : label;\n\n const markIcon = isIndeterminate ? (\n <Icon size={12} stroke={3} aria-hidden=\"true\">\n <IconMinus />\n </Icon>\n ) : (\n <CheckIcon size={12} stroke={3} />\n );\n\n const localRef = useRef<HTMLLIElement>(null);\n\n // Create checkbox icon for select all option\n const checkboxIcon = useMemo(() => {\n if (!isCheckable) {\n return null;\n }\n\n return (\n <ListBoxCheckboxWrapper\n data-element=\"CheckboxWrapper\"\n mods={{\n selected: isSelected,\n disabled: isDisabled,\n hovered: isHovered,\n indeterminate: isIndeterminate,\n }}\n >\n <ListBoxCheckbox\n data-element=\"Checkbox\"\n mods={{\n selected: isSelected,\n disabled: isDisabled,\n hovered: isHovered,\n indeterminate: isIndeterminate,\n }}\n >\n {(isIndeterminate || isSelected) && markIcon}\n </ListBoxCheckbox>\n </ListBoxCheckboxWrapper>\n );\n }, [\n isCheckable,\n isSelected,\n isDisabled,\n isHovered,\n isIndeterminate,\n markIcon,\n ]);\n\n const handleOptionClick = (e) => {\n // Mark focus changes from mouse clicks\n if (lastFocusSourceRef) {\n lastFocusSourceRef.current = 'mouse';\n }\n\n // If there's an onOptionClick callback and this is checkable in multiple mode,\n // we need to distinguish between checkbox and content clicks\n if (state.selectionManager.selectionMode === 'multiple') {\n // Check if the click target is within the checkbox area\n const clickTarget = e.target as HTMLElement;\n const checkboxElement = localRef.current?.querySelector(\n '[data-element=\"CheckboxWrapper\"]',\n );\n\n if (\n checkboxElement &&\n (checkboxElement === clickTarget ||\n checkboxElement.contains(clickTarget))\n ) {\n onClick?.(false);\n } else {\n // Then call the callback (which will close the popover in FilterPicker)\n onClick?.(true);\n }\n } else {\n onClick?.(true);\n }\n };\n\n return (\n <>\n <ListBoxItem\n ref={localRef}\n data-size={size}\n size={size}\n role=\"option\"\n aria-selected={isSelected}\n isSelected={isSelected}\n isDisabled={isDisabled}\n icon={checkboxIcon}\n mods={{\n listboxitem: true,\n disabled: isDisabled,\n checkable: isCheckable,\n hovered: isHovered,\n indeterminate: isIndeterminate,\n all: true, // Important: this preserves the 'all' modifier\n }}\n {...mergeProps(hoverProps, allValueProps, {\n onClick: handleOptionClick,\n })}\n >\n {resolvedLabel}\n </ListBoxItem>\n <StyledDivider />\n </>\n );\n};\n\n/**\n * A public selection prop as the Set-based value React Stately expects: a key\n * array (or `'all'`, passed through) in multiple mode, a single key (or\n * `null` for none) in single mode.\n */\nfunction toStatelySelection(\n value: 'all' | Key[] | Key | null,\n isMultiple: boolean,\n): 'all' | Set<Key> {\n if (isMultiple) {\n return value === 'all' ? 'all' : new Set(value as Key[]);\n }\n\n return value == null ? new Set() : new Set([value as Key]);\n}\n\nexport const ListBox = forwardRef(function ListBox<T extends object>(\n props: CubeListBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: any = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: any) => {\n if (props.selectionMode === 'multiple') {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n const { t } = useI18n();\n\n let {\n qa,\n label,\n extra,\n id,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n listStyles,\n optionStyles,\n optionHighlight,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n message,\n description,\n styles,\n mods: externalMods,\n size = 'medium',\n labelSuffix,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n shouldUseVirtualFocus,\n isFocusWithin,\n onSelectionChange,\n disableSelectionToggle = false,\n allowDuplicateSelectionEvents,\n stateRef,\n focusOnHover,\n header,\n footer,\n headerStyles,\n footerStyles,\n onEscape,\n isCheckable,\n onOptionClick,\n showSelectAll,\n selectAllLabel,\n allValueProps,\n filter,\n emptyLabel = t('listBox.noItems', 'No items'),\n shape = 'card',\n isReorderable = false,\n onReorder,\n form,\n ...otherProps\n } = props;\n\n const [, forceUpdate] = useState({});\n const lastSelectedKeyRef = useRef<Key | null>(null);\n\n // Wrap onSelectionChange to prevent selection when disabled and handle React Aria's Set format\n const externalSelectionHandler = onSelectionChange || (props as any).onChange;\n\n const wrappedOnSelectionChange = useMemo(() => {\n if (!externalSelectionHandler) return undefined;\n\n return (keys: any) => {\n // Don't allow selection changes when disabled\n if (isDisabled) {\n return;\n }\n\n // React Aria always passes a Set for selection changes\n // Handle the special \"all\" case and convert to our public API format\n if (keys === 'all') {\n externalSelectionHandler('all');\n } else if (keys instanceof Set) {\n if (keys.size === 0) {\n if (disableSelectionToggle && props.selectionMode === 'single') {\n const prevKey = lastSelectedKeyRef.current;\n if (prevKey != null) {\n externalSelectionHandler(prevKey);\n return;\n }\n }\n externalSelectionHandler(\n props.selectionMode === 'multiple' ? [] : null,\n );\n } else if (props.selectionMode === 'multiple') {\n externalSelectionHandler(Array.from(keys));\n } else {\n const key = Array.from(keys)[0];\n lastSelectedKeyRef.current = key ?? null;\n externalSelectionHandler(key);\n }\n } else {\n lastSelectedKeyRef.current = keys as Key | null;\n externalSelectionHandler(keys);\n }\n };\n }, [\n externalSelectionHandler,\n isDisabled,\n props.selectionMode,\n disableSelectionToggle,\n ]);\n\n // Prepare props for useListState with correct selection props\n const listStateProps: ListProps<T> = {\n ...props,\n onSelectionChange: wrappedOnSelectionChange,\n disabledBehavior: 'all',\n filter,\n selectionMode: props.selectionMode || 'single',\n allowDuplicateSelectionEvents,\n };\n\n // Set selection props based on mode: the array props in multiple mode, the\n // scalar key props in single mode.\n const isMultiple = listStateProps.selectionMode === 'multiple';\n const selection = isMultiple ? selectedKeys : selectedKey;\n const defaultSelection = isMultiple\n ? defaultSelectedKeys\n : defaultSelectedKey;\n\n if (selection !== undefined) {\n listStateProps.selectedKeys = toStatelySelection(selection, isMultiple);\n }\n\n if (defaultSelection !== undefined) {\n listStateProps.defaultSelectedKeys = toStatelySelection(\n defaultSelection,\n isMultiple,\n );\n }\n\n const listState = getValueSelectionState(useListState(listStateProps));\n\n useLayoutEffect(() => {\n const selected = listState.selectionManager.selectedKeys;\n if (selected && (selected as any).size > 0) {\n const first = Array.from(selected as Set<Key>)[0];\n lastSelectedKeyRef.current = first ?? null;\n }\n }, [listState.selectionManager.selectedKeys]);\n\n // Calculate select all state for multiple selection mode\n const selectAllState = useMemo(() => {\n // Select-all only makes sense for multiple selection mode *and* when the UI is enabled\n if (props.selectionMode !== 'multiple' || !showSelectAll) {\n return { isSelected: false, isIndeterminate: false };\n }\n\n // React Stately exposes the raw selection value which is either the string \"all\"\n // (when `selectAll()` was used) **or** a Set of item keys.\n const rawSelection: any = (listState.selectionManager as any).rawSelection;\n\n // Fast path – user pressed our \"Select All\" control previously.\n if (rawSelection === 'all') {\n return { isSelected: true, isIndeterminate: false };\n }\n\n const selectedKeys = listState.selectionManager.selectedKeys as Set<Key>;\n\n // When there is nothing selected, we are in a clear state\n if (selectedKeys.size === 0) {\n return { isSelected: false, isIndeterminate: false };\n }\n\n // Otherwise it must be a partial (indeterminate) selection.\n return { isSelected: false, isIndeterminate: true };\n }, [\n props.selectionMode,\n showSelectAll,\n listState.collection,\n listState.disabledKeys,\n listState.selectionManager.selectedKeys,\n listState.selectionManager.rawSelection,\n ]);\n\n // Handle select all click\n const handleSelectAllClick = (propagate?: boolean) => {\n if (isDisabled || props.selectionMode !== 'multiple') return;\n\n if (selectAllState.isSelected) {\n // All selected, deselect all\n listState.selectionManager.clearSelection();\n // Manually call the wrapped handler since React Aria might not trigger it\n wrappedOnSelectionChange?.(new Set());\n } else {\n // Some or none selected, select all\n listState.selectionManager.selectAll();\n // Manually call the wrapped handler since React Aria might not trigger it\n wrappedOnSelectionChange?.('all');\n forceUpdate({});\n }\n\n if (propagate && !selectAllState.isSelected) {\n onOptionClick?.('__ALL__');\n }\n };\n\n // Track whether the last focus change was due to keyboard navigation\n const lastFocusSourceRef = useRef<'keyboard' | 'mouse' | 'other'>('other');\n\n // Expose the list state instance via the provided ref (if any)\n if (stateRef) {\n stateRef.current = {\n ...listState,\n lastFocusSourceRef,\n };\n }\n\n // Warn if isCheckable is false in single selection mode\n useWarn(isCheckable === false && props.selectionMode === 'single', {\n key: ['listbox-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n // Custom keyboard handling: `Escape` and `Tab` have to leave the list so a\n // surrounding overlay can close on the one and keep focus inside with the\n // other, while every other key stays contained. See\n // `allowOverlayKeysToPropagate`.\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n allowOverlayKeysToPropagate(e);\n\n // Mark focus changes from keyboard navigation\n if (\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'Home' ||\n e.key === 'End' ||\n e.key === 'PageUp' ||\n e.key === 'PageDown'\n ) {\n lastFocusSourceRef.current = 'keyboard';\n }\n\n if (e.key === 'Escape') {\n // Called to potentially override the default selection clearing.\n onEscape?.();\n }\n },\n });\n\n styles = extractStyles(otherProps, PROP_STYLES, styles);\n\n ref = useCombinedRefs(ref);\n listRef = useCombinedRefs(listRef);\n\n // ----- Collection and virtualization decision (must precede useListBox) -----\n const itemsArray = useMemo(\n () => [...listState.collection],\n [listState.collection],\n );\n\n const hasSections = useMemo(\n () => itemsArray.some((i) => i.type === 'section'),\n [itemsArray],\n );\n\n const shouldVirtualize = !hasSections && !isReorderable;\n\n const { listBoxProps, labelProps } = useListBox(\n {\n ...props,\n id: id,\n // Only disable isVirtualized for reorderable lists (DnD needs real DOM focus).\n // Section-based lists keep isVirtualized: true to preserve ARIA attributes.\n isVirtualized: !isReorderable,\n shouldUseVirtualFocus: shouldUseVirtualFocus ?? false,\n escapeKeyBehavior: onEscape ? 'none' : 'clearSelection',\n onSelectionChange: wrappedOnSelectionChange,\n },\n listState,\n listRef,\n );\n\n const { isFocused, focusProps } = useFocus();\n\n // The focused key outlives focus, so an option shows as focused only while\n // the list has it. A component whose input moves the key (FilterListBox)\n // says whether focus is within it, in any focus mode. Otherwise the list's\n // own focus decides, and with virtual focus the focused key alone marks it.\n const isListFocused =\n isFocusWithin ??\n (shouldUseVirtualFocus || listState.selectionManager.isFocused);\n\n // Scroll container ref for virtualization\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const rowVirtualizer = useVirtualizer({\n count: shouldVirtualize ? itemsArray.length : 0,\n getScrollElement: () => scrollRef.current,\n // Use the actual item key to ensure React properly reconciles DOM elements\n // when items are filtered, added, or removed. Without this, the virtualizer\n // uses index-based keys which causes DOM reuse issues and style leaking.\n // A new key function makes the virtualizer recompute positions from the\n // heights it has measured per key. ListBox isn't compiled (useVirtualizer),\n // so that is every render. Reading `itemsArray` keeps new items bringing a\n // new function should it ever compile.\n getItemKey: (index: number) => itemsArray[index]?.key ?? index,\n estimateSize: (index: number) => {\n const currentItem: any = itemsArray[index];\n\n if (currentItem?.props?.description) {\n return SIZES.XL;\n }\n return SIZES[SIZE_NAME_TO_KEY[size] as keyof typeof SIZES];\n },\n // Options are positioned absolutely here, so their margins space nothing.\n // `1` matches the `1bw` default.\n gap: listGap ?? 1,\n overscan: 10,\n });\n\n // The virtualizer caches positions without the gap, so re-measure when it\n // changes. Not when the items do: their positions follow `getItemKey`, and\n // `measure()` would drop every measured height.\n useEffect(() => {\n if (shouldVirtualize) {\n rowVirtualizer.measure();\n }\n }, [shouldVirtualize, rowVirtualizer, listGap]);\n\n // Keep focused item visible, but only for keyboard navigation\n useLayoutEffect(() => {\n const focusedKey = listState.selectionManager.focusedKey;\n if (focusedKey == null) return;\n\n // Only scroll on keyboard navigation\n if (lastFocusSourceRef.current !== 'keyboard') return;\n\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const itemElement = scrollElement.querySelector(\n `[data-key=\"${CSS.escape(String(focusedKey))}\"]`,\n ) as HTMLElement;\n if (!itemElement) return;\n\n const scrollTop = scrollElement.scrollTop;\n const viewportHeight = scrollElement.clientHeight;\n const viewportBottom = scrollTop + viewportHeight;\n\n const itemRect = itemElement.getBoundingClientRect();\n const scrollRect = scrollElement.getBoundingClientRect();\n\n // Calculate item position relative to scroll container\n const itemTop = itemRect.top - scrollRect.top + scrollTop;\n const itemBottom = itemTop + itemRect.height;\n\n // Check if the item is fully visible in the viewport\n const isAlreadyVisible =\n itemTop >= scrollTop && itemBottom <= viewportBottom;\n\n if (!isAlreadyVisible) {\n // Use scrollIntoView with block: 'nearest' to minimize scroll jumps\n itemElement.scrollIntoView({ block: 'nearest', behavior: 'auto' });\n }\n }, [listState.selectionManager.focusedKey, itemsArray]);\n\n // Merge React Aria listbox props with custom keyboard props so both sets of\n // event handlers (e.g. Arrow navigation *and* our Escape handler) are\n // preserved.\n // `useListBox` takes no validation state, so the list would look invalid\n // without a screen reader ever hearing it.\n const mergedListBoxProps = mergeProps(listBoxProps, keyboardProps, {\n 'aria-invalid': isInvalid || undefined,\n });\n\n // React Aria keeps a disabled list a Tab stop while no option has focus.\n if (isDisabled) {\n delete mergedListBoxProps.tabIndex;\n }\n\n // Ordered keys for DnD reordering\n const orderedKeys = useMemo(() => {\n if (!isReorderable) {\n return [];\n }\n\n return itemsArray\n .filter((i) => i.type === 'item')\n .map((i) => String(i.key));\n }, [isReorderable, itemsArray]);\n\n const mods = useMemo(\n () => ({\n ...getValidationMods({ isInvalid, isValid }),\n disabled: isDisabled,\n focused: isFocused,\n header: !!header || (showSelectAll && props.selectionMode === 'multiple'),\n footer: !!footer,\n selectAll: showSelectAll && props.selectionMode === 'multiple',\n ...externalMods,\n }),\n [\n isInvalid,\n isValid,\n isDisabled,\n isFocused,\n header,\n footer,\n showSelectAll,\n props.selectionMode,\n externalMods,\n ],\n );\n\n const listGapTokens =\n listGap == null ? undefined : { '$list-gap': `${listGap}px` };\n\n const listBoxField = (\n <ListBoxWrapperElement\n ref={ref}\n qa=\"ListBoxWrapper\"\n mods={mods}\n styles={styles}\n data-shape={shape}\n >\n {header ? (\n <StyledHeader styles={headerStyles} data-size={size}>\n {header}\n </StyledHeader>\n ) : (\n <div role=\"presentation\" />\n )}\n {showSelectAll && props.selectionMode === 'multiple' ? (\n <SelectAllOption\n label={selectAllLabel}\n state={listState}\n lastFocusSourceRef={lastFocusSourceRef}\n isSelected={selectAllState.isSelected}\n isIndeterminate={selectAllState.isIndeterminate}\n isDisabled={isDisabled}\n isCheckable={isCheckable}\n size={size}\n allValueProps={allValueProps}\n onClick={handleSelectAllClick}\n />\n ) : (\n <>\n <div role=\"presentation\" />\n <div role=\"presentation\" />\n </>\n )}\n {/* Scroll container wrapper */}\n <ListBoxScrollElement ref={scrollRef} mods={mods} {...focusProps}>\n {listState.collection.size === 0 ? (\n <Item preset=\"t4\" color=\"#dark-03\" size={size} padding=\"(.5x - 1bw)\">\n {emptyLabel}\n </Item>\n ) : isReorderable ? (\n <DraggableListBox\n state={listState}\n listRef={listRef}\n orderedKeys={orderedKeys}\n onReorder={onReorder}\n >\n {(dragState, dropState, collectionProps) => (\n <ListElement\n qa={qa || 'ListBox'}\n {...mergeProps(mergedListBoxProps, collectionProps)}\n ref={listRef}\n styles={listStyles}\n tokens={listGapTokens}\n aria-disabled={isDisabled || undefined}\n mods={{ sections: false }}\n data-shape={shape}\n data-input-type=\"listbox\"\n >\n {itemsArray\n .filter((item) => item.type === 'item')\n .map((item) => (\n <Option\n key={item.key}\n size={size}\n item={item}\n state={listState}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n lastFocusSourceRef={lastFocusSourceRef}\n dragState={dragState}\n dropState={dropState}\n onClick={onOptionClick}\n />\n ))}\n </ListElement>\n )}\n </DraggableListBox>\n ) : (\n <ListElement\n qa={qa || 'ListBox'}\n {...mergedListBoxProps}\n ref={listRef}\n styles={listStyles}\n tokens={listGapTokens}\n aria-disabled={isDisabled || undefined}\n mods={{ sections: hasSections }}\n data-shape={shape}\n data-input-type=\"listbox\"\n style={\n shouldVirtualize\n ? {\n position: 'relative',\n height: `${rowVirtualizer.getTotalSize()}px`,\n }\n : undefined\n }\n >\n {shouldVirtualize\n ? rowVirtualizer.getVirtualItems().map((virtualItem) => {\n const item = itemsArray[virtualItem.index];\n\n return (\n <Option\n key={item.key}\n size={size}\n item={item}\n state={listState}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n // Measures the option's real height; the virtualizer adds the gap.\n virtualRef={rowVirtualizer.measureElement as any}\n virtualStyle={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n transform: `translateY(${virtualItem.start}px)`,\n }}\n virtualIndex={virtualItem.index}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />\n );\n })\n : (() => {\n const renderedItems: ReactNode[] = [];\n let isFirstSection = true;\n\n for (const item of listState.collection) {\n if (item.type === 'section') {\n if (!isFirstSection) {\n renderedItems.push(\n <StyledDivider\n key={`divider-${String(item.key)}`}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />,\n );\n }\n\n renderedItems.push(\n <ListBoxSection\n key={item.key}\n item={item}\n state={listState}\n optionStyles={optionStyles}\n optionHighlight={optionHighlight}\n headingStyles={headingStyles}\n sectionStyles={sectionStyles}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n size={size}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />,\n );\n\n isFirstSection = false;\n } else {\n renderedItems.push(\n <Option\n key={item.key}\n size={size}\n item={item}\n state={listState}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />,\n );\n }\n }\n\n return renderedItems;\n })()}\n </ListElement>\n )}\n </ListBoxScrollElement>\n {footer ? (\n <StyledFooter styles={footerStyles} data-size={size}>\n {footer}\n </StyledFooter>\n ) : (\n <div role=\"presentation\" />\n )}\n </ListBoxWrapperElement>\n );\n\n return wrapWithField<Omit<CubeListBoxProps<T>, 'children'>>(\n listBoxField,\n ref,\n { ...props, labelProps: mergeAriaProps(labelProps, props.labelProps) },\n );\n}) as unknown as (<T>(\n props: CubeListBoxProps<T> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReactElement) & {\n Item: typeof CollectionItem;\n Section: typeof BaseSection;\n};\n\nfunction Option({\n size = 'medium',\n item,\n state,\n styles,\n highlight,\n isParentDisabled,\n isInvalid,\n isValid,\n focusOnHover = false,\n isListFocused = false,\n isCheckable,\n onClick: onOptionClick,\n virtualStyle,\n virtualRef,\n virtualIndex,\n lastFocusSourceRef,\n dragState,\n dropState,\n}: {\n size?: 'small' | 'medium' | 'large';\n item: any;\n state: any;\n styles?: Styles;\n highlight?: string;\n isParentDisabled?: boolean;\n isInvalid?: boolean;\n isValid?: boolean;\n focusOnHover?: boolean;\n /** Whether the list has focus, so its focused option shows as focused */\n isListFocused?: boolean;\n isCheckable?: boolean;\n onClick?: (key: Key) => void;\n /** Inline style applied when virtualized (absolute positioning etc.) */\n virtualStyle?: CSSProperties;\n /** react-virtual's `measureElement`, called with the option after every commit */\n virtualRef?: (element: HTMLElement | null) => void;\n /** Virtual index from react-virtual for data-index attribute */\n virtualIndex?: number;\n /** Ref to track the source of focus changes */\n lastFocusSourceRef?: MutableRefObject<'keyboard' | 'mouse' | 'other'>;\n /** Drag state from DraggableCollection. When provided, enables drag-and-drop. */\n dragState?: DraggableCollectionState;\n /** Drop state from DraggableCollection. When provided, renders drop indicators. */\n dropState?: DroppableCollectionState;\n}) {\n const localRef = useRef<HTMLLIElement>(null);\n\n // Measure during the commit. After it, the browser can paint the option at\n // its estimated height first, overlapping the next one for a frame.\n useLayoutEffect(() => {\n virtualRef?.(localRef.current);\n });\n\n const isDisabled = isParentDisabled || state.disabledKeys.has(item.key);\n const isSelected = state.selectionManager.isSelected(item.key);\n\n // Drag-and-drop support — only enable when both states are provided\n const isDraggable = !!dragState && !!dropState;\n\n // useDraggableItem must be called unconditionally (Rules of Hooks).\n // When dragState is undefined, we pass a minimal mock state to satisfy the hook.\n const mockDragState = useMemo(\n () => createMockDragState(state.collection, state.selectionManager),\n [state.collection, state.selectionManager],\n );\n\n const dragResult = useDraggableItem(\n { key: item.key },\n dragState ?? mockDragState,\n );\n const effectiveDragProps = isDraggable ? dragResult.dragProps : {};\n const isDragging = isDraggable && !!dragState?.isDragging(item.key);\n\n const { hoverProps, isHovered } = useHover({ isDisabled });\n\n const { optionProps, isPressed, labelProps, descriptionProps } = useOption(\n {\n key: item.key,\n isDisabled,\n isSelected,\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: focusOnHover,\n },\n state,\n localRef,\n );\n\n const isFocused =\n !isDisabled &&\n isListFocused &&\n state.selectionManager.focusedKey === item.key;\n\n // Filter out service props - all remaining props can be passed to Item\n const filteredItemProps = filterSelectionItemProps(\n filterCollectionItemProps(item.props),\n );\n\n // Determine icon: drag handle > checkbox > user icon > default\n const effectiveIcon = useMemo(() => {\n if (isDraggable) {\n if (!filteredItemProps.icon || isHovered) {\n return <GripVerticalIcon size={14} />;\n }\n }\n\n if (\n !isCheckable ||\n state.selectionManager.selectionMode !== 'multiple' ||\n filteredItemProps.icon\n ) {\n return (\n filteredItemProps.icon ??\n (state.selectionManager.selectionMode !== 'multiple' ? null : undefined)\n );\n }\n\n return renderCheckboxIcon({\n isSelected,\n isDisabled,\n isFocused,\n isHovered,\n isInvalid,\n isValid,\n });\n }, [\n isDraggable,\n isCheckable,\n state.selectionManager.selectionMode,\n isSelected,\n isDisabled,\n isFocused,\n isHovered,\n isInvalid,\n isValid,\n filteredItemProps.icon,\n ]);\n\n // Side-effects layered on top of React Aria's own onClick. The underlying\n // React Aria onClick is already chained via mergeProps below, so this handler\n // must NOT call optionProps.onClick again — re-invoking it would trigger\n // usePress's virtual-click branch and double-fire onPress (and toggle\n // selection twice in multiple mode).\n const handleOptionExtras = (e: MouseEvent) => {\n if (lastFocusSourceRef) {\n lastFocusSourceRef.current = 'mouse';\n }\n\n state.selectionManager.setFocusedKey(item.key);\n\n if (!onOptionClick) {\n return;\n }\n\n // In checkable multiple mode, suppress the callback when the click landed\n // inside the checkbox wrapper — that area is reserved for toggle-only\n // behaviour (React Aria still handles the toggle via the chained onClick).\n if (isCheckable && state.selectionManager.selectionMode === 'multiple') {\n const clickTarget = e.target as HTMLElement;\n const checkboxElement = localRef.current?.querySelector(\n '[data-element=\"CheckboxWrapper\"]',\n );\n\n if (\n checkboxElement &&\n (checkboxElement === clickTarget ||\n checkboxElement.contains(clickTarget))\n ) {\n return;\n }\n }\n\n onOptionClick(item.key);\n };\n\n // Filter out React Aria props that shouldn't reach the DOM\n const {\n onKeyDown,\n onKeyUp,\n tabIndex,\n 'aria-selected': ariaSelected,\n 'aria-disabled': ariaDisabled,\n role,\n ...filteredOptionProps\n } = filterSelectionItemProps(optionProps);\n\n const theme = getValidationTheme(\n 'default' as const,\n { isInvalid, isValid },\n { includeValid: true },\n );\n\n const listBoxItem = (\n <ListBoxItem\n ref={localRef}\n data-key={String(item.key)}\n {...mergeProps(\n filteredOptionProps,\n hoverProps,\n filteredItemProps,\n {\n onClick: handleOptionExtras,\n onKeyDown,\n onKeyUp,\n tabIndex,\n 'aria-selected': ariaSelected,\n 'aria-disabled': ariaDisabled,\n role,\n },\n effectiveDragProps,\n )}\n theme={theme}\n style={virtualStyle}\n data-size={size}\n data-index={virtualIndex}\n size={size}\n display={isDraggable ? 'grid' : undefined}\n isSelected={isSelected}\n isDisabled={isDisabled}\n icon={effectiveIcon}\n highlight={highlight}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n styles={mergeStyles(styles, filteredItemProps.styles)}\n defaultTooltipPlacement=\"right\"\n mods={{\n listboxitem: true,\n focused: isFocused,\n pressed: isPressed,\n dragging: isDragging,\n draggable: isDraggable,\n gripIcon: isDraggable && (!filteredItemProps.icon || isHovered),\n valid: isSelected && !!isValid && !isInvalid,\n invalid: isSelected && !!isInvalid,\n checkable: isCheckable,\n hovered: isHovered,\n all: false, // This will be set to true for SelectAllOption\n }}\n >\n {item.rendered}\n </ListBoxItem>\n );\n\n if (!isDraggable || !dropState) {\n return listBoxItem;\n }\n\n return (\n <>\n <ListBoxDropIndicator\n target={{ type: 'item', key: item.key, dropPosition: 'before' }}\n dropState={dropState}\n />\n {listBoxItem}\n <ListBoxDropIndicator\n target={{ type: 'item', key: item.key, dropPosition: 'after' }}\n dropState={dropState}\n />\n </>\n );\n}\n\n// =============================================================================\n// Drop Indicator for DnD reordering\n// =============================================================================\n\nfunction ListBoxDropIndicator({\n target,\n dropState,\n}: {\n target: DropTarget;\n dropState: DroppableCollectionState;\n}) {\n const ref = useRef<HTMLLIElement>(null);\n const { dropIndicatorProps, isHidden, isDropTarget } = useDropIndicator(\n { target },\n dropState,\n ref,\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorElement\n ref={ref}\n role=\"option\"\n {...dropIndicatorProps}\n mods={{ 'drop-indicator': true, 'drop-target': isDropTarget }}\n >\n <div data-element=\"Indicator\" />\n </ListBoxDropIndicatorElement>\n );\n}\n\ninterface ListBoxSectionProps<T> {\n item: any;\n state: any;\n optionStyles?: Styles;\n optionHighlight?: string;\n headingStyles?: Styles;\n sectionStyles?: Styles;\n isParentDisabled?: boolean;\n isInvalid?: boolean;\n isValid?: boolean;\n focusOnHover?: boolean;\n isListFocused?: boolean;\n isCheckable?: boolean;\n onClick?: (key: Key) => void;\n size?: 'small' | 'medium' | 'large';\n lastFocusSourceRef?: MutableRefObject<'keyboard' | 'mouse' | 'other'>;\n}\n\nfunction ListBoxSection<T>(props: ListBoxSectionProps<T>) {\n const {\n item,\n state,\n optionStyles,\n optionHighlight,\n headingStyles,\n sectionStyles,\n isParentDisabled,\n isInvalid,\n isValid,\n focusOnHover,\n isListFocused,\n isCheckable,\n onClick: onOptionClick,\n lastFocusSourceRef,\n } = props;\n const heading = item.rendered;\n\n const { itemProps, headingProps, groupProps } = useListBoxSection({\n heading,\n 'aria-label': item['aria-label'],\n });\n\n return (\n <SectionWrapperElement {...itemProps} styles={sectionStyles}>\n {heading && (\n <StyledSectionHeading\n {...headingProps}\n size={props.size}\n styles={headingStyles}\n >\n {heading}\n </StyledSectionHeading>\n )}\n <SectionListElement {...groupProps}>\n {[...item.childNodes]\n .filter((node: any) => state.collection.getItem(node.key))\n .map((node: any) => (\n <Option\n key={node.key}\n size={props.size}\n item={node}\n state={state}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isParentDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />\n ))}\n </SectionListElement>\n </SectionWrapperElement>\n );\n}\n\ntype SectionComponent = typeof BaseSection;\n\nconst ListBoxSectionComponent = Object.assign(BaseSection, {\n displayName: 'Section',\n}) as SectionComponent;\n\nListBox.Item = CollectionItem;\n\nListBox.Section = ListBoxSectionComponent;\n\nObject.defineProperty(ListBox, 'cubeInputType', {\n value: 'ListBox',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,MAA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AA+Q;AAAA,KAAA/Q,EAAA,QAAAuQ,aAAAvQ,EAAA,QAAA8B,iBAAA9B,EAAA,QAAA+P,MAAA/P,EAAA,QAAA8Q,IAAA;AA/BvBC,OAAA,qBAAC;GAAqB,GAAKR;GAAmBzO,QAAAA;cAC3CiO,IASDe;IAsBsB;AAAA9Q,IAAA,MAAAuQ;AAAAvQ,IAAA,MAAA8B;AAAA9B,IAAA,MAAA+P;AAAA/P,IAAA,MAAA8Q;AAAA9Q,IAAA,MAAA+Q;OAAAA,MAAA/Q,EAAA;AAAA,QAhCxB+Q;;AAsCJ,MAAME,0BAA0BC,OAAOC,OAAO9V,SAAa,EACzD+V,aAAa,WACd,CAAC;AAEF5K,QAAQ1J,OAAOL;AAEf+J,QAAQpL,UAAU6V;AAElBC,OAAOG,eAAe7K,SAAS,iBAAiB;CAC9CH,OAAO;CACPiL,YAAY;CACZC,cAAc;CACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"ListBox.js","names":["useHover","IconMinus","useVirtualizer","BASE_STYLES","BasePropsWithoutChildren","BaseStyleProps","COLOR_STYLES","ColorStyleProps","mergeStyles","OUTER_STYLES","OuterStyleProps","Styles","tasty","CSSProperties","DOMAttributes","ForwardedRef","forwardRef","MutableRefObject","ReactElement","KeyboardEvent","ReactKeyboardEvent","MouseEvent","ReactMouseEvent","ReactNode","RefObject","useEffect","useLayoutEffect","useMemo","useRef","AriaListBoxProps","DropTarget","mergeProps","mergeAriaProps","useDraggableItem","useDropIndicator","useFocusRing","useKeyboard","useListBox","useListBoxSection","useOption","Section","BaseSection","DraggableCollectionState","DroppableCollectionState","ListProps","useListState","useWarn","useI18n","CheckIcon","GripVerticalIcon","Icon","SIZE_NAME_TO_KEY","SIZES","useCombinedRefs","useFocus","allowOverlayKeysToPropagate","extractStyles","StyledDivider","StyledFooter","StyledHeader","StyledSectionHeading","CollectionItem","CubeCollectionItemProps","filterCollectionItemProps","filterSelectionItemProps","getValueSelectionState","Item","getValidationMods","getValidationTheme","useFieldProps","wrapWithField","createMockDragState","useOptionOriginPress","DraggableListBox","SelectionManager","Collection","CollectionBase","Node","CollectionNode","Key","FieldBaseProps","ListBoxWrapperElement","qa","styles","display","gridColumns","gridRows","flow","gap","position","radius","color","transition","outline","focused","border","valid","invalid","disabled","ListElement","as","padding","empty","listStyle","boxSizing","margin","height","ListBoxScrollElement","overflow","scrollbar","ListBoxItem","disableActionsFocus","all","outlineOffset","cursor","draggable","opacity","gripIcon","ListBoxDropIndicatorElement","zIndex","pointerEvents","Indicator","$","left","right","top","fill","SectionWrapperElement","SectionListElement","ListBoxCheckbox","placeItems","width","flexShrink","ListBoxCheckboxWrapper","placeContent","placeSelf","renderCheckboxIcon","isSelected","isDisabled","isFocused","isHovered","isInvalid","isValid","mods","selected","hovered","CubeListBoxProps","Omit","T","listStyles","optionStyles","optionHighlight","sectionStyles","headingStyles","listGap","selectedKey","selectedKeys","defaultSelectedKey","defaultSelectedKeys","onSelectionChange","key","selectionMode","listRef","HTMLUListElement","disallowEmptySelection","allowDuplicateSelectionEvents","shouldFocusWrap","stateRef","focusOnHover","header","footer","headerStyles","footerStyles","Record","size","disableSelectionToggle","shouldUseVirtualFocus","isFocusWithin","onEscape","isCheckable","onOptionClick","showSelectAll","selectAllLabel","allValueProps","Partial","filter","nodes","Iterable","emptyLabel","shape","isReorderable","onReorder","newOrder","PROP_STYLES","NO_OPTIONS","children","SelectAllOption","t0","_c","label","isIndeterminate","t1","onClick","focusProps","t2","undefined","t","t3","hoverProps","focusRingProps","isFocusVisible","t4","resolvedLabel","t5","markIcon","t6","indeterminate","checkboxMods","t7","checkboxIcon","t8","e","checkbox","currentTarget","querySelector","contains","target","handleClick","t9","e_0","preventDefault","stopPropagation","handleKeyDown","T0","t10","t11","t12","t13","listboxitem","checkable","t14","tabIndex","onKeyDown","t15","t16","Symbol","for","t17","getSelectableKeys","collection","disabledKeys","Set","keys","getKeys","node","getItem","type","has","props","push","getSelectAllSelection","isAllSelected","selection","shownKeys","hiddenKeys","length","next","delete","isEverySelectableSelected","selectionManager","rawSelection","hasSelectable","canSelectItem","toStatelySelection","value","isMultiple","ListBox","ref","HTMLDivElement","valuePropsMapper","onChange","fieldProps","Array","isArray","extra","id","labelStyles","isRequired","necessityIndicator","message","description","externalMods","labelSuffix","form","otherProps","lastSelectedKeyRef","externalSelectionHandler","wrappedOnSelectionChange","prevKey","current","from","listStateProps","disabledBehavior","defaultSelection","listState","hasSelectAll","fullCollection","items","first","isSomeSelected","isEmpty","handleSelectAllClick","propagate","selectAll","clearSelection","setSelectedKeys","lastFocusSourceRef","args","keyboardProps","itemsArray","hasSections","some","i","shouldVirtualize","listBoxProps","labelProps","isVirtualized","escapeKeyBehavior","isListElementFocused","listElementFocusProps","isSelectAllFocused","selectAllFocusProps","isListFocused","scrollRef","rowVirtualizer","count","getScrollElement","getItemKey","index","estimateSize","currentItem","XL","overscan","measure","lastFocusedKeyRef","focusedKey","hasFocusMoved","scrollElement","itemElement","CSS","escape","String","HTMLElement","findIndex","item","scrollToIndex","align","scrollTop","viewportHeight","clientHeight","viewportBottom","itemRect","getBoundingClientRect","scrollRect","itemTop","itemBottom","isAlreadyVisible","scrollIntoView","block","behavior","mergedListBoxProps","emptyLabelId","Boolean","join","orderedKeys","map","isCardFocused","listGapTokens","listBoxField","dragState","dropState","collectionProps","sections","getTotalSize","getVirtualItems","virtualItem","measureElement","transform","start","renderedItems","isFirstSection","Option","state","highlight","isParentDisabled","virtualStyle","virtualRef","virtualIndex","element","localRef","HTMLLIElement","isDraggable","mockDragState","dragResult","effectiveDragProps","dragProps","isDragging","optionProps","isPressed","descriptionProps","shouldSelectOnPressUp","shouldFocusOnHover","filteredItemProps","effectiveIcon","icon","runOptionExtras","EventTarget","setFocusedKey","clickTarget","checkboxElement","handleOptionExtras","originPress","manager","onSettle","onKeyUp","onPointerUp","ariaSelected","ariaDisabled","role","filteredOptionProps","theme","const","includeValid","listBoxItem","onPointerDown","wrapPointerUp","pressed","dragging","rendered","dropPosition","ListBoxDropIndicator","dropIndicatorProps","isHidden","isDropTarget","ListBoxSectionProps","ListBoxSection","heading","itemProps","headingProps","groupProps","childNodes","node_0","SectionComponent","ListBoxSectionComponent","Object","assign","displayName","defineProperty","enumerable","configurable"],"sources":["../../../../src/components/fields/ListBox/ListBox.tsx"],"sourcesContent":["import { useHover } from '@react-aria/interactions';\nimport { IconMinus } from '@tabler/icons-react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport {\n BASE_STYLES,\n BasePropsWithoutChildren,\n BaseStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n mergeStyles,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n CSSProperties,\n DOMAttributes,\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n KeyboardEvent as ReactKeyboardEvent,\n MouseEvent as ReactMouseEvent,\n ReactNode,\n RefObject,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {\n AriaListBoxProps,\n DropTarget,\n mergeProps as mergeAriaProps,\n useDraggableItem,\n useDropIndicator,\n useFocusRing,\n useKeyboard,\n useListBox,\n useListBoxSection,\n useOption,\n} from 'react-aria';\nimport {\n Section as BaseSection,\n DraggableCollectionState,\n DroppableCollectionState,\n ListProps,\n useListState,\n} from 'react-stately';\n\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CheckIcon } from '../../../icons/CheckIcon';\nimport { GripVerticalIcon } from '../../../icons/GripVerticalIcon';\nimport { Icon } from '../../../icons/Icon';\nimport { SIZE_NAME_TO_KEY, SIZES } from '../../../tokens';\nimport { mergeProps, useCombinedRefs } from '../../../utils/react';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { extractStyles } from '../../../utils/styles';\n// Import Menu styled components for header and footer\nimport {\n StyledDivider,\n StyledFooter,\n StyledHeader,\n StyledSectionHeading,\n} from '../../actions/Menu/styled';\nimport {\n CollectionItem,\n CubeCollectionItemProps,\n filterCollectionItemProps,\n filterSelectionItemProps,\n getValueSelectionState,\n} from '../../CollectionItem';\nimport { Item } from '../../content/Item/Item';\nimport {\n getValidationMods,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport { createMockDragState } from '../../shared/DraggableCollection';\nimport { useOptionOriginPress } from '../option-origin-press';\n\nimport { DraggableListBox } from './DraggableListBox';\n\nimport type { SelectionManager } from '@react-stately/selection';\nimport type {\n Collection,\n CollectionBase,\n Node as CollectionNode,\n Key,\n} from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\nconst ListBoxWrapperElement = tasty({\n qa: 'ListBox',\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: 'max-content max-content max-content 1sf max-content',\n flow: 'column',\n gap: 0,\n position: 'relative',\n radius: {\n '': '1cr',\n '[data-shape=\"popover\"]': '(1cr - 1bw)',\n '[data-shape=\"plain\"]': '0',\n },\n color: '#dark-02',\n transition: 'theme',\n outline: {\n '': '#purple-03.0',\n 'invalid & focused': '#danger.50',\n focused: '#purple-03',\n },\n border: {\n '': true,\n focused: '#primary-text',\n valid: '#success-text.50',\n invalid: '#danger-text.50',\n disabled: true,\n '[data-shape=\"plain\"] | [data-shape=\"popover\"] | searchable': false,\n },\n },\n});\n\nconst ListElement = tasty({\n as: 'ul',\n styles: {\n // The space between options. Set from `listGap`, which also hands the\n // same number to the virtualizer.\n '$list-gap': '1bw',\n display: 'block',\n // The space kept below the last option. Padding, so `listStyles` can take\n // it away, and outside the content box, where a virtualized list sets its\n // own height.\n padding: {\n '': '.5x bottom',\n // Empty, the list sits under its empty label and takes no space.\n empty: 0,\n },\n listStyle: 'none',\n boxSizing: 'content-box',\n margin: {\n '': '.5x .5x 0 .5x',\n '[data-shape=\"plain\"] | empty': '0',\n },\n height: 'max-content',\n },\n});\n\n// NEW: dedicated scroll container for ListBox\nconst ListBoxScrollElement = tasty({\n as: 'div',\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: '1sf',\n overflow: 'auto',\n scrollbar: 'styled',\n },\n});\n\n// Create an extended Item for ListBox options with 'all' modifier support\nconst ListBoxItem = tasty(Item, {\n as: 'li',\n disableActionsFocus: true,\n styles: {\n display: 'grid',\n margin: {\n '': '$list-gap bottom',\n // Mid-drag the last option is followed by a drop indicator, which takes\n // the gap back (`ListBoxDropIndicatorElement`). Not `:has(~ …)`: see\n // AGENTS.md → Styling.\n ':last-child': '0',\n all: '.5x',\n },\n // Inside the option: options sit a hairline apart, so a ring outside one\n // would cover its neighbour, and the scroll box would clip it at the edges.\n outlineOffset: '-1bw',\n Icon: {\n cursor: {\n draggable: 'grab',\n },\n opacity: {\n gripIcon: '.4',\n 'gripIcon & hovered': '1',\n },\n transition: {\n draggable: 'opacity',\n },\n },\n },\n});\n\n// Horizontal drop indicator for DnD reordering\nconst ListBoxDropIndicatorElement = tasty({\n as: 'li',\n styles: {\n zIndex: 10,\n position: 'relative',\n pointerEvents: 'none',\n height: 0,\n // After the last option: cancels the `$list-gap` that option keeps while\n // it is not the last child, so the list holds its height mid-drag. An\n // `optionStyles` margin replaces that gap, and this then overshoots.\n margin: {\n '': 0,\n ':last-child': '(-1 * $list-gap) top',\n },\n opacity: {\n '': 0,\n 'drop-target': 1,\n },\n\n Indicator: {\n $: '>',\n position: 'absolute',\n left: '.5x',\n right: '.5x',\n // Centred in the gap between two options, or on the edge of the list.\n top: {\n '': '(-1px - $list-gap / 2)',\n ':first-child | :last-child': '-1px',\n },\n height: '2px',\n fill: '#primary',\n radius: 'round',\n },\n },\n});\n\nconst SectionWrapperElement = tasty({\n as: 'li',\n styles: {\n display: 'block',\n },\n});\n\nconst SectionListElement = tasty({\n qa: 'ListBoxSectionList',\n as: 'ul',\n styles: {\n display: 'flex',\n gap: '0',\n flow: 'column',\n margin: '0',\n padding: '0',\n listStyle: 'none',\n },\n});\n\n// Checkbox component for multiple selection options\nconst ListBoxCheckbox = tasty({\n as: 'div',\n styles: {\n display: 'grid',\n placeItems: 'center',\n radius: '.5r',\n width: '(2x - 2bw)',\n height: '(2x - 2bw)',\n flexShrink: 0,\n transition: 'theme',\n opacity: {\n '': 0,\n 'selected | indeterminate | hovered | focused': 1,\n },\n fill: {\n '': '#surface',\n 'selected | indeterminate': '#primary',\n 'invalid & !(selected | indeterminate)': '#surface',\n 'invalid & (selected | indeterminate)': '#danger',\n disabled: '#dark.12',\n },\n color: {\n '': '#clear',\n 'selected | indeterminate': '#white',\n },\n border: {\n '': '#dark.30',\n invalid: '#danger',\n 'disabled | ((selected | indeterminate) & !invalid)': '#clear',\n },\n },\n});\n\nconst ListBoxCheckboxWrapper = tasty({\n as: 'div',\n styles: {\n display: 'grid',\n placeItems: 'center',\n placeContent: 'center',\n cursor: '$pointer',\n placeSelf: 'stretch',\n },\n});\n\nfunction renderCheckboxIcon({\n isSelected,\n isDisabled,\n isFocused,\n isHovered,\n isInvalid,\n isValid,\n}: {\n isSelected: boolean;\n isDisabled: boolean;\n isFocused: boolean;\n isHovered: boolean;\n isInvalid?: boolean;\n isValid?: boolean;\n}) {\n const mods = {\n selected: isSelected,\n disabled: isDisabled,\n focused: isFocused,\n hovered: isHovered,\n ...getValidationMods({ isInvalid, isValid }),\n };\n\n return (\n <ListBoxCheckboxWrapper data-element=\"CheckboxWrapper\" mods={mods}>\n <ListBoxCheckbox data-element=\"Checkbox\" mods={mods}>\n <CheckIcon size={12} stroke={3} />\n </ListBoxCheckbox>\n </ListBoxCheckboxWrapper>\n );\n}\n\nexport interface CubeListBoxProps<T>\n extends Omit<\n AriaListBoxProps<T>,\n 'autoFocus' | 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange'\n >,\n CollectionBase<T>,\n FieldBaseProps<Key | readonly Key[] | null | undefined>,\n BasePropsWithoutChildren,\n // The style props `PROP_STYLES` extracts at runtime and the docs list;\n // without these a `height` or `width` worked but failed to type-check.\n BaseStyleProps,\n OuterStyleProps,\n ColorStyleProps {\n /** Custom styles for the list container */\n listStyles?: Styles;\n /** Custom styles for individual options */\n optionStyles?: Styles;\n /**\n * Substring to highlight within each option's (text) children. Typically the\n * current search query. Matching is case-insensitive.\n */\n optionHighlight?: string;\n /** Custom styles for section containers */\n sectionStyles?: Styles;\n /** Custom styles for section headings */\n headingStyles?: Styles;\n /**\n * Space between options, in pixels. Defaults to a hairline (`1bw`). It\n * applies to flat, virtualized, sectioned and reorderable lists alike.\n */\n listGap?: number;\n /** Whether the ListBox is disabled */\n isDisabled?: boolean;\n /** The selected key in controlled single selection mode */\n selectedKey?: Key | null;\n /** The selected keys in controlled multiple selection mode. Use \"all\" to select all items or an array of keys */\n selectedKeys?: 'all' | Key[];\n /** The default selected key in uncontrolled single selection mode */\n defaultSelectedKey?: Key | null;\n /** The default selected keys in uncontrolled multiple selection mode. Use \"all\" to select all items or an array of keys */\n defaultSelectedKeys?: 'all' | Key[];\n /** Callback fired when selection changes */\n onSelectionChange?: (key: Key | null | 'all' | Key[]) => void;\n /** The selection mode of the ListBox */\n selectionMode?: 'single' | 'multiple';\n /** Ref for accessing the list DOM element */\n listRef?: RefObject<HTMLUListElement | null>;\n /** Whether to disallow empty selection */\n disallowEmptySelection?: boolean;\n /**\n * Whether `onSelectionChange` should fire even when the new selection equals the\n * current one (e.g. re-selecting the already-selected item with `disallowEmptySelection`).\n * React Stately suppresses such duplicate events by default. Popover-based wrappers\n * (Picker, FilterPicker) rely on the duplicate event to close the popover on re-select.\n */\n allowDuplicateSelectionEvents?: boolean;\n /** Whether to wrap focus when reaching the end of the list */\n shouldFocusWrap?: boolean;\n /**\n * Ref to access the internal ListState instance.\n * This allows parent components to access selection state and other list functionality.\n */\n stateRef?: RefObject<any | null>;\n\n /**\n * Whether moving the pointer over an option will move DOM focus to that option.\n * Set to false for components that keep DOM focus outside (e.g. searchable FilterListBox).\n * Defaults to true.\n */\n focusOnHover?: boolean;\n /** Custom header content displayed above the list */\n header?: ReactNode;\n /** Custom footer content displayed below the list */\n footer?: ReactNode;\n /** Custom styles for the header */\n headerStyles?: Styles;\n /** Custom styles for the footer */\n footerStyles?: Styles;\n /** Additional modifiers for styling the ListBox */\n mods?: Record<string, boolean>;\n /** Size variant of the ListBox */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * When `true`, clicking an already-selected item keeps it selected instead of toggling it off,\n * and `onSelectionChange` reports that item again. Applies in single selection mode, whether\n * `selectionMode` is set or left to its default. Useful when embedding ListBox inside\n * components like ComboBox.\n */\n disableSelectionToggle?: boolean;\n\n /**\n * Whether to use virtual focus for keyboard navigation.\n * When true, DOM focus stays outside individual option elements (useful for searchable lists).\n * Defaults to false for backward compatibility.\n */\n shouldUseVirtualFocus?: boolean;\n\n /**\n * For a list whose focused option is moved from an input outside it, as\n * FilterListBox's search input does: whether focus is within that input's\n * component. The focused option is marked only while it is `true`. Unset, the\n * list's own focus decides, and with `shouldUseVirtualFocus` the focused\n * option is always marked.\n */\n isFocusWithin?: boolean;\n\n /**\n * Callback fired when the user presses Escape key.\n * When provided, this prevents React Aria's default Escape behavior (selection reset).\n */\n onEscape?: () => void;\n\n /**\n * Whether to show checkboxes for multiple selection mode.\n * This adds a checkbox icon to the left of each option.\n */\n isCheckable?: boolean;\n\n /**\n * Callback fired when an option is clicked but not on the checkbox area.\n * Used by FilterPicker to close the popover on non-checkbox clicks.\n */\n onOptionClick?: (key: Key) => void;\n\n /**\n * Whether to show the \"Select All\" checkbox in multiple selection mode.\n * It sits above the list as its own Tab stop and shows checked once every\n * selectable item the list shows is selected. A press selects every item\n * (`'all'`), or once checked takes the items shown out of the selection.\n * Under a `filter` it acts only on the items shown, and selected items the\n * filter hides stay selected.\n */\n showSelectAll?: boolean;\n\n /**\n * Label for the \"Select All\" option. Defaults to \"Select All\".\n */\n selectAllLabel?: ReactNode;\n\n /**\n * Props to apply to the \"Select All\" option.\n */\n allValueProps?: Partial<CubeCollectionItemProps<T>>;\n\n /**\n * Filter function to apply to the collection nodes.\n * Takes an iterable of nodes and returns a filtered iterable.\n * Useful for implementing search/filter functionality.\n */\n filter?: (nodes: Iterable<any>) => Iterable<any>;\n\n /**\n * Label to display when the list is empty (no items available).\n * Defaults to \"No items\".\n */\n emptyLabel?: ReactNode;\n\n /**\n * Visual shape of the ListBox styling.\n * - `card` (default): Standard card styling with border and margin\n * - `plain`: No border, no margin, no radius - suitable for embedded use\n * - `popover`: No border, but keeps margin and radius - suitable for overlay use\n * Defaults to 'card'.\n */\n shape?: 'card' | 'plain' | 'popover';\n\n /**\n * Enable drag-and-drop reordering of list items.\n * When enabled, virtualization is disabled and each item gets a drag handle.\n * @default false\n */\n isReorderable?: boolean;\n\n /**\n * Callback when items are reordered via drag-and-drop.\n * Called with the new array of item keys in their new order.\n */\n onReorder?: (newOrder: string[]) => void;\n}\n\nconst PROP_STYLES = [...BASE_STYLES, ...OUTER_STYLES, ...COLOR_STYLES];\n\n/** A collection with no options, for a list state that isn't needed. */\nconst NO_OPTIONS: ListProps<any> = { children: [], selectionMode: 'none' };\n\n/**\n * The \"Select All\" row: a tri-state checkbox above the list rather than an\n * option in it, since it acts on the options instead of being one. Being\n * outside the listbox keeps the listbox's children to options and groups, and\n * makes it a Tab stop of its own, which a list in virtual focus (searchable\n * lists) could not offer as an option.\n */\nconst SelectAllOption = ({\n label,\n isSelected,\n isIndeterminate,\n isDisabled,\n isCheckable,\n size = 'medium',\n onClick,\n focusProps,\n allValueProps = {},\n}: {\n label?: ReactNode;\n isSelected: boolean;\n isIndeterminate: boolean;\n isDisabled?: boolean;\n isCheckable?: boolean;\n size?: 'small' | 'medium' | 'large';\n /** `propagate` is false for a press on the checkbox mark, which only toggles */\n onClick: (propagate: boolean) => void;\n /** Tells the list when the row has focus */\n focusProps: DOMAttributes<HTMLElement>;\n allValueProps?: Partial<CubeCollectionItemProps<any>>;\n}) => {\n const { t } = useI18n();\n const { hoverProps, isHovered } = useHover({ isDisabled });\n const { focusProps: focusRingProps, isFocusVisible } = useFocusRing();\n const resolvedLabel =\n label === '' || label === undefined || label === null\n ? t('listBox.selectAll', 'Select All')\n : label;\n\n const markIcon = isIndeterminate ? (\n <Icon size={12} stroke={3} aria-hidden=\"true\">\n <IconMinus />\n </Icon>\n ) : (\n <CheckIcon size={12} stroke={3} />\n );\n\n const checkboxMods = {\n selected: isSelected,\n disabled: isDisabled,\n hovered: isHovered,\n indeterminate: isIndeterminate,\n };\n\n const checkboxIcon = isCheckable ? (\n <ListBoxCheckboxWrapper data-element=\"CheckboxWrapper\" mods={checkboxMods}>\n <ListBoxCheckbox data-element=\"Checkbox\" mods={checkboxMods}>\n {(isIndeterminate || isSelected) && markIcon}\n </ListBoxCheckbox>\n </ListBoxCheckboxWrapper>\n ) : null;\n\n const handleClick = (e: ReactMouseEvent<HTMLElement>) => {\n // A click on the checkbox mark only toggles; one on the label also tells\n // the list's owner, which closes a picker on it.\n const checkbox = e.currentTarget.querySelector(\n '[data-element=\"CheckboxWrapper\"]',\n );\n\n onClick(!checkbox?.contains(e.target as Node));\n };\n\n const handleKeyDown = (e: ReactKeyboardEvent<HTMLElement>) => {\n if (e.key !== ' ') return;\n\n // Space toggles a checkbox, and must neither scroll nor reach a shortcut.\n e.preventDefault();\n e.stopPropagation();\n onClick(false);\n };\n\n return (\n <>\n <ListBoxItem\n as=\"div\"\n role=\"checkbox\"\n aria-checked={isIndeterminate ? 'mixed' : isSelected}\n data-size={size}\n size={size}\n isDisabled={isDisabled}\n icon={checkboxIcon}\n mods={{\n listboxitem: true,\n // As a mod rather than `isSelected`, which would add an\n // `aria-selected` a checkbox does not take.\n selected: isSelected,\n disabled: isDisabled,\n checkable: isCheckable,\n hovered: isHovered,\n focused: isFocusVisible,\n indeterminate: isIndeterminate,\n all: true, // Important: this preserves the 'all' modifier\n }}\n {...mergeProps(hoverProps, focusRingProps, focusProps, allValueProps, {\n tabIndex: isDisabled ? undefined : 0,\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n })}\n >\n {resolvedLabel}\n </ListBoxItem>\n <StyledDivider as=\"div\" role=\"presentation\" />\n </>\n );\n};\n\n/** The keys of the options a user can select in a collection: not disabled. */\nfunction getSelectableKeys(\n collection: Collection<CollectionNode<unknown>>,\n disabledKeys: Set<Key>,\n): Key[] {\n const keys: Key[] = [];\n\n for (const key of collection.getKeys()) {\n const node = collection.getItem(key);\n\n if (\n node?.type === 'item' &&\n !disabledKeys.has(key) &&\n !node.props?.isDisabled\n ) {\n keys.push(key);\n }\n }\n\n return keys;\n}\n\n/**\n * The selection a \"Select All\" press leaves. While it isn't checked, the press\n * selects all (`'all'`), or under a filter adds the options shown. Once it is,\n * the press takes the options shown out of the selection: selected options\n * the list doesn't show, hidden by a filter or not among its options, stay.\n * `hiddenKeys` are the selectable options a filter hides.\n */\nfunction getSelectAllSelection(\n isAllSelected: boolean,\n selection: 'all' | Set<Key>,\n shownKeys: Key[],\n hiddenKeys: Key[],\n): 'all' | Set<Key> {\n if (!isAllSelected) {\n return selection === 'all' || hiddenKeys.length === 0\n ? 'all'\n : new Set([...selection, ...shownKeys]);\n }\n\n if (selection === 'all') return new Set(hiddenKeys);\n\n const next = new Set(selection);\n\n for (const key of shownKeys) next.delete(key);\n\n return next;\n}\n\n/**\n * Whether every option a user can select is selected, which checks \"Select\n * All\". Disabled options don't count, and a list with nothing to select is\n * never all selected.\n */\nfunction isEverySelectableSelected(\n collection: Collection<CollectionNode<unknown>>,\n selectionManager: SelectionManager,\n): boolean {\n if (selectionManager.rawSelection === 'all') return true;\n\n let hasSelectable = false;\n\n for (const key of collection.getKeys()) {\n if (\n collection.getItem(key)?.type !== 'item' ||\n !selectionManager.canSelectItem(key)\n ) {\n continue;\n }\n\n if (!selectionManager.isSelected(key)) return false;\n\n hasSelectable = true;\n }\n\n return hasSelectable;\n}\n\n/**\n * A public selection prop as the Set-based value React Stately expects: a key\n * array (or `'all'`, passed through) in multiple mode, a single key (or\n * `null` for none) in single mode.\n */\nfunction toStatelySelection(\n value: 'all' | Key[] | Key | null,\n isMultiple: boolean,\n): 'all' | Set<Key> {\n if (isMultiple) {\n return value === 'all' ? 'all' : new Set(value as Key[]);\n }\n\n return value == null ? new Set() : new Set([value as Key]);\n}\n\nexport const ListBox = forwardRef(function ListBox<T extends object>(\n props: CubeListBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: any = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: any) => {\n if (props.selectionMode === 'multiple') {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n const { t } = useI18n();\n\n let {\n qa,\n label,\n extra,\n id,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n listStyles,\n optionStyles,\n optionHighlight,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n message,\n description,\n styles,\n mods: externalMods,\n size = 'medium',\n labelSuffix,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n shouldUseVirtualFocus,\n isFocusWithin,\n onSelectionChange,\n disableSelectionToggle = false,\n allowDuplicateSelectionEvents,\n stateRef,\n focusOnHover,\n header,\n footer,\n headerStyles,\n footerStyles,\n onEscape,\n isCheckable,\n onOptionClick,\n showSelectAll,\n selectAllLabel,\n allValueProps,\n filter,\n emptyLabel = t('listBox.noItems', 'No items'),\n shape = 'card',\n isReorderable = false,\n onReorder,\n form,\n ...otherProps\n } = props;\n\n const lastSelectedKeyRef = useRef<Key | null>(null);\n\n // Wrap onSelectionChange to prevent selection when disabled and handle React Aria's Set format\n const externalSelectionHandler = onSelectionChange || (props as any).onChange;\n\n const wrappedOnSelectionChange = useMemo(() => {\n if (!externalSelectionHandler) return undefined;\n\n return (keys: any) => {\n // Don't allow selection changes when disabled\n if (isDisabled) {\n return;\n }\n\n // React Aria always passes a Set for selection changes\n // Handle the special \"all\" case and convert to our public API format\n if (keys === 'all') {\n externalSelectionHandler('all');\n } else if (keys instanceof Set) {\n if (keys.size === 0) {\n // Picking the selected option again keeps it, in single mode\n // whether set or by default. The controlled key is the one picked.\n if (disableSelectionToggle && props.selectionMode !== 'multiple') {\n const prevKey = selectedKey ?? lastSelectedKeyRef.current;\n if (prevKey != null) {\n externalSelectionHandler(prevKey);\n return;\n }\n }\n externalSelectionHandler(\n props.selectionMode === 'multiple' ? [] : null,\n );\n } else if (props.selectionMode === 'multiple') {\n externalSelectionHandler(Array.from(keys));\n } else {\n const key = Array.from(keys)[0];\n lastSelectedKeyRef.current = key ?? null;\n externalSelectionHandler(key);\n }\n } else {\n lastSelectedKeyRef.current = keys as Key | null;\n externalSelectionHandler(keys);\n }\n };\n }, [\n externalSelectionHandler,\n isDisabled,\n props.selectionMode,\n disableSelectionToggle,\n selectedKey,\n ]);\n\n // Prepare props for useListState with correct selection props\n const listStateProps: ListProps<T> = {\n ...props,\n onSelectionChange: wrappedOnSelectionChange,\n disabledBehavior: 'all',\n filter,\n selectionMode: props.selectionMode || 'single',\n allowDuplicateSelectionEvents,\n };\n\n // Set selection props based on mode: the array props in multiple mode, the\n // scalar key props in single mode.\n const isMultiple = listStateProps.selectionMode === 'multiple';\n const selection = isMultiple ? selectedKeys : selectedKey;\n const defaultSelection = isMultiple\n ? defaultSelectedKeys\n : defaultSelectedKey;\n\n if (selection !== undefined) {\n listStateProps.selectedKeys = toStatelySelection(selection, isMultiple);\n }\n\n if (defaultSelection !== undefined) {\n listStateProps.defaultSelectedKeys = toStatelySelection(\n defaultSelection,\n isMultiple,\n );\n }\n\n const listState = getValueSelectionState(useListState(listStateProps));\n\n const hasSelectAll = !!showSelectAll && props.selectionMode === 'multiple';\n\n // Under a filter, \"Select All\" acts on the options it shows and keeps the\n // selected ones the filter hides, so it needs the whole list. Built only\n // then; otherwise it is empty.\n const { collection: fullCollection } = useListState<T>(\n hasSelectAll && filter\n ? { children: props.children, items: props.items, selectionMode: 'none' }\n : NO_OPTIONS,\n );\n\n useLayoutEffect(() => {\n const selected = listState.selectionManager.selectedKeys;\n if (selected && (selected as any).size > 0) {\n const first = Array.from(selected as Set<Key>)[0];\n lastSelectedKeyRef.current = first ?? null;\n }\n }, [listState.selectionManager.selectedKeys]);\n\n // Checked once every selectable option is selected, however it got there;\n // mixed while only some are.\n const isAllSelected =\n hasSelectAll &&\n isEverySelectableSelected(listState.collection, listState.selectionManager);\n const isSomeSelected =\n hasSelectAll && !isAllSelected && !listState.selectionManager.isEmpty;\n\n // React Stately reports the change, so it is reported once. It reports none\n // when nothing changes, as when `disallowEmptySelection` keeps the selection.\n const handleSelectAllClick = (propagate: boolean) => {\n if (isDisabled || !hasSelectAll) return;\n\n const { collection, disabledKeys, selectionManager } = listState;\n const next = getSelectAllSelection(\n isAllSelected,\n selectionManager.rawSelection,\n getSelectableKeys(collection, disabledKeys),\n getSelectableKeys(fullCollection, disabledKeys).filter(\n (key) => !collection.getItem(key),\n ),\n );\n\n if (next === 'all') {\n selectionManager.selectAll();\n } else if (next.size === 0) {\n selectionManager.clearSelection();\n } else {\n selectionManager.setSelectedKeys(next);\n }\n\n if (propagate && !isAllSelected) {\n onOptionClick?.('__ALL__');\n }\n };\n\n // Track whether the last focus change was due to keyboard navigation\n const lastFocusSourceRef = useRef<'keyboard' | 'mouse' | 'other'>('other');\n\n // Expose the list state instance via the provided ref (if any)\n if (stateRef) {\n stateRef.current = {\n ...listState,\n lastFocusSourceRef,\n };\n }\n\n // Warn if isCheckable is false in single selection mode\n useWarn(isCheckable === false && props.selectionMode === 'single', {\n key: ['listbox-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n // Custom keyboard handling: `Escape` and `Tab` have to leave the list so a\n // surrounding overlay can close on the one and keep focus inside with the\n // other, while every other key stays contained. See\n // `allowOverlayKeysToPropagate`.\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n allowOverlayKeysToPropagate(e);\n\n // Mark focus changes from keyboard navigation\n if (\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'Home' ||\n e.key === 'End' ||\n e.key === 'PageUp' ||\n e.key === 'PageDown'\n ) {\n lastFocusSourceRef.current = 'keyboard';\n }\n\n if (e.key === 'Escape') {\n // Called to potentially override the default selection clearing.\n onEscape?.();\n }\n },\n });\n\n styles = extractStyles(otherProps, PROP_STYLES, styles);\n\n ref = useCombinedRefs(ref);\n listRef = useCombinedRefs(listRef);\n\n // ----- Collection and virtualization decision (must precede useListBox) -----\n const itemsArray = useMemo(\n () => [...listState.collection],\n [listState.collection],\n );\n\n const hasSections = useMemo(\n () => itemsArray.some((i) => i.type === 'section'),\n [itemsArray],\n );\n\n const shouldVirtualize = !hasSections && !isReorderable;\n\n const { listBoxProps, labelProps } = useListBox(\n {\n ...props,\n id: id,\n // Only disable isVirtualized for reorderable lists (DnD needs real DOM focus).\n // Section-based lists keep isVirtualized: true to preserve ARIA attributes.\n isVirtualized: !isReorderable,\n shouldUseVirtualFocus: shouldUseVirtualFocus ?? false,\n escapeKeyBehavior: onEscape ? 'none' : 'clearSelection',\n onSelectionChange: wrappedOnSelectionChange,\n },\n listState,\n listRef,\n );\n\n const { isFocused, focusProps } = useFocus();\n // An empty list is still a Tab stop, on its `ul` with no height, so the\n // card shows that focus as it shows its own.\n const { isFocused: isListElementFocused, focusProps: listElementFocusProps } =\n useFocus();\n const { isFocused: isSelectAllFocused, focusProps: selectAllFocusProps } =\n useFocus();\n\n // The focused key outlives focus, so an option shows as focused only while\n // the list has it. A component whose input moves the key (FilterListBox)\n // says whether focus is within it, in any focus mode. Otherwise the list's\n // own focus decides, and with virtual focus the focused key alone marks it.\n // Focus on \"Select All\" is on neither.\n const isListFocused =\n !isSelectAllFocused &&\n (isFocusWithin ??\n (shouldUseVirtualFocus || listState.selectionManager.isFocused));\n\n // Scroll container ref for virtualization\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const rowVirtualizer = useVirtualizer({\n count: shouldVirtualize ? itemsArray.length : 0,\n getScrollElement: () => scrollRef.current,\n // Use the actual item key to ensure React properly reconciles DOM elements\n // when items are filtered, added, or removed. Without this, the virtualizer\n // uses index-based keys which causes DOM reuse issues and style leaking.\n // A new key function makes the virtualizer recompute positions from the\n // heights it has measured per key. ListBox isn't compiled (useVirtualizer),\n // so that is every render. Reading `itemsArray` keeps new items bringing a\n // new function should it ever compile.\n getItemKey: (index: number) => itemsArray[index]?.key ?? index,\n estimateSize: (index: number) => {\n const currentItem: any = itemsArray[index];\n\n if (currentItem?.props?.description) {\n return SIZES.XL;\n }\n return SIZES[SIZE_NAME_TO_KEY[size] as keyof typeof SIZES];\n },\n // Options are positioned absolutely here, so their margins space nothing.\n // `1` matches the `1bw` default.\n gap: listGap ?? 1,\n overscan: 10,\n });\n\n // The virtualizer caches positions without the gap, so re-measure when it\n // changes. Not when the items do: their positions follow `getItemKey`, and\n // `measure()` would drop every measured height.\n useEffect(() => {\n if (shouldVirtualize) {\n rowVirtualizer.measure();\n }\n }, [shouldVirtualize, rowVirtualizer, listGap]);\n\n // The focused key this effect last saw, to tell a move of focus from a\n // change of the items.\n const lastFocusedKeyRef = useRef<Key | null>(null);\n\n // Keep the focused option visible. One the virtualizer hasn't rendered is\n // scrolled to by index, which renders it, when focus moves to it (End,\n // typeahead, the selected option on autofocus or Tab); new items alone\n // leave a list the user scrolled away from where it is. One already\n // rendered is scrolled to only for keyboard navigation, so a click never\n // moves the list.\n useLayoutEffect(() => {\n const focusedKey = listState.selectionManager.focusedKey;\n const hasFocusMoved = focusedKey !== lastFocusedKeyRef.current;\n\n lastFocusedKeyRef.current = focusedKey;\n\n if (focusedKey == null) return;\n\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const itemElement = scrollElement.querySelector(\n `[data-key=\"${CSS.escape(String(focusedKey))}\"]`,\n ) as HTMLElement;\n\n if (!itemElement) {\n const index = shouldVirtualize\n ? itemsArray.findIndex((item) => item.key === focusedKey)\n : -1;\n\n if (index !== -1 && hasFocusMoved) {\n rowVirtualizer.scrollToIndex(index, { align: 'auto' });\n }\n\n return;\n }\n\n // Only scroll on keyboard navigation\n if (lastFocusSourceRef.current !== 'keyboard') return;\n\n const scrollTop = scrollElement.scrollTop;\n const viewportHeight = scrollElement.clientHeight;\n const viewportBottom = scrollTop + viewportHeight;\n\n const itemRect = itemElement.getBoundingClientRect();\n const scrollRect = scrollElement.getBoundingClientRect();\n\n // Calculate item position relative to scroll container\n const itemTop = itemRect.top - scrollRect.top + scrollTop;\n const itemBottom = itemTop + itemRect.height;\n\n // Check if the item is fully visible in the viewport\n const isAlreadyVisible =\n itemTop >= scrollTop && itemBottom <= viewportBottom;\n\n if (!isAlreadyVisible) {\n // Use scrollIntoView with block: 'nearest' to minimize scroll jumps\n itemElement.scrollIntoView({ block: 'nearest', behavior: 'auto' });\n }\n }, [\n listState.selectionManager.focusedKey,\n itemsArray,\n shouldVirtualize,\n rowVirtualizer,\n ]);\n\n // Merge React Aria listbox props with custom keyboard props so both sets of\n // event handlers (e.g. Arrow navigation *and* our Escape handler) are\n // preserved.\n // `useListBox` takes no validation state, so the list would look invalid\n // without a screen reader ever hearing it.\n const mergedListBoxProps = mergeProps(\n listBoxProps,\n keyboardProps,\n listElementFocusProps,\n { 'aria-invalid': isInvalid || undefined },\n );\n\n // React Aria keeps a disabled list a Tab stop while no option has focus.\n if (isDisabled) {\n delete mergedListBoxProps.tabIndex;\n }\n\n // An empty list keeps its listbox, which ids from outside point at (a search\n // input's `aria-controls`, the label's `aria-labelledby`), and says why it is\n // empty through its description: a listbox may hold only options and groups.\n const isEmpty = listState.collection.size === 0;\n const emptyLabelId = `${listBoxProps.id}-empty`;\n\n if (isEmpty) {\n mergedListBoxProps['aria-describedby'] = [\n mergedListBoxProps['aria-describedby'],\n emptyLabelId,\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n // Ordered keys for DnD reordering\n const orderedKeys = useMemo(() => {\n if (!isReorderable) {\n return [];\n }\n\n return itemsArray\n .filter((i) => i.type === 'item')\n .map((i) => String(i.key));\n }, [isReorderable, itemsArray]);\n\n const isCardFocused = isFocused || (isEmpty && isListElementFocused);\n\n const mods = useMemo(\n () => ({\n ...getValidationMods({ isInvalid, isValid }),\n disabled: isDisabled,\n focused: isCardFocused,\n header: !!header || hasSelectAll,\n footer: !!footer,\n selectAll: hasSelectAll,\n ...externalMods,\n }),\n [\n isInvalid,\n isValid,\n isDisabled,\n isCardFocused,\n header,\n footer,\n hasSelectAll,\n externalMods,\n ],\n );\n\n const listGapTokens =\n listGap == null ? undefined : { '$list-gap': `${listGap}px` };\n\n const listBoxField = (\n <ListBoxWrapperElement\n ref={ref}\n qa=\"ListBoxWrapper\"\n mods={mods}\n styles={styles}\n data-shape={shape}\n >\n {header ? (\n <StyledHeader styles={headerStyles} data-size={size}>\n {header}\n </StyledHeader>\n ) : (\n <div role=\"presentation\" />\n )}\n {hasSelectAll ? (\n <SelectAllOption\n label={selectAllLabel}\n isSelected={isAllSelected}\n isIndeterminate={isSomeSelected}\n isDisabled={isDisabled}\n isCheckable={isCheckable}\n size={size}\n allValueProps={allValueProps}\n focusProps={selectAllFocusProps}\n onClick={handleSelectAllClick}\n />\n ) : (\n <>\n <div role=\"presentation\" />\n <div role=\"presentation\" />\n </>\n )}\n {/* Scroll container wrapper */}\n <ListBoxScrollElement ref={scrollRef} mods={mods} {...focusProps}>\n {isEmpty && (\n <Item\n id={emptyLabelId}\n // Read as the listbox's description, so not a second time as text.\n aria-hidden=\"true\"\n preset=\"t4\"\n color=\"#dark-03\"\n size={size}\n padding=\"(.5x - 1bw)\"\n >\n {emptyLabel}\n </Item>\n )}\n {isReorderable && !isEmpty ? (\n <DraggableListBox\n state={listState}\n listRef={listRef}\n orderedKeys={orderedKeys}\n onReorder={onReorder}\n >\n {(dragState, dropState, collectionProps) => (\n <ListElement\n qa={qa || 'ListBox'}\n {...mergeProps(mergedListBoxProps, collectionProps)}\n ref={listRef}\n styles={listStyles}\n tokens={listGapTokens}\n aria-disabled={isDisabled || undefined}\n mods={{ sections: false }}\n data-shape={shape}\n data-input-type=\"listbox\"\n >\n {itemsArray\n .filter((item) => item.type === 'item')\n .map((item) => (\n <Option\n key={item.key}\n size={size}\n item={item}\n state={listState}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n lastFocusSourceRef={lastFocusSourceRef}\n dragState={dragState}\n dropState={dropState}\n onClick={onOptionClick}\n />\n ))}\n </ListElement>\n )}\n </DraggableListBox>\n ) : (\n <ListElement\n qa={qa || 'ListBox'}\n {...mergedListBoxProps}\n ref={listRef}\n styles={listStyles}\n tokens={listGapTokens}\n aria-disabled={isDisabled || undefined}\n mods={{ sections: hasSections, empty: isEmpty }}\n data-shape={shape}\n data-input-type=\"listbox\"\n style={\n shouldVirtualize\n ? {\n position: 'relative',\n height: `${rowVirtualizer.getTotalSize()}px`,\n }\n : undefined\n }\n >\n {shouldVirtualize\n ? rowVirtualizer.getVirtualItems().map((virtualItem) => {\n const item = itemsArray[virtualItem.index];\n\n return (\n <Option\n key={item.key}\n size={size}\n item={item}\n state={listState}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n // Measures the option's real height; the virtualizer adds the gap.\n virtualRef={rowVirtualizer.measureElement as any}\n virtualStyle={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n transform: `translateY(${virtualItem.start}px)`,\n }}\n virtualIndex={virtualItem.index}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />\n );\n })\n : (() => {\n const renderedItems: ReactNode[] = [];\n let isFirstSection = true;\n\n for (const item of listState.collection) {\n if (item.type === 'section') {\n if (!isFirstSection) {\n renderedItems.push(\n // A listbox holds only options and groups.\n <StyledDivider\n key={`divider-${String(item.key)}`}\n role=\"presentation\"\n />,\n );\n }\n\n renderedItems.push(\n <ListBoxSection\n key={item.key}\n item={item}\n state={listState}\n optionStyles={optionStyles}\n optionHighlight={optionHighlight}\n headingStyles={headingStyles}\n sectionStyles={sectionStyles}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n size={size}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />,\n );\n\n isFirstSection = false;\n } else {\n renderedItems.push(\n <Option\n key={item.key}\n size={size}\n item={item}\n state={listState}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />,\n );\n }\n }\n\n return renderedItems;\n })()}\n </ListElement>\n )}\n </ListBoxScrollElement>\n {footer ? (\n <StyledFooter styles={footerStyles} data-size={size}>\n {footer}\n </StyledFooter>\n ) : (\n <div role=\"presentation\" />\n )}\n </ListBoxWrapperElement>\n );\n\n return wrapWithField<Omit<CubeListBoxProps<T>, 'children'>>(\n listBoxField,\n ref,\n { ...props, labelProps: mergeAriaProps(labelProps, props.labelProps) },\n );\n}) as unknown as (<T>(\n props: CubeListBoxProps<T> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReactElement) & {\n Item: typeof CollectionItem;\n Section: typeof BaseSection;\n};\n\nfunction Option({\n size = 'medium',\n item,\n state,\n styles,\n highlight,\n isParentDisabled,\n isInvalid,\n isValid,\n focusOnHover = false,\n isListFocused = false,\n isCheckable,\n onClick: onOptionClick,\n virtualStyle,\n virtualRef,\n virtualIndex,\n lastFocusSourceRef,\n dragState,\n dropState,\n}: {\n size?: 'small' | 'medium' | 'large';\n item: any;\n state: any;\n styles?: Styles;\n highlight?: string;\n isParentDisabled?: boolean;\n isInvalid?: boolean;\n isValid?: boolean;\n focusOnHover?: boolean;\n /** Whether the list has focus, so its focused option shows as focused */\n isListFocused?: boolean;\n isCheckable?: boolean;\n onClick?: (key: Key) => void;\n /** Inline style applied when virtualized (absolute positioning etc.) */\n virtualStyle?: CSSProperties;\n /** react-virtual's `measureElement`, called with the option after every commit */\n virtualRef?: (element: HTMLElement | null) => void;\n /** Virtual index from react-virtual for data-index attribute */\n virtualIndex?: number;\n /** Ref to track the source of focus changes */\n lastFocusSourceRef?: MutableRefObject<'keyboard' | 'mouse' | 'other'>;\n /** Drag state from DraggableCollection. When provided, enables drag-and-drop. */\n dragState?: DraggableCollectionState;\n /** Drop state from DraggableCollection. When provided, renders drop indicators. */\n dropState?: DroppableCollectionState;\n}) {\n const localRef = useRef<HTMLLIElement>(null);\n\n // Measure during the commit. After it, the browser can paint the option at\n // its estimated height first, overlapping the next one for a frame.\n useLayoutEffect(() => {\n virtualRef?.(localRef.current);\n });\n\n const isDisabled = isParentDisabled || state.disabledKeys.has(item.key);\n const isSelected = state.selectionManager.isSelected(item.key);\n\n // Drag-and-drop support — only enable when both states are provided\n const isDraggable = !!dragState && !!dropState;\n\n // useDraggableItem must be called unconditionally (Rules of Hooks).\n // When dragState is undefined, we pass a minimal mock state to satisfy the hook.\n const mockDragState = useMemo(\n () => createMockDragState(state.collection, state.selectionManager),\n [state.collection, state.selectionManager],\n );\n\n const dragResult = useDraggableItem(\n { key: item.key },\n dragState ?? mockDragState,\n );\n const effectiveDragProps = isDraggable ? dragResult.dragProps : {};\n const isDragging = isDraggable && !!dragState?.isDragging(item.key);\n\n const { hoverProps, isHovered } = useHover({ isDisabled });\n\n const { optionProps, isPressed, labelProps, descriptionProps } = useOption(\n {\n key: item.key,\n isDisabled,\n isSelected,\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: focusOnHover,\n },\n state,\n localRef,\n );\n\n const isFocused =\n !isDisabled &&\n isListFocused &&\n state.selectionManager.focusedKey === item.key;\n\n // Filter out service props - all remaining props can be passed to Item\n const filteredItemProps = filterSelectionItemProps(\n filterCollectionItemProps(item.props),\n );\n\n // Determine icon: drag handle > checkbox > user icon > default\n const effectiveIcon = useMemo(() => {\n if (isDraggable) {\n if (!filteredItemProps.icon || isHovered) {\n return <GripVerticalIcon size={14} />;\n }\n }\n\n if (\n !isCheckable ||\n state.selectionManager.selectionMode !== 'multiple' ||\n filteredItemProps.icon\n ) {\n return (\n filteredItemProps.icon ??\n (state.selectionManager.selectionMode !== 'multiple' ? null : undefined)\n );\n }\n\n return renderCheckboxIcon({\n isSelected,\n isDisabled,\n isFocused,\n isHovered,\n isInvalid,\n isValid,\n });\n }, [\n isDraggable,\n isCheckable,\n state.selectionManager.selectionMode,\n isSelected,\n isDisabled,\n isFocused,\n isHovered,\n isInvalid,\n isValid,\n filteredItemProps.icon,\n ]);\n\n // Side-effects layered on top of React Aria's own onClick. The underlying\n // React Aria onClick is already chained via mergeProps below, so this handler\n // must NOT call optionProps.onClick again — re-invoking it would trigger\n // usePress's virtual-click branch and double-fire onPress (and toggle\n // selection twice in multiple mode).\n const runOptionExtras = (target: EventTarget | null) => {\n if (lastFocusSourceRef) {\n lastFocusSourceRef.current = 'mouse';\n }\n\n state.selectionManager.setFocusedKey(item.key);\n\n if (!onOptionClick) {\n return;\n }\n\n // In checkable multiple mode, suppress the callback when the click landed\n // inside the checkbox wrapper — that area is reserved for toggle-only\n // behaviour (React Aria still handles the toggle via the chained onClick).\n if (isCheckable && state.selectionManager.selectionMode === 'multiple') {\n const clickTarget = target as HTMLElement;\n const checkboxElement = localRef.current?.querySelector(\n '[data-element=\"CheckboxWrapper\"]',\n );\n\n if (\n checkboxElement &&\n (checkboxElement === clickTarget ||\n checkboxElement.contains(clickTarget))\n ) {\n return;\n }\n }\n\n onOptionClick(item.key);\n };\n\n const handleOptionExtras = (e: MouseEvent) => runOptionExtras(e.target);\n\n // A mouse press picks the option it started on, even if the list moved\n // under the pointer before the release. The browser then sends the click to\n // a common ancestor, so the press runs the click's side effects itself.\n const originPress = useOptionOriginPress({\n key: item.key,\n ref: localRef,\n manager: state.selectionManager,\n isDisabled,\n onSettle: runOptionExtras,\n });\n\n // Filter out React Aria props that shouldn't reach the DOM\n const {\n onKeyDown,\n onKeyUp,\n onPointerUp,\n tabIndex,\n 'aria-selected': ariaSelected,\n 'aria-disabled': ariaDisabled,\n role,\n ...filteredOptionProps\n } = filterSelectionItemProps(optionProps);\n\n const theme = getValidationTheme(\n 'default' as const,\n { isInvalid, isValid },\n { includeValid: true },\n );\n\n const listBoxItem = (\n <ListBoxItem\n ref={localRef}\n data-key={String(item.key)}\n {...mergeProps(\n filteredOptionProps,\n hoverProps,\n filteredItemProps,\n {\n onClick: handleOptionExtras,\n onKeyDown,\n onKeyUp,\n onPointerDown: originPress.onPointerDown,\n onPointerUp: originPress.wrapPointerUp(onPointerUp),\n tabIndex,\n 'aria-selected': ariaSelected,\n 'aria-disabled': ariaDisabled,\n role,\n },\n effectiveDragProps,\n )}\n theme={theme}\n style={virtualStyle}\n data-size={size}\n data-index={virtualIndex}\n size={size}\n display={isDraggable ? 'grid' : undefined}\n isSelected={isSelected}\n isDisabled={isDisabled}\n icon={effectiveIcon}\n highlight={highlight}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n styles={mergeStyles(styles, filteredItemProps.styles)}\n defaultTooltipPlacement=\"right\"\n mods={{\n listboxitem: true,\n focused: isFocused,\n pressed: isPressed,\n dragging: isDragging,\n draggable: isDraggable,\n gripIcon: isDraggable && (!filteredItemProps.icon || isHovered),\n valid: isSelected && !!isValid && !isInvalid,\n invalid: isSelected && !!isInvalid,\n checkable: isCheckable,\n hovered: isHovered,\n all: false, // This will be set to true for SelectAllOption\n }}\n >\n {item.rendered}\n </ListBoxItem>\n );\n\n if (!isDraggable || !dropState) {\n return listBoxItem;\n }\n\n return (\n <>\n <ListBoxDropIndicator\n target={{ type: 'item', key: item.key, dropPosition: 'before' }}\n dropState={dropState}\n />\n {listBoxItem}\n <ListBoxDropIndicator\n target={{ type: 'item', key: item.key, dropPosition: 'after' }}\n dropState={dropState}\n />\n </>\n );\n}\n\n// =============================================================================\n// Drop Indicator for DnD reordering\n// =============================================================================\n\nfunction ListBoxDropIndicator({\n target,\n dropState,\n}: {\n target: DropTarget;\n dropState: DroppableCollectionState;\n}) {\n const ref = useRef<HTMLLIElement>(null);\n const { dropIndicatorProps, isHidden, isDropTarget } = useDropIndicator(\n { target },\n dropState,\n ref,\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorElement\n ref={ref}\n role=\"option\"\n {...dropIndicatorProps}\n mods={{ 'drop-indicator': true, 'drop-target': isDropTarget }}\n >\n <div data-element=\"Indicator\" />\n </ListBoxDropIndicatorElement>\n );\n}\n\ninterface ListBoxSectionProps<T> {\n item: any;\n state: any;\n optionStyles?: Styles;\n optionHighlight?: string;\n headingStyles?: Styles;\n sectionStyles?: Styles;\n isParentDisabled?: boolean;\n isInvalid?: boolean;\n isValid?: boolean;\n focusOnHover?: boolean;\n isListFocused?: boolean;\n isCheckable?: boolean;\n onClick?: (key: Key) => void;\n size?: 'small' | 'medium' | 'large';\n lastFocusSourceRef?: MutableRefObject<'keyboard' | 'mouse' | 'other'>;\n}\n\nfunction ListBoxSection<T>(props: ListBoxSectionProps<T>) {\n const {\n item,\n state,\n optionStyles,\n optionHighlight,\n headingStyles,\n sectionStyles,\n isParentDisabled,\n isInvalid,\n isValid,\n focusOnHover,\n isListFocused,\n isCheckable,\n onClick: onOptionClick,\n lastFocusSourceRef,\n } = props;\n const heading = item.rendered;\n\n const { itemProps, headingProps, groupProps } = useListBoxSection({\n heading,\n 'aria-label': item['aria-label'],\n });\n\n return (\n <SectionWrapperElement {...itemProps} styles={sectionStyles}>\n {heading && (\n <StyledSectionHeading\n {...headingProps}\n size={props.size}\n styles={headingStyles}\n >\n {heading}\n </StyledSectionHeading>\n )}\n <SectionListElement {...groupProps}>\n {[...item.childNodes]\n .filter((node: any) => state.collection.getItem(node.key))\n .map((node: any) => (\n <Option\n key={node.key}\n size={props.size}\n item={node}\n state={state}\n styles={optionStyles}\n highlight={optionHighlight}\n isParentDisabled={isParentDisabled}\n isInvalid={isInvalid}\n isValid={isValid}\n focusOnHover={focusOnHover}\n isListFocused={isListFocused}\n isCheckable={isCheckable}\n lastFocusSourceRef={lastFocusSourceRef}\n onClick={onOptionClick}\n />\n ))}\n </SectionListElement>\n </SectionWrapperElement>\n );\n}\n\ntype SectionComponent = typeof BaseSection;\n\nconst ListBoxSectionComponent = Object.assign(BaseSection, {\n displayName: 'Section',\n}) as SectionComponent;\n\nListBox.Item = CollectionItem;\n\nListBox.Section = ListBoxSectionComponent;\n\nObject.defineProperty(ListBox, 'cubeInputType', {\n value: 'ListBox',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAMiF,wBAAwBrE,MAAM;CAClCsE,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,aAAa;EACbC,UAAU;EACVC,MAAM;EACNC,KAAK;EACLC,UAAU;EACVC,QAAQ;GACN,IAAI;GACJ,4BAA0B;GAC1B,0BAAwB;GACzB;EACDC,OAAO;EACPC,YAAY;EACZC,SAAS;GACP,IAAI;GACJ,qBAAqB;GACrBC,SAAS;GACV;EACDC,QAAQ;GACN,IAAI;GACJD,SAAS;GACTE,OAAO;GACPC,SAAS;GACTC,UAAU;GACV,kEAA8D;GAChE;EACF;CACD,CAAC;AAEF,MAAMC,cAAcvF,MAAM;CACxBwF,IAAI;CACJjB,QAAQ;EAGN,aAAa;EACbC,SAAS;EAITiB,SAAS;GACP,IAAI;GAEJC,OAAO;GACR;EACDC,WAAW;EACXC,WAAW;EACXC,QAAQ;GACN,IAAI;GACJ,kCAAgC;GACjC;EACDC,QAAQ;EACV;CACD,CAAC;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AAuU,cAAAvU,EAAA,QAAAyF,IAAA;AApBNE,OAAA,oBAAC;GAAkB,GAAK4O;aACrB9O;IAoBkB;AAAAzF,IAAA,MAAAuU;AAAAvU,IAAA,MAAAyF;AAAAzF,IAAA,MAAA2F;OAAAA,MAAA3F,EAAA;CAAA,IAAA6F;AAAA,KAAA7F,EAAA,QAAAqU,aAAArU,EAAA,QAAA8B,iBAAA9B,EAAA,QAAAkF,MAAAlF,EAAA,QAAA2F,IAAA;AA/BvBE,OAAA,qBAAC;GAAqB,GAAKwO;GAAmBvS,QAAAA;cAC3CoD,IASDS;IAsBsB;AAAA3F,IAAA,MAAAqU;AAAArU,IAAA,MAAA8B;AAAA9B,IAAA,MAAAkF;AAAAlF,IAAA,MAAA2F;AAAA3F,IAAA,MAAA6F;OAAAA,MAAA7F,EAAA;AAAA,QAhCxB6F;;AAsCJ,MAAM8O,0BAA0BC,OAAOC,OAAO9Z,SAAa,EACzD+Z,aAAa,WACd,CAAC;AAEFpL,QAAQlN,OAAOL;AAEfuN,QAAQ5O,UAAU6Z;AAElBC,OAAOG,eAAerL,SAAS,iBAAiB;CAC9CF,OAAO;CACPwL,YAAY;CACZC,cAAc;CACf,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e3f8a1a | Cube Dev Team */
|
|
2
2
|
//#region src/components/fields/ListBox/optionId.ts
|
|
3
3
|
/**
|
|
4
4
|
* The DOM id of the option with `key` in the listbox whose id is `listBoxId`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e3f8a1a | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs as mergeRefs$1 } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -74,11 +74,12 @@ const ListBoxPopoverElement = tasty({
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
const ListBoxPopover = function ListBoxPopover(props) {
|
|
77
|
-
const $ = c(
|
|
77
|
+
const $ = c(80);
|
|
78
78
|
const { t } = useI18n();
|
|
79
79
|
const { isOpen, triggerRef, popoverRef, listBoxRef, direction, shouldFlip, overlayOffset, containerPadding, comboBoxWidth, listBoxId, overlayStyles, listBoxStyles, optionStyles, optionHighlight, sectionStyles, headingStyles, listGap, selectedKey, selectionMode: t0, selectedKeys, isCheckable, shouldCloseOnTriggerInteraction: t1, isDisabled, disabledKeys, items, children, listStateRef, onSelectionChange, onClose, label, ariaLabel, ariaLabelledby, compositeFocusProps, filter, size: t2, emptyLabel, positionTargetRef, positionApiRef } = props;
|
|
80
80
|
const selectionMode = t0 === void 0 ? "single" : t0;
|
|
81
81
|
const shouldCloseOnTriggerInteraction = t1 === void 0 ? true : t1;
|
|
82
|
+
const size = t2 === void 0 ? "medium" : t2;
|
|
82
83
|
const mergedPopoverRef = popoverRef;
|
|
83
84
|
const layerRef = useModalLayerRef();
|
|
84
85
|
const overlayScrollRef = useRef(null);
|
|
@@ -233,7 +234,7 @@ const ListBoxPopover = function ListBoxPopover(props) {
|
|
|
233
234
|
} else t18 = $[39];
|
|
234
235
|
const setScrollRef = t18;
|
|
235
236
|
let t19;
|
|
236
|
-
if ($[40] !== ariaLabel || $[41] !== ariaLabelledby || $[42] !== children || $[43] !== comboBoxWidth || $[44] !== compositeFocusProps || $[45] !== disabledKeys || $[46] !== emptyLabel || $[47] !== filter || $[48] !== headingStyles || $[49] !== isCheckable || $[50] !== isDisabled || $[51] !== items || $[52] !== label || $[53] !== layerRef || $[54] !== listBoxId || $[55] !== listBoxRef || $[56] !== listBoxStyles || $[57] !== listGap || $[58] !== listStateRef || $[59] !== maxHeight || $[60] !== maxWidth || $[61] !== mergedPopoverRef || $[62] !== onSelectionChange || $[63] !== optionHighlight || $[64] !== optionStyles || $[65] !== overlayBehaviorProps || $[66] !== overlayPositionProps || $[67] !== overlayStyles || $[68] !== placementDirection || $[69] !== positionStyle || $[70] !== sectionStyles || $[71] !== selectedKey || $[72] !== selectedKeys || $[73] !== selectionMode || $[74] !== t) {
|
|
237
|
+
if ($[40] !== ariaLabel || $[41] !== ariaLabelledby || $[42] !== children || $[43] !== comboBoxWidth || $[44] !== compositeFocusProps || $[45] !== disabledKeys || $[46] !== emptyLabel || $[47] !== filter || $[48] !== headingStyles || $[49] !== isCheckable || $[50] !== isDisabled || $[51] !== items || $[52] !== label || $[53] !== layerRef || $[54] !== listBoxId || $[55] !== listBoxRef || $[56] !== listBoxStyles || $[57] !== listGap || $[58] !== listStateRef || $[59] !== maxHeight || $[60] !== maxWidth || $[61] !== mergedPopoverRef || $[62] !== onSelectionChange || $[63] !== optionHighlight || $[64] !== optionStyles || $[65] !== overlayBehaviorProps || $[66] !== overlayPositionProps || $[67] !== overlayStyles || $[68] !== placementDirection || $[69] !== positionStyle || $[70] !== sectionStyles || $[71] !== selectedKey || $[72] !== selectedKeys || $[73] !== selectionMode || $[74] !== size || $[75] !== t) {
|
|
237
238
|
t19 = (t20) => {
|
|
238
239
|
const { phase, isShown, isExiting, ref: transitionRef } = t20;
|
|
239
240
|
transitionRefHolder.current = transitionRef;
|
|
@@ -266,12 +267,13 @@ const ListBoxPopover = function ListBoxPopover(props) {
|
|
|
266
267
|
id: listBoxId,
|
|
267
268
|
"aria-label": ariaLabel || (typeof label === "string" ? label : ariaLabelledby ? void 0 : t("listBoxPopover.options", "Options")),
|
|
268
269
|
"aria-labelledby": ariaLabelledby,
|
|
269
|
-
selectionMode
|
|
270
|
+
selectionMode,
|
|
270
271
|
selectedKey: selectionMode === "single" ? selectedKey : void 0,
|
|
271
272
|
selectedKeys: selectionMode === "multiple" ? selectedKeys : void 0,
|
|
272
273
|
isCheckable: selectionMode === "multiple" ? isCheckable : void 0,
|
|
273
274
|
isDisabled,
|
|
274
275
|
disabledKeys,
|
|
276
|
+
size: size === "large" ? "large" : "medium",
|
|
275
277
|
shouldUseVirtualFocus: true,
|
|
276
278
|
items,
|
|
277
279
|
filter,
|
|
@@ -324,19 +326,20 @@ const ListBoxPopover = function ListBoxPopover(props) {
|
|
|
324
326
|
$[71] = selectedKey;
|
|
325
327
|
$[72] = selectedKeys;
|
|
326
328
|
$[73] = selectionMode;
|
|
327
|
-
$[74] =
|
|
328
|
-
$[75] =
|
|
329
|
-
|
|
329
|
+
$[74] = size;
|
|
330
|
+
$[75] = t;
|
|
331
|
+
$[76] = t19;
|
|
332
|
+
} else t19 = $[76];
|
|
330
333
|
let t20;
|
|
331
|
-
if ($[
|
|
334
|
+
if ($[77] !== isOpen || $[78] !== t19) {
|
|
332
335
|
t20 = /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(DisplayTransition, {
|
|
333
336
|
isShown: isOpen,
|
|
334
337
|
children: t19
|
|
335
338
|
}) });
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
} else t20 = $[
|
|
339
|
+
$[77] = isOpen;
|
|
340
|
+
$[78] = t19;
|
|
341
|
+
$[79] = t20;
|
|
342
|
+
} else t20 = $[79];
|
|
340
343
|
return t20;
|
|
341
344
|
};
|
|
342
345
|
|