@cube-dev/ui-kit 0.212.0 → 0.213.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/dist/CHANGELOG.md +22 -0
- 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.d.ts +2 -1
- package/dist/components/GridProvider.js +6 -4
- package/dist/components/GridProvider.js.map +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/AutoCollapseObserver.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/Button/index.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.d.ts +3 -2
- package/dist/components/actions/CommandMenu/CommandMenu.js +128 -131
- package/dist/components/actions/CommandMenu/CommandMenu.js.map +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 +4 -3
- package/dist/components/actions/Menu/MenuTrigger.js.map +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +4 -3
- package/dist/components/actions/Menu/SubMenuTrigger.js.map +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/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.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +6 -10
- package/dist/components/content/Item/ItemWithNativeLinks.js.map +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.d.ts +3 -2
- package/dist/components/content/Layout/Layout.js +12 -5
- package/dist/components/content/Layout/Layout.js.map +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.d.ts +3 -2
- package/dist/components/content/Layout/LayoutContainer.js +4 -3
- package/dist/components/content/Layout/LayoutContainer.js.map +1 -1
- package/dist/components/content/Layout/LayoutContent.d.ts +3 -2
- package/dist/components/content/Layout/LayoutContent.js +56 -45
- package/dist/components/content/Layout/LayoutContent.js.map +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 +3 -3
- package/dist/components/content/Layout/LayoutHeader.js.map +1 -1
- package/dist/components/content/Layout/LayoutPane.d.ts +3 -2
- package/dist/components/content/Layout/LayoutPane.js +66 -55
- package/dist/components/content/Layout/LayoutPane.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanel.d.ts +3 -2
- package/dist/components/content/Layout/LayoutPanel.js +15 -8
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.d.ts +3 -2
- package/dist/components/content/Layout/LayoutPanelHeader.js +38 -68
- package/dist/components/content/Layout/LayoutPanelHeader.js.map +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.d.ts +3 -2
- package/dist/components/content/Placeholder/Placeholder.js +16 -37
- package/dist/components/content/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +11 -3
- package/dist/components/content/Tree/Tree.js.map +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/types.d.ts +3 -2
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +3 -1
- package/dist/components/data/DataTable/DataTable.js.map +1 -1
- package/dist/components/data/DataTable/types.d.ts +3 -2
- package/dist/components/data/ItemTable/ItemTable.js +3 -1
- 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/item-table-sections.js +1 -1
- package/dist/components/data/ItemTable/types.d.ts +3 -2
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.d.ts +1 -0
- package/dist/components/data/TableBase/TableView.js +7 -2
- 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 +1 -1
- package/dist/components/data/TableBase/table-body-sections.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.d.ts +3 -2
- package/dist/components/fields/Checkbox/Checkbox.js +5 -6
- 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 +38 -31
- package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.d.ts +3 -2
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js.map +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +3 -2
- package/dist/components/fields/ColorPicker/ColorPicker.js +150 -137
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.d.ts +3 -2
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +47 -28
- package/dist/components/fields/ColorSwatch/ColorSwatch.js.map +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.d.ts +3 -2
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +157 -135
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +3 -2
- package/dist/components/fields/ComboBox/ComboBox.js +240 -225
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/CalendarPopover.js +4 -3
- package/dist/components/fields/DatePicker/CalendarPopover.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInput.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateInput.js +4 -1
- package/dist/components/fields/DatePicker/DateInput.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +108 -92
- 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 +42 -32
- 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 +32 -27
- 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 +185 -175
- 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 +97 -86
- 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 +4 -1
- 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 +104 -87
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +3 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +2 -2
- package/dist/components/fields/FilterPicker/FilterPicker.js +4 -3
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +3 -2
- package/dist/components/fields/ListBox/ListBox.js +15 -3
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/empty-row.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +4 -3
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +2 -2
- package/dist/components/fields/Picker/Picker.js +4 -3
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +6 -5
- package/dist/components/fields/RadioGroup/Radio.js +113 -137
- 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 +67 -79
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/RadioGroup/joined-styles.js +100 -0
- package/dist/components/fields/RadioGroup/joined-styles.js.map +1 -0
- package/dist/components/fields/SearchComboBox/SearchComboBox.d.ts +3 -2
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +7 -3
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.d.ts +5 -3
- package/dist/components/fields/Select/Select.js +87 -69
- 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 +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +44 -24
- package/dist/components/fields/Slider/SliderBase.js.map +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Slider/types.d.ts +3 -2
- package/dist/components/fields/Switch/Switch.d.ts +3 -2
- package/dist/components/fields/Switch/Switch.js +9 -3
- package/dist/components/fields/Switch/Switch.js.map +1 -1
- package/dist/components/fields/TagInput/TagInput.d.ts +3 -2
- package/dist/components/fields/TagInput/TagInput.js +5 -5
- package/dist/components/fields/TagInput/TagInput.js.map +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.d.ts +3 -2
- package/dist/components/fields/TextInput/TextInputBase.js +14 -3
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/ToggleGroup/ToggleGroup.d.ts +53 -0
- package/dist/components/fields/ToggleGroup/ToggleGroup.js +237 -0
- package/dist/components/fields/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.d.ts +29 -0
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js +166 -0
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js.map +1 -0
- package/dist/components/fields/ToggleGroup/context.d.ts +8 -0
- package/dist/components/fields/ToggleGroup/context.js +13 -0
- package/dist/components/fields/ToggleGroup/context.js.map +1 -0
- package/dist/components/fields/ToggleGroup/index.d.ts +5 -0
- 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 +5 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.d.ts +3 -2
- package/dist/components/form/Form/Form.js +6 -4
- package/dist/components/form/Form/Form.js.map +1 -1
- package/dist/components/form/Form/FormContext.js +1 -1
- package/dist/components/form/Form/FormElement.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +43 -40
- package/dist/components/form/Form/ModernFormRoot.js.map +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.d.ts +3 -2
- package/dist/components/form/Label.js +31 -26
- package/dist/components/form/Label.js.map +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-layout.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.d.ts +3 -2
- package/dist/components/layout/Prefix.js +22 -17
- package/dist/components/layout/Prefix.js.map +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.d.ts +3 -2
- package/dist/components/layout/Suffix.js +22 -17
- package/dist/components/layout/Suffix.js.map +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 +148 -143
- package/dist/components/navigation/Tabs/TabButton.js.map +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 +15 -5
- package/dist/components/navigation/Tabs/Tabs.js.map +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/segmented-styles.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.d.ts +4 -3
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/types.js.map +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +54 -101
- package/dist/components/navigation/Tabs/use-tab-indicator.js.map +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.d.ts +3 -2
- package/dist/components/overlays/Dialog/Dialog.js +5 -2
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +4 -3
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.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 +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +3 -2
- package/dist/components/overlays/Tooltip/Tooltip.js +60 -28
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js.map +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 +3 -3
- 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 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +12 -3
- 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/layout-scale.js +25 -0
- package/dist/utils/layout-scale.js.map +1 -0
- 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/componentBaseProps.d.ts +9 -0
- package/dist/utils/react/componentBaseProps.js +15 -0
- package/dist/utils/react/componentBaseProps.js.map +1 -0
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/pickBaseCustomizationProps.d.ts +2 -0
- package/dist/utils/react/pickBaseCustomizationProps.js +16 -0
- package/dist/utils/react/pickBaseCustomizationProps.js.map +1 -0
- 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/useOverlayPosition.js +75 -0
- package/dist/utils/react/useOverlayPosition.js.map +1 -0
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/BaseProperties.md +9 -4
- package/docs/CreateComponent.md +15 -8
- package/docs/Theming.md +2 -0
- package/docs/Usage.md +2 -0
- package/docs/components/GridProvider.md +1 -1
- package/docs/components/fields/ColorSwatchGroup.md +7 -5
- package/docs/components/fields/RadioGroup.md +13 -0
- package/docs/components/fields/ToggleGroup.md +227 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { Provider } from "../../../provider.js";
|
|
4
|
+
import { filterComponentBaseProps } from "../../../utils/react/componentBaseProps.js";
|
|
4
5
|
import { castNullableStringValue } from "../../../utils/react/nullableValue.js";
|
|
5
6
|
import { wrapWithField } from "../../form/wrapper.js";
|
|
6
7
|
import { splitFieldLayout } from "../../form/field-layout.js";
|
|
@@ -8,6 +9,7 @@ import { FormScopeMask } from "../../form/Form/FormContext.js";
|
|
|
8
9
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
9
10
|
import { SEGMENTED_LIST_STYLES, SEGMENTED_TRACK_STYLES } from "../../navigation/Tabs/segmented-styles.js";
|
|
10
11
|
import { RadioContext } from "./context.js";
|
|
12
|
+
import { JOINED_GROUP_STYLES } from "./joined-styles.js";
|
|
11
13
|
import { c } from "react/compiler-runtime";
|
|
12
14
|
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
13
15
|
import { forwardRef, useRef } from "react";
|
|
@@ -19,9 +21,6 @@ import { getActiveElement, useObjectRef } from "@react-aria/utils";
|
|
|
19
21
|
const RadioGroupElement = tasty({
|
|
20
22
|
qa: "RadioGroup",
|
|
21
23
|
styles: mergeStyles({
|
|
22
|
-
display: "flex",
|
|
23
|
-
placeItems: "stretch",
|
|
24
|
-
placeContent: "stretch",
|
|
25
24
|
flow: {
|
|
26
25
|
"": "column",
|
|
27
26
|
horizontal: "row wrap",
|
|
@@ -34,21 +33,12 @@ const RadioGroupElement = tasty({
|
|
|
34
33
|
"": "#clear",
|
|
35
34
|
disabled: "#surface-4"
|
|
36
35
|
},
|
|
37
|
-
|
|
38
|
-
"": "max-content max-content initial",
|
|
39
|
-
"fill-width": "auto"
|
|
40
|
-
},
|
|
41
|
-
flexShrink: 0,
|
|
42
|
-
gap: {
|
|
43
|
-
"": "1x",
|
|
44
|
-
button: 0
|
|
45
|
-
},
|
|
46
|
-
whiteSpace: "nowrap",
|
|
36
|
+
gap: "1x",
|
|
47
37
|
outline: {
|
|
48
38
|
"": "$ring-width #primary-text.0 / $outline-offset",
|
|
49
39
|
"focused & button": "$ring-width #primary-text / $outline-offset"
|
|
50
40
|
}
|
|
51
|
-
}, SEGMENTED_TRACK_STYLES, SEGMENTED_LIST_STYLES)
|
|
41
|
+
}, JOINED_GROUP_STYLES, SEGMENTED_TRACK_STYLES, SEGMENTED_LIST_STYLES)
|
|
52
42
|
});
|
|
53
43
|
/**
|
|
54
44
|
* Whether focus rests on the radio with this value while it is disabled. Only
|
|
@@ -60,7 +50,7 @@ function isFocusedDisabledRadio(value) {
|
|
|
60
50
|
return element instanceof HTMLInputElement && element.type === "radio" && element.value === value && element.getAttribute("aria-disabled") === "true";
|
|
61
51
|
}
|
|
62
52
|
function RadioGroup(rawProps, ref) {
|
|
63
|
-
const $ = c(
|
|
53
|
+
const $ = c(30);
|
|
64
54
|
let orientation = rawProps.orientation;
|
|
65
55
|
let t0;
|
|
66
56
|
if ($[0] !== rawProps) {
|
|
@@ -75,9 +65,10 @@ function RadioGroup(rawProps, ref) {
|
|
|
75
65
|
$[2] = t1;
|
|
76
66
|
} else t1 = $[2];
|
|
77
67
|
const props = useFieldProps(rawProps, t1);
|
|
78
|
-
let { qa, id, isDisabled, isReadOnly, isRequired, labelPosition: t2, isInvalid, isValid, children, styles, insideForm, labelProps: baseLabelProps, size, buttonType, type } = props;
|
|
68
|
+
let { qa, id, isDisabled, isReadOnly, isRequired, labelPosition: t2, isInvalid, isValid, children, styles, insideForm, labelProps: baseLabelProps, size, buttonType, type, mods } = props;
|
|
79
69
|
const labelPosition = t2 === void 0 ? "top" : t2;
|
|
80
70
|
const domRef = useObjectRef(ref);
|
|
71
|
+
const { onChange: _onChange, onFocus: _onFocus, onBlur: _onBlur, onFocusChange: _onFocusChange, isDisabled: _isDisabled, mods: _mods, ...baseProps } = filterComponentBaseProps(props, { eventProps: true });
|
|
81
72
|
const fieldLayout = splitFieldLayout(props);
|
|
82
73
|
styles = fieldLayout.styles;
|
|
83
74
|
const baseState = useRadioGroupState(props);
|
|
@@ -109,88 +100,83 @@ function RadioGroup(rawProps, ref) {
|
|
|
109
100
|
} else t4 = $[7];
|
|
110
101
|
const { radioGroupProps, labelProps } = useRadioGroup(t4, state);
|
|
111
102
|
const { onKeyDown: onArrowKey, ...groupProps } = radioGroupProps;
|
|
103
|
+
const onKeyDown = (event) => {
|
|
104
|
+
isArrowKeyRef.current = true;
|
|
105
|
+
onArrowKey?.(event);
|
|
106
|
+
isArrowKeyRef.current = false;
|
|
107
|
+
baseProps.onKeyDown?.(event);
|
|
108
|
+
};
|
|
112
109
|
let t5;
|
|
113
|
-
if ($[8]
|
|
114
|
-
t5 =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
};
|
|
119
|
-
$[8] = onArrowKey;
|
|
120
|
-
$[9] = t5;
|
|
121
|
-
} else t5 = $[9];
|
|
122
|
-
const onKeyDown = t5;
|
|
110
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
+
t5 = { within: true };
|
|
112
|
+
$[8] = t5;
|
|
113
|
+
} else t5 = $[8];
|
|
114
|
+
const { isFocusVisible: isFocusWithinVisible, focusProps: groupFocusProps } = useFocusRing(t5);
|
|
123
115
|
let t6;
|
|
124
|
-
if ($[10]
|
|
125
|
-
t6 = {
|
|
126
|
-
$[10] = t6;
|
|
127
|
-
} else t6 = $[10];
|
|
128
|
-
const { isFocusVisible: isFocusWithinVisible, focusProps: groupFocusProps } = useFocusRing(t6);
|
|
129
|
-
let t7;
|
|
130
|
-
if ($[11] !== isDisabled || $[12] !== isInvalid || $[13] !== isRequired || $[14] !== isValid) {
|
|
131
|
-
t7 = {
|
|
116
|
+
if ($[9] !== isDisabled || $[10] !== isInvalid || $[11] !== isRequired || $[12] !== isValid) {
|
|
117
|
+
t6 = {
|
|
132
118
|
isRequired,
|
|
133
119
|
isInvalid,
|
|
134
120
|
isValid,
|
|
135
121
|
isDisabled
|
|
136
122
|
};
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
} else
|
|
143
|
-
let
|
|
144
|
-
if ($[
|
|
145
|
-
|
|
123
|
+
$[9] = isDisabled;
|
|
124
|
+
$[10] = isInvalid;
|
|
125
|
+
$[11] = isRequired;
|
|
126
|
+
$[12] = isValid;
|
|
127
|
+
$[13] = t6;
|
|
128
|
+
} else t6 = $[13];
|
|
129
|
+
let t7;
|
|
130
|
+
if ($[14] !== buttonType || $[15] !== props.name || $[16] !== size || $[17] !== state || $[18] !== type) {
|
|
131
|
+
t7 = {
|
|
146
132
|
state,
|
|
147
133
|
name: props.name,
|
|
148
134
|
size,
|
|
149
135
|
buttonType,
|
|
150
136
|
type
|
|
151
137
|
};
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
} else
|
|
159
|
-
let
|
|
160
|
-
if ($[
|
|
161
|
-
|
|
162
|
-
value:
|
|
138
|
+
$[14] = buttonType;
|
|
139
|
+
$[15] = props.name;
|
|
140
|
+
$[16] = size;
|
|
141
|
+
$[17] = state;
|
|
142
|
+
$[18] = type;
|
|
143
|
+
$[19] = t7;
|
|
144
|
+
} else t7 = $[19];
|
|
145
|
+
let t8;
|
|
146
|
+
if ($[20] !== children || $[21] !== t7) {
|
|
147
|
+
t8 = /* @__PURE__ */ jsx(RadioContext.Provider, {
|
|
148
|
+
value: t7,
|
|
163
149
|
children
|
|
164
150
|
});
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
} else
|
|
169
|
-
let
|
|
170
|
-
if ($[
|
|
171
|
-
|
|
151
|
+
$[20] = children;
|
|
152
|
+
$[21] = t7;
|
|
153
|
+
$[22] = t8;
|
|
154
|
+
} else t8 = $[22];
|
|
155
|
+
let t9;
|
|
156
|
+
if ($[23] !== isDisabled || $[24] !== isReadOnly || $[25] !== t8) {
|
|
157
|
+
t9 = /* @__PURE__ */ jsx(Provider, {
|
|
172
158
|
isDisabled,
|
|
173
159
|
isReadOnly,
|
|
174
|
-
children:
|
|
160
|
+
children: t8
|
|
175
161
|
});
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else
|
|
181
|
-
let
|
|
182
|
-
if ($[
|
|
183
|
-
|
|
184
|
-
value:
|
|
185
|
-
children:
|
|
162
|
+
$[23] = isDisabled;
|
|
163
|
+
$[24] = isReadOnly;
|
|
164
|
+
$[25] = t8;
|
|
165
|
+
$[26] = t9;
|
|
166
|
+
} else t9 = $[26];
|
|
167
|
+
let t10;
|
|
168
|
+
if ($[27] !== t6 || $[28] !== t9) {
|
|
169
|
+
t10 = /* @__PURE__ */ jsx(FormScopeMask, {
|
|
170
|
+
value: t6,
|
|
171
|
+
children: t9
|
|
186
172
|
});
|
|
173
|
+
$[27] = t6;
|
|
174
|
+
$[28] = t9;
|
|
187
175
|
$[29] = t10;
|
|
188
|
-
|
|
189
|
-
$[31] = t11;
|
|
190
|
-
} else t11 = $[31];
|
|
176
|
+
} else t10 = $[29];
|
|
191
177
|
const radioGroup = /* @__PURE__ */ jsx(RadioGroupElement, {
|
|
192
178
|
ref: domRef,
|
|
193
|
-
...mergeProps$1(groupProps, groupFocusProps),
|
|
179
|
+
...mergeProps$1(baseProps, groupProps, groupFocusProps),
|
|
194
180
|
onKeyDown,
|
|
195
181
|
id,
|
|
196
182
|
qa: qa || "RadioGroup",
|
|
@@ -202,12 +188,14 @@ function RadioGroup(rawProps, ref) {
|
|
|
202
188
|
"inside-form": insideForm,
|
|
203
189
|
"side-label": labelPosition === "side",
|
|
204
190
|
button: type === "button",
|
|
191
|
+
joined: type === "button",
|
|
205
192
|
tabs: type === "tabs",
|
|
206
193
|
segmented: type === "tabs",
|
|
207
194
|
focused: isFocusWithinVisible,
|
|
208
|
-
"fill-width": fieldLayout.fillWidth
|
|
195
|
+
"fill-width": fieldLayout.fillWidth,
|
|
196
|
+
...mods
|
|
209
197
|
},
|
|
210
|
-
children:
|
|
198
|
+
children: t10
|
|
211
199
|
});
|
|
212
200
|
return wrapWithField(radioGroup, {
|
|
213
201
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["getActiveElement","useObjectRef","BaseProps","mergeStyles","Styles","tasty","forwardRef","useRef","AriaRadioGroupProps","useFocusRing","useRadioGroup","RadioGroupState","useRadioGroupState","Provider","FieldBaseProps","mergeProps","castNullableStringValue","WithNullableValue","CubeItemProps","FieldLayoutStyleProps","splitFieldLayout","FormScopeMask","useFieldProps","wrapWithField","SEGMENTED_LIST_STYLES","SEGMENTED_TRACK_STYLES","RadioContext","KeyboardEvent","CubeRadioGroupProps","Omit","groupStyles","orientation","value","defaultValue","onChange","size","Exclude","buttonType","type","RadioGroupElement","qa","styles","display","placeItems","placeContent","flow","horizontal","padding","boxSizing","radius","fill","disabled","width","flexShrink","gap","button","whiteSpace","outline","isFocusedDisabledRadio","element","HTMLInputElement","getAttribute","RadioGroup","rawProps","ref","$","_c","t0","t1","Symbol","for","defaultValidationTrigger","props","id","isDisabled","isReadOnly","isRequired","labelPosition","t2","isInvalid","isValid","children","insideForm","labelProps","baseLabelProps","undefined","domRef","fieldLayout","baseState","isArrowKeyRef","t3","setSelectedValue","current","state","t4","form","radioGroupProps","onKeyDown","onArrowKey","groupProps","t5","event","t6","within","isFocusVisible","isFocusWithinVisible","focusProps","groupFocusProps","t7","t8","name","t9","t10","t11","radioGroup","tabs","segmented","focused","fillWidth","field","_RadioGroup","cubeInputType","displayName","_c","mergeProps"],"sources":["../../../../src/components/fields/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import { getActiveElement, useObjectRef } from '@react-aria/utils';\nimport { BaseProps, mergeStyles, Styles, tasty } from '@tenphi/tasty';\nimport { forwardRef, useRef } from 'react';\nimport { AriaRadioGroupProps, useFocusRing, useRadioGroup } from 'react-aria';\nimport { RadioGroupState, useRadioGroupState } from 'react-stately';\n\nimport { Provider } from '../../../provider';\nimport { FieldBaseProps } from '../../../shared/form';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { CubeItemProps } from '../../content/Item/Item';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport { FormScopeMask } from '../../form/Form/FormContext';\nimport { useFieldProps } from '../../form/Form/use-field/use-field-props';\nimport { wrapWithField } from '../../form/wrapper';\nimport {\n SEGMENTED_LIST_STYLES,\n SEGMENTED_TRACK_STYLES,\n} from '../../navigation/Tabs/segmented-styles';\n\nimport { RadioContext } from './context';\n\nimport type { KeyboardEvent } from 'react';\n\nexport interface CubeRadioGroupProps\n extends\n BaseProps,\n Omit<AriaRadioGroupProps, 'errorMessage' | 'form' | 'name'>,\n FieldLayoutStyleProps,\n FieldBaseProps<string | null | undefined> {\n groupStyles?: Styles;\n orientation?: 'horizontal' | 'vertical';\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /* Size for all radio buttons in the group */\n size?: Exclude<CubeItemProps['size'], 'inline'>;\n /* Button type for all button-style radios (ignored in tabs mode). When set to 'primary', selected buttons use 'primary' and non-selected use 'outline' with isSelected appearance */\n buttonType?: CubeItemProps['type'];\n /* Visual type for all radios in the group: radio (default), button, or tabs */\n type?: 'radio' | 'button' | 'tabs';\n}\n\n// In tabs mode the group is the track of the segmented control `Tabs\n// type=\"radio\"` shares (`segmented-styles.ts`), merged in after its own styles.\nconst RadioGroupElement = tasty({\n qa: 'RadioGroup',\n styles: mergeStyles(\n {\n display: 'flex',\n placeItems: 'stretch',\n placeContent: 'stretch',\n flow: {\n '': 'column',\n horizontal: 'row wrap',\n 'horizontal & tabs': 'row',\n },\n padding: '0',\n // The tabs layout is the only one with padding, and a caller that gives the\n // group an explicit width (`width: 100%` inside a popover, say) means the\n // box it can see. Without this the padding is added on top and the group\n // overhangs its container by `1x`.\n boxSizing: 'border-box',\n radius: true,\n fill: {\n '': '#clear',\n disabled: '#surface-4',\n },\n width: {\n '': 'max-content max-content initial',\n // In a field its style props size, the group fills the field as every\n // other input does.\n 'fill-width': 'auto',\n },\n flexShrink: 0,\n gap: {\n '': '1x',\n button: 0,\n },\n whiteSpace: 'nowrap',\n // Keyboard focus ring on the group, shown only for the button layout,\n // where the items merge into one control. A classic radio shows a ring\n // on its circle, and a tabs segment one of its own, as a tab does.\n outline: {\n '': '$ring-width #primary-text.0 / $outline-offset',\n 'focused & button': '$ring-width #primary-text / $outline-offset',\n },\n },\n SEGMENTED_TRACK_STYLES,\n SEGMENTED_LIST_STYLES,\n ),\n});\n\n/**\n * Whether focus rests on the radio with this value while it is disabled. Only\n * a radio kept focusable for its tooltip can be: a natively disabled one never\n * takes focus (see `Radio`).\n */\nfunction isFocusedDisabledRadio(value: string | null) {\n let element = getActiveElement();\n\n return (\n element instanceof HTMLInputElement &&\n element.type === 'radio' &&\n element.value === value &&\n element.getAttribute('aria-disabled') === 'true'\n );\n}\n\nfunction RadioGroup(rawProps: WithNullableValue<CubeRadioGroupProps>, ref) {\n let orientation = rawProps.orientation;\n\n // `null` is the radio group's own \"nothing selected\".\n rawProps = castNullableStringValue(rawProps, null);\n let props = useFieldProps(rawProps, { defaultValidationTrigger: 'onChange' });\n\n let {\n qa,\n id,\n isDisabled,\n isReadOnly,\n isRequired,\n labelPosition = 'top',\n isInvalid,\n isValid,\n children,\n styles,\n groupStyles,\n insideForm,\n // orientation, // ignore orientation since it came from the form context\n labelProps: baseLabelProps,\n size,\n buttonType,\n type,\n form,\n } = props;\n let domRef = useObjectRef(ref);\n\n const fieldLayout = splitFieldLayout(props);\n\n styles = fieldLayout.styles;\n\n let baseState = useRadioGroupState(props);\n // The arrow keys focus the next radio and select it. A disabled radio that\n // keeps focus for its tooltip is reached that way too, and has to stop the\n // selection the way a read-only group does: focus moves, the value stays.\n // Only the arrow keys: a click elsewhere or a form reset still selects.\n let isArrowKeyRef = useRef(false);\n let state: RadioGroupState = {\n ...baseState,\n setSelectedValue(value) {\n if (isArrowKeyRef.current && isFocusedDisabledRadio(value)) return;\n\n baseState.setSelectedValue(value);\n },\n };\n\n // Set default orientation based on type\n if (orientation == null) {\n orientation =\n type === 'button' || type === 'tabs' ? 'horizontal' : 'vertical';\n }\n\n // React Aria hands `form` to every radio's input as the id of its `<form>`,\n // so the form instance would render as `form=\"[object Object]\"` on each.\n let { radioGroupProps, labelProps } = useRadioGroup(\n { ...props, orientation, form: undefined },\n state,\n );\n\n let { onKeyDown: onArrowKey, ...groupProps } = radioGroupProps;\n let onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n isArrowKeyRef.current = true;\n onArrowKey?.(event);\n isArrowKeyRef.current = false;\n };\n\n // Keyboard-only focus ring on the group container (button layout).\n // `within: true` tracks focus on any descendant radio. We read\n // `isFocusVisible` (not `isFocused`), which is keyboard-gated — mouse\n // clicks on a radio focus the input but leave `isFocusVisible` false.\n let { isFocusVisible: isFocusWithinVisible, focusProps: groupFocusProps } =\n useFocusRing({ within: true });\n\n let radioGroup = (\n <RadioGroupElement\n ref={domRef}\n // Keep semantics and keyboard handling on the group: `isBare` omits\n // the field wrapper.\n {...mergeProps(groupProps, groupFocusProps)}\n onKeyDown={onKeyDown}\n // `useRadioGroup` seeds its id once; the current one follows the form\n // binding.\n id={id}\n qa={qa || 'RadioGroup'}\n styles={styles}\n data-input-type=\"radiogroup\"\n data-radio-button-group={type === 'button' ? '' : undefined}\n mods={{\n horizontal: orientation === 'horizontal',\n 'inside-form': insideForm,\n 'side-label': labelPosition === 'side',\n button: type === 'button',\n tabs: type === 'tabs',\n segmented: type === 'tabs',\n focused: isFocusWithinVisible,\n 'fill-width': fieldLayout.fillWidth,\n }}\n >\n <FormScopeMask\n value={{\n isRequired,\n isInvalid,\n isValid,\n isDisabled,\n }}\n >\n {/* Each radio is a field that reads the provider before the form\n context, so the group's own state has to reach it here to beat an\n enclosing disabled form. `<Provider>` skips `undefined`, so a group\n that sets nothing keeps the form's state. */}\n <Provider isDisabled={isDisabled} isReadOnly={isReadOnly}>\n <RadioContext.Provider\n value={{\n state,\n name: props.name,\n size,\n buttonType,\n type,\n }}\n >\n {children}\n </RadioContext.Provider>\n </Provider>\n </FormScopeMask>\n </RadioGroupElement>\n );\n\n return wrapWithField(radioGroup, {\n ...props,\n ...fieldLayout.field,\n labelProps: mergeProps(baseLabelProps, labelProps),\n });\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = forwardRef(RadioGroup);\n\n(_RadioGroup as any).cubeInputType = 'RadioGroup';\n_RadioGroup.displayName = 'RadioGroup';\n\nexport { _RadioGroup as RadioGroup };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmDA,MAAMuC,oBAAoBlC,MAAM;CAC9BmC,IAAI;CACJC,QAAQtC,YACN;EACEuC,SAAS;EACTC,YAAY;EACZC,cAAc;EACdC,MAAM;GACJ,IAAI;GACJC,YAAY;GACZ,qBAAqB;EACvB;EACAC,SAAS;EAKTC,WAAW;EACXC,QAAQ;EACRC,MAAM;GACJ,IAAI;GACJC,UAAU;EACZ;EACAC,OAAO;GACL,IAAI;GAGJ,cAAc;EAChB;EACAC,YAAY;EACZC,KAAK;GACH,IAAI;GACJC,QAAQ;EACV;EACAC,YAAY;EAIZC,SAAS;GACP,IAAI;GACJ,oBAAoB;EACtB;CACF,GACAhC,wBACAD,qBACF;AACF,CAAC;;;;;;AAOD,SAASkC,uBAAuB1B,OAAsB;CACpD,IAAI2B,UAAU3D,iBAAiB;CAE/B,OACE2D,mBAAmBC,oBACnBD,QAAQrB,SAAS,WACjBqB,QAAQ3B,UAAUA,SAClB2B,QAAQE,aAAa,eAAe,MAAM;AAE9C;AAEA,SAAAC,WAAAC,UAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACE,IAAAnC,cAAkBgC,SAAQhC;CAAa,IAAAoC;CAAA,IAAAF,EAAA,OAAAF,UAAA;EAG5BI,KAAAnD,wBAAwB+C,UAAU,IAAI;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAE;CAAA,OA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U;CACnD,CAAC;AAAC;;;;;AAOJ,MAAMqC,cAAclH,WAAWwD,UAAU;AAEzC,YAAqB2D,gBAAgB;AACrCD,YAAYE,cAAc"}
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["getActiveElement","useObjectRef","mergeStyles","Styles","tasty","forwardRef","useRef","AriaRadioGroupProps","useFocusRing","useRadioGroup","RadioGroupState","useRadioGroupState","Provider","FieldBaseProps","filterComponentBaseProps","mergeProps","castNullableStringValue","WithNullableValue","CubeItemProps","FieldLayoutStyleProps","splitFieldLayout","FormScopeMask","useFieldProps","wrapWithField","SEGMENTED_LIST_STYLES","SEGMENTED_TRACK_STYLES","RadioContext","JOINED_GROUP_STYLES","DOMAttributes","KeyboardEvent","ComponentBaseProps","CubeRadioGroupProps","Omit","groupStyles","orientation","value","defaultValue","onChange","size","Exclude","buttonType","type","RadioGroupElement","qa","styles","flow","horizontal","padding","boxSizing","radius","fill","disabled","gap","outline","isFocusedDisabledRadio","element","HTMLInputElement","getAttribute","RadioGroup","rawProps","ref","$","_c","t0","t1","Symbol","for","defaultValidationTrigger","props","id","isDisabled","isReadOnly","isRequired","labelPosition","t2","isInvalid","isValid","children","insideForm","labelProps","baseLabelProps","mods","undefined","domRef","_onChange","onFocus","_onFocus","onBlur","_onBlur","onFocusChange","_onFocusChange","_isDisabled","_mods","baseProps","eventProps","fieldLayout","baseState","isArrowKeyRef","t3","setSelectedValue","current","state","t4","form","radioGroupProps","onKeyDown","onArrowKey","groupProps","event","HTMLDivElement","t5","within","isFocusVisible","isFocusWithinVisible","focusProps","groupFocusProps","t6","t7","name","t8","t9","t10","radioGroup","button","joined","tabs","segmented","focused","fillWidth","field","_RadioGroup","cubeInputType","displayName","_c","mergeProps"],"sources":["../../../../src/components/fields/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import { getActiveElement, useObjectRef } from '@react-aria/utils';\nimport { mergeStyles, Styles, tasty } from '@tenphi/tasty';\nimport { forwardRef, useRef } from 'react';\nimport { AriaRadioGroupProps, useFocusRing, useRadioGroup } from 'react-aria';\nimport { RadioGroupState, useRadioGroupState } from 'react-stately';\n\nimport { Provider } from '../../../provider';\nimport { FieldBaseProps } from '../../../shared/form';\nimport { filterComponentBaseProps } from '../../../utils/react/componentBaseProps';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { CubeItemProps } from '../../content/Item/Item';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport { FormScopeMask } from '../../form/Form/FormContext';\nimport { useFieldProps } from '../../form/Form/use-field/use-field-props';\nimport { wrapWithField } from '../../form/wrapper';\nimport {\n SEGMENTED_LIST_STYLES,\n SEGMENTED_TRACK_STYLES,\n} from '../../navigation/Tabs/segmented-styles';\n\nimport { RadioContext } from './context';\nimport { JOINED_GROUP_STYLES } from './joined-styles';\n\nimport type { DOMAttributes, KeyboardEvent } from 'react';\nimport type { ComponentBaseProps } from '../../../utils/react/componentBaseProps';\n\nexport interface CubeRadioGroupProps\n extends\n ComponentBaseProps,\n Omit<AriaRadioGroupProps, 'errorMessage' | 'form' | 'name'>,\n FieldLayoutStyleProps,\n FieldBaseProps<string | null | undefined> {\n groupStyles?: Styles;\n orientation?: 'horizontal' | 'vertical';\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /* Size for all radio buttons in the group */\n size?: Exclude<CubeItemProps['size'], 'inline'>;\n /* Button type for all button-style radios (ignored in tabs mode). When set to 'primary', selected buttons use 'primary' and non-selected use 'outline' with isSelected appearance */\n buttonType?: CubeItemProps['type'];\n /* Visual type for all radios in the group: radio (default), button, or tabs */\n type?: 'radio' | 'button' | 'tabs';\n}\n\n// In button mode the group is the joined row `ToggleGroup` shares\n// (`joined-styles.ts`); in tabs mode it is the track of the segmented control\n// `Tabs type=\"radio\"` shares (`segmented-styles.ts`). Both are merged in after\n// its own styles.\nconst RadioGroupElement = tasty({\n qa: 'RadioGroup',\n styles: mergeStyles(\n {\n flow: {\n '': 'column',\n horizontal: 'row wrap',\n 'horizontal & tabs': 'row',\n },\n padding: '0',\n // The tabs layout is the only one with padding, and a caller that gives the\n // group an explicit width (`width: 100%` inside a popover, say) means the\n // box it can see. Without this the padding is added on top and the group\n // overhangs its container by `1x`.\n boxSizing: 'border-box',\n radius: true,\n fill: {\n '': '#clear',\n disabled: '#surface-4',\n },\n gap: '1x',\n // Keyboard focus ring on the group, shown only for the button layout,\n // where the items merge into one control. A classic radio shows a ring\n // on its circle, and a tabs segment one of its own, as a tab does.\n outline: {\n '': '$ring-width #primary-text.0 / $outline-offset',\n 'focused & button': '$ring-width #primary-text / $outline-offset',\n },\n },\n JOINED_GROUP_STYLES,\n SEGMENTED_TRACK_STYLES,\n SEGMENTED_LIST_STYLES,\n ),\n});\n\n/**\n * Whether focus rests on the radio with this value while it is disabled. Only\n * a radio kept focusable for its tooltip can be: a natively disabled one never\n * takes focus (see `Radio`).\n */\nfunction isFocusedDisabledRadio(value: string | null) {\n let element = getActiveElement();\n\n return (\n element instanceof HTMLInputElement &&\n element.type === 'radio' &&\n element.value === value &&\n element.getAttribute('aria-disabled') === 'true'\n );\n}\n\nfunction RadioGroup(rawProps: WithNullableValue<CubeRadioGroupProps>, ref) {\n let orientation = rawProps.orientation;\n\n // `null` is the radio group's own \"nothing selected\".\n rawProps = castNullableStringValue(rawProps, null);\n let props = useFieldProps(rawProps, { defaultValidationTrigger: 'onChange' });\n\n let {\n qa,\n id,\n isDisabled,\n isReadOnly,\n isRequired,\n labelPosition = 'top',\n isInvalid,\n isValid,\n children,\n styles,\n groupStyles,\n insideForm,\n // orientation, // ignore orientation since it came from the form context\n labelProps: baseLabelProps,\n size,\n buttonType,\n type,\n form,\n mods,\n } = props;\n let domRef = useObjectRef(ref);\n\n // The caller's base props (`qaVal`, `className`, `style`, `tokens`,\n // `data-*`, event handlers) reach the group, as on `ToggleGroup`. Not the\n // ones `useRadioGroup` already handles: a native `change` bubbles up from\n // each radio, so a forwarded `onChange` would be called with an event, and\n // `isDisabled` would turn on a `disabled` fill the group never shows.\n let {\n onChange: _onChange,\n onFocus: _onFocus,\n onBlur: _onBlur,\n onFocusChange: _onFocusChange,\n isDisabled: _isDisabled,\n mods: _mods,\n ...baseProps\n } = filterComponentBaseProps(props, { eventProps: true });\n\n const fieldLayout = splitFieldLayout(props);\n\n styles = fieldLayout.styles;\n\n let baseState = useRadioGroupState(props);\n // The arrow keys focus the next radio and select it. A disabled radio that\n // keeps focus for its tooltip is reached that way too, and has to stop the\n // selection the way a read-only group does: focus moves, the value stays.\n // Only the arrow keys: a click elsewhere or a form reset still selects.\n let isArrowKeyRef = useRef(false);\n let state: RadioGroupState = {\n ...baseState,\n setSelectedValue(value) {\n if (isArrowKeyRef.current && isFocusedDisabledRadio(value)) return;\n\n baseState.setSelectedValue(value);\n },\n };\n\n // Set default orientation based on type\n if (orientation == null) {\n orientation =\n type === 'button' || type === 'tabs' ? 'horizontal' : 'vertical';\n }\n\n // React Aria hands `form` to every radio's input as the id of its `<form>`,\n // so the form instance would render as `form=\"[object Object]\"` on each.\n let { radioGroupProps, labelProps } = useRadioGroup(\n { ...props, orientation, form: undefined },\n state,\n );\n\n let { onKeyDown: onArrowKey, ...groupProps } = radioGroupProps;\n let onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n isArrowKeyRef.current = true;\n onArrowKey?.(event);\n isArrowKeyRef.current = false;\n // The caller's own handler, which the explicit prop below would replace.\n // `filterComponentBaseProps` forwards event handlers, but its type lists none.\n (baseProps as DOMAttributes<HTMLDivElement>).onKeyDown?.(event);\n };\n\n // Keyboard-only focus ring on the group container (button layout).\n // `within: true` tracks focus on any descendant radio. We read\n // `isFocusVisible` (not `isFocused`), which is keyboard-gated — mouse\n // clicks on a radio focus the input but leave `isFocusVisible` false.\n let { isFocusVisible: isFocusWithinVisible, focusProps: groupFocusProps } =\n useFocusRing({ within: true });\n\n let radioGroup = (\n <RadioGroupElement\n ref={domRef}\n // Keep semantics and keyboard handling on the group: `isBare` omits\n // the field wrapper.\n {...mergeProps(baseProps, groupProps, groupFocusProps)}\n onKeyDown={onKeyDown}\n // `useRadioGroup` seeds its id once; the current one follows the form\n // binding.\n id={id}\n qa={qa || 'RadioGroup'}\n styles={styles}\n data-input-type=\"radiogroup\"\n data-radio-button-group={type === 'button' ? '' : undefined}\n mods={{\n horizontal: orientation === 'horizontal',\n 'inside-form': insideForm,\n 'side-label': labelPosition === 'side',\n button: type === 'button',\n joined: type === 'button',\n tabs: type === 'tabs',\n segmented: type === 'tabs',\n focused: isFocusWithinVisible,\n 'fill-width': fieldLayout.fillWidth,\n ...mods,\n }}\n >\n <FormScopeMask\n value={{\n isRequired,\n isInvalid,\n isValid,\n isDisabled,\n }}\n >\n {/* Each radio is a field that reads the provider before the form\n context, so the group's own state has to reach it here to beat an\n enclosing disabled form. `<Provider>` skips `undefined`, so a group\n that sets nothing keeps the form's state. */}\n <Provider isDisabled={isDisabled} isReadOnly={isReadOnly}>\n <RadioContext.Provider\n value={{\n state,\n name: props.name,\n size,\n buttonType,\n type,\n }}\n >\n {children}\n </RadioContext.Provider>\n </Provider>\n </FormScopeMask>\n </RadioGroupElement>\n );\n\n return wrapWithField(radioGroup, {\n ...props,\n ...fieldLayout.field,\n labelProps: mergeProps(baseLabelProps, labelProps),\n });\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = forwardRef(RadioGroup);\n\n(_RadioGroup as any).cubeInputType = 'RadioGroup';\n_RadioGroup.displayName = 'RadioGroup';\n\nexport { _RadioGroup as RadioGroup };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwDA,MAAM0C,oBAAoBtC,MAAM;CAC9BuC,IAAI;CACJC,QAAQ1C,YACN;EACE2C,MAAM;GACJ,IAAI;GACJC,YAAY;GACZ,qBAAqB;EACvB;EACAC,SAAS;EAKTC,WAAW;EACXC,QAAQ;EACRC,MAAM;GAC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BE3D,EAAA,MAAAuD;EAAAvD,EAAA,MAAA2D;EAAA3D,EAAA,MAAA4D;CAAA,OAAAA,MAAA5D,EAAA;CApDpB,MAAA6D,aACE,oBAAC,mBAAD;EACOvC,KAAAA;EAAM,GAGPpE,aAAW8E,WAAWc,YAAYQ,eAAe;EAC1CV;EAGPpC;EACA,IAAA1B,MAAA;EACIC;EACQ,mBAAA;EACS,2BAAAH,SAAS,WAAT,KAAAyC,KAAAA;EACnB,MAAA;GAAApC,YACQZ,gBAAgB;GAAY,eACzB4C;GAAU,cACXL,kBAAkB;GAAMkD,QAC9BlF,SAAS;GAAQmF,QACjBnF,SAAS;GAAQoF,MACnBpF,SAAS;GAAMqF,WACVrF,SAAS;GAAMsF,SACjBd;GAAoB,cACflB,YAAWiC;GAAU,GAChC/C;EACL;EAEAwC,UAAAA;CA1BgB,CAAA;CAqDlB,OAEKlG,cAAcmG,YAAY;EAAA,GAC5BtD;EAAK,GACL2B,YAAWkC;EAAMlD,YACRhE,aAAWiE,gBAAgBD,UAAU;CACnD,CAAC;AAAC;;;;;AAOJ,MAAMmD,cAAc7H,WAAWqD,UAAU;AAEzC,YAAqByE,gBAAgB;AACrCD,YAAYE,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
//#region src/components/fields/RadioGroup/context.ts
|
|
4
4
|
const RadioContext = createContext(null);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
|
+
//#region src/components/fields/RadioGroup/joined-styles.ts
|
|
3
|
+
/**
|
|
4
|
+
* Same columns as `Item`, but none of them stretches — a button in a group is
|
|
5
|
+
* sized by its content, not stretched like a list item. The label column still
|
|
6
|
+
* has a zero minimum, the way `Item`'s `1sf` does, so a button given less room
|
|
7
|
+
* than its label truncates the label instead of overflowing the button — which
|
|
8
|
+
* is also what lets the auto tooltip (`tooltip` / `tooltip={true}`) fire.
|
|
9
|
+
*/
|
|
10
|
+
const BUTTON_COLUMNS = "max-content max-content minmax(0, max-content) max-content max-content max-content";
|
|
11
|
+
/**
|
|
12
|
+
* A `block` description spans every column, and a spanning item's width goes
|
|
13
|
+
* to the columns with an intrinsic minimum. With a zero-minimum label column
|
|
14
|
+
* that is every column but the label's — so the description's width lands in
|
|
15
|
+
* the empty icon / prefix / suffix columns and the button grows to label plus
|
|
16
|
+
* description instead of the wider of the two. Only this layout keeps the
|
|
17
|
+
* all-`max-content` columns, and with them a label that does not truncate.
|
|
18
|
+
*/
|
|
19
|
+
const BUTTON_BLOCK_COLUMNS = "max-content max-content max-content max-content max-content max-content";
|
|
20
|
+
/**
|
|
21
|
+
* The group: a row of buttons sized by their content, with the join on top.
|
|
22
|
+
* The row layout is not keyed: RadioGroup uses it for its other layouts too,
|
|
23
|
+
* and sets their `flow` itself.
|
|
24
|
+
*
|
|
25
|
+
* Joined, it has no gap, so the buttons can overlap by one border width (see
|
|
26
|
+
* `JOINED_ITEM_STYLES`), and it isolates its stacking, so a raised button stays
|
|
27
|
+
* inside the group and never paints over a consumer's sticky header or overlay
|
|
28
|
+
* — a selected button stays raised for as long as it is selected.
|
|
29
|
+
*
|
|
30
|
+
* `gap` has no `''` key: `mergeStyles(styles, JOINED_GROUP_STYLES)` appends it
|
|
31
|
+
* to the group's own map, which keeps its default for the other layouts.
|
|
32
|
+
*/
|
|
33
|
+
const JOINED_GROUP_STYLES = {
|
|
34
|
+
display: "flex",
|
|
35
|
+
placeItems: "stretch",
|
|
36
|
+
placeContent: "stretch",
|
|
37
|
+
width: {
|
|
38
|
+
"": "max-content max-content initial",
|
|
39
|
+
"fill-width": "auto"
|
|
40
|
+
},
|
|
41
|
+
flexShrink: 0,
|
|
42
|
+
whiteSpace: "nowrap",
|
|
43
|
+
gap: { joined: 0 },
|
|
44
|
+
isolation: {
|
|
45
|
+
"": "auto",
|
|
46
|
+
joined: "isolate"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* One button: an `Item` sized by its content, with the join on top.
|
|
51
|
+
*
|
|
52
|
+
* The corner radius is shared, so the first and last buttons keep only their
|
|
53
|
+
* outer corners and the middle ones go square. Every button but the first
|
|
54
|
+
* overlaps its neighbour by one border width, so two neighbours draw one line
|
|
55
|
+
* between them.
|
|
56
|
+
*
|
|
57
|
+
* The selected button is raised above its neighbours, so its brand-tinted
|
|
58
|
+
* border shows on all four sides: otherwise the next button would paint over
|
|
59
|
+
* its right edge. A keyboard-focused button goes above the selected one, so its
|
|
60
|
+
* ring is never covered. Hover changes no border, so it raises nothing.
|
|
61
|
+
*/
|
|
62
|
+
const JOINED_ITEM_STYLES = {
|
|
63
|
+
preset: "t3m / tight",
|
|
64
|
+
flexGrow: 1,
|
|
65
|
+
gridTemplate: {
|
|
66
|
+
"": `"icon prefix label suffix rightIcon actions" auto / ${BUTTON_COLUMNS}`,
|
|
67
|
+
"description=inline": `"icon prefix description suffix rightIcon actions" auto / ${BUTTON_COLUMNS}`,
|
|
68
|
+
"description=inline & has-label": `"icon prefix label suffix rightIcon actions" auto "icon prefix description suffix rightIcon actions" auto / ${BUTTON_COLUMNS}`,
|
|
69
|
+
"description=block": `"icon prefix label suffix rightIcon actions" auto "description description description description description description" auto / ${BUTTON_BLOCK_COLUMNS}`
|
|
70
|
+
},
|
|
71
|
+
placeContent: "center",
|
|
72
|
+
shadow: { "": false },
|
|
73
|
+
radius: {
|
|
74
|
+
"": true,
|
|
75
|
+
"joined & !:last-child": "1r left",
|
|
76
|
+
"joined & !:first-child": "1r right",
|
|
77
|
+
"joined & !:first-child & !:last-child": 0
|
|
78
|
+
},
|
|
79
|
+
margin: {
|
|
80
|
+
"": 0,
|
|
81
|
+
"joined & !:first-child": "-1bw left"
|
|
82
|
+
},
|
|
83
|
+
width: {
|
|
84
|
+
"joined & size=xsmall": "min ($size + 2bw)",
|
|
85
|
+
"has-icon & (has-right-icon | (has-actions & inside-wrapper))": "@inherit"
|
|
86
|
+
},
|
|
87
|
+
zIndex: {
|
|
88
|
+
"": "auto",
|
|
89
|
+
"joined & selected": 1,
|
|
90
|
+
"joined & focused": 2
|
|
91
|
+
},
|
|
92
|
+
Label: { placeSelf: {
|
|
93
|
+
"": "center start",
|
|
94
|
+
"!has-prefix & !has-suffix & !has-icon & !has-right-icon": "center"
|
|
95
|
+
} }
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
export { JOINED_GROUP_STYLES, JOINED_ITEM_STYLES };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=joined-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joined-styles.js","names":["Styles","BUTTON_COLUMNS","BUTTON_BLOCK_COLUMNS","JOINED_GROUP_STYLES","display","placeItems","placeContent","width","flexShrink","whiteSpace","gap","joined","isolation","JOINED_ITEM_STYLES","preset","flexGrow","gridTemplate","shadow","radius","margin","zIndex","Label","placeSelf"],"sources":["../../../../src/components/fields/RadioGroup/joined-styles.ts"],"sourcesContent":["import type { Styles } from '@tenphi/tasty';\n\n// =============================================================================\n// Joined button-group look, shared by `Radio.Group type=\"button\"` and\n// `ToggleGroup`. They keep their own semantics (radio group vs toggle buttons)\n// and keyboard behaviour, but render one control: a row of buttons sized by\n// their content that share their borders. Radio is the reference.\n//\n// The join is keyed on the `joined` mod. RadioGroup and Radio set it for\n// `type=\"button\"`; ToggleGroup and its items always set it. The button layout\n// in `JOINED_ITEM_STYLES` is not keyed: `Radio.Tabs` uses it too, under the\n// segmented look (`navigation/Tabs/segmented-styles.ts`).\n//\n// `ToggleGroup/joined.browser.test.tsx` renders both controls and fails when\n// their computed styles part.\n// =============================================================================\n\n/**\n * Same columns as `Item`, but none of them stretches — a button in a group is\n * sized by its content, not stretched like a list item. The label column still\n * has a zero minimum, the way `Item`'s `1sf` does, so a button given less room\n * than its label truncates the label instead of overflowing the button — which\n * is also what lets the auto tooltip (`tooltip` / `tooltip={true}`) fire.\n */\nconst BUTTON_COLUMNS =\n 'max-content max-content minmax(0, max-content) max-content max-content max-content';\n\n/**\n * A `block` description spans every column, and a spanning item's width goes\n * to the columns with an intrinsic minimum. With a zero-minimum label column\n * that is every column but the label's — so the description's width lands in\n * the empty icon / prefix / suffix columns and the button grows to label plus\n * description instead of the wider of the two. Only this layout keeps the\n * all-`max-content` columns, and with them a label that does not truncate.\n */\nconst BUTTON_BLOCK_COLUMNS =\n 'max-content max-content max-content max-content max-content max-content';\n\n/**\n * The group: a row of buttons sized by their content, with the join on top.\n * The row layout is not keyed: RadioGroup uses it for its other layouts too,\n * and sets their `flow` itself.\n *\n * Joined, it has no gap, so the buttons can overlap by one border width (see\n * `JOINED_ITEM_STYLES`), and it isolates its stacking, so a raised button stays\n * inside the group and never paints over a consumer's sticky header or overlay\n * — a selected button stays raised for as long as it is selected.\n *\n * `gap` has no `''` key: `mergeStyles(styles, JOINED_GROUP_STYLES)` appends it\n * to the group's own map, which keeps its default for the other layouts.\n */\nexport const JOINED_GROUP_STYLES: Styles = {\n display: 'flex',\n placeItems: 'stretch',\n placeContent: 'stretch',\n width: {\n '': 'max-content max-content initial',\n // In a field its style props size, the group fills the field as every\n // other input does.\n 'fill-width': 'auto',\n },\n flexShrink: 0,\n whiteSpace: 'nowrap',\n // oxlint-disable-next-line tasty/require-default-state -- extends the group's own map (see above)\n gap: { joined: 0 },\n isolation: { '': 'auto', joined: 'isolate' },\n};\n\n/**\n * One button: an `Item` sized by its content, with the join on top.\n *\n * The corner radius is shared, so the first and last buttons keep only their\n * outer corners and the middle ones go square. Every button but the first\n * overlaps its neighbour by one border width, so two neighbours draw one line\n * between them.\n *\n * The selected button is raised above its neighbours, so its brand-tinted\n * border shows on all four sides: otherwise the next button would paint over\n * its right edge. A keyboard-focused button goes above the selected one, so its\n * ring is never covered. Hover changes no border, so it raises nothing.\n */\nexport const JOINED_ITEM_STYLES: Styles = {\n preset: 't3m / tight',\n flexGrow: 1,\n // Same areas as `Item`. The `description` rows have to be repeated here\n // because a plain string would replace `Item`'s whole state map and leave\n // the description without a grid area to land in.\n gridTemplate: {\n '': `\"icon prefix label suffix rightIcon actions\" auto / ${BUTTON_COLUMNS}`,\n 'description=inline': `\"icon prefix description suffix rightIcon actions\" auto / ${BUTTON_COLUMNS}`,\n 'description=inline & has-label': `\"icon prefix label suffix rightIcon actions\" auto \"icon prefix description suffix rightIcon actions\" auto / ${BUTTON_COLUMNS}`,\n 'description=block': `\"icon prefix label suffix rightIcon actions\" auto \"description description description description description description\" auto / ${BUTTON_BLOCK_COLUMNS}`,\n },\n placeContent: 'center',\n shadow: {\n '': false,\n },\n radius: {\n '': true,\n 'joined & !:last-child': '1r left',\n 'joined & !:first-child': '1r right',\n 'joined & !:first-child & !:last-child': 0,\n },\n margin: {\n '': 0,\n 'joined & !:first-child': '-1bw left',\n },\n // Extends `Item`'s `width`. A neighbour covers one border width of each side,\n // so a joined xsmall button (24px) would keep less than the 24px target WCAG\n // 2.5.8 asks for; two border widths more keep it whole. `Item`'s wider minimum\n // for an icon with a right icon moves after it, so it still wins.\n // oxlint-disable-next-line tasty/require-default-state -- extends `Item`'s own map\n width: {\n 'joined & size=xsmall': 'min ($size + 2bw)',\n 'has-icon & (has-right-icon | (has-actions & inside-wrapper))': '@inherit',\n },\n zIndex: {\n '': 'auto',\n 'joined & selected': 1,\n 'joined & focused': 2,\n },\n\n Label: {\n placeSelf: {\n '': 'center start',\n '!has-prefix & !has-suffix & !has-icon & !has-right-icon': 'center',\n },\n },\n};\n"],"mappings":";;;;;;;;;AAwBA,MAAMC,iBACJ;;;;;;;;;AAUF,MAAMC,uBACJ;;;;;;;;;;;;;;AAeF,MAAaC,sBAA8B;CACzCC,SAAS;CACTC,YAAY;CACZC,cAAc;CACdC,OAAO;EACL,IAAI;EAGJ,cAAc;CAChB;CACAC,YAAY;CACZC,YAAY;CAEZC,KAAK,EAAEC,QAAQ,EAAE;CACjBC,WAAW;EAAE,IAAI;EAAQD,QAAQ;CAAU;AAC7C;;;;;;;;;;;;;;AAeA,MAAaE,qBAA6B;CACxCC,QAAQ;CACRC,UAAU;CAIVC,cAAc;EACZ,IAAI,uDAAuDf;EAC3D,sBAAsB,6DAA6DA;EACnF,kCAAkC,+GAA+GA;EACjJ,qBAAqB,sIAAsIC;CAC7J;CACAI,cAAc;CACdW,QAAQ,EACN,IAAI,MACN;CACAC,QAAQ;EACN,IAAI;EACJ,yBAAyB;EACzB,0BAA0B;EAC1B,yCAAyC;CAC3C;CACAC,QAAQ;EACN,IAAI;EACJ,0BAA0B;CAC5B;CAMAZ,OAAO;EACL,wBAAwB;EACxB,gEAAgE;CAClE;CACAa,QAAQ;EACN,IAAI;EACJ,qBAAqB;EACrB,oBAAoB;CACtB;CAEAC,OAAO,EACLC,WAAW;EACT,IAAI;EACJ,2DAA2D;CAC7D,EACF;AACF"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
import { FieldBaseProps, TextFieldKeyboardProps } from "../../../shared/form.js";
|
|
3
|
+
import { ComponentBasePropsWithoutChildren } from "../../../utils/react/componentBaseProps.js";
|
|
3
4
|
import { CollectionItem as _CollectionItem } from "../../CollectionItem.js";
|
|
4
5
|
import { FieldLayoutStyleProps } from "../../form/field-layout.js";
|
|
5
|
-
import {
|
|
6
|
+
import { Styles } from "@tenphi/tasty";
|
|
6
7
|
import { ForwardedRef, ReactElement, ReactNode, RefObject } from "react";
|
|
7
8
|
import { Section } from "react-stately";
|
|
8
9
|
import { FocusableRef, Key as Key$1 } from "@react-types/shared";
|
|
9
10
|
//#region src/components/fields/SearchComboBox/SearchComboBox.d.ts
|
|
10
11
|
type FilterFn = (textValue: string, inputValue: string) => boolean;
|
|
11
12
|
export type PopoverTriggerAction = 'focus' | 'input' | 'manual';
|
|
12
|
-
export interface CubeSearchComboBoxProps<T> extends
|
|
13
|
+
export interface CubeSearchComboBoxProps<T> extends ComponentBasePropsWithoutChildren, FieldLayoutStyleProps, Omit<FieldBaseProps, 'name' | 'form' | 'rules' | 'shouldUpdate' | 'validationDelay' | 'validateTrigger' | 'insideForm' | 'idPrefix'> {
|
|
13
14
|
/**
|
|
14
15
|
* Callback fired when the user picks a suggestion from the list.
|
|
15
16
|
* Receives the option key and its text value. The input is cleared afterwards.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
|
+
import { pickBaseCustomizationProps } from "../../../utils/react/pickBaseCustomizationProps.js";
|
|
2
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
3
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
5
|
import { useFocus as useFocus$1 } from "../../../utils/react/interactions.js";
|
|
@@ -68,9 +69,10 @@ function useDelayedFlag(active, delay) {
|
|
|
68
69
|
useEffect(t0, t1);
|
|
69
70
|
return flag;
|
|
70
71
|
}
|
|
71
|
-
const SearchComboBoxInput = forwardRef(function SearchComboBoxInput({ qa, inputRef, id, value, placeholder, isDisabled, isReadOnly, autoFocus, autoComplete, size, mods, inputStyles, keyboardProps, focusProps, onChange, onFocus, isExpanded, searchComboBoxId, listStateRef }, ref) {
|
|
72
|
+
const SearchComboBoxInput = forwardRef(function SearchComboBoxInput({ qa, customizationProps, inputRef, id, value, placeholder, isDisabled, isReadOnly, autoFocus, autoComplete, size, mods, inputStyles, keyboardProps, focusProps, onChange, onFocus, isExpanded, searchComboBoxId, listStateRef }, ref) {
|
|
72
73
|
const combinedRef = useCombinedRefs(ref, inputRef);
|
|
73
74
|
return /* @__PURE__ */ jsx(InputElement, {
|
|
75
|
+
...customizationProps,
|
|
74
76
|
ref: combinedRef,
|
|
75
77
|
qa,
|
|
76
78
|
id,
|
|
@@ -334,7 +336,8 @@ const SearchComboBox = forwardRef(function SearchComboBox(props, ref) {
|
|
|
334
336
|
loading: showLoading,
|
|
335
337
|
prefix: !!prefix,
|
|
336
338
|
suffix: true,
|
|
337
|
-
clearable: showClearButton
|
|
339
|
+
clearable: showClearButton,
|
|
340
|
+
...props.mods
|
|
338
341
|
};
|
|
339
342
|
const searchComboBoxWidth = wrapperRef?.current?.offsetWidth;
|
|
340
343
|
useLayoutEffect(() => {
|
|
@@ -377,6 +380,7 @@ const SearchComboBox = forwardRef(function SearchComboBox(props, ref) {
|
|
|
377
380
|
children: prefix
|
|
378
381
|
}) : null,
|
|
379
382
|
/* @__PURE__ */ jsx(SearchComboBoxInput, {
|
|
383
|
+
customizationProps: pickBaseCustomizationProps(props),
|
|
380
384
|
qa: qa || "SearchComboBox",
|
|
381
385
|
inputRef,
|
|
382
386
|
id,
|