@cube-dev/ui-kit 0.200.1 → 0.202.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/CHANGELOG.md +50 -0
- package/dist/README.md +1 -1
- 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 +2 -1
- package/dist/components/HiddenInput.js.map +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/Divider.d.ts +22 -0
- package/dist/components/content/Divider/Divider.js +159 -0
- package/dist/components/content/Divider/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.d.ts +2 -1
- package/dist/components/content/TextItem/TextItem.js +134 -69
- package/dist/components/content/TextItem/TextItem.js.map +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +39 -14
- package/dist/components/content/Tree/Tree.js.map +1 -1
- package/dist/components/content/Tree/TreeNode.js +8 -7
- package/dist/components/content/Tree/TreeNode.js.map +1 -1
- package/dist/components/content/Tree/checked-keys.js +158 -0
- package/dist/components/content/Tree/checked-keys.js.map +1 -0
- package/dist/components/content/Tree/rowId.js +16 -0
- package/dist/components/content/Tree/rowId.js.map +1 -0
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +10 -2
- package/dist/components/content/Tree/tree-index.js.map +1 -1
- package/dist/components/content/Tree/types.d.ts +21 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +17 -123
- package/dist/components/content/Tree/use-checkbox-tree.js.map +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 +94 -66
- package/dist/components/data/ItemTable/ItemTable.js.map +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 +88 -0
- package/dist/components/data/TableBase/TableRowLink.js.map +1 -0
- package/dist/components/data/TableBase/TableView.js +317 -69
- package/dist/components/data/TableBase/TableView.js.map +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 +33 -22
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.d.ts +2 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/types.js.map +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 +21 -10
- 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 +36 -42
- 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 +5 -3
- 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 +182 -200
- 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 +6 -4
- package/dist/components/fields/ComboBox/ComboBox.js +601 -574
- 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 +5 -4
- package/dist/components/fields/CommandTextArea/CommandTextArea.js.map +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 +7 -5
- package/dist/components/fields/DatePicker/DateInput.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +79 -76
- package/dist/components/fields/DatePicker/DateInputBase.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/DatePicker.js +85 -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 +117 -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 +289 -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 +87 -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 +7 -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 -65
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterListBox/styled.js +66 -0
- package/dist/components/fields/FilterListBox/styled.js.map +1 -0
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +35 -3
- package/dist/components/fields/FilterPicker/FilterPicker.js +76 -15
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +413 -0
- package/dist/components/fields/FilterPicker/FilterTree.js.map +1 -0
- 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 +5 -3
- package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +5 -3
- package/dist/components/fields/PasswordInput/PasswordInput.js.map +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 +152 -154
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.d.ts +3 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js +85 -111
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/RadioGroup/context.js.map +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.d.ts +9 -4
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +16 -23
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +52 -48
- package/dist/components/fields/SearchInput/SearchInput.js.map +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 +19 -26
- package/dist/components/fields/Slider/RangeSlider.js.map +1 -1
- package/dist/components/fields/Slider/Slider.js +51 -58
- 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 +12 -2
- package/dist/components/fields/Switch/Switch.js +97 -165
- package/dist/components/fields/Switch/Switch.js.map +1 -1
- package/dist/components/fields/TagInput/TagInput.d.ts +5 -2
- package/dist/components/fields/TagInput/TagInput.js +18 -13
- 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 +5 -3
- package/dist/components/fields/TextArea/TextArea.js.map +1 -1
- package/dist/components/fields/TextInput/TextInput.js +5 -3
- package/dist/components/fields/TextInput/TextInput.js.map +1 -1
- package/dist/components/fields/TextInput/TextInputBase.d.ts +15 -4
- package/dist/components/fields/TextInput/TextInputBase.js +200 -104
- 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/index.d.ts +2 -2
- 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/index.d.ts +2 -2
- 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 +2 -1
- package/dist/components/navigation/Tabs/styled.js.map +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 +116 -116
- package/dist/data/item-themes.js.map +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 +4 -3
- package/dist/index.js +4 -4
- 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.d.ts +5 -0
- package/dist/provider.js +19 -7
- package/dist/provider.js.map +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/shared/form.d.ts +3 -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 +4 -4
- package/dist/tokens/palette.js.map +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 +29 -2
- package/dist/utils/react/disabledProps.js.map +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 +44 -7
- package/dist/utils/react/overlayKeyPropagation.js.map +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 +3 -3
- package/docs/CreateComponent.md +1 -1
- package/docs/FieldProperties.md +17 -7
- package/docs/Usage.md +3 -0
- package/docs/components/content/Divider.md +103 -21
- package/docs/components/content/Tree.md +5 -4
- package/docs/components/data/ItemTable.md +9 -1
- package/docs/components/fields/Checkbox.md +7 -8
- package/docs/components/fields/ColorInput.md +11 -13
- package/docs/components/fields/ColorPicker.md +2 -2
- package/docs/components/fields/ColorSwatchGroup.md +2 -3
- package/docs/components/fields/ComboBox.md +2 -4
- package/docs/components/fields/CommandTextArea.md +3 -5
- package/docs/components/fields/DatePicker.md +1 -4
- package/docs/components/fields/FileInput.md +1 -5
- package/docs/components/fields/FilterListBox.md +0 -3
- package/docs/components/fields/FilterPicker.md +68 -5
- package/docs/components/fields/HueSlider.md +1 -2
- package/docs/components/fields/ListBox.md +0 -3
- package/docs/components/fields/NumberInput.md +5 -6
- package/docs/components/fields/PasswordInput.md +7 -8
- package/docs/components/fields/PeriodPicker.md +0 -4
- package/docs/components/fields/Picker.md +2 -4
- package/docs/components/fields/RadioGroup.md +4 -5
- package/docs/components/fields/SearchComboBox.md +2 -4
- package/docs/components/fields/SearchInput.md +3 -4
- package/docs/components/fields/Select.md +0 -3
- package/docs/components/fields/Slider.md +0 -1
- package/docs/components/fields/Switch.md +16 -3
- package/docs/components/fields/TagInput.md +3 -6
- package/docs/components/fields/TextArea.md +9 -8
- package/docs/components/fields/TextInput.md +39 -10
- package/docs/components/overlays/Tooltip.md +1 -1
- package/docs/tasty/ai-agents.md +1 -1
- package/docs/tasty/react-api.md +1 -1
- package/docs/tasty/styles.md +37 -3
- package/package.json +6 -4
- package/dist/components/content/Divider.d.ts +0 -7
- package/dist/components/content/Divider.js +0 -105
- package/dist/components/content/Divider.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","names":["tasty","ForwardedRef","forwardRef","KeyboardEvent","RefObject","useRef","AriaNumberFieldProps","mergeProps","mergeAriaProps","useKeyboard","useLocale","useNumberField","useNumberFieldState","useI18n","castNullableNumberValue","WithNullableValue","useFieldProps","useDisplayedValidation","CubeTextInputBaseProps","TextInputBase","StepButton","TextInputDOMEvents","FieldBaseProps","TextFieldKeyboardProps","CubeNumberInputProps","Omit","field","hideStepper","suffixPosition","StyledTextInputBase","inputStyles","textAlign","StepperContainer","styles","display","gridColumns","gridRows","flow","placeSelf","margin","NumberInput","rawProps","ref","$","_c","t","t0","t1","Symbol","for","showsValidateErrors","props","suffix","value","defaultValue","onChange","inputRef","labelProps","userLabelProps","inputProps","userInputProps","wrapperProps","otherProps","showStepper","locale","displayedValidation","t2","trackTouched","ariaProps","t3","state","localInputRef","t4","onKeyDown","undefined","onKeyUp","groupProps","ariaGroupProps","incrementButtonProps","decrementButtonProps","validation","HTMLInputElement","t5","fieldLabel","label","t6","incrementAriaLabel","stepUpLabel","t7","decrementAriaLabel","stepDownLabel","t8","event","defaultPrevented","isDefaultPrevented","key","continuePropagation","t9","isDisabled","keyboardProps","t10","mergedLabelProps","steppers","size","T0","t12","getDisplayedValidation","t13","id","t14","t15","_NumberInput","cubeInputType","displayName","_c","mergeProps","mergeAriaProps"],"sources":["../../../../src/components/fields/NumberInput/NumberInput.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n KeyboardEvent,\n RefObject,\n useRef,\n} from 'react';\nimport {\n AriaNumberFieldProps,\n mergeProps as mergeAriaProps,\n useKeyboard,\n useLocale,\n useNumberField,\n} from 'react-aria';\nimport { useNumberFieldState } from 'react-stately';\n\nimport { useI18n } from '../../../i18n';\nimport { mergeProps } from '../../../utils/react';\nimport {\n castNullableNumberValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { useFieldProps } from '../../form';\nimport { useDisplayedValidation } from '../TextInput/displayed-validation';\nimport {\n CubeTextInputBaseProps,\n TextInputBase,\n} from '../TextInput/TextInputBase';\n\nimport { StepButton } from './StepButton';\n\nimport type { TextInputDOMEvents } from '@react-types/shared';\nimport type {\n FieldBaseProps,\n TextFieldKeyboardProps,\n} from '../../../shared/form';\n\nexport interface CubeNumberInputProps\n extends\n Omit<\n CubeTextInputBaseProps,\n | 'defaultValue'\n | 'value'\n | 'onChange'\n | 'field'\n | 'validate'\n | 'onFocus'\n | 'onBlur'\n | keyof TextInputDOMEvents\n >,\n Omit<\n AriaNumberFieldProps,\n 'form' | 'name' | 'errorMessage' | 'onKeyDown' | 'onKeyUp'\n >,\n TextFieldKeyboardProps {\n field?: FieldBaseProps<number | null | undefined>['field'];\n /** Whether or to hide stepper */\n hideStepper?: boolean;\n /**\n * Whether the suffix goes before or after the stepper buttons. Defaults to\n * `before`, so a unit sits next to the number. The validation and loading\n * icons always come before both.\n */\n suffixPosition?: 'before' | 'after';\n}\n\nconst StyledTextInputBase = tasty(TextInputBase, {\n inputStyles: {\n textAlign: 'right',\n },\n});\n\nconst StepperContainer = tasty({\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: '1sf 1sf',\n flow: 'column',\n placeSelf: 'stretch',\n margin: '(.5x - 1bw) left',\n },\n});\n\nfunction NumberInput(\n rawProps: WithNullableValue<CubeNumberInputProps>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n // `NaN` is the number field's own empty value.\n rawProps = castNullableNumberValue(rawProps);\n let props = useFieldProps(rawProps, { showsValidateErrors: true });\n\n let {\n hideStepper,\n suffix,\n value,\n defaultValue,\n onChange,\n inputRef,\n labelProps: userLabelProps,\n inputProps: userInputProps,\n wrapperProps,\n ...otherProps\n } = props;\n let showStepper = !hideStepper;\n let { locale } = useLocale();\n // The state commits typed text on blur and Enter, so its `onChange` is the\n // change `validate` sees.\n let displayedValidation = useDisplayedValidation();\n let ariaProps = displayedValidation.trackTouched(props);\n let state = useNumberFieldState({ ...ariaProps, locale });\n let localInputRef = useRef<HTMLInputElement>(null);\n\n inputRef = inputRef ?? localInputRef;\n\n let {\n groupProps: ariaGroupProps,\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n ...validation\n } = useNumberField(\n { ...ariaProps, onKeyDown: undefined, onKeyUp: undefined },\n state,\n inputRef as RefObject<HTMLInputElement>,\n );\n let groupProps = mergeProps(ariaGroupProps, wrapperProps);\n\n // React Aria names each stepper after the field: a text label goes into the\n // name, any other label is composed in through the `aria-labelledby` it sets.\n // The UI Kit strings take the label the same way, so they replace React\n // Aria's own without losing the field name. Without a text label the name\n // has to read on its own, so it has strings of its own rather than an\n // empty `{{label}}` slot.\n let fieldLabel =\n props['aria-label'] || (typeof props.label === 'string' ? props.label : '');\n let stepUpLabel =\n props.incrementAriaLabel ??\n (fieldLabel\n ? t('numberInput.stepUp', 'Increase {{label}}', { label: fieldLabel })\n : t('numberInput.increase', 'Increase'));\n let stepDownLabel =\n props.decrementAriaLabel ??\n (fieldLabel\n ? t('numberInput.stepDown', 'Decrease {{label}}', { label: fieldLabel })\n : t('numberInput.decrease', 'Decrease'));\n // Keep native commits and user callbacks inside one Aria event wrapper so\n // continuePropagation can still undo the native shortcut's propagation stop.\n let { keyboardProps } = useKeyboard({\n isDisabled: props.isDisabled,\n onKeyDown: (event) => {\n inputProps.onKeyDown?.(event as KeyboardEvent<HTMLInputElement>);\n event.defaultPrevented = event.isDefaultPrevented();\n // NumberInput historically lets every key except Enter reach ancestors.\n if (event.key !== 'Enter') event.continuePropagation();\n props.onKeyDown?.(event);\n },\n onKeyUp: props.onKeyUp,\n });\n\n // Merge user-provided labelProps with aria labelProps\n const mergedLabelProps = mergeProps(labelProps, userLabelProps);\n\n const steppers = showStepper ? (\n <StepperContainer>\n <StepButton\n isDisabled={props.isDisabled}\n direction=\"up\"\n {...incrementButtonProps}\n aria-label={stepUpLabel}\n size={otherProps.size}\n />\n <StepButton\n isDisabled={props.isDisabled}\n direction=\"down\"\n {...decrementButtonProps}\n aria-label={stepDownLabel}\n size={otherProps.size}\n />\n </StepperContainer>\n ) : undefined;\n\n return (\n <StyledTextInputBase\n {...otherProps}\n {...displayedValidation.getDisplayedValidation(otherProps, validation)}\n ref={ref}\n labelProps={mergedLabelProps}\n inputProps={mergeProps(\n // `useNumberField` seeds its input id once. Merging the current id\n // through react-aria's own `mergeProps` updates that seed, so the\n // input, its label and the steppers' `aria-controls` follow the id\n // when the form binding changes after mount.\n mergeAriaProps({ ...inputProps, ...keyboardProps }, { id: props.id }),\n { 'data-input-type': 'numberinput' },\n userInputProps,\n )}\n inputRef={inputRef}\n wrapperProps={groupProps}\n // The validation/loading icon always comes first; `suffixPosition`\n // places the suffix against the steppers instead.\n suffixPosition=\"after\"\n suffix={\n showStepper ? (\n props.suffixPosition === 'after' ? (\n <>\n {steppers}\n {suffix}\n </>\n ) : (\n <>\n {suffix}\n {steppers}\n </>\n )\n ) : (\n suffix\n )\n }\n />\n );\n}\n\n/**\n * NumberFields allow users to enter a number and increment or decrement the value using stepper buttons.\n */\nconst _NumberInput = forwardRef(NumberInput);\n\n(_NumberInput as any).cubeInputType = 'Number';\n\n_NumberInput.displayName = 'NumberInput';\n\nexport { _NumberInput as NumberInput };\nexport type { AriaNumberFieldProps };\n"],"mappings":";;;;;;;;;;;;;;;AAmEA,MAAM6B,sBAAsB7B,MAAMmB,eAAe,EAC/CW,aAAa,EACXC,WAAW,QACb,EACF,CAAC;AAED,MAAMC,mBAAmBhC,MAAM,EAC7BiC,QAAQ;CACNC,SAAS;CACTC,aAAa;CACbC,UAAU;CACVC,MAAM;CACNC,WAAW;CACXC,QAAQ;AACV,EACF,CAAC;AAED,SAAAC,YAA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,QAAAD,OAAAC,EAAA,QAAA8D,OAAA9D,EAAA,QAAAgE,OAAAhE,EAAA,QAAAkE,KAAA;EAlCLC,MAAA,oBAAC,IAAD;GAAoB,GACdhD;GAAU,GACV2C;GACC/D;GACO2D,YAAAA;GACA,YAAAM;GASFnD;GACIoB,cAAAA;GAGC,gBAAA;GAEb,QAAAiC;EAcC,CAAA;EAEHlE,EAAA,MAAA6D;EAAA7D,EAAA,MAAAiC;EAAAjC,EAAA,MAAAa;EAAAb,EAAA,MAAA0D;EAAA1D,EAAA,MAAAmB;EAAAnB,EAAA,MAAAD;EAAAC,EAAA,MAAA8D;EAAA9D,EAAA,MAAAgE;EAAAhE,EAAA,MAAAkE;EAAAlE,EAAA,MAAAmE;CAAA,OAAAA,MAAAnE,EAAA;CAAA,OApCFmE;AAoCE;;;;AAON,MAAMC,eAAe7G,WAAWsC,WAAW;AAE3C,aAAsBwE,gBAAgB;AAEtCD,aAAaE,cAAc"}
|
|
1
|
+
{"version":3,"file":"NumberInput.js","names":["tasty","ForwardedRef","forwardRef","KeyboardEvent","RefObject","useRef","AriaNumberFieldProps","mergeProps","mergeAriaProps","useKeyboard","useLocale","useNumberField","useNumberFieldState","useI18n","castNullableNumberValue","WithNullableValue","settleOverlayKey","useFieldProps","useDisplayedValidation","CubeTextInputBaseProps","TextInputBase","StepButton","TextInputDOMEvents","FieldBaseProps","TextFieldKeyboardProps","CubeNumberInputProps","Omit","field","hideStepper","suffixPosition","StyledTextInputBase","inputStyles","textAlign","StepperContainer","styles","display","gridColumns","gridRows","flow","placeSelf","margin","NumberInput","rawProps","ref","$","_c","t","t0","t1","Symbol","for","showsValidateErrors","props","suffix","value","defaultValue","onChange","inputRef","labelProps","userLabelProps","inputProps","userInputProps","wrapperProps","otherProps","showStepper","locale","displayedValidation","t2","trackTouched","ariaProps","t3","state","localInputRef","t4","onKeyDown","undefined","onKeyUp","groupProps","ariaGroupProps","incrementButtonProps","decrementButtonProps","validation","HTMLInputElement","t5","fieldLabel","label","t6","incrementAriaLabel","stepUpLabel","t7","decrementAriaLabel","stepDownLabel","t8","event","defaultPrevented","isDefaultPrevented","key","continuePropagation","t9","isDisabled","keyboardProps","t10","mergedLabelProps","steppers","size","T0","t12","getDisplayedValidation","t13","id","t14","t15","_NumberInput","cubeInputType","displayName","TextInputBase","_c","mergeProps","mergeAriaProps"],"sources":["../../../../src/components/fields/NumberInput/NumberInput.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n KeyboardEvent,\n RefObject,\n useRef,\n} from 'react';\nimport {\n AriaNumberFieldProps,\n mergeProps as mergeAriaProps,\n useKeyboard,\n useLocale,\n useNumberField,\n} from 'react-aria';\nimport { useNumberFieldState } from 'react-stately';\n\nimport { useI18n } from '../../../i18n';\nimport { mergeProps } from '../../../utils/react';\nimport {\n castNullableNumberValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { settleOverlayKey } from '../../../utils/react/overlayKeyPropagation';\nimport { useFieldProps } from '../../form';\nimport { useDisplayedValidation } from '../TextInput/displayed-validation';\nimport {\n CubeTextInputBaseProps,\n TextInputBase,\n} from '../TextInput/TextInputBase';\n\nimport { StepButton } from './StepButton';\n\nimport type { TextInputDOMEvents } from '@react-types/shared';\nimport type {\n FieldBaseProps,\n TextFieldKeyboardProps,\n} from '../../../shared/form';\n\nexport interface CubeNumberInputProps\n extends\n Omit<\n CubeTextInputBaseProps,\n | 'defaultValue'\n | 'value'\n | 'onChange'\n | 'field'\n | 'validate'\n | 'onFocus'\n | 'onBlur'\n | keyof TextInputDOMEvents\n >,\n Omit<\n AriaNumberFieldProps,\n 'form' | 'name' | 'errorMessage' | 'onKeyDown' | 'onKeyUp'\n >,\n TextFieldKeyboardProps {\n field?: FieldBaseProps<number | null | undefined>['field'];\n /** Whether or to hide stepper */\n hideStepper?: boolean;\n /**\n * Whether the suffix goes before or after the stepper buttons. Defaults to\n * `before`, so a unit sits next to the number. The validation and loading\n * icons always come before both.\n */\n suffixPosition?: 'before' | 'after';\n}\n\nconst StyledTextInputBase = tasty(TextInputBase, {\n inputStyles: {\n textAlign: 'right',\n },\n});\n\nconst StepperContainer = tasty({\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: '1sf 1sf',\n flow: 'column',\n placeSelf: 'stretch',\n margin: '(.5x - 1bw) left',\n },\n});\n\nfunction NumberInput(\n rawProps: WithNullableValue<CubeNumberInputProps>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n // `NaN` is the number field's own empty value.\n rawProps = castNullableNumberValue(rawProps);\n let props = useFieldProps(rawProps, { showsValidateErrors: true });\n\n let {\n hideStepper,\n suffix,\n value,\n defaultValue,\n onChange,\n inputRef,\n labelProps: userLabelProps,\n inputProps: userInputProps,\n wrapperProps,\n ...otherProps\n } = props;\n let showStepper = !hideStepper;\n let { locale } = useLocale();\n // The state commits typed text on blur and Enter, so its `onChange` is the\n // change `validate` sees.\n let displayedValidation = useDisplayedValidation();\n let ariaProps = displayedValidation.trackTouched(props);\n let state = useNumberFieldState({ ...ariaProps, locale });\n let localInputRef = useRef<HTMLInputElement>(null);\n\n inputRef = inputRef ?? localInputRef;\n\n let {\n groupProps: ariaGroupProps,\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n ...validation\n } = useNumberField(\n { ...ariaProps, onKeyDown: undefined, onKeyUp: undefined },\n state,\n inputRef as RefObject<HTMLInputElement>,\n );\n let groupProps = mergeProps(ariaGroupProps, wrapperProps);\n\n // React Aria names each stepper after the field: a text label goes into the\n // name, any other label is composed in through the `aria-labelledby` it sets.\n // The UI Kit strings take the label the same way, so they replace React\n // Aria's own without losing the field name. Without a text label the name\n // has to read on its own, so it has strings of its own rather than an\n // empty `{{label}}` slot.\n let fieldLabel =\n props['aria-label'] || (typeof props.label === 'string' ? props.label : '');\n let stepUpLabel =\n props.incrementAriaLabel ??\n (fieldLabel\n ? t('numberInput.stepUp', 'Increase {{label}}', { label: fieldLabel })\n : t('numberInput.increase', 'Increase'));\n let stepDownLabel =\n props.decrementAriaLabel ??\n (fieldLabel\n ? t('numberInput.stepDown', 'Decrease {{label}}', { label: fieldLabel })\n : t('numberInput.decrease', 'Decrease'));\n // Keep native commits and user callbacks inside one Aria event wrapper so\n // continuePropagation can still undo the native shortcut's propagation stop.\n let { keyboardProps } = useKeyboard({\n isDisabled: props.isDisabled,\n onKeyDown: (event) => {\n inputProps.onKeyDown?.(event as KeyboardEvent<HTMLInputElement>);\n event.defaultPrevented = event.isDefaultPrevented();\n // NumberInput historically lets every key except Enter reach ancestors.\n if (event.key !== 'Enter') event.continuePropagation();\n props.onKeyDown?.(event);\n // Number handling never prevents `Escape` or `Tab`, so a prevented one\n // is the caller's and stops here, as in every other field. An\n // unprevented one already goes on, unless the caller stopped it.\n if (event.isDefaultPrevented()) settleOverlayKey(event);\n },\n onKeyUp: props.onKeyUp,\n });\n\n // Merge user-provided labelProps with aria labelProps\n const mergedLabelProps = mergeProps(labelProps, userLabelProps);\n\n const steppers = showStepper ? (\n <StepperContainer>\n <StepButton\n isDisabled={props.isDisabled}\n direction=\"up\"\n {...incrementButtonProps}\n aria-label={stepUpLabel}\n size={otherProps.size}\n />\n <StepButton\n isDisabled={props.isDisabled}\n direction=\"down\"\n {...decrementButtonProps}\n aria-label={stepDownLabel}\n size={otherProps.size}\n />\n </StepperContainer>\n ) : undefined;\n\n return (\n <StyledTextInputBase\n {...otherProps}\n {...displayedValidation.getDisplayedValidation(otherProps, validation)}\n ref={ref}\n labelProps={mergedLabelProps}\n inputProps={mergeProps(\n // `useNumberField` seeds its input id once. Merging the current id\n // through react-aria's own `mergeProps` updates that seed, so the\n // input, its label and the steppers' `aria-controls` follow the id\n // when the form binding changes after mount.\n mergeAriaProps({ ...inputProps, ...keyboardProps }, { id: props.id }),\n { 'data-input-type': 'numberinput' },\n userInputProps,\n )}\n inputRef={inputRef}\n wrapperProps={groupProps}\n // The validation/loading icon always comes first; `suffixPosition`\n // places the suffix against the steppers instead.\n suffixPosition=\"after\"\n suffix={\n showStepper ? (\n props.suffixPosition === 'after' ? (\n <>\n {steppers}\n {suffix}\n </>\n ) : (\n <>\n {suffix}\n {steppers}\n </>\n )\n ) : (\n suffix\n )\n }\n />\n );\n}\n\n/**\n * NumberFields allow users to enter a number and increment or decrement the value using stepper buttons.\n */\nconst _NumberInput = forwardRef(NumberInput);\n\n(_NumberInput as any).cubeInputType = 'Number';\n\n_NumberInput.displayName = 'NumberInput';\n\nexport { _NumberInput as NumberInput };\nexport type { AriaNumberFieldProps };\n"],"mappings":";;;;;;;;;;;;;;;;AAoEA,MAAM8B,sBAAsB9B,MAAMoB,gBAAe,EAC/CW,aAAa,EACXC,WAAW,QACb,EACF,CAAC;AAED,MAAMC,mBAAmBjC,MAAM,EAC7BkC,QAAQ;CACNC,SAAS;CACTC,aAAa;CACbC,UAAU;CACVC,MAAM;CACNC,WAAW;CACXC,QAAQ;AACV,EACF,CAAC;AAED,SAAAC,YAAAC,UAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAIE,MAAA,EAAAC,MAAcjC,QAAQ;CAAE,IAAAkC;CAAA,IAAAH,EAAA,OAAAF,UAAA;EAGbK,KAAAjC,wBAAwB4B,QAAQ;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAA5CF,WAAWA;CAAH,IAAAM;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EAC4BF,KAAA,EAAAG,qBAAuB,KAAK;EAACP,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAjE,MAAAQ,QAAYnC,cAAcyB,UAAUM,EAA6B;CAEjE,IAAA,EAAApB,aAAAyB,QAAAC,OAAAC,cAAAC,UAAAC,UAAAC,YAAAC,gBAAAC,YAAAC,gBAAAC,cAAA,GAAAC,eAWIX;CACJ,MAAAY,cAAkB,CAACpC;CACnB,MAAA,EAAAqC,WAAiBvD,UAAU;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B;AAEtCD,aAAaE,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.202.0 | Cube Dev Team */
|
|
2
2
|
import { Button } from "../../actions/Button/Button.js";
|
|
3
3
|
import { DirectionIcon } from "../../../icons/DirectionIcon.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.202.0 | 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,9 +7,10 @@ import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
|
7
7
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
8
8
|
import { EyeIcon } from "../../../icons/EyeIcon.js";
|
|
9
9
|
import { EyeInvisibleIcon } from "../../../icons/EyeInvisibleIcon.js";
|
|
10
|
+
import { withOverlayKeys } from "../../../utils/react/overlayKeyPropagation.js";
|
|
10
11
|
import { castNullableStringValue } from "../../../utils/react/nullableValue.js";
|
|
11
12
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
12
|
-
import { TextInputBase } from "../TextInput/TextInputBase.js";
|
|
13
|
+
import { TextInputBase as _TextInputBase } from "../TextInput/TextInputBase.js";
|
|
13
14
|
import { useDisplayedValidation } from "../TextInput/displayed-validation.js";
|
|
14
15
|
import { c } from "react/compiler-runtime";
|
|
15
16
|
import { forwardRef, useRef, useState } from "react";
|
|
@@ -51,6 +52,7 @@ function PasswordInput(rawProps, ref) {
|
|
|
51
52
|
value: buffered.value,
|
|
52
53
|
onChange: buffered.onChange,
|
|
53
54
|
onBlur: chain(rest.onBlur, buffered.reset),
|
|
55
|
+
onKeyDown: withOverlayKeys(rest.onKeyDown),
|
|
54
56
|
type
|
|
55
57
|
}), inputRef);
|
|
56
58
|
let t2;
|
|
@@ -112,7 +114,7 @@ function PasswordInput(rawProps, ref) {
|
|
|
112
114
|
t10 = { paddingRight: "4x" };
|
|
113
115
|
$[18] = t10;
|
|
114
116
|
} else t10 = $[18];
|
|
115
|
-
return /* @__PURE__ */ jsx(
|
|
117
|
+
return /* @__PURE__ */ jsx(_TextInputBase, {
|
|
116
118
|
ref,
|
|
117
119
|
labelProps: mergedLabelProps,
|
|
118
120
|
inputProps: t9,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","names":["ForwardedRef","forwardRef","RefObject","useRef","useState","AriaTextFieldProps","useTextField","useI18n","EyeIcon","EyeInvisibleIcon","chain","mergeProps","useBufferedValue","castNullableStringValue","WithNullableValue","ItemAction","ItemActionProvider","useFieldProps","useDisplayedValidation","CubeBufferedValueProps","CubeTextInputBaseProps","TextInputBase","TextFieldKeyboardProps","CubePasswordInputProps","Omit","validate","PasswordInput","rawProps","ref","$","_c","t","t0","t1","Symbol","for","defaultValidationTrigger","showsValidateErrors","valuePropsMapper","_temp","props","type","setType","labelProps","userLabelProps","inputProps","userInputProps","suffix","multiLine","inputRef","propsInputRef","form","isBuffered","rest","localInputRef","buffered","value","onChange","isDisabled","isReadOnly","displayedValidation","validation","trackTouched","onBlur","reset","HTMLInputElement","t2","mergedLabelProps","t3","_temp2","toggleType","t4","t5","t6","t7","t8","wrappedSuffix","t9","t10","paddingRight","getDisplayedValidation","type_0","toString","_PasswordInput","cubeInputType","displayName","_c","mergeProps"],"sources":["../../../../src/components/fields/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, RefObject, useRef, useState } from 'react';\nimport { AriaTextFieldProps, useTextField } from 'react-aria';\n\nimport { useI18n } from '../../../i18n';\nimport { EyeIcon } from '../../../icons/EyeIcon';\nimport { EyeInvisibleIcon } from '../../../icons/EyeInvisibleIcon';\nimport { chain, mergeProps, useBufferedValue } from '../../../utils/react';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { ItemAction } from '../../actions/ItemAction/ItemAction';\nimport { ItemActionProvider } from '../../actions/ItemActionContext';\nimport { useFieldProps } from '../../form';\nimport { useDisplayedValidation } from '../TextInput/displayed-validation';\nimport {\n CubeBufferedValueProps,\n CubeTextInputBaseProps,\n TextInputBase,\n} from '../TextInput/TextInputBase';\n\nimport type { TextFieldKeyboardProps } from '../../../shared/form';\n\nexport interface CubePasswordInputProps\n extends\n WithNullableValue<Omit<CubeTextInputBaseProps, 'validate'>>,\n CubeBufferedValueProps,\n TextFieldKeyboardProps {\n validate?: AriaTextFieldProps['validate'];\n}\n\nfunction PasswordInput(\n rawProps: CubePasswordInputProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n rawProps = castNullableStringValue(rawProps);\n let props = useFieldProps(rawProps, {\n defaultValidationTrigger: 'onBlur',\n showsValidateErrors: true,\n valuePropsMapper: ({ value, onChange }) => ({\n value: value?.toString() ?? '',\n onChange,\n }),\n });\n\n let [type, setType] = useState('password');\n let {\n labelProps: userLabelProps,\n inputProps: userInputProps,\n suffix,\n multiLine,\n inputRef: propsInputRef,\n // The form instance, not the DOM `form` id `useTextField` forwards.\n form,\n isBuffered,\n ...rest\n } = props;\n let localInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = propsInputRef ?? localInputRef;\n\n // Hold the typed text locally until the controlled value catches up — see `useBufferedValue`.\n let buffered = useBufferedValue(rest.value, rest.onChange, {\n isBuffered,\n isDisabled: rest.isDisabled,\n isReadOnly: rest.isReadOnly,\n });\n\n let displayedValidation = useDisplayedValidation();\n let { labelProps, inputProps, ...validation } = useTextField(\n displayedValidation.trackTouched({\n ...rest,\n value: buffered.value,\n onChange: buffered.onChange,\n onBlur: chain(rest.onBlur, buffered.reset),\n type,\n }),\n inputRef as RefObject<HTMLInputElement | null>,\n );\n\n // Merge user-provided labelProps with aria labelProps\n const mergedLabelProps = mergeProps(labelProps, userLabelProps);\n\n const toggleType = () => {\n setType((type) => (type === 'password' ? 'text' : 'password'));\n };\n\n const wrappedSuffix = (\n <>\n {suffix}\n {/*\n The disabled state travels through the provider rather than as a prop on\n the action. Both disable it, but the provider marks the state as\n INHERITED from the field, and `current` paints from the colour it\n inherits — which a disabled field has already faded — so a second fade\n would multiply the two down to roughly a tenth opacity. No `type` is\n passed, so the `context` mod stays off and the toggle keeps its margins.\n */}\n <ItemActionProvider isDisabled={rest.isDisabled}>\n <ItemAction\n // No `type` — the default `current` type inherits the input's own text\n // color, so the toggle follows the field's theme, validation state and\n // disabled state rather than staying opaque against faded text.\n // A toggle button keeps one name and reports its state with\n // `aria-pressed`: pressed means the password is shown.\n tooltip={t('passwordInput.showPassword', 'Show password')}\n aria-pressed={type === 'text'}\n icon={type === 'password' ? <EyeInvisibleIcon /> : <EyeIcon />}\n onPress={toggleType}\n />\n </ItemActionProvider>\n </>\n );\n\n return (\n <TextInputBase\n ref={ref}\n labelProps={mergedLabelProps}\n inputProps={mergeProps(\n inputProps,\n { 'data-input-type': 'passwordinput' },\n userInputProps,\n )}\n inputRef={inputRef}\n inputStyles={{ paddingRight: '4x' }}\n type={type}\n suffixPosition=\"after\"\n suffix={wrappedSuffix}\n multiLine={multiLine}\n {...rest}\n {...displayedValidation.getDisplayedValidation(rest, validation)}\n />\n );\n}\n\n/**\n * PasswordInputs are password inputs that allow users to input passwords or code entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _PasswordInput = forwardRef(PasswordInput);\n\n(_PasswordInput as any).cubeInputType = 'Text';\n_PasswordInput.displayName = 'PasswordInput';\n\nexport { _PasswordInput as PasswordInput };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PasswordInput.js","names":["ForwardedRef","forwardRef","RefObject","useRef","useState","AriaTextFieldProps","useTextField","useI18n","EyeIcon","EyeInvisibleIcon","chain","mergeProps","useBufferedValue","castNullableStringValue","WithNullableValue","withOverlayKeys","ItemAction","ItemActionProvider","useFieldProps","useDisplayedValidation","CubeBufferedValueProps","CubeTextInputBaseProps","TextInputBase","TextFieldKeyboardProps","CubePasswordInputProps","Omit","validate","PasswordInput","rawProps","ref","$","_c","t","t0","t1","Symbol","for","defaultValidationTrigger","showsValidateErrors","valuePropsMapper","_temp","props","type","setType","labelProps","userLabelProps","inputProps","userInputProps","suffix","multiLine","inputRef","propsInputRef","form","isBuffered","rest","localInputRef","buffered","value","onChange","isDisabled","isReadOnly","displayedValidation","validation","trackTouched","onBlur","reset","onKeyDown","HTMLInputElement","t2","mergedLabelProps","t3","_temp2","toggleType","t4","t5","t6","t7","t8","wrappedSuffix","t9","t10","paddingRight","getDisplayedValidation","type_0","toString","_PasswordInput","cubeInputType","displayName","_c","mergeProps","TextInputBase"],"sources":["../../../../src/components/fields/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, RefObject, useRef, useState } from 'react';\nimport { AriaTextFieldProps, useTextField } from 'react-aria';\n\nimport { useI18n } from '../../../i18n';\nimport { EyeIcon } from '../../../icons/EyeIcon';\nimport { EyeInvisibleIcon } from '../../../icons/EyeInvisibleIcon';\nimport { chain, mergeProps, useBufferedValue } from '../../../utils/react';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { withOverlayKeys } from '../../../utils/react/overlayKeyPropagation';\nimport { ItemAction } from '../../actions/ItemAction/ItemAction';\nimport { ItemActionProvider } from '../../actions/ItemActionContext';\nimport { useFieldProps } from '../../form';\nimport { useDisplayedValidation } from '../TextInput/displayed-validation';\nimport {\n CubeBufferedValueProps,\n CubeTextInputBaseProps,\n TextInputBase,\n} from '../TextInput/TextInputBase';\n\nimport type { TextFieldKeyboardProps } from '../../../shared/form';\n\nexport interface CubePasswordInputProps\n extends\n WithNullableValue<Omit<CubeTextInputBaseProps, 'validate'>>,\n CubeBufferedValueProps,\n TextFieldKeyboardProps {\n validate?: AriaTextFieldProps['validate'];\n}\n\nfunction PasswordInput(\n rawProps: CubePasswordInputProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n rawProps = castNullableStringValue(rawProps);\n let props = useFieldProps(rawProps, {\n defaultValidationTrigger: 'onBlur',\n showsValidateErrors: true,\n valuePropsMapper: ({ value, onChange }) => ({\n value: value?.toString() ?? '',\n onChange,\n }),\n });\n\n let [type, setType] = useState('password');\n let {\n labelProps: userLabelProps,\n inputProps: userInputProps,\n suffix,\n multiLine,\n inputRef: propsInputRef,\n // The form instance, not the DOM `form` id `useTextField` forwards.\n form,\n isBuffered,\n ...rest\n } = props;\n let localInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = propsInputRef ?? localInputRef;\n\n // Hold the typed text locally until the controlled value catches up — see `useBufferedValue`.\n let buffered = useBufferedValue(rest.value, rest.onChange, {\n isBuffered,\n isDisabled: rest.isDisabled,\n isReadOnly: rest.isReadOnly,\n });\n\n let displayedValidation = useDisplayedValidation();\n let { labelProps, inputProps, ...validation } = useTextField(\n displayedValidation.trackTouched({\n ...rest,\n value: buffered.value,\n onChange: buffered.onChange,\n onBlur: chain(rest.onBlur, buffered.reset),\n onKeyDown: withOverlayKeys(rest.onKeyDown),\n type,\n }),\n inputRef as RefObject<HTMLInputElement | null>,\n );\n\n // Merge user-provided labelProps with aria labelProps\n const mergedLabelProps = mergeProps(labelProps, userLabelProps);\n\n const toggleType = () => {\n setType((type) => (type === 'password' ? 'text' : 'password'));\n };\n\n const wrappedSuffix = (\n <>\n {suffix}\n {/*\n The disabled state travels through the provider rather than as a prop on\n the action. Both disable it, but the provider marks the state as\n INHERITED from the field, and `current` paints from the colour it\n inherits — which a disabled field has already faded — so a second fade\n would multiply the two down to roughly a tenth opacity. No `type` is\n passed, so the `context` mod stays off and the toggle keeps its margins.\n */}\n <ItemActionProvider isDisabled={rest.isDisabled}>\n <ItemAction\n // No `type` — the default `current` type inherits the input's own text\n // color, so the toggle follows the field's theme, validation state and\n // disabled state rather than staying opaque against faded text.\n // A toggle button keeps one name and reports its state with\n // `aria-pressed`: pressed means the password is shown.\n tooltip={t('passwordInput.showPassword', 'Show password')}\n aria-pressed={type === 'text'}\n icon={type === 'password' ? <EyeInvisibleIcon /> : <EyeIcon />}\n onPress={toggleType}\n />\n </ItemActionProvider>\n </>\n );\n\n return (\n <TextInputBase\n ref={ref}\n labelProps={mergedLabelProps}\n inputProps={mergeProps(\n inputProps,\n { 'data-input-type': 'passwordinput' },\n userInputProps,\n )}\n inputRef={inputRef}\n inputStyles={{ paddingRight: '4x' }}\n type={type}\n suffixPosition=\"after\"\n suffix={wrappedSuffix}\n multiLine={multiLine}\n {...rest}\n {...displayedValidation.getDisplayedValidation(rest, validation)}\n />\n );\n}\n\n/**\n * PasswordInputs are password inputs that allow users to input passwords or code entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _PasswordInput = forwardRef(PasswordInput);\n\n(_PasswordInput as any).cubeInputType = 'Text';\n_PasswordInput.displayName = 'PasswordInput';\n\nexport { _PasswordInput as PasswordInput };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCA,SAAA2B,cAAAC,UAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAIE,MAAA,EAAAC,MAAczB,QAAQ;CAAE,IAAA0B;CAAA,IAAAH,EAAA,OAAAF,UAAA;EAEbK,KAAApB,wBAAwBe,QAAQ;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAA5CF,WAAWA;CAAH,IAAAM;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EAC4BF,KAAA;GAAAG,0BACR;GAAQC,qBACb;GAAIC,kBACPC;EAIpB;EAACV,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CA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GAChBK;EAAI,GACJO,oBAAmBqB,uBAAwB5B,MAAMQ,UAAU;CAAC,CAAA;AAChE;;;;;;AAtGN,SAAAS,OAAAY,QAAA;CAAA,OAuDuBzC,WAAS,aAAT,SAAA;AAAyC;AAvDhE,SAAAF,MAAAP,IAAA;CAUuB,MAAA,EAAAwB,OAAAC,aAAAzB;CAAmB,OAAM;EAAAwB,OACnCA,OAAK2B,SAAiB,KAAtB;EAAuB1B;CAEhC;AAAC;AAkGL,MAAM2B,iBAAiBpF,WAAW0B,aAAa;AAE/C,eAAwB2D,gBAAgB;AACxCD,eAAeE,cAAc"}
|
|
@@ -6,13 +6,14 @@ import "../../content/Item/index.js";
|
|
|
6
6
|
import { CubeItemButtonProps } from "../../actions/ItemButton/ItemButton.js";
|
|
7
7
|
import "../../actions/index.js";
|
|
8
8
|
import { CubeItemBaseProps as CubeItemProps } from "../../content/Item/Item.js";
|
|
9
|
+
import { FieldLayoutStyleProps } from "../../form/field-layout.js";
|
|
9
10
|
import { CubeListBoxProps, ListBox } from "../ListBox/ListBox.js";
|
|
10
|
-
import { BasePropsWithoutChildren,
|
|
11
|
+
import { BasePropsWithoutChildren, ContainerStyleProps, Styles } from "@tenphi/tasty";
|
|
11
12
|
import { ForwardedRef, MutableRefObject, ReactElement, ReactNode, RefObject } from "react";
|
|
12
13
|
import { Placement } from "react-aria";
|
|
13
14
|
import { ListState, Section } from "react-stately";
|
|
14
15
|
//#region src/components/fields/Picker/Picker.d.ts
|
|
15
|
-
export interface CubePickerProps<T> extends Omit<CubeListBoxProps<T>, 'size' | 'shape' | 'emptyLabel' | 'isFocusWithin'>, Omit<CubeItemProps, 'children' | 'size' | 'tooltip'>, BasePropsWithoutChildren,
|
|
16
|
+
export interface CubePickerProps<T> extends Omit<CubeListBoxProps<T>, 'size' | 'shape' | 'emptyLabel' | 'isFocusWithin'>, Omit<CubeItemProps, 'children' | 'size' | 'tooltip' | keyof ContainerStyleProps>, BasePropsWithoutChildren, FieldLayoutStyleProps, FieldBaseProps<string | number | readonly (string | number)[] | null | undefined>, Pick<CubeItemButtonProps, 'type' | 'theme' | 'icon' | 'rightIcon' | 'prefix' | 'suffix' | 'hotkeys' | 'shape'> {
|
|
16
17
|
/** Accessible name for the picker trigger when there is no visible label. */
|
|
17
18
|
'aria-label'?: string;
|
|
18
19
|
/** Ids of elements that also describe the trigger, beside the displayed value and the field's own description and message. */
|
|
@@ -49,7 +50,12 @@ export interface CubePickerProps<T> extends Omit<CubeListBoxProps<T>, 'size' | '
|
|
|
49
50
|
placement?: Placement;
|
|
50
51
|
/** Minimum padding in pixels between the popover and viewport edges */
|
|
51
52
|
containerPadding?: number;
|
|
52
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Tooltip for the trigger. The info badge next to the field's label is
|
|
55
|
+
* `labelTooltip`.
|
|
56
|
+
*/
|
|
57
|
+
tooltip?: CubeItemProps['tooltip'];
|
|
58
|
+
/** @deprecated Use `tooltip`. */
|
|
53
59
|
triggerTooltip?: CubeItemProps['tooltip'];
|
|
54
60
|
/** Description for the trigger button (separate from field description) */
|
|
55
61
|
triggerDescription?: CubeItemProps['description'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
2
|
-
import {
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.202.0 | Cube Dev Team */
|
|
2
|
+
import { mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { Text as _Text } from "../../content/Text.js";
|
|
4
4
|
import { isTextOnly } from "../../../utils/react/isTextOnly.js";
|
|
5
5
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -15,23 +15,20 @@ import { Dialog } from "../../overlays/Dialog/Dialog.js";
|
|
|
15
15
|
import { allowOverlayKeysToPropagate } from "../../../utils/react/overlayKeyPropagation.js";
|
|
16
16
|
import { getValidationTheme } from "../../form/validation/resolve-validation-props.js";
|
|
17
17
|
import { getValidationIcon } from "../../form/validation/ValidationIndicator.js";
|
|
18
|
+
import { TRIGGER_TOOLTIP_WARNING } from "../../form/legacy-tooltip.js";
|
|
18
19
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
19
20
|
import { wrapWithField } from "../../form/wrapper.js";
|
|
21
|
+
import { splitFieldLayout } from "../../form/field-layout.js";
|
|
20
22
|
import { DialogTrigger } from "../../overlays/Dialog/DialogTrigger.js";
|
|
21
23
|
import { ListBox } from "../ListBox/ListBox.js";
|
|
22
24
|
import { TriggerActions } from "../TriggerActions.js";
|
|
23
25
|
import { processSelectionArray } from "../../../utils/selection.js";
|
|
24
|
-
import {
|
|
26
|
+
import { filterBaseProps, tasty } from "@tenphi/tasty";
|
|
25
27
|
import { forwardRef, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
26
28
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
27
29
|
import { FocusScope, mergeProps, useLabel } from "react-aria";
|
|
28
30
|
import { Section, useListState } from "react-stately";
|
|
29
31
|
//#region src/components/fields/Picker/Picker.tsx
|
|
30
|
-
const PROP_STYLES = [
|
|
31
|
-
...BASE_STYLES,
|
|
32
|
-
...OUTER_STYLES,
|
|
33
|
-
...COLOR_STYLES
|
|
34
|
-
];
|
|
35
32
|
const PickerWrapper = tasty({
|
|
36
33
|
qa: "PickerWrapper",
|
|
37
34
|
styles: {
|
|
@@ -56,8 +53,10 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
56
53
|
};
|
|
57
54
|
return fieldProps;
|
|
58
55
|
} });
|
|
59
|
-
let { id, qa, label, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, extra, icon, rightIcon, prefix, suffix, actions, hotkeys, triggerTooltip, triggerDescription, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, isDisabled, isLoading, message, mods: externalMods, description, descriptionPlacement, placeholder, size = "medium", styles, listBoxStyles, popoverStyles, type = "outline", theme = "default", shape, labelSuffix, shouldFocusWrap, children, shouldFlip = true, targetRef, placement = "bottom start", containerPadding = 8, selectedKey, defaultSelectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, onSelectionChange, selectionMode = "single", listStateRef, focusOnHover, showSelectAll, selectAllLabel = t("picker.all", "All"), items, header, footer, headerStyles, footerStyles, triggerStyles, renderSummary, isCheckable, allValueProps, listStyles, optionStyles, sectionStyles, headingStyles, listGap, listRef, disallowEmptySelection, shouldUseVirtualFocus, onEscape, onOptionClick, isClearable, clearLabel, onClear, sortSelectedToTop, onOpenChange, listStateRef: externalListStateRef, ...otherProps } = props;
|
|
60
|
-
|
|
56
|
+
let { id, qa, label, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, extra, icon, rightIcon, prefix, suffix, actions, hotkeys, tooltip, triggerTooltip, triggerDescription, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, isDisabled, isLoading, message, mods: externalMods, description, descriptionPlacement, placeholder, size = "medium", styles, listBoxStyles, popoverStyles, type = "outline", theme = "default", shape, labelSuffix, shouldFocusWrap, children, shouldFlip = true, targetRef, placement = "bottom start", containerPadding = 8, selectedKey, defaultSelectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, onSelectionChange, selectionMode = "single", listStateRef, focusOnHover, showSelectAll, selectAllLabel = t("picker.all", "All"), items, header, footer, headerStyles, footerStyles, triggerStyles, renderSummary, isCheckable, allValueProps, listStyles, optionStyles, sectionStyles, headingStyles, listGap, listRef, disallowEmptySelection, shouldUseVirtualFocus, onEscape, onOptionClick, isClearable, clearLabel, onClear, sortSelectedToTop, onOpenChange, listStateRef: externalListStateRef, ...otherProps } = props;
|
|
57
|
+
const fieldLayout = splitFieldLayout(props);
|
|
58
|
+
styles = fieldLayout.styles;
|
|
59
|
+
useWarn(triggerTooltip !== void 0, TRIGGER_TOOLTIP_WARNING);
|
|
61
60
|
useWarn(isCheckable === false && selectionMode === "single", {
|
|
62
61
|
key: ["picker-checkable-single-mode"],
|
|
63
62
|
args: ["CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior."]
|
|
@@ -279,7 +278,7 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
279
278
|
prefix,
|
|
280
279
|
suffix,
|
|
281
280
|
hotkeys,
|
|
282
|
-
tooltip: triggerTooltip,
|
|
281
|
+
tooltip: tooltip ?? triggerTooltip,
|
|
283
282
|
description: triggerDescription,
|
|
284
283
|
descriptionPlacement,
|
|
285
284
|
styles: triggerStyles,
|
|
@@ -387,6 +386,8 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
387
386
|
});
|
|
388
387
|
return wrapWithField(pickerField, {
|
|
389
388
|
...props,
|
|
389
|
+
...fieldLayout.field,
|
|
390
|
+
tooltip: void 0,
|
|
390
391
|
labelProps: mergeProps(labelProps, props.labelProps)
|
|
391
392
|
});
|
|
392
393
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.js","names":["CollectionChildren","FocusableRefValue","BASE_STYLES","BasePropsWithoutChildren","BaseStyleProps","COLOR_STYLES","ColorStyleProps","filterBaseProps","OUTER_STYLES","OuterStyleProps","Styles","tasty","ForwardedRef","forwardRef","MutableRefObject","ReactElement","ReactNode","RefObject","useEffect","useId","useMemo","useRef","useState","FocusScope","Key","mergeProps","Placement","useLabel","Section","BaseSection","ListState","useListState","useEvent","useWarn","useI18n","CloseIcon","DirectionIcon","LoadingIcon","isTextOnly","allowOverlayKeysToPropagate","processSelectionArray","extractStyles","mergeStyleLayers","CubeItemButtonProps","ItemAction","ItemButton","CubeItemProps","Text","getValidationIcon","getValidationTheme","useFieldProps","wrapWithField","Dialog","DialogTrigger","CubeListBoxProps","ListBox","TriggerActions","TriggerIcon","KeyboardEvent","RAKeyboardEvent","FieldBaseProps","CubePickerProps","Omit","T","Pick","placeholder","size","listBoxStyles","popoverStyles","triggerStyles","isCheckable","shouldFlip","targetRef","HTMLElement","placement","containerPadding","triggerTooltip","triggerDescription","renderSummary","args","selectedLabels","selectedKeys","selectedLabel","selectedKey","selectionMode","listStateRef","mods","Record","isClearable","clearLabel","onClear","actions","sortSelectedToTop","onOpenChange","isOpen","PROP_STYLES","PickerWrapper","qa","styles","display","flow","gridRows","placeContent","placeItems","Picker","props","ref","t","valuePropsMapper","value","onChange","fieldProps","onSelectionChange","key","Array","isArray","id","label","ariaLabel","ariaDescribedBy","extra","icon","rightIcon","prefix","suffix","hotkeys","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","isLoading","message","externalMods","description","descriptionPlacement","type","theme","shape","labelSuffix","shouldFocusWrap","children","defaultSelectedKey","defaultSelectedKeys","disabledKeys","focusOnHover","showSelectAll","selectAllLabel","items","header","footer","headerStyles","footerStyles","allValueProps","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","disallowEmptySelection","shouldUseVirtualFocus","onEscape","onOptionClick","externalListStateRef","otherProps","internalSelectedKey","setInternalSelectedKey","internalSelectedKeys","setInternalSelectedKeys","isPopoverOpen","setIsPopoverOpen","triggerRef","HTMLButtonElement","valueId","labelProps","triggerLabelProps","labelElementType","undefined","pickerAriaLabel","String","trim","triggerWidthRef","isControlledSingle","isControlledMultiple","effectiveSelectedKey","effectiveSelectedKeys","internalListStateRef","current","cachedItemsOrder","latestSelectionRef","single","multiple","map","selectionWhenClosed","sortSelectedToTopExplicit","shouldSortSelectedToTop","finalItems","selectedKeySet","Set","length","forEach","k","add","itemsArray","from","selectedItems","unselectedItems","item","has","push","sorted","localCollectionState","collection","labels","textValue","keysToGet","getItem","filter","Boolean","hasSelection","handleOpenChange","UNSAFE_getDOMNode","offsetWidth","keyboardProps","onKeyDown","e","preventDefault","clearValue","focus","triggerContent","join","showClearButton","isReadOnly","validationIcon","paintedTheme","hasCustomRightIcon","triggerRightIcon","hasTriggerActions","triggerActions","pressed","triggerValueId","triggerDescribedBy","triggerElement","handleSelectionChange","selection","normalized","handleEscape","handleOptionClick","pickerField","eventProps","width","Item","Action","Object","defineProperty","enumerable","configurable","Text","TriggerIcon","ItemButton","BaseSection"],"sources":["../../../../src/components/fields/Picker/Picker.tsx"],"sourcesContent":["import { CollectionChildren, FocusableRefValue } from '@react-types/shared';\nimport {\n BASE_STYLES,\n BasePropsWithoutChildren,\n BaseStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n filterBaseProps,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FocusScope, Key, mergeProps, Placement, useLabel } from 'react-aria';\nimport { Section as BaseSection, ListState, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { isTextOnly } from '../../../utils/react/isTextOnly';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { processSelectionArray } from '../../../utils/selection';\nimport { extractStyles, mergeStyleLayers } from '../../../utils/styles';\nimport { CubeItemButtonProps, ItemAction, ItemButton } from '../../actions';\nimport { CubeItemProps } from '../../content/Item';\nimport { Text } from '../../content/Text';\nimport {\n getValidationIcon,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport { Dialog } from '../../overlays/Dialog/Dialog';\nimport { DialogTrigger } from '../../overlays/Dialog/DialogTrigger';\nimport { CubeListBoxProps, ListBox } from '../ListBox/ListBox';\nimport { TriggerActions, TriggerIcon } from '../TriggerActions';\n\nimport type { KeyboardEvent as RAKeyboardEvent } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\nexport interface CubePickerProps<T>\n extends\n Omit<\n CubeListBoxProps<T>,\n 'size' | 'shape' | 'emptyLabel' | 'isFocusWithin'\n >,\n // `tooltip` is the trigger's, and on a picker the trigger's is spelled\n // `triggerTooltip`; the label's info badge is `labelTooltip`.\n Omit<CubeItemProps, 'children' | 'size' | 'tooltip'>,\n BasePropsWithoutChildren,\n BaseStyleProps,\n OuterStyleProps,\n ColorStyleProps,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n >,\n Pick<\n CubeItemButtonProps,\n | 'type'\n | 'theme'\n | 'icon'\n | 'rightIcon'\n | 'prefix'\n | 'suffix'\n | 'hotkeys'\n | 'shape'\n > {\n /** Accessible name for the picker trigger when there is no visible label. */\n 'aria-label'?: string;\n /** Ids of elements that also describe the trigger, beside the displayed value and the field's own description and message. */\n 'aria-describedby'?: string;\n /** Placeholder text when no selection is made */\n placeholder?: string;\n /** Size of the picker component */\n size?: 'small' | 'medium' | 'large';\n /** Custom styles for the list box popover */\n listBoxStyles?: Styles;\n /** Custom styles for the popover container */\n popoverStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Whether to show checkboxes for multiple selection mode */\n isCheckable?: boolean;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /**\n * The ref of the element the popover should visually attach itself to.\n * Defaults to the trigger button.\n *\n * Forwarded to `DialogTrigger`, so the anchor also becomes what outside-click\n * dismissal treats as the trigger. The popover's `minWidth` stays tied to the\n * trigger button, not to this element.\n */\n targetRef?: RefObject<HTMLElement | null>;\n /**\n * Placement of the popover relative to the anchor.\n * Accepts React Aria's `Placement` strings (e.g. `'bottom start'`,\n * `'top start'`, `'right top'`, `'left top'`).\n * @default 'bottom start'\n */\n placement?: Placement;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /** Tooltip for the trigger button (separate from `labelTooltip`) */\n triggerTooltip?: CubeItemProps['tooltip'];\n /** Description for the trigger button (separate from field description) */\n triggerDescription?: CubeItemProps['description'];\n\n /**\n * Custom renderer for the summary shown inside the trigger when there is a selection.\n *\n * For `selectionMode=\"multiple\"` the function receives:\n * - `selectedLabels`: array of labels of the selected items.\n * - `selectedKeys`: array of keys of the selected items or \"all\".\n *\n * For `selectionMode=\"single\"` the function receives:\n * - `selectedLabel`: label of the selected item.\n * - `selectedKey`: key of the selected item.\n *\n * The function should return a `ReactNode` that will be rendered inside the trigger.\n * Set to `false` to hide the summary text completely.\n */\n renderSummary?:\n | ((args: {\n selectedLabels?: string[];\n selectedKeys?: 'all' | (string | number)[];\n selectedLabel?: string;\n selectedKey?: string | number | null;\n selectionMode?: 'single' | 'multiple';\n }) => ReactNode)\n | false;\n\n /** Ref to access internal ListBox state */\n listStateRef?: MutableRefObject<ListState<T>>;\n /** Additional modifiers for styling the Picker */\n mods?: Record<string, boolean>;\n /** Whether the picker is clearable using a clear button in the rightIcon slot */\n isClearable?: boolean;\n /** Accessible name for the built-in clear button. Defaults to a localized \"Clear value\". */\n clearLabel?: string;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n /**\n * Custom actions rendered inside the trigger, to the left of the built-in\n * clear button and dropdown caret. Use `Picker.Action` so they match the\n * trigger's size and theme.\n *\n * Pressing one runs its handler without opening or closing the popover —\n * including while the popover is open. Actions follow the trigger's disabled\n * state but NOT `isReadOnly`, since a read-only field can still host an\n * action that does not change the value; pass `isDisabled` yourself for one\n * that does.\n */\n actions?: ReactNode;\n /**\n * Sort selected item(s) to the top when the popover opens.\n * Only works when using the `items` prop (data-driven mode).\n * Supports both single and multiple selection modes.\n * @default true when items are provided, false when using JSX children\n */\n sortSelectedToTop?: boolean;\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\nconst PickerWrapper = tasty({\n qa: 'PickerWrapper',\n styles: {\n display: 'inline-grid',\n flow: 'column',\n gridRows: '1sf',\n placeContent: 'stretch',\n placeItems: 'stretch',\n },\n});\n\nexport const Picker = forwardRef(function Picker<T extends object>(\n props: CubePickerProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: Record<string, unknown> = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: Key | null | 'all' | Key[]) => {\n if (props.selectionMode === 'multiple') {\n // Handle \"all\" selection and array selections\n if (key === 'all') {\n onChange('all');\n } else {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n }\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n let {\n id,\n qa,\n label,\n 'aria-label': ariaLabel,\n // The field's description and message describe the trigger, which is the\n // control, not the wrapper the rest of these props land on.\n 'aria-describedby': ariaDescribedBy,\n extra,\n icon,\n rightIcon,\n prefix,\n suffix,\n actions,\n hotkeys,\n triggerTooltip,\n triggerDescription,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n message,\n mods: externalMods,\n description,\n descriptionPlacement,\n placeholder,\n size = 'medium',\n styles,\n listBoxStyles,\n popoverStyles,\n type = 'outline',\n theme = 'default',\n shape,\n labelSuffix,\n shouldFocusWrap,\n children,\n shouldFlip = true,\n targetRef,\n placement = 'bottom start',\n containerPadding = 8,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n selectionMode = 'single',\n listStateRef,\n focusOnHover,\n showSelectAll,\n selectAllLabel = t('picker.all', 'All'),\n items,\n header,\n footer,\n headerStyles,\n footerStyles,\n triggerStyles,\n renderSummary,\n isCheckable,\n allValueProps,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n disallowEmptySelection,\n shouldUseVirtualFocus,\n onEscape,\n onOptionClick,\n isClearable,\n clearLabel,\n onClear,\n sortSelectedToTop,\n onOpenChange,\n listStateRef: externalListStateRef,\n ...otherProps\n } = props;\n\n styles = extractStyles(otherProps, PROP_STYLES, styles);\n\n // Warn if isCheckable is false in single selection mode\n useWarn(isCheckable === false && selectionMode === 'single', {\n key: ['picker-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n // Internal selection state (uncontrolled scenario)\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(\n defaultSelectedKey ?? null,\n );\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n 'all' | Key[]\n >(defaultSelectedKeys ?? []);\n\n // Popover state — used as controlled prop for DialogTrigger\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const triggerRef = useRef<FocusableRefValue<HTMLButtonElement>>(null);\n const valueId = useId();\n const { labelProps, fieldProps: triggerLabelProps } = useLabel({\n id: props.id,\n label,\n labelElementType: 'span',\n 'aria-label':\n ariaLabel ?? (!label ? t('picker.pickerAriaLabel', 'Picker') : undefined),\n 'aria-labelledby': props['aria-labelledby'],\n });\n const pickerAriaLabel =\n `${ariaLabel ?? (isTextOnly(label) ? String(label ?? '') : '')} ${t('picker.pickerAriaLabel', 'Picker')}`.trim();\n\n // Measured lazily on popover open instead of on every render\n const triggerWidthRef = useRef<number | undefined>(undefined);\n\n const isControlledSingle = selectedKey !== undefined;\n const isControlledMultiple = selectedKeys !== undefined;\n\n const effectiveSelectedKey = isControlledSingle\n ? selectedKey\n : internalSelectedKey;\n const effectiveSelectedKeys = isControlledMultiple\n ? selectedKeys\n : internalSelectedKeys;\n\n // Ref to access internal ListBox state for collection API\n const internalListStateRef = useRef<ListState<T>>(null);\n\n // Sync internal ref with external ref if provided\n useEffect(() => {\n if (externalListStateRef && internalListStateRef.current) {\n externalListStateRef.current = internalListStateRef.current;\n }\n }, [externalListStateRef]);\n\n // Cache for sorted items array when using `items` prop\n const cachedItemsOrder = useRef<T[] | null>(null);\n\n const latestSelectionRef = useRef<{\n single: string | null;\n multiple: string[];\n }>({\n single: effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n });\n\n useEffect(() => {\n latestSelectionRef.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }, [effectiveSelectedKey, effectiveSelectedKeys, selectionMode]);\n\n const selectionWhenClosed = useRef<{\n single: string | null;\n multiple: string[];\n }>({ single: null, multiple: [] });\n\n const sortSelectedToTopExplicit = sortSelectedToTop !== undefined;\n const shouldSortSelectedToTop = sortSelectedToTop ?? (items ? true : false);\n\n useWarn(sortSelectedToTopExplicit && shouldSortSelectedToTop && !items, {\n key: ['picker-sort-selected-to-top-children'],\n args: [\n 'Picker: sortSelectedToTop only works with the items prop. Sorting will be skipped when using JSX children.',\n ],\n });\n\n useEffect(() => {\n cachedItemsOrder.current = null;\n }, [items]);\n\n useEffect(() => {\n if (!isPopoverOpen) {\n selectionWhenClosed.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }\n }, [\n effectiveSelectedKey,\n effectiveSelectedKeys,\n isPopoverOpen,\n selectionMode,\n ]);\n\n const finalItems = useMemo(() => {\n if (!items || !shouldSortSelectedToTop) return items;\n if (!isPopoverOpen) return items;\n if (cachedItemsOrder.current) return cachedItemsOrder.current;\n\n const selectedKeySet = new Set<string>();\n\n if (selectionMode === 'multiple') {\n if (\n selectionWhenClosed.current.multiple.length === 0 ||\n effectiveSelectedKeys === 'all'\n ) {\n return items;\n }\n selectionWhenClosed.current.multiple.forEach((k) =>\n selectedKeySet.add(k),\n );\n } else if (selectionWhenClosed.current.single) {\n selectedKeySet.add(selectionWhenClosed.current.single);\n }\n\n if (selectedKeySet.size === 0) return items;\n\n const itemsArray = Array.isArray(items) ? items : Array.from(items);\n const selectedItems: T[] = [];\n const unselectedItems: T[] = [];\n\n itemsArray.forEach((item) => {\n const key = (item as any)?.key ?? (item as any)?.id;\n if (key != null && selectedKeySet.has(String(key))) {\n selectedItems.push(item);\n } else {\n unselectedItems.push(item);\n }\n });\n\n const sorted = [...selectedItems, ...unselectedItems];\n\n cachedItemsOrder.current = sorted;\n\n return sorted;\n }, [items, shouldSortSelectedToTop, selectionMode, isPopoverOpen]);\n\n // Create local collection state for reading item data (labels, etc.)\n // This allows us to read item labels even before the popover opens\n const localCollectionState = useListState({\n children,\n items: finalItems, // Use sorted items to match what's shown in popover\n selectionMode: 'none', // Don't manage selection in this state\n });\n\n const selectedLabels = useMemo(() => {\n const collection = localCollectionState?.collection;\n\n if (selectionMode === 'multiple' && effectiveSelectedKeys === 'all') {\n if (!collection) return [];\n const labels: string[] = [];\n for (const item of collection) {\n if (item.type === 'item') {\n labels.push(item.textValue || String(item.key));\n }\n }\n return labels;\n }\n\n const keysToGet =\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? effectiveSelectedKeys || []\n : effectiveSelectedKey != null\n ? [effectiveSelectedKey]\n : [];\n\n return keysToGet\n .map((key) => {\n const item = collection?.getItem(key);\n return item?.textValue || String(key);\n })\n .filter(Boolean);\n }, [\n selectionMode,\n effectiveSelectedKeys,\n effectiveSelectedKey,\n localCollectionState?.collection,\n ]);\n\n const hasSelection = selectedLabels.length > 0;\n\n // ---------------------------------------------------------------------------\n // Popover lifecycle — all effects moved out of the inline renderTrigger\n // function so they have a stable component identity and don't tear\n // down/setup on every parent re-render.\n // DialogTrigger is controlled via isOpen/onOpenChange.\n // ---------------------------------------------------------------------------\n\n const handleOpenChange = useEvent((isOpen: boolean) => {\n if (isOpen === isPopoverOpen) return;\n\n if (isOpen) {\n triggerWidthRef.current =\n triggerRef?.current?.UNSAFE_getDOMNode()?.offsetWidth;\n }\n setIsPopoverOpen(isOpen);\n if (!isOpen) {\n selectionWhenClosed.current = { ...latestSelectionRef.current };\n cachedItemsOrder.current = null;\n }\n onOpenChange?.(isOpen);\n });\n\n // Popover sync is handled by the inner `DialogTrigger` (type=\"popover\").\n\n // Keyboard handler for arrow keys to open popover\n // Deliberately NOT `useKeyboard`. `ItemButton` already runs whatever\n // `onKeyDown` it is given through `useFocusable`'s own `useKeyboard`, and a\n // second wrapper here would leave `continuePropagation()` releasing only the\n // inner one while the outer still stopped the event — `Escape` reached the\n // trigger and died there (CUB-4839). Handed over plain, this IS the outer\n // wrapper's handler, so the opt-out applies to the event that travels.\n const keyboardProps = {\n onKeyDown: (e: RAKeyboardEvent) => {\n allowOverlayKeysToPropagate(e);\n\n if ((e.key === 'ArrowUp' || e.key === 'ArrowDown') && !isPopoverOpen) {\n e.preventDefault();\n handleOpenChange(true);\n\n return;\n }\n },\n };\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (selectionMode === 'multiple') {\n if (!isControlledMultiple) {\n setInternalSelectedKeys([]);\n }\n onSelectionChange?.([]);\n } else {\n if (!isControlledSingle) {\n setInternalSelectedKey(null);\n }\n onSelectionChange?.(null);\n }\n\n handleOpenChange(false);\n triggerRef?.current?.focus?.();\n onClear?.();\n\n return false;\n });\n\n // ---------------------------------------------------------------------------\n // Trigger content\n // ---------------------------------------------------------------------------\n\n const triggerContent = useMemo((): ReactNode => {\n if (typeof renderSummary === 'function') {\n if (selectionMode === 'single') {\n return renderSummary({\n selectedLabel: selectedLabels[0],\n selectedKey: effectiveSelectedKey ?? null,\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'single',\n });\n }\n\n return renderSummary({\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'multiple',\n });\n } else if (renderSummary === false) {\n return null;\n }\n\n if (!hasSelection) {\n return <Text.Placeholder>{placeholder}</Text.Placeholder>;\n } else if (selectionMode === 'single') {\n return selectedLabels[0] || null;\n } else if (effectiveSelectedKeys === 'all') {\n return selectAllLabel;\n } else {\n return selectedLabels.join(', ') || null;\n }\n }, [\n renderSummary,\n selectionMode,\n selectedLabels,\n effectiveSelectedKey,\n effectiveSelectedKeys,\n hasSelection,\n placeholder,\n selectAllLabel,\n ]);\n\n const showClearButton =\n isClearable && hasSelection && !isDisabled && !props.isReadOnly;\n\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n // Must be the SAME expression the trigger is painted with, not the raw\n // `theme`: this tells an action which surface it sits on, and validation\n // overrides the theme. With `theme=\"special\"` on an invalid field the trigger\n // renders `danger` — a light surface — so forwarding `special` would hand the\n // action the strong dark-purple alpha ramp and make hover/press read far too\n // heavy.\n const paintedTheme = getValidationTheme(theme, { isInvalid, isValid });\n //\n // It reaches the trailing actions through `ItemButton`'s wrapper, which is\n // what provides `ItemActionContext` for a run rendered outside the button —\n // so passing it as the trigger's `theme` is all that is needed.\n\n if (validationIcon) {\n suffix = (\n <>\n {suffix}\n {validationIcon}\n </>\n );\n }\n\n // A caller's `rightIcon` keeps the `rightIcon` slot: it accepts a render\n // function resolved against the trigger's mods, which only that slot does, and\n // it is also what a caller's `RightIcon` styles target. It replaces the\n // built-in control, exactly as before — including under `isLoading`, where the\n // spinner replaces it in turn.\n const hasCustomRightIcon = rightIcon !== undefined;\n const triggerRightIcon = hasCustomRightIcon ? (\n isLoading ? (\n <LoadingIcon />\n ) : (\n rightIcon\n )\n ) : undefined;\n\n // With a caller's own `rightIcon` the built-in control moves into that slot,\n // leaving the run with whatever the caller passed — possibly nothing. `null`\n // rather than nothing at all: the run stays in the markup, so the trigger does\n // not restructure if actions arrive later, but the row stops counting it as\n // end content. That is what keeps an icon-only trigger with `rightIcon={null}`\n // square, as it was before the run existed.\n const hasTriggerActions = !hasCustomRightIcon || !!actions;\n\n // Everything trailing that is NOT the caller's own icon goes into the actions\n // run — a sibling of the `<button>`, so the clear button is no longer nested\n // inside one. See `TriggerActions`.\n const triggerActions = (\n <TriggerActions\n actions={actions}\n builtIn={\n hasCustomRightIcon ? null : isLoading ? (\n <TriggerIcon>\n <LoadingIcon />\n </TriggerIcon>\n ) : showClearButton ? (\n <ItemAction\n icon={<CloseIcon />}\n size={size}\n qa=\"PickerClearButton\"\n // See `Select`: `ItemAction` names itself from `aria-label` or a\n // string `tooltip`, and warns for neither.\n aria-label={clearLabel ?? t('picker.clearValue', 'Clear value')}\n // No explicit `type`/`theme` — the default `current` type inherits\n // the trigger's own text color, which already carries validation\n // state here, so this renders exactly as the explicit theme did\n // while also following a custom theme.\n mods={{ pressed: false }}\n onPress={clearValue}\n />\n ) : (\n <TriggerIcon>\n <DirectionIcon to={isPopoverOpen ? 'top' : 'bottom'} />\n </TriggerIcon>\n )\n }\n />\n );\n\n // The trigger keeps the field label as its name, so queries by name stay\n // stable, and the value it shows (or the placeholder) is its description.\n const triggerValueId = triggerContent ? valueId : undefined;\n const triggerDescribedBy =\n [triggerValueId, ariaDescribedBy].filter(Boolean).join(' ') || undefined;\n\n // Trigger element — plain JSX with no hooks.\n const triggerElement = (\n <ItemButton\n ref={triggerRef as any}\n data-popover-trigger\n qa={qa || 'PickerTrigger'}\n type={type}\n theme={paintedTheme}\n size={size}\n shape={shape}\n isDisabled={isDisabled || isLoading}\n data-input-type=\"picker\"\n mods={{\n placeholder: !hasSelection,\n ...externalMods,\n }}\n icon={icon}\n rightIcon={triggerRightIcon}\n actions={hasTriggerActions ? triggerActions : null}\n prefix={prefix}\n suffix={suffix}\n hotkeys={hotkeys}\n tooltip={triggerTooltip}\n description={triggerDescription}\n descriptionPlacement={descriptionPlacement}\n styles={triggerStyles}\n {...keyboardProps}\n {...mergeProps(triggerLabelProps, { id })}\n labelProps={triggerValueId ? { id: triggerValueId } : undefined}\n // `DialogTrigger` leaves `aria-haspopup` out for dialogs; the popup the\n // trigger controls is the `Dialog` that holds the list.\n aria-haspopup=\"dialog\"\n aria-describedby={triggerDescribedBy}\n >\n {triggerContent}\n </ItemButton>\n );\n\n // ---------------------------------------------------------------------------\n // Selection change handler\n // ---------------------------------------------------------------------------\n\n const handleSelectionChange = useEvent((selection: any) => {\n if (selectionMode === 'single') {\n // With `disallowEmptySelection`, re-selecting the current item emits a\n // duplicate event (see `allowDuplicateSelectionEvents` below). Close the\n // popover but don't propagate the unchanged selection.\n if (\n disallowEmptySelection &&\n selection != null &&\n effectiveSelectedKey != null &&\n String(selection) === String(effectiveSelectedKey)\n ) {\n handleOpenChange(false);\n return;\n }\n\n if (!isControlledSingle) {\n setInternalSelectedKey(selection as Key | null);\n }\n } else {\n if (!isControlledMultiple) {\n let normalized: 'all' | Key[] = selection;\n\n if (selection === 'all') {\n normalized = 'all';\n } else if (Array.isArray(selection)) {\n normalized = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n normalized = processSelectionArray(selection as Set<Key>);\n }\n\n setInternalSelectedKeys(normalized);\n }\n }\n\n if (selectionMode === 'single') {\n latestSelectionRef.current.single =\n selection != null ? String(selection) : null;\n } else {\n if (selection === 'all') {\n latestSelectionRef.current.multiple = [];\n } else if (Array.isArray(selection)) {\n latestSelectionRef.current.multiple = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n latestSelectionRef.current.multiple = processSelectionArray(\n selection as Set<Key>,\n );\n } else {\n latestSelectionRef.current.multiple = [];\n }\n }\n\n onSelectionChange?.(selection);\n\n if (selectionMode === 'single') {\n handleOpenChange(false);\n }\n });\n\n const handleEscape = useEvent(() => {\n handleOpenChange(false);\n });\n\n const handleOptionClick = useEvent((key: Key) => {\n if ((selectionMode === 'multiple' && isCheckable) || key === '__ALL__') {\n handleOpenChange(false);\n }\n });\n\n const pickerField = (\n <PickerWrapper\n ref={ref}\n styles={styles}\n {...(filterBaseProps(otherProps, { eventProps: true }) as Record<\n string,\n unknown\n >)}\n >\n <DialogTrigger\n type=\"popover\"\n placement={placement}\n targetRef={targetRef}\n isOpen={isPopoverOpen}\n containerPadding={containerPadding}\n shouldFlip={shouldFlip}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {() => (\n <Dialog\n qa=\"PickerOverlay\"\n aria-label={pickerAriaLabel}\n display=\"grid\"\n styles={mergeStyleLayers(\n {\n gridRows: '1sf',\n width: 'max($overlay-min-width, 30x) max-content 50vw',\n '$overlay-min-width': '30x',\n },\n popoverStyles,\n )}\n tokens={\n triggerWidthRef.current\n ? { '$overlay-min-width': `${triggerWidthRef.current}px` }\n : undefined\n }\n >\n <FocusScope restoreFocus>\n <ListBox\n isBare\n autoFocus\n items={items ? (finalItems as typeof props.items) : undefined}\n aria-label={pickerAriaLabel}\n selectedKey={\n selectionMode === 'single' ? effectiveSelectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple'\n ? effectiveSelectedKeys\n : undefined\n }\n listStyles={listStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n listRef={listRef}\n disallowEmptySelection={disallowEmptySelection}\n allowDuplicateSelectionEvents={\n selectionMode === 'single' && !!disallowEmptySelection\n }\n disabledKeys={disabledKeys}\n focusOnHover={focusOnHover}\n shouldFocusWrap={shouldFocusWrap}\n selectionMode={selectionMode}\n isInvalid={isInvalid}\n isValid={isValid}\n isDisabled={isDisabled}\n isLoading={isLoading}\n stateRef={internalListStateRef}\n isCheckable={isCheckable}\n shape=\"popover\"\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n header={header}\n footer={footer}\n headerStyles={headerStyles}\n footerStyles={footerStyles}\n qa={`${props.qa || 'Picker'}ListBox`}\n allValueProps={allValueProps}\n onEscape={handleEscape}\n onOptionClick={handleOptionClick}\n onSelectionChange={handleSelectionChange}\n >\n {children as CollectionChildren<T>}\n </ListBox>\n </FocusScope>\n </Dialog>\n )}\n </DialogTrigger>\n </PickerWrapper>\n );\n\n return wrapWithField<Omit<CubePickerProps<T>, 'children'>>(pickerField, {\n ...props,\n labelProps: mergeProps(labelProps, props.labelProps),\n });\n}) as unknown as (<T>(\n props: CubePickerProps<T> & { ref?: ForwardedRef<HTMLElement> },\n) => ReactElement) & {\n Item: typeof ListBox.Item;\n Section: typeof BaseSection;\n Action: typeof ItemAction;\n};\n\nPicker.Item = ListBox.Item;\n\nPicker.Section = BaseSection;\n\nPicker.Action = ItemAction;\n\nObject.defineProperty(Picker, 'cubeInputType', {\n value: 'Picker',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqLA,MAAM+F,cAAc;CAAC,GAAG7F;CAAa,GAAGM;CAAc,GAAGH;AAAY;AAErE,MAAM2F,gBAAgBrF,MAAM;CAC1BsF,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC,YAAY;CACd;AACF,CAAC;AAED,MAAaC,SAAS3F,WAAW,SAAS2F,OACxCC,OACAC,KACA;CACA,MAAM,EAAEC,MAAMzE,QAAQ;CAEtBuE,QAAQvD,cAAcuD,OAAO,EAC3BG,mBAAmB,EAAEC,OAAOC,eAAe;EACzC,MAAMC,aAAsC,CAAC;EAE7C,IAAIN,MAAMrB,kBAAkB,YAC1B2B,WAAW9B,eAAe4B,SAAS,CAAA;OAEnCE,WAAW5B,cAAc0B,SAAS;EAGpCE,WAAWC,qBAAqBC,QAAoC;GAClE,IAAIR,MAAMrB,kBAAkB,YAAY;IAEtC,IAAI6B,QAAQ,OACVH,SAAS,KAAK;SAEdA,SAASG,MAAOC,MAAMC,QAAQF,GAAG,IAAIA,MAAM,CAACA,GAAG,IAAK,CAAA,CAAE;GAE1D,OACEH,SAASI,MAAMC,QAAQF,GAAG,IAAIA,IAAI,KAAKA,GAAG;EAE9C;EAEA,OAAOF;CACT,EACF,CAAC;CAED,IAAI,EACFK,IACAnB,IACAoB,OACA,cAAcC,WAGd,oBAAoBC,iBACpBC,OACAC,MACAC,WACAC,QACAC,QACAjC,SACAkC,SACAjD,gBACAC,oBACAiD,aACAC,YACAC,oBACAC,WACA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N;AAEhBmN,OAAOC,eAAexJ,QAAQ,iBAAiB;CAC7CK,OAAO;CACPoJ,YAAY;CACZC,cAAc;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Picker.js","names":["CollectionChildren","FocusableRefValue","BasePropsWithoutChildren","ContainerStyleProps","filterBaseProps","Styles","tasty","ForwardedRef","forwardRef","MutableRefObject","ReactElement","ReactNode","RefObject","useEffect","useId","useMemo","useRef","useState","FocusScope","Key","mergeProps","Placement","useLabel","Section","BaseSection","ListState","useListState","useEvent","useWarn","useI18n","CloseIcon","DirectionIcon","LoadingIcon","isTextOnly","allowOverlayKeysToPropagate","processSelectionArray","mergeStyleLayers","CubeItemButtonProps","ItemAction","ItemButton","CubeItemProps","Text","getValidationIcon","getValidationTheme","useFieldProps","wrapWithField","FieldLayoutStyleProps","splitFieldLayout","TRIGGER_TOOLTIP_WARNING","Dialog","DialogTrigger","CubeListBoxProps","ListBox","TriggerActions","TriggerIcon","KeyboardEvent","RAKeyboardEvent","FieldBaseProps","CubePickerProps","Omit","T","Pick","placeholder","size","listBoxStyles","popoverStyles","triggerStyles","isCheckable","shouldFlip","targetRef","HTMLElement","placement","containerPadding","tooltip","triggerTooltip","triggerDescription","renderSummary","args","selectedLabels","selectedKeys","selectedLabel","selectedKey","selectionMode","listStateRef","mods","Record","isClearable","clearLabel","onClear","actions","sortSelectedToTop","onOpenChange","isOpen","PickerWrapper","qa","styles","display","flow","gridRows","placeContent","placeItems","Picker","props","ref","t","valuePropsMapper","value","onChange","fieldProps","onSelectionChange","key","Array","isArray","id","label","ariaLabel","ariaDescribedBy","extra","icon","rightIcon","prefix","suffix","hotkeys","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","isLoading","message","externalMods","description","descriptionPlacement","type","theme","shape","labelSuffix","shouldFocusWrap","children","defaultSelectedKey","defaultSelectedKeys","disabledKeys","focusOnHover","showSelectAll","selectAllLabel","items","header","footer","headerStyles","footerStyles","allValueProps","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","disallowEmptySelection","shouldUseVirtualFocus","onEscape","onOptionClick","externalListStateRef","otherProps","fieldLayout","undefined","internalSelectedKey","setInternalSelectedKey","internalSelectedKeys","setInternalSelectedKeys","isPopoverOpen","setIsPopoverOpen","triggerRef","HTMLButtonElement","valueId","labelProps","triggerLabelProps","labelElementType","pickerAriaLabel","String","trim","triggerWidthRef","isControlledSingle","isControlledMultiple","effectiveSelectedKey","effectiveSelectedKeys","internalListStateRef","current","cachedItemsOrder","latestSelectionRef","single","multiple","map","selectionWhenClosed","sortSelectedToTopExplicit","shouldSortSelectedToTop","finalItems","selectedKeySet","Set","length","forEach","k","add","itemsArray","from","selectedItems","unselectedItems","item","has","push","sorted","localCollectionState","collection","labels","textValue","keysToGet","getItem","filter","Boolean","hasSelection","handleOpenChange","UNSAFE_getDOMNode","offsetWidth","keyboardProps","onKeyDown","e","preventDefault","clearValue","focus","triggerContent","join","showClearButton","isReadOnly","validationIcon","paintedTheme","hasCustomRightIcon","triggerRightIcon","hasTriggerActions","triggerActions","pressed","triggerValueId","triggerDescribedBy","triggerElement","handleSelectionChange","selection","normalized","handleEscape","handleOptionClick","pickerField","eventProps","width","field","Item","Action","Object","defineProperty","enumerable","configurable","Text","TriggerIcon","ItemButton","BaseSection"],"sources":["../../../../src/components/fields/Picker/Picker.tsx"],"sourcesContent":["import { CollectionChildren, FocusableRefValue } from '@react-types/shared';\nimport {\n BasePropsWithoutChildren,\n ContainerStyleProps,\n filterBaseProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FocusScope, Key, mergeProps, Placement, useLabel } from 'react-aria';\nimport { Section as BaseSection, ListState, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { isTextOnly } from '../../../utils/react/isTextOnly';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { processSelectionArray } from '../../../utils/selection';\nimport { mergeStyleLayers } from '../../../utils/styles';\nimport { CubeItemButtonProps, ItemAction, ItemButton } from '../../actions';\nimport { CubeItemProps } from '../../content/Item';\nimport { Text } from '../../content/Text';\nimport {\n getValidationIcon,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport { TRIGGER_TOOLTIP_WARNING } from '../../form/legacy-tooltip';\nimport { Dialog } from '../../overlays/Dialog/Dialog';\nimport { DialogTrigger } from '../../overlays/Dialog/DialogTrigger';\nimport { CubeListBoxProps, ListBox } from '../ListBox/ListBox';\nimport { TriggerActions, TriggerIcon } from '../TriggerActions';\n\nimport type { KeyboardEvent as RAKeyboardEvent } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\nexport interface CubePickerProps<T>\n extends\n Omit<\n CubeListBoxProps<T>,\n 'size' | 'shape' | 'emptyLabel' | 'isFocusWithin'\n >,\n // `tooltip` is declared below, for the trigger; the label's info badge is\n // `labelTooltip`. Of the item's style props, only the field layout ones\n // apply, through `FieldLayoutStyleProps`.\n Omit<\n CubeItemProps,\n 'children' | 'size' | 'tooltip' | keyof ContainerStyleProps\n >,\n BasePropsWithoutChildren,\n FieldLayoutStyleProps,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n >,\n Pick<\n CubeItemButtonProps,\n | 'type'\n | 'theme'\n | 'icon'\n | 'rightIcon'\n | 'prefix'\n | 'suffix'\n | 'hotkeys'\n | 'shape'\n > {\n /** Accessible name for the picker trigger when there is no visible label. */\n 'aria-label'?: string;\n /** Ids of elements that also describe the trigger, beside the displayed value and the field's own description and message. */\n 'aria-describedby'?: string;\n /** Placeholder text when no selection is made */\n placeholder?: string;\n /** Size of the picker component */\n size?: 'small' | 'medium' | 'large';\n /** Custom styles for the list box popover */\n listBoxStyles?: Styles;\n /** Custom styles for the popover container */\n popoverStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Whether to show checkboxes for multiple selection mode */\n isCheckable?: boolean;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /**\n * The ref of the element the popover should visually attach itself to.\n * Defaults to the trigger button.\n *\n * Forwarded to `DialogTrigger`, so the anchor also becomes what outside-click\n * dismissal treats as the trigger. The popover's `minWidth` stays tied to the\n * trigger button, not to this element.\n */\n targetRef?: RefObject<HTMLElement | null>;\n /**\n * Placement of the popover relative to the anchor.\n * Accepts React Aria's `Placement` strings (e.g. `'bottom start'`,\n * `'top start'`, `'right top'`, `'left top'`).\n * @default 'bottom start'\n */\n placement?: Placement;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /**\n * Tooltip for the trigger. The info badge next to the field's label is\n * `labelTooltip`.\n */\n tooltip?: CubeItemProps['tooltip'];\n /** @deprecated Use `tooltip`. */\n triggerTooltip?: CubeItemProps['tooltip'];\n /** Description for the trigger button (separate from field description) */\n triggerDescription?: CubeItemProps['description'];\n\n /**\n * Custom renderer for the summary shown inside the trigger when there is a selection.\n *\n * For `selectionMode=\"multiple\"` the function receives:\n * - `selectedLabels`: array of labels of the selected items.\n * - `selectedKeys`: array of keys of the selected items or \"all\".\n *\n * For `selectionMode=\"single\"` the function receives:\n * - `selectedLabel`: label of the selected item.\n * - `selectedKey`: key of the selected item.\n *\n * The function should return a `ReactNode` that will be rendered inside the trigger.\n * Set to `false` to hide the summary text completely.\n */\n renderSummary?:\n | ((args: {\n selectedLabels?: string[];\n selectedKeys?: 'all' | (string | number)[];\n selectedLabel?: string;\n selectedKey?: string | number | null;\n selectionMode?: 'single' | 'multiple';\n }) => ReactNode)\n | false;\n\n /** Ref to access internal ListBox state */\n listStateRef?: MutableRefObject<ListState<T>>;\n /** Additional modifiers for styling the Picker */\n mods?: Record<string, boolean>;\n /** Whether the picker is clearable using a clear button in the rightIcon slot */\n isClearable?: boolean;\n /** Accessible name for the built-in clear button. Defaults to a localized \"Clear value\". */\n clearLabel?: string;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n /**\n * Custom actions rendered inside the trigger, to the left of the built-in\n * clear button and dropdown caret. Use `Picker.Action` so they match the\n * trigger's size and theme.\n *\n * Pressing one runs its handler without opening or closing the popover —\n * including while the popover is open. Actions follow the trigger's disabled\n * state but NOT `isReadOnly`, since a read-only field can still host an\n * action that does not change the value; pass `isDisabled` yourself for one\n * that does.\n */\n actions?: ReactNode;\n /**\n * Sort selected item(s) to the top when the popover opens.\n * Only works when using the `items` prop (data-driven mode).\n * Supports both single and multiple selection modes.\n * @default true when items are provided, false when using JSX children\n */\n sortSelectedToTop?: boolean;\n /** Callback called when the popover open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nconst PickerWrapper = tasty({\n qa: 'PickerWrapper',\n styles: {\n display: 'inline-grid',\n flow: 'column',\n gridRows: '1sf',\n placeContent: 'stretch',\n placeItems: 'stretch',\n },\n});\n\nexport const Picker = forwardRef(function Picker<T extends object>(\n props: CubePickerProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: Record<string, unknown> = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: Key | null | 'all' | Key[]) => {\n if (props.selectionMode === 'multiple') {\n // Handle \"all\" selection and array selections\n if (key === 'all') {\n onChange('all');\n } else {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n }\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n let {\n id,\n qa,\n label,\n 'aria-label': ariaLabel,\n // The field's description and message describe the trigger, which is the\n // control, not the wrapper the rest of these props land on.\n 'aria-describedby': ariaDescribedBy,\n extra,\n icon,\n rightIcon,\n prefix,\n suffix,\n actions,\n hotkeys,\n tooltip,\n triggerTooltip,\n triggerDescription,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n message,\n mods: externalMods,\n description,\n descriptionPlacement,\n placeholder,\n size = 'medium',\n styles,\n listBoxStyles,\n popoverStyles,\n type = 'outline',\n theme = 'default',\n shape,\n labelSuffix,\n shouldFocusWrap,\n children,\n shouldFlip = true,\n targetRef,\n placement = 'bottom start',\n containerPadding = 8,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n selectionMode = 'single',\n listStateRef,\n focusOnHover,\n showSelectAll,\n selectAllLabel = t('picker.all', 'All'),\n items,\n header,\n footer,\n headerStyles,\n footerStyles,\n triggerStyles,\n renderSummary,\n isCheckable,\n allValueProps,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n disallowEmptySelection,\n shouldUseVirtualFocus,\n onEscape,\n onOptionClick,\n isClearable,\n clearLabel,\n onClear,\n sortSelectedToTop,\n onOpenChange,\n listStateRef: externalListStateRef,\n ...otherProps\n } = props;\n\n const fieldLayout = splitFieldLayout(props);\n\n styles = fieldLayout.styles;\n\n useWarn(triggerTooltip !== undefined, TRIGGER_TOOLTIP_WARNING);\n\n // Warn if isCheckable is false in single selection mode\n useWarn(isCheckable === false && selectionMode === 'single', {\n key: ['picker-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n // Internal selection state (uncontrolled scenario)\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(\n defaultSelectedKey ?? null,\n );\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n 'all' | Key[]\n >(defaultSelectedKeys ?? []);\n\n // Popover state — used as controlled prop for DialogTrigger\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const triggerRef = useRef<FocusableRefValue<HTMLButtonElement>>(null);\n const valueId = useId();\n const { labelProps, fieldProps: triggerLabelProps } = useLabel({\n id: props.id,\n label,\n labelElementType: 'span',\n 'aria-label':\n ariaLabel ?? (!label ? t('picker.pickerAriaLabel', 'Picker') : undefined),\n 'aria-labelledby': props['aria-labelledby'],\n });\n const pickerAriaLabel =\n `${ariaLabel ?? (isTextOnly(label) ? String(label ?? '') : '')} ${t('picker.pickerAriaLabel', 'Picker')}`.trim();\n\n // Measured lazily on popover open instead of on every render\n const triggerWidthRef = useRef<number | undefined>(undefined);\n\n const isControlledSingle = selectedKey !== undefined;\n const isControlledMultiple = selectedKeys !== undefined;\n\n const effectiveSelectedKey = isControlledSingle\n ? selectedKey\n : internalSelectedKey;\n const effectiveSelectedKeys = isControlledMultiple\n ? selectedKeys\n : internalSelectedKeys;\n\n // Ref to access internal ListBox state for collection API\n const internalListStateRef = useRef<ListState<T>>(null);\n\n // Sync internal ref with external ref if provided\n useEffect(() => {\n if (externalListStateRef && internalListStateRef.current) {\n externalListStateRef.current = internalListStateRef.current;\n }\n }, [externalListStateRef]);\n\n // Cache for sorted items array when using `items` prop\n const cachedItemsOrder = useRef<T[] | null>(null);\n\n const latestSelectionRef = useRef<{\n single: string | null;\n multiple: string[];\n }>({\n single: effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n });\n\n useEffect(() => {\n latestSelectionRef.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }, [effectiveSelectedKey, effectiveSelectedKeys, selectionMode]);\n\n const selectionWhenClosed = useRef<{\n single: string | null;\n multiple: string[];\n }>({ single: null, multiple: [] });\n\n const sortSelectedToTopExplicit = sortSelectedToTop !== undefined;\n const shouldSortSelectedToTop = sortSelectedToTop ?? (items ? true : false);\n\n useWarn(sortSelectedToTopExplicit && shouldSortSelectedToTop && !items, {\n key: ['picker-sort-selected-to-top-children'],\n args: [\n 'Picker: sortSelectedToTop only works with the items prop. Sorting will be skipped when using JSX children.',\n ],\n });\n\n useEffect(() => {\n cachedItemsOrder.current = null;\n }, [items]);\n\n useEffect(() => {\n if (!isPopoverOpen) {\n selectionWhenClosed.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }\n }, [\n effectiveSelectedKey,\n effectiveSelectedKeys,\n isPopoverOpen,\n selectionMode,\n ]);\n\n const finalItems = useMemo(() => {\n if (!items || !shouldSortSelectedToTop) return items;\n if (!isPopoverOpen) return items;\n if (cachedItemsOrder.current) return cachedItemsOrder.current;\n\n const selectedKeySet = new Set<string>();\n\n if (selectionMode === 'multiple') {\n if (\n selectionWhenClosed.current.multiple.length === 0 ||\n effectiveSelectedKeys === 'all'\n ) {\n return items;\n }\n selectionWhenClosed.current.multiple.forEach((k) =>\n selectedKeySet.add(k),\n );\n } else if (selectionWhenClosed.current.single) {\n selectedKeySet.add(selectionWhenClosed.current.single);\n }\n\n if (selectedKeySet.size === 0) return items;\n\n const itemsArray = Array.isArray(items) ? items : Array.from(items);\n const selectedItems: T[] = [];\n const unselectedItems: T[] = [];\n\n itemsArray.forEach((item) => {\n const key = (item as any)?.key ?? (item as any)?.id;\n if (key != null && selectedKeySet.has(String(key))) {\n selectedItems.push(item);\n } else {\n unselectedItems.push(item);\n }\n });\n\n const sorted = [...selectedItems, ...unselectedItems];\n\n cachedItemsOrder.current = sorted;\n\n return sorted;\n }, [items, shouldSortSelectedToTop, selectionMode, isPopoverOpen]);\n\n // Create local collection state for reading item data (labels, etc.)\n // This allows us to read item labels even before the popover opens\n const localCollectionState = useListState({\n children,\n items: finalItems, // Use sorted items to match what's shown in popover\n selectionMode: 'none', // Don't manage selection in this state\n });\n\n const selectedLabels = useMemo(() => {\n const collection = localCollectionState?.collection;\n\n if (selectionMode === 'multiple' && effectiveSelectedKeys === 'all') {\n if (!collection) return [];\n const labels: string[] = [];\n for (const item of collection) {\n if (item.type === 'item') {\n labels.push(item.textValue || String(item.key));\n }\n }\n return labels;\n }\n\n const keysToGet =\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? effectiveSelectedKeys || []\n : effectiveSelectedKey != null\n ? [effectiveSelectedKey]\n : [];\n\n return keysToGet\n .map((key) => {\n const item = collection?.getItem(key);\n return item?.textValue || String(key);\n })\n .filter(Boolean);\n }, [\n selectionMode,\n effectiveSelectedKeys,\n effectiveSelectedKey,\n localCollectionState?.collection,\n ]);\n\n const hasSelection = selectedLabels.length > 0;\n\n // ---------------------------------------------------------------------------\n // Popover lifecycle — all effects moved out of the inline renderTrigger\n // function so they have a stable component identity and don't tear\n // down/setup on every parent re-render.\n // DialogTrigger is controlled via isOpen/onOpenChange.\n // ---------------------------------------------------------------------------\n\n const handleOpenChange = useEvent((isOpen: boolean) => {\n if (isOpen === isPopoverOpen) return;\n\n if (isOpen) {\n triggerWidthRef.current =\n triggerRef?.current?.UNSAFE_getDOMNode()?.offsetWidth;\n }\n setIsPopoverOpen(isOpen);\n if (!isOpen) {\n selectionWhenClosed.current = { ...latestSelectionRef.current };\n cachedItemsOrder.current = null;\n }\n onOpenChange?.(isOpen);\n });\n\n // Popover sync is handled by the inner `DialogTrigger` (type=\"popover\").\n\n // Keyboard handler for arrow keys to open popover\n // Deliberately NOT `useKeyboard`. `ItemButton` already runs whatever\n // `onKeyDown` it is given through `useFocusable`'s own `useKeyboard`, and a\n // second wrapper here would leave `continuePropagation()` releasing only the\n // inner one while the outer still stopped the event — `Escape` reached the\n // trigger and died there (CUB-4839). Handed over plain, this IS the outer\n // wrapper's handler, so the opt-out applies to the event that travels.\n const keyboardProps = {\n onKeyDown: (e: RAKeyboardEvent) => {\n allowOverlayKeysToPropagate(e);\n\n if ((e.key === 'ArrowUp' || e.key === 'ArrowDown') && !isPopoverOpen) {\n e.preventDefault();\n handleOpenChange(true);\n\n return;\n }\n },\n };\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (selectionMode === 'multiple') {\n if (!isControlledMultiple) {\n setInternalSelectedKeys([]);\n }\n onSelectionChange?.([]);\n } else {\n if (!isControlledSingle) {\n setInternalSelectedKey(null);\n }\n onSelectionChange?.(null);\n }\n\n handleOpenChange(false);\n triggerRef?.current?.focus?.();\n onClear?.();\n\n return false;\n });\n\n // ---------------------------------------------------------------------------\n // Trigger content\n // ---------------------------------------------------------------------------\n\n const triggerContent = useMemo((): ReactNode => {\n if (typeof renderSummary === 'function') {\n if (selectionMode === 'single') {\n return renderSummary({\n selectedLabel: selectedLabels[0],\n selectedKey: effectiveSelectedKey ?? null,\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'single',\n });\n }\n\n return renderSummary({\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'multiple',\n });\n } else if (renderSummary === false) {\n return null;\n }\n\n if (!hasSelection) {\n return <Text.Placeholder>{placeholder}</Text.Placeholder>;\n } else if (selectionMode === 'single') {\n return selectedLabels[0] || null;\n } else if (effectiveSelectedKeys === 'all') {\n return selectAllLabel;\n } else {\n return selectedLabels.join(', ') || null;\n }\n }, [\n renderSummary,\n selectionMode,\n selectedLabels,\n effectiveSelectedKey,\n effectiveSelectedKeys,\n hasSelection,\n placeholder,\n selectAllLabel,\n ]);\n\n const showClearButton =\n isClearable && hasSelection && !isDisabled && !props.isReadOnly;\n\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n // Must be the SAME expression the trigger is painted with, not the raw\n // `theme`: this tells an action which surface it sits on, and validation\n // overrides the theme. With `theme=\"special\"` on an invalid field the trigger\n // renders `danger` — a light surface — so forwarding `special` would hand the\n // action the strong dark-purple alpha ramp and make hover/press read far too\n // heavy.\n const paintedTheme = getValidationTheme(theme, { isInvalid, isValid });\n //\n // It reaches the trailing actions through `ItemButton`'s wrapper, which is\n // what provides `ItemActionContext` for a run rendered outside the button —\n // so passing it as the trigger's `theme` is all that is needed.\n\n if (validationIcon) {\n suffix = (\n <>\n {suffix}\n {validationIcon}\n </>\n );\n }\n\n // A caller's `rightIcon` keeps the `rightIcon` slot: it accepts a render\n // function resolved against the trigger's mods, which only that slot does, and\n // it is also what a caller's `RightIcon` styles target. It replaces the\n // built-in control, exactly as before — including under `isLoading`, where the\n // spinner replaces it in turn.\n const hasCustomRightIcon = rightIcon !== undefined;\n const triggerRightIcon = hasCustomRightIcon ? (\n isLoading ? (\n <LoadingIcon />\n ) : (\n rightIcon\n )\n ) : undefined;\n\n // With a caller's own `rightIcon` the built-in control moves into that slot,\n // leaving the run with whatever the caller passed — possibly nothing. `null`\n // rather than nothing at all: the run stays in the markup, so the trigger does\n // not restructure if actions arrive later, but the row stops counting it as\n // end content. That is what keeps an icon-only trigger with `rightIcon={null}`\n // square, as it was before the run existed.\n const hasTriggerActions = !hasCustomRightIcon || !!actions;\n\n // Everything trailing that is NOT the caller's own icon goes into the actions\n // run — a sibling of the `<button>`, so the clear button is no longer nested\n // inside one. See `TriggerActions`.\n const triggerActions = (\n <TriggerActions\n actions={actions}\n builtIn={\n hasCustomRightIcon ? null : isLoading ? (\n <TriggerIcon>\n <LoadingIcon />\n </TriggerIcon>\n ) : showClearButton ? (\n <ItemAction\n icon={<CloseIcon />}\n size={size}\n qa=\"PickerClearButton\"\n // See `Select`: `ItemAction` names itself from `aria-label` or a\n // string `tooltip`, and warns for neither.\n aria-label={clearLabel ?? t('picker.clearValue', 'Clear value')}\n // No explicit `type`/`theme` — the default `current` type inherits\n // the trigger's own text color, which already carries validation\n // state here, so this renders exactly as the explicit theme did\n // while also following a custom theme.\n mods={{ pressed: false }}\n onPress={clearValue}\n />\n ) : (\n <TriggerIcon>\n <DirectionIcon to={isPopoverOpen ? 'top' : 'bottom'} />\n </TriggerIcon>\n )\n }\n />\n );\n\n // The trigger keeps the field label as its name, so queries by name stay\n // stable, and the value it shows (or the placeholder) is its description.\n const triggerValueId = triggerContent ? valueId : undefined;\n const triggerDescribedBy =\n [triggerValueId, ariaDescribedBy].filter(Boolean).join(' ') || undefined;\n\n // Trigger element — plain JSX with no hooks.\n const triggerElement = (\n <ItemButton\n ref={triggerRef as any}\n data-popover-trigger\n qa={qa || 'PickerTrigger'}\n type={type}\n theme={paintedTheme}\n size={size}\n shape={shape}\n isDisabled={isDisabled || isLoading}\n data-input-type=\"picker\"\n mods={{\n placeholder: !hasSelection,\n ...externalMods,\n }}\n icon={icon}\n rightIcon={triggerRightIcon}\n actions={hasTriggerActions ? triggerActions : null}\n prefix={prefix}\n suffix={suffix}\n hotkeys={hotkeys}\n tooltip={tooltip ?? triggerTooltip}\n description={triggerDescription}\n descriptionPlacement={descriptionPlacement}\n styles={triggerStyles}\n {...keyboardProps}\n {...mergeProps(triggerLabelProps, { id })}\n labelProps={triggerValueId ? { id: triggerValueId } : undefined}\n // `DialogTrigger` leaves `aria-haspopup` out for dialogs; the popup the\n // trigger controls is the `Dialog` that holds the list.\n aria-haspopup=\"dialog\"\n aria-describedby={triggerDescribedBy}\n >\n {triggerContent}\n </ItemButton>\n );\n\n // ---------------------------------------------------------------------------\n // Selection change handler\n // ---------------------------------------------------------------------------\n\n const handleSelectionChange = useEvent((selection: any) => {\n if (selectionMode === 'single') {\n // With `disallowEmptySelection`, re-selecting the current item emits a\n // duplicate event (see `allowDuplicateSelectionEvents` below). Close the\n // popover but don't propagate the unchanged selection.\n if (\n disallowEmptySelection &&\n selection != null &&\n effectiveSelectedKey != null &&\n String(selection) === String(effectiveSelectedKey)\n ) {\n handleOpenChange(false);\n return;\n }\n\n if (!isControlledSingle) {\n setInternalSelectedKey(selection as Key | null);\n }\n } else {\n if (!isControlledMultiple) {\n let normalized: 'all' | Key[] = selection;\n\n if (selection === 'all') {\n normalized = 'all';\n } else if (Array.isArray(selection)) {\n normalized = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n normalized = processSelectionArray(selection as Set<Key>);\n }\n\n setInternalSelectedKeys(normalized);\n }\n }\n\n if (selectionMode === 'single') {\n latestSelectionRef.current.single =\n selection != null ? String(selection) : null;\n } else {\n if (selection === 'all') {\n latestSelectionRef.current.multiple = [];\n } else if (Array.isArray(selection)) {\n latestSelectionRef.current.multiple = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n latestSelectionRef.current.multiple = processSelectionArray(\n selection as Set<Key>,\n );\n } else {\n latestSelectionRef.current.multiple = [];\n }\n }\n\n onSelectionChange?.(selection);\n\n if (selectionMode === 'single') {\n handleOpenChange(false);\n }\n });\n\n const handleEscape = useEvent(() => {\n handleOpenChange(false);\n });\n\n const handleOptionClick = useEvent((key: Key) => {\n if ((selectionMode === 'multiple' && isCheckable) || key === '__ALL__') {\n handleOpenChange(false);\n }\n });\n\n const pickerField = (\n <PickerWrapper\n ref={ref}\n styles={styles}\n {...(filterBaseProps(otherProps, { eventProps: true }) as Record<\n string,\n unknown\n >)}\n >\n <DialogTrigger\n type=\"popover\"\n placement={placement}\n targetRef={targetRef}\n isOpen={isPopoverOpen}\n containerPadding={containerPadding}\n shouldFlip={shouldFlip}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {() => (\n <Dialog\n qa=\"PickerOverlay\"\n aria-label={pickerAriaLabel}\n display=\"grid\"\n styles={mergeStyleLayers(\n {\n gridRows: '1sf',\n width: 'max($overlay-min-width, 30x) max-content 50vw',\n '$overlay-min-width': '30x',\n },\n popoverStyles,\n )}\n tokens={\n triggerWidthRef.current\n ? { '$overlay-min-width': `${triggerWidthRef.current}px` }\n : undefined\n }\n >\n <FocusScope restoreFocus>\n <ListBox\n isBare\n autoFocus\n items={items ? (finalItems as typeof props.items) : undefined}\n aria-label={pickerAriaLabel}\n selectedKey={\n selectionMode === 'single' ? effectiveSelectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple'\n ? effectiveSelectedKeys\n : undefined\n }\n listStyles={listStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n listRef={listRef}\n disallowEmptySelection={disallowEmptySelection}\n allowDuplicateSelectionEvents={\n selectionMode === 'single' && !!disallowEmptySelection\n }\n disabledKeys={disabledKeys}\n focusOnHover={focusOnHover}\n shouldFocusWrap={shouldFocusWrap}\n selectionMode={selectionMode}\n isInvalid={isInvalid}\n isValid={isValid}\n isDisabled={isDisabled}\n isLoading={isLoading}\n stateRef={internalListStateRef}\n isCheckable={isCheckable}\n shape=\"popover\"\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n header={header}\n footer={footer}\n headerStyles={headerStyles}\n footerStyles={footerStyles}\n qa={`${props.qa || 'Picker'}ListBox`}\n allValueProps={allValueProps}\n onEscape={handleEscape}\n onOptionClick={handleOptionClick}\n onSelectionChange={handleSelectionChange}\n >\n {children as CollectionChildren<T>}\n </ListBox>\n </FocusScope>\n </Dialog>\n )}\n </DialogTrigger>\n </PickerWrapper>\n );\n\n return wrapWithField<Omit<CubePickerProps<T>, 'children'>>(pickerField, {\n ...props,\n ...fieldLayout.field,\n // The trigger's own. Handed on, it read as the legacy field `tooltip`.\n tooltip: undefined,\n labelProps: mergeProps(labelProps, props.labelProps),\n });\n}) as unknown as (<T>(\n props: CubePickerProps<T> & { ref?: ForwardedRef<HTMLElement> },\n) => ReactElement) & {\n Item: typeof ListBox.Item;\n Section: typeof BaseSection;\n Action: typeof ItemAction;\n};\n\nPicker.Item = ListBox.Item;\n\nPicker.Section = BaseSection;\n\nPicker.Action = ItemAction;\n\nObject.defineProperty(Picker, 'cubeInputType', {\n value: 'Picker',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4LA,MAAM6F,gBAAgBvF,MAAM;CAC1BwF,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC,YAAY;CACd;AACF,CAAC;AAED,MAAaC,SAAS7F,WAAW,SAAS6F,OACxCC,OACAC,KACA;CACA,MAAM,EAAEC,MAAM3E,QAAQ;CAEtByE,QAAQ1D,cAAc0D,OAAO,EAC3BG,mBAAmB,EAAEC,OAAOC,eAAe;EACzC,MAAMC,aAAsC,CAAC;EAE7C,IAAIN,MAAMpB,kBAAkB,YAC1B0B,WAAW7B,eAAe2B,SAAS,CAAA;OAEnCE,WAAW3B,cAAcyB,SAAS;EAGpCE,WAAWC,qBAAqBC,QAAoC;GAClE,IAAIR,MAAMpB,kBAAkB,YAAY;IAEtC,IAAI4B,QAAQ,OACVH,SAAS,KAAK;SAEdA,SAASG,MAAOC,MAAMC,QAAQF,GAAG,IAAIA,MAAM,CAACA,GAAG,IAAK,CAAA,CAAE;GAE1D,OACEH,SAASI,MAAMC,QAAQF,GAAG,IAAIA,IAAI,KAAKA,GAAG;EAE9C;EAEA,OAAOF;CACT,EACF,CAAC;CAED,IAAI,EACFK,IACAnB,IACAoB,OACA,cAAcC,WAGd,oBAAoBC,iBACpBC,OACAC,MACAC,WACAC,QACAC,QACAhC,SACAiC,SACAjD,SACAC,gBACAC,oBACAgD,aACAC,YACAC,oBACAC,WACAC,SACAC,YACAC,WACAC,SACA9C,MAAM+C,cACNC,aACAC,sBACAvE,aACAC,OAAO,UACPgC,QACA/B,eACAC,eACAqE,OAAO,WACPC,QAAQ,WACRC,OACAC,aACAC,iBACAC,UACAvE,aAAa,MACbC,WACAE,YAAY,gBACZC,mBAAmB,GACnBS,aACA2D,oBACA7D,cACA8D,qBACAC,cACAjC,mBACA3B,gBAAgB,UAChBC,cACA4D,cACAC,eACAC,i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