@cube-dev/ui-kit 0.120.0 → 0.121.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 +20 -0
- package/dist/_internal/hooks/use-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +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.d.ts +1 -0
- package/dist/components/actions/Button/Button.js +34 -14
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.d.ts +47 -0
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +105 -0
- package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +1 -0
- package/dist/components/actions/ButtonSplit/context.d.ts +18 -0
- package/dist/components/actions/ButtonSplit/context.js +12 -0
- package/dist/components/actions/ButtonSplit/context.js.map +1 -0
- package/dist/components/actions/ButtonSplit/index.d.ts +3 -0
- 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/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.d.ts +2 -2
- 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/index.d.ts +8 -3
- package/dist/components/actions/index.js +10 -5
- package/dist/components/actions/index.js.map +1 -1
- package/dist/components/actions/use-action.d.ts +1 -0
- package/dist/components/actions/use-action.js +21 -18
- package/dist/components/actions/use-action.js.map +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 +2 -1
- package/dist/components/content/Badge/Badge.js.map +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 +5 -2
- package/dist/components/content/Disclosure/Disclosure.js.map +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/Item/Item.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +3 -2
- package/dist/components/content/ItemBadge/ItemBadge.js.map +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +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/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 +2 -1
- package/dist/components/content/Tag/Tag.js.map +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/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.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/ComboBox/ComboBox.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/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/intl.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.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 +2 -2
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/ListBox.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 +2 -2
- package/dist/components/fields/RadioGroup/Radio.js +3 -1
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.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/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/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/extract-field-wrapper-props.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/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/index.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/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/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/EditableTitle.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 +2 -1
- package/dist/components/navigation/Tabs/TabPicker.js.map +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/styled.js +3 -1
- package/dist/components/navigation/Tabs/styled.js.map +1 -1
- package/dist/components/navigation/Tabs/types.d.ts +2 -2
- 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 +1 -1
- package/dist/components/organisms/FileTabs/FileTabs.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/RangeCalendar.js +1 -1
- package/dist/components/other/CloudLogo/CloudLogo.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 +2 -2
- 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/context.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/OpenTransition.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 +2 -2
- 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/context.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/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 +6 -6
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.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/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/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/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 +6 -4
- package/dist/index.js +7 -5
- package/dist/index.js.map +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/base.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.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/utils/ResizeSensor.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/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/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.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.d.ts +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/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { DisplayTransition } from "../../helpers/DisplayTransition/DisplayTransition.js";
|
|
4
4
|
import { ItemActionProvider } from "../ItemActionContext.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { CubeItemBadgeProps } from "../../content/ItemBadge/ItemBadge.js";
|
|
3
|
-
import { CubeItemActionProps } from "../ItemAction/ItemAction.js";
|
|
4
2
|
import { _MenuTrigger } from "./MenuTrigger.js";
|
|
5
3
|
import { SubMenuTrigger } from "./SubMenuTrigger.js";
|
|
4
|
+
import { CubeItemBadgeProps } from "../../content/ItemBadge/ItemBadge.js";
|
|
5
|
+
import { CubeItemActionProps } from "../ItemAction/ItemAction.js";
|
|
6
6
|
import "../index.js";
|
|
7
7
|
import { CubeCollectionItemProps, _CollectionItem } from "../../CollectionItem.js";
|
|
8
8
|
import "../../../index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { _CollectionItem } from "../../CollectionItem.js";
|
|
4
4
|
import { useMenuContext } from "./context.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { filterCollectionItemProps } from "../../CollectionItem.js";
|
|
4
4
|
import { _Item } from "../../content/Item/Item.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
3
3
|
import { MenuItem } from "./MenuItem.js";
|
|
4
4
|
import { StyledMenu, StyledSection, StyledSectionHeading } from "./styled.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { SlotProvider } from "../../../utils/react/Slots.js";
|
|
3
3
|
import { useEventBus } from "../../../utils/react/useEventBus.js";
|
|
4
4
|
import { MenuContext } from "./context.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { useEventBus } from "../../../utils/react/useEventBus.js";
|
|
3
3
|
import { MenuContext, useMenuContext } from "./context.js";
|
|
4
4
|
import { SubmenuTriggerContext } from "./SubmenuTriggerContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { DEFAULT_NEUTRAL_STYLES } from "../../../data/item-themes.js";
|
|
3
3
|
import { Space } from "../../layout/Space.js";
|
|
4
4
|
import { DEFAULT_BUTTON_STYLES } from "../Button/Button.js";
|
|
@@ -4,6 +4,12 @@ import { CubeUseActionProps, openLink, parseTo, performClickHandler, useAction }
|
|
|
4
4
|
import { Action, CubeActionProps } from "./Action/Action.js";
|
|
5
5
|
import { ButtonMods, ButtonVariant, CubeButtonProps, DEFAULT_BUTTON_STYLES } from "./Button/Button.js";
|
|
6
6
|
import "./Button/index.js";
|
|
7
|
+
import { AriaMenuTriggerProps, CubeMenuTriggerProps, _MenuTrigger } from "./Menu/MenuTrigger.js";
|
|
8
|
+
import { CubeSubMenuTriggerProps, SubMenuTrigger } from "./Menu/SubMenuTrigger.js";
|
|
9
|
+
import { CubeMenuProps, __Menu } from "./Menu/Menu.js";
|
|
10
|
+
import { ButtonSplit, ButtonSplitAction, CubeButtonSplitProps } from "./ButtonSplit/ButtonSplit.js";
|
|
11
|
+
import { ButtonSplitContext, ButtonSplitContextValue, useButtonSplitContext } from "./ButtonSplit/context.js";
|
|
12
|
+
import "./ButtonSplit/index.js";
|
|
7
13
|
import { CubeSpaceProps } from "../layout/Space.js";
|
|
8
14
|
import { ButtonGroup } from "./ButtonGroup/ButtonGroup.js";
|
|
9
15
|
import { CubeItemActionProps, ItemAction } from "./ItemAction/ItemAction.js";
|
|
@@ -13,9 +19,6 @@ import "./ItemAction/index.js";
|
|
|
13
19
|
import { ItemActionProvider, ItemActionProviderProps, useItemActionContext } from "./ItemActionContext.js";
|
|
14
20
|
import { CubeItemButtonProps, _ItemButton } from "./ItemButton/ItemButton.js";
|
|
15
21
|
import "./ItemButton/index.js";
|
|
16
|
-
import { AriaMenuTriggerProps, CubeMenuTriggerProps, _MenuTrigger } from "./Menu/MenuTrigger.js";
|
|
17
|
-
import { CubeSubMenuTriggerProps, SubMenuTrigger } from "./Menu/SubMenuTrigger.js";
|
|
18
|
-
import { CubeMenuProps, __Menu } from "./Menu/Menu.js";
|
|
19
22
|
import { MenuItem, MenuItemProps, MenuSelectionType } from "./Menu/MenuItem.js";
|
|
20
23
|
import { CubeMenuSectionProps, MenuSection } from "./Menu/MenuSection.js";
|
|
21
24
|
import { MenuContext, MenuContextValue, useMenuContext } from "./Menu/context.js";
|
|
@@ -31,8 +34,10 @@ import * as _react_types_shared0 from "@react-types/shared";
|
|
|
31
34
|
//#region src/components/actions/index.d.ts
|
|
32
35
|
declare const Button: react.ForwardRefExoticComponent<Omit<CubeButtonProps, "ref"> & react.RefAttributes<_react_types_shared0.FocusableRefValue<HTMLElement, HTMLElement>>> & {
|
|
33
36
|
Group: typeof ButtonGroup;
|
|
37
|
+
Split: typeof ButtonSplit;
|
|
34
38
|
} & {
|
|
35
39
|
Group: react.ForwardRefExoticComponent<CubeSpaceProps & react.RefAttributes<unknown>>;
|
|
40
|
+
Split: react.ForwardRefExoticComponent<CubeButtonSplitProps & react.RefAttributes<HTMLDivElement>>;
|
|
36
41
|
};
|
|
37
42
|
//#endregion
|
|
38
43
|
export { Button };
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { ItemActionProvider, useItemActionContext } from "./ItemActionContext.js";
|
|
3
3
|
import { openLink, parseTo, performClickHandler, useAction } from "./use-action.js";
|
|
4
4
|
import { ItemAction } from "./ItemAction/ItemAction.js";
|
|
5
|
+
import { ButtonSplitContext, useButtonSplitContext } from "./ButtonSplit/context.js";
|
|
5
6
|
import { Button as Button$1, DEFAULT_BUTTON_STYLES } from "./Button/Button.js";
|
|
6
7
|
import { ButtonGroup } from "./ButtonGroup/ButtonGroup.js";
|
|
7
|
-
import { Banner, BannerAction, BannerLink } from "./Banner/Banner.js";
|
|
8
|
-
import { Action } from "./Action/Action.js";
|
|
9
|
-
import { _ItemButton } from "./ItemButton/ItemButton.js";
|
|
10
8
|
import { MenuContext, useMenuContext } from "./Menu/context.js";
|
|
11
9
|
import { MenuItem } from "./Menu/MenuItem.js";
|
|
12
10
|
import { MenuSection } from "./Menu/MenuSection.js";
|
|
13
11
|
import { _MenuTrigger } from "./Menu/MenuTrigger.js";
|
|
14
12
|
import { SubMenuTrigger } from "./Menu/SubMenuTrigger.js";
|
|
15
13
|
import { __Menu } from "./Menu/Menu.js";
|
|
14
|
+
import { ButtonSplit } from "./ButtonSplit/ButtonSplit.js";
|
|
15
|
+
import { Banner, BannerAction, BannerLink } from "./Banner/Banner.js";
|
|
16
|
+
import { Action } from "./Action/Action.js";
|
|
17
|
+
import { _ItemButton } from "./ItemButton/ItemButton.js";
|
|
16
18
|
import { __CommandMenu } from "./CommandMenu/CommandMenu.js";
|
|
17
19
|
import { useAnchoredMenu } from "./use-anchored-menu.js";
|
|
18
20
|
import { useContextMenu } from "./use-context-menu.js";
|
|
19
21
|
|
|
20
22
|
//#region src/components/actions/index.ts
|
|
21
|
-
const Button = Object.assign(Button$1, {
|
|
23
|
+
const Button = Object.assign(Button$1, {
|
|
24
|
+
Group: ButtonGroup,
|
|
25
|
+
Split: ButtonSplit
|
|
26
|
+
});
|
|
22
27
|
|
|
23
28
|
//#endregion
|
|
24
29
|
export { Button };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["__Button"],"sources":["../../../src/components/actions/index.ts"],"sourcesContent":["import { Button as __Button } from './Button';\nimport { ButtonGroup } from './ButtonGroup/ButtonGroup';\n\nconst Button = Object.assign(\n __Button as typeof __Button & {\n Group: typeof ButtonGroup;\n },\n { Group: ButtonGroup },\n);\n\nexport * from './Banner';\nexport * from './Button';\nexport * from './Action/Action';\nexport * from './ItemAction';\nexport * from './ItemActionContext';\nexport * from './ItemButton';\nexport * from './Menu';\nexport * from './CommandMenu';\nexport * from './use-action';\nexport * from './use-anchored-menu';\nexport * from './use-context-menu';\nexport { Button, ButtonGroup };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["__Button"],"sources":["../../../src/components/actions/index.ts"],"sourcesContent":["import { Button as __Button } from './Button';\nimport { ButtonGroup } from './ButtonGroup/ButtonGroup';\nimport { ButtonSplit } from './ButtonSplit/ButtonSplit';\n\nconst Button = Object.assign(\n __Button as typeof __Button & {\n Group: typeof ButtonGroup;\n Split: typeof ButtonSplit;\n },\n { Group: ButtonGroup, Split: ButtonSplit },\n);\n\nexport * from './Banner';\nexport * from './Button';\nexport * from './ButtonSplit';\nexport * from './Action/Action';\nexport * from './ItemAction';\nexport * from './ItemActionContext';\nexport * from './ItemButton';\nexport * from './Menu';\nexport * from './CommandMenu';\nexport * from './use-action';\nexport * from './use-anchored-menu';\nexport * from './use-context-menu';\nexport { Button, ButtonGroup, ButtonSplit };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,SAAS,OAAO,OACpBA,UAIA;CAAE,OAAO;CAAa,OAAO;CAAa,CAC3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
4
4
|
import { useFocus as useFocus$1 } from "../../utils/react/interactions.js";
|
|
@@ -206,23 +206,26 @@ const useAction = function useAction({ to, as, htmlType, label, mods, onPress, n
|
|
|
206
206
|
const customProps = to && !isHistoryNavigation ? { onClick(evt) {
|
|
207
207
|
evt.preventDefault();
|
|
208
208
|
} } : {};
|
|
209
|
-
return {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
209
|
+
return {
|
|
210
|
+
isPressed,
|
|
211
|
+
actionProps: {
|
|
212
|
+
mods: {
|
|
213
|
+
hovered: isHovered && !isDisabled,
|
|
214
|
+
pressed: isPressed && !isDisabled,
|
|
215
|
+
focused: isFocused && !isDisabled,
|
|
216
|
+
disabled: isDisabled,
|
|
217
|
+
...mods
|
|
218
|
+
},
|
|
219
|
+
...mergeProps$1(buttonProps, hoverProps, focusProps, customProps, filterBaseProps(props, FILTER_OPTIONS)),
|
|
220
|
+
ref: domRef,
|
|
221
|
+
type: htmlType || "button",
|
|
222
|
+
rel: as === "a" && newTab ? "noopener noreferrer" : void 0,
|
|
223
|
+
as,
|
|
224
|
+
isDisabled,
|
|
225
|
+
target,
|
|
226
|
+
href
|
|
227
|
+
}
|
|
228
|
+
};
|
|
226
229
|
};
|
|
227
230
|
|
|
228
231
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-action.js","names":["useFocus","mergeProps"],"sources":["../../../src/components/actions/use-action.ts"],"sourcesContent":["import { useFocusableRef } from '@react-spectrum/utils';\nimport { FocusableRef, PressEvent } from '@react-types/shared';\nimport { AllBaseProps, filterBaseProps, TagName } from '@tenphi/tasty';\nimport { useContext } from 'react';\nimport { AriaButtonProps, useButton, useHover } from 'react-aria';\n\nimport { useEvent } from '../../_internal';\nimport { UIKitContext } from '../../provider';\nimport { useTracking } from '../../providers/TrackingProvider';\nimport { mergeProps } from '../../utils/react';\nimport { useFocus } from '../../utils/react/interactions';\n\n// Import specific types for internal usage\nimport type {\n NavigateArg,\n NavigateOptions,\n Path,\n To,\n} from '../../providers/navigation.types';\n\nconst LINK_PRESS_EVENT = 'Link Press';\nconst BUTTON_PRESS_EVENT = 'Button Press';\n\n// Re-export types for convenience\nexport type {\n NavigateLike,\n Path,\n To,\n NavigateArg,\n NavigateOptions,\n RelativeRoutingType,\n} from '../../providers/navigation.types';\n\nexport interface CubeUseActionProps<\n T extends TagName = 'a' | 'button' | 'span' | 'div',\n> extends AllBaseProps<T>,\n Omit<AriaButtonProps, 'type'> {\n to?: NavigateArg;\n label?: string;\n htmlType?: 'button' | 'submit' | 'reset' | undefined;\n navigationOptions?: NavigateOptions;\n}\n\nconst FILTER_OPTIONS = { propNames: new Set(['onMouseEnter', 'onMouseLeave']) };\n\n/**\n * Helper to open link.\n * @param {String} href\n * @param {String|Boolean} [target]\n */\nexport function openLink(href, target?) {\n const link = document.createElement('a');\n\n link.href = href;\n\n if (target) {\n link.target = target === true ? '_blank' : target;\n // Prevent reverse tabnabbing when opening in a new tab\n link.rel = 'noopener noreferrer';\n }\n\n document.body.appendChild(link);\n\n link.click();\n\n document.body.removeChild(link);\n}\n\n/**\n * Checks if a URL is external (absolute HTTP(S), protocol-relative, or non-http protocols)\n */\nfunction isExternalUrl(url: string): boolean {\n return (\n url.startsWith('http://') ||\n url.startsWith('https://') ||\n url.startsWith('//') ||\n (url.includes(':') && !url.startsWith('#'))\n );\n}\n\nexport function parseTo(to: NavigateArg | undefined): {\n newTab: boolean;\n nativeRoute: boolean;\n cleanTo: To | undefined;\n isHistoryNavigation: boolean;\n historyDelta?: number;\n isHashNavigation: boolean;\n isExternal: boolean;\n} {\n // Handle number (history navigation)\n if (typeof to === 'number') {\n return {\n newTab: false,\n nativeRoute: false,\n cleanTo: undefined,\n isHistoryNavigation: true,\n historyDelta: to,\n isHashNavigation: false,\n isExternal: false,\n };\n }\n\n // Handle object path\n if (to && typeof to === 'object') {\n return {\n newTab: false,\n nativeRoute: false,\n cleanTo: to,\n isHistoryNavigation: false,\n isHashNavigation: false,\n isExternal: false,\n };\n }\n\n // Handle string\n if (!to || typeof to !== 'string') {\n return {\n newTab: false,\n nativeRoute: false,\n cleanTo: undefined,\n isHistoryNavigation: false,\n isHashNavigation: false,\n isExternal: false,\n };\n }\n\n const newTab = to.startsWith('!');\n const nativeRoute = to.startsWith('@');\n const isHashNavigation = to.startsWith('#');\n const cleanTo = newTab || nativeRoute ? to.slice(1) : to;\n const isExternal = typeof cleanTo === 'string' && isExternalUrl(cleanTo);\n\n return {\n newTab,\n nativeRoute,\n cleanTo,\n isHistoryNavigation: false,\n isHashNavigation,\n isExternal,\n };\n}\n\ninterface SanitizedPressEvent {\n type?: string;\n pointerType?: string;\n shiftKey: boolean;\n metaKey: boolean;\n ctrlKey: boolean;\n altKey: boolean;\n // target is defined as a non-enumerable property below\n [key: string]: unknown; // allow non-enumerable 'target'\n}\n\nfunction sanitizePressEvent(evt: PressEvent): SanitizedPressEvent {\n const safeEvt: SanitizedPressEvent = {\n type: 'type' in evt ? evt.type : undefined,\n pointerType:\n 'pointerType' in evt\n ? (evt as { pointerType?: string }).pointerType\n : undefined,\n shiftKey:\n 'shiftKey' in evt ? !!(evt as { shiftKey?: boolean }).shiftKey : false,\n metaKey:\n 'metaKey' in evt ? !!(evt as { metaKey?: boolean }).metaKey : false,\n ctrlKey:\n 'ctrlKey' in evt ? !!(evt as { ctrlKey?: boolean }).ctrlKey : false,\n altKey: 'altKey' in evt ? !!(evt as { altKey?: boolean }).altKey : false,\n };\n try {\n Object.defineProperty(safeEvt, 'target', {\n value: 'target' in evt ? (evt as { target?: unknown }).target : undefined,\n enumerable: false,\n configurable: true,\n });\n } catch (e) {\n // Failed to define target property - continue without it\n }\n return safeEvt;\n}\n\nexport function performClickHandler(\n evt,\n { navigate, resolvedHref, to, onPress, tracking, navigationOptions },\n) {\n const {\n newTab,\n nativeRoute,\n cleanTo,\n isHistoryNavigation,\n historyDelta,\n isHashNavigation,\n isExternal,\n } = parseTo(to);\n const element = evt.target;\n const qa = element?.getAttribute('data-qa');\n\n onPress?.(sanitizePressEvent(evt));\n\n if (to == null) {\n // Allow 0 as valid navigation (go to current page)\n tracking.event(BUTTON_PRESS_EVENT, { qa }, element);\n return;\n }\n\n // Handle history navigation (back/forward)\n if (isHistoryNavigation && typeof historyDelta === 'number') {\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, delta: historyDelta, type: 'router-history' },\n element,\n );\n navigate(historyDelta);\n return;\n }\n\n // Handle hash navigation (smooth scroll)\n if (isHashNavigation && typeof to === 'string') {\n const id = to.slice(1);\n const targetElement = document.getElementById(id);\n\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: to, type: 'hash', target: id },\n element,\n );\n\n if (targetElement) {\n targetElement.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n inline: 'nearest',\n });\n }\n return;\n }\n\n // Handle new tab (via ! prefix or user modifiers)\n if (evt.shiftKey || evt.metaKey || (evt as any).ctrlKey || newTab) {\n openLink(resolvedHref, true);\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: resolvedHref, type: 'tab' },\n element,\n );\n return;\n }\n\n // Handle @ prefix (native navigation)\n if (nativeRoute) {\n if (cleanTo === '' || cleanTo === undefined) {\n // @'' or @ -> reload current page\n tracking.event(LINK_PRESS_EVENT, { qa, type: 'native' }, element);\n window.location.reload();\n } else {\n // @path -> navigate to resolved path natively\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: resolvedHref, type: 'native' },\n element,\n );\n window.location.assign(resolvedHref);\n }\n return;\n }\n\n // Handle external URLs (always native)\n if (isExternal && typeof cleanTo === 'string') {\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: cleanTo, type: 'native' },\n element,\n );\n window.location.assign(cleanTo);\n return;\n }\n\n // Handle router navigation\n if (cleanTo !== undefined) {\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: resolvedHref, type: 'router' },\n element,\n );\n navigate(cleanTo, navigationOptions);\n }\n}\n\nexport const useAction = function useAction(\n {\n to,\n as,\n htmlType,\n label,\n mods,\n onPress,\n navigationOptions,\n ...props\n }: CubeUseActionProps,\n ref: FocusableRef<HTMLElement>,\n) {\n const tracking = useTracking();\n const navigation = useContext(UIKitContext).navigation;\n const isDisabled = props.isDisabled;\n\n const {\n newTab,\n nativeRoute,\n cleanTo,\n isHistoryNavigation,\n isHashNavigation,\n isExternal,\n } = parseTo(to);\n\n // Always call navigation hooks (using fallback when to is not provided)\n const fallbackTo = to || '.';\n const navigate = navigation.useNavigate();\n const resolvedHref = navigation.useHref(fallbackTo);\n // Always resolve cleanTo href to avoid conditional hook calls\n const cleanToHref = navigation.useHref(cleanTo || '.');\n\n // Determine element type: 'a' for navigation, 'button' for actions\n as = to && !isHistoryNavigation ? 'a' : as || 'button';\n\n // Compute target (prefixes override explicit target prop per spec)\n const target = newTab ? '_blank' : props.target;\n\n // Compute href for anchor elements\n let href: string | undefined;\n if (as === 'a' && cleanTo !== undefined) {\n if (newTab || nativeRoute) {\n // For ! and @ prefixes, resolve the clean path\n href =\n typeof cleanTo === 'string' && isExternal\n ? cleanTo // External URLs as-is\n : cleanToHref;\n } else {\n // Regular navigation\n href = resolvedHref;\n }\n }\n\n const domRef = useFocusableRef(ref);\n\n // Use navigation options directly\n const mergedNavigationOptions = navigationOptions;\n\n const customOnPress = useEvent((evt: PressEvent) => {\n performClickHandler(evt, {\n navigate,\n resolvedHref: href || resolvedHref,\n to,\n onPress,\n tracking,\n navigationOptions: mergedNavigationOptions,\n });\n });\n\n let { buttonProps, isPressed } = useButton(\n {\n 'aria-label': label,\n ...props,\n onPress: customOnPress,\n },\n domRef,\n );\n let { hoverProps, isHovered } = useHover({ isDisabled });\n let { focusProps, isFocused } = useFocus({ isDisabled }, true);\n\n const customProps =\n to && !isHistoryNavigation\n ? {\n onClick(evt) {\n evt.preventDefault();\n },\n }\n : {};\n\n return {\n actionProps: {\n mods: {\n hovered: isHovered && !isDisabled,\n pressed: isPressed && !isDisabled,\n focused: isFocused && !isDisabled,\n disabled: isDisabled,\n ...mods,\n },\n ...(mergeProps(\n buttonProps,\n hoverProps,\n focusProps,\n customProps,\n filterBaseProps(props, FILTER_OPTIONS),\n ) as object),\n ref: domRef,\n type: htmlType || 'button',\n rel: as === 'a' && newTab ? 'noopener noreferrer' : undefined,\n as,\n isDisabled,\n target,\n href,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,mB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gBAAgB,UAAU,QAAoB;AAClD,sBAAoB,KAAK;GACvB;GACA,cAAc,QAAQ;GACtB;GACA;GACA;GACA,mBAAmB;GACpB,CAAC;GACF;CAEF,IAAI,EAAE,aAAa,cAAc,UAC/B;EACE,cAAc;EACd,GAAG;EACH,SAAS;EACV,EACD,OACD;CACD,IAAI,EAAE,YAAY,cAAc,SAAS,EAAE,YAAY,CAAC;CACxD,IAAI,EAAE,YAAY,cAAcA,WAAS,EAAE,YAAY,EAAE,KAAK;CAE9D,MAAM,cACJ,MAAM,CAAC,sBACH,EACE,QAAQ,KAAK;AACX,MAAI,gBAAgB;IAEvB,GACD,EAAE;AAER,QAAO,EACL,aAAa;EACX,MAAM;GACJ,SAAS,aAAa,CAAC;GACvB,SAAS,aAAa,CAAC;GACvB,SAAS,aAAa,CAAC;GACvB,UAAU;GACV,GAAG;GACJ;EACD,GAAIC,aACF,aACA,YACA,YACA,aACA,gBAAgB,OAAO,eAAe,CACvC;EACD,KAAK;EACL,MAAM,YAAY;EAClB,KAAK,OAAO,OAAO,SAAS,wBAAwB;EACpD;EACA;EACA;EACA;EACD,EACF"}
|
|
1
|
+
{"version":3,"file":"use-action.js","names":["useFocus","mergeProps"],"sources":["../../../src/components/actions/use-action.ts"],"sourcesContent":["import { useFocusableRef } from '@react-spectrum/utils';\nimport { FocusableRef, PressEvent } from '@react-types/shared';\nimport { AllBaseProps, filterBaseProps, TagName } from '@tenphi/tasty';\nimport { useContext } from 'react';\nimport { AriaButtonProps, useButton, useHover } from 'react-aria';\n\nimport { useEvent } from '../../_internal';\nimport { UIKitContext } from '../../provider';\nimport { useTracking } from '../../providers/TrackingProvider';\nimport { mergeProps } from '../../utils/react';\nimport { useFocus } from '../../utils/react/interactions';\n\n// Import specific types for internal usage\nimport type {\n NavigateArg,\n NavigateOptions,\n Path,\n To,\n} from '../../providers/navigation.types';\n\nconst LINK_PRESS_EVENT = 'Link Press';\nconst BUTTON_PRESS_EVENT = 'Button Press';\n\n// Re-export types for convenience\nexport type {\n NavigateLike,\n Path,\n To,\n NavigateArg,\n NavigateOptions,\n RelativeRoutingType,\n} from '../../providers/navigation.types';\n\nexport interface CubeUseActionProps<\n T extends TagName = 'a' | 'button' | 'span' | 'div',\n> extends AllBaseProps<T>,\n Omit<AriaButtonProps, 'type'> {\n to?: NavigateArg;\n label?: string;\n htmlType?: 'button' | 'submit' | 'reset' | undefined;\n navigationOptions?: NavigateOptions;\n}\n\nconst FILTER_OPTIONS = { propNames: new Set(['onMouseEnter', 'onMouseLeave']) };\n\n/**\n * Helper to open link.\n * @param {String} href\n * @param {String|Boolean} [target]\n */\nexport function openLink(href, target?) {\n const link = document.createElement('a');\n\n link.href = href;\n\n if (target) {\n link.target = target === true ? '_blank' : target;\n // Prevent reverse tabnabbing when opening in a new tab\n link.rel = 'noopener noreferrer';\n }\n\n document.body.appendChild(link);\n\n link.click();\n\n document.body.removeChild(link);\n}\n\n/**\n * Checks if a URL is external (absolute HTTP(S), protocol-relative, or non-http protocols)\n */\nfunction isExternalUrl(url: string): boolean {\n return (\n url.startsWith('http://') ||\n url.startsWith('https://') ||\n url.startsWith('//') ||\n (url.includes(':') && !url.startsWith('#'))\n );\n}\n\nexport function parseTo(to: NavigateArg | undefined): {\n newTab: boolean;\n nativeRoute: boolean;\n cleanTo: To | undefined;\n isHistoryNavigation: boolean;\n historyDelta?: number;\n isHashNavigation: boolean;\n isExternal: boolean;\n} {\n // Handle number (history navigation)\n if (typeof to === 'number') {\n return {\n newTab: false,\n nativeRoute: false,\n cleanTo: undefined,\n isHistoryNavigation: true,\n historyDelta: to,\n isHashNavigation: false,\n isExternal: false,\n };\n }\n\n // Handle object path\n if (to && typeof to === 'object') {\n return {\n newTab: false,\n nativeRoute: false,\n cleanTo: to,\n isHistoryNavigation: false,\n isHashNavigation: false,\n isExternal: false,\n };\n }\n\n // Handle string\n if (!to || typeof to !== 'string') {\n return {\n newTab: false,\n nativeRoute: false,\n cleanTo: undefined,\n isHistoryNavigation: false,\n isHashNavigation: false,\n isExternal: false,\n };\n }\n\n const newTab = to.startsWith('!');\n const nativeRoute = to.startsWith('@');\n const isHashNavigation = to.startsWith('#');\n const cleanTo = newTab || nativeRoute ? to.slice(1) : to;\n const isExternal = typeof cleanTo === 'string' && isExternalUrl(cleanTo);\n\n return {\n newTab,\n nativeRoute,\n cleanTo,\n isHistoryNavigation: false,\n isHashNavigation,\n isExternal,\n };\n}\n\ninterface SanitizedPressEvent {\n type?: string;\n pointerType?: string;\n shiftKey: boolean;\n metaKey: boolean;\n ctrlKey: boolean;\n altKey: boolean;\n // target is defined as a non-enumerable property below\n [key: string]: unknown; // allow non-enumerable 'target'\n}\n\nfunction sanitizePressEvent(evt: PressEvent): SanitizedPressEvent {\n const safeEvt: SanitizedPressEvent = {\n type: 'type' in evt ? evt.type : undefined,\n pointerType:\n 'pointerType' in evt\n ? (evt as { pointerType?: string }).pointerType\n : undefined,\n shiftKey:\n 'shiftKey' in evt ? !!(evt as { shiftKey?: boolean }).shiftKey : false,\n metaKey:\n 'metaKey' in evt ? !!(evt as { metaKey?: boolean }).metaKey : false,\n ctrlKey:\n 'ctrlKey' in evt ? !!(evt as { ctrlKey?: boolean }).ctrlKey : false,\n altKey: 'altKey' in evt ? !!(evt as { altKey?: boolean }).altKey : false,\n };\n try {\n Object.defineProperty(safeEvt, 'target', {\n value: 'target' in evt ? (evt as { target?: unknown }).target : undefined,\n enumerable: false,\n configurable: true,\n });\n } catch (e) {\n // Failed to define target property - continue without it\n }\n return safeEvt;\n}\n\nexport function performClickHandler(\n evt,\n { navigate, resolvedHref, to, onPress, tracking, navigationOptions },\n) {\n const {\n newTab,\n nativeRoute,\n cleanTo,\n isHistoryNavigation,\n historyDelta,\n isHashNavigation,\n isExternal,\n } = parseTo(to);\n const element = evt.target;\n const qa = element?.getAttribute('data-qa');\n\n onPress?.(sanitizePressEvent(evt));\n\n if (to == null) {\n // Allow 0 as valid navigation (go to current page)\n tracking.event(BUTTON_PRESS_EVENT, { qa }, element);\n return;\n }\n\n // Handle history navigation (back/forward)\n if (isHistoryNavigation && typeof historyDelta === 'number') {\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, delta: historyDelta, type: 'router-history' },\n element,\n );\n navigate(historyDelta);\n return;\n }\n\n // Handle hash navigation (smooth scroll)\n if (isHashNavigation && typeof to === 'string') {\n const id = to.slice(1);\n const targetElement = document.getElementById(id);\n\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: to, type: 'hash', target: id },\n element,\n );\n\n if (targetElement) {\n targetElement.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n inline: 'nearest',\n });\n }\n return;\n }\n\n // Handle new tab (via ! prefix or user modifiers)\n if (evt.shiftKey || evt.metaKey || (evt as any).ctrlKey || newTab) {\n openLink(resolvedHref, true);\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: resolvedHref, type: 'tab' },\n element,\n );\n return;\n }\n\n // Handle @ prefix (native navigation)\n if (nativeRoute) {\n if (cleanTo === '' || cleanTo === undefined) {\n // @'' or @ -> reload current page\n tracking.event(LINK_PRESS_EVENT, { qa, type: 'native' }, element);\n window.location.reload();\n } else {\n // @path -> navigate to resolved path natively\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: resolvedHref, type: 'native' },\n element,\n );\n window.location.assign(resolvedHref);\n }\n return;\n }\n\n // Handle external URLs (always native)\n if (isExternal && typeof cleanTo === 'string') {\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: cleanTo, type: 'native' },\n element,\n );\n window.location.assign(cleanTo);\n return;\n }\n\n // Handle router navigation\n if (cleanTo !== undefined) {\n tracking.event(\n LINK_PRESS_EVENT,\n { qa, href: resolvedHref, type: 'router' },\n element,\n );\n navigate(cleanTo, navigationOptions);\n }\n}\n\nexport const useAction = function useAction(\n {\n to,\n as,\n htmlType,\n label,\n mods,\n onPress,\n navigationOptions,\n ...props\n }: CubeUseActionProps,\n ref: FocusableRef<HTMLElement>,\n) {\n const tracking = useTracking();\n const navigation = useContext(UIKitContext).navigation;\n const isDisabled = props.isDisabled;\n\n const {\n newTab,\n nativeRoute,\n cleanTo,\n isHistoryNavigation,\n isHashNavigation,\n isExternal,\n } = parseTo(to);\n\n // Always call navigation hooks (using fallback when to is not provided)\n const fallbackTo = to || '.';\n const navigate = navigation.useNavigate();\n const resolvedHref = navigation.useHref(fallbackTo);\n // Always resolve cleanTo href to avoid conditional hook calls\n const cleanToHref = navigation.useHref(cleanTo || '.');\n\n // Determine element type: 'a' for navigation, 'button' for actions\n as = to && !isHistoryNavigation ? 'a' : as || 'button';\n\n // Compute target (prefixes override explicit target prop per spec)\n const target = newTab ? '_blank' : props.target;\n\n // Compute href for anchor elements\n let href: string | undefined;\n if (as === 'a' && cleanTo !== undefined) {\n if (newTab || nativeRoute) {\n // For ! and @ prefixes, resolve the clean path\n href =\n typeof cleanTo === 'string' && isExternal\n ? cleanTo // External URLs as-is\n : cleanToHref;\n } else {\n // Regular navigation\n href = resolvedHref;\n }\n }\n\n const domRef = useFocusableRef(ref);\n\n // Use navigation options directly\n const mergedNavigationOptions = navigationOptions;\n\n const customOnPress = useEvent((evt: PressEvent) => {\n performClickHandler(evt, {\n navigate,\n resolvedHref: href || resolvedHref,\n to,\n onPress,\n tracking,\n navigationOptions: mergedNavigationOptions,\n });\n });\n\n let { buttonProps, isPressed } = useButton(\n {\n 'aria-label': label,\n ...props,\n onPress: customOnPress,\n },\n domRef,\n );\n let { hoverProps, isHovered } = useHover({ isDisabled });\n let { focusProps, isFocused } = useFocus({ isDisabled }, true);\n\n const customProps =\n to && !isHistoryNavigation\n ? {\n onClick(evt) {\n evt.preventDefault();\n },\n }\n : {};\n\n return {\n isPressed,\n actionProps: {\n mods: {\n hovered: isHovered && !isDisabled,\n pressed: isPressed && !isDisabled,\n focused: isFocused && !isDisabled,\n disabled: isDisabled,\n ...mods,\n },\n ...(mergeProps(\n buttonProps,\n hoverProps,\n focusProps,\n customProps,\n filterBaseProps(props, FILTER_OPTIONS),\n ) as object),\n ref: domRef,\n type: htmlType || 'button',\n rel: as === 'a' && newTab ? 'noopener noreferrer' : undefined,\n as,\n isDisabled,\n target,\n href,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,mBAAmB;AACzB,MAAM,qBAAqB;AAsB3B,MAAM,iBAAiB,EAAE,WAAW,IAAI,IAAI,CAAC,gBAAgB,eAAe,CAAC,EAAE;;;;;;AAO/E,SAAgB,SAAS,MAAM,QAAS;CACtC,MAAM,OAAO,SAAS,cAAc,IAAI;AAExC,MAAK,OAAO;AAEZ,KAAI,QAAQ;AACV,OAAK,SAAS,WAAW,OAAO,WAAW;AAE3C,OAAK,MAAM;;AAGb,UAAS,KAAK,YAAY,KAAK;AAE/B,MAAK,OAAO;AAEZ,UAAS,KAAK,YAAY,KAAK;;;;;AAMjC,SAAS,cAAc,KAAsB;AAC3C,QACE,IAAI,WAAW,UAAU,IACzB,IAAI,WAAW,WAAW,IAC1B,IAAI,WAAW,KAAK,IACnB,IAAI,SAAS,IAAI,IAAI,CAAC,IAAI,WAAW,IAAI;;AAI9C,SAAgB,QAAQ,IAQtB;AAEA,KAAI,OAAO,OAAO,SAChB,QAAO;EACL,QAAQ;EACR,aAAa;EACb,SAAS;EACT,qBAAqB;EACrB,cAAc;EACd,kBAAkB;EAClB,YAAY;EACb;AAIH,KAAI,MAAM,OAAO,OAAO,SACtB,QAAO;EACL,QAAQ;EACR,aAAa;EACb,SAAS;EACT,qBAAqB;EACrB,kBAAkB;EAClB,YAAY;EACb;AAIH,KAAI,CAAC,MAAM,OAAO,OAAO,SACvB,QAAO;EACL,QAAQ;EACR,aAAa;EACb,SAAS;EACT,qBAAqB;EACrB,kBAAkB;EAClB,YAAY;EACb;CAGH,MAAM,SAAS,GAAG,WAAW,IAAI;CACjC,MAAM,cAAc,GAAG,WAAW,IAAI;CACtC,MAAM,mBAAmB,GAAG,WAAW,IAAI;CAC3C,MAAM,UAAU,UAAU,cAAc,GAAG,MAAM,EAAE,GAAG;AAGtD,QAAO;EACL;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AAU,YAEZ,QACE,OAAO,YAAY,YAAY,aAC3B,UACA;KAGN,QAAO;CAIX,MAAM,SAAS,gBAAgB,IAAI;CAGnC,MAAM,0BAA0B;CAEhC,MAAM,gBAAgB,UAAU,QAAoB;AAClD,sBAAoB,KAAK;GACvB;GACA,cAAc,QAAQ;GACtB;GACA;GACA;GACA,mBAAmB;GACpB,CAAC;GACF;CAEF,IAAI,EAAE,aAAa,cAAc,UAC/B;EACE,cAAc;EACd,GAAG;EACH,SAAS;EACV,EACD,OACD;CACD,IAAI,EAAE,YAAY,cAAc,SAAS,EAAE,YAAY,CAAC;CACxD,IAAI,EAAE,YAAY,cAAcA,WAAS,EAAE,YAAY,EAAE,KAAK;CAE9D,MAAM,cACJ,MAAM,CAAC,sBACH,EACE,QAAQ,KAAK;AACX,MAAI,gBAAgB;IAEvB,GACD,EAAE;AAER,QAAO;EACL;EACA,aAAa;GACX,MAAM;IACJ,SAAS,aAAa,CAAC;IACvB,SAAS,aAAa,CAAC;IACvB,SAAS,aAAa,CAAC;IACvB,UAAU;IACV,GAAG;IACJ;GACD,GAAIC,aACF,aACA,YACA,YACA,aACA,gBAAgB,OAAO,eAAe,CACvC;GACD,KAAK;GACL,MAAM,YAAY;GAClB,KAAK,OAAO,OAAO,SAAS,wBAAwB;GACpD;GACA;GACA;GACA;GACD;EACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEventBus } from "../../utils/react/useEventBus.js";
|
|
4
4
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEventBus } from "../../utils/react/useEventBus.js";
|
|
4
4
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useFocus as useFocus$1 } from "../../../utils/react/interactions.js";
|
|
4
4
|
import { CONTAINER_STYLES, Element, TEXT_STYLES, extractStyles, filterBaseProps } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { useDeprecationWarning } from "../../../_internal/hooks/use-deprecation-warning.js";
|
|
3
3
|
import { CONTAINER_STYLES, TEXT_STYLES, extractStyles, filterBaseProps } from "@tenphi/tasty";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { CONTAINER_STYLES, Element, extractStyles, filterBaseProps } from "@tenphi/tasty";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { _Item } from "../Item/Item.js";
|
|
3
3
|
import themes_default from "../../../data/themes.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -27,6 +27,7 @@ const BadgeElement = tasty(_Item, {
|
|
|
27
27
|
"size=small | size=medium": "t3",
|
|
28
28
|
"size=large | size=xlarge": "t2"
|
|
29
29
|
},
|
|
30
|
+
border: { "type=primary": "#clear" },
|
|
30
31
|
"$inline-padding": {
|
|
31
32
|
"": "max($min-inline-padding, (($size - 1lh - 2bw) / 2 + $inline-compensation))",
|
|
32
33
|
"size=inline": ".5x"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","names":["THEMES","Item"],"sources":["../../../../src/components/content/Badge/Badge.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { forwardRef } from 'react';\n\nimport THEMES from '../../../data/themes';\nimport { CubeItemProps, Item } from '../Item';\n\nconst FILL_STYLES = Object.keys(THEMES).reduce((map, type) => {\n map[`theme=${type}`] =\n type === 'special' ? THEMES[type].fill : THEMES[type].color;\n\n return map;\n}, {});\n\nconst BadgeElement = tasty(Item, {\n qa: 'Badge',\n role: 'status',\n size: 'inline',\n styles: {\n radius: 'round',\n color: '#white',\n fill: {\n '': '#primary',\n ...FILL_STYLES,\n },\n preset: {\n '': 'tag',\n 'size=xsmall': 't4',\n 'size=small | size=medium': 't3',\n 'size=large | size=xlarge': 't2',\n },\n\n '$inline-padding': {\n '': 'max($min-inline-padding, (($size - 1lh - 2bw) / 2 + $inline-compensation))',\n 'size=inline': '.5x',\n },\n\n Label: {\n textAlign: 'center',\n placeSelf: 'center',\n },\n },\n});\n\nexport interface CubeBadgeProps extends CubeItemProps {\n /* @deprecated Use theme instead */\n type?: keyof typeof THEMES | string;\n theme?: keyof typeof THEMES | string;\n}\n\nfunction Badge(allProps: CubeBadgeProps, ref) {\n let {\n type,\n theme = 'special',\n children,\n size = 'inline',\n ...props\n } = allProps;\n\n const badgeTheme = theme ?? type;\n\n return (\n <BadgeElement\n ref={ref}\n size={size}\n data-type=\"primary\"\n data-theme={badgeTheme}\n {...props}\n >\n {children}\n </BadgeElement>\n );\n}\n\nconst _Badge = forwardRef(Badge);\n\n_Badge.displayName = 'Badge';\n\nexport { _Badge as Badge };\n"],"mappings":";;;;;;;;AAMA,MAAM,cAAc,OAAO,KAAKA,eAAO,CAAC,QAAQ,KAAK,SAAS;AAC5D,KAAI,SAAS,UACX,SAAS,YAAYA,eAAO,MAAM,OAAOA,eAAO,MAAM;AAExD,QAAO;GACN,EAAE,CAAC;AAEN,MAAM,eAAe,MAAMC,OAAM;CAC/B,IAAI;CACJ,MAAM;CACN,MAAM;CACN,QAAQ;EACN,QAAQ;EACR,OAAO;EACP,MAAM;GACJ,IAAI;GACJ,GAAG;GACJ;EACD,QAAQ;GACN,IAAI;GACJ,eAAe;GACf,4BAA4B;GAC5B,4BAA4B;GAC7B;EAED,mBAAmB;GACjB,IAAI;GACJ,eAAe;GAChB;EAED,OAAO;GACL,WAAW;GACX,WAAW;GACZ;EACF;CACF,CAAC;AAQF,SAAS,MAAM,UAA0B,KAAK;CAC5C,IAAI,EACF,MACA,QAAQ,WACR,UACA,OAAO,UACP,GAAG,UACD;CAEJ,MAAM,aAAa,SAAS;AAE5B,QACE,oBAAC;EACM;EACC;EACN,aAAU;EACV,cAAY;EACZ,GAAI;EAEH;GACY;;AAInB,MAAM,SAAS,WAAW,MAAM;AAEhC,OAAO,cAAc"}
|
|
1
|
+
{"version":3,"file":"Badge.js","names":["THEMES","Item"],"sources":["../../../../src/components/content/Badge/Badge.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { forwardRef } from 'react';\n\nimport THEMES from '../../../data/themes';\nimport { CubeItemProps, Item } from '../Item';\n\nconst FILL_STYLES = Object.keys(THEMES).reduce((map, type) => {\n map[`theme=${type}`] =\n type === 'special' ? THEMES[type].fill : THEMES[type].color;\n\n return map;\n}, {});\n\nconst BadgeElement = tasty(Item, {\n qa: 'Badge',\n role: 'status',\n size: 'inline',\n styles: {\n radius: 'round',\n color: '#white',\n fill: {\n '': '#primary',\n ...FILL_STYLES,\n },\n preset: {\n '': 'tag',\n 'size=xsmall': 't4',\n 'size=small | size=medium': 't3',\n 'size=large | size=xlarge': 't2',\n },\n border: {\n // extend\n 'type=primary': '#clear',\n },\n\n '$inline-padding': {\n '': 'max($min-inline-padding, (($size - 1lh - 2bw) / 2 + $inline-compensation))',\n 'size=inline': '.5x',\n },\n\n Label: {\n textAlign: 'center',\n placeSelf: 'center',\n },\n },\n});\n\nexport interface CubeBadgeProps extends CubeItemProps {\n /* @deprecated Use theme instead */\n type?: keyof typeof THEMES | string;\n theme?: keyof typeof THEMES | string;\n}\n\nfunction Badge(allProps: CubeBadgeProps, ref) {\n let {\n type,\n theme = 'special',\n children,\n size = 'inline',\n ...props\n } = allProps;\n\n const badgeTheme = theme ?? type;\n\n return (\n <BadgeElement\n ref={ref}\n size={size}\n data-type=\"primary\"\n data-theme={badgeTheme}\n {...props}\n >\n {children}\n </BadgeElement>\n );\n}\n\nconst _Badge = forwardRef(Badge);\n\n_Badge.displayName = 'Badge';\n\nexport { _Badge as Badge };\n"],"mappings":";;;;;;;;AAMA,MAAM,cAAc,OAAO,KAAKA,eAAO,CAAC,QAAQ,KAAK,SAAS;AAC5D,KAAI,SAAS,UACX,SAAS,YAAYA,eAAO,MAAM,OAAOA,eAAO,MAAM;AAExD,QAAO;GACN,EAAE,CAAC;AAEN,MAAM,eAAe,MAAMC,OAAM;CAC/B,IAAI;CACJ,MAAM;CACN,MAAM;CACN,QAAQ;EACN,QAAQ;EACR,OAAO;EACP,MAAM;GACJ,IAAI;GACJ,GAAG;GACJ;EACD,QAAQ;GACN,IAAI;GACJ,eAAe;GACf,4BAA4B;GAC5B,4BAA4B;GAC7B;EACD,QAAQ,EAEN,gBAAgB,UACjB;EAED,mBAAmB;GACjB,IAAI;GACJ,eAAe;GAChB;EAED,OAAO;GACL,WAAW;GACX,WAAW;GACZ;EACF;CACF,CAAC;AAQF,SAAS,MAAM,UAA0B,KAAK;CAC5C,IAAI,EACF,MACA,QAAQ,WACR,UACA,OAAO,UACP,GAAG,UACD;CAEJ,MAAM,aAAa,SAAS;AAE5B,QACE,oBAAC;EACM;EACC;EACN,aAAU;EACV,cAAY;EACZ,GAAI;EAEH;GACY;;AAInB,MAAM,SAAS,WAAW,MAAM;AAEhC,OAAO,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { CONTAINER_STYLES, extractStyles, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
3
3
|
import { CONTAINER_STYLES, TEXT_STYLES, extractStyles, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { useTimer } from "../../../_internal/hooks/use-timer/use-timer.js";
|
|
3
3
|
import { CopyIcon } from "../../../icons/CopyIcon.js";
|
|
4
4
|
import { Button } from "../../actions/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { _Tooltip } from "../../overlays/Tooltip/Tooltip.js";
|
|
3
3
|
import { TooltipTrigger } from "../../overlays/Tooltip/TooltipTrigger.js";
|
|
4
4
|
import { CopyIcon } from "../../../icons/CopyIcon.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
3
3
|
import { DisplayTransition } from "../../helpers/DisplayTransition/DisplayTransition.js";
|
|
4
4
|
import { RightIcon } from "../../../icons/RightIcon.js";
|
|
@@ -36,7 +36,10 @@ const DisclosureRoot = tasty({
|
|
|
36
36
|
"shape=card": "1cr",
|
|
37
37
|
"shape=sharp": "0"
|
|
38
38
|
},
|
|
39
|
-
fill:
|
|
39
|
+
fill: {
|
|
40
|
+
"": false,
|
|
41
|
+
"shape=card": "#white"
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
});
|
|
42
45
|
const ContentWrapperElement = tasty({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Disclosure.js","names":["ItemButton","useId"],"sources":["../../../../src/components/content/Disclosure/Disclosure.tsx"],"sourcesContent":["import {\n BaseProps,\n BasePropsWithoutChildren,\n extractStyles,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n createContext,\n forwardRef,\n Key,\n ReactNode,\n RefObject,\n useContext,\n useMemo,\n useRef,\n} from 'react';\nimport { mergeProps, useDisclosure, useId } from 'react-aria';\nimport {\n DisclosureGroupState,\n DisclosureState,\n useDisclosureGroupState,\n useDisclosureState,\n} from 'react-stately';\n\nimport { RightIcon } from '../../../icons';\nimport { mergeRefs } from '../../../utils/react';\nimport { CubeItemButtonProps, ItemButton } from '../../actions/ItemButton';\nimport { DisplayTransition } from '../../helpers';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface DisclosureStateContext {\n isExpanded: boolean;\n toggle: () => void;\n expand: () => void;\n collapse: () => void;\n}\n\ninterface DisclosureContextValue {\n state: DisclosureState;\n buttonProps: Record<string, unknown>;\n panelProps: Record<string, unknown>;\n panelRef: RefObject<HTMLDivElement | null>;\n isDisabled: boolean;\n isExpanded: boolean;\n shape: 'default' | 'card' | 'sharp';\n transitionDuration?: number;\n triggerProps?: Partial<CubeItemButtonProps>;\n contentStyles?: Styles;\n}\n\ninterface DisclosureGroupContextValue {\n groupState: DisclosureGroupState;\n triggerProps?: Partial<CubeItemButtonProps>;\n contentStyles?: Styles;\n}\n\nexport interface CubeDisclosureProps\n extends BasePropsWithoutChildren,\n OuterStyleProps {\n /** Controls expanded state in controlled mode */\n isExpanded?: boolean;\n /** Initial expanded state in uncontrolled mode */\n defaultExpanded?: boolean;\n /** Callback fired when expanded state changes */\n onExpandedChange?: (isExpanded: boolean) => void;\n /** Disables trigger interactions and force-closes the content */\n isDisabled?: boolean;\n /** Render-prop alternative to achieve custom trigger markup */\n children?: ReactNode | ((state: DisclosureStateContext) => ReactNode);\n /** Visual shape variant */\n shape?: 'default' | 'card' | 'sharp';\n /** Duration for DisplayTransition animation in milliseconds */\n transitionDuration?: number;\n}\n\nexport interface CubeDisclosureTriggerProps\n extends Omit<CubeItemButtonProps, 'onPress' | 'isDisabled'> {\n /** Children content for the trigger */\n children?: ReactNode;\n}\n\nexport interface CubeDisclosureContentProps extends BaseProps {\n /** Children content for the panel */\n children?: ReactNode;\n}\n\nexport interface CubeDisclosureGroupProps extends BaseProps, OuterStyleProps {\n /** Allow more than one disclosure to be open */\n allowsMultipleExpanded?: boolean;\n /** Controlled expanded keys */\n expandedKeys?: Iterable<Key>;\n /** Uncontrolled default expanded keys */\n defaultExpandedKeys?: Iterable<Key>;\n /** Change handler providing the full expanded keys Set */\n onExpandedChange?: (keys: Set<Key>) => void;\n /** Disable all disclosures within group and force-close their content */\n isDisabled?: boolean;\n /** Props forwarded to all ItemButton triggers in the group */\n triggerProps?: Partial<CubeItemButtonProps>;\n /** Optional panel styles applied to all Content panels in the group */\n contentStyles?: Styles;\n children: ReactNode;\n}\n\nexport interface CubeDisclosureItemProps\n extends Omit<BasePropsWithoutChildren, 'id'>,\n OuterStyleProps {\n /** Unique identifier for the disclosure item in a group */\n id?: Key;\n /** Children content */\n children?: ReactNode;\n /** Disables trigger interactions and force-closes the content */\n isDisabled?: boolean;\n /** Controls expanded state in controlled mode */\n isExpanded?: boolean;\n /** Initial expanded state in uncontrolled mode */\n defaultExpanded?: boolean;\n /** Callback fired when expanded state changes */\n onExpandedChange?: (isExpanded: boolean) => void;\n /** Visual shape variant */\n shape?: 'default' | 'card' | 'sharp';\n}\n\n// ============================================================================\n// Contexts\n// ============================================================================\n\nconst DisclosureContext = createContext<DisclosureContextValue | null>(null);\nconst DisclosureGroupContext =\n createContext<DisclosureGroupContextValue | null>(null);\n\nfunction useDisclosureContext(): DisclosureContextValue {\n const context = useContext(DisclosureContext);\n\n if (!context) {\n throw new Error(\n 'Disclosure.Trigger and Disclosure.Content must be used within a Disclosure',\n );\n }\n\n return context;\n}\n\nfunction useDisclosureGroupContext(): DisclosureGroupContextValue | null {\n return useContext(DisclosureGroupContext);\n}\n\n// ============================================================================\n// Styled Components\n// ============================================================================\n\nconst DisclosureRoot = tasty({\n qa: 'Disclosure',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: 0,\n position: 'relative',\n border: {\n '': 'none',\n 'shape=card': '1bw solid #border',\n },\n radius: {\n '': '1r',\n 'shape=card': '1cr',\n 'shape=sharp': '0',\n },\n fill: '#white',\n },\n});\n\nconst ContentWrapperElement = tasty({\n qa: 'DisclosureContentWrapper',\n styles: {\n display: 'block',\n overflow: 'hidden',\n interpolateSize: 'allow-keywords',\n height: {\n '': 0,\n shown: 'max-content',\n },\n transition: 'height $disclosure-transition',\n },\n});\n\nconst ContentElement = tasty({\n qa: 'DisclosureContent',\n styles: {\n display: 'block',\n flow: 'column',\n contentVisibility: 'auto',\n },\n});\n\nconst GroupRoot = tasty({\n qa: 'DisclosureGroup',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: '0',\n },\n});\n\nconst TriggerIcon = tasty(RightIcon, {\n styles: {\n transition: 'rotate',\n rotate: {\n '': '0deg',\n expanded: '90deg',\n },\n },\n});\n\nconst StyledTrigger = tasty(ItemButton, {\n qa: 'DisclosureTrigger',\n type: 'header',\n styles: {\n radius: {\n '': '1r',\n 'expanded & shape=card': '(1cr - 1bw) (1cr - 1bw) 0 0',\n 'shape=sharp': '0',\n },\n border: '#clear',\n },\n});\n\n// ============================================================================\n// Disclosure Component\n// ============================================================================\n\nconst DisclosureComponent = forwardRef<HTMLDivElement, CubeDisclosureProps>(\n function Disclosure(props, ref) {\n const {\n isExpanded: controlledIsExpanded,\n defaultExpanded,\n onExpandedChange,\n isDisabled = false,\n children,\n shape = 'default',\n transitionDuration,\n qa,\n mods,\n ...otherProps\n } = props;\n\n const groupContext = useDisclosureGroupContext();\n const panelRef = useRef<HTMLDivElement>(null);\n\n // When disabled, force expanded to false\n const effectiveIsExpanded = isDisabled ? false : controlledIsExpanded;\n\n const state = useDisclosureState({\n isExpanded: effectiveIsExpanded,\n defaultExpanded: isDisabled ? false : defaultExpanded,\n onExpandedChange: isDisabled ? undefined : onExpandedChange,\n });\n\n // When disabled, override state.isExpanded to false\n const isExpanded = isDisabled ? false : state.isExpanded;\n\n const { buttonProps, panelProps } = useDisclosure(\n {\n isExpanded,\n isDisabled,\n },\n state,\n panelRef,\n );\n\n const contextValue = useMemo<DisclosureContextValue>(\n () => ({\n state,\n buttonProps,\n panelProps,\n panelRef,\n isDisabled,\n isExpanded,\n shape,\n transitionDuration,\n triggerProps: groupContext?.triggerProps,\n contentStyles: groupContext?.contentStyles,\n }),\n [\n state,\n buttonProps,\n panelProps,\n isDisabled,\n isExpanded,\n shape,\n transitionDuration,\n groupContext?.triggerProps,\n groupContext?.contentStyles,\n ],\n );\n\n const stateContext = useMemo<DisclosureStateContext>(\n () => ({\n isExpanded,\n toggle: state.toggle,\n expand: state.expand,\n collapse: state.collapse,\n }),\n [isExpanded, state.toggle, state.expand, state.collapse],\n );\n\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const finalMods = useMemo(\n () => ({\n expanded: isExpanded,\n disabled: isDisabled,\n shape,\n ...mods,\n }),\n [isExpanded, isDisabled, shape, mods],\n );\n\n const content =\n typeof children === 'function' ? children(stateContext) : children;\n\n return (\n <DisclosureContext.Provider value={contextValue}>\n <DisclosureRoot ref={ref} qa={qa} mods={finalMods} styles={outerStyles}>\n {content}\n </DisclosureRoot>\n </DisclosureContext.Provider>\n );\n },\n);\n\n// ============================================================================\n// Disclosure.Trigger Component\n// ============================================================================\n\nconst DisclosureTrigger = forwardRef<\n HTMLButtonElement,\n CubeDisclosureTriggerProps\n>(function DisclosureTrigger(props, ref) {\n const { children, icon, mods, ...otherProps } = props;\n const context = useDisclosureContext();\n const { buttonProps, isDisabled, isExpanded, shape, triggerProps } = context;\n\n const finalMods = useMemo(\n () => ({\n expanded: isExpanded,\n disabled: isDisabled,\n shape,\n selected: false,\n ...mods,\n }),\n [isExpanded, isDisabled, shape, mods],\n );\n\n // Default icon is a rotating chevron\n const defaultIcon = <TriggerIcon mods={{ expanded: isExpanded }} />;\n\n return (\n <StyledTrigger\n ref={ref}\n icon={icon ?? defaultIcon}\n isDisabled={isDisabled}\n isSelected={isExpanded}\n {...triggerProps}\n {...(mergeProps(otherProps, buttonProps as any) as any)}\n mods={finalMods}\n >\n {children}\n </StyledTrigger>\n );\n});\n\n// ============================================================================\n// Disclosure.Content Component\n// ============================================================================\n\nconst DisclosureContent = forwardRef<\n HTMLDivElement,\n CubeDisclosureContentProps\n>(function DisclosureContent(props, ref) {\n const { children, styles, mods, ...otherProps } = props;\n const context = useDisclosureContext();\n const {\n panelProps,\n panelRef,\n isExpanded,\n transitionDuration,\n contentStyles,\n } = context;\n\n const mergedStyles = useMemo<Styles>(\n () => ({\n ...contentStyles,\n ...styles,\n }),\n [contentStyles, styles],\n );\n\n // Filter out hidden attribute from panelProps since we manage visibility via CSS height animation\n const { hidden, ...filteredPanelProps } = panelProps as Record<\n string,\n unknown\n >;\n\n return (\n <DisplayTransition\n isShown={isExpanded}\n duration={transitionDuration}\n animateOnMount={false}\n >\n {({ phase, isShown, ref: transitionRef }) => (\n <ContentWrapperElement\n ref={transitionRef}\n mods={{ shown: isShown, phase }}\n tokens={\n transitionDuration != null\n ? { '$disclosure-transition': `${transitionDuration}ms` }\n : undefined\n }\n >\n <ContentElement\n ref={mergeRefs(ref, panelRef)}\n mods={mods}\n styles={mergedStyles}\n {...filteredPanelProps}\n {...otherProps}\n >\n {children}\n </ContentElement>\n </ContentWrapperElement>\n )}\n </DisplayTransition>\n );\n});\n\n// ============================================================================\n// Disclosure.Group Component\n// ============================================================================\n\nconst DisclosureGroup = forwardRef<HTMLDivElement, CubeDisclosureGroupProps>(\n function DisclosureGroup(props, ref) {\n const {\n allowsMultipleExpanded = false,\n expandedKeys,\n defaultExpandedKeys,\n onExpandedChange,\n isDisabled = false,\n triggerProps,\n contentStyles,\n children,\n qa,\n mods,\n styles,\n ...otherProps\n } = props;\n\n const groupState = useDisclosureGroupState({\n allowsMultipleExpanded,\n expandedKeys,\n defaultExpandedKeys,\n onExpandedChange,\n isDisabled,\n });\n\n const contextValue = useMemo<DisclosureGroupContextValue>(\n () => ({\n groupState,\n triggerProps,\n contentStyles,\n }),\n [groupState, triggerProps, contentStyles],\n );\n\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const finalStyles = useMemo<Styles>(\n () => ({\n ...outerStyles,\n ...styles,\n }),\n [outerStyles, styles],\n );\n\n return (\n <DisclosureGroupContext.Provider value={contextValue}>\n <GroupRoot ref={ref} qa={qa} mods={mods} styles={finalStyles}>\n {children}\n </GroupRoot>\n </DisclosureGroupContext.Provider>\n );\n },\n);\n\n// ============================================================================\n// Disclosure.Item Component\n// ============================================================================\n\nconst DisclosureItem = forwardRef<HTMLDivElement, CubeDisclosureItemProps>(\n function DisclosureItem(props, ref) {\n const {\n id: providedId,\n children,\n isDisabled: itemDisabled = false,\n isExpanded: controlledIsExpanded,\n defaultExpanded,\n onExpandedChange,\n shape = 'default',\n qa,\n mods,\n styles,\n ...otherProps\n } = props;\n\n const defaultId = useId();\n const id = providedId ?? defaultId;\n\n const groupContext = useDisclosureGroupContext();\n const panelRef = useRef<HTMLDivElement>(null);\n\n // Determine if disabled from group or item\n const isDisabled =\n itemDisabled || groupContext?.groupState?.isDisabled || false;\n\n // Determine expanded state from group or local props\n const groupIsExpanded = groupContext\n ? groupContext.groupState.expandedKeys.has(id)\n : undefined;\n\n // When disabled, force expanded to false\n const effectiveIsExpanded = isDisabled\n ? false\n : groupIsExpanded ?? controlledIsExpanded;\n\n const state = useDisclosureState({\n isExpanded: effectiveIsExpanded,\n defaultExpanded: isDisabled ? false : defaultExpanded,\n onExpandedChange(expanded) {\n if (isDisabled) return;\n\n if (groupContext) {\n groupContext.groupState.toggleKey(id);\n }\n onExpandedChange?.(expanded);\n },\n });\n\n // When disabled, override state.isExpanded to false\n const isExpanded = isDisabled ? false : state.isExpanded;\n\n const { buttonProps, panelProps } = useDisclosure(\n {\n isExpanded,\n isDisabled,\n },\n state,\n panelRef,\n );\n\n const contextValue = useMemo<DisclosureContextValue>(\n () => ({\n state,\n buttonProps,\n panelProps,\n panelRef,\n isDisabled,\n isExpanded,\n shape,\n transitionDuration: undefined,\n triggerProps: groupContext?.triggerProps,\n contentStyles: groupContext?.contentStyles,\n }),\n [\n state,\n buttonProps,\n panelProps,\n isDisabled,\n isExpanded,\n shape,\n groupContext?.triggerProps,\n groupContext?.contentStyles,\n ],\n );\n\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const finalStyles = useMemo<Styles>(\n () => ({\n ...outerStyles,\n ...styles,\n }),\n [outerStyles, styles],\n );\n\n const finalMods = useMemo(\n () => ({\n expanded: isExpanded,\n disabled: isDisabled,\n shape,\n ...mods,\n }),\n [isExpanded, isDisabled, shape, mods],\n );\n\n return (\n <DisclosureContext.Provider value={contextValue}>\n <DisclosureRoot\n ref={ref}\n qa={qa}\n mods={finalMods}\n styles={finalStyles}\n data-key={id}\n >\n {children}\n </DisclosureRoot>\n </DisclosureContext.Provider>\n );\n },\n);\n\n// ============================================================================\n// Compound Component Export\n// ============================================================================\n\nconst _Disclosure = Object.assign(DisclosureComponent, {\n Trigger: DisclosureTrigger,\n Content: DisclosureContent,\n Group: DisclosureGroup,\n Item: DisclosureItem,\n});\n\nexport { _Disclosure as Disclosure };\nexport type {\n CubeDisclosureProps as DisclosureProps,\n CubeDisclosureTriggerProps as DisclosureTriggerProps,\n CubeDisclosureContentProps as DisclosureContentProps,\n CubeDisclosureGroupProps as DisclosureGroupProps,\n CubeDisclosureItemProps as DisclosureItemProps,\n};\n"],"mappings":";;;;;;;;;;;;AAqIA,MAAM,oBAAoB,cAA6C,KAAK;AAC5E,MAAM,yBACJ,cAAkD,KAAK;AAEzD,SAAS,uBAA+C;CACtD,MAAM,UAAU,WAAW,kBAAkB;AAE7C,KAAI,CAAC,QACH,OAAM,IAAI,MACR,6EACD;AAGH,QAAO;;AAGT,SAAS,4BAAgE;AACvE,QAAO,WAAW,uBAAuB;;AAO3C,MAAM,iBAAiB,MAAM;CAC3B,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,MAAM;EACN,KAAK;EACL,UAAU;EACV,QAAQ;GACN,IAAI;GACJ,cAAc;GACf;EACD,QAAQ;GACN,IAAI;GACJ,cAAc;GACd,eAAe;GAChB;EACD,MAAM;EACP;CACF,CAAC;AAEF,MAAM,wBAAwB,MAAM;CAClC,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,UAAU;EACV,iBAAiB;EACjB,QAAQ;GACN,IAAI;GACJ,OAAO;GACR;EACD,YAAY;EACb;CACF,CAAC;AAEF,MAAM,iBAAiB,MAAM;CAC3B,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,MAAM;EACN,mBAAmB;EACpB;CACF,CAAC;AAEF,MAAM,YAAY,MAAM;CACtB,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,MAAM;EACN,KAAK;EACN;CACF,CAAC;AAEF,MAAM,cAAc,MAAM,WAAW,EACnC,QAAQ;CACN,YAAY;CACZ,QAAQ;EACN,IAAI;EACJ,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CACF;CAED,MAAM,cAAc,cAAc,YAAY,aAAa;CAE3D,MAAM,cAAc,eACX;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,aAAa,OAAO,CACtB;CAED,MAAM,YAAY,eACT;EACL,UAAU;EACV,UAAU;EACV;EACA,GAAG;EACJ,GACD;EAAC;EAAY;EAAY;EAAO;EAAK,CACtC;AAED,QACE,oBAAC,kBAAkB;EAAS,OAAO;YACjC,oBAAC;GACM;GACD;GACJ,MAAM;GACN,QAAQ;GACR,YAAU;GAET;IACc;GACU;EAGlC;AAMD,MAAM,cAAc,OAAO,OAAO,qBAAqB;CACrD,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;CACP,CAAC"}
|
|
1
|
+
{"version":3,"file":"Disclosure.js","names":["ItemButton","useId"],"sources":["../../../../src/components/content/Disclosure/Disclosure.tsx"],"sourcesContent":["import {\n BaseProps,\n BasePropsWithoutChildren,\n extractStyles,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n createContext,\n forwardRef,\n Key,\n ReactNode,\n RefObject,\n useContext,\n useMemo,\n useRef,\n} from 'react';\nimport { mergeProps, useDisclosure, useId } from 'react-aria';\nimport {\n DisclosureGroupState,\n DisclosureState,\n useDisclosureGroupState,\n useDisclosureState,\n} from 'react-stately';\n\nimport { RightIcon } from '../../../icons';\nimport { mergeRefs } from '../../../utils/react';\nimport { CubeItemButtonProps, ItemButton } from '../../actions/ItemButton';\nimport { DisplayTransition } from '../../helpers';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface DisclosureStateContext {\n isExpanded: boolean;\n toggle: () => void;\n expand: () => void;\n collapse: () => void;\n}\n\ninterface DisclosureContextValue {\n state: DisclosureState;\n buttonProps: Record<string, unknown>;\n panelProps: Record<string, unknown>;\n panelRef: RefObject<HTMLDivElement | null>;\n isDisabled: boolean;\n isExpanded: boolean;\n shape: 'default' | 'card' | 'sharp';\n transitionDuration?: number;\n triggerProps?: Partial<CubeItemButtonProps>;\n contentStyles?: Styles;\n}\n\ninterface DisclosureGroupContextValue {\n groupState: DisclosureGroupState;\n triggerProps?: Partial<CubeItemButtonProps>;\n contentStyles?: Styles;\n}\n\nexport interface CubeDisclosureProps\n extends BasePropsWithoutChildren,\n OuterStyleProps {\n /** Controls expanded state in controlled mode */\n isExpanded?: boolean;\n /** Initial expanded state in uncontrolled mode */\n defaultExpanded?: boolean;\n /** Callback fired when expanded state changes */\n onExpandedChange?: (isExpanded: boolean) => void;\n /** Disables trigger interactions and force-closes the content */\n isDisabled?: boolean;\n /** Render-prop alternative to achieve custom trigger markup */\n children?: ReactNode | ((state: DisclosureStateContext) => ReactNode);\n /** Visual shape variant */\n shape?: 'default' | 'card' | 'sharp';\n /** Duration for DisplayTransition animation in milliseconds */\n transitionDuration?: number;\n}\n\nexport interface CubeDisclosureTriggerProps\n extends Omit<CubeItemButtonProps, 'onPress' | 'isDisabled'> {\n /** Children content for the trigger */\n children?: ReactNode;\n}\n\nexport interface CubeDisclosureContentProps extends BaseProps {\n /** Children content for the panel */\n children?: ReactNode;\n}\n\nexport interface CubeDisclosureGroupProps extends BaseProps, OuterStyleProps {\n /** Allow more than one disclosure to be open */\n allowsMultipleExpanded?: boolean;\n /** Controlled expanded keys */\n expandedKeys?: Iterable<Key>;\n /** Uncontrolled default expanded keys */\n defaultExpandedKeys?: Iterable<Key>;\n /** Change handler providing the full expanded keys Set */\n onExpandedChange?: (keys: Set<Key>) => void;\n /** Disable all disclosures within group and force-close their content */\n isDisabled?: boolean;\n /** Props forwarded to all ItemButton triggers in the group */\n triggerProps?: Partial<CubeItemButtonProps>;\n /** Optional panel styles applied to all Content panels in the group */\n contentStyles?: Styles;\n children: ReactNode;\n}\n\nexport interface CubeDisclosureItemProps\n extends Omit<BasePropsWithoutChildren, 'id'>,\n OuterStyleProps {\n /** Unique identifier for the disclosure item in a group */\n id?: Key;\n /** Children content */\n children?: ReactNode;\n /** Disables trigger interactions and force-closes the content */\n isDisabled?: boolean;\n /** Controls expanded state in controlled mode */\n isExpanded?: boolean;\n /** Initial expanded state in uncontrolled mode */\n defaultExpanded?: boolean;\n /** Callback fired when expanded state changes */\n onExpandedChange?: (isExpanded: boolean) => void;\n /** Visual shape variant */\n shape?: 'default' | 'card' | 'sharp';\n}\n\n// ============================================================================\n// Contexts\n// ============================================================================\n\nconst DisclosureContext = createContext<DisclosureContextValue | null>(null);\nconst DisclosureGroupContext =\n createContext<DisclosureGroupContextValue | null>(null);\n\nfunction useDisclosureContext(): DisclosureContextValue {\n const context = useContext(DisclosureContext);\n\n if (!context) {\n throw new Error(\n 'Disclosure.Trigger and Disclosure.Content must be used within a Disclosure',\n );\n }\n\n return context;\n}\n\nfunction useDisclosureGroupContext(): DisclosureGroupContextValue | null {\n return useContext(DisclosureGroupContext);\n}\n\n// ============================================================================\n// Styled Components\n// ============================================================================\n\nconst DisclosureRoot = tasty({\n qa: 'Disclosure',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: 0,\n position: 'relative',\n border: {\n '': 'none',\n 'shape=card': '1bw solid #border',\n },\n radius: {\n '': '1r',\n 'shape=card': '1cr',\n 'shape=sharp': '0',\n },\n fill: {\n '': false,\n 'shape=card': '#white',\n },\n },\n});\n\nconst ContentWrapperElement = tasty({\n qa: 'DisclosureContentWrapper',\n styles: {\n display: 'block',\n overflow: 'hidden',\n interpolateSize: 'allow-keywords',\n height: {\n '': 0,\n shown: 'max-content',\n },\n transition: 'height $disclosure-transition',\n },\n});\n\nconst ContentElement = tasty({\n qa: 'DisclosureContent',\n styles: {\n display: 'block',\n flow: 'column',\n contentVisibility: 'auto',\n },\n});\n\nconst GroupRoot = tasty({\n qa: 'DisclosureGroup',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: '0',\n },\n});\n\nconst TriggerIcon = tasty(RightIcon, {\n styles: {\n transition: 'rotate',\n rotate: {\n '': '0deg',\n expanded: '90deg',\n },\n },\n});\n\nconst StyledTrigger = tasty(ItemButton, {\n qa: 'DisclosureTrigger',\n type: 'header',\n styles: {\n radius: {\n '': '1r',\n 'expanded & shape=card': '(1cr - 1bw) (1cr - 1bw) 0 0',\n 'shape=sharp': '0',\n },\n border: '#clear',\n },\n});\n\n// ============================================================================\n// Disclosure Component\n// ============================================================================\n\nconst DisclosureComponent = forwardRef<HTMLDivElement, CubeDisclosureProps>(\n function Disclosure(props, ref) {\n const {\n isExpanded: controlledIsExpanded,\n defaultExpanded,\n onExpandedChange,\n isDisabled = false,\n children,\n shape = 'default',\n transitionDuration,\n qa,\n mods,\n ...otherProps\n } = props;\n\n const groupContext = useDisclosureGroupContext();\n const panelRef = useRef<HTMLDivElement>(null);\n\n // When disabled, force expanded to false\n const effectiveIsExpanded = isDisabled ? false : controlledIsExpanded;\n\n const state = useDisclosureState({\n isExpanded: effectiveIsExpanded,\n defaultExpanded: isDisabled ? false : defaultExpanded,\n onExpandedChange: isDisabled ? undefined : onExpandedChange,\n });\n\n // When disabled, override state.isExpanded to false\n const isExpanded = isDisabled ? false : state.isExpanded;\n\n const { buttonProps, panelProps } = useDisclosure(\n {\n isExpanded,\n isDisabled,\n },\n state,\n panelRef,\n );\n\n const contextValue = useMemo<DisclosureContextValue>(\n () => ({\n state,\n buttonProps,\n panelProps,\n panelRef,\n isDisabled,\n isExpanded,\n shape,\n transitionDuration,\n triggerProps: groupContext?.triggerProps,\n contentStyles: groupContext?.contentStyles,\n }),\n [\n state,\n buttonProps,\n panelProps,\n isDisabled,\n isExpanded,\n shape,\n transitionDuration,\n groupContext?.triggerProps,\n groupContext?.contentStyles,\n ],\n );\n\n const stateContext = useMemo<DisclosureStateContext>(\n () => ({\n isExpanded,\n toggle: state.toggle,\n expand: state.expand,\n collapse: state.collapse,\n }),\n [isExpanded, state.toggle, state.expand, state.collapse],\n );\n\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const finalMods = useMemo(\n () => ({\n expanded: isExpanded,\n disabled: isDisabled,\n shape,\n ...mods,\n }),\n [isExpanded, isDisabled, shape, mods],\n );\n\n const content =\n typeof children === 'function' ? children(stateContext) : children;\n\n return (\n <DisclosureContext.Provider value={contextValue}>\n <DisclosureRoot ref={ref} qa={qa} mods={finalMods} styles={outerStyles}>\n {content}\n </DisclosureRoot>\n </DisclosureContext.Provider>\n );\n },\n);\n\n// ============================================================================\n// Disclosure.Trigger Component\n// ============================================================================\n\nconst DisclosureTrigger = forwardRef<\n HTMLButtonElement,\n CubeDisclosureTriggerProps\n>(function DisclosureTrigger(props, ref) {\n const { children, icon, mods, ...otherProps } = props;\n const context = useDisclosureContext();\n const { buttonProps, isDisabled, isExpanded, shape, triggerProps } = context;\n\n const finalMods = useMemo(\n () => ({\n expanded: isExpanded,\n disabled: isDisabled,\n shape,\n selected: false,\n ...mods,\n }),\n [isExpanded, isDisabled, shape, mods],\n );\n\n // Default icon is a rotating chevron\n const defaultIcon = <TriggerIcon mods={{ expanded: isExpanded }} />;\n\n return (\n <StyledTrigger\n ref={ref}\n icon={icon ?? defaultIcon}\n isDisabled={isDisabled}\n isSelected={isExpanded}\n {...triggerProps}\n {...(mergeProps(otherProps, buttonProps as any) as any)}\n mods={finalMods}\n >\n {children}\n </StyledTrigger>\n );\n});\n\n// ============================================================================\n// Disclosure.Content Component\n// ============================================================================\n\nconst DisclosureContent = forwardRef<\n HTMLDivElement,\n CubeDisclosureContentProps\n>(function DisclosureContent(props, ref) {\n const { children, styles, mods, ...otherProps } = props;\n const context = useDisclosureContext();\n const {\n panelProps,\n panelRef,\n isExpanded,\n transitionDuration,\n contentStyles,\n } = context;\n\n const mergedStyles = useMemo<Styles>(\n () => ({\n ...contentStyles,\n ...styles,\n }),\n [contentStyles, styles],\n );\n\n // Filter out hidden attribute from panelProps since we manage visibility via CSS height animation\n const { hidden, ...filteredPanelProps } = panelProps as Record<\n string,\n unknown\n >;\n\n return (\n <DisplayTransition\n isShown={isExpanded}\n duration={transitionDuration}\n animateOnMount={false}\n >\n {({ phase, isShown, ref: transitionRef }) => (\n <ContentWrapperElement\n ref={transitionRef}\n mods={{ shown: isShown, phase }}\n tokens={\n transitionDuration != null\n ? { '$disclosure-transition': `${transitionDuration}ms` }\n : undefined\n }\n >\n <ContentElement\n ref={mergeRefs(ref, panelRef)}\n mods={mods}\n styles={mergedStyles}\n {...filteredPanelProps}\n {...otherProps}\n >\n {children}\n </ContentElement>\n </ContentWrapperElement>\n )}\n </DisplayTransition>\n );\n});\n\n// ============================================================================\n// Disclosure.Group Component\n// ============================================================================\n\nconst DisclosureGroup = forwardRef<HTMLDivElement, CubeDisclosureGroupProps>(\n function DisclosureGroup(props, ref) {\n const {\n allowsMultipleExpanded = false,\n expandedKeys,\n defaultExpandedKeys,\n onExpandedChange,\n isDisabled = false,\n triggerProps,\n contentStyles,\n children,\n qa,\n mods,\n styles,\n ...otherProps\n } = props;\n\n const groupState = useDisclosureGroupState({\n allowsMultipleExpanded,\n expandedKeys,\n defaultExpandedKeys,\n onExpandedChange,\n isDisabled,\n });\n\n const contextValue = useMemo<DisclosureGroupContextValue>(\n () => ({\n groupState,\n triggerProps,\n contentStyles,\n }),\n [groupState, triggerProps, contentStyles],\n );\n\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const finalStyles = useMemo<Styles>(\n () => ({\n ...outerStyles,\n ...styles,\n }),\n [outerStyles, styles],\n );\n\n return (\n <DisclosureGroupContext.Provider value={contextValue}>\n <GroupRoot ref={ref} qa={qa} mods={mods} styles={finalStyles}>\n {children}\n </GroupRoot>\n </DisclosureGroupContext.Provider>\n );\n },\n);\n\n// ============================================================================\n// Disclosure.Item Component\n// ============================================================================\n\nconst DisclosureItem = forwardRef<HTMLDivElement, CubeDisclosureItemProps>(\n function DisclosureItem(props, ref) {\n const {\n id: providedId,\n children,\n isDisabled: itemDisabled = false,\n isExpanded: controlledIsExpanded,\n defaultExpanded,\n onExpandedChange,\n shape = 'default',\n qa,\n mods,\n styles,\n ...otherProps\n } = props;\n\n const defaultId = useId();\n const id = providedId ?? defaultId;\n\n const groupContext = useDisclosureGroupContext();\n const panelRef = useRef<HTMLDivElement>(null);\n\n // Determine if disabled from group or item\n const isDisabled =\n itemDisabled || groupContext?.groupState?.isDisabled || false;\n\n // Determine expanded state from group or local props\n const groupIsExpanded = groupContext\n ? groupContext.groupState.expandedKeys.has(id)\n : undefined;\n\n // When disabled, force expanded to false\n const effectiveIsExpanded = isDisabled\n ? false\n : groupIsExpanded ?? controlledIsExpanded;\n\n const state = useDisclosureState({\n isExpanded: effectiveIsExpanded,\n defaultExpanded: isDisabled ? false : defaultExpanded,\n onExpandedChange(expanded) {\n if (isDisabled) return;\n\n if (groupContext) {\n groupContext.groupState.toggleKey(id);\n }\n onExpandedChange?.(expanded);\n },\n });\n\n // When disabled, override state.isExpanded to false\n const isExpanded = isDisabled ? false : state.isExpanded;\n\n const { buttonProps, panelProps } = useDisclosure(\n {\n isExpanded,\n isDisabled,\n },\n state,\n panelRef,\n );\n\n const contextValue = useMemo<DisclosureContextValue>(\n () => ({\n state,\n buttonProps,\n panelProps,\n panelRef,\n isDisabled,\n isExpanded,\n shape,\n transitionDuration: undefined,\n triggerProps: groupContext?.triggerProps,\n contentStyles: groupContext?.contentStyles,\n }),\n [\n state,\n buttonProps,\n panelProps,\n isDisabled,\n isExpanded,\n shape,\n groupContext?.triggerProps,\n groupContext?.contentStyles,\n ],\n );\n\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const finalStyles = useMemo<Styles>(\n () => ({\n ...outerStyles,\n ...styles,\n }),\n [outerStyles, styles],\n );\n\n const finalMods = useMemo(\n () => ({\n expanded: isExpanded,\n disabled: isDisabled,\n shape,\n ...mods,\n }),\n [isExpanded, isDisabled, shape, mods],\n );\n\n return (\n <DisclosureContext.Provider value={contextValue}>\n <DisclosureRoot\n ref={ref}\n qa={qa}\n mods={finalMods}\n styles={finalStyles}\n data-key={id}\n >\n {children}\n </DisclosureRoot>\n </DisclosureContext.Provider>\n );\n },\n);\n\n// ============================================================================\n// Compound Component Export\n// ============================================================================\n\nconst _Disclosure = Object.assign(DisclosureComponent, {\n Trigger: DisclosureTrigger,\n Content: DisclosureContent,\n Group: DisclosureGroup,\n Item: DisclosureItem,\n});\n\nexport { _Disclosure as Disclosure };\nexport type {\n CubeDisclosureProps as DisclosureProps,\n CubeDisclosureTriggerProps as DisclosureTriggerProps,\n CubeDisclosureContentProps as DisclosureContentProps,\n CubeDisclosureGroupProps as DisclosureGroupProps,\n CubeDisclosureItemProps as DisclosureItemProps,\n};\n"],"mappings":";;;;;;;;;;;;AAqIA,MAAM,oBAAoB,cAA6C,KAAK;AAC5E,MAAM,yBACJ,cAAkD,KAAK;AAEzD,SAAS,uBAA+C;CACtD,MAAM,UAAU,WAAW,kBAAkB;AAE7C,KAAI,CAAC,QACH,OAAM,IAAI,MACR,6EACD;AAGH,QAAO;;AAGT,SAAS,4BAAgE;AACvE,QAAO,WAAW,uBAAuB;;AAO3C,MAAM,iBAAiB,MAAM;CAC3B,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,MAAM;EACN,KAAK;EACL,UAAU;EACV,QAAQ;GACN,IAAI;GACJ,cAAc;GACf;EACD,QAAQ;GACN,IAAI;GACJ,cAAc;GACd,eAAe;GAChB;EACD,MAAM;GACJ,IAAI;GACJ,cAAc;GACf;EACF;CACF,CAAC;AAEF,MAAM,wBAAwB,MAAM;CAClC,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,UAAU;EACV,iBAAiB;EACjB,QAAQ;GACN,IAAI;GACJ,OAAO;GACR;EACD,YAAY;EACb;CACF,CAAC;AAEF,MAAM,iBAAiB,MAAM;CAC3B,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,MAAM;EACN,mBAAmB;EACpB;CACF,CAAC;AAEF,MAAM,YAAY,MAAM;CACtB,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,MAAM;EACN,KAAK;EACN;CACF,CAAC;AAEF,MAAM,cAAc,MAAM,WAAW,EACnC,QAAQ;CACN,YAAY;CACZ,QAAQ;EACN,IAAI;EACJ,UAAU;EACX;C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AM,cAAc,cAAc,YAAY,aAAa;CAE3D,MAAM,cAAc,eACX;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,aAAa,OAAO,CACtB;CAED,MAAM,YAAY,eACT;EACL,UAAU;EACV,UAAU;EACV;EACA,GAAG;EACJ,GACD;EAAC;EAAY;EAAY;EAAO;EAAK,CACtC;AAED,QACE,oBAAC,kBAAkB;EAAS,OAAO;YACjC,oBAAC;GACM;GACD;GACJ,MAAM;GACN,QAAQ;GACR,YAAU;GAET;IACc;GACU;EAGlC;AAMD,MAAM,cAAc,OAAO,OAAO,qBAAqB;CACrD,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;CACP,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
3
3
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { BASE_STYLES, COLOR_STYLES, OUTER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
3
3
|
import { CONTAINER_STYLES, TEXT_STYLES, extractStyles, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
3
3
|
import { CONTAINER_STYLES, TEXT_STYLES, extractStyles, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { _Text } from "../Text.js";
|
|
3
3
|
import { useKeySymbols } from "../../../utils/react/useKeySymbols.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { resolveIcon } from "../../../utils/react/resolveIcon.js";
|
|
4
4
|
import { highlightText } from "../highlightText.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.121.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
4
4
|
import { DANGER_CLEAR_STYLES, DANGER_NEUTRAL_STYLES, DANGER_PRIMARY_STYLES, DANGER_SECONDARY_STYLES, DEFAULT_CLEAR_STYLES, DEFAULT_NEUTRAL_STYLES, DEFAULT_PRIMARY_STYLES, DEFAULT_SECONDARY_STYLES, ITEM_ACTION_BASE_STYLES, SPECIAL_CLEAR_STYLES, SPECIAL_NEUTRAL_STYLES, SPECIAL_PRIMARY_STYLES, SPECIAL_SECONDARY_STYLES, SUCCESS_CLEAR_STYLES, SUCCESS_NEUTRAL_STYLES, SUCCESS_PRIMARY_STYLES, SUCCESS_SECONDARY_STYLES } from "../../../data/item-themes.js";
|
|
@@ -14,7 +14,8 @@ const ItemBadgeElement = tasty({
|
|
|
14
14
|
qa: "ItemBadge",
|
|
15
15
|
styles: {
|
|
16
16
|
...ITEM_ACTION_BASE_STYLES,
|
|
17
|
-
cursor: "default"
|
|
17
|
+
cursor: "default",
|
|
18
|
+
border: { "type=primary": "#clear" }
|
|
18
19
|
},
|
|
19
20
|
variants: {
|
|
20
21
|
"default.primary": DEFAULT_PRIMARY_STYLES,
|