@cube-dev/ui-kit 0.0.0-canary-9bce1d6 → 0.0.0-canary-5a0d20c
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 +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 +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 -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.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.d.ts +7 -0
- package/dist/components/content/Divider.js +105 -0
- package/dist/components/content/Divider.js.map +1 -0
- 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 +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +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 +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 +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +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.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 +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/TableRowLink.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.d.ts +3 -2
- package/dist/components/fields/Checkbox/Checkbox.js +5 -4
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.d.ts +3 -2
- package/dist/components/fields/Checkbox/CheckboxGroup.js +19 -38
- 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.d.ts +3 -2
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js.map +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/components/fields/ColorPicker/ColorPicker.js +186 -196
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.d.ts +3 -2
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +143 -171
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +3 -2
- package/dist/components/fields/ComboBox/ComboBox.js +589 -572
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- 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.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateInput.js +6 -5
- package/dist/components/fields/DatePicker/DateInput.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/DatePicker.js +83 -173
- package/dist/components/fields/DatePicker/DatePicker.js.map +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.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateRangePicker.js +115 -204
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +284 -434
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/PeriodPicker.js +86 -113
- package/dist/components/fields/DatePicker/PeriodPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.d.ts +3 -2
- package/dist/components/fields/DatePicker/TimeInput.js +6 -5
- package/dist/components/fields/DatePicker/TimeInput.js.map +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.d.ts +3 -2
- package/dist/components/fields/FileInput/FileInput.js +114 -141
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +10 -11
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +9 -3
- package/dist/components/fields/FilterPicker/FilterPicker.js +12 -11
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +3 -2
- package/dist/components/fields/ListBox/ListBox.js +7 -10
- 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 +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.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +9 -3
- package/dist/components/fields/Picker/Picker.js +12 -11
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.d.ts +3 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js +73 -110
- 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.d.ts +3 -2
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +12 -21
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.d.ts +3 -2
- package/dist/components/fields/Select/Select.js +8 -10
- 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 +25 -42
- package/dist/components/fields/Slider/RangeSlider.js.map +1 -1
- package/dist/components/fields/Slider/Slider.js +36 -39
- package/dist/components/fields/Slider/Slider.js.map +1 -1
- package/dist/components/fields/Slider/SliderBase.js +61 -60
- package/dist/components/fields/Slider/SliderBase.js.map +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/Slider/types.d.ts +3 -2
- package/dist/components/fields/Switch/Switch.d.ts +3 -2
- package/dist/components/fields/Switch/Switch.js +90 -124
- package/dist/components/fields/Switch/Switch.js.map +1 -1
- package/dist/components/fields/TagInput/TagInput.d.ts +3 -2
- package/dist/components/fields/TagInput/TagInput.js +5 -4
- package/dist/components/fields/TagInput/TagInput.js.map +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.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.d.ts +3 -2
- package/dist/components/fields/TextInput/TextInputBase.js +8 -11
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- 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/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +120 -57
- package/dist/components/form/FieldWrapper/FieldWrapper.js.map +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/field-chrome.js.map +1 -1
- package/dist/components/form/field-layout.d.ts +10 -0
- package/dist/components/form/field-layout.js +96 -0
- package/dist/components/form/field-layout.js.map +1 -0
- package/dist/components/form/index.d.ts +2 -1
- package/dist/components/form/legacy-tooltip.js +15 -2
- package/dist/components/form/legacy-tooltip.js.map +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 +6 -2
- package/dist/components/form/wrapper.js.map +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.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +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.js +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 +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
- 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 +1 -1
- package/dist/components/overlays/Modal/Popover.js +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 +2 -2
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js.map +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.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +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 +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 +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- 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 +3 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- 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 +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/CreateComponent.md +1 -1
- package/docs/FieldProperties.md +15 -5
- package/docs/Usage.md +2 -0
- package/docs/components/content/Divider.md +21 -103
- package/docs/components/fields/Checkbox.md +0 -4
- package/docs/components/fields/ColorInput.md +0 -3
- package/docs/components/fields/ColorPicker.md +2 -2
- package/docs/components/fields/ColorSwatchGroup.md +2 -3
- package/docs/components/fields/ComboBox.md +0 -3
- package/docs/components/fields/CommandTextArea.md +0 -3
- package/docs/components/fields/DatePicker.md +0 -4
- package/docs/components/fields/FileInput.md +1 -5
- package/docs/components/fields/FilterListBox.md +0 -3
- package/docs/components/fields/FilterPicker.md +2 -4
- package/docs/components/fields/HueSlider.md +1 -2
- package/docs/components/fields/ListBox.md +0 -3
- package/docs/components/fields/NumberInput.md +1 -4
- package/docs/components/fields/PasswordInput.md +0 -3
- package/docs/components/fields/PeriodPicker.md +0 -4
- package/docs/components/fields/Picker.md +2 -4
- package/docs/components/fields/RadioGroup.md +1 -4
- package/docs/components/fields/SearchComboBox.md +0 -3
- package/docs/components/fields/SearchInput.md +0 -3
- package/docs/components/fields/Select.md +0 -3
- package/docs/components/fields/Slider.md +0 -1
- package/docs/components/fields/Switch.md +0 -1
- package/docs/components/fields/TagInput.md +1 -5
- package/docs/components/fields/TextArea.md +0 -3
- package/docs/components/fields/TextInput.md +1 -4
- package/package.json +1 -1
- package/dist/components/content/Divider/Divider.d.ts +0 -22
- package/dist/components/content/Divider/Divider.js +0 -159
- package/dist/components/content/Divider/Divider.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["getActiveElement","useObjectRef","BaseProps","CONTAINER_STYLES","ContainerStyleProps","Styles","tasty","forwardRef","useRef","AriaRadioGroupProps","useFocusRing","useRadioGroup","RadioGroupState","useRadioGroupState","FieldBaseProps","mergeProps","castNullableStringValue","WithNullableValue","extractStyles","CubeItemProps","FormScopeMask","useFieldProps","wrapWithField","RadioContext","KeyboardEvent","CubeRadioGroupProps","Omit","groupStyles","orientation","value","defaultValue","onChange","size","Exclude","buttonType","type","RadioGroupElement","qa","styles","display","placeItems","placeContent","flow","horizontal","padding","tabs","boxSizing","radius","fill","width","flexShrink","gap","button","whiteSpace","outline","isFocusedDisabledRadio","element","HTMLInputElement","getAttribute","RadioGroup","rawProps","ref","$","_c","t0","t1","Symbol","for","defaultValidationTrigger","props","id","isDisabled","isRequired","labelPosition","t2","isInvalid","isValid","children","insideForm","labelProps","baseLabelProps","form","otherProps","undefined","domRef","baseState","isArrowKeyRef","t3","setSelectedValue","current","state","t4","radioGroupProps","onKeyDown","onArrowKey","groupProps","t5","event","t6","within","isFocusVisible","isFocusWithinVisible","focusProps","groupFocusProps","T0","t7","t8","t9","t10","t11","t12","t13","t14","focused","t15","t16","name","t17","t18","t19","radioGroup","t20","_RadioGroup","cubeInputType","displayName","_c","mergeProps"],"sources":["../../../../src/components/fields/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import { getActiveElement, useObjectRef } from '@react-aria/utils';\nimport {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport { forwardRef, useRef } from 'react';\nimport { AriaRadioGroupProps, useFocusRing, useRadioGroup } from 'react-aria';\nimport { RadioGroupState, useRadioGroupState } from 'react-stately';\n\nimport { FieldBaseProps } from '../../../shared';\nimport { mergeProps } from '../../../utils/react';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { extractStyles } from '../../../utils/styles';\nimport { CubeItemProps } from '../../content/Item/Item';\nimport { FormScopeMask, useFieldProps, wrapWithField } from '../../form';\n\nimport { RadioContext } from './context';\n\nimport type { KeyboardEvent } from 'react';\n\nexport interface CubeRadioGroupProps\n extends\n BaseProps,\n Omit<AriaRadioGroupProps, 'errorMessage' | 'form' | 'name'>,\n ContainerStyleProps,\n FieldBaseProps<string | null | undefined> {\n groupStyles?: Styles;\n orientation?: 'horizontal' | 'vertical';\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /* Size for all radio buttons in the group */\n size?: Exclude<CubeItemProps['size'], 'inline'>;\n /* Button type for all button-style radios (ignored in tabs mode). When set to 'primary', selected buttons use 'primary' and non-selected use 'outline' with isSelected appearance */\n buttonType?: CubeItemProps['type'];\n /* Visual type for all radios in the group: radio (default), button, or tabs */\n type?: 'radio' | 'button' | 'tabs';\n}\n\nconst RadioGroupElement = tasty({\n qa: 'RadioGroup',\n styles: {\n display: 'flex',\n placeItems: 'stretch',\n placeContent: 'stretch',\n flow: {\n '': 'column',\n horizontal: 'row wrap',\n 'horizontal & tabs': 'row',\n },\n padding: {\n '': '0',\n tabs: '.5x',\n },\n // The tabs layout is the only one with padding, and a caller that gives the\n // group an explicit width (`width: 100%` inside a popover, say) means the\n // box it can see. Without this the padding is added on top and the group\n // overhangs its container by `1x`.\n boxSizing: 'border-box',\n radius: true,\n fill: {\n '': '#clear',\n 'tabs | disabled': '#surface-4',\n },\n width: 'max-content max-content initial',\n flexShrink: 0,\n gap: {\n '': '1x',\n button: 0,\n tabs: '.5x',\n },\n whiteSpace: 'nowrap',\n // Keyboard focus ring on the group, shown only for button/tabs layouts\n // where individual items are visually merged (button-group) or share a\n // single chrome (tabs) — the classic vertical radio list already shows\n // a per-item focus ring on the radio circle.\n outline: {\n '': '$ring-width #primary-text.0 / $outline-offset',\n 'focused & (button | tabs)':\n '$ring-width #primary-text / $outline-offset',\n },\n },\n});\n\n/**\n * Whether focus rests on the radio with this value while it is disabled. Only\n * a radio kept focusable for its tooltip can be: a natively disabled one never\n * takes focus (see `Radio`).\n */\nfunction isFocusedDisabledRadio(value: string | null) {\n let element = getActiveElement();\n\n return (\n element instanceof HTMLInputElement &&\n element.type === 'radio' &&\n element.value === value &&\n element.getAttribute('aria-disabled') === 'true'\n );\n}\n\nfunction RadioGroup(rawProps: WithNullableValue<CubeRadioGroupProps>, ref) {\n let orientation = rawProps.orientation;\n\n // `null` is the radio group's own \"nothing selected\".\n rawProps = castNullableStringValue(rawProps, null);\n let props = useFieldProps(rawProps, { defaultValidationTrigger: 'onChange' });\n\n let {\n qa,\n id,\n isDisabled,\n isRequired,\n labelPosition = 'top',\n isInvalid,\n isValid,\n children,\n styles,\n groupStyles,\n insideForm,\n // orientation, // ignore orientation since it came from the form context\n labelProps: baseLabelProps,\n size,\n buttonType,\n type,\n form,\n ...otherProps\n } = props;\n let domRef = useObjectRef(ref);\n\n styles = extractStyles(otherProps, CONTAINER_STYLES, styles);\n\n let baseState = useRadioGroupState(props);\n // The arrow keys focus the next radio and select it. A disabled radio that\n // keeps focus for its tooltip is reached that way too, and has to stop the\n // selection the way a read-only group does: focus moves, the value stays.\n // Only the arrow keys: a click elsewhere or a form reset still selects.\n let isArrowKeyRef = useRef(false);\n let state: RadioGroupState = {\n ...baseState,\n setSelectedValue(value) {\n if (isArrowKeyRef.current && isFocusedDisabledRadio(value)) return;\n\n baseState.setSelectedValue(value);\n },\n };\n\n // Set default orientation based on type\n if (orientation == null) {\n orientation =\n type === 'button' || type === 'tabs' ? 'horizontal' : 'vertical';\n }\n\n // React Aria hands `form` to every radio's input as the id of its `<form>`,\n // so the form instance would render as `form=\"[object Object]\"` on each.\n let { radioGroupProps, labelProps } = useRadioGroup(\n { ...props, orientation, form: undefined },\n state,\n );\n\n let { onKeyDown: onArrowKey, ...groupProps } = radioGroupProps;\n let onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n isArrowKeyRef.current = true;\n onArrowKey?.(event);\n isArrowKeyRef.current = false;\n };\n\n // Keyboard-only focus ring on the group container (button/tabs layouts).\n // `within: true` tracks focus on any descendant radio. We read\n // `isFocusVisible` (not `isFocused`), which is keyboard-gated — mouse\n // clicks on a radio focus the input but leave `isFocusVisible` false.\n let { isFocusVisible: isFocusWithinVisible, focusProps: groupFocusProps } =\n useFocusRing({ within: true });\n\n let radioGroup = (\n <RadioGroupElement\n ref={domRef}\n // Keep semantics and keyboard handling on the group: `isBare` omits\n // the field wrapper.\n {...mergeProps(groupProps, groupFocusProps)}\n onKeyDown={onKeyDown}\n // `useRadioGroup` seeds its id once; the current one follows the form\n // binding.\n id={id}\n qa={qa || 'RadioGroup'}\n styles={styles}\n data-input-type=\"radiogroup\"\n data-radio-button-group={type === 'button' ? '' : undefined}\n mods={{\n horizontal: orientation === 'horizontal',\n 'inside-form': insideForm,\n 'side-label': labelPosition === 'side',\n button: type === 'button',\n tabs: type === 'tabs',\n focused: isFocusWithinVisible,\n }}\n >\n <FormScopeMask\n value={{\n isRequired,\n isInvalid,\n isValid,\n isDisabled,\n }}\n >\n <RadioContext.Provider\n value={{\n state,\n name: props.name,\n size,\n buttonType,\n type,\n isDisabled,\n }}\n >\n {children}\n </RadioContext.Provider>\n </FormScopeMask>\n </RadioGroupElement>\n );\n\n return wrapWithField(radioGroup, {\n ...props,\n labelProps: mergeProps(baseLabelProps, labelProps),\n });\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = forwardRef(RadioGroup);\n\n(_RadioGroup as any).cubeInputType = 'RadioGroup';\n_RadioGroup.displayName = 'RadioGroup';\n\nexport { _RadioGroup as RadioGroup };\n"],"mappings":";;;;;;;;;;;;;;;;AA6CA,MAAMoC,oBAAoB9B,MAAM;CAC9B+B,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,YAAY;EACZC,cAAc;EACdC,MAAM;GACJ,IAAI;GACJC,YAAY;GACZ,qBAAqB;EACvB;EACAC,SAAS;GACP,IAAI;GACJC,MAAM;EACR;EAKAC,WAAW;EACXC,QAAQ;EACRC,MAAM;GACJ,IAAI;GACJ,mBAAmB;EACrB;EACAC,OAAO;EACPC,YAAY;EACZC,KAAK;GACH,IAAI;GACJC,QAAQ;GACRP,MAAM;EACR;EACAQ,YAAY;EAKZC,SA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EAAA,QAAAO,SAAAP,EAAA,QAAA0D,YAAA;EAEKC,MAAAnG,cAAckG,YAAY;GAAA,GAC5BnD;GAAKU,YACIhE,aAAWiE,gBAAgBD,UAAU;EACnD,CAAC;EAACjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAO;EAAAP,EAAA,MAAA0D;EAAA1D,EAAA,MAAA2D;CAAA,OAAAA,MAAA3D,EAAA;CAAA,OAHK2D;AAGL;;;;;AAOJ,MAAMC,cAAcnH,WAAWoD,UAAU;AAEzC,YAAqBgE,gBAAgB;AACrCD,YAAYE,cAAc"}
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["getActiveElement","useObjectRef","BaseProps","Styles","tasty","forwardRef","useRef","AriaRadioGroupProps","useFocusRing","useRadioGroup","RadioGroupState","useRadioGroupState","FieldBaseProps","mergeProps","castNullableStringValue","WithNullableValue","CubeItemProps","FormScopeMask","useFieldProps","wrapWithField","FieldLayoutStyleProps","splitFieldLayout","RadioContext","KeyboardEvent","CubeRadioGroupProps","Omit","groupStyles","orientation","value","defaultValue","onChange","size","Exclude","buttonType","type","RadioGroupElement","qa","styles","display","placeItems","placeContent","flow","horizontal","padding","tabs","boxSizing","radius","fill","width","flexShrink","gap","button","whiteSpace","outline","isFocusedDisabledRadio","element","HTMLInputElement","getAttribute","RadioGroup","rawProps","ref","$","_c","t0","t1","Symbol","for","defaultValidationTrigger","props","id","isDisabled","isRequired","labelPosition","t2","isInvalid","isValid","children","insideForm","labelProps","baseLabelProps","undefined","domRef","fieldLayout","baseState","isArrowKeyRef","t3","setSelectedValue","current","state","t4","form","radioGroupProps","onKeyDown","onArrowKey","groupProps","t5","event","t6","within","isFocusVisible","isFocusWithinVisible","focusProps","groupFocusProps","t7","t8","name","t9","t10","radioGroup","focused","fillWidth","field","_RadioGroup","cubeInputType","displayName","_c","mergeProps"],"sources":["../../../../src/components/fields/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import { getActiveElement, useObjectRef } from '@react-aria/utils';\nimport { BaseProps, Styles, tasty } from '@tenphi/tasty';\nimport { forwardRef, useRef } from 'react';\nimport { AriaRadioGroupProps, useFocusRing, useRadioGroup } from 'react-aria';\nimport { RadioGroupState, useRadioGroupState } from 'react-stately';\n\nimport { FieldBaseProps } from '../../../shared';\nimport { mergeProps } from '../../../utils/react';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { CubeItemProps } from '../../content/Item/Item';\nimport { FormScopeMask, useFieldProps, wrapWithField } from '../../form';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\n\nimport { RadioContext } from './context';\n\nimport type { KeyboardEvent } from 'react';\n\nexport interface CubeRadioGroupProps\n extends\n BaseProps,\n Omit<AriaRadioGroupProps, 'errorMessage' | 'form' | 'name'>,\n FieldLayoutStyleProps,\n FieldBaseProps<string | null | undefined> {\n groupStyles?: Styles;\n orientation?: 'horizontal' | 'vertical';\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /* Size for all radio buttons in the group */\n size?: Exclude<CubeItemProps['size'], 'inline'>;\n /* Button type for all button-style radios (ignored in tabs mode). When set to 'primary', selected buttons use 'primary' and non-selected use 'outline' with isSelected appearance */\n buttonType?: CubeItemProps['type'];\n /* Visual type for all radios in the group: radio (default), button, or tabs */\n type?: 'radio' | 'button' | 'tabs';\n}\n\nconst RadioGroupElement = tasty({\n qa: 'RadioGroup',\n styles: {\n display: 'flex',\n placeItems: 'stretch',\n placeContent: 'stretch',\n flow: {\n '': 'column',\n horizontal: 'row wrap',\n 'horizontal & tabs': 'row',\n },\n padding: {\n '': '0',\n tabs: '.5x',\n },\n // The tabs layout is the only one with padding, and a caller that gives the\n // group an explicit width (`width: 100%` inside a popover, say) means the\n // box it can see. Without this the padding is added on top and the group\n // overhangs its container by `1x`.\n boxSizing: 'border-box',\n radius: true,\n fill: {\n '': '#clear',\n 'tabs | disabled': '#surface-4',\n },\n width: {\n '': 'max-content max-content initial',\n // In a field its style props size, the group fills the field as every\n // other input does.\n 'fill-width': 'auto',\n },\n flexShrink: 0,\n gap: {\n '': '1x',\n button: 0,\n tabs: '.5x',\n },\n whiteSpace: 'nowrap',\n // Keyboard focus ring on the group, shown only for button/tabs layouts\n // where individual items are visually merged (button-group) or share a\n // single chrome (tabs) — the classic vertical radio list already shows\n // a per-item focus ring on the radio circle.\n outline: {\n '': '$ring-width #primary-text.0 / $outline-offset',\n 'focused & (button | tabs)':\n '$ring-width #primary-text / $outline-offset',\n },\n },\n});\n\n/**\n * Whether focus rests on the radio with this value while it is disabled. Only\n * a radio kept focusable for its tooltip can be: a natively disabled one never\n * takes focus (see `Radio`).\n */\nfunction isFocusedDisabledRadio(value: string | null) {\n let element = getActiveElement();\n\n return (\n element instanceof HTMLInputElement &&\n element.type === 'radio' &&\n element.value === value &&\n element.getAttribute('aria-disabled') === 'true'\n );\n}\n\nfunction RadioGroup(rawProps: WithNullableValue<CubeRadioGroupProps>, ref) {\n let orientation = rawProps.orientation;\n\n // `null` is the radio group's own \"nothing selected\".\n rawProps = castNullableStringValue(rawProps, null);\n let props = useFieldProps(rawProps, { defaultValidationTrigger: 'onChange' });\n\n let {\n qa,\n id,\n isDisabled,\n isRequired,\n labelPosition = 'top',\n isInvalid,\n isValid,\n children,\n styles,\n groupStyles,\n insideForm,\n // orientation, // ignore orientation since it came from the form context\n labelProps: baseLabelProps,\n size,\n buttonType,\n type,\n form,\n } = props;\n let domRef = useObjectRef(ref);\n\n const fieldLayout = splitFieldLayout(props);\n\n styles = fieldLayout.styles;\n\n let baseState = useRadioGroupState(props);\n // The arrow keys focus the next radio and select it. A disabled radio that\n // keeps focus for its tooltip is reached that way too, and has to stop the\n // selection the way a read-only group does: focus moves, the value stays.\n // Only the arrow keys: a click elsewhere or a form reset still selects.\n let isArrowKeyRef = useRef(false);\n let state: RadioGroupState = {\n ...baseState,\n setSelectedValue(value) {\n if (isArrowKeyRef.current && isFocusedDisabledRadio(value)) return;\n\n baseState.setSelectedValue(value);\n },\n };\n\n // Set default orientation based on type\n if (orientation == null) {\n orientation =\n type === 'button' || type === 'tabs' ? 'horizontal' : 'vertical';\n }\n\n // React Aria hands `form` to every radio's input as the id of its `<form>`,\n // so the form instance would render as `form=\"[object Object]\"` on each.\n let { radioGroupProps, labelProps } = useRadioGroup(\n { ...props, orientation, form: undefined },\n state,\n );\n\n let { onKeyDown: onArrowKey, ...groupProps } = radioGroupProps;\n let onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n isArrowKeyRef.current = true;\n onArrowKey?.(event);\n isArrowKeyRef.current = false;\n };\n\n // Keyboard-only focus ring on the group container (button/tabs layouts).\n // `within: true` tracks focus on any descendant radio. We read\n // `isFocusVisible` (not `isFocused`), which is keyboard-gated — mouse\n // clicks on a radio focus the input but leave `isFocusVisible` false.\n let { isFocusVisible: isFocusWithinVisible, focusProps: groupFocusProps } =\n useFocusRing({ within: true });\n\n let radioGroup = (\n <RadioGroupElement\n ref={domRef}\n // Keep semantics and keyboard handling on the group: `isBare` omits\n // the field wrapper.\n {...mergeProps(groupProps, groupFocusProps)}\n onKeyDown={onKeyDown}\n // `useRadioGroup` seeds its id once; the current one follows the form\n // binding.\n id={id}\n qa={qa || 'RadioGroup'}\n styles={styles}\n data-input-type=\"radiogroup\"\n data-radio-button-group={type === 'button' ? '' : undefined}\n mods={{\n horizontal: orientation === 'horizontal',\n 'inside-form': insideForm,\n 'side-label': labelPosition === 'side',\n button: type === 'button',\n tabs: type === 'tabs',\n focused: isFocusWithinVisible,\n 'fill-width': fieldLayout.fillWidth,\n }}\n >\n <FormScopeMask\n value={{\n isRequired,\n isInvalid,\n isValid,\n isDisabled,\n }}\n >\n <RadioContext.Provider\n value={{\n state,\n name: props.name,\n size,\n buttonType,\n type,\n isDisabled,\n }}\n >\n {children}\n </RadioContext.Provider>\n </FormScopeMask>\n </RadioGroupElement>\n );\n\n return wrapWithField(radioGroup, {\n ...props,\n ...fieldLayout.field,\n labelProps: mergeProps(baseLabelProps, labelProps),\n });\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = forwardRef(RadioGroup);\n\n(_RadioGroup as any).cubeInputType = 'RadioGroup';\n_RadioGroup.displayName = 'RadioGroup';\n\nexport { _RadioGroup as RadioGroup };\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,MAAMmC,oBAAoB/B,MAAM;CAC9BgC,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,YAAY;EACZC,cAAc;EACdC,MAAM;GACJ,IAAI;GACJC,YAAY;GACZ,qBAAqB;EACvB;EACAC,SAAS;GACP,IAAI;GACJC,MAAM;EACR;EAKAC,WAAW;EACXC,QAAQ;EACRC,MAAM;GACJ,IAAI;GACJ,mBAAmB;EACrB;EACAC,OAAO;GACL,IAAI;GAGJ,cAAc;EAChB;EACAC,YAAY;EACZC,KAAK;GACH,IAAI;GACJC,QAAQ;GACRP,MAAM;EACR;EACAQ,YAAY;EAKZC,SAAS;GACP,IAAI;GACJ,6BACE;EACJ;CACF;AACF,CAAC;;;;;;AAOD,SAASC,uBAAuB1B,OAAsB;CACpD,IAAI2B,UAAUvD,iBAAiB;CAE/B,OACEuD,mBAAmBC,oBACnBD,QAAQrB,SAAS,WACjBqB,QAAQ3B,UAAUA,SAClB2B,QAAQE,aAAa,eAAe,MAAM;AAE9C;AAEA,SAAAC,WAAAC,UAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACE,IAAAnC,cAAkBgC,SAAQhC;CAAa,IAAAoC;CAAA,IAAAF,EAAA,OAAAF,UAAA;EAG5BI,KAAAjD,wBAAwB6C,UAAU,IAAI;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAlDF,WAAWA;CAAH,IAAAK;CAAA,IAAAH,EAAA,OAAAI,OAAAC,IAAA,2BAAA,GAAA;EAC4BF,KAAA,EAAAG,0BA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S,OAAAF;GASN5B;EACH,CAAA;EAAwBf,EAAA,MAAAe;EAAAf,EAAA,MAAA2C;EAAA3C,EAAA,MAAA6C;CAAA,OAAAA,KAAA7C,EAAA;CAAA,IAAA8C;CAAA,IAAA9C,EAAA,QAAA0C,MAAA1C,EAAA,QAAA6C,IAAA;EAnB1BC,MAAA,oBAAC,eAAD;GACS,OAAAJ;GAOPG,UAAAA;EARY,CAAA;EAoBE7C,EAAA,MAAA0C;EAAA1C,EAAA,MAAA6C;EAAA7C,EAAA,MAAA8C;CAAA,OAAAA,MAAA9C,EAAA;CA5CpB,MAAA+C,aACE,oBAAC,mBAAD;EACO3B,KAAAA;EAAM,GAGPpE,aAAWiF,YAAYQ,eAAe;EAC/BV;EAGPvB;EACA,IAAAjC,MAAA;EACIC;EACQ,mBAAA;EACS,2BAAAH,SAAS,WAAT,KAAA8C,KAAAA;EACnB,MAAA;GAAAtC,YACQf,gBAAgB;GAAY,eACzBkD;GAAU,cACXL,kBAAkB;GAAMrB,QAC9BjB,SAAS;GAAQU,MACnBV,SAAS;GAAM2E,SACZT;GAAoB,cACflB,YAAW4B;EAC3B;EAEAH,UAAAA;CAvBgB,CAAA;CA6ClB,OAEKxF,cAAcyF,YAAY;EAAA,GAC5BxC;EAAK,GACLc,YAAW6B;EAAMjC,YACRjE,aAAWkE,gBAAgBD,UAAU;CACnD,CAAC;AAAC;;;;;AAOJ,MAAMkC,cAAc3G,WAAWqD,UAAU;AAEzC,YAAqBuD,gBAAgB;AACrCD,YAAYE,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-5a0d20c | Cube Dev Team */
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
//#region src/components/fields/RadioGroup/context.ts
|
|
4
4
|
const RadioContext = createContext(null);
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { FieldBaseProps, TextFieldKeyboardProps } from "../../../shared/form.js";
|
|
3
3
|
import "../../../shared/index.js";
|
|
4
4
|
import { CollectionItem as _CollectionItem } from "../../CollectionItem.js";
|
|
5
|
-
import {
|
|
5
|
+
import { FieldLayoutStyleProps } from "../../form/field-layout.js";
|
|
6
|
+
import { BasePropsWithoutChildren, Styles } from "@tenphi/tasty";
|
|
6
7
|
import { ForwardedRef, ReactElement, ReactNode, RefObject } from "react";
|
|
7
8
|
import { Section } from "react-stately";
|
|
8
9
|
import { FocusableRef, Key as Key$1 } from "@react-types/shared";
|
|
9
10
|
//#region src/components/fields/SearchComboBox/SearchComboBox.d.ts
|
|
10
11
|
type FilterFn = (textValue: string, inputValue: string) => boolean;
|
|
11
12
|
export type PopoverTriggerAction = 'focus' | 'input' | 'manual';
|
|
12
|
-
export interface CubeSearchComboBoxProps<T> extends BasePropsWithoutChildren,
|
|
13
|
+
export interface CubeSearchComboBoxProps<T> extends BasePropsWithoutChildren, FieldLayoutStyleProps, Omit<FieldBaseProps, 'name' | 'form' | 'rules' | 'shouldUpdate' | 'validationDelay' | 'validateTrigger' | 'insideForm' | 'idPrefix'> {
|
|
13
14
|
/**
|
|
14
15
|
* Callback fired when the user picks a suggestion from the list.
|
|
15
16
|
* Receives the option key and its text value. The input is cleared afterwards.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
2
|
-
import { extractStyles } from "../../../utils/styles.js";
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5a0d20c | Cube Dev Team */
|
|
3
2
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
3
|
import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
|
|
5
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -17,6 +16,7 @@ import { getValidationMods } from "../../form/validation/resolve-validation-prop
|
|
|
17
16
|
import { useValidationProps } from "../../form/validation/use-validation-props.js";
|
|
18
17
|
import { getValidationIcon } from "../../form/validation/ValidationIndicator.js";
|
|
19
18
|
import { wrapWithField } from "../../form/wrapper.js";
|
|
19
|
+
import { splitFieldLayout } from "../../form/field-layout.js";
|
|
20
20
|
import { getListBoxOptionId } from "../ListBox/optionId.js";
|
|
21
21
|
import { filterCollectionNodes, getEdgeVisibleKey, getNextVisibleKey, getVisibleKeys, markKeyboardFocus } from "../ListBoxPopover/listNavigation.js";
|
|
22
22
|
import { DEFAULT_INPUT_STYLES, INPUT_WRAPPER_STYLES } from "../TextInput/TextInputBase.js";
|
|
@@ -24,7 +24,7 @@ import { SearchIcon } from "../../../icons/SearchIcon.js";
|
|
|
24
24
|
import { ListBoxPopover } from "../ListBoxPopover/ListBoxPopover.js";
|
|
25
25
|
import { useCompositeFocus } from "../ListBoxPopover/useCompositeFocus.js";
|
|
26
26
|
import { c } from "react/compiler-runtime";
|
|
27
|
-
import {
|
|
27
|
+
import { tasty } from "@tenphi/tasty";
|
|
28
28
|
import { forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
29
29
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
30
30
|
import { useFilter, useKeyboard } from "react-aria";
|
|
@@ -38,11 +38,6 @@ const InputElement = tasty({
|
|
|
38
38
|
as: "input",
|
|
39
39
|
styles: DEFAULT_INPUT_STYLES
|
|
40
40
|
});
|
|
41
|
-
const PROP_STYLES = [
|
|
42
|
-
...BASE_STYLES,
|
|
43
|
-
...OUTER_STYLES,
|
|
44
|
-
...COLOR_STYLES
|
|
45
|
-
];
|
|
46
41
|
function useDelayedFlag(active, delay) {
|
|
47
42
|
const $ = c(4);
|
|
48
43
|
const [flag, setFlag] = useState(false);
|
|
@@ -107,7 +102,7 @@ const SearchComboBox = forwardRef(function SearchComboBox(props, ref) {
|
|
|
107
102
|
props = useProviderProps(props);
|
|
108
103
|
props = useValidationProps(props);
|
|
109
104
|
const { t } = useI18n();
|
|
110
|
-
let { qa, label, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, id, icon, prefix, isDisabled, autoFocus, autoComplete = "off", wrapperRef, inputRef, triggerRef, popoverRef, listBoxRef, isLoading, loadingDelay = 1e3, inputStyles, optionStyles, triggerStyles, listBoxStyles, overlayStyles, suffix, hideTrigger = true, message, description, size = "medium", direction = "bottom", shouldFlip = true, popoverTrigger = "input", suffixPosition = "before", filter, styles, labelSuffix, inputValue, defaultInputValue, onInputChange, isClearable = true, onClear, placeholder, emptyLabel, onSelect, onSubmit, items, children: renderChildren, sectionStyles, headingStyles, listGap, isReadOnly, overlayOffset = 8, containerPadding = 8, onOpenChange, onFocus, onBlur, onKeyDown, disabledKeys
|
|
105
|
+
let { qa, label, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, id, icon, prefix, isDisabled, autoFocus, autoComplete = "off", wrapperRef, inputRef, triggerRef, popoverRef, listBoxRef, isLoading, loadingDelay = 1e3, inputStyles, optionStyles, triggerStyles, listBoxStyles, overlayStyles, suffix, hideTrigger = true, message, description, size = "medium", direction = "bottom", shouldFlip = true, popoverTrigger = "input", suffixPosition = "before", filter, styles, labelSuffix, inputValue, defaultInputValue, onInputChange, isClearable = true, onClear, placeholder, emptyLabel, onSelect, onSubmit, items, children: renderChildren, sectionStyles, headingStyles, listGap, isReadOnly, overlayOffset = 8, containerPadding = 8, onOpenChange, onFocus, onBlur, onKeyDown, disabledKeys } = props;
|
|
111
106
|
const searchComboBoxId = useMemo(() => generateRandomId(), []);
|
|
112
107
|
wrapperRef = useCombinedRefs(wrapperRef, ref);
|
|
113
108
|
popoverRef = useCombinedRefs(popoverRef);
|
|
@@ -115,7 +110,8 @@ const SearchComboBox = forwardRef(function SearchComboBox(props, ref) {
|
|
|
115
110
|
const [internalInputValue, setInternalInputValue] = useState(defaultInputValue ?? "");
|
|
116
111
|
const effectiveInputValue = isControlledInput ? inputValue : internalInputValue;
|
|
117
112
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
118
|
-
|
|
113
|
+
const fieldLayout = splitFieldLayout(props);
|
|
114
|
+
styles = fieldLayout.styles;
|
|
119
115
|
inputRef = useCombinedRefs(inputRef);
|
|
120
116
|
triggerRef = useCombinedRefs(triggerRef);
|
|
121
117
|
listBoxRef = useCombinedRefs(listBoxRef);
|
|
@@ -326,7 +322,7 @@ const SearchComboBox = forwardRef(function SearchComboBox(props, ref) {
|
|
|
326
322
|
else prefix = icon;
|
|
327
323
|
}
|
|
328
324
|
const showClearButton = isClearable && effectiveInputValue !== "" && !isDisabled && !isReadOnly;
|
|
329
|
-
const mods =
|
|
325
|
+
const mods = {
|
|
330
326
|
...getValidationMods({
|
|
331
327
|
isInvalid,
|
|
332
328
|
isValid
|
|
@@ -338,15 +334,7 @@ const SearchComboBox = forwardRef(function SearchComboBox(props, ref) {
|
|
|
338
334
|
prefix: !!prefix,
|
|
339
335
|
suffix: true,
|
|
340
336
|
clearable: showClearButton
|
|
341
|
-
}
|
|
342
|
-
isInvalid,
|
|
343
|
-
isValid,
|
|
344
|
-
isDisabled,
|
|
345
|
-
isFocused,
|
|
346
|
-
showLoading,
|
|
347
|
-
prefix,
|
|
348
|
-
showClearButton
|
|
349
|
-
]);
|
|
337
|
+
};
|
|
350
338
|
const searchComboBoxWidth = wrapperRef?.current?.offsetWidth;
|
|
351
339
|
useLayoutEffect(() => {
|
|
352
340
|
if (!shouldShowPopover) return;
|
|
@@ -487,7 +475,10 @@ const SearchComboBox = forwardRef(function SearchComboBox(props, ref) {
|
|
|
487
475
|
]
|
|
488
476
|
});
|
|
489
477
|
const { children: _, ...propsWithoutChildren } = props;
|
|
490
|
-
return wrapWithField(searchComboBoxField,
|
|
478
|
+
return wrapWithField(searchComboBoxField, {
|
|
479
|
+
...propsWithoutChildren,
|
|
480
|
+
...fieldLayout.field
|
|
481
|
+
});
|
|
491
482
|
});
|
|
492
483
|
SearchComboBox.Item = _CollectionItem;
|
|
493
484
|
SearchComboBox.Section = Section;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchComboBox.js","names":["KeyboardEvent","AriaKeyboardEvent","FocusableRef","Key","BASE_STYLES","BasePropsWithoutChildren","BaseStyleProps","COLOR_STYLES","ColorStyleProps","OUTER_STYLES","OuterStyleProps","Styles","tasty","React","cloneElement","ForwardedRef","forwardRef","ReactElement","ReactNode","RefObject","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFilter","useKeyboard","Section","BaseSection","useListState","useEvent","useI18n","CloseIcon","DirectionIcon","LoadingIcon","SearchIcon","useProviderProps","FieldBaseProps","TextFieldKeyboardProps","generateRandomId","useCombinedRefs","useFocus","settleOverlayKey","usePopoverSync","extractStyles","CollectionItem","Item","getValidationIcon","getValidationMods","useValidationProps","wrapWithField","asksForFieldChrome","withFieldChrome","getListBoxOptionId","filterCollectionNodes","getEdgeVisibleKey","getNextVisibleKey","getVisibleKeys","ListBoxPopover","ListStateLike","markKeyboardFocus","useCompositeFocus","DEFAULT_INPUT_STYLES","INPUT_WRAPPER_STYLES","FilterFn","textValue","inputValue","PopoverTriggerAction","SearchComboBoxWrapperElement","qa","styles","InputElement","as","CubeSearchComboBoxProps","Omit","onSelect","key","onSubmit","value","emptyLabel","defaultInputValue","onInputChange","placeholder","autoFocus","autoComplete","onFocus","onBlur","onKeyDown","popoverTrigger","items","Iterable","T","children","item","filter","isClearable","onClear","icon","prefix","suffix","hideTrigger","size","inputRef","HTMLInputElement","wrapperRef","HTMLDivElement","listBoxRef","popoverRef","triggerRef","HTMLButtonElement","inputStyles","triggerStyles","listBoxStyles","overlayStyles","optionStyles","sectionStyles","headingStyles","listGap","isDisabled","isLoading","loadingDelay","disabledKeys","shouldFlip","direction","overlayOffset","containerPadding","isReadOnly","suffixPosition","onOpenChange","isOpen","PROP_STYLES","useDelayedFlag","active","delay","$","_c","flag","setFlag","t0","t1","id","setTimeout","clearTimeout","SearchComboBoxInputProps","mods","Record","keyboardProps","focusProps","onChange","e","ChangeEvent","FocusEvent","isExpanded","searchComboBoxId","listStateRef","SearchComboBoxInput","ref","combinedRef","undefined","current","selectionManager","focusedKey","SearchComboBox","props","t","label","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","message","description","labelSuffix","renderChildren","otherProps","isControlledInput","internalInputValue","setInternalInputValue","effectiveInputValue","isPopoverOpen","setIsPopoverOpen","isFilterActive","setIsFilterActive","contains","sensitivity","textFilterFn","filterFn","nodes","term","trim","localCollectionState","selectionMode","isFocused","validationIcon","setFocusTick","bumpFocus","getItemLabel","collection","getItem","String","showLoading","hasResults","node","type","childNodes","length","disabledKeySet","Set","Array","from","visibleItemKeys","keys","walk","has","push","trimmedInput","shouldShowPopover","Boolean","menuId","onClose","HTMLElement","containerRef","suppressFocusOpenRef","clearAndClose","focus","handleSelectionChange","selection","isArray","handleSubmit","clearValue","handleInputChange","target","trimmed","handleInputFocus","handleCompositeBlur","compositeFocusProps","focusOption","listState","setFocusedKey","handleArrowKey","preventDefault","getKeyToSelect","visibleKeys","includes","handleEnterKey","keyToSelect","select","handleEscapeKey","handleEdgeKey","isDefaultPrevented","showClearButton","disabled","hovered","focused","loading","clearable","searchComboBoxWidth","offsetWidth","attempts","timer","ReturnType","applyFocus","isFocusValid","resolvedEmptyLabel","searchComboBoxField","pressed","willOpen","_","propsWithoutChildren","_c","useFocus","Item","BaseSection"],"sources":["../../../../src/components/fields/SearchComboBox/SearchComboBox.tsx"],"sourcesContent":["import {\n KeyboardEvent as AriaKeyboardEvent,\n FocusableRef,\n Key,\n} from '@react-types/shared';\nimport {\n BASE_STYLES,\n BasePropsWithoutChildren,\n BaseStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport React, {\n cloneElement,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useKeyboard } from 'react-aria';\nimport { Section as BaseSection, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { SearchIcon } from '../../../icons/SearchIcon';\nimport { useProviderProps } from '../../../provider';\nimport { FieldBaseProps, TextFieldKeyboardProps } from '../../../shared';\nimport { generateRandomId } from '../../../utils/random';\nimport { useCombinedRefs } from '../../../utils/react';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { settleOverlayKey } from '../../../utils/react/overlayKeyPropagation';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { extractStyles } from '../../../utils/styles';\nimport { CollectionItem as Item } from '../../CollectionItem';\nimport {\n getValidationIcon,\n getValidationMods,\n useValidationProps,\n wrapWithField,\n} from '../../form';\nimport { asksForFieldChrome, withFieldChrome } from '../../form/field-chrome';\nimport { getListBoxOptionId } from '../ListBox/optionId';\nimport {\n filterCollectionNodes,\n getEdgeVisibleKey,\n getNextVisibleKey,\n getVisibleKeys,\n ListBoxPopover,\n ListStateLike,\n markKeyboardFocus,\n useCompositeFocus,\n} from '../ListBoxPopover';\nimport {\n DEFAULT_INPUT_STYLES,\n INPUT_WRAPPER_STYLES,\n} from '../TextInput/TextInputBase';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport type PopoverTriggerAction = 'focus' | 'input' | 'manual';\n\nconst SearchComboBoxWrapperElement = tasty({\n qa: 'SearchComboBoxWrapper',\n styles: INPUT_WRAPPER_STYLES,\n});\n\nconst InputElement = tasty({\n as: 'input',\n styles: DEFAULT_INPUT_STYLES,\n});\n\nexport interface CubeSearchComboBoxProps<T>\n extends\n BasePropsWithoutChildren,\n BaseStyleProps,\n OuterStyleProps,\n ColorStyleProps,\n // SearchComboBox is not form-connected: it holds no persistent value, so\n // form-binding and form-validation props are excluded from the public API.\n Omit<\n FieldBaseProps,\n | 'name'\n | 'form'\n | 'rules'\n | 'shouldUpdate'\n | 'validationDelay'\n | 'validateTrigger'\n | 'insideForm'\n | 'idPrefix'\n > {\n /**\n * Callback fired when the user picks a suggestion from the list.\n * Receives the option key and its text value. The input is cleared afterwards.\n */\n onSelect?: (key: string, textValue: string) => void;\n /**\n * Opt-in callback fired when the user presses Enter while no suggestion is\n * visible (the popover has no results). Receives the trimmed input text. The\n * input is cleared afterwards. When suggestions are visible, Enter selects the\n * top result via `onSelect` instead. When not provided, Enter with no visible\n * suggestion is a no-op.\n */\n onSubmit?: (value: string) => void;\n /**\n * Label displayed when the list is empty (no results). Defaults to a\n * context-aware \"No results found\" / \"Loading…\" message.\n */\n emptyLabel?: ReactNode;\n\n /** The input value in controlled mode */\n inputValue?: string;\n /** The default input value in uncontrolled mode */\n defaultInputValue?: string;\n /** Callback fired when input value changes */\n onInputChange?: (value: string) => void;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input should have autofocus */\n autoFocus?: boolean;\n /** HTML autocomplete attribute for the input */\n autoComplete?: string;\n /** Callback fired when focus enters the component (input or popover). Does not receive event object. */\n onFocus?: () => void;\n /** Callback fired when focus leaves the component entirely. Does not receive event object. */\n onBlur?: () => void;\n /**\n * Callback fired when a key is pressed on the input, before the built-in\n * key handling. Receives React Aria's keyboard event: `e.preventDefault()`\n * skips the built-in handling for the key. `Escape` and `Tab` go on to\n * ancestors, such as a surrounding dialog, unless SearchComboBox acts on\n * them or the handler prevents them. It acts on `Escape` while the list is\n * open or the input has text: it closes the list, or clears the text, or,\n * when not clearable, keeps the browser from clearing it. Other keys stop\n * at the input unless the handler calls `e.continuePropagation()`.\n */\n onKeyDown?: TextFieldKeyboardProps['onKeyDown'];\n\n /** Popover trigger behavior: 'focus', 'input', or 'manual'. Defaults to 'input' */\n popoverTrigger?: PopoverTriggerAction;\n\n /** Items for the listbox (alternative to children) */\n items?: Iterable<T>;\n /** Children for the listbox (static items or render function) */\n children?: ReactNode | ((item: T) => ReactElement);\n\n /**\n * Custom filter function for determining if an option should be included.\n * Pass `false` to disable internal filtering completely (external/server-side filtering).\n */\n filter?: FilterFn | false;\n\n /** Whether the search combobox is clearable using ESC key or clear button. Defaults to true. */\n isClearable?: boolean;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n\n /** Left input icon. Defaults to a search icon. */\n icon?: ReactElement | null;\n /** Input decoration before the main input */\n prefix?: ReactNode;\n /** Input decoration after the main input */\n suffix?: ReactNode;\n /** Whether to show the trigger button. Hidden by default (search field look). */\n hideTrigger?: boolean;\n /** Size of the search combobox */\n size?: 'small' | 'medium' | 'large' | (string & {});\n\n /** Ref for accessing the input element */\n inputRef?: RefObject<HTMLInputElement | null>;\n /** Ref for accessing the wrapper element */\n wrapperRef?: RefObject<HTMLDivElement>;\n /** Ref for accessing the listbox element */\n listBoxRef?: RefObject<HTMLDivElement>;\n /** Ref for accessing the popover element */\n popoverRef?: RefObject<HTMLDivElement>;\n /** Ref for accessing the trigger button element */\n triggerRef?: FocusableRef<HTMLButtonElement>;\n\n /** Custom styles for the input */\n inputStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Custom styles for the listbox */\n listBoxStyles?: Styles;\n /** Custom styles for the popover overlay */\n overlayStyles?: Styles;\n /** Custom styles for individual options */\n optionStyles?: Styles;\n /** Custom styles for sections */\n sectionStyles?: Styles;\n /** Custom styles for section headings */\n headingStyles?: Styles;\n /** Space between options, in pixels. Defaults to a hairline (`$item-gap`, `1px`). */\n listGap?: number;\n\n /** Whether the search combobox is disabled */\n isDisabled?: boolean;\n /**\n * Whether items are being loaded (e.g. from a server). While loading, the\n * previous results stay visible; the loading indicator only appears after\n * `loadingDelay` to avoid flicker on fast responses.\n */\n isLoading?: boolean;\n /** Delay in milliseconds before the loading indicator is shown. Defaults to 1000. */\n loadingDelay?: number;\n /** Keys of disabled items */\n disabledKeys?: Iterable<Key>;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /** Placement direction for the popover */\n direction?: 'bottom' | 'top';\n /** Offset for the popover */\n overlayOffset?: number;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /** Whether the search combobox is read-only */\n isReadOnly?: boolean;\n /** Suffix position goes before or after the validation and loading statuses */\n suffixPosition?: 'before' | 'after';\n /** Callback called when the popover open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nconst PROP_STYLES = [...BASE_STYLES, ...OUTER_STYLES, ...COLOR_STYLES];\n\n// ============================================================================\n// Hook: useDelayedFlag\n// ----------------------------------------------------------------------------\n// Turns `true` only after `delay` ms of `active` staying true, and back to\n// `false` immediately when `active` becomes false. Used to defer the loading\n// indicator so fast responses never flash a loading state.\n// ============================================================================\nfunction useDelayedFlag(active: boolean, delay: number): boolean {\n const [flag, setFlag] = useState(false);\n\n useEffect(() => {\n if (!active) {\n setFlag(false);\n return;\n }\n\n if (delay <= 0) {\n setFlag(true);\n return;\n }\n\n const id = setTimeout(() => setFlag(true), delay);\n return () => clearTimeout(id);\n }, [active, delay]);\n\n return flag;\n}\n\n// ============================================================================\n// Component: SearchComboBoxInput\n// ============================================================================\ninterface SearchComboBoxInputProps {\n qa?: string;\n inputRef: RefObject<HTMLInputElement | null>;\n id?: string;\n value: string;\n placeholder?: string;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n autoFocus?: boolean;\n autoComplete?: string;\n size: string;\n mods: Record<string, any>;\n inputStyles?: Styles;\n keyboardProps: any;\n focusProps: any;\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;\n /** Whether the listbox popover is actually visible (results, loading, or empty state). */\n isExpanded: boolean;\n searchComboBoxId: string;\n listStateRef: RefObject<any>;\n}\n\nconst SearchComboBoxInput = forwardRef<\n HTMLInputElement,\n SearchComboBoxInputProps\n>(function SearchComboBoxInput(\n {\n qa,\n inputRef,\n id,\n value,\n placeholder,\n isDisabled,\n isReadOnly,\n autoFocus,\n autoComplete,\n size,\n mods,\n inputStyles,\n keyboardProps,\n focusProps,\n onChange,\n onFocus,\n isExpanded,\n searchComboBoxId,\n listStateRef,\n },\n ref,\n) {\n const combinedRef = useCombinedRefs(ref, inputRef);\n\n return (\n <InputElement\n ref={combinedRef}\n qa={qa}\n id={id}\n type=\"search\"\n value={value}\n placeholder={placeholder}\n isDisabled={isDisabled}\n readOnly={isReadOnly}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={focusProps.onBlur}\n {...keyboardProps}\n styles={inputStyles}\n mods={mods}\n data-size={size}\n data-input-type=\"searchcombobox\"\n role=\"combobox\"\n aria-expanded={isExpanded}\n aria-haspopup=\"listbox\"\n aria-controls={\n isExpanded ? `SearchComboBoxListBox-${searchComboBoxId}` : undefined\n }\n aria-activedescendant={\n isExpanded && listStateRef.current?.selectionManager.focusedKey != null\n ? getListBoxOptionId(\n `SearchComboBoxListBox-${searchComboBoxId}`,\n listStateRef.current.selectionManager.focusedKey,\n )\n : undefined\n }\n />\n );\n});\n\n// ============================================================================\n// Main Component: SearchComboBox\n// ============================================================================\nexport const SearchComboBox = forwardRef(function SearchComboBox<\n T extends object,\n>(props: CubeSearchComboBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // SearchComboBox is a standalone control, not a form field, so it does not use `useFieldProps`.\n // Without a label, it still shows a description or message under the control.\n if (asksForFieldChrome(props)) props = withFieldChrome(props);\n props = useProviderProps(props);\n props = useValidationProps(props);\n\n const { t } = useI18n();\n\n let {\n qa,\n label,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n id,\n icon,\n prefix,\n isDisabled,\n autoFocus,\n autoComplete = 'off',\n wrapperRef,\n inputRef,\n triggerRef,\n popoverRef,\n listBoxRef,\n isLoading,\n loadingDelay = 1000,\n inputStyles,\n optionStyles,\n triggerStyles,\n listBoxStyles,\n overlayStyles,\n suffix,\n hideTrigger = true,\n message,\n description,\n size = 'medium',\n direction = 'bottom',\n shouldFlip = true,\n popoverTrigger = 'input',\n suffixPosition = 'before',\n filter,\n styles,\n labelSuffix,\n inputValue,\n defaultInputValue,\n onInputChange,\n isClearable = true,\n onClear,\n placeholder,\n emptyLabel,\n onSelect,\n onSubmit,\n items,\n children: renderChildren,\n sectionStyles,\n headingStyles,\n listGap,\n isReadOnly,\n overlayOffset = 8,\n containerPadding = 8,\n onOpenChange,\n onFocus,\n onBlur,\n onKeyDown,\n disabledKeys,\n ...otherProps\n } = props;\n\n // Generate a unique ID for this instance\n const searchComboBoxId = useMemo(() => generateRandomId(), []);\n\n // Normalize the wrapper/popover refs above popover-sync so it sees stable refs.\n // The field's ref is the wrapper's, with or without the field chrome.\n wrapperRef = useCombinedRefs(wrapperRef, ref);\n popoverRef = useCombinedRefs(popoverRef);\n\n // Input value state (controlled/uncontrolled)\n const isControlledInput = inputValue !== undefined;\n const [internalInputValue, setInternalInputValue] = useState(\n defaultInputValue ?? '',\n );\n const effectiveInputValue = isControlledInput\n ? (inputValue as string)\n : internalInputValue;\n\n // Popover state — open *intent*. The overlay is gated separately by\n // `shouldShowPopover` (results / delayed loading / empty-query state).\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n\n styles = extractStyles(otherProps, PROP_STYLES, styles);\n\n inputRef = useCombinedRefs(inputRef);\n triggerRef = useCombinedRefs(triggerRef);\n listBoxRef = useCombinedRefs(listBoxRef);\n\n const children = renderChildren as ReactNode;\n\n // Filtering\n const [isFilterActive, setIsFilterActive] = useState(false);\n const { contains } = useFilter({ sensitivity: 'base' });\n\n const textFilterFn = useMemo<FilterFn>(\n () => (filter === false ? () => true : filter || contains),\n [filter, contains],\n );\n\n const filterFn = useCallback(\n (nodes: Iterable<any>) => {\n const term = effectiveInputValue.trim();\n\n if (!isFilterActive || !term) {\n return nodes;\n }\n\n return filterCollectionNodes(nodes, term, textFilterFn);\n },\n [isFilterActive, effectiveInputValue, textFilterFn],\n );\n\n // Local collection state for reading item labels (textValue) before/without a selection.\n const localCollectionState = useListState({\n children: children as any,\n items,\n selectionMode: 'none',\n });\n\n const { isFocused, focusProps } = useFocus();\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n const listStateRef = useRef<any>(null);\n // Bumped whenever we move the virtual focus so the input's\n // `aria-activedescendant` (read from the ListBox's stateRef at render time)\n // stays in sync — the ListBox's own state update does not re-render us.\n const [, setFocusTick] = useState(0);\n const bumpFocus = useEvent(() => setFocusTick((t) => t + 1));\n\n const getItemLabel = useCallback(\n (key: Key): string => {\n const item = localCollectionState?.collection?.getItem(key);\n return item?.textValue || String(key);\n },\n [localCollectionState?.collection],\n );\n\n // Delayed loading indicator\n const showLoading = useDelayedFlag(!!isLoading, loadingDelay);\n\n // Check if there are any results after filtering\n const hasResults = useMemo(() => {\n const collection = localCollectionState?.collection;\n if (!collection) return false;\n\n for (const node of filterFn(collection) as Iterable<any>) {\n if (node.type === 'section') {\n if (node.childNodes && [...node.childNodes].length > 0) return true;\n } else {\n return true;\n }\n }\n\n return false;\n }, [localCollectionState?.collection, filterFn]);\n\n const disabledKeySet = useMemo(\n () => new Set<Key>(disabledKeys ? Array.from(disabledKeys) : []),\n [disabledKeys],\n );\n\n // Flat list of selectable keys after filtering. Doubles as the dependency\n // that re-triggers auto-focus whenever the visible results change.\n const visibleItemKeys = useMemo(() => {\n const collection = localCollectionState?.collection;\n const keys: Key[] = [];\n if (!collection) return keys;\n\n const walk = (nodes: Iterable<any>) => {\n for (const node of nodes) {\n if (node.type === 'item') {\n if (!disabledKeySet.has(node.key)) keys.push(node.key);\n } else if (node.childNodes) {\n walk(node.childNodes);\n }\n }\n };\n\n walk(filterFn(collection) as Iterable<any>);\n return keys;\n }, [localCollectionState?.collection, filterFn, disabledKeySet]);\n\n const trimmedInput = effectiveInputValue.trim();\n\n // Keep the popover visible while there's something meaningful to show:\n // results, a loading indicator, or an empty state for a non-empty query.\n // While a load is in flight but the delayed indicator hasn't kicked in yet,\n // suppress the empty state so users never see a false \"No results found\".\n //\n // `isPopoverOpen` can still be true while this is false (loading delay with\n // no results, or opening an empty collection). Sync, notifications, and\n // keyboard commit must key off *this* flag so we never advertise or act on\n // an invisible overlay (incl. stale keys left in `listStateRef`).\n const shouldShowPopover = Boolean(\n isPopoverOpen &&\n (hasResults || showLoading || (trimmedInput.length > 0 && !isLoading)),\n );\n\n usePopoverSync({\n menuId: searchComboBoxId,\n isOpen: shouldShowPopover,\n onClose: () => setIsPopoverOpen(false),\n triggerRef: wrapperRef as RefObject<HTMLElement | null>,\n containerRef: popoverRef as RefObject<HTMLElement | null>,\n });\n\n // Notify when the overlay is actually shown/hidden, not merely intended open.\n useEffect(() => {\n onOpenChange?.(shouldShowPopover);\n }, [shouldShowPopover]);\n\n // When we programmatically return focus to the input after a commit, the\n // resulting focus event must not reopen the popover (relevant for\n // `popoverTrigger=\"focus\"`). Consumed once by `handleInputFocus`.\n const suppressFocusOpenRef = useRef(false);\n\n // Shared tail for commit actions (select/submit): reset the filter, clear the\n // input, close the popover, and return focus to the input.\n const clearAndClose = useEvent(() => {\n setIsFilterActive(false);\n\n if (!isControlledInput) {\n setInternalInputValue('');\n }\n onInputChange?.('');\n\n setIsPopoverOpen(false);\n\n suppressFocusOpenRef.current = true;\n setTimeout(() => {\n inputRef.current?.focus();\n // Clear right after the (synchronous) focus dispatch so a stale flag can\n // never suppress a later, genuine user focus — even if `focus()` was a\n // no-op because the input already held focus.\n suppressFocusOpenRef.current = false;\n }, 0);\n });\n\n // Selection handler — fire onSelect and clear the input.\n const handleSelectionChange = useEvent((selection: Key | Key[] | null) => {\n const key = Array.isArray(selection) ? selection[0] : selection;\n\n if (key != null) {\n const textValue = getItemLabel(key);\n onSelect?.(String(key), textValue);\n }\n\n clearAndClose();\n });\n\n // Submit handler — fire onSubmit and clear the input.\n const handleSubmit = useEvent((value: string) => {\n onSubmit?.(value);\n\n clearAndClose();\n });\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (!isControlledInput) {\n setInternalInputValue('');\n }\n onInputChange?.('');\n\n setIsFilterActive(false);\n\n if (isPopoverOpen) {\n setIsPopoverOpen(false);\n }\n\n // Same suppress as clearAndClose: programmatic refocus must not reopen the\n // popover when popoverTrigger=\"focus\" (e.g. clear button steal+restore focus).\n suppressFocusOpenRef.current = true;\n setTimeout(() => {\n inputRef.current?.focus();\n suppressFocusOpenRef.current = false;\n }, 0);\n\n onClear?.();\n });\n\n // Input change handler\n const handleInputChange = useEvent(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n\n if (!isControlledInput) {\n setInternalInputValue(value);\n }\n onInputChange?.(value);\n\n const trimmed = value.trim();\n setIsFilterActive(trimmed.length > 0);\n\n if (popoverTrigger !== 'manual') {\n if (trimmed && !isPopoverOpen) {\n setIsPopoverOpen(true);\n } else if (!trimmed && isPopoverOpen && popoverTrigger === 'input') {\n setIsPopoverOpen(false);\n }\n }\n },\n );\n\n // Input focus handler\n const handleInputFocus = useEvent((e: React.FocusEvent<HTMLInputElement>) => {\n focusProps.onFocus?.(e as any);\n\n // Skip the focus-triggered open exactly once when we refocused the input\n // ourselves right after a commit, so select/submit truly resets the field.\n if (suppressFocusOpenRef.current) {\n return;\n }\n\n if (popoverTrigger === 'focus' && !isPopoverOpen) {\n setIsPopoverOpen(true);\n }\n });\n\n // Composite blur — fires when focus leaves the whole component.\n // Always clear open intent: while the overlay is suppressed (e.g. loading\n // delay with no results), `useOverlay` is not mounted and cannot dismiss\n // on outside interaction, so blur is the only chance to drop `isPopoverOpen`.\n // Otherwise a late result arrival would flip `shouldShowPopover` true and\n // show the popover after focus has already left.\n const handleCompositeBlur = useEvent(() => {\n setIsFilterActive(false);\n setIsPopoverOpen(false);\n onBlur?.();\n });\n\n const { compositeFocusProps } = useCompositeFocus({\n wrapperRef,\n popoverRef,\n onFocus,\n onBlur: handleCompositeBlur,\n isDisabled,\n });\n\n // ---- keyboard -----------------------------------------------------------\n // Moves the virtual focus to `key`, if there is one, and scrolls it into view.\n const focusOption = (listState: ListStateLike, key: Key | null) => {\n if (key == null) return;\n\n markKeyboardFocus(listState);\n listState.selectionManager.setFocusedKey(key);\n bumpFocus();\n };\n\n const handleArrowKey = (e: AriaKeyboardEvent) => {\n e.preventDefault();\n\n if (!shouldShowPopover) {\n // Open intent may already be set while nothing is shown (loading delay).\n if (!isPopoverOpen) {\n if (!hasResults) setIsFilterActive(false);\n setIsPopoverOpen(true);\n }\n\n return;\n }\n\n const listState = listStateRef.current;\n\n if (listState) {\n focusOption(\n listState,\n getNextVisibleKey(listState, e.key === 'ArrowDown' ? 1 : -1),\n );\n }\n };\n\n // The option Enter commits. Prefer the highlighted option, but only when\n // it's still visible (further typing may have filtered it out); otherwise\n // fall back to the first visible option so typing a match and pressing\n // Enter always selects the top result.\n //\n // `listStateRef` can still be null while the popover is mounting/\n // transitioning. In that window we fall back to the parent-computed\n // `visibleItemKeys` so a matching query commits via `onSelect` instead of\n // leaking through to `onSubmit`.\n const getKeyToSelect = (listState: ListStateLike | null): Key | null => {\n const visibleKeys = listState ? getVisibleKeys(listState) : visibleItemKeys;\n const focusedKey = listState?.selectionManager.focusedKey;\n\n return focusedKey != null && visibleKeys.includes(focusedKey)\n ? focusedKey\n : (visibleKeys[0] ?? null);\n };\n\n // Enter commits an option, else submits the raw text, else does nothing\n // (keeping any empty state visible). It never reaches a surrounding form.\n const handleEnterKey = (e: AriaKeyboardEvent) => {\n e.preventDefault();\n\n // Commit an option only when the overlay is actually shown. Gate on\n // `shouldShowPopover` (not `isPopoverOpen`): during the loading delay or\n // an empty open, intent can be open while nothing is mounted, and a stale\n // `listStateRef` must not be committed.\n const listState = listStateRef.current;\n const keyToSelect = shouldShowPopover ? getKeyToSelect(listState) : null;\n\n if (keyToSelect != null) {\n if (listState) {\n listState.selectionManager.select(keyToSelect, e);\n } else {\n // No mounted list state to route through — commit directly.\n handleSelectionChange(keyToSelect);\n }\n } else if (onSubmit && trimmedInput) {\n handleSubmit(trimmedInput);\n }\n };\n\n const handleEscapeKey = (e: AriaKeyboardEvent) => {\n if (isPopoverOpen) {\n e.preventDefault();\n setIsPopoverOpen(false);\n inputRef.current?.focus();\n } else if (effectiveInputValue) {\n // Always preventDefault: type=\"search\" clears natively on Escape\n // unless cancelled, which would bypass isClearable={false}.\n e.preventDefault();\n if (isClearable) clearValue();\n }\n };\n\n const handleEdgeKey = (e: AriaKeyboardEvent) => {\n if (!shouldShowPopover) return;\n\n e.preventDefault();\n\n const listState = listStateRef.current;\n\n if (listState) {\n focusOption(\n listState,\n getEdgeVisibleKey(listState, e.key === 'Home' ? 'first' : 'last'),\n );\n }\n };\n\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n // The user's handler runs first, and a key it prevents is theirs: skip\n // the built-in handling. Read `isDefaultPrevented()`, not\n // `defaultPrevented` — `useKeyboard` hands over a copy of the event whose\n // `defaultPrevented` field is fixed at the moment it was made.\n onKeyDown?.(e);\n\n if (!e.isDefaultPrevented()) {\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n handleArrowKey(e);\n break;\n case 'Enter':\n handleEnterKey(e);\n break;\n case 'Escape':\n handleEscapeKey(e);\n break;\n case 'Home':\n case 'End':\n handleEdgeKey(e);\n break;\n }\n }\n\n // An `Escape` that closed the list or cleared the text is prevented and\n // stays; otherwise it, and `Tab`, go on to a surrounding dialog.\n settleOverlayKey(e);\n },\n });\n\n if (icon === undefined) {\n icon = <SearchIcon />;\n }\n\n if (icon) {\n icon = <div data-element=\"InputIcon\">{icon}</div>;\n\n if (prefix) {\n prefix = (\n <>\n {icon}\n {prefix}\n </>\n );\n } else {\n prefix = icon;\n }\n }\n\n const showClearButton =\n isClearable && effectiveInputValue !== '' && !isDisabled && !isReadOnly;\n\n const mods = useMemo(\n () => ({\n ...getValidationMods({ isInvalid, isValid }),\n disabled: isDisabled,\n // Hover is handled purely via CSS `:hover`, so it never flows through mods.\n hovered: false,\n focused: isFocused,\n loading: showLoading,\n prefix: !!prefix,\n // Always reserve the suffix slot (it holds validation/loading/clear/trigger).\n suffix: true,\n clearable: showClearButton,\n }),\n [\n isInvalid,\n isValid,\n isDisabled,\n isFocused,\n showLoading,\n prefix,\n showClearButton,\n ],\n );\n\n const searchComboBoxWidth = wrapperRef?.current?.offsetWidth;\n\n // Highlight the first visible suggestion when the popover opens or when the\n // filtered results change, so the top match is visibly pre-selected (parity\n // with ComboBox's initial-focus behaviour). The user's own highlight is left\n // untouched while the focused option is still visible; a missing or\n // filtered-out focus falls back to the first visible key. This only drives\n // the visual highlight — Enter always resolves the option itself, so\n // correctness never depends on this effect's timing.\n useLayoutEffect(() => {\n if (!shouldShowPopover) return;\n\n let attempts = 0;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const applyFocus = () => {\n if (!shouldShowPopover) return;\n\n const listState = listStateRef.current;\n\n if (listState) {\n const keys = getVisibleKeys(listState);\n\n if (keys.length > 0) {\n const focusedKey = listState.selectionManager.focusedKey;\n const isFocusValid = focusedKey != null && keys.includes(focusedKey);\n\n if (!isFocusValid) {\n markKeyboardFocus(listState);\n listState.selectionManager.setFocusedKey(keys[0]);\n bumpFocus();\n }\n\n return;\n }\n }\n\n // The listbox mounts inside a portal/transition, so its state may not be\n // ready on the first tick; retry a few times before giving up.\n attempts += 1;\n if (attempts < 8) {\n timer = setTimeout(applyFocus, 16);\n }\n };\n\n applyFocus();\n\n return () => {\n if (timer != null) clearTimeout(timer);\n };\n }, [shouldShowPopover, visibleItemKeys]);\n\n const resolvedEmptyLabel =\n emptyLabel !== undefined\n ? emptyLabel\n : showLoading\n ? t('searchComboBox.loading', 'Loading…')\n : t('searchComboBox.noResults', 'No results found');\n\n const searchComboBoxField = (\n <SearchComboBoxWrapperElement\n ref={wrapperRef}\n mods={mods}\n styles={styles}\n data-size={size}\n {...compositeFocusProps}\n >\n {prefix ? <div data-element=\"Prefix\">{prefix}</div> : null}\n <SearchComboBoxInput\n qa={qa || 'SearchComboBox'}\n inputRef={inputRef}\n id={id}\n value={effectiveInputValue}\n placeholder={placeholder}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n size={size}\n mods={mods}\n inputStyles={inputStyles}\n keyboardProps={keyboardProps}\n focusProps={focusProps}\n isExpanded={shouldShowPopover}\n searchComboBoxId={searchComboBoxId}\n listStateRef={listStateRef}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n />\n <div data-element=\"Suffix\">\n {suffixPosition === 'before' ? suffix : null}\n {showLoading ? (\n <LoadingIcon data-element=\"InputIcon\" />\n ) : (\n validationIcon\n )}\n {suffixPosition === 'after' ? suffix : null}\n {showClearButton && (\n <Item.Action\n icon={<CloseIcon />}\n size={size}\n // No `theme` — see `ComboBox`: the default `current` type inherits\n // the input's already validation-tinted text color.\n qa=\"SearchComboBoxClearButton\"\n data-no-trigger={hideTrigger ? '' : undefined}\n data-popover-dismiss=\"\"\n aria-label={t('searchComboBox.clearValue', 'Clear value')}\n onPress={clearValue}\n />\n )}\n {!hideTrigger ? (\n <Item.Action\n ref={triggerRef}\n data-popover-trigger\n icon={<DirectionIcon to={shouldShowPopover ? 'up' : 'down'} />}\n qa=\"SearchComboBoxTrigger\"\n mods={{\n pressed: shouldShowPopover,\n disabled: isDisabled,\n loading: showLoading,\n }}\n data-size={size}\n isDisabled={isDisabled}\n styles={triggerStyles}\n aria-expanded={shouldShowPopover}\n aria-haspopup=\"listbox\"\n aria-label={t('searchComboBox.showOptions', 'Show options')}\n onPress={() => {\n if (!isDisabled) {\n const willOpen = !isPopoverOpen;\n setIsPopoverOpen(willOpen);\n if (willOpen) {\n inputRef.current?.focus();\n if (!hasResults) {\n setIsFilterActive(false);\n }\n }\n }\n }}\n />\n ) : null}\n </div>\n <ListBoxPopover\n isOpen={shouldShowPopover}\n triggerRef={wrapperRef as RefObject<HTMLElement>}\n popoverRef={popoverRef}\n listBoxRef={listBoxRef}\n direction={direction}\n shouldFlip={shouldFlip}\n overlayOffset={overlayOffset}\n containerPadding={containerPadding}\n comboBoxWidth={searchComboBoxWidth}\n listBoxId={`SearchComboBoxListBox-${searchComboBoxId}`}\n overlayStyles={overlayStyles}\n listBoxStyles={listBoxStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n selectedKey={null}\n isDisabled={isDisabled}\n disabledKeys={disabledKeys}\n items={items}\n listStateRef={listStateRef}\n label={label}\n ariaLabel={(props as any)['aria-label']}\n compositeFocusProps={compositeFocusProps}\n filter={filterFn}\n size={size}\n emptyLabel={resolvedEmptyLabel}\n onSelectionChange={handleSelectionChange}\n onClose={() => setIsPopoverOpen(false)}\n >\n {children}\n </ListBoxPopover>\n </SearchComboBoxWrapperElement>\n );\n\n const { children: _, ...propsWithoutChildren } = props;\n\n return wrapWithField<Omit<CubeSearchComboBoxProps<T>, 'children'>>(\n searchComboBoxField,\n propsWithoutChildren,\n );\n}) as unknown as (<T>(\n props: CubeSearchComboBoxProps<T> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReactElement) & { Item: typeof Item; Section: typeof BaseSection };\n\nSearchComboBox.Item = Item;\n\nSearchComboBox.Section = BaseSection;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAMqE,+BAA+BzD,MAAM;CACzC0D,IAAI;CACJC,QAAQP;AACV,CAAC;AAED,MAAMQ,eAAe5D,MAAM;CACzB6D,IAAI;CACJF,QAAQR;AACV,CAAC;AA0JD,MAAMoE,cAAc;CAAC,GAAG/H;CAAa,GAAGK;CAAc,GAAGF;AAAY;AASrE,SAAA6H,eAAAC,QAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,MAAAC,WAAwBjH,SAAS,KAAK;CAAE,IAAAkH;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAF,UAAAE,EAAA,OAAAD,OAAA;EAE9BK,WAAA;GACR,IAAI,CAACN,QAAM;IACTK,QAAQ,KAAK;IAAC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ACLuN,qBACAI,oBACF;AACF,CAAC;AAID3G,eAAepH,OAAOA;AAEtBoH,eAAevI,UAAUC"}
|
|
1
|
+
{"version":3,"file":"SearchComboBox.js","names":["KeyboardEvent","AriaKeyboardEvent","FocusableRef","Key","BasePropsWithoutChildren","Styles","tasty","React","cloneElement","ForwardedRef","forwardRef","ReactElement","ReactNode","RefObject","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFilter","useKeyboard","Section","BaseSection","useListState","useEvent","useI18n","CloseIcon","DirectionIcon","LoadingIcon","SearchIcon","useProviderProps","FieldBaseProps","TextFieldKeyboardProps","generateRandomId","useCombinedRefs","useFocus","settleOverlayKey","usePopoverSync","CollectionItem","Item","getValidationIcon","getValidationMods","useValidationProps","wrapWithField","asksForFieldChrome","withFieldChrome","FieldLayoutStyleProps","splitFieldLayout","getListBoxOptionId","filterCollectionNodes","getEdgeVisibleKey","getNextVisibleKey","getVisibleKeys","ListBoxPopover","ListStateLike","markKeyboardFocus","useCompositeFocus","DEFAULT_INPUT_STYLES","INPUT_WRAPPER_STYLES","FilterFn","textValue","inputValue","PopoverTriggerAction","SearchComboBoxWrapperElement","qa","styles","InputElement","as","CubeSearchComboBoxProps","Omit","onSelect","key","onSubmit","value","emptyLabel","defaultInputValue","onInputChange","placeholder","autoFocus","autoComplete","onFocus","onBlur","onKeyDown","popoverTrigger","items","Iterable","T","children","item","filter","isClearable","onClear","icon","prefix","suffix","hideTrigger","size","inputRef","HTMLInputElement","wrapperRef","HTMLDivElement","listBoxRef","popoverRef","triggerRef","HTMLButtonElement","inputStyles","triggerStyles","listBoxStyles","overlayStyles","optionStyles","sectionStyles","headingStyles","listGap","isDisabled","isLoading","loadingDelay","disabledKeys","shouldFlip","direction","overlayOffset","containerPadding","isReadOnly","suffixPosition","onOpenChange","isOpen","useDelayedFlag","active","delay","$","_c","flag","setFlag","t0","t1","id","setTimeout","clearTimeout","SearchComboBoxInputProps","mods","Record","keyboardProps","focusProps","onChange","e","ChangeEvent","FocusEvent","isExpanded","searchComboBoxId","listStateRef","SearchComboBoxInput","ref","combinedRef","undefined","current","selectionManager","focusedKey","SearchComboBox","props","t","label","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","message","description","labelSuffix","renderChildren","isControlledInput","internalInputValue","setInternalInputValue","effectiveInputValue","isPopoverOpen","setIsPopoverOpen","fieldLayout","isFilterActive","setIsFilterActive","contains","sensitivity","textFilterFn","filterFn","nodes","term","trim","localCollectionState","selectionMode","isFocused","validationIcon","setFocusTick","bumpFocus","getItemLabel","collection","getItem","String","showLoading","hasResults","node","type","childNodes","length","disabledKeySet","Set","Array","from","visibleItemKeys","keys","walk","has","push","trimmedInput","shouldShowPopover","Boolean","menuId","onClose","HTMLElement","containerRef","suppressFocusOpenRef","clearAndClose","focus","handleSelectionChange","selection","isArray","handleSubmit","clearValue","handleInputChange","target","trimmed","handleInputFocus","handleCompositeBlur","compositeFocusProps","focusOption","listState","setFocusedKey","handleArrowKey","preventDefault","getKeyToSelect","visibleKeys","includes","handleEnterKey","keyToSelect","select","handleEscapeKey","handleEdgeKey","isDefaultPrevented","showClearButton","disabled","hovered","focused","loading","clearable","searchComboBoxWidth","offsetWidth","attempts","timer","ReturnType","applyFocus","isFocusValid","resolvedEmptyLabel","searchComboBoxField","pressed","willOpen","_","propsWithoutChildren","field","_c","useFocus","Item","BaseSection"],"sources":["../../../../src/components/fields/SearchComboBox/SearchComboBox.tsx"],"sourcesContent":["import {\n KeyboardEvent as AriaKeyboardEvent,\n FocusableRef,\n Key,\n} from '@react-types/shared';\nimport { BasePropsWithoutChildren, Styles, tasty } from '@tenphi/tasty';\nimport React, {\n cloneElement,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useKeyboard } from 'react-aria';\nimport { Section as BaseSection, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { SearchIcon } from '../../../icons/SearchIcon';\nimport { useProviderProps } from '../../../provider';\nimport { FieldBaseProps, TextFieldKeyboardProps } from '../../../shared';\nimport { generateRandomId } from '../../../utils/random';\nimport { useCombinedRefs } from '../../../utils/react';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { settleOverlayKey } from '../../../utils/react/overlayKeyPropagation';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { CollectionItem as Item } from '../../CollectionItem';\nimport {\n getValidationIcon,\n getValidationMods,\n useValidationProps,\n wrapWithField,\n} from '../../form';\nimport { asksForFieldChrome, withFieldChrome } from '../../form/field-chrome';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport { getListBoxOptionId } from '../ListBox/optionId';\nimport {\n filterCollectionNodes,\n getEdgeVisibleKey,\n getNextVisibleKey,\n getVisibleKeys,\n ListBoxPopover,\n ListStateLike,\n markKeyboardFocus,\n useCompositeFocus,\n} from '../ListBoxPopover';\nimport {\n DEFAULT_INPUT_STYLES,\n INPUT_WRAPPER_STYLES,\n} from '../TextInput/TextInputBase';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport type PopoverTriggerAction = 'focus' | 'input' | 'manual';\n\nconst SearchComboBoxWrapperElement = tasty({\n qa: 'SearchComboBoxWrapper',\n styles: INPUT_WRAPPER_STYLES,\n});\n\nconst InputElement = tasty({\n as: 'input',\n styles: DEFAULT_INPUT_STYLES,\n});\n\nexport interface CubeSearchComboBoxProps<T>\n extends\n BasePropsWithoutChildren,\n FieldLayoutStyleProps,\n // SearchComboBox is not form-connected: it holds no persistent value, so\n // form-binding and form-validation props are excluded from the public API.\n Omit<\n FieldBaseProps,\n | 'name'\n | 'form'\n | 'rules'\n | 'shouldUpdate'\n | 'validationDelay'\n | 'validateTrigger'\n | 'insideForm'\n | 'idPrefix'\n > {\n /**\n * Callback fired when the user picks a suggestion from the list.\n * Receives the option key and its text value. The input is cleared afterwards.\n */\n onSelect?: (key: string, textValue: string) => void;\n /**\n * Opt-in callback fired when the user presses Enter while no suggestion is\n * visible (the popover has no results). Receives the trimmed input text. The\n * input is cleared afterwards. When suggestions are visible, Enter selects the\n * top result via `onSelect` instead. When not provided, Enter with no visible\n * suggestion is a no-op.\n */\n onSubmit?: (value: string) => void;\n /**\n * Label displayed when the list is empty (no results). Defaults to a\n * context-aware \"No results found\" / \"Loading…\" message.\n */\n emptyLabel?: ReactNode;\n\n /** The input value in controlled mode */\n inputValue?: string;\n /** The default input value in uncontrolled mode */\n defaultInputValue?: string;\n /** Callback fired when input value changes */\n onInputChange?: (value: string) => void;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input should have autofocus */\n autoFocus?: boolean;\n /** HTML autocomplete attribute for the input */\n autoComplete?: string;\n /** Callback fired when focus enters the component (input or popover). Does not receive event object. */\n onFocus?: () => void;\n /** Callback fired when focus leaves the component entirely. Does not receive event object. */\n onBlur?: () => void;\n /**\n * Callback fired when a key is pressed on the input, before the built-in\n * key handling. Receives React Aria's keyboard event: `e.preventDefault()`\n * skips the built-in handling for the key. `Escape` and `Tab` go on to\n * ancestors, such as a surrounding dialog, unless SearchComboBox acts on\n * them or the handler prevents them. It acts on `Escape` while the list is\n * open or the input has text: it closes the list, or clears the text, or,\n * when not clearable, keeps the browser from clearing it. Other keys stop\n * at the input unless the handler calls `e.continuePropagation()`.\n */\n onKeyDown?: TextFieldKeyboardProps['onKeyDown'];\n\n /** Popover trigger behavior: 'focus', 'input', or 'manual'. Defaults to 'input' */\n popoverTrigger?: PopoverTriggerAction;\n\n /** Items for the listbox (alternative to children) */\n items?: Iterable<T>;\n /** Children for the listbox (static items or render function) */\n children?: ReactNode | ((item: T) => ReactElement);\n\n /**\n * Custom filter function for determining if an option should be included.\n * Pass `false` to disable internal filtering completely (external/server-side filtering).\n */\n filter?: FilterFn | false;\n\n /** Whether the search combobox is clearable using ESC key or clear button. Defaults to true. */\n isClearable?: boolean;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n\n /** Left input icon. Defaults to a search icon. */\n icon?: ReactElement | null;\n /** Input decoration before the main input */\n prefix?: ReactNode;\n /** Input decoration after the main input */\n suffix?: ReactNode;\n /** Whether to show the trigger button. Hidden by default (search field look). */\n hideTrigger?: boolean;\n /** Size of the search combobox */\n size?: 'small' | 'medium' | 'large' | (string & {});\n\n /** Ref for accessing the input element */\n inputRef?: RefObject<HTMLInputElement | null>;\n /** Ref for accessing the wrapper element */\n wrapperRef?: RefObject<HTMLDivElement>;\n /** Ref for accessing the listbox element */\n listBoxRef?: RefObject<HTMLDivElement>;\n /** Ref for accessing the popover element */\n popoverRef?: RefObject<HTMLDivElement>;\n /** Ref for accessing the trigger button element */\n triggerRef?: FocusableRef<HTMLButtonElement>;\n\n /** Custom styles for the input */\n inputStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Custom styles for the listbox */\n listBoxStyles?: Styles;\n /** Custom styles for the popover overlay */\n overlayStyles?: Styles;\n /** Custom styles for individual options */\n optionStyles?: Styles;\n /** Custom styles for sections */\n sectionStyles?: Styles;\n /** Custom styles for section headings */\n headingStyles?: Styles;\n /** Space between options, in pixels. Defaults to a hairline (`$item-gap`, `1px`). */\n listGap?: number;\n\n /** Whether the search combobox is disabled */\n isDisabled?: boolean;\n /**\n * Whether items are being loaded (e.g. from a server). While loading, the\n * previous results stay visible; the loading indicator only appears after\n * `loadingDelay` to avoid flicker on fast responses.\n */\n isLoading?: boolean;\n /** Delay in milliseconds before the loading indicator is shown. Defaults to 1000. */\n loadingDelay?: number;\n /** Keys of disabled items */\n disabledKeys?: Iterable<Key>;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /** Placement direction for the popover */\n direction?: 'bottom' | 'top';\n /** Offset for the popover */\n overlayOffset?: number;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /** Whether the search combobox is read-only */\n isReadOnly?: boolean;\n /** Suffix position goes before or after the validation and loading statuses */\n suffixPosition?: 'before' | 'after';\n /** Callback called when the popover open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\n// ============================================================================\n// Hook: useDelayedFlag\n// ----------------------------------------------------------------------------\n// Turns `true` only after `delay` ms of `active` staying true, and back to\n// `false` immediately when `active` becomes false. Used to defer the loading\n// indicator so fast responses never flash a loading state.\n// ============================================================================\nfunction useDelayedFlag(active: boolean, delay: number): boolean {\n const [flag, setFlag] = useState(false);\n\n useEffect(() => {\n if (!active) {\n setFlag(false);\n return;\n }\n\n if (delay <= 0) {\n setFlag(true);\n return;\n }\n\n const id = setTimeout(() => setFlag(true), delay);\n return () => clearTimeout(id);\n }, [active, delay]);\n\n return flag;\n}\n\n// ============================================================================\n// Component: SearchComboBoxInput\n// ============================================================================\ninterface SearchComboBoxInputProps {\n qa?: string;\n inputRef: RefObject<HTMLInputElement | null>;\n id?: string;\n value: string;\n placeholder?: string;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n autoFocus?: boolean;\n autoComplete?: string;\n size: string;\n mods: Record<string, any>;\n inputStyles?: Styles;\n keyboardProps: any;\n focusProps: any;\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;\n /** Whether the listbox popover is actually visible (results, loading, or empty state). */\n isExpanded: boolean;\n searchComboBoxId: string;\n listStateRef: RefObject<any>;\n}\n\nconst SearchComboBoxInput = forwardRef<\n HTMLInputElement,\n SearchComboBoxInputProps\n>(function SearchComboBoxInput(\n {\n qa,\n inputRef,\n id,\n value,\n placeholder,\n isDisabled,\n isReadOnly,\n autoFocus,\n autoComplete,\n size,\n mods,\n inputStyles,\n keyboardProps,\n focusProps,\n onChange,\n onFocus,\n isExpanded,\n searchComboBoxId,\n listStateRef,\n },\n ref,\n) {\n const combinedRef = useCombinedRefs(ref, inputRef);\n\n return (\n <InputElement\n ref={combinedRef}\n qa={qa}\n id={id}\n type=\"search\"\n value={value}\n placeholder={placeholder}\n isDisabled={isDisabled}\n readOnly={isReadOnly}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={focusProps.onBlur}\n {...keyboardProps}\n styles={inputStyles}\n mods={mods}\n data-size={size}\n data-input-type=\"searchcombobox\"\n role=\"combobox\"\n aria-expanded={isExpanded}\n aria-haspopup=\"listbox\"\n aria-controls={\n isExpanded ? `SearchComboBoxListBox-${searchComboBoxId}` : undefined\n }\n aria-activedescendant={\n isExpanded && listStateRef.current?.selectionManager.focusedKey != null\n ? getListBoxOptionId(\n `SearchComboBoxListBox-${searchComboBoxId}`,\n listStateRef.current.selectionManager.focusedKey,\n )\n : undefined\n }\n />\n );\n});\n\n// ============================================================================\n// Main Component: SearchComboBox\n// ============================================================================\nexport const SearchComboBox = forwardRef(function SearchComboBox<\n T extends object,\n>(props: CubeSearchComboBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // SearchComboBox is a standalone control, not a form field, so it does not use `useFieldProps`.\n // Without a label, it still shows a description or message under the control.\n if (asksForFieldChrome(props)) props = withFieldChrome(props);\n props = useProviderProps(props);\n props = useValidationProps(props);\n\n const { t } = useI18n();\n\n let {\n qa,\n label,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n id,\n icon,\n prefix,\n isDisabled,\n autoFocus,\n autoComplete = 'off',\n wrapperRef,\n inputRef,\n triggerRef,\n popoverRef,\n listBoxRef,\n isLoading,\n loadingDelay = 1000,\n inputStyles,\n optionStyles,\n triggerStyles,\n listBoxStyles,\n overlayStyles,\n suffix,\n hideTrigger = true,\n message,\n description,\n size = 'medium',\n direction = 'bottom',\n shouldFlip = true,\n popoverTrigger = 'input',\n suffixPosition = 'before',\n filter,\n styles,\n labelSuffix,\n inputValue,\n defaultInputValue,\n onInputChange,\n isClearable = true,\n onClear,\n placeholder,\n emptyLabel,\n onSelect,\n onSubmit,\n items,\n children: renderChildren,\n sectionStyles,\n headingStyles,\n listGap,\n isReadOnly,\n overlayOffset = 8,\n containerPadding = 8,\n onOpenChange,\n onFocus,\n onBlur,\n onKeyDown,\n disabledKeys,\n } = props;\n\n // Generate a unique ID for this instance\n const searchComboBoxId = useMemo(() => generateRandomId(), []);\n\n // Normalize the wrapper/popover refs above popover-sync so it sees stable refs.\n // The field's ref is the wrapper's, with or without the field chrome.\n wrapperRef = useCombinedRefs(wrapperRef, ref);\n popoverRef = useCombinedRefs(popoverRef);\n\n // Input value state (controlled/uncontrolled)\n const isControlledInput = inputValue !== undefined;\n const [internalInputValue, setInternalInputValue] = useState(\n defaultInputValue ?? '',\n );\n const effectiveInputValue = isControlledInput\n ? (inputValue as string)\n : internalInputValue;\n\n // Popover state — open *intent*. The overlay is gated separately by\n // `shouldShowPopover` (results / delayed loading / empty-query state).\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n\n const fieldLayout = splitFieldLayout(props);\n\n styles = fieldLayout.styles;\n\n inputRef = useCombinedRefs(inputRef);\n triggerRef = useCombinedRefs(triggerRef);\n listBoxRef = useCombinedRefs(listBoxRef);\n\n const children = renderChildren as ReactNode;\n\n // Filtering\n const [isFilterActive, setIsFilterActive] = useState(false);\n const { contains } = useFilter({ sensitivity: 'base' });\n\n const textFilterFn = useMemo<FilterFn>(\n () => (filter === false ? () => true : filter || contains),\n [filter, contains],\n );\n\n const filterFn = useCallback(\n (nodes: Iterable<any>) => {\n const term = effectiveInputValue.trim();\n\n if (!isFilterActive || !term) {\n return nodes;\n }\n\n return filterCollectionNodes(nodes, term, textFilterFn);\n },\n [isFilterActive, effectiveInputValue, textFilterFn],\n );\n\n // Local collection state for reading item labels (textValue) before/without a selection.\n const localCollectionState = useListState({\n children: children as any,\n items,\n selectionMode: 'none',\n });\n\n const { isFocused, focusProps } = useFocus();\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n const listStateRef = useRef<any>(null);\n // Bumped whenever we move the virtual focus so the input's\n // `aria-activedescendant` (read from the ListBox's stateRef at render time)\n // stays in sync — the ListBox's own state update does not re-render us.\n const [, setFocusTick] = useState(0);\n const bumpFocus = useEvent(() => setFocusTick((t) => t + 1));\n\n const getItemLabel = useCallback(\n (key: Key): string => {\n const item = localCollectionState?.collection?.getItem(key);\n return item?.textValue || String(key);\n },\n [localCollectionState?.collection],\n );\n\n // Delayed loading indicator\n const showLoading = useDelayedFlag(!!isLoading, loadingDelay);\n\n // Check if there are any results after filtering\n const hasResults = useMemo(() => {\n const collection = localCollectionState?.collection;\n if (!collection) return false;\n\n for (const node of filterFn(collection) as Iterable<any>) {\n if (node.type === 'section') {\n if (node.childNodes && [...node.childNodes].length > 0) return true;\n } else {\n return true;\n }\n }\n\n return false;\n }, [localCollectionState?.collection, filterFn]);\n\n const disabledKeySet = useMemo(\n () => new Set<Key>(disabledKeys ? Array.from(disabledKeys) : []),\n [disabledKeys],\n );\n\n // Flat list of selectable keys after filtering. Doubles as the dependency\n // that re-triggers auto-focus whenever the visible results change.\n const visibleItemKeys = useMemo(() => {\n const collection = localCollectionState?.collection;\n const keys: Key[] = [];\n if (!collection) return keys;\n\n const walk = (nodes: Iterable<any>) => {\n for (const node of nodes) {\n if (node.type === 'item') {\n if (!disabledKeySet.has(node.key)) keys.push(node.key);\n } else if (node.childNodes) {\n walk(node.childNodes);\n }\n }\n };\n\n walk(filterFn(collection) as Iterable<any>);\n return keys;\n }, [localCollectionState?.collection, filterFn, disabledKeySet]);\n\n const trimmedInput = effectiveInputValue.trim();\n\n // Keep the popover visible while there's something meaningful to show:\n // results, a loading indicator, or an empty state for a non-empty query.\n // While a load is in flight but the delayed indicator hasn't kicked in yet,\n // suppress the empty state so users never see a false \"No results found\".\n //\n // `isPopoverOpen` can still be true while this is false (loading delay with\n // no results, or opening an empty collection). Sync, notifications, and\n // keyboard commit must key off *this* flag so we never advertise or act on\n // an invisible overlay (incl. stale keys left in `listStateRef`).\n const shouldShowPopover = Boolean(\n isPopoverOpen &&\n (hasResults || showLoading || (trimmedInput.length > 0 && !isLoading)),\n );\n\n usePopoverSync({\n menuId: searchComboBoxId,\n isOpen: shouldShowPopover,\n onClose: () => setIsPopoverOpen(false),\n triggerRef: wrapperRef as RefObject<HTMLElement | null>,\n containerRef: popoverRef as RefObject<HTMLElement | null>,\n });\n\n // Notify when the overlay is actually shown/hidden, not merely intended open.\n useEffect(() => {\n onOpenChange?.(shouldShowPopover);\n }, [shouldShowPopover]);\n\n // When we programmatically return focus to the input after a commit, the\n // resulting focus event must not reopen the popover (relevant for\n // `popoverTrigger=\"focus\"`). Consumed once by `handleInputFocus`.\n const suppressFocusOpenRef = useRef(false);\n\n // Shared tail for commit actions (select/submit): reset the filter, clear the\n // input, close the popover, and return focus to the input.\n const clearAndClose = useEvent(() => {\n setIsFilterActive(false);\n\n if (!isControlledInput) {\n setInternalInputValue('');\n }\n onInputChange?.('');\n\n setIsPopoverOpen(false);\n\n suppressFocusOpenRef.current = true;\n setTimeout(() => {\n inputRef.current?.focus();\n // Clear right after the (synchronous) focus dispatch so a stale flag can\n // never suppress a later, genuine user focus — even if `focus()` was a\n // no-op because the input already held focus.\n suppressFocusOpenRef.current = false;\n }, 0);\n });\n\n // Selection handler — fire onSelect and clear the input.\n const handleSelectionChange = useEvent((selection: Key | Key[] | null) => {\n const key = Array.isArray(selection) ? selection[0] : selection;\n\n if (key != null) {\n const textValue = getItemLabel(key);\n onSelect?.(String(key), textValue);\n }\n\n clearAndClose();\n });\n\n // Submit handler — fire onSubmit and clear the input.\n const handleSubmit = useEvent((value: string) => {\n onSubmit?.(value);\n\n clearAndClose();\n });\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (!isControlledInput) {\n setInternalInputValue('');\n }\n onInputChange?.('');\n\n setIsFilterActive(false);\n\n if (isPopoverOpen) {\n setIsPopoverOpen(false);\n }\n\n // Same suppress as clearAndClose: programmatic refocus must not reopen the\n // popover when popoverTrigger=\"focus\" (e.g. clear button steal+restore focus).\n suppressFocusOpenRef.current = true;\n setTimeout(() => {\n inputRef.current?.focus();\n suppressFocusOpenRef.current = false;\n }, 0);\n\n onClear?.();\n });\n\n // Input change handler\n const handleInputChange = useEvent(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n\n if (!isControlledInput) {\n setInternalInputValue(value);\n }\n onInputChange?.(value);\n\n const trimmed = value.trim();\n setIsFilterActive(trimmed.length > 0);\n\n if (popoverTrigger !== 'manual') {\n if (trimmed && !isPopoverOpen) {\n setIsPopoverOpen(true);\n } else if (!trimmed && isPopoverOpen && popoverTrigger === 'input') {\n setIsPopoverOpen(false);\n }\n }\n },\n );\n\n // Input focus handler\n const handleInputFocus = useEvent((e: React.FocusEvent<HTMLInputElement>) => {\n focusProps.onFocus?.(e as any);\n\n // Skip the focus-triggered open exactly once when we refocused the input\n // ourselves right after a commit, so select/submit truly resets the field.\n if (suppressFocusOpenRef.current) {\n return;\n }\n\n if (popoverTrigger === 'focus' && !isPopoverOpen) {\n setIsPopoverOpen(true);\n }\n });\n\n // Composite blur — fires when focus leaves the whole component.\n // Always clear open intent: while the overlay is suppressed (e.g. loading\n // delay with no results), `useOverlay` is not mounted and cannot dismiss\n // on outside interaction, so blur is the only chance to drop `isPopoverOpen`.\n // Otherwise a late result arrival would flip `shouldShowPopover` true and\n // show the popover after focus has already left.\n const handleCompositeBlur = useEvent(() => {\n setIsFilterActive(false);\n setIsPopoverOpen(false);\n onBlur?.();\n });\n\n const { compositeFocusProps } = useCompositeFocus({\n wrapperRef,\n popoverRef,\n onFocus,\n onBlur: handleCompositeBlur,\n isDisabled,\n });\n\n // ---- keyboard -----------------------------------------------------------\n // Moves the virtual focus to `key`, if there is one, and scrolls it into view.\n const focusOption = (listState: ListStateLike, key: Key | null) => {\n if (key == null) return;\n\n markKeyboardFocus(listState);\n listState.selectionManager.setFocusedKey(key);\n bumpFocus();\n };\n\n const handleArrowKey = (e: AriaKeyboardEvent) => {\n e.preventDefault();\n\n if (!shouldShowPopover) {\n // Open intent may already be set while nothing is shown (loading delay).\n if (!isPopoverOpen) {\n if (!hasResults) setIsFilterActive(false);\n setIsPopoverOpen(true);\n }\n\n return;\n }\n\n const listState = listStateRef.current;\n\n if (listState) {\n focusOption(\n listState,\n getNextVisibleKey(listState, e.key === 'ArrowDown' ? 1 : -1),\n );\n }\n };\n\n // The option Enter commits. Prefer the highlighted option, but only when\n // it's still visible (further typing may have filtered it out); otherwise\n // fall back to the first visible option so typing a match and pressing\n // Enter always selects the top result.\n //\n // `listStateRef` can still be null while the popover is mounting/\n // transitioning. In that window we fall back to the parent-computed\n // `visibleItemKeys` so a matching query commits via `onSelect` instead of\n // leaking through to `onSubmit`.\n const getKeyToSelect = (listState: ListStateLike | null): Key | null => {\n const visibleKeys = listState ? getVisibleKeys(listState) : visibleItemKeys;\n const focusedKey = listState?.selectionManager.focusedKey;\n\n return focusedKey != null && visibleKeys.includes(focusedKey)\n ? focusedKey\n : (visibleKeys[0] ?? null);\n };\n\n // Enter commits an option, else submits the raw text, else does nothing\n // (keeping any empty state visible). It never reaches a surrounding form.\n const handleEnterKey = (e: AriaKeyboardEvent) => {\n e.preventDefault();\n\n // Commit an option only when the overlay is actually shown. Gate on\n // `shouldShowPopover` (not `isPopoverOpen`): during the loading delay or\n // an empty open, intent can be open while nothing is mounted, and a stale\n // `listStateRef` must not be committed.\n const listState = listStateRef.current;\n const keyToSelect = shouldShowPopover ? getKeyToSelect(listState) : null;\n\n if (keyToSelect != null) {\n if (listState) {\n listState.selectionManager.select(keyToSelect, e);\n } else {\n // No mounted list state to route through — commit directly.\n handleSelectionChange(keyToSelect);\n }\n } else if (onSubmit && trimmedInput) {\n handleSubmit(trimmedInput);\n }\n };\n\n const handleEscapeKey = (e: AriaKeyboardEvent) => {\n if (isPopoverOpen) {\n e.preventDefault();\n setIsPopoverOpen(false);\n inputRef.current?.focus();\n } else if (effectiveInputValue) {\n // Always preventDefault: type=\"search\" clears natively on Escape\n // unless cancelled, which would bypass isClearable={false}.\n e.preventDefault();\n if (isClearable) clearValue();\n }\n };\n\n const handleEdgeKey = (e: AriaKeyboardEvent) => {\n if (!shouldShowPopover) return;\n\n e.preventDefault();\n\n const listState = listStateRef.current;\n\n if (listState) {\n focusOption(\n listState,\n getEdgeVisibleKey(listState, e.key === 'Home' ? 'first' : 'last'),\n );\n }\n };\n\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n // The user's handler runs first, and a key it prevents is theirs: skip\n // the built-in handling. Read `isDefaultPrevented()`, not\n // `defaultPrevented` — `useKeyboard` hands over a copy of the event whose\n // `defaultPrevented` field is fixed at the moment it was made.\n onKeyDown?.(e);\n\n if (!e.isDefaultPrevented()) {\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n handleArrowKey(e);\n break;\n case 'Enter':\n handleEnterKey(e);\n break;\n case 'Escape':\n handleEscapeKey(e);\n break;\n case 'Home':\n case 'End':\n handleEdgeKey(e);\n break;\n }\n }\n\n // An `Escape` that closed the list or cleared the text is prevented and\n // stays; otherwise it, and `Tab`, go on to a surrounding dialog.\n settleOverlayKey(e);\n },\n });\n\n if (icon === undefined) {\n icon = <SearchIcon />;\n }\n\n if (icon) {\n icon = <div data-element=\"InputIcon\">{icon}</div>;\n\n if (prefix) {\n prefix = (\n <>\n {icon}\n {prefix}\n </>\n );\n } else {\n prefix = icon;\n }\n }\n\n const showClearButton =\n isClearable && effectiveInputValue !== '' && !isDisabled && !isReadOnly;\n\n const mods = {\n ...getValidationMods({ isInvalid, isValid }),\n disabled: isDisabled,\n // Hover is handled purely via CSS `:hover`, so it never flows through mods.\n hovered: false,\n focused: isFocused,\n loading: showLoading,\n prefix: !!prefix,\n // Always reserve the suffix slot (it holds validation/loading/clear/trigger).\n suffix: true,\n clearable: showClearButton,\n };\n\n const searchComboBoxWidth = wrapperRef?.current?.offsetWidth;\n\n // Highlight the first visible suggestion when the popover opens or when the\n // filtered results change, so the top match is visibly pre-selected (parity\n // with ComboBox's initial-focus behaviour). The user's own highlight is left\n // untouched while the focused option is still visible; a missing or\n // filtered-out focus falls back to the first visible key. This only drives\n // the visual highlight — Enter always resolves the option itself, so\n // correctness never depends on this effect's timing.\n useLayoutEffect(() => {\n if (!shouldShowPopover) return;\n\n let attempts = 0;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const applyFocus = () => {\n if (!shouldShowPopover) return;\n\n const listState = listStateRef.current;\n\n if (listState) {\n const keys = getVisibleKeys(listState);\n\n if (keys.length > 0) {\n const focusedKey = listState.selectionManager.focusedKey;\n const isFocusValid = focusedKey != null && keys.includes(focusedKey);\n\n if (!isFocusValid) {\n markKeyboardFocus(listState);\n listState.selectionManager.setFocusedKey(keys[0]);\n bumpFocus();\n }\n\n return;\n }\n }\n\n // The listbox mounts inside a portal/transition, so its state may not be\n // ready on the first tick; retry a few times before giving up.\n attempts += 1;\n if (attempts < 8) {\n timer = setTimeout(applyFocus, 16);\n }\n };\n\n applyFocus();\n\n return () => {\n if (timer != null) clearTimeout(timer);\n };\n }, [shouldShowPopover, visibleItemKeys]);\n\n const resolvedEmptyLabel =\n emptyLabel !== undefined\n ? emptyLabel\n : showLoading\n ? t('searchComboBox.loading', 'Loading…')\n : t('searchComboBox.noResults', 'No results found');\n\n const searchComboBoxField = (\n <SearchComboBoxWrapperElement\n ref={wrapperRef}\n mods={mods}\n styles={styles}\n data-size={size}\n {...compositeFocusProps}\n >\n {prefix ? <div data-element=\"Prefix\">{prefix}</div> : null}\n <SearchComboBoxInput\n qa={qa || 'SearchComboBox'}\n inputRef={inputRef}\n id={id}\n value={effectiveInputValue}\n placeholder={placeholder}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n size={size}\n mods={mods}\n inputStyles={inputStyles}\n keyboardProps={keyboardProps}\n focusProps={focusProps}\n isExpanded={shouldShowPopover}\n searchComboBoxId={searchComboBoxId}\n listStateRef={listStateRef}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n />\n <div data-element=\"Suffix\">\n {suffixPosition === 'before' ? suffix : null}\n {showLoading ? (\n <LoadingIcon data-element=\"InputIcon\" />\n ) : (\n validationIcon\n )}\n {suffixPosition === 'after' ? suffix : null}\n {showClearButton && (\n <Item.Action\n icon={<CloseIcon />}\n size={size}\n // No `theme` — see `ComboBox`: the default `current` type inherits\n // the input's already validation-tinted text color.\n qa=\"SearchComboBoxClearButton\"\n data-no-trigger={hideTrigger ? '' : undefined}\n data-popover-dismiss=\"\"\n aria-label={t('searchComboBox.clearValue', 'Clear value')}\n onPress={clearValue}\n />\n )}\n {!hideTrigger ? (\n <Item.Action\n ref={triggerRef}\n data-popover-trigger\n icon={<DirectionIcon to={shouldShowPopover ? 'up' : 'down'} />}\n qa=\"SearchComboBoxTrigger\"\n mods={{\n pressed: shouldShowPopover,\n disabled: isDisabled,\n loading: showLoading,\n }}\n data-size={size}\n isDisabled={isDisabled}\n styles={triggerStyles}\n aria-expanded={shouldShowPopover}\n aria-haspopup=\"listbox\"\n aria-label={t('searchComboBox.showOptions', 'Show options')}\n onPress={() => {\n if (!isDisabled) {\n const willOpen = !isPopoverOpen;\n setIsPopoverOpen(willOpen);\n if (willOpen) {\n inputRef.current?.focus();\n if (!hasResults) {\n setIsFilterActive(false);\n }\n }\n }\n }}\n />\n ) : null}\n </div>\n <ListBoxPopover\n isOpen={shouldShowPopover}\n triggerRef={wrapperRef as RefObject<HTMLElement>}\n popoverRef={popoverRef}\n listBoxRef={listBoxRef}\n direction={direction}\n shouldFlip={shouldFlip}\n overlayOffset={overlayOffset}\n containerPadding={containerPadding}\n comboBoxWidth={searchComboBoxWidth}\n listBoxId={`SearchComboBoxListBox-${searchComboBoxId}`}\n overlayStyles={overlayStyles}\n listBoxStyles={listBoxStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n selectedKey={null}\n isDisabled={isDisabled}\n disabledKeys={disabledKeys}\n items={items}\n listStateRef={listStateRef}\n label={label}\n ariaLabel={(props as any)['aria-label']}\n compositeFocusProps={compositeFocusProps}\n filter={filterFn}\n size={size}\n emptyLabel={resolvedEmptyLabel}\n onSelectionChange={handleSelectionChange}\n onClose={() => setIsPopoverOpen(false)}\n >\n {children}\n </ListBoxPopover>\n </SearchComboBoxWrapperElement>\n );\n\n const { children: _, ...propsWithoutChildren } = props;\n\n return wrapWithField<Omit<CubeSearchComboBoxProps<T>, 'children'>>(\n searchComboBoxField,\n { ...propsWithoutChildren, ...fieldLayout.field },\n );\n}) as unknown as (<T>(\n props: CubeSearchComboBoxProps<T> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReactElement) & { Item: typeof Item; Section: typeof BaseSection };\n\nSearchComboBox.Item = Item;\n\nSearchComboBox.Section = BaseSection;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,MAAMgE,+BAA+B1D,MAAM;CACzC2D,IAAI;CACJC,QAAQP;AACV,CAAC;AAED,MAAMQ,eAAe7D,MAAM;CACzB8D,IAAI;CACJF,QAAQR;AACV,CAAC;AA+JD,SAAAoE,eAAAC,QAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACE,MAAA,CAAAC,MAAAC,WAAwBjH,SAAS,KAAK;CAAE,IAAAkH;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAF,UAAAE,EAAA,OAAAD,OAAA;EAE9BK,WAAA;GACR,IAAI,CAACN,QAAM;IACTK,QAAQ,KAAK;IAAC;GAAA;GAIhB,IAAIJ,SAAS,GAAC;IACZI,QAAQ,IAAI;IAAC;GAAA;GAIf,MAAAG,KAAWC,iBAAiBJ,QAAQ,IAAI,GAAGJ,KAAK;GAAE,aACrCS,aAAaF,EAAE;EAAC;EAC5BD,KAAA,CAACP,QAAQC,KAAK;EAACC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAA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K,QAAN;MACE,KAAKpK;MACL,wBAAA;MACA,MAAM,oBAAC,eAAD,EAAe,IAAI4G,oBAAoB,OAAO,OAAO,CAAA;MAC3D,IAAG;MACH,MAAM;OACJiD,SAASjD;OACTmC,UAAUrI;OACVwI,SAAStD;MACX;MACA,aAAWnG;MACCiB;MACZ,QAAQP;MACR,iBAAeyG;MACf,iBAAc;MACd,cAAYrD,EAAE,8BAA8B,cAAc;MAC1D,eAAe;OACb,IAAI,CAAC7C,YAAY;QACf,MAAMoJ,WAAW,CAACxF;QAClBC,iBAAiBuF,QAAQ;QACzB,IAAIA,UAAU;SACZpK,SAASwD,SAASkE,MAAM;SACxB,IAAI,CAACvB,YACHnB,kBAAkB,KAAK;QAE3B;OACF;MACF;KAAE,CAAA,IAEF;IACD;;GACL,oBAAC,gBAAD;IACE,QAAQkC;IACR,YAAYhH;IACAG;IACAD;IACDiB;IACCD;IACGE;IACGC;IAClB,eAAemI;IACf,WAAW,yBAAyBxG;IACrBvC;IACAD;IACDE;IACCC;IACAC;IACNC;IACT,aAAa;IACDC;IACEG;IACPhC;IACOgE;IACPW;IACP,WAAYF,MAAc;IACLyE;IACrB,QAAQjD;IACFrF;IACN,YAAYkK;IACZ,mBAAmBtC;IACnB,eAAe9C,iBAAiB,KAAK;IAEpCvF;GACa,CAAA;EACY;;CAGhC,MAAM,EAAEA,UAAU+K,GAAG,GAAGC,yBAAyB1G;CAEjD,OAAOlH,cACLwN,qBACA;EAAE,GAAGI;EAAsB,GAAGxF,YAAYyF;CAAM,CAClD;AACF,CAAC;AAID5G,eAAerH,OAAOA;AAEtBqH,eAAevI,UAAUC"}
|
|
@@ -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-5a0d20c | Cube Dev Team */
|
|
2
2
|
import { chain } from "../../../utils/react/chain.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useBufferedValue } from "../../../utils/react/useBufferedValue.js";
|
|
@@ -7,8 +7,9 @@ import { CubeItemActionProps, ItemAction } from "../../actions/ItemAction/ItemAc
|
|
|
7
7
|
import { ItemBadge } from "../../content/ItemBadge/ItemBadge.js";
|
|
8
8
|
import "../../actions/index.js";
|
|
9
9
|
import { CollectionItem as _CollectionItem, CubeCollectionItemProps } from "../../CollectionItem.js";
|
|
10
|
+
import { FieldLayoutStyleProps } from "../../form/field-layout.js";
|
|
10
11
|
import "../../../index.js";
|
|
11
|
-
import { BasePropsWithoutChildren,
|
|
12
|
+
import { BasePropsWithoutChildren, Styles } from "@tenphi/tasty";
|
|
12
13
|
import React, { ForwardedRef, ReactElement, ReactNode, RefObject } from "react";
|
|
13
14
|
import { AriaSelectProps, Placement } from "react-aria";
|
|
14
15
|
import { Section, useSelectState } from "react-stately";
|
|
@@ -17,7 +18,7 @@ import { AriaLabelingProps, CollectionBase, Key as Key$2 } from "@react-types/sh
|
|
|
17
18
|
export declare const ListBoxElement: import("@tenphi/tasty").TastyPolymorphicComponent<"ul", readonly never[], import("@tenphi/tasty").VariantMap, readonly never[], readonly never[]> & {
|
|
18
19
|
[x: string]: React.ForwardRefExoticComponent<Omit<import("@tenphi/tasty").SubElementProps<never>, "ref"> & React.RefAttributes<never>>;
|
|
19
20
|
};
|
|
20
|
-
export interface CubeSelectBaseProps<T> extends BasePropsWithoutChildren, AriaLabelingProps,
|
|
21
|
+
export interface CubeSelectBaseProps<T> extends BasePropsWithoutChildren, AriaLabelingProps, FieldLayoutStyleProps, FieldBaseProps<Key$2 | null | undefined>, CollectionBase<T>, Omit<AriaSelectProps<T>, 'errorMessage' | 'form' | 'name' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange'> {
|
|
21
22
|
/** The currently selected key in the collection (controlled). */
|
|
22
23
|
selectedKey?: Key$2 | null;
|
|
23
24
|
/** The initial selected key in the collection (uncontrolled). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
2
|
-
import {
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5a0d20c | Cube Dev Team */
|
|
2
|
+
import { mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { Text as _Text } from "../../content/Text.js";
|
|
5
5
|
import { mergeRefs, useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -25,10 +25,11 @@ import { getValidationMods } from "../../form/validation/resolve-validation-prop
|
|
|
25
25
|
import { getValidationIcon } from "../../form/validation/ValidationIndicator.js";
|
|
26
26
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
27
27
|
import { wrapWithField } from "../../form/wrapper.js";
|
|
28
|
+
import { splitFieldLayout } from "../../form/field-layout.js";
|
|
28
29
|
import { useOptionOriginPress } from "../option-origin-press.js";
|
|
29
30
|
import { TriggerActions } from "../TriggerActions.js";
|
|
30
31
|
import { c } from "react/compiler-runtime";
|
|
31
|
-
import {
|
|
32
|
+
import { tasty } from "@tenphi/tasty";
|
|
32
33
|
import { forwardRef, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
33
34
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
34
35
|
import { DismissButton, FocusScope, HiddenSelect, useButton, useHover, useListBox, useListBoxSection, useOption, useOverlay, useOverlayPosition, useSelect } from "react-aria";
|
|
@@ -130,11 +131,6 @@ const OverlayElement = tasty({
|
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
});
|
|
133
|
-
const PROP_STYLES = [
|
|
134
|
-
...BASE_STYLES,
|
|
135
|
-
...OUTER_STYLES,
|
|
136
|
-
...COLOR_STYLES
|
|
137
|
-
];
|
|
138
134
|
const ignore = () => {};
|
|
139
135
|
/**
|
|
140
136
|
* A state whose value can't change. React Aria's trigger opens the list,
|
|
@@ -158,7 +154,7 @@ function Select(rawProps, ref) {
|
|
|
158
154
|
onSelectionChange: onChange
|
|
159
155
|
})
|
|
160
156
|
});
|
|
161
|
-
let { qa, label, extra, icon, rightIcon, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, prefix, isDisabled = props.isLoading || false, autoFocus, inputProps, triggerRef: triggerRefProp, popoverRef, listBoxRef, isLoading, loadingIndicator, overlayOffset = 8, inputStyles, triggerStyles, optionStyles, listBoxStyles, listGap, overlayStyles, suffix, actions, message, triggerDescription, descriptionPlacement, hotkeys, direction = "bottom", targetRef, placement: placementProp, shouldFlip = true, containerPadding = 8, placeholder, tooltip, size = "medium", shape, styles, type = "outline", theme = "default", labelSuffix, suffixPosition = "before", isClearable, clearLabel, onOpenChange, form
|
|
157
|
+
let { qa, label, extra, icon, rightIcon, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, prefix, isDisabled = props.isLoading || false, autoFocus, inputProps, triggerRef: triggerRefProp, popoverRef, listBoxRef, isLoading, loadingIndicator, overlayOffset = 8, inputStyles, triggerStyles, optionStyles, listBoxStyles, listGap, overlayStyles, suffix, actions, message, triggerDescription, descriptionPlacement, hotkeys, direction = "bottom", targetRef, placement: placementProp, shouldFlip = true, containerPadding = 8, placeholder, tooltip, size = "medium", shape, styles, type = "outline", theme = "default", labelSuffix, suffixPosition = "before", isClearable, clearLabel, onOpenChange, form } = props;
|
|
162
158
|
const { t } = useI18n();
|
|
163
159
|
let state = getValueSelectionState(useSelectState(props));
|
|
164
160
|
const isLocked = !!props.isReadOnly || !!isLoading;
|
|
@@ -169,7 +165,8 @@ function Select(rawProps, ref) {
|
|
|
169
165
|
useEffect(() => {
|
|
170
166
|
if (isInert && state.isOpen) closeList();
|
|
171
167
|
}, [isInert, state.isOpen]);
|
|
172
|
-
|
|
168
|
+
const fieldLayout = splitFieldLayout(props);
|
|
169
|
+
styles = fieldLayout.styles;
|
|
173
170
|
ref = useCombinedRefs(ref);
|
|
174
171
|
const triggerRef = useCombinedRefs(triggerRefProp);
|
|
175
172
|
popoverRef = useCombinedRefs(popoverRef);
|
|
@@ -343,6 +340,7 @@ function Select(rawProps, ref) {
|
|
|
343
340
|
});
|
|
344
341
|
return wrapWithField(selectField, mergeProps$1({
|
|
345
342
|
...props,
|
|
343
|
+
...fieldLayout.field,
|
|
346
344
|
tooltip: void 0
|
|
347
345
|
}, { labelProps }));
|
|
348
346
|
}
|