@cube-dev/ui-kit 0.0.0-canary-38e4d16 → 0.0.0-canary-22602ec
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.d.ts +2 -5
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/TextItem/TextItem.js.map +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +72 -114
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/item-table-sections.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-body-sections.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/CalendarPopover.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-layout.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/Usage.md +11 -0
- package/docs/components/content/Item.md +1 -1
- package/docs/components/content/TextItem.md +1 -13
- package/package.json +4 -2
- package/tasty.config.generated.ts +526 -0
- package/tasty.config.ts +29 -422
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import "./LayoutContext.js";
|
|
3
3
|
import { Layout as _Layout } from "./Layout.js";
|
|
4
4
|
import { LayoutContent as _LayoutContent } from "./LayoutContent.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { Text as _Text } from "./Text.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { extractStyles, mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { Prism as RendererPrism, ensureSqlDateUnitKeywords, ensureYamlSqlExtensions } from "./prismSetup.js";
|
|
3
3
|
import { CONTAINER_STYLES, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { Prism as RendererPrism } from "prism-react-renderer";
|
|
3
3
|
//#region src/components/content/PrismCode/prismSetup.tsx
|
|
4
4
|
globalThis.Prism = RendererPrism;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { PrismCode as _PrismCode } from "../PrismCode/PrismCode.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { wrapNodeIfPlain } from "../../../utils/react/wrapNodeIfPlain.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
3
3
|
import { Space } from "../../layout/Space.js";
|
|
4
4
|
import { Grid } from "../../layout/Grid.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { Item as _Item } from "../Item/Item.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -27,11 +27,8 @@ export interface CubeTextItemProps extends Omit<CubeTextProps, 'ellipsis' | 'now
|
|
|
27
27
|
/**
|
|
28
28
|
* Tooltip content and configuration:
|
|
29
29
|
* - string: simple tooltip text
|
|
30
|
-
* - true: auto tooltip on overflow (shows children as tooltip when truncated
|
|
31
|
-
*
|
|
32
|
-
* - object: advanced configuration with optional auto property;
|
|
33
|
-
* `{ title, auto: true }` shows `title` only on overflow, for any children
|
|
34
|
-
* (an element label included)
|
|
30
|
+
* - true: auto tooltip on overflow (shows children as tooltip when truncated)
|
|
31
|
+
* - object: advanced configuration with optional auto property
|
|
35
32
|
* @default true
|
|
36
33
|
*/
|
|
37
34
|
tooltip?: AutoTooltipValue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { TEXT_DEFAULT_STYLES, TEXT_PROP_MAP, useTextProps } from "../Text.js";
|
|
4
4
|
import { highlightText } from "../highlightText.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextItem.js","names":["BASE_STYLES","COLOR_STYLES","filterBaseProps","mergeStyles","Styles","tasty","TEXT_STYLES","AnchorHTMLAttributes","forwardRef","ForwardRefExoticComponent","HTMLAttributes","Ref","RefAttributes","RefObject","useEffectEvent","useLayoutEffect","PositionProps","extractStyles","highlightText","CubeTextProps","TEXT_DEFAULT_STYLES","TEXT_PROP_MAP","useTextProps","AutoTooltipValue","useAutoTooltip","STYLE_LIST","const","CubeTextItemProps","Omit","highlight","highlightCaseSensitive","highlightStyles","tooltip","tooltipPlacement","TEXT_ITEM_STYLES","display","verticalAlign","width","whiteSpace","overflow","textOverflow","NATIVE_LINK_STYLES","position","undefined","zIndex","TextItemElement","as","styles","variants","plain","table","preset","nativePlain","nativeTable","NativeTextLink","inset","outline","TextItemWithNativeLinkProps","nativeLinkProps","HTMLAnchorElement","TEXT_ITEM_STYLE_KEYS","Object","keys","Array","matchesNativeState","value","expected","isArray","states","Record","length","hasOwn","getStaticVariant","count","every","key","TextItemContent","t0","$","_c","handleRef","onAppearanceCommit","t1","t2","t3","t4","t5","t6","ref","labelRef","tooltipRef","t7","t8","props","t9","element","current","qa","textProps","variant","shouldMeasure","refreshOverflow","t10","t11","t12","t13","mods","t14","t15","children","t16","TextItem","HTMLElement","restProps","renderWithTooltip","isAutoTooltipEnabled","scheduleOverflowCheck","processedChildren","renderElement","tooltipTriggerProps","eventProps","displayName","TextItemWithNativeLink","_c"],"sources":["../../../../src/components/content/TextItem/TextItem.tsx"],"sourcesContent":["import {\n BASE_STYLES,\n COLOR_STYLES,\n filterBaseProps,\n mergeStyles,\n Styles,\n tasty,\n TEXT_STYLES,\n} from '@tenphi/tasty';\nimport {\n AnchorHTMLAttributes,\n forwardRef,\n ForwardRefExoticComponent,\n HTMLAttributes,\n Ref,\n RefAttributes,\n RefObject,\n useEffectEvent,\n useLayoutEffect,\n} from 'react';\nimport { PositionProps } from 'react-aria';\n\nimport { extractStyles } from '../../../utils/styles';\nimport { highlightText } from '../highlightText';\nimport {\n CubeTextProps,\n TEXT_DEFAULT_STYLES,\n TEXT_PROP_MAP,\n useTextProps,\n} from '../Text';\nimport { AutoTooltipValue, useAutoTooltip } from '../use-auto-tooltip';\n\nconst STYLE_LIST = [...BASE_STYLES, ...TEXT_STYLES, ...COLOR_STYLES] as const;\n\n/**\n * TextItem truncates to one line with an ellipsis, so Text's `ellipsis` and\n * `nowrap` have nothing to switch.\n */\nexport interface CubeTextItemProps extends Omit<\n CubeTextProps,\n 'ellipsis' | 'nowrap'\n> {\n /**\n * String to highlight within children.\n * Only works when children is a plain string.\n */\n highlight?: string;\n /**\n * Whether highlight matching is case-sensitive.\n * @default false\n */\n highlightCaseSensitive?: boolean;\n /**\n * Custom styles for highlighted text.\n */\n highlightStyles?: Styles;\n /**\n * Tooltip content and configuration:\n * - string: simple tooltip text\n * - true: auto tooltip on overflow (shows children as tooltip when truncated;\n * string children only)\n * - object: advanced configuration with optional auto property;\n * `{ title, auto: true }` shows `title` only on overflow, for any children\n * (an element label included)\n * @default true\n */\n tooltip?: AutoTooltipValue;\n /**\n * Default tooltip placement.\n * @default \"top\"\n */\n tooltipPlacement?: PositionProps['placement'];\n}\n\nconst TEXT_ITEM_STYLES = {\n display: 'inline-block',\n verticalAlign: 'bottom',\n width: 'max 100%',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n} satisfies Styles;\n\nconst NATIVE_LINK_STYLES: Styles = {\n // The child native target takes presses while this span keeps hover\n // ownership for its truncation tooltip.\n position: { '': undefined, 'native-link': 'relative' },\n zIndex: { '': undefined, 'native-link': 1 },\n};\n\nconst TextItemElement = tasty({\n as: 'span',\n styles: TEXT_DEFAULT_STYLES,\n variants: {\n plain: TEXT_ITEM_STYLES,\n table: mergeStyles(TEXT_ITEM_STYLES, { preset: 't3' }),\n nativePlain: mergeStyles(TEXT_ITEM_STYLES, NATIVE_LINK_STYLES),\n nativeTable: mergeStyles(TEXT_ITEM_STYLES, NATIVE_LINK_STYLES, {\n preset: 't3',\n }),\n },\n});\n\nconst NativeTextLink = tasty({\n as: 'a',\n styles: {\n position: 'absolute',\n inset: 0,\n zIndex: 0,\n outline: 0,\n },\n});\n\ninterface TextItemWithNativeLinkProps extends CubeTextItemProps {\n nativeLinkProps?: AnchorHTMLAttributes<HTMLAnchorElement>;\n}\n\nconst TEXT_ITEM_STYLE_KEYS = Object.keys(TEXT_ITEM_STYLES) as Array<\n keyof typeof TEXT_ITEM_STYLES\n>;\n\n/** Style merging copies state maps, so identity cannot recognize the defaults. */\nfunction matchesNativeState(value: unknown, expected: string | number) {\n if (value == null || typeof value !== 'object' || Array.isArray(value))\n return false;\n\n const states = value as Record<string, unknown>;\n return (\n Object.keys(states).length === 2 &&\n Object.hasOwn(states, '') &&\n Object.hasOwn(states, 'native-link') &&\n states[''] === undefined &&\n states['native-link'] === expected\n );\n}\n\nfunction getStaticVariant(styles: Styles) {\n const count = Object.keys(styles).length;\n\n if (\n !TEXT_ITEM_STYLE_KEYS.every((key) => styles[key] === TEXT_ITEM_STYLES[key])\n ) {\n return;\n }\n\n if (count === TEXT_ITEM_STYLE_KEYS.length) return 'plain';\n if (count === TEXT_ITEM_STYLE_KEYS.length + 1 && styles.preset === 't3')\n return 'table';\n\n if (\n !matchesNativeState(styles.position, 'relative') ||\n !matchesNativeState(styles.zIndex, 1)\n ) {\n return;\n }\n\n if (count === TEXT_ITEM_STYLE_KEYS.length + 2) return 'nativePlain';\n if (count === TEXT_ITEM_STYLE_KEYS.length + 3 && styles.preset === 't3')\n return 'nativeTable';\n}\n\n/** Own the DOM ref outside the tooltip's render prop so Compiler can retain it. */\nfunction TextItemContent({\n ref,\n labelRef,\n tooltipRef,\n onAppearanceCommit,\n nativeLinkProps,\n ...props\n}: CubeTextProps & {\n ref?: Ref<HTMLElement>;\n labelRef: (element: HTMLElement | null) => void;\n tooltipRef?: RefObject<HTMLElement | null>;\n onAppearanceCommit?: () => void;\n nativeLinkProps?: AnchorHTMLAttributes<HTMLAnchorElement>;\n}) {\n const handleRef = (element: HTMLElement | null) => {\n if (typeof ref === 'function') ref(element);\n else if (ref) ref.current = element;\n\n if (tooltipRef) tooltipRef.current = element;\n\n labelRef(element);\n };\n\n // Match tasty(Text)'s prop/style merge before Text applies its slot. A reset\n // here removes the TextItem default and restores Text's native default.\n const textProps = useTextProps({\n qa: 'TextItem',\n ...props,\n as: props.as ?? undefined,\n element: props.element || undefined,\n styles: mergeStyles(\n TEXT_ITEM_STYLES,\n nativeLinkProps ? NATIVE_LINK_STYLES : undefined,\n props.styles,\n ),\n });\n const variant = getStaticVariant(textProps.styles);\n\n const shouldMeasure = !!onAppearanceCommit;\n const refreshOverflow = useEffectEvent(() => onAppearanceCommit?.());\n\n // A fixed box can change its text width without a ResizeObserver delivery.\n // Queue after its props/slot commit, as the former ref reattachment did.\n useLayoutEffect(() => {\n if (shouldMeasure) refreshOverflow();\n }, [textProps, shouldMeasure]);\n\n // Reuse Tasty's static-style cache for common labels, with one native owner\n // across style/slot changes so a focused label never remounts for styling.\n return (\n <TextItemElement\n {...textProps}\n mods={{ ...textProps.mods, 'native-link': !!nativeLinkProps }}\n variant={variant}\n styles={variant ? undefined : textProps.styles}\n ref={handleRef}\n >\n {nativeLinkProps ? (\n <>\n {textProps.children}\n <NativeTextLink\n {...nativeLinkProps}\n data-element=\"NativeLink\"\n aria-hidden={true}\n tabIndex={-1}\n children={undefined}\n />\n </>\n ) : (\n textProps.children\n )}\n </TextItemElement>\n );\n}\n\nexport const TextItem = forwardRef<HTMLElement, CubeTextItemProps>(\n function TextItem(props, ref) {\n const {\n children,\n highlight,\n highlightCaseSensitive = false,\n highlightStyles,\n tooltip = true,\n tooltipPlacement = 'top',\n nativeLinkProps,\n ...restProps\n } = props as TextItemWithNativeLinkProps;\n\n // Extract style props (preset, color, etc.) to pass via styles prop\n const styles = extractStyles(restProps, STYLE_LIST, {}, TEXT_PROP_MAP);\n\n const {\n labelRef,\n renderWithTooltip,\n isAutoTooltipEnabled,\n scheduleOverflowCheck,\n } = useAutoTooltip({ tooltip, children });\n\n // Process children with highlight if applicable\n const processedChildren =\n typeof children === 'string' && highlight\n ? highlightText(\n children,\n highlight,\n highlightCaseSensitive,\n highlightStyles,\n )\n : children;\n\n const renderElement = (\n tooltipTriggerProps?: HTMLAttributes<HTMLElement>,\n tooltipRef?: RefObject<HTMLElement>,\n ) => {\n return (\n <TextItemContent\n {...filterBaseProps(restProps, { eventProps: true })}\n {...tooltipTriggerProps}\n ref={ref}\n labelRef={labelRef}\n tooltipRef={tooltipRef}\n nativeLinkProps={nativeLinkProps}\n onAppearanceCommit={\n isAutoTooltipEnabled ? scheduleOverflowCheck : undefined\n }\n styles={styles}\n >\n {processedChildren}\n </TextItemContent>\n );\n };\n\n return renderWithTooltip(renderElement, tooltipPlacement);\n },\n);\n\nTextItem.displayName = 'TextItem';\n\n/** @private Retains text hover ownership above a stretched native row link. */\nexport const TextItemWithNativeLink = TextItem as ForwardRefExoticComponent<\n TextItemWithNativeLinkProps & RefAttributes<HTMLElement>\n>;\n"],"mappings":";;;;;;;;;;AAgCA,MAAMyB,aAAa;CAAC,GAAGzB;CAAa,GAAGM;CAAa,GAAGL;AAAY;AA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a,YAApBhF,YACIX,cACE2F,UACAhF,WACAC,wBACAC,eAEK,IAPX8E;EAOY/B,EAAA,KAAA+B;EAAA/B,EAAA,KAAAjD;EAAAiD,EAAA,KAAAhD;EAAAgD,EAAA,KAAA/C;EAAA+C,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CARd,MAAAuC,oBACEhC;CASF,MAAAiC,iBAAsBC,qBAAA7B,eAKlB,oBAAC,iBAAD;EAAgB,GACVxF,gBAAgB+G,WAAW,EAAAO,YAAc,KAAK,CAAC;EAAC,GAChDD;EACC/B;EACKC;EACEC;EACKhC;EAEf,oBAAAyD,uBAAAC,wBAAAzE,KAAAA;EAEMI;EAEPsE,UAAAA;CAZa,CAAA;CAelB,OAEKH,kBAAkBI,eAAerF,gBAAgB;AAAC,CAE7D;AAEA8E,SAASU,cAAc;;AAGvB,MAAaC,yBAAyBX"}
|
|
1
|
+
{"version":3,"file":"TextItem.js","names":["BASE_STYLES","COLOR_STYLES","filterBaseProps","mergeStyles","Styles","tasty","TEXT_STYLES","AnchorHTMLAttributes","forwardRef","ForwardRefExoticComponent","HTMLAttributes","Ref","RefAttributes","RefObject","useEffectEvent","useLayoutEffect","PositionProps","extractStyles","highlightText","CubeTextProps","TEXT_DEFAULT_STYLES","TEXT_PROP_MAP","useTextProps","AutoTooltipValue","useAutoTooltip","STYLE_LIST","const","CubeTextItemProps","Omit","highlight","highlightCaseSensitive","highlightStyles","tooltip","tooltipPlacement","TEXT_ITEM_STYLES","display","verticalAlign","width","whiteSpace","overflow","textOverflow","NATIVE_LINK_STYLES","position","undefined","zIndex","TextItemElement","as","styles","variants","plain","table","preset","nativePlain","nativeTable","NativeTextLink","inset","outline","TextItemWithNativeLinkProps","nativeLinkProps","HTMLAnchorElement","TEXT_ITEM_STYLE_KEYS","Object","keys","Array","matchesNativeState","value","expected","isArray","states","Record","length","hasOwn","getStaticVariant","count","every","key","TextItemContent","t0","$","_c","handleRef","onAppearanceCommit","t1","t2","t3","t4","t5","t6","ref","labelRef","tooltipRef","t7","t8","props","t9","element","current","qa","textProps","variant","shouldMeasure","refreshOverflow","t10","t11","t12","t13","mods","t14","t15","children","t16","TextItem","HTMLElement","restProps","renderWithTooltip","isAutoTooltipEnabled","scheduleOverflowCheck","processedChildren","renderElement","tooltipTriggerProps","eventProps","displayName","TextItemWithNativeLink","_c"],"sources":["../../../../src/components/content/TextItem/TextItem.tsx"],"sourcesContent":["import {\n BASE_STYLES,\n COLOR_STYLES,\n filterBaseProps,\n mergeStyles,\n Styles,\n tasty,\n TEXT_STYLES,\n} from '@tenphi/tasty';\nimport {\n AnchorHTMLAttributes,\n forwardRef,\n ForwardRefExoticComponent,\n HTMLAttributes,\n Ref,\n RefAttributes,\n RefObject,\n useEffectEvent,\n useLayoutEffect,\n} from 'react';\nimport { PositionProps } from 'react-aria';\n\nimport { extractStyles } from '../../../utils/styles';\nimport { highlightText } from '../highlightText';\nimport {\n CubeTextProps,\n TEXT_DEFAULT_STYLES,\n TEXT_PROP_MAP,\n useTextProps,\n} from '../Text';\nimport { AutoTooltipValue, useAutoTooltip } from '../use-auto-tooltip';\n\nconst STYLE_LIST = [...BASE_STYLES, ...TEXT_STYLES, ...COLOR_STYLES] as const;\n\n/**\n * TextItem truncates to one line with an ellipsis, so Text's `ellipsis` and\n * `nowrap` have nothing to switch.\n */\nexport interface CubeTextItemProps extends Omit<\n CubeTextProps,\n 'ellipsis' | 'nowrap'\n> {\n /**\n * String to highlight within children.\n * Only works when children is a plain string.\n */\n highlight?: string;\n /**\n * Whether highlight matching is case-sensitive.\n * @default false\n */\n highlightCaseSensitive?: boolean;\n /**\n * Custom styles for highlighted text.\n */\n highlightStyles?: Styles;\n /**\n * Tooltip content and configuration:\n * - string: simple tooltip text\n * - true: auto tooltip on overflow (shows children as tooltip when truncated)\n * - object: advanced configuration with optional auto property\n * @default true\n */\n tooltip?: AutoTooltipValue;\n /**\n * Default tooltip placement.\n * @default \"top\"\n */\n tooltipPlacement?: PositionProps['placement'];\n}\n\nconst TEXT_ITEM_STYLES = {\n display: 'inline-block',\n verticalAlign: 'bottom',\n width: 'max 100%',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n} satisfies Styles;\n\nconst NATIVE_LINK_STYLES: Styles = {\n // The child native target takes presses while this span keeps hover\n // ownership for its truncation tooltip.\n position: { '': undefined, 'native-link': 'relative' },\n zIndex: { '': undefined, 'native-link': 1 },\n};\n\nconst TextItemElement = tasty({\n as: 'span',\n styles: TEXT_DEFAULT_STYLES,\n variants: {\n plain: TEXT_ITEM_STYLES,\n table: mergeStyles(TEXT_ITEM_STYLES, { preset: 't3' }),\n nativePlain: mergeStyles(TEXT_ITEM_STYLES, NATIVE_LINK_STYLES),\n nativeTable: mergeStyles(TEXT_ITEM_STYLES, NATIVE_LINK_STYLES, {\n preset: 't3',\n }),\n },\n});\n\nconst NativeTextLink = tasty({\n as: 'a',\n styles: {\n position: 'absolute',\n inset: 0,\n zIndex: 0,\n outline: 0,\n },\n});\n\ninterface TextItemWithNativeLinkProps extends CubeTextItemProps {\n nativeLinkProps?: AnchorHTMLAttributes<HTMLAnchorElement>;\n}\n\nconst TEXT_ITEM_STYLE_KEYS = Object.keys(TEXT_ITEM_STYLES) as Array<\n keyof typeof TEXT_ITEM_STYLES\n>;\n\n/** Style merging copies state maps, so identity cannot recognize the defaults. */\nfunction matchesNativeState(value: unknown, expected: string | number) {\n if (value == null || typeof value !== 'object' || Array.isArray(value))\n return false;\n\n const states = value as Record<string, unknown>;\n return (\n Object.keys(states).length === 2 &&\n Object.hasOwn(states, '') &&\n Object.hasOwn(states, 'native-link') &&\n states[''] === undefined &&\n states['native-link'] === expected\n );\n}\n\nfunction getStaticVariant(styles: Styles) {\n const count = Object.keys(styles).length;\n\n if (\n !TEXT_ITEM_STYLE_KEYS.every((key) => styles[key] === TEXT_ITEM_STYLES[key])\n ) {\n return;\n }\n\n if (count === TEXT_ITEM_STYLE_KEYS.length) return 'plain';\n if (count === TEXT_ITEM_STYLE_KEYS.length + 1 && styles.preset === 't3')\n return 'table';\n\n if (\n !matchesNativeState(styles.position, 'relative') ||\n !matchesNativeState(styles.zIndex, 1)\n ) {\n return;\n }\n\n if (count === TEXT_ITEM_STYLE_KEYS.length + 2) return 'nativePlain';\n if (count === TEXT_ITEM_STYLE_KEYS.length + 3 && styles.preset === 't3')\n return 'nativeTable';\n}\n\n/** Own the DOM ref outside the tooltip's render prop so Compiler can retain it. */\nfunction TextItemContent({\n ref,\n labelRef,\n tooltipRef,\n onAppearanceCommit,\n nativeLinkProps,\n ...props\n}: CubeTextProps & {\n ref?: Ref<HTMLElement>;\n labelRef: (element: HTMLElement | null) => void;\n tooltipRef?: RefObject<HTMLElement | null>;\n onAppearanceCommit?: () => void;\n nativeLinkProps?: AnchorHTMLAttributes<HTMLAnchorElement>;\n}) {\n const handleRef = (element: HTMLElement | null) => {\n if (typeof ref === 'function') ref(element);\n else if (ref) ref.current = element;\n\n if (tooltipRef) tooltipRef.current = element;\n\n labelRef(element);\n };\n\n // Match tasty(Text)'s prop/style merge before Text applies its slot. A reset\n // here removes the TextItem default and restores Text's native default.\n const textProps = useTextProps({\n qa: 'TextItem',\n ...props,\n as: props.as ?? undefined,\n element: props.element || undefined,\n styles: mergeStyles(\n TEXT_ITEM_STYLES,\n nativeLinkProps ? NATIVE_LINK_STYLES : undefined,\n props.styles,\n ),\n });\n const variant = getStaticVariant(textProps.styles);\n\n const shouldMeasure = !!onAppearanceCommit;\n const refreshOverflow = useEffectEvent(() => onAppearanceCommit?.());\n\n // A fixed box can change its text width without a ResizeObserver delivery.\n // Queue after its props/slot commit, as the former ref reattachment did.\n useLayoutEffect(() => {\n if (shouldMeasure) refreshOverflow();\n }, [textProps, shouldMeasure]);\n\n // Reuse Tasty's static-style cache for common labels, with one native owner\n // across style/slot changes so a focused label never remounts for styling.\n return (\n <TextItemElement\n {...textProps}\n mods={{ ...textProps.mods, 'native-link': !!nativeLinkProps }}\n variant={variant}\n styles={variant ? undefined : textProps.styles}\n ref={handleRef}\n >\n {nativeLinkProps ? (\n <>\n {textProps.children}\n <NativeTextLink\n {...nativeLinkProps}\n data-element=\"NativeLink\"\n aria-hidden={true}\n tabIndex={-1}\n children={undefined}\n />\n </>\n ) : (\n textProps.children\n )}\n </TextItemElement>\n );\n}\n\nexport const TextItem = forwardRef<HTMLElement, CubeTextItemProps>(\n function TextItem(props, ref) {\n const {\n children,\n highlight,\n highlightCaseSensitive = false,\n highlightStyles,\n tooltip = true,\n tooltipPlacement = 'top',\n nativeLinkProps,\n ...restProps\n } = props as TextItemWithNativeLinkProps;\n\n // Extract style props (preset, color, etc.) to pass via styles prop\n const styles = extractStyles(restProps, STYLE_LIST, {}, TEXT_PROP_MAP);\n\n const {\n labelRef,\n renderWithTooltip,\n isAutoTooltipEnabled,\n scheduleOverflowCheck,\n } = useAutoTooltip({ tooltip, children });\n\n // Process children with highlight if applicable\n const processedChildren =\n typeof children === 'string' && highlight\n ? highlightText(\n children,\n highlight,\n highlightCaseSensitive,\n highlightStyles,\n )\n : children;\n\n const renderElement = (\n tooltipTriggerProps?: HTMLAttributes<HTMLElement>,\n tooltipRef?: RefObject<HTMLElement>,\n ) => {\n return (\n <TextItemContent\n {...filterBaseProps(restProps, { eventProps: true })}\n {...tooltipTriggerProps}\n ref={ref}\n labelRef={labelRef}\n tooltipRef={tooltipRef}\n nativeLinkProps={nativeLinkProps}\n onAppearanceCommit={\n isAutoTooltipEnabled ? scheduleOverflowCheck : undefined\n }\n styles={styles}\n >\n {processedChildren}\n </TextItemContent>\n );\n };\n\n return renderWithTooltip(renderElement, tooltipPlacement);\n },\n);\n\nTextItem.displayName = 'TextItem';\n\n/** @private Retains text hover ownership above a stretched native row link. */\nexport const TextItemWithNativeLink = TextItem as ForwardRefExoticComponent<\n TextItemWithNativeLinkProps & RefAttributes<HTMLElement>\n>;\n"],"mappings":";;;;;;;;;;AAgCA,MAAMyB,aAAa;CAAC,GAAGzB;CAAa,GAAGM;CAAa,GAAGL;AAA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,aAAa,YAApBhF,YACIX,cACE2F,UACAhF,WACAC,wBACAC,eAEK,IAPX8E;EAOY/B,EAAA,KAAA+B;EAAA/B,EAAA,KAAAjD;EAAAiD,EAAA,KAAAhD;EAAAgD,EAAA,KAAA/C;EAAA+C,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CARd,MAAAuC,oBACEhC;CASF,MAAAiC,iBAAsBC,qBAAA7B,eAKlB,oBAAC,iBAAD;EAAgB,GACVxF,gBAAgB+G,WAAW,EAAAO,YAAc,KAAK,CAAC;EAAC,GAChDD;EACC/B;EACKC;EACEC;EACKhC;EAEf,oBAAAyD,uBAAAC,wBAAAzE,KAAAA;EAEMI;EAEPsE,UAAAA;CAZa,CAAA;CAelB,OAEKH,kBAAkBI,eAAerF,gBAAgB;AAAC,CAE7D;AAEA8E,SAASU,cAAc;;AAGvB,MAAaC,yBAAyBX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { TEXT_PROP_MAP } from "./Text.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
//#region src/components/content/Tree/checked-keys.ts
|
|
3
3
|
/**
|
|
4
4
|
* Pure checkbox cascade for a tree: which keys are fully checked and which
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
//#region src/components/content/Tree/rowId.ts
|
|
3
3
|
/**
|
|
4
4
|
* The DOM id of the row with `key` in the tree whose id is `treeId`, for the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { Item as _Item } from "../Item/Item.js";
|
|
3
3
|
import { Action } from "../../actions/Action/Action.js";
|
|
4
4
|
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
//#region src/components/content/Tree/tree-index.ts
|
|
3
3
|
/**
|
|
4
4
|
* A node's plain-text label: its `textValue`, else its `title` when that
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { deriveCheckedSets, toggleCheckedKey } from "./checked-keys.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { isDevEnvOrTest } from "../../../utils/is-dev-env.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { Text as _Text } from "./Text.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/content/highlightText.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-22602ec | Cube Dev Team */
|
|
2
2
|
import { TooltipProvider } from "../overlays/Tooltip/TooltipProvider.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -40,7 +40,8 @@ function queueOverflowCheck(check) {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Whether the tooltip value asks to detect overflow on its own. What it
|
|
43
|
-
* measures is decided separately
|
|
43
|
+
* measures is decided separately: overflow detection measures text, so only a
|
|
44
|
+
* string label or description takes part.
|
|
44
45
|
*/
|
|
45
46
|
function allowsAutoTooltip(tooltip) {
|
|
46
47
|
if (tooltip === true) return true;
|
|
@@ -51,37 +52,6 @@ function allowsAutoTooltip(tooltip) {
|
|
|
51
52
|
return false;
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
|
-
* The tooltip's own title when it still waits for overflow (`{ title, auto:
|
|
55
|
-
* true }`), or `undefined`.
|
|
56
|
-
*/
|
|
57
|
-
function getOwnAutoTitle(tooltip) {
|
|
58
|
-
if (typeof tooltip !== "object" || tooltip.auto !== true) return void 0;
|
|
59
|
-
return tooltip.title || void 0;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Whether a label or description takes part in overflow detection.
|
|
63
|
-
*
|
|
64
|
-
* Without a title of its own, the tooltip shows the text that is cut off, so
|
|
65
|
-
* only a string part is measured. With one, it never shows the part, so a part
|
|
66
|
-
* of any kind is measured: an element label, such as a coloured commit hash
|
|
67
|
-
* followed by its message, gets a tooltip that appears only when it is cut off.
|
|
68
|
-
* Only the part's own box is compared, so a child that cuts off its own text
|
|
69
|
-
* inside it does not count.
|
|
70
|
-
*/
|
|
71
|
-
function isMeasured(part, ownTitle) {
|
|
72
|
-
return ownTitle ? part != null : typeof part === "string";
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* What a measured part's re-check is keyed on. Text can change its overflow
|
|
76
|
-
* without resizing the observed box, so a string part is keyed by its text. Any
|
|
77
|
-
* other part is keyed by the tooltip's own title, which callers derive from the
|
|
78
|
-
* same text, rather than by an element that is new on every render.
|
|
79
|
-
*/
|
|
80
|
-
function getMeasureKey(part, ownTitle) {
|
|
81
|
-
if (typeof part === "string") return part;
|
|
82
|
-
return typeof ownTitle === "string" ? ownTitle : void 0;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
55
|
* What the auto tooltip shows: the text that is cut off, and nothing the row
|
|
86
56
|
* already shows in full. When both parts are, the description goes below the
|
|
87
57
|
* label as the tooltip's `Description`, styled as secondary text.
|
|
@@ -148,7 +118,7 @@ function observeMeasuredNodes(measured, onResize) {
|
|
|
148
118
|
if (description) measured.observer.observe(description);
|
|
149
119
|
}
|
|
150
120
|
function useAutoTooltip(t0) {
|
|
151
|
-
const $ = c(
|
|
121
|
+
const $ = c(44);
|
|
152
122
|
const { tooltip, children, description, labelProps, isDynamicLabel: t1, labelRef: labelRefOption, descriptionRef: descriptionRefOption } = t0;
|
|
153
123
|
const isDynamicLabel = t1 === void 0 ? false : t1;
|
|
154
124
|
let t2;
|
|
@@ -158,9 +128,8 @@ function useAutoTooltip(t0) {
|
|
|
158
128
|
$[1] = t2;
|
|
159
129
|
} else t2 = $[1];
|
|
160
130
|
const allowsAuto = t2;
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
const isDescriptionMeasured = allowsAuto && isMeasured(description, ownTitle);
|
|
131
|
+
const isLabelMeasured = allowsAuto && typeof children === "string";
|
|
132
|
+
const isDescriptionMeasured = allowsAuto && typeof description === "string";
|
|
164
133
|
const isAutoTooltipEnabled = isLabelMeasured || isDescriptionMeasured;
|
|
165
134
|
const externalLabelRef = labelProps?.ref;
|
|
166
135
|
const [truncation, setTruncation] = useState("none");
|
|
@@ -186,29 +155,27 @@ function useAutoTooltip(t0) {
|
|
|
186
155
|
} else t4 = $[3];
|
|
187
156
|
const setVerdict = t4;
|
|
188
157
|
let t5;
|
|
189
|
-
if ($[4]
|
|
158
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
190
159
|
t5 = () => {
|
|
191
160
|
const { label, description: description_0 } = measuredRef.current;
|
|
192
161
|
if (!label && !description_0) return;
|
|
193
162
|
setVerdict(measureTruncation(label, description_0));
|
|
194
163
|
};
|
|
195
|
-
$[4] =
|
|
196
|
-
|
|
197
|
-
} else t5 = $[5];
|
|
164
|
+
$[4] = t5;
|
|
165
|
+
} else t5 = $[4];
|
|
198
166
|
const checkOverflow = t5;
|
|
199
167
|
let t6;
|
|
200
|
-
if ($[
|
|
168
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
201
169
|
t6 = () => {
|
|
202
170
|
queueOverflowCheck(checkOverflow);
|
|
203
171
|
};
|
|
204
|
-
$[
|
|
205
|
-
|
|
206
|
-
} else t6 = $[7];
|
|
172
|
+
$[5] = t6;
|
|
173
|
+
} else t6 = $[5];
|
|
207
174
|
const scheduleOverflowCheck = t6;
|
|
208
|
-
const measuredLabel = isLabelMeasured ?
|
|
209
|
-
const measuredDescription = isDescriptionMeasured ?
|
|
175
|
+
const measuredLabel = isLabelMeasured ? children : void 0;
|
|
176
|
+
const measuredDescription = isDescriptionMeasured ? description : void 0;
|
|
210
177
|
let t7;
|
|
211
|
-
if ($[
|
|
178
|
+
if ($[6] !== isAutoTooltipEnabled) {
|
|
212
179
|
t7 = () => {
|
|
213
180
|
if (isAutoTooltipEnabled) {
|
|
214
181
|
scheduleOverflowCheck();
|
|
@@ -216,13 +183,11 @@ function useAutoTooltip(t0) {
|
|
|
216
183
|
}
|
|
217
184
|
setVerdict("none");
|
|
218
185
|
};
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
|
|
222
|
-
$[11] = t7;
|
|
223
|
-
} else t7 = $[11];
|
|
186
|
+
$[6] = isAutoTooltipEnabled;
|
|
187
|
+
$[7] = t7;
|
|
188
|
+
} else t7 = $[7];
|
|
224
189
|
let t8;
|
|
225
|
-
if ($[
|
|
190
|
+
if ($[8] !== isAutoTooltipEnabled || $[9] !== isDescriptionMeasured || $[10] !== isLabelMeasured || $[11] !== measuredDescription || $[12] !== measuredLabel) {
|
|
226
191
|
t8 = [
|
|
227
192
|
isAutoTooltipEnabled,
|
|
228
193
|
isLabelMeasured,
|
|
@@ -232,18 +197,16 @@ function useAutoTooltip(t0) {
|
|
|
232
197
|
scheduleOverflowCheck,
|
|
233
198
|
setVerdict
|
|
234
199
|
];
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
|
|
242
|
-
$[19] = t8;
|
|
243
|
-
} else t8 = $[19];
|
|
200
|
+
$[8] = isAutoTooltipEnabled;
|
|
201
|
+
$[9] = isDescriptionMeasured;
|
|
202
|
+
$[10] = isLabelMeasured;
|
|
203
|
+
$[11] = measuredDescription;
|
|
204
|
+
$[12] = measuredLabel;
|
|
205
|
+
$[13] = t8;
|
|
206
|
+
} else t8 = $[13];
|
|
244
207
|
useEffect(t7, t8);
|
|
245
208
|
let t9;
|
|
246
|
-
if ($[
|
|
209
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
247
210
|
t9 = (part, element) => {
|
|
248
211
|
const measured = measuredRef.current;
|
|
249
212
|
const previous = measured[part];
|
|
@@ -262,52 +225,48 @@ function useAutoTooltip(t0) {
|
|
|
262
225
|
if (!element) return;
|
|
263
226
|
scheduleOverflowCheck();
|
|
264
227
|
};
|
|
265
|
-
$[
|
|
266
|
-
|
|
267
|
-
$[22] = t9;
|
|
268
|
-
} else t9 = $[22];
|
|
228
|
+
$[14] = t9;
|
|
229
|
+
} else t9 = $[14];
|
|
269
230
|
const attachMeasuredNode = t9;
|
|
270
231
|
let t10;
|
|
271
|
-
if ($[
|
|
232
|
+
if ($[15] !== externalLabelRef || $[16] !== isLabelMeasured || $[17] !== labelRefOption) {
|
|
272
233
|
t10 = (element_0) => {
|
|
273
234
|
assignRef(externalLabelRef, element_0);
|
|
274
235
|
assignRef(labelRefOption, element_0);
|
|
275
236
|
attachMeasuredNode("label", isLabelMeasured ? element_0 : null);
|
|
276
237
|
};
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
|
|
282
|
-
} else t10 = $[27];
|
|
238
|
+
$[15] = externalLabelRef;
|
|
239
|
+
$[16] = isLabelMeasured;
|
|
240
|
+
$[17] = labelRefOption;
|
|
241
|
+
$[18] = t10;
|
|
242
|
+
} else t10 = $[18];
|
|
283
243
|
const handleLabelElementRef = t10;
|
|
284
244
|
let t11;
|
|
285
|
-
if ($[
|
|
245
|
+
if ($[19] !== descriptionRefOption || $[20] !== isDescriptionMeasured) {
|
|
286
246
|
t11 = (element_1) => {
|
|
287
247
|
assignRef(descriptionRefOption, element_1);
|
|
288
248
|
attachMeasuredNode("description", isDescriptionMeasured ? element_1 : null);
|
|
289
249
|
};
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
|
|
294
|
-
} else t11 = $[31];
|
|
250
|
+
$[19] = descriptionRefOption;
|
|
251
|
+
$[20] = isDescriptionMeasured;
|
|
252
|
+
$[21] = t11;
|
|
253
|
+
} else t11 = $[21];
|
|
295
254
|
const handleDescriptionElementRef = t11;
|
|
296
255
|
let t12;
|
|
297
|
-
if ($[
|
|
256
|
+
if ($[22] !== labelProps) {
|
|
298
257
|
t12 = labelProps || {};
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
} else t12 = $[
|
|
258
|
+
$[22] = labelProps;
|
|
259
|
+
$[23] = t12;
|
|
260
|
+
} else t12 = $[23];
|
|
302
261
|
let finalLabelProps;
|
|
303
|
-
if ($[
|
|
262
|
+
if ($[24] !== t12) {
|
|
304
263
|
const { ref: _labelPropsRef, ...t13 } = t12;
|
|
305
264
|
finalLabelProps = t13;
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
} else finalLabelProps = $[
|
|
265
|
+
$[24] = t12;
|
|
266
|
+
$[25] = finalLabelProps;
|
|
267
|
+
} else finalLabelProps = $[25];
|
|
309
268
|
let t13;
|
|
310
|
-
if ($[
|
|
269
|
+
if ($[26] !== children || $[27] !== description || $[28] !== isDynamicLabel || $[29] !== labelProps || $[30] !== tooltip || $[31] !== truncation) {
|
|
311
270
|
t13 = resolveTooltip({
|
|
312
271
|
tooltip,
|
|
313
272
|
children,
|
|
@@ -316,18 +275,18 @@ function useAutoTooltip(t0) {
|
|
|
316
275
|
isDynamicLabel,
|
|
317
276
|
truncation
|
|
318
277
|
});
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
} else t13 = $[
|
|
278
|
+
$[26] = children;
|
|
279
|
+
$[27] = description;
|
|
280
|
+
$[28] = isDynamicLabel;
|
|
281
|
+
$[29] = labelProps;
|
|
282
|
+
$[30] = tooltip;
|
|
283
|
+
$[31] = truncation;
|
|
284
|
+
$[32] = t13;
|
|
285
|
+
} else t13 = $[32];
|
|
327
286
|
const resolvedTooltip = t13;
|
|
328
287
|
const isTooltipActive = !!resolvedTooltip && resolvedTooltip.isDisabled !== true;
|
|
329
288
|
let t14;
|
|
330
|
-
if ($[
|
|
289
|
+
if ($[33] !== resolvedTooltip) {
|
|
331
290
|
t14 = (renderElement, defaultTooltipPlacement) => {
|
|
332
291
|
if (!resolvedTooltip) return renderElement();
|
|
333
292
|
return /* @__PURE__ */ jsx(TooltipProvider, {
|
|
@@ -336,14 +295,14 @@ function useAutoTooltip(t0) {
|
|
|
336
295
|
children: (triggerProps, ref) => renderElement(triggerProps, ref)
|
|
337
296
|
});
|
|
338
297
|
};
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
} else t14 = $[
|
|
298
|
+
$[33] = resolvedTooltip;
|
|
299
|
+
$[34] = t14;
|
|
300
|
+
} else t14 = $[34];
|
|
342
301
|
const renderWithTooltip = t14;
|
|
343
302
|
const t15 = truncation !== "none";
|
|
344
303
|
const t16 = !!tooltip;
|
|
345
304
|
let t17;
|
|
346
|
-
if ($[
|
|
305
|
+
if ($[35] !== finalLabelProps || $[36] !== handleDescriptionElementRef || $[37] !== handleLabelElementRef || $[38] !== isAutoTooltipEnabled || $[39] !== isTooltipActive || $[40] !== renderWithTooltip || $[41] !== t15 || $[42] !== t16) {
|
|
347
306
|
t17 = {
|
|
348
307
|
labelRef: handleLabelElementRef,
|
|
349
308
|
descriptionRef: handleDescriptionElementRef,
|
|
@@ -355,17 +314,16 @@ function useAutoTooltip(t0) {
|
|
|
355
314
|
renderWithTooltip,
|
|
356
315
|
scheduleOverflowCheck
|
|
357
316
|
};
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
|
|
368
|
-
} else t17 = $[54];
|
|
317
|
+
$[35] = finalLabelProps;
|
|
318
|
+
$[36] = handleDescriptionElementRef;
|
|
319
|
+
$[37] = handleLabelElementRef;
|
|
320
|
+
$[38] = isAutoTooltipEnabled;
|
|
321
|
+
$[39] = isTooltipActive;
|
|
322
|
+
$[40] = renderWithTooltip;
|
|
323
|
+
$[41] = t15;
|
|
324
|
+
$[42] = t16;
|
|
325
|
+
$[43] = t17;
|
|
326
|
+
} else t17 = $[43];
|
|
369
327
|
return t17;
|
|
370
328
|
}
|
|
371
329
|
//#endregion
|