@cube-dev/ui-kit 0.0.0-canary-84c1a2c → 0.0.0-canary-afff9bd
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/GlobalStyles.js.map +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/ButtonSplit.js.map +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/CommandMenu.js.map +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js.map +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/Menu/styled.js.map +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/Alert.js.map +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/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 +1 -1
- 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/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +10 -11
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/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/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.d.ts +34 -4
- package/dist/components/content/Result/Result.js +199 -95
- package/dist/components/content/Result/Result.js.map +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Tag/Tag.js.map +1 -1
- package/dist/components/content/Text.d.ts +14 -14
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.d.ts +2 -0
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Title.js.map +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/styled.js +1 -1
- package/dist/components/content/Tree/styled.js.map +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/DataTable/DataTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +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 +10 -8
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-order.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-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js.map +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.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/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +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/Picker/Picker.js.map +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/Select/Select.js.map +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js.map +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/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +2 -2
- package/dist/components/layout/Board/Board.js.map +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +4 -4
- package/dist/components/layout/Board/WidgetHost.js.map +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/placement.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.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/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/CalendarCell.js.map +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/PeriodGrid.js.map +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/CubeLogo/CubeLogo.js.map +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +2 -2
- package/dist/components/overlays/Modal/Popover.js.map +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Tray.js.map +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +17 -1
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/escapePropagation.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/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.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/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/styles.js.map +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +3 -3
- package/docs/components/content/Result.md +202 -12
- package/docs/components/content/Title.md +1 -0
- package/docs/tasty/dsl.md +6 -28
- package/docs/tasty/styles.md +0 -18
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemAction.js","names":["FocusableRef","BaseProps","Styles","tasty","ComponentProps","forwardRef","HTMLAttributes","ReactNode","RefObject","CURRENT_CLEAR_STYLES","CURRENT_OUTLINE_STYLES","CURRENT_PRIMARY_STYLES","DANGER_CLEAR_STYLES","DANGER_OUTLINE_STYLES","DANGER_PRIMARY_STYLES","DEFAULT_CLEAR_STYLES","DEFAULT_OUTLINE_STYLES","DEFAULT_PRIMARY_STYLES","ITEM_ACTION_BASE_STYLES","NOTE_CLEAR_STYLES","NOTE_OUTLINE_STYLES","NOTE_PRIMARY_STYLES","SPECIAL_CLEAR_STYLES","SPECIAL_OUTLINE_STYLES","SPECIAL_PRIMARY_STYLES","SUCCESS_CLEAR_STYLES","SUCCESS_OUTLINE_STYLES","SUCCESS_PRIMARY_STYLES","WARNING_CLEAR_STYLES","WARNING_OUTLINE_STYLES","WARNING_PRIMARY_STYLES","CheckIcon","LoadingIcon","mergeProps","TooltipProvider","useItemActionContext","CubeUseActionProps","useAction","CubeItemActionProps","Omit","icon","children","isLoading","isSelected","type","theme","tooltip","title","styles","tabIndex","ItemActionVariant","ItemActionElement","qa","recipe","outline","focused","outlineOffset","cursor","disabled","preset","padding","Icon","$","variants","ItemAction","allProps","ref","_c","contextType","disableActionsFocus","isDisabled","contextIsDisabled","isDisabledProp","mods","rest","t0","t1","t2","t3","undefined","isDisabledInherited","hasCheckmark","t4","finalIcon","t5","t6","t7","t8","checkmark","selected","loading","context","finalMods","ariaLabel","t9","htmlType","actionProps","finalTabIndex","showTooltip","tooltipContent","t10","tooltipProps","_title","t11","finalType","tooltipTriggerProps","tooltipRef","mergedProps","element","current","actionRef","renderButton","t12","triggerProps","tooltipRef_0","t13","ItemActionProps"],"sources":["../../../../src/components/actions/ItemAction/ItemAction.tsx"],"sourcesContent":["import { FocusableRef } from '@react-types/shared';\nimport { BaseProps, Styles, tasty } from '@tenphi/tasty';\nimport {\n ComponentProps,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefObject,\n} from 'react';\n\nimport {\n CURRENT_CLEAR_STYLES,\n CURRENT_OUTLINE_STYLES,\n CURRENT_PRIMARY_STYLES,\n DANGER_CLEAR_STYLES,\n DANGER_OUTLINE_STYLES,\n DANGER_PRIMARY_STYLES,\n DEFAULT_CLEAR_STYLES,\n DEFAULT_OUTLINE_STYLES,\n DEFAULT_PRIMARY_STYLES,\n ITEM_ACTION_BASE_STYLES,\n NOTE_CLEAR_STYLES,\n NOTE_OUTLINE_STYLES,\n NOTE_PRIMARY_STYLES,\n SPECIAL_CLEAR_STYLES,\n SPECIAL_OUTLINE_STYLES,\n SPECIAL_PRIMARY_STYLES,\n SUCCESS_CLEAR_STYLES,\n SUCCESS_OUTLINE_STYLES,\n SUCCESS_PRIMARY_STYLES,\n WARNING_CLEAR_STYLES,\n WARNING_OUTLINE_STYLES,\n WARNING_PRIMARY_STYLES,\n} from '../../../data/item-themes';\nimport { CheckIcon } from '../../../icons/CheckIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { mergeProps } from '../../../utils/react';\nimport { TooltipProvider } from '../../overlays/Tooltip/TooltipProvider';\nimport { useItemActionContext } from '../ItemActionContext';\nimport { CubeUseActionProps, useAction } from '../use-action';\n\nexport interface CubeItemActionProps\n extends Omit<CubeUseActionProps, 'as' | 'htmlType'>,\n Omit<BaseProps, 'as'> {\n icon?: ReactNode | 'checkmark';\n children?: ReactNode;\n isLoading?: boolean;\n isSelected?: boolean;\n type?: 'primary' | 'outline' | 'clear' | (string & {});\n theme?:\n | 'current'\n | 'default'\n | 'danger'\n | 'success'\n | 'warning'\n | 'note'\n | 'special'\n | (string & {});\n tooltip?:\n | string\n | (Omit<ComponentProps<typeof TooltipProvider>, 'children'> & {\n title?: ReactNode;\n });\n styles?: Styles;\n tabIndex?: number;\n}\n\ntype ItemActionVariant =\n // Inherited-color theme — see the CURRENT THEME section of `item-themes`.\n | 'current.primary'\n | 'current.outline'\n | 'current.clear'\n | 'default.primary'\n | 'default.outline'\n | 'default.clear'\n | 'danger.primary'\n | 'danger.outline'\n | 'danger.clear'\n | 'success.primary'\n | 'success.outline'\n | 'success.clear'\n | 'warning.primary'\n | 'warning.outline'\n | 'warning.clear'\n | 'note.primary'\n | 'note.outline'\n | 'note.clear'\n | 'special.primary'\n | 'special.outline'\n | 'special.clear';\n\nconst ItemActionElement = tasty({\n qa: 'ItemAction',\n styles: {\n // eslint-disable-next-line tasty/no-style-spread -- action base shared with ItemBadge\n ...ITEM_ACTION_BASE_STYLES,\n recipe: 'reset button',\n // Every variant below defines its own ring and overrides this one, which is\n // kept as the floor for a custom `type` that resolves to no variant at all.\n // It uses the same `#primary-accent-text` as every variant in\n // `item-themes.ts`.\n outline: {\n '': '0 #primary-accent-text.0',\n focused: '1bw #primary-accent-text',\n },\n outlineOffset: 1,\n cursor: { '': '$pointer', disabled: 'default' },\n preset: {\n '': 't4',\n 'size=xlarge': 't3m',\n },\n padding: {\n '': '0 $inline-padding',\n 'has-icon': 0,\n 'has-icon & has-label': '$inline-padding right',\n },\n\n '$inline-padding': {\n '': 'max($min-inline-padding, (($action-size - 1lh - 2bw) / 2 + $inline-compensation))',\n 'size=inline': '.25x',\n },\n '$inline-compensation': '.5x',\n '$min-inline-padding': '(.5x - 1bw)',\n '$local-icon-size': '$icon-size',\n\n Icon: {\n $: '>',\n // eslint-disable-next-line tasty/no-style-spread -- Icon base shared with ItemBadge\n ...(ITEM_ACTION_BASE_STYLES.Icon as Styles),\n '$icon-size': 'min($local-icon-size, ($action-size - .25x))',\n },\n },\n variants: {\n // Current theme — colors mixed from the inherited `currentcolor`. The\n // default `clear` flavour is borderless, so an action does not put a resting\n // chip on every row.\n 'current.primary': CURRENT_PRIMARY_STYLES,\n 'current.outline': CURRENT_OUTLINE_STYLES,\n 'current.clear': CURRENT_CLEAR_STYLES,\n\n // Default theme\n 'default.primary': DEFAULT_PRIMARY_STYLES,\n 'default.outline': DEFAULT_OUTLINE_STYLES,\n 'default.clear': DEFAULT_CLEAR_STYLES,\n\n // Danger theme\n 'danger.primary': DANGER_PRIMARY_STYLES,\n 'danger.outline': DANGER_OUTLINE_STYLES,\n 'danger.clear': DANGER_CLEAR_STYLES,\n\n // Success theme\n 'success.primary': SUCCESS_PRIMARY_STYLES,\n 'success.outline': SUCCESS_OUTLINE_STYLES,\n 'success.clear': SUCCESS_CLEAR_STYLES,\n\n // Warning theme\n 'warning.primary': WARNING_PRIMARY_STYLES,\n 'warning.outline': WARNING_OUTLINE_STYLES,\n 'warning.clear': WARNING_CLEAR_STYLES,\n\n // Note theme\n 'note.primary': NOTE_PRIMARY_STYLES,\n 'note.outline': NOTE_OUTLINE_STYLES,\n 'note.clear': NOTE_CLEAR_STYLES,\n\n // Special theme\n 'special.primary': SPECIAL_PRIMARY_STYLES,\n 'special.outline': SPECIAL_OUTLINE_STYLES,\n 'special.clear': SPECIAL_CLEAR_STYLES,\n },\n});\n\nexport const ItemAction = forwardRef(function ItemAction(\n allProps: CubeItemActionProps,\n ref: FocusableRef<HTMLElement>,\n) {\n const {\n type: contextType,\n disableActionsFocus,\n isDisabled: contextIsDisabled,\n } = useItemActionContext();\n\n const {\n // Borderless by default: an action sits inside a row, where a resting chip\n // on every one of them would read as noise.\n type = 'clear',\n // The `current` theme derives every color from the row's inherited\n // `currentcolor`, so one default covers every host type and theme — no need\n // to mirror the row's own `theme` from context. An action that names a theme\n // is asking to paint itself rather than match its host, and gets it.\n theme = 'current',\n icon,\n children,\n isLoading = false,\n isSelected = false,\n tooltip,\n mods,\n styles,\n isDisabled: isDisabledProp,\n ...rest\n } = allProps;\n\n // Inherit disabled state from context, but allow local override\n const isDisabled = isDisabledProp ?? contextIsDisabled;\n\n // Whether that disabled state came from the host row rather than this action's\n // own prop. The `current` theme paints from the inherited color, and a\n // disabled host has already faded it — so fading a second time washes the\n // label out. See `CURRENT_ITEM_STYLES.color`.\n const isDisabledInherited = isDisabledProp == null && !!contextIsDisabled;\n\n // Determine if we should show a checkmark\n const hasCheckmark = icon === 'checkmark';\n\n // Determine final icon (loading takes precedence)\n const finalIcon = isLoading ? (\n <LoadingIcon />\n ) : hasCheckmark ? (\n <CheckIcon />\n ) : (\n icon\n );\n\n // Build modifiers\n const finalMods = {\n checkmark: hasCheckmark,\n selected: isSelected,\n loading: isLoading,\n 'has-label': !!children,\n context: !!contextType,\n 'has-icon': !!icon,\n 'inherit-disabled': isDisabledInherited,\n ...mods,\n };\n\n // An explicit label always wins; a tooltip only fills in the accessible name\n // when there isn't one. Rich tooltip content can't serve as a name, so only\n // plain strings are used here.\n const ariaLabel =\n rest['aria-label'] ||\n (typeof tooltip === 'string'\n ? tooltip\n : typeof tooltip === 'object' && typeof tooltip.title === 'string'\n ? tooltip.title\n : undefined);\n\n // Call useAction hook\n const { actionProps } = useAction(\n {\n ...rest,\n isDisabled,\n 'aria-label': ariaLabel,\n mods: finalMods,\n htmlType: 'button',\n },\n ref,\n );\n\n // Set tabIndex when in context\n const finalTabIndex = disableActionsFocus ? -1 : rest.tabIndex;\n\n // Determine if we should show tooltip (icon-only buttons)\n const showTooltip = !children && tooltip;\n\n // Extract tooltip content and props\n const tooltipContent =\n typeof tooltip === 'string'\n ? tooltip\n : typeof tooltip === 'object' && tooltip.title\n ? tooltip.title\n : undefined;\n\n const { title: _title, ...tooltipProps } =\n typeof tooltip === 'object' ? tooltip : {};\n\n const finalType = type;\n\n // Render function that accepts tooltip trigger props and ref\n const renderButton = (\n tooltipTriggerProps?: HTMLAttributes<HTMLElement>,\n tooltipRef?: RefObject<HTMLElement>,\n ) => {\n // Merge tooltip ref with actionProps if provided\n const mergedProps = tooltipRef\n ? mergeProps(actionProps, tooltipTriggerProps || {}, {\n ref: (element: HTMLElement | null) => {\n // Set the tooltip ref\n if (tooltipRef) {\n (tooltipRef as any).current = element;\n }\n // Set the action ref if it exists in actionProps\n const actionRef = (actionProps as any).ref;\n if (actionRef) {\n if (typeof actionRef === 'function') {\n actionRef(element);\n } else {\n actionRef.current = element;\n }\n }\n },\n })\n : mergeProps(actionProps, tooltipTriggerProps || {});\n\n return (\n <ItemActionElement\n {...mergedProps}\n variant={`${theme}.${finalType}` as ItemActionVariant}\n data-theme={theme}\n data-type={finalType}\n tabIndex={finalTabIndex}\n styles={styles}\n >\n {finalIcon && <div data-element=\"Icon\">{finalIcon}</div>}\n {children}\n </ItemActionElement>\n );\n };\n\n // Wrap with tooltip if needed\n if (showTooltip && tooltipContent) {\n return (\n <TooltipProvider title={tooltipContent} {...tooltipProps}>\n {(triggerProps, tooltipRef) => renderButton(triggerProps, tooltipRef)}\n </TooltipProvider>\n );\n }\n\n return renderButton();\n});\n\nexport type { CubeItemActionProps as ItemActionProps };\n"],"mappings":";;;;;;;;;;;;;;AA2FA,MAAMmD,oBAAoBhD,MAAM;CAC9BiD,IAAI;CACJJ,QAAQ;EAEN,GAAG9B;EACHmC,QAAQ;EAKRC,SAAS;GACP,IAAI;GACJC,SAAS;GACV;EACDC,eAAe;EACfC,QAAQ;GAAE,IAAI;GAAYC,UAAU;GAAW;EAC/CC,QAAQ;GACN,IAAI;GACJ,eAAe;GAChB;EACDC,SAAS;GACP,IAAI;GACJ,YAAY;GACZ,wBAAwB;GACzB;EAED,mBAAmB;GACjB,IAAI;GACJ,eAAe;GAChB;EACD,wBAAwB;EACxB,uBAAuB;EACvB,oBAAoB;EAEpBC,MAAM;GACJC,GAAG;GAEH,GAAI5C,wBAAwB2C;GAC5B,c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BhB,OAAAA;IAAc,GAAME;cACzCW;KACe;AAAAlD,KAAA,MAAAkD;AAAAlD,KAAA,MAAAqC;AAAArC,KAAA,MAAAuC;AAAAvC,KAAA,MAAAqD;QAAAA,OAAArD,EAAA;AAAA,SAFlBqD;;CAIH,IAAAH;AAAA,KAAAlD,EAAA,QAAAiD,cAAA;AAEMC,QAAAD,cAAc;AAAAjD,IAAA,MAAAiD;AAAAjD,IAAA,MAAAkD;OAAAA,OAAAlD,EAAA;AAAA,QAAdkD;EACP"}
|
|
1
|
+
{"version":3,"file":"ItemAction.js","names":["FocusableRef","BaseProps","Styles","tasty","ComponentProps","forwardRef","HTMLAttributes","ReactNode","RefObject","CURRENT_CLEAR_STYLES","CURRENT_OUTLINE_STYLES","CURRENT_PRIMARY_STYLES","DANGER_CLEAR_STYLES","DANGER_OUTLINE_STYLES","DANGER_PRIMARY_STYLES","DEFAULT_CLEAR_STYLES","DEFAULT_OUTLINE_STYLES","DEFAULT_PRIMARY_STYLES","ITEM_ACTION_BASE_STYLES","NOTE_CLEAR_STYLES","NOTE_OUTLINE_STYLES","NOTE_PRIMARY_STYLES","SPECIAL_CLEAR_STYLES","SPECIAL_OUTLINE_STYLES","SPECIAL_PRIMARY_STYLES","SUCCESS_CLEAR_STYLES","SUCCESS_OUTLINE_STYLES","SUCCESS_PRIMARY_STYLES","WARNING_CLEAR_STYLES","WARNING_OUTLINE_STYLES","WARNING_PRIMARY_STYLES","CheckIcon","LoadingIcon","mergeProps","TooltipProvider","useItemActionContext","CubeUseActionProps","useAction","CubeItemActionProps","Omit","icon","children","isLoading","isSelected","type","theme","tooltip","title","styles","tabIndex","ItemActionVariant","ItemActionElement","qa","recipe","outline","focused","outlineOffset","cursor","disabled","preset","padding","Icon","$","variants","ItemAction","allProps","ref","_c","contextType","disableActionsFocus","isDisabled","contextIsDisabled","isDisabledProp","mods","rest","t0","t1","t2","t3","undefined","isDisabledInherited","hasCheckmark","t4","finalIcon","t5","t6","t7","t8","checkmark","selected","loading","context","finalMods","ariaLabel","t9","htmlType","actionProps","finalTabIndex","showTooltip","tooltipContent","t10","tooltipProps","_title","t11","finalType","tooltipTriggerProps","tooltipRef","mergedProps","element","current","actionRef","renderButton","t12","triggerProps","tooltipRef_0","t13","ItemActionProps"],"sources":["../../../../src/components/actions/ItemAction/ItemAction.tsx"],"sourcesContent":["import { FocusableRef } from '@react-types/shared';\nimport { BaseProps, Styles, tasty } from '@tenphi/tasty';\nimport {\n ComponentProps,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefObject,\n} from 'react';\n\nimport {\n CURRENT_CLEAR_STYLES,\n CURRENT_OUTLINE_STYLES,\n CURRENT_PRIMARY_STYLES,\n DANGER_CLEAR_STYLES,\n DANGER_OUTLINE_STYLES,\n DANGER_PRIMARY_STYLES,\n DEFAULT_CLEAR_STYLES,\n DEFAULT_OUTLINE_STYLES,\n DEFAULT_PRIMARY_STYLES,\n ITEM_ACTION_BASE_STYLES,\n NOTE_CLEAR_STYLES,\n NOTE_OUTLINE_STYLES,\n NOTE_PRIMARY_STYLES,\n SPECIAL_CLEAR_STYLES,\n SPECIAL_OUTLINE_STYLES,\n SPECIAL_PRIMARY_STYLES,\n SUCCESS_CLEAR_STYLES,\n SUCCESS_OUTLINE_STYLES,\n SUCCESS_PRIMARY_STYLES,\n WARNING_CLEAR_STYLES,\n WARNING_OUTLINE_STYLES,\n WARNING_PRIMARY_STYLES,\n} from '../../../data/item-themes';\nimport { CheckIcon } from '../../../icons/CheckIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { mergeProps } from '../../../utils/react';\nimport { TooltipProvider } from '../../overlays/Tooltip/TooltipProvider';\nimport { useItemActionContext } from '../ItemActionContext';\nimport { CubeUseActionProps, useAction } from '../use-action';\n\nexport interface CubeItemActionProps\n extends Omit<CubeUseActionProps, 'as' | 'htmlType'>,\n Omit<BaseProps, 'as'> {\n icon?: ReactNode | 'checkmark';\n children?: ReactNode;\n isLoading?: boolean;\n isSelected?: boolean;\n type?: 'primary' | 'outline' | 'clear' | (string & {});\n theme?:\n | 'current'\n | 'default'\n | 'danger'\n | 'success'\n | 'warning'\n | 'note'\n | 'special'\n | (string & {});\n tooltip?:\n | string\n | (Omit<ComponentProps<typeof TooltipProvider>, 'children'> & {\n title?: ReactNode;\n });\n styles?: Styles;\n tabIndex?: number;\n}\n\ntype ItemActionVariant =\n // Inherited-color theme — see the CURRENT THEME section of `item-themes`.\n | 'current.primary'\n | 'current.outline'\n | 'current.clear'\n | 'default.primary'\n | 'default.outline'\n | 'default.clear'\n | 'danger.primary'\n | 'danger.outline'\n | 'danger.clear'\n | 'success.primary'\n | 'success.outline'\n | 'success.clear'\n | 'warning.primary'\n | 'warning.outline'\n | 'warning.clear'\n | 'note.primary'\n | 'note.outline'\n | 'note.clear'\n | 'special.primary'\n | 'special.outline'\n | 'special.clear';\n\nconst ItemActionElement = tasty({\n qa: 'ItemAction',\n styles: {\n ...ITEM_ACTION_BASE_STYLES,\n recipe: 'reset button',\n // Every variant below defines its own ring and overrides this one, which is\n // kept as the floor for a custom `type` that resolves to no variant at all.\n // It uses the same `#primary-accent-text` as every variant in\n // `item-themes.ts`.\n outline: {\n '': '0 #primary-accent-text.0',\n focused: '1bw #primary-accent-text',\n },\n outlineOffset: 1,\n cursor: { '': '$pointer', disabled: 'default' },\n preset: {\n '': 't4',\n 'size=xlarge': 't3m',\n },\n padding: {\n '': '0 $inline-padding',\n 'has-icon': 0,\n 'has-icon & has-label': '$inline-padding right',\n },\n\n '$inline-padding': {\n '': 'max($min-inline-padding, (($action-size - 1lh - 2bw) / 2 + $inline-compensation))',\n 'size=inline': '.25x',\n },\n '$inline-compensation': '.5x',\n '$min-inline-padding': '(.5x - 1bw)',\n '$local-icon-size': '$icon-size',\n\n Icon: {\n $: '>',\n ...(ITEM_ACTION_BASE_STYLES.Icon as Styles),\n '$icon-size': 'min($local-icon-size, ($action-size - .25x))',\n },\n },\n variants: {\n // Current theme — colors mixed from the inherited `currentcolor`. The\n // default `clear` flavour is borderless, so an action does not put a resting\n // chip on every row.\n 'current.primary': CURRENT_PRIMARY_STYLES,\n 'current.outline': CURRENT_OUTLINE_STYLES,\n 'current.clear': CURRENT_CLEAR_STYLES,\n\n // Default theme\n 'default.primary': DEFAULT_PRIMARY_STYLES,\n 'default.outline': DEFAULT_OUTLINE_STYLES,\n 'default.clear': DEFAULT_CLEAR_STYLES,\n\n // Danger theme\n 'danger.primary': DANGER_PRIMARY_STYLES,\n 'danger.outline': DANGER_OUTLINE_STYLES,\n 'danger.clear': DANGER_CLEAR_STYLES,\n\n // Success theme\n 'success.primary': SUCCESS_PRIMARY_STYLES,\n 'success.outline': SUCCESS_OUTLINE_STYLES,\n 'success.clear': SUCCESS_CLEAR_STYLES,\n\n // Warning theme\n 'warning.primary': WARNING_PRIMARY_STYLES,\n 'warning.outline': WARNING_OUTLINE_STYLES,\n 'warning.clear': WARNING_CLEAR_STYLES,\n\n // Note theme\n 'note.primary': NOTE_PRIMARY_STYLES,\n 'note.outline': NOTE_OUTLINE_STYLES,\n 'note.clear': NOTE_CLEAR_STYLES,\n\n // Special theme\n 'special.primary': SPECIAL_PRIMARY_STYLES,\n 'special.outline': SPECIAL_OUTLINE_STYLES,\n 'special.clear': SPECIAL_CLEAR_STYLES,\n },\n});\n\nexport const ItemAction = forwardRef(function ItemAction(\n allProps: CubeItemActionProps,\n ref: FocusableRef<HTMLElement>,\n) {\n const {\n type: contextType,\n disableActionsFocus,\n isDisabled: contextIsDisabled,\n } = useItemActionContext();\n\n const {\n // Borderless by default: an action sits inside a row, where a resting chip\n // on every one of them would read as noise.\n type = 'clear',\n // The `current` theme derives every color from the row's inherited\n // `currentcolor`, so one default covers every host type and theme — no need\n // to mirror the row's own `theme` from context. An action that names a theme\n // is asking to paint itself rather than match its host, and gets it.\n theme = 'current',\n icon,\n children,\n isLoading = false,\n isSelected = false,\n tooltip,\n mods,\n styles,\n isDisabled: isDisabledProp,\n ...rest\n } = allProps;\n\n // Inherit disabled state from context, but allow local override\n const isDisabled = isDisabledProp ?? contextIsDisabled;\n\n // Whether that disabled state came from the host row rather than this action's\n // own prop. The `current` theme paints from the inherited color, and a\n // disabled host has already faded it — so fading a second time washes the\n // label out. See `CURRENT_ITEM_STYLES.color`.\n const isDisabledInherited = isDisabledProp == null && !!contextIsDisabled;\n\n // Determine if we should show a checkmark\n const hasCheckmark = icon === 'checkmark';\n\n // Determine final icon (loading takes precedence)\n const finalIcon = isLoading ? (\n <LoadingIcon />\n ) : hasCheckmark ? (\n <CheckIcon />\n ) : (\n icon\n );\n\n // Build modifiers\n const finalMods = {\n checkmark: hasCheckmark,\n selected: isSelected,\n loading: isLoading,\n 'has-label': !!children,\n context: !!contextType,\n 'has-icon': !!icon,\n 'inherit-disabled': isDisabledInherited,\n ...mods,\n };\n\n // An explicit label always wins; a tooltip only fills in the accessible name\n // when there isn't one. Rich tooltip content can't serve as a name, so only\n // plain strings are used here.\n const ariaLabel =\n rest['aria-label'] ||\n (typeof tooltip === 'string'\n ? tooltip\n : typeof tooltip === 'object' && typeof tooltip.title === 'string'\n ? tooltip.title\n : undefined);\n\n // Call useAction hook\n const { actionProps } = useAction(\n {\n ...rest,\n isDisabled,\n 'aria-label': ariaLabel,\n mods: finalMods,\n htmlType: 'button',\n },\n ref,\n );\n\n // Set tabIndex when in context\n const finalTabIndex = disableActionsFocus ? -1 : rest.tabIndex;\n\n // Determine if we should show tooltip (icon-only buttons)\n const showTooltip = !children && tooltip;\n\n // Extract tooltip content and props\n const tooltipContent =\n typeof tooltip === 'string'\n ? tooltip\n : typeof tooltip === 'object' && tooltip.title\n ? tooltip.title\n : undefined;\n\n const { title: _title, ...tooltipProps } =\n typeof tooltip === 'object' ? tooltip : {};\n\n const finalType = type;\n\n // Render function that accepts tooltip trigger props and ref\n const renderButton = (\n tooltipTriggerProps?: HTMLAttributes<HTMLElement>,\n tooltipRef?: RefObject<HTMLElement>,\n ) => {\n // Merge tooltip ref with actionProps if provided\n const mergedProps = tooltipRef\n ? mergeProps(actionProps, tooltipTriggerProps || {}, {\n ref: (element: HTMLElement | null) => {\n // Set the tooltip ref\n if (tooltipRef) {\n (tooltipRef as any).current = element;\n }\n // Set the action ref if it exists in actionProps\n const actionRef = (actionProps as any).ref;\n if (actionRef) {\n if (typeof actionRef === 'function') {\n actionRef(element);\n } else {\n actionRef.current = element;\n }\n }\n },\n })\n : mergeProps(actionProps, tooltipTriggerProps || {});\n\n return (\n <ItemActionElement\n {...mergedProps}\n variant={`${theme}.${finalType}` as ItemActionVariant}\n data-theme={theme}\n data-type={finalType}\n tabIndex={finalTabIndex}\n styles={styles}\n >\n {finalIcon && <div data-element=\"Icon\">{finalIcon}</div>}\n {children}\n </ItemActionElement>\n );\n };\n\n // Wrap with tooltip if needed\n if (showTooltip && tooltipContent) {\n return (\n <TooltipProvider title={tooltipContent} {...tooltipProps}>\n {(triggerProps, tooltipRef) => renderButton(triggerProps, tooltipRef)}\n </TooltipProvider>\n );\n }\n\n return renderButton();\n});\n\nexport type { CubeItemActionProps as ItemActionProps };\n"],"mappings":";;;;;;;;;;;;;;AA2FA,MAAMmD,oBAAoBhD,MAAM;CAC9BiD,IAAI;CACJJ,QAAQ;EACN,GAAG9B;EACHmC,QAAQ;EAKRC,SAAS;GACP,IAAI;GACJC,SAAS;GACV;EACDC,eAAe;EACfC,QAAQ;GAAE,IAAI;GAAYC,UAAU;GAAW;EAC/CC,QAAQ;GACN,IAAI;GACJ,eAAe;GAChB;EACDC,SAAS;GACP,IAAI;GACJ,YAAY;GACZ,wBAAwB;GACzB;EAED,mBAAmB;GACjB,IAAI;GACJ,eAAe;GAChB;EACD,wBAAwB;EACxB,uBAAuB;EACvB,oBAAoB;EAEpBC,MAAM;GACJC,GAAG;GACH,GAAI5C,wBAAwB2C;GAC5B,cAAc;GAChB;EACD;CACDE,UAAU;EAIR,mBAAmBpD;EACnB,mBAAmBD;EACnB,iBAAiBD;EAGjB,mBAAmBQ;EACnB,mBAAmBD;EACnB,iBAAiBD;EAGjB,kB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AAArD,EAAA;AAAA,SAFlBqD;;CAIH,IAAAH;AAAA,KAAAlD,EAAA,QAAAiD,cAAA;AAEMC,QAAAD,cAAc;AAAAjD,IAAA,MAAAiD;AAAAjD,IAAA,MAAAkD;OAAAA,OAAAlD,EAAA;AAAA,QAAdkD;EACP"}
|
|
@@ -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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { DisplayTransition } from "../helpers/DisplayTransition/DisplayTransition.js";
|
|
3
3
|
import { ITEM_RESTING_COLOR_VARIANTS, ROW_STATE_ALIASES, resolveItemVariant } from "../../data/item-themes.js";
|
|
4
4
|
import { ItemActionProvider } from "./ItemActionContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemActionsWrapper.js","names":["ClearPressResponder","Mods","Styles","tasty","CSSProperties","HTMLAttributes","ReactNode","useLayoutEffect","useRef","useState","useFocusWithin","useHover","ITEM_RESTING_COLOR_VARIANTS","resolveItemVariant","ROW_STATE_ALIASES","CubeItemProps","DisplayTransition","ItemActionProvider","ItemActionsWrapperElement","variants","styles","display","position","placeContent","placeItems","$size","Actions","$","inset","gap","pointerEvents","padding","height","opacity","translate","transition","ActionsChild","ActionIcon","flexShrink","width","preset","ItemActionIcon","props","_c","t0","children","ItemActionsWrapperProps","state","showActions","skipActionsWidthTransition","actions","type","theme","size","isDisabled","disableActionsFocus","autoHideActions","preserveActionsSpace","mods","actionsProps","HTMLDivElement","ItemActionsWrapper","t1","t2","t3","t4","undefined","actionsRef","actionsWidth","setActionsWidth","areActionsVisible","setAreActionsVisible","skipWidthTransition","setSkipWidthTransition","isMountPassRef","t5","el","current","isMountPass","childElementCount","Math","round","offsetWidth","t6","isFocusWithin","setIsFocusWithin","hasPressed","setHasPressed","t7","Symbol","for","hoverProps","isHovered","t8","onFocusWithinChange","focusWithinProps","t9","actionsEl","checkPressed","querySelector","observer","MutationObserver","observe","attributes","attributeFilter","subtree","disconnect","t10","shouldShowActions","t11","t12","t13","disabled","finalMods","t14","t15","t16","t17","t18","t19","t20","phase","t21","ref","transitionRef","node","t22"],"sources":["../../../src/components/actions/ItemActionsWrapper.tsx"],"sourcesContent":["import { ClearPressResponder } from '@react-aria/interactions';\nimport { Mods, Styles, tasty } from '@tenphi/tasty';\nimport {\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { useFocusWithin, useHover } from 'react-aria';\n\nimport {\n ITEM_RESTING_COLOR_VARIANTS,\n resolveItemVariant,\n ROW_STATE_ALIASES,\n} from '../../data/item-themes';\nimport { CubeItemProps } from '../content/Item/Item';\nimport { DisplayTransition } from '../helpers/DisplayTransition/DisplayTransition';\n\nimport { ItemActionProvider } from './ItemActionContext';\n\n/**\n * The sibling-actions layout shared by `ItemButton` and the field triggers\n * (`Select` / `Picker` / `FilterPicker`).\n *\n * A row's actions cannot live inside the row when the row is itself a button:\n * that nests a `<button>` in a `<button>`, and a press on an action activates\n * the row. So the run is rendered as a SIBLING, laid over the row's trailing\n * end, and the row reserves the space for it through `--actions-width` — which\n * this file measures — and `Item`'s own `actions` placeholder column.\n *\n * The run is pointer-transparent; only its children take presses. That is what\n * lets a picker put its non-interactive caret in the run and still have a click\n * on the caret reach the trigger underneath, and it stops the run's padding and\n * inter-action gaps from swallowing presses meant for the row.\n *\n * Being a sibling also puts the run OUTSIDE the row for anything that asks\n * \"did this press land on my trigger?\" — an overlay opened by the row would\n * read a press on its own actions as a press outside and dismiss itself,\n * swallowing that press on the way. The run therefore marks itself with\n * `data-trigger-action`, which `isOwnActionsPress` resolves back to the row it\n * belongs to. See `actions-run.ts`.\n */\nconst ItemActionsWrapperElement = tasty({\n // Actions default to the `current` type, which paints from the inherited\n // `currentcolor` — but they are rendered as a SIBLING of the row here, not\n // inside it, so without this they would inherit the page color instead of the\n // row's. Harmless on the default theme (the two match) and plainly wrong on\n // any other: a `special` row would hand its actions the page's dark text to\n // tint with, on a dark purple surface. The variant carries the row's resting\n // color down so `currentcolor` means the same thing it does inside an `Item`.\n variants: ITEM_RESTING_COLOR_VARIANTS,\n styles: {\n // The row is the wrapper's own child, so the wrapper can read the one\n // interaction the row expresses as a COLOR change rather than a fill change.\n // Without it the label darkened under the finger while the caret and the\n // actions laid over the same row — which paint from the color this element\n // hands down — stayed at their resting tint. The variants restate it,\n // because that is where the colors keyed on it live.\n // eslint-disable-next-line tasty/no-style-spread -- shared with ITEM_RESTING_COLOR_VARIANTS, which declare the same states\n ...ROW_STATE_ALIASES,\n\n // The one layout the row does not want its actions centred in. A block\n // description stacks under the label and can make the row arbitrarily tall;\n // there the actions belong in the first line, beside the label, which is\n // what anchoring them to a `$size`-tall box at the top achieves. Every other\n // row — including one with an INLINE description — is a single band, and\n // centring is both what it wants and what survives a caller overriding the\n // height. Read off the row rather than plumbed through as a prop, because\n // `Item` is what decides the placement and it defaults by type.\n '@block-description': ':has(> [data-description=\"block\"])',\n\n display: 'grid',\n position: 'relative',\n placeContent: 'stretch',\n placeItems: 'stretch',\n\n $size: {\n '': '$size-md',\n 'size=xsmall': '$size-xs',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n 'size=xlarge': '$size-xl',\n },\n\n Actions: {\n $: '>',\n position: 'absolute',\n // Both insets set, so the run's BOX spans the row and `placeItems: center`\n // puts the actions on its centre line. What sits in the box does not grow\n // with it — every child is a fixed `$action-size`, which is capped so a\n // large row does not get oversized buttons.\n inset: {\n '': '1bw right dock',\n 'type=card': '(1bw + .5x) right dock',\n '@block-description': '1bw 1bw auto auto',\n 'type=card & @block-description': '(1bw + .5x) (1bw + .5x) auto auto',\n },\n display: 'flex',\n gap: '1bw',\n placeItems: 'center',\n placeContent: 'center end',\n\n // The run lies OVER the row. Left opaque, its padding and the gaps between\n // its actions eat presses that belong to the row behind it, and a\n // non-interactive control inside it (a picker's caret) could never reach\n // its own trigger. The run itself is therefore transparent to the pointer\n // and its children opt back in — see `ActionsChild` — so a child that\n // wants to stay transparent, like that caret, only has to say so.\n pointerEvents: 'none',\n\n padding: '0 $side-padding',\n // Only where the run is top-anchored: there the box has no bottom to\n // measure from, so `$size` is what gives it one. Everywhere else the two\n // insets decide the height, and this floor would force the box back to\n // `$size` and re-anchor it at the top.\n height: {\n '': 'min 0',\n '@block-description': 'min ($size - 2bw)',\n },\n opacity: {\n '': 1,\n '!actions-shown': 0,\n },\n // The run slides in as it fades, but only where it was taking no space to\n // begin with. Where the space is reserved the run has a fixed place in the\n // layout, and sliding it would read as the actions drifting rather than\n // appearing.\n translate: {\n '': '0 0',\n '!actions-shown & !preserve-actions-space': '.5x 0',\n },\n transition: 'theme, translate',\n\n // Size for the action buttons\n '$action-size': 'min(max((2x + 2bw), ($size - 1x - 2bw)), (3x - 2bw))',\n // Side padding for the button\n '$side-padding': '(($size - $action-size - 2bw) / 2)',\n },\n\n // Whatever a caller put in the run: interactive again, so the transparency\n // above applies only to the space BETWEEN and AROUND the actions. `*`\n // because the run's content is the caller's — there is no element name to\n // key on.\n ActionsChild: {\n $: '>Actions>*',\n pointerEvents: {\n '': 'auto',\n '!actions-shown': 'none',\n },\n },\n\n // A non-interactive box in the run, the same size as an action so it lines\n // up with one. `$side-padding + $action-size / 2` collapses to\n // `($size - 2bw) / 2` — the centre of `Item`'s own `rightIcon` square — so a\n // caret moved out of that slot and into the run does not move on screen.\n ActionIcon: {\n $: '>Actions>',\n display: 'grid',\n placeItems: 'center',\n placeContent: 'center',\n flexShrink: 0,\n width: '$action-size',\n height: '$action-size',\n // The run's children are interactive by default; this one is not, and a\n // press on it belongs to the row underneath.\n pointerEvents: 'none',\n // `--icon-size` comes from the preset, and the run is outside the row that\n // sets one — so the box restates the ladder `Item` uses. The `m` weights a\n // non-`item` type picks carry the same icon size as their plain\n // counterparts, so weight is not a factor here.\n preset: {\n '': 't3',\n 'size=xsmall': 't4',\n 'size=xlarge': 't2',\n },\n },\n },\n});\n\n/**\n * A non-interactive box inside an actions run — a dropdown caret, a loading\n * spinner. It occupies an action's footprint so the run stays evenly spaced,\n * and it lets presses through to the row behind it.\n */\nexport function ItemActionIcon(props: { children: ReactNode }) {\n return <div data-element=\"ActionIcon\">{props.children}</div>;\n}\n\nexport interface ItemActionsWrapperProps {\n /**\n * The row or trigger the actions are laid over. Receives the resolved\n * visibility so it can reserve space for the run while it is shown, and\n * whether the reserved width must jump rather than animate (`Item`'s\n * `skipActionsWidthTransition`).\n */\n children: (state: {\n showActions: boolean;\n skipActionsWidthTransition: boolean;\n }) => ReactNode;\n /**\n * The run's content. Rendering the wrapper with an empty run is supported and\n * costs nothing — the measured width is 0 — which is how a trigger keeps its\n * markup stable across states that do and do not have trailing controls.\n */\n actions?: ReactNode;\n type?: string;\n theme?: string;\n /** `Item`'s size token, or a pixel number. */\n size?: CubeItemProps['size'];\n isDisabled?: boolean;\n disableActionsFocus?: boolean;\n /**\n * Hide the actions until the row is hovered, focused, or holds a pressed\n * control.\n * @default false\n */\n autoHideActions?: boolean;\n /**\n * Keep the run's width reserved while it is hidden, so the row does not\n * change size as the actions come and go. Only meaningful with\n * `autoHideActions`.\n *\n * It also keeps the run MOUNTED rather than transitioning it in and out:\n * an unmounted run cannot be measured, so a row that starts hidden would\n * have nothing to reserve.\n * @default false\n */\n preserveActionsSpace?: boolean;\n /** Extra modifiers for the wrapper, merged after the ones it derives itself. */\n mods?: Mods;\n /** Styles for the wrapper element — the one that is the row's layout box. */\n styles?: Styles;\n /** Extra props spread on the run's container, e.g. event handlers. */\n actionsProps?: HTMLAttributes<HTMLDivElement>;\n}\n\n/**\n * Wraps a row in the sibling-actions layout and publishes `--actions-width` so\n * the row can reserve the space the run covers.\n */\nexport function ItemActionsWrapper(props: ItemActionsWrapperProps) {\n const {\n children,\n actions,\n type = 'item',\n theme = 'default',\n size = 'medium',\n isDisabled,\n disableActionsFocus,\n autoHideActions = false,\n preserveActionsSpace = false,\n mods,\n styles,\n actionsProps,\n } = props;\n\n const actionsRef = useRef<HTMLDivElement>(null);\n const [actionsWidth, setActionsWidth] = useState(0);\n const [areActionsVisible, setAreActionsVisible] = useState(false);\n const [skipWidthTransition, setSkipWidthTransition] = useState(false);\n const isMountPassRef = useRef(true);\n\n useLayoutEffect(() => {\n const el = actionsRef.current;\n const isMountPass = isMountPassRef.current;\n\n isMountPassRef.current = false;\n\n if (!el) return;\n\n // An empty run still has the container's side padding, which would reserve\n // space inside the row for nothing. Nothing rendered means nothing to\n // reserve.\n const width = el.childElementCount ? Math.round(el.offsetWidth) : 0;\n\n if (width !== actionsWidth) {\n // The width a run reports on mount is where the row starts, not a change\n // to it. The `offsetWidth` read has already resolved the row at 0px, so\n // publishing with the transition on made every trigger grow by its caret\n // after mounting — and a click in that window sized FilterPicker's popover\n // from a half-grown trigger. A run revealed later still slides open.\n if (isMountPass) setSkipWidthTransition(true);\n setActionsWidth(width);\n } else if (skipWidthTransition) {\n // This pass's read resolved the row at its final width with the\n // transition off, so turning it back on animates nothing.\n setSkipWidthTransition(false);\n }\n }, [actions, areActionsVisible, actionsWidth, skipWidthTransition]);\n\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const [hasPressed, setHasPressed] = useState(false);\n const { hoverProps, isHovered } = useHover({});\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: setIsFocusWithin,\n });\n\n // Watch for data-pressed attribute on any descendant element\n useLayoutEffect(() => {\n const actionsEl = actionsRef.current;\n\n if (!actionsEl || !autoHideActions) return;\n\n const checkPressed = () => {\n setHasPressed(actionsEl.querySelector('[data-pressed]') !== null);\n };\n\n const observer = new MutationObserver(checkPressed);\n\n observer.observe(actionsEl, {\n attributes: true,\n attributeFilter: ['data-pressed'],\n subtree: true,\n });\n\n checkPressed();\n\n return () => observer.disconnect();\n }, [areActionsVisible, autoHideActions]);\n\n const shouldShowActions =\n isHovered || isFocusWithin || hasPressed || !autoHideActions;\n\n // `disabled` is on the wrapper so its variant can paint the row's DISABLED\n // label color, not just the resting one. Actions default to the `current` type\n // and suppress their own fade when the disabled state is inherited — on the\n // grounds that the host already faded the color they paint from — so without\n // this the wrapper would hand them a full-strength color and a disabled button\n // would sit next to full-strength actions. See `ITEM_RESTING_COLOR_VARIANTS`.\n const finalMods = {\n ...mods,\n ...(shouldShowActions ? { 'actions-shown': true } : null),\n ...(preserveActionsSpace ? { 'preserve-actions-space': true } : null),\n disabled: isDisabled,\n };\n\n return (\n <ItemActionsWrapperElement\n {...hoverProps}\n // The same resolver `Item` uses, so the wrapper cannot land on a\n // different variant than the row it wraps.\n variant={resolveItemVariant(theme, type)}\n data-size={size}\n data-type={type}\n data-theme={theme}\n mods={finalMods}\n styles={styles}\n style={\n {\n '--actions-width':\n areActionsVisible || !autoHideActions || preserveActionsSpace\n ? `${actionsWidth}px`\n : '0px',\n ...(typeof size === 'number' && { '--size': `${size}px` }),\n } as CSSProperties\n }\n >\n {children({\n showActions: shouldShowActions,\n skipActionsWidthTransition: skipWidthTransition,\n })}\n {/*\n The run is rendered under whatever press context the row sits in, and a\n `PressResponder` in that context reaches EVERY `usePress` below it — so\n an `ItemButton` / `TabButton` / picker trigger inside a `DialogTrigger`\n or a `MenuTrigger` handed its own actions the trigger's `onPress`, and\n pressing one toggled the overlay on top of running the action. The run\n belongs to the row, not to whatever opened around it: it clears the\n context so each action answers only to its own handler.\n */}\n <ClearPressResponder>\n <ItemActionProvider\n type={type}\n theme={theme}\n disableActionsFocus={disableActionsFocus}\n isDisabled={isDisabled}\n >\n {autoHideActions && !preserveActionsSpace ? (\n <DisplayTransition\n exposeUnmounted\n isShown={shouldShowActions}\n onPhaseChange={(phase) => {\n setAreActionsVisible(phase !== 'unmounted');\n }}\n >\n {({ ref: transitionRef }) => {\n return (\n <div\n {...focusWithinProps}\n {...actionsProps}\n ref={(node: any) => {\n actionsRef.current = node;\n transitionRef(node);\n }}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n );\n }}\n </DisplayTransition>\n ) : (\n <div\n ref={actionsRef}\n {...actionsProps}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n )}\n </ItemActionProvider>\n </ClearPressResponder>\n </ItemActionsWrapperElement>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMkB,4BAA4Bf,MAAM;CAQtCgB,UAAUP;CACVQ,QAAQ;EAQN,GAAGN;EAUH,sBAAsB;EAEtBO,SAAS;EACTC,UAAU;EACVC,cAAc;EACdC,YAAY;EAEZC,OAAO;GACL,IAAI;GACJ,eAAe;GACf,cAAc;GACd,eAAe;GACf,cAAc;GACd,eAAe;GAChB;EAEDC,SAAS;GACPC,GAAG;GACHL,UAAU;GAKVM,OAAO;IACL,IAAI;IACJ,aAAa;IACb,sBAAsB;IACtB,kCAAkC;IACnC;GACDP,SAAS;GACTQ,KAAK;GACLL,YAAY;GACZD,cAAc;GAQdO,eAAe;GAEfC,SAAS;GAKTC,QAAQ;IACN,IAAI;IACJ,sBAAsB;IACvB;GACDC,SAAS;IACP,IAAI;IACJ,kBAAkB;IACnB;GAKDC,WAAW;IACT,IAAI;IACJ,4CAA4C;IAC7C;GACDC,YAAY;GAGZ,gBAAgB;GAEhB,iBAAiB;GAClB;EAMDC,cAAc;GACZT,GAAG;GACHG,eAAe;IACb,IAAI;IACJ,kBAAkB;IACpB;GACD;EAMDO,YAAY;GACVV,GAAG;GACHN,SAAS;GACTG,YAAY;GACZD,cAAc;GACde,YAAY;GACZC,OAAO;GACPP,QAAQ;GAGRF,eA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ACE7D,aAAAA;GACAF,aAAAA;GACCC,cAAAA;GACN6D,MAAAA;GACE7F;GAEN,OAAAkG;cASDC,KAaDG;IA4C0B;AAAA/F,IAAA,MAAAsF;AAAAtF,IAAA,MAAAgE;AAAAhE,IAAA,MAAA0B;AAAA1B,IAAA,MAAAP;AAAAO,IAAA,MAAAuF;AAAAvF,IAAA,MAAA2F;AAAA3F,IAAA,MAAA4F;AAAA5F,IAAA,MAAA+F;AAAA/F,IAAA,MAAAyB;AAAAzB,IAAA,MAAAwB;AAAAxB,IAAA,MAAAmG;OAAAA,OAAAnG,EAAA;AAAA,QA7E5BmG"}
|
|
1
|
+
{"version":3,"file":"ItemActionsWrapper.js","names":["ClearPressResponder","Mods","Styles","tasty","CSSProperties","HTMLAttributes","ReactNode","useLayoutEffect","useRef","useState","useFocusWithin","useHover","ITEM_RESTING_COLOR_VARIANTS","resolveItemVariant","ROW_STATE_ALIASES","CubeItemProps","DisplayTransition","ItemActionProvider","ItemActionsWrapperElement","variants","styles","display","position","placeContent","placeItems","$size","Actions","$","inset","gap","pointerEvents","padding","height","opacity","translate","transition","ActionsChild","ActionIcon","flexShrink","width","preset","ItemActionIcon","props","_c","t0","children","ItemActionsWrapperProps","state","showActions","skipActionsWidthTransition","actions","type","theme","size","isDisabled","disableActionsFocus","autoHideActions","preserveActionsSpace","mods","actionsProps","HTMLDivElement","ItemActionsWrapper","t1","t2","t3","t4","undefined","actionsRef","actionsWidth","setActionsWidth","areActionsVisible","setAreActionsVisible","skipWidthTransition","setSkipWidthTransition","isMountPassRef","t5","el","current","isMountPass","childElementCount","Math","round","offsetWidth","t6","isFocusWithin","setIsFocusWithin","hasPressed","setHasPressed","t7","Symbol","for","hoverProps","isHovered","t8","onFocusWithinChange","focusWithinProps","t9","actionsEl","checkPressed","querySelector","observer","MutationObserver","observe","attributes","attributeFilter","subtree","disconnect","t10","shouldShowActions","t11","t12","t13","disabled","finalMods","t14","t15","t16","t17","t18","t19","t20","phase","t21","ref","transitionRef","node","t22"],"sources":["../../../src/components/actions/ItemActionsWrapper.tsx"],"sourcesContent":["import { ClearPressResponder } from '@react-aria/interactions';\nimport { Mods, Styles, tasty } from '@tenphi/tasty';\nimport {\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { useFocusWithin, useHover } from 'react-aria';\n\nimport {\n ITEM_RESTING_COLOR_VARIANTS,\n resolveItemVariant,\n ROW_STATE_ALIASES,\n} from '../../data/item-themes';\nimport { CubeItemProps } from '../content/Item/Item';\nimport { DisplayTransition } from '../helpers/DisplayTransition/DisplayTransition';\n\nimport { ItemActionProvider } from './ItemActionContext';\n\n/**\n * The sibling-actions layout shared by `ItemButton` and the field triggers\n * (`Select` / `Picker` / `FilterPicker`).\n *\n * A row's actions cannot live inside the row when the row is itself a button:\n * that nests a `<button>` in a `<button>`, and a press on an action activates\n * the row. So the run is rendered as a SIBLING, laid over the row's trailing\n * end, and the row reserves the space for it through `--actions-width` — which\n * this file measures — and `Item`'s own `actions` placeholder column.\n *\n * The run is pointer-transparent; only its children take presses. That is what\n * lets a picker put its non-interactive caret in the run and still have a click\n * on the caret reach the trigger underneath, and it stops the run's padding and\n * inter-action gaps from swallowing presses meant for the row.\n *\n * Being a sibling also puts the run OUTSIDE the row for anything that asks\n * \"did this press land on my trigger?\" — an overlay opened by the row would\n * read a press on its own actions as a press outside and dismiss itself,\n * swallowing that press on the way. The run therefore marks itself with\n * `data-trigger-action`, which `isOwnActionsPress` resolves back to the row it\n * belongs to. See `actions-run.ts`.\n */\nconst ItemActionsWrapperElement = tasty({\n // Actions default to the `current` type, which paints from the inherited\n // `currentcolor` — but they are rendered as a SIBLING of the row here, not\n // inside it, so without this they would inherit the page color instead of the\n // row's. Harmless on the default theme (the two match) and plainly wrong on\n // any other: a `special` row would hand its actions the page's dark text to\n // tint with, on a dark purple surface. The variant carries the row's resting\n // color down so `currentcolor` means the same thing it does inside an `Item`.\n variants: ITEM_RESTING_COLOR_VARIANTS,\n styles: {\n // The row is the wrapper's own child, so the wrapper can read the one\n // interaction the row expresses as a COLOR change rather than a fill change.\n // Without it the label darkened under the finger while the caret and the\n // actions laid over the same row — which paint from the color this element\n // hands down — stayed at their resting tint. The variants restate it,\n // because that is where the colors keyed on it live.\n ...ROW_STATE_ALIASES,\n\n // The one layout the row does not want its actions centred in. A block\n // description stacks under the label and can make the row arbitrarily tall;\n // there the actions belong in the first line, beside the label, which is\n // what anchoring them to a `$size`-tall box at the top achieves. Every other\n // row — including one with an INLINE description — is a single band, and\n // centring is both what it wants and what survives a caller overriding the\n // height. Read off the row rather than plumbed through as a prop, because\n // `Item` is what decides the placement and it defaults by type.\n '@block-description': ':has(> [data-description=\"block\"])',\n\n display: 'grid',\n position: 'relative',\n placeContent: 'stretch',\n placeItems: 'stretch',\n\n $size: {\n '': '$size-md',\n 'size=xsmall': '$size-xs',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n 'size=xlarge': '$size-xl',\n },\n\n Actions: {\n $: '>',\n position: 'absolute',\n // Both insets set, so the run's BOX spans the row and `placeItems: center`\n // puts the actions on its centre line. What sits in the box does not grow\n // with it — every child is a fixed `$action-size`, which is capped so a\n // large row does not get oversized buttons.\n inset: {\n '': '1bw right dock',\n 'type=card': '(1bw + .5x) right dock',\n '@block-description': '1bw 1bw auto auto',\n 'type=card & @block-description': '(1bw + .5x) (1bw + .5x) auto auto',\n },\n display: 'flex',\n gap: '1bw',\n placeItems: 'center',\n placeContent: 'center end',\n\n // The run lies OVER the row. Left opaque, its padding and the gaps between\n // its actions eat presses that belong to the row behind it, and a\n // non-interactive control inside it (a picker's caret) could never reach\n // its own trigger. The run itself is therefore transparent to the pointer\n // and its children opt back in — see `ActionsChild` — so a child that\n // wants to stay transparent, like that caret, only has to say so.\n pointerEvents: 'none',\n\n padding: '0 $side-padding',\n // Only where the run is top-anchored: there the box has no bottom to\n // measure from, so `$size` is what gives it one. Everywhere else the two\n // insets decide the height, and this floor would force the box back to\n // `$size` and re-anchor it at the top.\n height: {\n '': 'min 0',\n '@block-description': 'min ($size - 2bw)',\n },\n opacity: {\n '': 1,\n '!actions-shown': 0,\n },\n // The run slides in as it fades, but only where it was taking no space to\n // begin with. Where the space is reserved the run has a fixed place in the\n // layout, and sliding it would read as the actions drifting rather than\n // appearing.\n translate: {\n '': '0 0',\n '!actions-shown & !preserve-actions-space': '.5x 0',\n },\n transition: 'theme, translate',\n\n // Size for the action buttons\n '$action-size': 'min(max((2x + 2bw), ($size - 1x - 2bw)), (3x - 2bw))',\n // Side padding for the button\n '$side-padding': '(($size - $action-size - 2bw) / 2)',\n },\n\n // Whatever a caller put in the run: interactive again, so the transparency\n // above applies only to the space BETWEEN and AROUND the actions. `*`\n // because the run's content is the caller's — there is no element name to\n // key on.\n ActionsChild: {\n $: '>Actions>*',\n pointerEvents: {\n '': 'auto',\n '!actions-shown': 'none',\n },\n },\n\n // A non-interactive box in the run, the same size as an action so it lines\n // up with one. `$side-padding + $action-size / 2` collapses to\n // `($size - 2bw) / 2` — the centre of `Item`'s own `rightIcon` square — so a\n // caret moved out of that slot and into the run does not move on screen.\n ActionIcon: {\n $: '>Actions>',\n display: 'grid',\n placeItems: 'center',\n placeContent: 'center',\n flexShrink: 0,\n width: '$action-size',\n height: '$action-size',\n // The run's children are interactive by default; this one is not, and a\n // press on it belongs to the row underneath.\n pointerEvents: 'none',\n // `--icon-size` comes from the preset, and the run is outside the row that\n // sets one — so the box restates the ladder `Item` uses. The `m` weights a\n // non-`item` type picks carry the same icon size as their plain\n // counterparts, so weight is not a factor here.\n preset: {\n '': 't3',\n 'size=xsmall': 't4',\n 'size=xlarge': 't2',\n },\n },\n },\n});\n\n/**\n * A non-interactive box inside an actions run — a dropdown caret, a loading\n * spinner. It occupies an action's footprint so the run stays evenly spaced,\n * and it lets presses through to the row behind it.\n */\nexport function ItemActionIcon(props: { children: ReactNode }) {\n return <div data-element=\"ActionIcon\">{props.children}</div>;\n}\n\nexport interface ItemActionsWrapperProps {\n /**\n * The row or trigger the actions are laid over. Receives the resolved\n * visibility so it can reserve space for the run while it is shown, and\n * whether the reserved width must jump rather than animate (`Item`'s\n * `skipActionsWidthTransition`).\n */\n children: (state: {\n showActions: boolean;\n skipActionsWidthTransition: boolean;\n }) => ReactNode;\n /**\n * The run's content. Rendering the wrapper with an empty run is supported and\n * costs nothing — the measured width is 0 — which is how a trigger keeps its\n * markup stable across states that do and do not have trailing controls.\n */\n actions?: ReactNode;\n type?: string;\n theme?: string;\n /** `Item`'s size token, or a pixel number. */\n size?: CubeItemProps['size'];\n isDisabled?: boolean;\n disableActionsFocus?: boolean;\n /**\n * Hide the actions until the row is hovered, focused, or holds a pressed\n * control.\n * @default false\n */\n autoHideActions?: boolean;\n /**\n * Keep the run's width reserved while it is hidden, so the row does not\n * change size as the actions come and go. Only meaningful with\n * `autoHideActions`.\n *\n * It also keeps the run MOUNTED rather than transitioning it in and out:\n * an unmounted run cannot be measured, so a row that starts hidden would\n * have nothing to reserve.\n * @default false\n */\n preserveActionsSpace?: boolean;\n /** Extra modifiers for the wrapper, merged after the ones it derives itself. */\n mods?: Mods;\n /** Styles for the wrapper element — the one that is the row's layout box. */\n styles?: Styles;\n /** Extra props spread on the run's container, e.g. event handlers. */\n actionsProps?: HTMLAttributes<HTMLDivElement>;\n}\n\n/**\n * Wraps a row in the sibling-actions layout and publishes `--actions-width` so\n * the row can reserve the space the run covers.\n */\nexport function ItemActionsWrapper(props: ItemActionsWrapperProps) {\n const {\n children,\n actions,\n type = 'item',\n theme = 'default',\n size = 'medium',\n isDisabled,\n disableActionsFocus,\n autoHideActions = false,\n preserveActionsSpace = false,\n mods,\n styles,\n actionsProps,\n } = props;\n\n const actionsRef = useRef<HTMLDivElement>(null);\n const [actionsWidth, setActionsWidth] = useState(0);\n const [areActionsVisible, setAreActionsVisible] = useState(false);\n const [skipWidthTransition, setSkipWidthTransition] = useState(false);\n const isMountPassRef = useRef(true);\n\n useLayoutEffect(() => {\n const el = actionsRef.current;\n const isMountPass = isMountPassRef.current;\n\n isMountPassRef.current = false;\n\n if (!el) return;\n\n // An empty run still has the container's side padding, which would reserve\n // space inside the row for nothing. Nothing rendered means nothing to\n // reserve.\n const width = el.childElementCount ? Math.round(el.offsetWidth) : 0;\n\n if (width !== actionsWidth) {\n // The width a run reports on mount is where the row starts, not a change\n // to it. The `offsetWidth` read has already resolved the row at 0px, so\n // publishing with the transition on made every trigger grow by its caret\n // after mounting — and a click in that window sized FilterPicker's popover\n // from a half-grown trigger. A run revealed later still slides open.\n if (isMountPass) setSkipWidthTransition(true);\n setActionsWidth(width);\n } else if (skipWidthTransition) {\n // This pass's read resolved the row at its final width with the\n // transition off, so turning it back on animates nothing.\n setSkipWidthTransition(false);\n }\n }, [actions, areActionsVisible, actionsWidth, skipWidthTransition]);\n\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const [hasPressed, setHasPressed] = useState(false);\n const { hoverProps, isHovered } = useHover({});\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: setIsFocusWithin,\n });\n\n // Watch for data-pressed attribute on any descendant element\n useLayoutEffect(() => {\n const actionsEl = actionsRef.current;\n\n if (!actionsEl || !autoHideActions) return;\n\n const checkPressed = () => {\n setHasPressed(actionsEl.querySelector('[data-pressed]') !== null);\n };\n\n const observer = new MutationObserver(checkPressed);\n\n observer.observe(actionsEl, {\n attributes: true,\n attributeFilter: ['data-pressed'],\n subtree: true,\n });\n\n checkPressed();\n\n return () => observer.disconnect();\n }, [areActionsVisible, autoHideActions]);\n\n const shouldShowActions =\n isHovered || isFocusWithin || hasPressed || !autoHideActions;\n\n // `disabled` is on the wrapper so its variant can paint the row's DISABLED\n // label color, not just the resting one. Actions default to the `current` type\n // and suppress their own fade when the disabled state is inherited — on the\n // grounds that the host already faded the color they paint from — so without\n // this the wrapper would hand them a full-strength color and a disabled button\n // would sit next to full-strength actions. See `ITEM_RESTING_COLOR_VARIANTS`.\n const finalMods = {\n ...mods,\n ...(shouldShowActions ? { 'actions-shown': true } : null),\n ...(preserveActionsSpace ? { 'preserve-actions-space': true } : null),\n disabled: isDisabled,\n };\n\n return (\n <ItemActionsWrapperElement\n {...hoverProps}\n // The same resolver `Item` uses, so the wrapper cannot land on a\n // different variant than the row it wraps.\n variant={resolveItemVariant(theme, type)}\n data-size={size}\n data-type={type}\n data-theme={theme}\n mods={finalMods}\n styles={styles}\n style={\n {\n '--actions-width':\n areActionsVisible || !autoHideActions || preserveActionsSpace\n ? `${actionsWidth}px`\n : '0px',\n ...(typeof size === 'number' && { '--size': `${size}px` }),\n } as CSSProperties\n }\n >\n {children({\n showActions: shouldShowActions,\n skipActionsWidthTransition: skipWidthTransition,\n })}\n {/*\n The run is rendered under whatever press context the row sits in, and a\n `PressResponder` in that context reaches EVERY `usePress` below it — so\n an `ItemButton` / `TabButton` / picker trigger inside a `DialogTrigger`\n or a `MenuTrigger` handed its own actions the trigger's `onPress`, and\n pressing one toggled the overlay on top of running the action. The run\n belongs to the row, not to whatever opened around it: it clears the\n context so each action answers only to its own handler.\n */}\n <ClearPressResponder>\n <ItemActionProvider\n type={type}\n theme={theme}\n disableActionsFocus={disableActionsFocus}\n isDisabled={isDisabled}\n >\n {autoHideActions && !preserveActionsSpace ? (\n <DisplayTransition\n exposeUnmounted\n isShown={shouldShowActions}\n onPhaseChange={(phase) => {\n setAreActionsVisible(phase !== 'unmounted');\n }}\n >\n {({ ref: transitionRef }) => {\n return (\n <div\n {...focusWithinProps}\n {...actionsProps}\n ref={(node: any) => {\n actionsRef.current = node;\n transitionRef(node);\n }}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n );\n }}\n </DisplayTransition>\n ) : (\n <div\n ref={actionsRef}\n {...actionsProps}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n )}\n </ItemActionProvider>\n </ClearPressResponder>\n </ItemActionsWrapperElement>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-afff9bd | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useDismissParentPopover } from "../../../utils/react/usePopoverSync.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { Button } from "../Button/Button.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { _CollectionItem } from "../../CollectionItem.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-afff9bd | 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.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-afff9bd | Cube Dev Team */
|
|
2
2
|
import { MenuItem } from "./MenuItem.js";
|
|
3
3
|
import { StyledMenu, StyledSection, StyledSectionHeading } from "./styled.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { SlotProvider } from "../../../utils/react/Slots.js";
|
|
3
3
|
import { usePopoverSync } from "../../../utils/react/usePopoverSync.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { MenuContext, useMenuContext } from "./context.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { DEFAULT_CLEAR_STYLES } from "../../../data/item-themes.js";
|
|
3
3
|
import { Space } from "../../layout/Space.js";
|
|
4
4
|
import { DEFAULT_BUTTON_STYLES } from "../Button/Button.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","names":["tasty","DEFAULT_CLEAR_STYLES","Space","DEFAULT_BUTTON_STYLES","StyledMenuWrapper","qa","styles","display","gridRows","fill","margin","padding","border","radius","width","popover","shadow","height","tray","boxSizing","StyledMenu","as","flow","gap","sections","section","overflow","scrollbar","StyledDivider","listStyle","flexShrink","StyledHeader","role","color","preset","placeContent","placeItems","whiteSpace","$size","StyledFooter","StyledSection","StyledItem","justifyContent","focused","selected","pressed","disabled","cursor","outline","Description","StyledSectionHeading","prefix"],"sources":["../../../../src/components/actions/Menu/styled.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\n\nimport { DEFAULT_CLEAR_STYLES } from '../../../data/item-themes';\nimport { Space } from '../../layout/Space';\nimport { DEFAULT_BUTTON_STYLES } from '../Button/Button';\n\nexport const StyledMenuWrapper = tasty({\n qa: 'Menu',\n styles: {\n display: 'grid',\n gridRows: 'max-content 1sf max-content',\n fill: '#surface',\n margin: 0,\n padding: 0,\n border: true,\n radius: '(1cr + 1bw)',\n width: {\n '': 'auto',\n popover: 'max-content',\n },\n shadow: {\n '': '',\n // Use the design-system `$shadow` token (resolves to\n // `0 .5x 2x #shadow-md`) so the popover shadow follows the\n // scheme-aware Glaze `#shadow-md` color. The previous literal\n // `0px 5px 15px #dark.05` baked in `#dark` (now aliased to the\n // adaptive `#surface-text`) which inverts to a *light* shadow on\n // dark surfaces.\n 'popover | tray': '$shadow',\n },\n height: {\n '': 'initial',\n popover: 'initial max-content (50vh - 4x)',\n tray: 'initial max-content (100vh - 4x)',\n },\n boxSizing: 'border-box',\n },\n});\n\nexport const StyledMenu = tasty({\n as: 'ul',\n qa: 'MenuList',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: {\n '': '1bw',\n sections: false,\n },\n boxSizing: 'border-box',\n margin: 0,\n padding: {\n '': '0.5x',\n section: 0, // section menu\n },\n overflow: {\n '': 'auto',\n section: '',\n },\n scrollbar: 'styled',\n },\n});\n\nexport const StyledDivider = tasty({\n qa: 'Divider',\n as: 'li',\n styles: {\n display: 'flex',\n flow: 'column',\n margin: '.5x',\n listStyle: 'none',\n fill: '#border',\n height: '1bw',\n flexShrink: 0,\n },\n});\n\nexport const StyledHeader = tasty(Space, {\n qa: 'Header',\n as: 'div',\n role: 'heading',\n 'aria-level': 3,\n styles: {\n color: '#dark-02',\n preset: 't3',\n placeContent: 'space-between',\n placeItems: 'center',\n whiteSpace: 'nowrap',\n padding: '.5x 1.5x',\n height: 'min $size',\n boxSizing: 'border-box',\n border: 'bottom',\n radius: '1cr top',\n\n $size: {\n '': '$size-md',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n },\n },\n});\n\nexport const StyledFooter = tasty(Space, {\n qa: 'Footer',\n as: 'div',\n role: 'footer',\n styles: {\n color: '#dark-02',\n preset: 't3',\n placeContent: 'space-between',\n placeItems: 'center',\n whiteSpace: 'nowrap',\n padding: '.5x 1.5x',\n height: {\n '': 'min $size-md',\n 'size=large': 'min $size-lg',\n },\n boxSizing: 'border-box',\n border: 'top',\n radius: '1cr bottom',\n },\n});\n\nexport const StyledSection = tasty({\n qa: 'Section',\n as: 'li',\n styles: {\n display: 'flex',\n flow: 'column',\n margin: '0',\n padding: '0',\n listStyle: 'none',\n fill: '#surface',\n },\n});\n\nexport const StyledItem = tasty({\n qa: 'Item',\n as: 'li',\n styles: {\n // Base button-like styles merged from Action/Button defaults\n
|
|
1
|
+
{"version":3,"file":"styled.js","names":["tasty","DEFAULT_CLEAR_STYLES","Space","DEFAULT_BUTTON_STYLES","StyledMenuWrapper","qa","styles","display","gridRows","fill","margin","padding","border","radius","width","popover","shadow","height","tray","boxSizing","StyledMenu","as","flow","gap","sections","section","overflow","scrollbar","StyledDivider","listStyle","flexShrink","StyledHeader","role","color","preset","placeContent","placeItems","whiteSpace","$size","StyledFooter","StyledSection","StyledItem","justifyContent","focused","selected","pressed","disabled","cursor","outline","Description","StyledSectionHeading","prefix"],"sources":["../../../../src/components/actions/Menu/styled.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\n\nimport { DEFAULT_CLEAR_STYLES } from '../../../data/item-themes';\nimport { Space } from '../../layout/Space';\nimport { DEFAULT_BUTTON_STYLES } from '../Button/Button';\n\nexport const StyledMenuWrapper = tasty({\n qa: 'Menu',\n styles: {\n display: 'grid',\n gridRows: 'max-content 1sf max-content',\n fill: '#surface',\n margin: 0,\n padding: 0,\n border: true,\n radius: '(1cr + 1bw)',\n width: {\n '': 'auto',\n popover: 'max-content',\n },\n shadow: {\n '': '',\n // Use the design-system `$shadow` token (resolves to\n // `0 .5x 2x #shadow-md`) so the popover shadow follows the\n // scheme-aware Glaze `#shadow-md` color. The previous literal\n // `0px 5px 15px #dark.05` baked in `#dark` (now aliased to the\n // adaptive `#surface-text`) which inverts to a *light* shadow on\n // dark surfaces.\n 'popover | tray': '$shadow',\n },\n height: {\n '': 'initial',\n popover: 'initial max-content (50vh - 4x)',\n tray: 'initial max-content (100vh - 4x)',\n },\n boxSizing: 'border-box',\n },\n});\n\nexport const StyledMenu = tasty({\n as: 'ul',\n qa: 'MenuList',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: {\n '': '1bw',\n sections: false,\n },\n boxSizing: 'border-box',\n margin: 0,\n padding: {\n '': '0.5x',\n section: 0, // section menu\n },\n overflow: {\n '': 'auto',\n section: '',\n },\n scrollbar: 'styled',\n },\n});\n\nexport const StyledDivider = tasty({\n qa: 'Divider',\n as: 'li',\n styles: {\n display: 'flex',\n flow: 'column',\n margin: '.5x',\n listStyle: 'none',\n fill: '#border',\n height: '1bw',\n flexShrink: 0,\n },\n});\n\nexport const StyledHeader = tasty(Space, {\n qa: 'Header',\n as: 'div',\n role: 'heading',\n 'aria-level': 3,\n styles: {\n color: '#dark-02',\n preset: 't3',\n placeContent: 'space-between',\n placeItems: 'center',\n whiteSpace: 'nowrap',\n padding: '.5x 1.5x',\n height: 'min $size',\n boxSizing: 'border-box',\n border: 'bottom',\n radius: '1cr top',\n\n $size: {\n '': '$size-md',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n },\n },\n});\n\nexport const StyledFooter = tasty(Space, {\n qa: 'Footer',\n as: 'div',\n role: 'footer',\n styles: {\n color: '#dark-02',\n preset: 't3',\n placeContent: 'space-between',\n placeItems: 'center',\n whiteSpace: 'nowrap',\n padding: '.5x 1.5x',\n height: {\n '': 'min $size-md',\n 'size=large': 'min $size-lg',\n },\n boxSizing: 'border-box',\n border: 'top',\n radius: '1cr bottom',\n },\n});\n\nexport const StyledSection = tasty({\n qa: 'Section',\n as: 'li',\n styles: {\n display: 'flex',\n flow: 'column',\n margin: '0',\n padding: '0',\n listStyle: 'none',\n fill: '#surface',\n },\n});\n\nexport const StyledItem = tasty({\n qa: 'Item',\n as: 'li',\n styles: {\n // Base button-like styles merged from Action/Button defaults\n ...DEFAULT_BUTTON_STYLES,\n ...DEFAULT_CLEAR_STYLES,\n\n // Override specifics for menu context\n display: 'flex',\n flow: 'row',\n justifyContent: 'stretch',\n listStyle: 'none',\n flexShrink: 0,\n height: {\n '': 'min $size-md',\n 'size=large': 'min $size-lg',\n },\n border: false,\n boxSizing: 'border-box',\n fill: {\n '': '#clear',\n focused: '#dark.03',\n selected: '#dark.09',\n 'selected & focused': '#dark.12',\n pressed: '#dark.09',\n disabled: '#clear',\n },\n color: {\n '': '#dark-02',\n 'selected | pressed': '#dark',\n disabled: '#disabled-surface-text',\n },\n cursor: {\n '': 'default',\n disabled: 'not-allowed',\n },\n shadow: '#clear',\n padding: {\n '': '.5x 1x',\n 'selectionIcon & selectable & !selected': '.5x 1x .5x (1x + 3x)',\n },\n gap: '.75x',\n outline: false,\n\n Description: {\n preset: 't4',\n color: '#dark-03',\n },\n },\n});\n\nexport const StyledSectionHeading = tasty(Space, {\n qa: 'SectionHeading',\n as: 'div',\n styles: {\n color: '#dark-04',\n preset: 'c2',\n height: '3x',\n placeContent: 'center space-between',\n padding: {\n '': '.5x .75x',\n prefix: '0 .75x 0 .5x',\n },\n\n $size: {\n '': '$size-md',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n },\n },\n});\n"],"mappings":";;;;;;;AAMA,MAAaI,oBAAoBJ,MAAM;CACrCK,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,UAAU;EACVC,MAAM;EACNC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRC,OAAO;GACL,IAAI;GACJC,SAAS;GACV;EACDC,QAAQ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C,SAAS;EACTkB,WAAW;EACXpB,MAAM;EACR;CACD,CAAC;AAEF,MAAagC,aAAazC,MAAM;CAC9BK,IAAI;CACJgB,IAAI;CACJf,QAAQ;EAEN,GAAGH;EACH,GAAGF;EAGHM,SAAS;EACTe,MAAM;EACNoB,gBAAgB;EAChBb,WAAW;EACXC,YAAY;EACZb,QAAQ;GACN,IAAI;GACJ,cAAc;GACf;EACDL,QAAQ;EACRO,WAAW;EACXV,MAAM;GACJ,IAAI;GACJkC,SAAS;GACTC,UAAU;GACV,sBAAsB;GACtBC,SAAS;GACTC,UAAU;GACX;EACDb,OAAO;GACL,IAAI;GACJ,sBAAsB;GACtBa,UAAU;GACX;EACDC,QAAQ;GACN,IAAI;GACJD,UAAU;GACX;EACD9B,QAAQ;EACRL,SAAS;GACP,IAAI;GACJ,0CAA0C;GAC3C;EACDY,KAAK;EACLyB,SAAS;EAETC,aAAa;GACXf,QAAQ;GACRD,OAAO;GACT;EACF;CACD,CAAC;AAEF,MAAaiB,uBAAuBlD,MAAME,OAAO;CAC/CG,IAAI;CACJgB,IAAI;CACJf,QAAQ;EACN2B,OAAO;EACPC,QAAQ;EACRjB,QAAQ;EACRkB,cAAc;EACdxB,SAAS;GACP,IAAI;GACJwC,QAAQ;GACT;EAEDb,OAAO;GACL,IAAI;GACJ,cAAc;GACd,eAAe;GACf,cAAc;GAChB;EACF;CACD,CAAC"}
|
|
@@ -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-afff9bd | Cube Dev Team */
|
|
2
2
|
//#region src/components/actions/actions-run.ts
|
|
3
3
|
/**
|
|
4
4
|
* Whether `element` — the node react-aria hands an overlay's dismiss predicate
|
|
@@ -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-afff9bd | 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";
|
|
@@ -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-afff9bd | 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 { useWarn } from "../../_internal/hooks/use-warn.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { usePopoverSync } from "../../utils/react/usePopoverSync.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { usePopoverSync } from "../../utils/react/usePopoverSync.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useFocus as useFocus$1 } from "../../../utils/react/interactions.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import themes_default from "../../../data/themes.js";
|
|
3
3
|
import { useAlert } from "./use-alert.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","names":["tasty","ForwardedRef","forwardRef","THEMES","CubeAlertProps","useAlert","AlertElement","name","role","qa","styles","display","flow","radius","padding","preset","color","disabled","fill","Object","keys","reduce","map","type","border","Alert","props","ref","$","_c","mods","filteredProps","t0"],"sources":["../../../../src/components/content/Alert/Alert.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { ForwardedRef, forwardRef } from 'react';\n\nimport THEMES from '../../../data/themes';\n\nimport { CubeAlertProps } from './types';\nimport { useAlert } from './use-alert';\n\nconst AlertElement = tasty({\n name: 'Alert',\n role: 'alert',\n qa: 'Alert',\n styles: {\n display: 'block',\n flow: 'column',\n radius: {\n '': '1cr',\n 'shape=sharp': '0',\n },\n padding: '1.5x',\n preset: 't3',\n color: {\n '': '#dark-02',\n 'type=disabled': THEMES.disabled.color,\n },\n fill: {\n '': '#clear',\n
|
|
1
|
+
{"version":3,"file":"Alert.js","names":["tasty","ForwardedRef","forwardRef","THEMES","CubeAlertProps","useAlert","AlertElement","name","role","qa","styles","display","flow","radius","padding","preset","color","disabled","fill","Object","keys","reduce","map","type","border","Alert","props","ref","$","_c","mods","filteredProps","t0"],"sources":["../../../../src/components/content/Alert/Alert.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { ForwardedRef, forwardRef } from 'react';\n\nimport THEMES from '../../../data/themes';\n\nimport { CubeAlertProps } from './types';\nimport { useAlert } from './use-alert';\n\nconst AlertElement = tasty({\n name: 'Alert',\n role: 'alert',\n qa: 'Alert',\n styles: {\n display: 'block',\n flow: 'column',\n radius: {\n '': '1cr',\n 'shape=sharp': '0',\n },\n padding: '1.5x',\n preset: 't3',\n color: {\n '': '#dark-02',\n 'type=disabled': THEMES.disabled.color,\n },\n fill: {\n '': '#clear',\n ...Object.keys(THEMES).reduce((map, type) => {\n map[`type=${type}`] = THEMES[type].fill;\n\n return map;\n }, {}),\n },\n border: {\n '': '#clear',\n ...Object.keys(THEMES).reduce((map, type) => {\n map[`type=${type}`] = THEMES[type].border;\n\n return map;\n }, {}),\n 'shape=sharp': '0',\n },\n },\n});\n\nexport const Alert = forwardRef(function Alert(\n props: CubeAlertProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { styles, mods, filteredProps } = useAlert(props);\n\n return (\n <AlertElement {...filteredProps} ref={ref} mods={mods} styles={styles} />\n );\n});\n"],"mappings":";;;;;;;;;AAQA,MAAMM,eAAeN,MAAM;CACzBO,MAAM;CACNC,MAAM;CACNC,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,QAAQ;GACN,IAAI;GACJ,eAAe;GAChB;EACDC,SAAS;EACTC,QAAQ;EACRC,OAAO;GACL,IAAI;GACJ,iBAAiBb,eAAOc,SAASD;GAClC;EACDE,MAAM;GACJ,IAAI;GACJ,GAAGC,OAAOC,KAAKjB,eAAO,CAACkB,QAAQC,KAAKC,SAAS;AAC3CD,QAAI,QAAQC,UAAUpB,eAAOoB,MAAML;AAEnC,WAAOI;MACN,EAAE,CAAA;GACN;EACDE,QAAQ;GACN,IAAI;GACJ,GAAGL,OAAOC,KAAKjB,eAAO,CAACkB,QAAQC,KAAKC,SAAS;AAC3CD,QAAI,QAAQC,UAAUpB,eAAOoB,MAAMC;AAEnC,WAAOF;MACN,EAAE,CAAC;GACN,eAAe;GACjB;EACF;CACD,CAAC;AAEF,MAAaG,QAAQvB,WAAW,SAAAuB,MAAAC,OAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAI9B,MAAA,EAAAnB,QAAAoB,MAAAC,kBAAwC1B,SAASqB,MAAM;CAAC,IAAAM;AAAA,KAAAJ,EAAA,OAAAG,iBAAAH,EAAA,OAAAE,QAAAF,EAAA,OAAAD,OAAAC,EAAA,OAAAlB,QAAA;AAGtDsB,OAAA,oBAAC;GAAY,GAAKD;GAAoBJ;GAAWG;GAAcpB;IAAU;AAAAkB,IAAA,KAAAG;AAAAH,IAAA,KAAAE;AAAAF,IAAA,KAAAD;AAAAC,IAAA,KAAAlB;AAAAkB,IAAA,KAAAI;OAAAA,MAAAJ,EAAA;AAAA,QAAzEI;EAEF"}
|
|
@@ -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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useDeprecationWarning } from "../../../_internal/hooks/use-deprecation-warning.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { CONTAINER_STYLES, Element, filterBaseProps } 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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { _Item } from "../Item/Item.js";
|
|
3
3
|
import themes_default from "../../../data/themes.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","names":["tasty","forwardRef","THEMES","CubeItemProps","Item","FILL_STYLES","Object","keys","reduce","map","type","fill","color","BadgeElement","qa","role","size","styles","radius","preset","border","Label","textAlign","placeSelf","CubeBadgeProps","theme","Badge","allProps","ref","$","_c","children","props","t0","t1","undefined","badgeTheme","t2","_Badge","displayName"],"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: {\n '': '#white',\n // Every other theme fills with a fixed accent; `disabled` fills with the\n // adaptive `#surface-text-soft-2`, which turns light in dark, so its label\n // flips with it (a fixed `#white` fell to 3.59:1 there).\n 'theme=disabled': '#surface',\n },\n fill: {\n '': '#primary',\n
|
|
1
|
+
{"version":3,"file":"Badge.js","names":["tasty","forwardRef","THEMES","CubeItemProps","Item","FILL_STYLES","Object","keys","reduce","map","type","fill","color","BadgeElement","qa","role","size","styles","radius","preset","border","Label","textAlign","placeSelf","CubeBadgeProps","theme","Badge","allProps","ref","$","_c","children","props","t0","t1","undefined","badgeTheme","t2","_Badge","displayName"],"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: {\n '': '#white',\n // Every other theme fills with a fixed accent; `disabled` fills with the\n // adaptive `#surface-text-soft-2`, which turns light in dark, so its label\n // flips with it (a fixed `#white` fell to 3.59:1 there).\n 'theme=disabled': '#surface',\n },\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,MAAMK,cAAcC,OAAOC,KAAKL,eAAO,CAACM,QAAQC,KAAKC,SAAS;AAC5DD,KAAI,SAASC,UACXA,SAAS,YAAYR,eAAOQ,MAAMC,OAAOT,eAAOQ,MAAME;AAExD,QAAOH;GACN,EAAE,CAAC;AAEN,MAAMI,eAAeb,MAAMI,OAAM;CAC/BU,IAAI;CACJC,MAAM;CACNC,MAAM;CACNC,QAAQ;EACNC,QAAQ;EACRN,OAAO;GACL,IAAI;GAIJ,kBAAkB;GACnB;EACDD,MAAM;GACJ,IAAI;GACJ,GAAGN;GACJ;EAC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
|
|
@@ -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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { CONTAINER_STYLES, filterBaseProps, 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-afff9bd | 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";
|
|
@@ -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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useTimer } from "../../../_internal/hooks/use-timer/use-timer.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { _Tooltip } from "../../overlays/Tooltip/Tooltip.js";
|
|
3
3
|
import { TooltipTrigger } from "../../overlays/Tooltip/TooltipTrigger.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.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-afff9bd | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { DisplayTransition } from "../../helpers/DisplayTransition/DisplayTransition.js";
|