@cube-dev/ui-kit 0.193.0 → 0.193.2
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 +16 -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.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/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.d.ts +14 -14
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.d.ts +4 -2
- package/dist/components/content/Item/Item.js +2 -2
- package/dist/components/content/Item/Item.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.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.d.ts +14 -14
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +3 -3
- package/dist/components/content/Tree/TreeNode.js.map +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +35 -18
- 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 +14 -1
- 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.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 +157 -0
- package/dist/components/data/TableBase/use-column-window.js.map +1 -0
- 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 +30 -19
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js.map +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +3 -3
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +3 -3
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +3 -3
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +20 -20
- package/dist/components/fields/RadioGroup/Radio.js +160 -92
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +145 -107
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +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 +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.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/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.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/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/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.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/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.js +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/navigationAdapter.default.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +46 -0
- package/dist/utils/react/overlayKeyPropagation.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/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/data/DataTable.md +3 -0
- package/docs/components/data/ItemTable.md +9 -1
- package/docs/components/fields/RadioGroup.md +21 -4
- package/package.json +2 -1
- package/dist/utils/react/escapePropagation.js +0 -39
- package/dist/utils/react/escapePropagation.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.193.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.193.2 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
|
+
import { getDisabledElementProps, omitActivationEventProps } from "../../../utils/react/disabledProps.js";
|
|
3
4
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
5
|
import { useFocus as useFocus$1 } from "../../../utils/react/interactions.js";
|
|
5
6
|
import { useAutoTooltip } from "../../content/use-auto-tooltip.js";
|
|
@@ -145,6 +146,42 @@ const RadioNormalElement = tasty({ styles: {
|
|
|
145
146
|
}
|
|
146
147
|
} });
|
|
147
148
|
const RadioCircleElement = /* @__PURE__ */ jsx("div", { "data-element": "RadioCircle" });
|
|
149
|
+
/**
|
|
150
|
+
* The tab stop `useRadio` gives an enabled radio and drops for a disabled one:
|
|
151
|
+
* the selected radio or, with nothing selected, every radio until one of them
|
|
152
|
+
* takes focus, so Tab enters the group from either end.
|
|
153
|
+
*/
|
|
154
|
+
function getRovingTabIndex(state, value) {
|
|
155
|
+
if (state.selectedValue != null) return state.selectedValue === value ? 0 : -1;
|
|
156
|
+
return state.lastFocusedValue == null || state.lastFocusedValue === value ? 0 : -1;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* React reports a click on an inert radio as a change: the browser checks it
|
|
160
|
+
* before the click is cancelled. Kept as a handler rather than dropped, or
|
|
161
|
+
* React would warn about a `checked` input without one.
|
|
162
|
+
*/
|
|
163
|
+
function ignoreChange(event) {
|
|
164
|
+
event.stopPropagation();
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Tab leaves the group from a focused disabled radio, as it does from the
|
|
168
|
+
* group's tab stop, the selected radio. Left to itself the browser would stop
|
|
169
|
+
* on the selected radio first when it lies ahead, so that radio gives up its
|
|
170
|
+
* tab stop for this one key. Focusing it on the way out instead would open its
|
|
171
|
+
* tooltip and scroll to it.
|
|
172
|
+
*/
|
|
173
|
+
function leaveGroupOnTab(event, selectedValue) {
|
|
174
|
+
let input = event.currentTarget;
|
|
175
|
+
if (event.key !== "Tab" || event.altKey || event.ctrlKey || event.metaKey || selectedValue == null || input.value === selectedValue) return;
|
|
176
|
+
let radios = input.closest("[role=\"radiogroup\"]")?.querySelectorAll("input[type=\"radio\"]");
|
|
177
|
+
let selected = Array.from(radios ?? []).find((radio) => radio.value === selectedValue);
|
|
178
|
+
if (!selected || selected.disabled || selected.tabIndex < 0) return;
|
|
179
|
+
let { tabIndex } = selected;
|
|
180
|
+
selected.tabIndex = -1;
|
|
181
|
+
setTimeout(() => {
|
|
182
|
+
if (selected.checked) selected.tabIndex = tabIndex;
|
|
183
|
+
});
|
|
184
|
+
}
|
|
148
185
|
const RadioLabelElement = tasty({
|
|
149
186
|
qa: "RadioLabel",
|
|
150
187
|
styles: INLINE_LABEL_STYLES
|
|
@@ -193,7 +230,7 @@ const ITEM_PROPS = [
|
|
|
193
230
|
"labelRef"
|
|
194
231
|
];
|
|
195
232
|
function Radio(props, ref) {
|
|
196
|
-
const $ = c(
|
|
233
|
+
const $ = c(79);
|
|
197
234
|
let t0;
|
|
198
235
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
199
236
|
t0 = { defaultValidationTrigger: "onChange" };
|
|
@@ -266,38 +303,64 @@ function Radio(props, ref) {
|
|
|
266
303
|
$[7] = t5;
|
|
267
304
|
$[8] = t6;
|
|
268
305
|
} else t6 = $[8];
|
|
269
|
-
const { labelRef: tooltipLabelRef, renderWithTooltip } = useAutoTooltip(t6);
|
|
306
|
+
const { labelRef: tooltipLabelRef, renderWithTooltip, isTooltipActive } = useAutoTooltip(t6);
|
|
270
307
|
const inputRef = useRef(null);
|
|
271
308
|
const domRef = useFocusableRef(ref, inputRef);
|
|
272
|
-
const
|
|
273
|
-
let
|
|
274
|
-
if ($[9] !== effectiveIsDisabled || $[10] !== name || $[11] !== props || $[12] !==
|
|
275
|
-
|
|
309
|
+
const value = props.value ?? "";
|
|
310
|
+
let t7;
|
|
311
|
+
if ($[9] !== effectiveIsDisabled || $[10] !== name || $[11] !== props || $[12] !== value) {
|
|
312
|
+
t7 = {
|
|
276
313
|
name,
|
|
277
314
|
...props,
|
|
278
315
|
isDisabled: effectiveIsDisabled,
|
|
279
|
-
value
|
|
316
|
+
value
|
|
280
317
|
};
|
|
281
318
|
$[9] = effectiveIsDisabled;
|
|
282
319
|
$[10] = name;
|
|
283
320
|
$[11] = props;
|
|
284
|
-
$[12] =
|
|
285
|
-
$[13] =
|
|
286
|
-
} else
|
|
287
|
-
const { inputProps, isDisabled: isRadioDisabled, isSelected: isRadioSelected } = useRadio$1(
|
|
321
|
+
$[12] = value;
|
|
322
|
+
$[13] = t7;
|
|
323
|
+
} else t7 = $[13];
|
|
324
|
+
const { inputProps, isDisabled: isRadioDisabled, isSelected: isRadioSelected } = useRadio$1(t7, state, inputRef);
|
|
325
|
+
let t8;
|
|
326
|
+
if ($[14] !== inputProps || $[15] !== isRadioDisabled || $[16] !== state || $[17] !== value) {
|
|
327
|
+
t8 = (hasActiveTooltip) => {
|
|
328
|
+
const { isInert, inertProps } = getDisabledElementProps({
|
|
329
|
+
isDisabled: isRadioDisabled,
|
|
330
|
+
keepEvents: hasActiveTooltip,
|
|
331
|
+
as: "input"
|
|
332
|
+
});
|
|
333
|
+
if (!isInert) return inputProps;
|
|
334
|
+
return mergeProps$1({
|
|
335
|
+
...omitActivationEventProps(inputProps),
|
|
336
|
+
disabled: false,
|
|
337
|
+
tabIndex: getRovingTabIndex(state, value),
|
|
338
|
+
onChange: ignoreChange
|
|
339
|
+
}, {
|
|
340
|
+
onFocus: () => state.setLastFocusedValue(value),
|
|
341
|
+
onKeyDown: (event) => leaveGroupOnTab(event, state.selectedValue)
|
|
342
|
+
}, inertProps);
|
|
343
|
+
};
|
|
344
|
+
$[14] = inputProps;
|
|
345
|
+
$[15] = isRadioDisabled;
|
|
346
|
+
$[16] = state;
|
|
347
|
+
$[17] = value;
|
|
348
|
+
$[18] = t8;
|
|
349
|
+
} else t8 = $[18];
|
|
350
|
+
const getInputProps = t8;
|
|
288
351
|
let t9;
|
|
289
|
-
if ($[
|
|
352
|
+
if ($[19] !== isInvalid || $[20] !== isValid) {
|
|
290
353
|
t9 = getValidationMods({
|
|
291
354
|
isInvalid,
|
|
292
355
|
isValid
|
|
293
356
|
});
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
} else t9 = $[
|
|
357
|
+
$[19] = isInvalid;
|
|
358
|
+
$[20] = isValid;
|
|
359
|
+
$[21] = t9;
|
|
360
|
+
} else t9 = $[21];
|
|
298
361
|
const t10 = effectiveType === "tabs";
|
|
299
362
|
let t11;
|
|
300
|
-
if ($[
|
|
363
|
+
if ($[22] !== isButton || $[23] !== isFocused || $[24] !== isHovered || $[25] !== isRadioDisabled || $[26] !== isRadioSelected || $[27] !== t10 || $[28] !== t9) {
|
|
301
364
|
t11 = {
|
|
302
365
|
checked: isRadioSelected,
|
|
303
366
|
...t9,
|
|
@@ -307,75 +370,75 @@ function Radio(props, ref) {
|
|
|
307
370
|
focused: isFocused,
|
|
308
371
|
tabs: t10
|
|
309
372
|
};
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
} else t11 = $[
|
|
373
|
+
$[22] = isButton;
|
|
374
|
+
$[23] = isFocused;
|
|
375
|
+
$[24] = isHovered;
|
|
376
|
+
$[25] = isRadioDisabled;
|
|
377
|
+
$[26] = isRadioSelected;
|
|
378
|
+
$[27] = t10;
|
|
379
|
+
$[28] = t9;
|
|
380
|
+
$[29] = t11;
|
|
381
|
+
} else t11 = $[29];
|
|
319
382
|
const mods = t11;
|
|
320
383
|
if (isButton) {
|
|
321
384
|
const t12 = effectiveButtonType;
|
|
322
385
|
let t13;
|
|
323
|
-
if ($[
|
|
386
|
+
if ($[30] !== isInvalid || $[31] !== isValid) {
|
|
324
387
|
t13 = getValidationTheme("default", {
|
|
325
388
|
isInvalid,
|
|
326
389
|
isValid
|
|
327
390
|
}, { includeValid: true });
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
} else t13 = $[
|
|
391
|
+
$[30] = isInvalid;
|
|
392
|
+
$[31] = isValid;
|
|
393
|
+
$[32] = t13;
|
|
394
|
+
} else t13 = $[32];
|
|
332
395
|
const t14 = effectiveSize;
|
|
333
396
|
let t15;
|
|
334
|
-
if ($[
|
|
397
|
+
if ($[33] !== forceSelectedMod || $[34] !== isRadioDisabled) {
|
|
335
398
|
t15 = forceSelectedMod && !isRadioDisabled ? { selected: true } : {};
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
} else t15 = $[
|
|
399
|
+
$[33] = forceSelectedMod;
|
|
400
|
+
$[34] = isRadioDisabled;
|
|
401
|
+
$[35] = t15;
|
|
402
|
+
} else t15 = $[35];
|
|
340
403
|
let t16;
|
|
341
|
-
if ($[
|
|
404
|
+
if ($[36] !== mods || $[37] !== t15) {
|
|
342
405
|
t16 = {
|
|
343
406
|
...mods,
|
|
344
407
|
...t15
|
|
345
408
|
};
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
} else t16 = $[
|
|
409
|
+
$[36] = mods;
|
|
410
|
+
$[37] = t15;
|
|
411
|
+
$[38] = t16;
|
|
412
|
+
} else t16 = $[38];
|
|
350
413
|
let t17;
|
|
351
|
-
if ($[
|
|
414
|
+
if ($[39] !== focusProps || $[40] !== hoverProps) {
|
|
352
415
|
t17 = mergeProps$1(hoverProps, focusProps);
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
} else t17 = $[
|
|
416
|
+
$[39] = focusProps;
|
|
417
|
+
$[40] = hoverProps;
|
|
418
|
+
$[41] = t17;
|
|
419
|
+
} else t17 = $[41];
|
|
357
420
|
let t18;
|
|
358
|
-
if ($[
|
|
359
|
-
t18 = (tooltipFocusProps) => /* @__PURE__ */ jsx(HiddenInput, {
|
|
421
|
+
if ($[42] !== ariaLabel || $[43] !== getInputProps || $[44] !== isButton || $[45] !== isRadioDisabled || $[46] !== qa) {
|
|
422
|
+
t18 = (tooltipFocusProps, isItemTooltipActive) => /* @__PURE__ */ jsx(HiddenInput, {
|
|
360
423
|
qa: qa || "Radio",
|
|
361
424
|
"data-input-type": "radio",
|
|
362
425
|
"aria-label": ariaLabel,
|
|
363
|
-
...mergeTooltipFocusProps(
|
|
426
|
+
...mergeTooltipFocusProps(getInputProps(isItemTooltipActive), tooltipFocusProps),
|
|
364
427
|
ref: inputRef,
|
|
365
428
|
mods: {
|
|
366
429
|
button: isButton,
|
|
367
430
|
disabled: isRadioDisabled
|
|
368
431
|
}
|
|
369
432
|
});
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
} else t18 = $[
|
|
433
|
+
$[42] = ariaLabel;
|
|
434
|
+
$[43] = getInputProps;
|
|
435
|
+
$[44] = isButton;
|
|
436
|
+
$[45] = isRadioDisabled;
|
|
437
|
+
$[46] = qa;
|
|
438
|
+
$[47] = t18;
|
|
439
|
+
} else t18 = $[47];
|
|
377
440
|
let t19;
|
|
378
|
-
if ($[
|
|
441
|
+
if ($[48] !== domRef || $[49] !== effectiveButtonType || $[50] !== effectiveSize || $[51] !== isRadioDisabled || $[52] !== isRadioSelected || $[53] !== itemProps || $[54] !== label || $[55] !== styles || $[56] !== t13 || $[57] !== t16 || $[58] !== t17 || $[59] !== t18) {
|
|
379
442
|
t19 = /* @__PURE__ */ jsx(RadioButtonElement, {
|
|
380
443
|
ref: domRef,
|
|
381
444
|
type: t12,
|
|
@@ -391,24 +454,24 @@ function Radio(props, ref) {
|
|
|
391
454
|
hiddenContent: t18,
|
|
392
455
|
children: label
|
|
393
456
|
});
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
} else t19 = $[
|
|
457
|
+
$[48] = domRef;
|
|
458
|
+
$[49] = effectiveButtonType;
|
|
459
|
+
$[50] = effectiveSize;
|
|
460
|
+
$[51] = isRadioDisabled;
|
|
461
|
+
$[52] = isRadioSelected;
|
|
462
|
+
$[53] = itemProps;
|
|
463
|
+
$[54] = label;
|
|
464
|
+
$[55] = styles;
|
|
465
|
+
$[56] = t13;
|
|
466
|
+
$[57] = t16;
|
|
467
|
+
$[58] = t17;
|
|
468
|
+
$[59] = t18;
|
|
469
|
+
$[60] = t19;
|
|
470
|
+
} else t19 = $[60];
|
|
408
471
|
return t19;
|
|
409
472
|
}
|
|
410
473
|
let t12;
|
|
411
|
-
if ($[
|
|
474
|
+
if ($[61] !== ariaLabel || $[62] !== domRef || $[63] !== focusProps || $[64] !== getInputProps || $[65] !== hoverProps || $[66] !== isButton || $[67] !== isRadioDisabled || $[68] !== isTooltipActive || $[69] !== label || $[70] !== labelProps || $[71] !== labelStyles || $[72] !== mods || $[73] !== qa || $[74] !== renderWithTooltip || $[75] !== styles || $[76] !== tooltipLabelRef || $[77] !== type) {
|
|
412
475
|
t12 = renderWithTooltip((tooltipTriggerProps, tooltipRef) => {
|
|
413
476
|
const { pointerProps, focusProps: tooltipFocusProps_0 } = splitTooltipTriggerProps(tooltipTriggerProps);
|
|
414
477
|
return /* @__PURE__ */ jsxs(RadioWrapperElement, {
|
|
@@ -425,9 +488,12 @@ function Radio(props, ref) {
|
|
|
425
488
|
qa: qa || "Radio",
|
|
426
489
|
"data-input-type": "radio",
|
|
427
490
|
"aria-label": ariaLabel,
|
|
428
|
-
...mergeTooltipFocusProps(mergeProps$1(
|
|
491
|
+
...mergeTooltipFocusProps(mergeProps$1(getInputProps(isTooltipActive), focusProps), tooltipFocusProps_0),
|
|
429
492
|
ref: inputRef,
|
|
430
|
-
mods: {
|
|
493
|
+
mods: {
|
|
494
|
+
button: isButton,
|
|
495
|
+
disabled: isRadioDisabled
|
|
496
|
+
}
|
|
431
497
|
}),
|
|
432
498
|
/* @__PURE__ */ jsx(RadioNormalElement, {
|
|
433
499
|
"data-element": "Input",
|
|
@@ -445,23 +511,25 @@ function Radio(props, ref) {
|
|
|
445
511
|
]
|
|
446
512
|
});
|
|
447
513
|
}, "top");
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
$[
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
|
|
514
|
+
$[61] = ariaLabel;
|
|
515
|
+
$[62] = domRef;
|
|
516
|
+
$[63] = focusProps;
|
|
517
|
+
$[64] = getInputProps;
|
|
518
|
+
$[65] = hoverProps;
|
|
519
|
+
$[66] = isButton;
|
|
520
|
+
$[67] = isRadioDisabled;
|
|
521
|
+
$[68] = isTooltipActive;
|
|
522
|
+
$[69] = label;
|
|
523
|
+
$[70] = labelProps;
|
|
524
|
+
$[71] = labelStyles;
|
|
525
|
+
$[72] = mods;
|
|
526
|
+
$[73] = qa;
|
|
527
|
+
$[74] = renderWithTooltip;
|
|
528
|
+
$[75] = styles;
|
|
529
|
+
$[76] = tooltipLabelRef;
|
|
530
|
+
$[77] = type;
|
|
531
|
+
$[78] = t12;
|
|
532
|
+
} else t12 = $[78];
|
|
465
533
|
return t12;
|
|
466
534
|
}
|
|
467
535
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","names":["useFocusableRef","BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","OUTER_STYLES","tasty","forwardRef","useRef","useHover","useRadio","FieldBaseProps","mergeProps","useFocus","extractStyles","CubeItemProps","Item","useAutoTooltip","getValidationMods","getValidationTheme","INLINE_LABEL_STYLES","useFieldProps","HiddenInput","RADIO_SIZE_MAP","mergeTooltipFocusProps","splitTooltipTriggerProps","useRadioProvider","RadioGroup","AriaRadioProps","RADIO_BUTTON_COLUMNS","RADIO_BUTTON_BLOCK_COLUMNS","RadioButtonElement","qa","as","styles","preset","lineHeight","flexGrow","gridTemplate","placeContent","shadow","fill","color","radius","margin","zIndex","Label","placeSelf","RadioWrapperElement","position","display","placeItems","gap","flow","width","button","checked","RadioNormalElement","disabled","border","invalid","valid","height","outline","focused","transition","whiteSpace","RadioCircle","RadioCircleElement","RadioLabelElement","ITEM_PROPS","const","RadioItemProps","Pick","CubeRadioProps","Omit","type","buttonType","value","size","Exclude","Radio","props","ref","$","_c","t0","Symbol","for","defaultValidationTrigger","isDisabled","isInvalid","isValid","children","label","t1","autoFocus","labelStyles","t2","labelProps","ariaLabel","form","otherProps","itemProps","itemPropName","Record","radioGroupProps","state","name","contextSize","contextButtonType","contextType","contextIsDisabled","Error","effectiveType","isButton","effectiveSize","effectiveButtonType","forceSelectedMod","baseButtonType","selectedValue","baseIsDisabled","isLoadingButton","isLoading","effectiveIsDisabled","isFocused","focusProps","t3","hoverProps","isHovered","t4","undefined","tooltip","t5","labelRef","t6","isDynamicLabel","tooltipLabelRef","renderWithTooltip","inputRef","domRef","t7","t8","inputProps","isRadioDisabled","isSelected","isRadioSelected","t9","t10","t11","hovered","tabs","mods","t13","includeValid","t15","selected","t16","t17","t18","tooltipFocusProps","t19","t12","tooltipTriggerProps","tooltipRef","pointerProps","tooltipFocusProps_0","element","current","HTMLElement","_Radio","Tabs","ButtonGroup","__Radio","Object","assign","Group","Button","displayName"],"sources":["../../../../src/components/fields/RadioGroup/Radio.tsx"],"sourcesContent":["import { useFocusableRef } from '@react-spectrum/utils';\nimport {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n OUTER_STYLES,\n tasty,\n} from '@tenphi/tasty';\nimport { forwardRef, useRef } from 'react';\nimport { useHover, useRadio } from 'react-aria';\n\nimport { FieldBaseProps } from '../../../shared';\nimport { mergeProps } from '../../../utils/react';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { extractStyles } from '../../../utils/styles';\nimport { CubeItemProps, Item } from '../../content/Item/Item';\nimport { useAutoTooltip } from '../../content/use-auto-tooltip';\nimport {\n getValidationMods,\n getValidationTheme,\n INLINE_LABEL_STYLES,\n useFieldProps,\n} from '../../form';\nimport { HiddenInput } from '../../HiddenInput';\nimport { RADIO_SIZE_MAP } from '../../navigation/Tabs/types';\nimport {\n mergeTooltipFocusProps,\n splitTooltipTriggerProps,\n} from '../../overlays/Tooltip/split-trigger-props';\n\nimport { useRadioProvider } from './context';\nimport { RadioGroup } from './RadioGroup';\n\nimport type { AriaRadioProps } from 'react-aria';\n\nexport { AriaRadioProps };\nexport { useRadio };\n\n/**\n * Same columns as `Item`, but none of them stretches — a radio button is sized\n * by its content, not stretched like a list item. The label column still has a\n * zero minimum, the way `Item`'s `1sf` does, so a radio given less room than\n * its label truncates the label instead of overflowing the button — which is\n * also what lets the auto tooltip (`tooltip` / `tooltip={true}`) fire.\n */\nconst RADIO_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 RADIO_BUTTON_BLOCK_COLUMNS =\n 'max-content max-content max-content max-content max-content max-content';\n\nconst RadioButtonElement = tasty(Item, {\n qa: 'RadioButton',\n as: 'label',\n styles: {\n preset: 't3m',\n lineHeight: '1em',\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 / ${RADIO_BUTTON_COLUMNS}`,\n 'description=inline': `\"icon prefix description suffix rightIcon actions\" auto / ${RADIO_BUTTON_COLUMNS}`,\n 'description=inline & has-label': `\"icon prefix label suffix rightIcon actions\" auto \"icon prefix description suffix rightIcon actions\" auto / ${RADIO_BUTTON_COLUMNS}`,\n 'description=block': `\"icon prefix label suffix rightIcon actions\" auto \"description description description description description description\" auto / ${RADIO_BUTTON_BLOCK_COLUMNS}`,\n },\n placeContent: 'center',\n shadow: {\n '': false,\n 'tabs & selected': '$item-shadow',\n 'tabs & selected & disabled': false,\n },\n fill: {\n 'selected & tabs': '#surface',\n 'selected & tabs & disabled': '#surface.6',\n },\n color: {\n 'selected & tabs': '#dark',\n 'selected & tabs & disabled': '#dark.3',\n },\n\n // Mirror the ButtonSplit grouping: the corner radius is shared so the\n // first/last items keep only their outer-side radius and middle items go\n // square; a -1bw left margin overlaps adjacent borders into a single\n // continuous edge. The selected button is bumped above its siblings so its\n // brand-tinted border is visible from all four sides — without the bump\n // the right edge of an adjacent sibling would paint over the selected\n // button's left edge (and vice-versa). Hover / focus-visible bump higher\n // still so they always read on top of the selected highlight.\n radius: {\n '': true,\n '!tabs & !:last-child': '1r left',\n '!tabs & !:first-child': '1r right',\n '!tabs & !:first-child & !:last-child': 0,\n },\n margin: {\n '': 0,\n '!tabs & !:first-child': '-1bw left',\n },\n zIndex: {\n '!tabs & selected': 1,\n },\n\n Label: {\n placeSelf: {\n '': 'center start',\n '!has-prefix & !has-suffix & !has-icon & !has-right-icon': 'center',\n },\n },\n },\n});\n\nconst RadioWrapperElement = tasty({\n as: 'label',\n qa: 'RadioWrapper',\n styles: {\n position: 'relative',\n display: 'grid',\n placeItems: 'center start',\n placeContent: 'center start',\n gap: '1x',\n flow: 'column',\n preset: 'default',\n width: 'min-content',\n radius: true,\n margin: {\n '': '1x right',\n button: '0',\n },\n zIndex: {\n '': 'initial',\n checked: 1,\n },\n flexGrow: 1,\n },\n});\n\nconst RadioNormalElement = tasty({\n styles: {\n display: 'grid',\n placeItems: 'center',\n radius: 'round',\n fill: {\n '': '#surface',\n disabled: '#disabled-surface',\n },\n color: {\n '': '#clear',\n checked: '#primary-text',\n 'invalid & checked': '#danger-text',\n 'valid & checked': '#success-text',\n 'disabled | !checked': '#clear',\n 'disabled & checked': '#dark.12',\n },\n border: {\n '': '#dark-04',\n checked: '#primary-text',\n invalid: '#danger-text.50',\n valid: '#success-text.50',\n disabled: '#dark.12',\n },\n width: '2x',\n height: '2x',\n outline: {\n '': '#primary-text.0 / 1bw',\n focused: '1bw #primary-text / 1bw',\n },\n transition: 'theme',\n whiteSpace: 'nowrap',\n\n RadioCircle: {\n display: 'block',\n radius: 'round',\n width: '1x',\n height: '1x',\n fill: '#current',\n },\n },\n});\n\nconst RadioCircleElement = <div data-element=\"RadioCircle\" />;\n\nconst RadioLabelElement = tasty({\n qa: 'RadioLabel',\n styles: INLINE_LABEL_STYLES,\n});\n\n/**\n * `Item` props a button-type radio hands straight to the `Item` it renders, so\n * `Radio.Button` accepts the same content and presentation API as an\n * `ItemButton`. Kept as a runtime list so a new `Item` prop only has to be\n * added in one place.\n *\n * A classic radio ignores all of them except `tooltip` and `labelRef`, which\n * it resolves itself (see `useAutoTooltip` in `Radio`).\n *\n * Deliberately absent:\n * - `size`, `type`, `theme`, `isSelected`, `isDisabled`, `mods`, `styles` —\n * owned by the radio (they come from the prop/context/validation resolution\n * below).\n * - `shape` — the radius is owned by the button-group layout below, which keeps\n * only the outer-side radius on the first/last radio so the group reads as one\n * continuous control. Forwarding `shape` would have no effect.\n * - `htmlType`, `as`, `insideWrapper`, `showActions`,\n * `skipActionsWidthTransition` — internal to `Item` / `ItemButton`.\n * - `actions`, `autoHideActions`, `preserveActionsSpace`,\n * `disableActionsFocus` — a button radio renders as a `<label>`, and a click\n * anywhere inside a label activates its control, so nested action buttons\n * would select the radio (and nested interactive content is invalid inside a\n * label to begin with).\n */\nconst ITEM_PROPS = [\n 'icon',\n 'rightIcon',\n 'prefix',\n 'suffix',\n 'description',\n 'descriptionPlacement',\n 'descriptionProps',\n 'tooltip',\n 'hotkeys',\n 'keyboardShortcutProps',\n 'level',\n 'isLoading',\n 'loadingSlot',\n 'highlight',\n 'highlightCaseSensitive',\n 'highlightStyles',\n 'labelRef',\n] as const;\n\ntype RadioItemProps = Pick<CubeItemProps, (typeof ITEM_PROPS)[number]>;\n\nexport interface CubeRadioProps\n extends BaseProps,\n Omit<AriaRadioProps, 'value'>,\n // `labelTooltip` belongs to the group's label: a single radio has none.\n Omit<FieldBaseProps, 'labelTooltip'>,\n /**\n * Container style props apply to button-type radios (they style the `Item`\n * the radio renders). A classic radio only reads the outer subset —\n * everything else belongs to its inner circle and label.\n */\n ContainerStyleProps,\n /**\n * All of these apply to button/tabs-type radios only, except `tooltip`\n * and `labelRef`, which a classic radio supports too.\n */\n RadioItemProps {\n 'aria-label'?: string;\n /* The visual type of the radio button */\n type?: 'button' | 'radio';\n buttonType?: CubeItemProps['type'];\n value?: string;\n /* Size of the button (for button type only) */\n size?: Exclude<CubeItemProps['size'], 'inline'>;\n}\n\nfunction Radio(props: CubeRadioProps, ref) {\n props = useFieldProps(props, { defaultValidationTrigger: 'onChange' });\n\n let {\n qa,\n isDisabled,\n isInvalid,\n isValid,\n children,\n label,\n autoFocus,\n labelStyles,\n labelProps,\n type,\n buttonType,\n size,\n 'aria-label': ariaLabel,\n form,\n ...otherProps\n } = props;\n\n label = label || children;\n\n // Only the props the caller actually passed, so an unset one keeps `Item`'s\n // own default instead of being overridden with `undefined`.\n const itemProps: Record<string, unknown> = {};\n\n for (const itemPropName of ITEM_PROPS) {\n if (itemPropName in props) {\n itemProps[itemPropName] = (props as Record<string, unknown>)[\n itemPropName\n ];\n }\n }\n\n labelStyles = {\n ...INLINE_LABEL_STYLES,\n ...labelStyles,\n };\n\n let radioGroupProps = useRadioProvider();\n\n let state = radioGroupProps && radioGroupProps.state;\n let name = radioGroupProps && radioGroupProps.name;\n let contextSize = radioGroupProps?.size;\n let contextButtonType = radioGroupProps?.buttonType;\n let contextType = radioGroupProps?.type;\n let contextIsDisabled = radioGroupProps?.isDisabled;\n\n if (!state) {\n throw new Error('CubeUI: The Radio button is used outside the RadioGroup.');\n }\n\n // Determine effective type from props or context\n let effectiveType = type ?? contextType ?? 'radio';\n let isButton = effectiveType === 'button' || effectiveType === 'tabs';\n\n // A button radio *is* an `Item`, so it takes the same container style props an\n // `ItemButton` does. A classic radio only exposes the outer subset: the rest\n // would land on the wrapper that holds the circle and the label, where\n // `padding` / `fill` / `preset` mean something entirely different.\n let styles = extractStyles(\n otherProps,\n isButton ? CONTAINER_STYLES : OUTER_STYLES,\n );\n\n // Determine effective size with priority: prop > context > default\n let effectiveSize: CubeItemProps['size'] = (size ??\n contextSize ??\n 'medium') as CubeItemProps['size'];\n\n // Apply size mapping for tabs mode button radios.\n // API sizes mapped to Item button sizes: large -> medium (40px), medium -> xsmall (32px).\n if (effectiveType === 'tabs' && isButton) {\n effectiveSize =\n RADIO_SIZE_MAP[effectiveSize === 'large' ? 'large' : 'medium'];\n }\n\n // Determine effective button type\n // In tabs mode, always use 'clear' and ignore buttonType prop.\n let effectiveButtonType: string;\n // When buttonType is 'primary', non-selected radios use 'outline' with a\n // visual-only `selected` mod (mods.selected=true) to render the brand-tinted\n // outline+selected look — this is the only place mods.selected intentionally\n // decouples from the aria/isSelected state. Suppressed while disabled: the\n // real selected radio is then painted with the brand-tinted disabled chip\n // (`accent-disabled-surface`), and faking `selected` on its siblings would\n // give them the outline variant of that same chip and erase the distinction.\n let forceSelectedMod = false;\n if (effectiveType === 'tabs') {\n effectiveButtonType = 'clear';\n } else {\n const baseButtonType = buttonType ?? contextButtonType ?? 'outline';\n if (baseButtonType === 'primary') {\n if (state.selectedValue === props.value) {\n effectiveButtonType = 'primary';\n } else {\n effectiveButtonType = 'outline';\n forceSelectedMod = true;\n }\n } else {\n effectiveButtonType = baseButtonType;\n }\n }\n\n // Use context isDisabled if prop isDisabled is not explicitly set\n let baseIsDisabled = isDisabled ?? contextIsDisabled ?? false;\n\n // Loading has to disable the radio here, not inside `Item`. `useRadio` and the\n // `HiddenInput` covering the button own the actual selection, so leaving it to\n // `Item` would render a spinner on an option that still takes clicks and arrow\n // keys. And because this component always passes a resolved `isDisabled` down,\n // an unresolved `isLoading` would additionally read to `Item` as an explicit\n // `isDisabled={false}` and cancel its own loading-disables-the-item rule.\n //\n // Same precedence as `Item` / `ItemButton`: an explicit `isDisabled={false}`\n // still wins over loading. Button-type only — a classic radio has no spinner,\n // so disabling it on `isLoading` would leave no visible reason why.\n let isLoadingButton = isButton && props.isLoading === true;\n let effectiveIsDisabled =\n baseIsDisabled === true || (isLoadingButton && isDisabled !== false);\n\n let { isFocused, focusProps } = useFocus(true);\n let { hoverProps, isHovered } = useHover({ isDisabled: effectiveIsDisabled });\n\n // A button radio hands `tooltip` to its `Item`, which resolves it around the\n // element it renders. A classic radio has no `Item`, so it resolves its own —\n // otherwise the prop the type accepts would render nothing at all.\n let { labelRef: tooltipLabelRef, renderWithTooltip } = useAutoTooltip({\n tooltip: isButton ? undefined : props.tooltip,\n children: label,\n labelRef: isButton ? undefined : props.labelRef,\n // As for a button radio's `Item`: an auto tooltip that mounted only once\n // the label truncated would remount the radio, and its focused input.\n isDynamicLabel: true,\n });\n\n let inputRef = useRef(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {\n inputProps,\n isDisabled: isRadioDisabled,\n isSelected: isRadioSelected,\n } = useRadio(\n {\n name,\n ...props,\n isDisabled: effectiveIsDisabled,\n value: props.value ?? '',\n },\n state,\n inputRef,\n );\n\n const mods = {\n checked: isRadioSelected,\n ...getValidationMods({ isInvalid, isValid }),\n disabled: isRadioDisabled,\n hovered: isHovered,\n button: isButton,\n focused: isFocused,\n tabs: effectiveType === 'tabs',\n };\n\n // Render button type using Item\n if (isButton) {\n return (\n <RadioButtonElement\n ref={domRef}\n type={effectiveButtonType}\n theme={getValidationTheme(\n 'default',\n { isInvalid, isValid },\n { includeValid: true },\n )}\n size={effectiveSize}\n {...itemProps}\n isSelected={isRadioSelected}\n isDisabled={isRadioDisabled}\n mods={{\n ...mods,\n ...(forceSelectedMod && !isRadioDisabled ? { selected: true } : {}),\n }}\n styles={styles}\n {...mergeProps(hoverProps, focusProps)}\n // Outside the label, so `Item` sees the label alone: its auto tooltip\n // and `highlight` only work on a string label, and an input counted as\n // label content gave an icon-only radio an empty, padded `Label`.\n // Its label's room follows the group's, so whether it truncates can\n // change while it has focus — keep the tooltip from remounting it.\n isDynamicLabel\n // A function, so the input — where keyboard focus lands — gets the\n // tooltip's focus-side trigger props: the tooltip opens on focus and\n // describes the control a screen reader announces.\n hiddenContent={(tooltipFocusProps) => (\n <HiddenInput\n qa={qa || 'Radio'}\n data-input-type=\"radio\"\n aria-label={ariaLabel}\n {...mergeTooltipFocusProps(inputProps, tooltipFocusProps)}\n ref={inputRef}\n mods={{ button: isButton, disabled: isRadioDisabled }}\n />\n )}\n >\n {label}\n </RadioButtonElement>\n );\n }\n\n // Render classic radio type\n return renderWithTooltip((tooltipTriggerProps, tooltipRef) => {\n // Hover on the wrapper, focus on the input it holds (see the button branch).\n const { pointerProps, focusProps: tooltipFocusProps } =\n splitTooltipTriggerProps(tooltipTriggerProps);\n\n return (\n <RadioWrapperElement\n styles={styles}\n {...mergeProps(hoverProps, pointerProps)}\n ref={\n tooltipRef\n ? // Written only when React attaches the node, never during render.\n (element: HTMLLabelElement | null) => {\n (domRef as { current: HTMLElement | null }).current = element;\n (tooltipRef as { current: HTMLElement | null }).current =\n element;\n }\n : domRef\n }\n mods={mods}\n data-type={type}\n >\n <HiddenInput\n qa={qa || 'Radio'}\n data-input-type=\"radio\"\n aria-label={ariaLabel}\n {...mergeTooltipFocusProps(\n mergeProps(inputProps, focusProps),\n tooltipFocusProps,\n )}\n ref={inputRef}\n mods={{ button: isButton }}\n />\n <RadioNormalElement data-element=\"Input\" mods={mods} data-type={type}>\n {RadioCircleElement}\n </RadioNormalElement>\n {label && (\n <RadioLabelElement\n ref={tooltipLabelRef}\n mods={mods}\n styles={labelStyles}\n {...(labelProps ? filterBaseProps(labelProps) : undefined)}\n >\n {label}\n </RadioLabelElement>\n )}\n </RadioWrapperElement>\n );\n }, 'top');\n}\n\n/**\n * Radio buttons 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 _Radio = forwardRef(Radio);\n\nconst Tabs = tasty(RadioGroup, {\n type: 'tabs',\n});\n\nconst ButtonGroup = tasty(RadioGroup, {\n type: 'button',\n});\n\nconst __Radio = Object.assign(\n _Radio as typeof _Radio & {\n Group: typeof RadioGroup;\n Tabs: typeof Tabs;\n ButtonGroup: typeof ButtonGroup;\n Button: typeof _Radio;\n },\n {\n Group: RadioGroup,\n Tabs,\n ButtonGroup,\n Button: _Radio,\n },\n);\n\n__Radio.displayName = 'Radio';\n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AAgC,gBAAA;MAAcqC;MAAiB5E,aAAAA;gBAC7DR;OAEF;KAAA0B,SACC,oBAAC;MACM2C,KAAAA;MACCe;MACEvD,QAAAA;MAAW,GACdE,aAAa/F,gBAAgB+F,WAAuB,GAApDgC;gBAEJrC;OAEL;;KACoB;KAEvB,MAAM;AAAAV,IAAA,MAAAgB;AAAAhB,IAAA,MAAAwD;AAAAxD,IAAA,MAAA0C;AAAA1C,IAAA,MAAA4C;AAAA5C,IAAA,MAAA2D;AAAA3D,IAAA,MAAA+B;AAAA/B,IAAA,MAAAU;AAAAV,IAAA,MAAAe;AAAAf,IAAA,MAAAa;AAAAb,IAAA,MAAAoE;AAAApE,IAAA,MAAApD;AAAAoD,IAAA,MAAAsD;AAAAtD,IAAA,MAAAlD;AAAAkD,IAAA,MAAAqD;AAAArD,IAAA,MAAAR;AAAAQ,IAAA,MAAA8E;OAAAA,OAAA9E,EAAA;AAAA,QAhDF8E;;;;;;AAuDT,MAAMQ,SAASnK,WAAW0E,MAAM;AAEhC,MAAM0F,OAAOrK,MAAMqB,aAAY,EAC7BiD,MAAM,QACP,CAAC;AAEF,MAAMgG,cAActK,MAAMqB,aAAY,EACpCiD,MAAM,UACP,CAAC;AAEF,MAAMiG,UAAUC,OAAOC,OACrBL,QAMA;CACEM,OAAOrJ;CACPgJ;CACAC;CACAK,QAAQP;CAEZ,CAAC;AAEDG,QAAQK,cAAc"}
|
|
1
|
+
{"version":3,"file":"Radio.js","names":["useFocusableRef","BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","OUTER_STYLES","tasty","forwardRef","useRef","useHover","useRadio","FieldBaseProps","mergeProps","getDisabledElementProps","omitActivationEventProps","useFocus","extractStyles","CubeItemProps","Item","useAutoTooltip","getValidationMods","getValidationTheme","INLINE_LABEL_STYLES","useFieldProps","HiddenInput","RADIO_SIZE_MAP","mergeTooltipFocusProps","splitTooltipTriggerProps","useRadioProvider","RadioGroup","ChangeEvent","KeyboardEvent","AriaRadioProps","RadioGroupState","RADIO_BUTTON_COLUMNS","RADIO_BUTTON_BLOCK_COLUMNS","RadioButtonElement","qa","as","styles","preset","lineHeight","flexGrow","gridTemplate","placeContent","shadow","fill","color","radius","margin","zIndex","Label","placeSelf","RadioWrapperElement","position","display","placeItems","gap","flow","width","button","checked","RadioNormalElement","disabled","border","invalid","valid","height","outline","focused","transition","whiteSpace","RadioCircle","RadioCircleElement","getRovingTabIndex","state","value","selectedValue","lastFocusedValue","ignoreChange","event","stopPropagation","leaveGroupOnTab","HTMLInputElement","input","currentTarget","key","altKey","ctrlKey","metaKey","radios","closest","querySelectorAll","selected","Array","from","find","radio","tabIndex","setTimeout","RadioLabelElement","ITEM_PROPS","const","RadioItemProps","Pick","CubeRadioProps","Omit","type","buttonType","size","Exclude","Radio","props","ref","$","_c","t0","Symbol","for","defaultValidationTrigger","isDisabled","isInvalid","isValid","children","label","t1","autoFocus","labelStyles","t2","labelProps","ariaLabel","form","otherProps","itemProps","itemPropName","Record","radioGroupProps","name","contextSize","contextButtonType","contextType","contextIsDisabled","Error","effectiveType","isButton","effectiveSize","effectiveButtonType","forceSelectedMod","baseButtonType","baseIsDisabled","isLoadingButton","isLoading","effectiveIsDisabled","isFocused","focusProps","t3","hoverProps","isHovered","t4","undefined","tooltip","t5","labelRef","t6","isDynamicLabel","tooltipLabelRef","renderWithTooltip","isTooltipActive","inputRef","domRef","t7","inputProps","isRadioDisabled","isSelected","isRadioSelected","t8","hasActiveTooltip","isInert","inertProps","keepEvents","onChange","onFocus","setLastFocusedValue","onKeyDown","getInputProps","t9","t10","t11","hovered","tabs","mods","t13","includeValid","t15","t16","t17","t18","tooltipFocusProps","isItemTooltipActive","t19","t12","tooltipTriggerProps","tooltipRef","pointerProps","tooltipFocusProps_0","element","current","HTMLElement","_Radio","Tabs","ButtonGroup","__Radio","Object","assign","Group","Button","displayName"],"sources":["../../../../src/components/fields/RadioGroup/Radio.tsx"],"sourcesContent":["import { useFocusableRef } from '@react-spectrum/utils';\nimport {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n OUTER_STYLES,\n tasty,\n} from '@tenphi/tasty';\nimport { forwardRef, useRef } from 'react';\nimport { useHover, useRadio } from 'react-aria';\n\nimport { FieldBaseProps } from '../../../shared';\nimport { mergeProps } from '../../../utils/react';\nimport {\n getDisabledElementProps,\n omitActivationEventProps,\n} from '../../../utils/react/disabledProps';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { extractStyles } from '../../../utils/styles';\nimport { CubeItemProps, Item } from '../../content/Item/Item';\nimport { useAutoTooltip } from '../../content/use-auto-tooltip';\nimport {\n getValidationMods,\n getValidationTheme,\n INLINE_LABEL_STYLES,\n useFieldProps,\n} from '../../form';\nimport { HiddenInput } from '../../HiddenInput';\nimport { RADIO_SIZE_MAP } from '../../navigation/Tabs/types';\nimport {\n mergeTooltipFocusProps,\n splitTooltipTriggerProps,\n} from '../../overlays/Tooltip/split-trigger-props';\n\nimport { useRadioProvider } from './context';\nimport { RadioGroup } from './RadioGroup';\n\nimport type { ChangeEvent, KeyboardEvent } from 'react';\nimport type { AriaRadioProps } from 'react-aria';\nimport type { RadioGroupState } from 'react-stately';\n\nexport { AriaRadioProps };\nexport { useRadio };\n\n/**\n * Same columns as `Item`, but none of them stretches — a radio button is sized\n * by its content, not stretched like a list item. The label column still has a\n * zero minimum, the way `Item`'s `1sf` does, so a radio given less room than\n * its label truncates the label instead of overflowing the button — which is\n * also what lets the auto tooltip (`tooltip` / `tooltip={true}`) fire.\n */\nconst RADIO_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 RADIO_BUTTON_BLOCK_COLUMNS =\n 'max-content max-content max-content max-content max-content max-content';\n\nconst RadioButtonElement = tasty(Item, {\n qa: 'RadioButton',\n as: 'label',\n styles: {\n preset: 't3m',\n lineHeight: '1em',\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 / ${RADIO_BUTTON_COLUMNS}`,\n 'description=inline': `\"icon prefix description suffix rightIcon actions\" auto / ${RADIO_BUTTON_COLUMNS}`,\n 'description=inline & has-label': `\"icon prefix label suffix rightIcon actions\" auto \"icon prefix description suffix rightIcon actions\" auto / ${RADIO_BUTTON_COLUMNS}`,\n 'description=block': `\"icon prefix label suffix rightIcon actions\" auto \"description description description description description description\" auto / ${RADIO_BUTTON_BLOCK_COLUMNS}`,\n },\n placeContent: 'center',\n shadow: {\n '': false,\n 'tabs & selected': '$item-shadow',\n 'tabs & selected & disabled': false,\n },\n fill: {\n 'selected & tabs': '#surface',\n 'selected & tabs & disabled': '#surface.6',\n },\n color: {\n 'selected & tabs': '#dark',\n 'selected & tabs & disabled': '#dark.3',\n },\n\n // Mirror the ButtonSplit grouping: the corner radius is shared so the\n // first/last items keep only their outer-side radius and middle items go\n // square; a -1bw left margin overlaps adjacent borders into a single\n // continuous edge. The selected button is bumped above its siblings so its\n // brand-tinted border is visible from all four sides — without the bump\n // the right edge of an adjacent sibling would paint over the selected\n // button's left edge (and vice-versa). Hover / focus-visible bump higher\n // still so they always read on top of the selected highlight.\n radius: {\n '': true,\n '!tabs & !:last-child': '1r left',\n '!tabs & !:first-child': '1r right',\n '!tabs & !:first-child & !:last-child': 0,\n },\n margin: {\n '': 0,\n '!tabs & !:first-child': '-1bw left',\n },\n zIndex: {\n '!tabs & selected': 1,\n },\n\n Label: {\n placeSelf: {\n '': 'center start',\n '!has-prefix & !has-suffix & !has-icon & !has-right-icon': 'center',\n },\n },\n },\n});\n\nconst RadioWrapperElement = tasty({\n as: 'label',\n qa: 'RadioWrapper',\n styles: {\n position: 'relative',\n display: 'grid',\n placeItems: 'center start',\n placeContent: 'center start',\n gap: '1x',\n flow: 'column',\n preset: 'default',\n width: 'min-content',\n radius: true,\n margin: {\n '': '1x right',\n button: '0',\n },\n zIndex: {\n '': 'initial',\n checked: 1,\n },\n flexGrow: 1,\n },\n});\n\nconst RadioNormalElement = tasty({\n styles: {\n display: 'grid',\n placeItems: 'center',\n radius: 'round',\n fill: {\n '': '#surface',\n disabled: '#disabled-surface',\n },\n color: {\n '': '#clear',\n checked: '#primary-text',\n 'invalid & checked': '#danger-text',\n 'valid & checked': '#success-text',\n 'disabled | !checked': '#clear',\n 'disabled & checked': '#dark.12',\n },\n border: {\n '': '#dark-04',\n checked: '#primary-text',\n invalid: '#danger-text.50',\n valid: '#success-text.50',\n disabled: '#dark.12',\n },\n width: '2x',\n height: '2x',\n outline: {\n '': '#primary-text.0 / 1bw',\n focused: '1bw #primary-text / 1bw',\n },\n transition: 'theme',\n whiteSpace: 'nowrap',\n\n RadioCircle: {\n display: 'block',\n radius: 'round',\n width: '1x',\n height: '1x',\n fill: '#current',\n },\n },\n});\n\nconst RadioCircleElement = <div data-element=\"RadioCircle\" />;\n\n/**\n * The tab stop `useRadio` gives an enabled radio and drops for a disabled one:\n * the selected radio or, with nothing selected, every radio until one of them\n * takes focus, so Tab enters the group from either end.\n */\nfunction getRovingTabIndex(state: RadioGroupState, value: string) {\n if (state.selectedValue != null) {\n return state.selectedValue === value ? 0 : -1;\n }\n\n return state.lastFocusedValue == null || state.lastFocusedValue === value\n ? 0\n : -1;\n}\n\n/**\n * React reports a click on an inert radio as a change: the browser checks it\n * before the click is cancelled. Kept as a handler rather than dropped, or\n * React would warn about a `checked` input without one.\n */\nfunction ignoreChange(event: ChangeEvent) {\n event.stopPropagation();\n}\n\n/**\n * Tab leaves the group from a focused disabled radio, as it does from the\n * group's tab stop, the selected radio. Left to itself the browser would stop\n * on the selected radio first when it lies ahead, so that radio gives up its\n * tab stop for this one key. Focusing it on the way out instead would open its\n * tooltip and scroll to it.\n */\nfunction leaveGroupOnTab(\n event: KeyboardEvent<HTMLInputElement>,\n selectedValue: string | null,\n) {\n let input = event.currentTarget;\n\n if (\n event.key !== 'Tab' ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n selectedValue == null ||\n input.value === selectedValue\n ) {\n return;\n }\n\n let radios = input\n .closest('[role=\"radiogroup\"]')\n ?.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]');\n\n let selected = Array.from(radios ?? []).find(\n (radio) => radio.value === selectedValue,\n );\n\n // Already dropped by an earlier Tab that moved nothing: its restore is due.\n if (!selected || selected.disabled || selected.tabIndex < 0) return;\n\n let { tabIndex } = selected;\n\n selected.tabIndex = -1;\n // The key's default action, or a `FocusScope`, moves focus synchronously.\n // A blur handler may have moved the selection, and its tab stop, meanwhile.\n setTimeout(() => {\n if (selected.checked) selected.tabIndex = tabIndex;\n });\n}\n\nconst RadioLabelElement = tasty({\n qa: 'RadioLabel',\n styles: INLINE_LABEL_STYLES,\n});\n\n/**\n * `Item` props a button-type radio hands straight to the `Item` it renders, so\n * `Radio.Button` accepts the same content and presentation API as an\n * `ItemButton`. Kept as a runtime list so a new `Item` prop only has to be\n * added in one place.\n *\n * A classic radio ignores all of them except `tooltip` and `labelRef`, which\n * it resolves itself (see `useAutoTooltip` in `Radio`).\n *\n * Deliberately absent:\n * - `size`, `type`, `theme`, `isSelected`, `isDisabled`, `mods`, `styles` —\n * owned by the radio (they come from the prop/context/validation resolution\n * below).\n * - `shape` — the radius is owned by the button-group layout below, which keeps\n * only the outer-side radius on the first/last radio so the group reads as one\n * continuous control. Forwarding `shape` would have no effect.\n * - `htmlType`, `as`, `insideWrapper`, `showActions`,\n * `skipActionsWidthTransition` — internal to `Item` / `ItemButton`.\n * - `actions`, `autoHideActions`, `preserveActionsSpace`,\n * `disableActionsFocus` — a button radio renders as a `<label>`, and a click\n * anywhere inside a label activates its control, so nested action buttons\n * would select the radio (and nested interactive content is invalid inside a\n * label to begin with).\n */\nconst ITEM_PROPS = [\n 'icon',\n 'rightIcon',\n 'prefix',\n 'suffix',\n 'description',\n 'descriptionPlacement',\n 'descriptionProps',\n 'tooltip',\n 'hotkeys',\n 'keyboardShortcutProps',\n 'level',\n 'isLoading',\n 'loadingSlot',\n 'highlight',\n 'highlightCaseSensitive',\n 'highlightStyles',\n 'labelRef',\n] as const;\n\ntype RadioItemProps = Pick<CubeItemProps, (typeof ITEM_PROPS)[number]>;\n\nexport interface CubeRadioProps\n extends BaseProps,\n Omit<AriaRadioProps, 'value'>,\n // `labelTooltip` belongs to the group's label: a single radio has none.\n Omit<FieldBaseProps, 'labelTooltip'>,\n /**\n * Container style props apply to button-type radios (they style the `Item`\n * the radio renders). A classic radio only reads the outer subset —\n * everything else belongs to its inner circle and label.\n */\n ContainerStyleProps,\n /**\n * All of these apply to button/tabs-type radios only, except `tooltip`\n * and `labelRef`, which a classic radio supports too.\n */\n RadioItemProps {\n 'aria-label'?: string;\n /* The visual type of the radio button */\n type?: 'button' | 'radio';\n buttonType?: CubeItemProps['type'];\n value?: string;\n /* Size of the button (for button type only) */\n size?: Exclude<CubeItemProps['size'], 'inline'>;\n}\n\nfunction Radio(props: CubeRadioProps, ref) {\n props = useFieldProps(props, { defaultValidationTrigger: 'onChange' });\n\n let {\n qa,\n isDisabled,\n isInvalid,\n isValid,\n children,\n label,\n autoFocus,\n labelStyles,\n labelProps,\n type,\n buttonType,\n size,\n 'aria-label': ariaLabel,\n form,\n ...otherProps\n } = props;\n\n label = label || children;\n\n // Only the props the caller actually passed, so an unset one keeps `Item`'s\n // own default instead of being overridden with `undefined`.\n const itemProps: Record<string, unknown> = {};\n\n for (const itemPropName of ITEM_PROPS) {\n if (itemPropName in props) {\n itemProps[itemPropName] = (props as Record<string, unknown>)[\n itemPropName\n ];\n }\n }\n\n labelStyles = {\n ...INLINE_LABEL_STYLES,\n ...labelStyles,\n };\n\n let radioGroupProps = useRadioProvider();\n\n let state = radioGroupProps && radioGroupProps.state;\n let name = radioGroupProps && radioGroupProps.name;\n let contextSize = radioGroupProps?.size;\n let contextButtonType = radioGroupProps?.buttonType;\n let contextType = radioGroupProps?.type;\n let contextIsDisabled = radioGroupProps?.isDisabled;\n\n if (!state) {\n throw new Error('CubeUI: The Radio button is used outside the RadioGroup.');\n }\n\n // Determine effective type from props or context\n let effectiveType = type ?? contextType ?? 'radio';\n let isButton = effectiveType === 'button' || effectiveType === 'tabs';\n\n // A button radio *is* an `Item`, so it takes the same container style props an\n // `ItemButton` does. A classic radio only exposes the outer subset: the rest\n // would land on the wrapper that holds the circle and the label, where\n // `padding` / `fill` / `preset` mean something entirely different.\n let styles = extractStyles(\n otherProps,\n isButton ? CONTAINER_STYLES : OUTER_STYLES,\n );\n\n // Determine effective size with priority: prop > context > default\n let effectiveSize: CubeItemProps['size'] = (size ??\n contextSize ??\n 'medium') as CubeItemProps['size'];\n\n // Apply size mapping for tabs mode button radios.\n // API sizes mapped to Item button sizes: large -> medium (40px), medium -> xsmall (32px).\n if (effectiveType === 'tabs' && isButton) {\n effectiveSize =\n RADIO_SIZE_MAP[effectiveSize === 'large' ? 'large' : 'medium'];\n }\n\n // Determine effective button type\n // In tabs mode, always use 'clear' and ignore buttonType prop.\n let effectiveButtonType: string;\n // When buttonType is 'primary', non-selected radios use 'outline' with a\n // visual-only `selected` mod (mods.selected=true) to render the brand-tinted\n // outline+selected look — this is the only place mods.selected intentionally\n // decouples from the aria/isSelected state. Suppressed while disabled: the\n // real selected radio is then painted with the brand-tinted disabled chip\n // (`accent-disabled-surface`), and faking `selected` on its siblings would\n // give them the outline variant of that same chip and erase the distinction.\n let forceSelectedMod = false;\n if (effectiveType === 'tabs') {\n effectiveButtonType = 'clear';\n } else {\n const baseButtonType = buttonType ?? contextButtonType ?? 'outline';\n if (baseButtonType === 'primary') {\n if (state.selectedValue === props.value) {\n effectiveButtonType = 'primary';\n } else {\n effectiveButtonType = 'outline';\n forceSelectedMod = true;\n }\n } else {\n effectiveButtonType = baseButtonType;\n }\n }\n\n // Use context isDisabled if prop isDisabled is not explicitly set\n let baseIsDisabled = isDisabled ?? contextIsDisabled ?? false;\n\n // Loading has to disable the radio here, not inside `Item`. `useRadio` and the\n // `HiddenInput` covering the button own the actual selection, so leaving it to\n // `Item` would render a spinner on an option that still takes clicks and arrow\n // keys. And because this component always passes a resolved `isDisabled` down,\n // an unresolved `isLoading` would additionally read to `Item` as an explicit\n // `isDisabled={false}` and cancel its own loading-disables-the-item rule.\n //\n // Same precedence as `Item` / `ItemButton`: an explicit `isDisabled={false}`\n // still wins over loading. Button-type only — a classic radio has no spinner,\n // so disabling it on `isLoading` would leave no visible reason why.\n let isLoadingButton = isButton && props.isLoading === true;\n let effectiveIsDisabled =\n baseIsDisabled === true || (isLoadingButton && isDisabled !== false);\n\n let { isFocused, focusProps } = useFocus(true);\n let { hoverProps, isHovered } = useHover({ isDisabled: effectiveIsDisabled });\n\n // A button radio hands `tooltip` to its `Item`, which resolves it around the\n // element it renders. A classic radio has no `Item`, so it resolves its own —\n // otherwise the prop the type accepts would render nothing at all.\n let {\n labelRef: tooltipLabelRef,\n renderWithTooltip,\n isTooltipActive,\n } = useAutoTooltip({\n tooltip: isButton ? undefined : props.tooltip,\n children: label,\n labelRef: isButton ? undefined : props.labelRef,\n // As for a button radio's `Item`: an auto tooltip that mounted only once\n // the label truncated would remount the radio, and its focused input.\n isDynamicLabel: true,\n });\n\n let inputRef = useRef(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let value = props.value ?? '';\n\n let {\n inputProps,\n isDisabled: isRadioDisabled,\n isSelected: isRadioSelected,\n } = useRadio(\n {\n name,\n ...props,\n isDisabled: effectiveIsDisabled,\n value,\n },\n state,\n inputRef,\n );\n\n // A disabled radio with a tooltip to show keeps its focus, as a disabled\n // `Button` does: the tooltip is usually the reason it is disabled, and focus\n // is how the keyboard opens it (CUB-5387). It is marked `aria-disabled` and\n // kept inert instead. `useRadio` gives a disabled radio no tab stop and does\n // not track its focus, so both are restored here; `RadioGroup` keeps the\n // arrow keys from selecting it.\n let getInputProps = (hasActiveTooltip: boolean) => {\n let { isInert, inertProps } = getDisabledElementProps({\n isDisabled: isRadioDisabled,\n keepEvents: hasActiveTooltip,\n as: 'input',\n });\n\n if (!isInert) return inputProps;\n\n return mergeProps(\n {\n ...omitActivationEventProps(inputProps),\n disabled: false,\n tabIndex: getRovingTabIndex(state, value),\n onChange: ignoreChange,\n },\n {\n onFocus: () => state.setLastFocusedValue(value),\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) =>\n leaveGroupOnTab(event, state.selectedValue),\n },\n inertProps,\n );\n };\n\n const mods = {\n checked: isRadioSelected,\n ...getValidationMods({ isInvalid, isValid }),\n disabled: isRadioDisabled,\n hovered: isHovered,\n button: isButton,\n focused: isFocused,\n tabs: effectiveType === 'tabs',\n };\n\n // Render button type using Item\n if (isButton) {\n return (\n <RadioButtonElement\n ref={domRef}\n type={effectiveButtonType}\n theme={getValidationTheme(\n 'default',\n { isInvalid, isValid },\n { includeValid: true },\n )}\n size={effectiveSize}\n {...itemProps}\n isSelected={isRadioSelected}\n isDisabled={isRadioDisabled}\n mods={{\n ...mods,\n ...(forceSelectedMod && !isRadioDisabled ? { selected: true } : {}),\n }}\n styles={styles}\n {...mergeProps(hoverProps, focusProps)}\n // Outside the label, so `Item` sees the label alone: its auto tooltip\n // and `highlight` only work on a string label, and an input counted as\n // label content gave an icon-only radio an empty, padded `Label`.\n // Its label's room follows the group's, so whether it truncates can\n // change while it has focus — keep the tooltip from remounting it.\n isDynamicLabel\n // A function, so the input — where keyboard focus lands — gets the\n // tooltip's focus-side trigger props: the tooltip opens on focus and\n // describes the control a screen reader announces.\n hiddenContent={(tooltipFocusProps, isItemTooltipActive) => (\n <HiddenInput\n qa={qa || 'Radio'}\n data-input-type=\"radio\"\n aria-label={ariaLabel}\n {...mergeTooltipFocusProps(\n getInputProps(isItemTooltipActive),\n tooltipFocusProps,\n )}\n ref={inputRef}\n mods={{ button: isButton, disabled: isRadioDisabled }}\n />\n )}\n >\n {label}\n </RadioButtonElement>\n );\n }\n\n // Render classic radio type\n return renderWithTooltip((tooltipTriggerProps, tooltipRef) => {\n // Hover on the wrapper, focus on the input it holds (see the button branch).\n const { pointerProps, focusProps: tooltipFocusProps } =\n splitTooltipTriggerProps(tooltipTriggerProps);\n\n return (\n <RadioWrapperElement\n styles={styles}\n {...mergeProps(hoverProps, pointerProps)}\n ref={\n tooltipRef\n ? // Written only when React attaches the node, never during render.\n (element: HTMLLabelElement | null) => {\n (domRef as { current: HTMLElement | null }).current = element;\n (tooltipRef as { current: HTMLElement | null }).current =\n element;\n }\n : domRef\n }\n mods={mods}\n data-type={type}\n >\n <HiddenInput\n qa={qa || 'Radio'}\n data-input-type=\"radio\"\n aria-label={ariaLabel}\n {...mergeTooltipFocusProps(\n mergeProps(getInputProps(isTooltipActive), focusProps),\n tooltipFocusProps,\n )}\n ref={inputRef}\n // Not left to the native `disabled`, which an inert radio drops.\n mods={{ button: isButton, disabled: isRadioDisabled }}\n />\n <RadioNormalElement data-element=\"Input\" mods={mods} data-type={type}>\n {RadioCircleElement}\n </RadioNormalElement>\n {label && (\n <RadioLabelElement\n ref={tooltipLabelRef}\n mods={mods}\n styles={labelStyles}\n {...(labelProps ? filterBaseProps(labelProps) : undefined)}\n >\n {label}\n </RadioLabelElement>\n )}\n </RadioWrapperElement>\n );\n }, 'top');\n}\n\n/**\n * Radio buttons 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 _Radio = forwardRef(Radio);\n\nconst Tabs = tasty(RadioGroup, {\n type: 'tabs',\n});\n\nconst ButtonGroup = tasty(RadioGroup, {\n type: 'button',\n});\n\nconst __Radio = Object.assign(\n _Radio as typeof _Radio & {\n Group: typeof RadioGroup;\n Tabs: typeof Tabs;\n ButtonGroup: typeof ButtonGroup;\n Button: typeof _Radio;\n },\n {\n Group: RadioGroup,\n Tabs,\n ButtonGroup,\n Button: _Radio,\n },\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