@cube-dev/ui-kit 0.0.0-canary-e530064 → 0.0.0-canary-52c46a3
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-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.d.ts +0 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/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/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 +42 -44
- package/dist/components/actions/use-context-menu.js.map +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/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/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +2 -2
- 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.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.d.ts +13 -0
- package/dist/components/data/DataTable/DataTable.js +246 -0
- package/dist/components/data/DataTable/DataTable.js.map +1 -0
- package/dist/components/data/DataTable/index.d.ts +3 -0
- package/dist/components/data/DataTable/types.d.ts +145 -0
- package/dist/components/data/ItemTable/ItemTable.d.ts +19 -0
- package/dist/components/data/ItemTable/ItemTable.js +350 -0
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableBulkBar.d.ts +23 -0
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +131 -0
- package/dist/components/data/ItemTable/ItemTableBulkBar.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +46 -0
- package/dist/components/data/ItemTable/ItemTableDragPreview.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableFooter.js +79 -0
- package/dist/components/data/ItemTable/ItemTableFooter.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableToolbar.d.ts +34 -0
- package/dist/components/data/ItemTable/ItemTableToolbar.js +91 -0
- package/dist/components/data/ItemTable/ItemTableToolbar.js.map +1 -0
- package/dist/components/data/ItemTable/index.d.ts +4 -0
- package/dist/components/data/ItemTable/types.d.ts +327 -0
- package/dist/components/data/TableBase/ColumnResizer.js +70 -0
- package/dist/components/data/TableBase/ColumnResizer.js.map +1 -0
- package/dist/components/data/TableBase/RowCollection.js +99 -0
- package/dist/components/data/TableBase/RowCollection.js.map +1 -0
- package/dist/components/data/TableBase/TableRow.js +89 -0
- package/dist/components/data/TableBase/TableRow.js.map +1 -0
- package/dist/components/data/TableBase/TableView.d.ts +22 -0
- package/dist/components/data/TableBase/TableView.js +921 -0
- package/dist/components/data/TableBase/TableView.js.map +1 -0
- package/dist/components/data/TableBase/index.d.ts +5 -0
- package/dist/components/data/TableBase/row-menu.js +40 -0
- package/dist/components/data/TableBase/row-menu.js.map +1 -0
- package/dist/components/data/TableBase/styled.d.ts +5 -0
- package/dist/components/data/TableBase/styled.js +532 -0
- package/dist/components/data/TableBase/styled.js.map +1 -0
- package/dist/components/data/TableBase/types.d.ts +160 -0
- package/dist/components/data/TableBase/types.js +31 -0
- package/dist/components/data/TableBase/types.js.map +1 -0
- package/dist/components/data/TableBase/use-cell-selection.d.ts +3 -0
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-cell-selection.js.map +1 -0
- package/dist/components/data/TableBase/use-container-width.js +35 -0
- package/dist/components/data/TableBase/use-container-width.js.map +1 -0
- package/dist/components/data/TableBase/use-row-move-animation.js +90 -0
- package/dist/components/data/TableBase/use-row-move-animation.js.map +1 -0
- package/dist/components/data/TableBase/use-scrollability.js +49 -0
- package/dist/components/data/TableBase/use-scrollability.js.map +1 -0
- package/dist/components/data/TableBase/use-table-columns.d.ts +2 -0
- package/dist/components/data/TableBase/use-table-columns.js +166 -0
- package/dist/components/data/TableBase/use-table-columns.js.map +1 -0
- package/dist/components/data/TableBase/use-table-search.js +64 -0
- package/dist/components/data/TableBase/use-table-search.js.map +1 -0
- package/dist/components/data/TableBase/use-table-selection.d.ts +4 -0
- package/dist/components/data/TableBase/use-table-selection.js +233 -0
- package/dist/components/data/TableBase/use-table-selection.js.map +1 -0
- package/dist/components/data/TableBase/use-table-sort.js +91 -0
- package/dist/components/data/TableBase/use-table-sort.js.map +1 -0
- package/dist/components/data/TableBase/use-table-sorts.js +97 -0
- package/dist/components/data/TableBase/use-table-sorts.js.map +1 -0
- package/dist/components/data/TableBase/use-table-storage.d.ts +8 -0
- package/dist/components/data/TableBase/use-table-storage.js +58 -0
- package/dist/components/data/TableBase/use-table-storage.js.map +1 -0
- package/dist/components/data/index.d.ts +10 -0
- 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/ColorPicker/ColorPicker.d.ts +37 -34
- package/dist/components/fields/ColorPicker/ColorPicker.js +182 -131
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/fields/{color/ColorPanel.js → ColorPicker/ColorPickerPanel.js} +11 -14
- package/dist/components/fields/ColorPicker/ColorPickerPanel.js.map +1 -0
- package/dist/components/fields/{color → ColorPicker}/channels.d.ts +1 -1
- package/dist/components/fields/{color → ColorPicker}/channels.js +2 -2
- package/dist/components/fields/ColorPicker/channels.js.map +1 -0
- package/dist/components/fields/ColorPicker/color.d.ts +15 -0
- package/dist/components/fields/{color → ColorPicker}/color.js +2 -2
- package/dist/components/fields/ColorPicker/color.js.map +1 -0
- package/dist/components/fields/ColorPicker/index.d.ts +3 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +2 -2
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/index.d.ts +0 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +2 -2
- package/dist/components/fields/RadioGroup/Radio.js +4 -4
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/index.d.ts +3 -9
- 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/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/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 +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 +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.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/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.d.ts +9 -0
- package/dist/components/navigation/Pagination/Pagination.js +258 -0
- package/dist/components/navigation/Pagination/Pagination.js.map +1 -0
- package/dist/components/navigation/Pagination/index.d.ts +4 -0
- package/dist/components/navigation/Pagination/types.d.ts +81 -0
- package/dist/components/navigation/Pagination/use-pagination.d.ts +52 -0
- package/dist/components/navigation/Pagination/use-pagination.js +83 -0
- package/dist/components/navigation/Pagination/use-pagination.js.map +1 -0
- 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/navigation/index.d.ts +5 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.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/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +1 -2
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.d.ts +0 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/types.d.ts +0 -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.d.ts +0 -2
- 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/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/index.d.ts +0 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +24 -8
- package/dist/components/shared/DraggableCollection.js.map +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 +203 -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 +36 -1
- package/dist/i18n/locales/en-US/uikit.js +36 -1
- package/dist/i18n/locales/en-US/uikit.json.d.ts +41 -1
- package/dist/i18n/locales/es-ES/uikit.js +36 -1
- package/dist/i18n/locales/es-MX/uikit.js +36 -1
- package/dist/i18n/locales/fr-FR/uikit.js +36 -1
- package/dist/i18n/locales/it-IT/uikit.js +36 -1
- package/dist/i18n/locales/ja-JP/uikit.js +36 -1
- package/dist/i18n/locales/nb-NO/uikit.js +36 -1
- package/dist/i18n/locales/pt-BR/uikit.js +36 -1
- package/dist/i18n/locales/pt-PT/uikit.js +36 -1
- package/dist/i18n/locales/sv-SE/uikit.js +36 -1
- package/dist/i18n/locales/vi-VN/uikit.js +36 -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/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 +22 -15
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.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.d.ts +1 -1
- package/dist/tokens/typography.js +11 -2
- package/dist/tokens/typography.js.map +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/data/DataTable.md +298 -0
- package/docs/components/data/ItemTable.md +984 -0
- package/docs/components/fields/ColorPicker.md +144 -85
- package/docs/components/navigation/Pagination.md +245 -0
- package/package.json +8 -3
- package/dist/components/fields/ColorInput/ColorInput.d.ts +0 -67
- package/dist/components/fields/ColorInput/ColorInput.js +0 -230
- package/dist/components/fields/ColorInput/ColorInput.js.map +0 -1
- package/dist/components/fields/ColorInput/index.d.ts +0 -2
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.d.ts +0 -50
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +0 -269
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +0 -1
- package/dist/components/fields/ColorSwatchGroup/index.d.ts +0 -2
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.d.ts +0 -2
- package/dist/components/fields/color/ColorPanel.js.map +0 -1
- package/dist/components/fields/color/ColorSwatch.d.ts +0 -22
- package/dist/components/fields/color/ColorSwatch.js +0 -58
- package/dist/components/fields/color/ColorSwatch.js.map +0 -1
- package/dist/components/fields/color/channels.js.map +0 -1
- package/dist/components/fields/color/color.d.ts +0 -21
- package/dist/components/fields/color/color.js.map +0 -1
- package/dist/components/fields/color/context.js +0 -20
- package/dist/components/fields/color/context.js.map +0 -1
- package/dist/components/fields/color/index.d.ts +0 -4
- package/dist/components/portal/PortalProvider.d.ts +0 -2
- package/docs/components/fields/ColorInput.md +0 -284
- package/docs/components/fields/ColorSwatchGroup.md +0 -206
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-52c46a3 | Cube Dev Team */
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/data/TableBase/use-table-storage.ts
|
|
5
|
+
/**
|
|
6
|
+
* Namespaced so a `storageKey` cannot collide with whatever else the host app
|
|
7
|
+
* keeps in `localStorage`, and so the kit's own stored shape can be migrated or
|
|
8
|
+
* cleared as a group later.
|
|
9
|
+
*/
|
|
10
|
+
const PREFIX = "cube-ui-kit:table:";
|
|
11
|
+
const DEFAULT_PERSIST_KEYS = ["pageSize", "columnWidths"];
|
|
12
|
+
function read(storageKey) {
|
|
13
|
+
if (!storageKey || typeof window === "undefined") return {};
|
|
14
|
+
try {
|
|
15
|
+
const raw = window.localStorage.getItem(PREFIX + storageKey);
|
|
16
|
+
if (!raw) return {};
|
|
17
|
+
const parsed = JSON.parse(raw);
|
|
18
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
19
|
+
} catch {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Persists the parts of the table's own state that a user expects to survive a
|
|
25
|
+
* reload. Only state the table *owns* is stored: a controlled `pageSize` or
|
|
26
|
+
* `sort` belongs to the page, so restoring it would fight the page's own source
|
|
27
|
+
* of truth.
|
|
28
|
+
*
|
|
29
|
+
* Returns the state read at mount — a one-shot snapshot, deliberately, so a
|
|
30
|
+
* second table sharing the key cannot yank this one's page size mid-session.
|
|
31
|
+
*/
|
|
32
|
+
function useTableStorage(storageKey, persist = DEFAULT_PERSIST_KEYS) {
|
|
33
|
+
const [initial] = useState(() => read(storageKey));
|
|
34
|
+
const persistRef = useRef(persist);
|
|
35
|
+
persistRef.current = persist;
|
|
36
|
+
const write = useCallback((patch) => {
|
|
37
|
+
if (!storageKey || typeof window === "undefined") return;
|
|
38
|
+
const allowed = persistRef.current;
|
|
39
|
+
const entries = Object.entries(patch).filter(([key]) => allowed.includes(key));
|
|
40
|
+
if (!entries.length) return;
|
|
41
|
+
try {
|
|
42
|
+
const next = {
|
|
43
|
+
...read(storageKey),
|
|
44
|
+
...Object.fromEntries(entries)
|
|
45
|
+
};
|
|
46
|
+
window.localStorage.setItem(PREFIX + storageKey, JSON.stringify(next));
|
|
47
|
+
} catch {}
|
|
48
|
+
}, [storageKey]);
|
|
49
|
+
return {
|
|
50
|
+
initial: storageKey ? initial : {},
|
|
51
|
+
has: (key) => !!storageKey && persist.includes(key),
|
|
52
|
+
write
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { useTableStorage };
|
|
58
|
+
//# sourceMappingURL=use-table-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-table-storage.js","names":[],"sources":["../../../../src/components/data/TableBase/use-table-storage.ts"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\n\nimport type { CubeTableSort } from './types';\n\n/**\n * Namespaced so a `storageKey` cannot collide with whatever else the host app\n * keeps in `localStorage`, and so the kit's own stored shape can be migrated or\n * cleared as a group later.\n */\nconst PREFIX = 'cube-ui-kit:table:';\n\nexport type CubeTablePersistKey = 'pageSize' | 'columnWidths' | 'sort';\n\nexport interface CubeTableStoredState {\n pageSize?: number;\n sort?: CubeTableSort | null;\n columnWidths?: Record<string, number>;\n}\n\nexport const DEFAULT_PERSIST_KEYS: CubeTablePersistKey[] = [\n 'pageSize',\n 'columnWidths',\n];\n\nfunction read(storageKey: string | undefined): CubeTableStoredState {\n // No `storageKey` means the feature is off; no `window` means SSR. Both are\n // normal, not errors.\n if (!storageKey || typeof window === 'undefined') return {};\n\n try {\n const raw = window.localStorage.getItem(PREFIX + storageKey);\n\n if (!raw) return {};\n\n const parsed = JSON.parse(raw);\n\n // Anything could be under that key — a hand-edited value, a stale shape\n // from an older version. A non-object is simply ignored.\n return parsed && typeof parsed === 'object' ? parsed : {};\n } catch {\n // Private mode, a disabled store, or malformed JSON. Persistence is a\n // convenience; losing it must never take the table down with it.\n return {};\n }\n}\n\n/**\n * Persists the parts of the table's own state that a user expects to survive a\n * reload. Only state the table *owns* is stored: a controlled `pageSize` or\n * `sort` belongs to the page, so restoring it would fight the page's own source\n * of truth.\n *\n * Returns the state read at mount — a one-shot snapshot, deliberately, so a\n * second table sharing the key cannot yank this one's page size mid-session.\n */\nexport function useTableStorage(\n storageKey: string | undefined,\n persist: CubeTablePersistKey[] = DEFAULT_PERSIST_KEYS,\n) {\n const [initial] = useState(() => read(storageKey));\n const persistRef = useRef(persist);\n\n persistRef.current = persist;\n\n const write = useCallback(\n (patch: CubeTableStoredState) => {\n if (!storageKey || typeof window === 'undefined') return;\n\n const allowed = persistRef.current;\n const entries = Object.entries(patch).filter(([key]) =>\n allowed.includes(key as CubeTablePersistKey),\n );\n\n if (!entries.length) return;\n\n try {\n const next = {\n ...read(storageKey),\n ...Object.fromEntries(entries),\n };\n\n window.localStorage.setItem(PREFIX + storageKey, JSON.stringify(next));\n } catch {\n // Quota exceeded or a disabled store — nothing to do but carry on.\n }\n },\n [storageKey],\n );\n\n return {\n initial: storageKey ? initial : {},\n /** `true` when this key is persisted, so callers can skip the work. */\n has: (key: CubeTablePersistKey) => !!storageKey && persist.includes(key),\n write,\n };\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,SAAS;AAUf,MAAa,uBAA8C,CACzD,YACA,eACD;AAED,SAAS,KAAK,YAAsD;AAGlE,KAAI,CAAC,cAAc,OAAO,WAAW,YAAa,QAAO,EAAE;AAE3D,KAAI;EACF,MAAM,MAAM,OAAO,aAAa,QAAQ,SAAS,WAAW;AAE5D,MAAI,CAAC,IAAK,QAAO,EAAE;EAEnB,MAAM,SAAS,KAAK,MAAM,IAAI;AAI9B,SAAO,UAAU,OAAO,WAAW,WAAW,SAAS,EAAE;SACnD;AAGN,SAAO,EAAE;;;;;;;;;;;;AAab,SAAgB,gBACd,YACA,UAAiC,sBACjC;CACA,MAAM,CAAC,WAAW,eAAe,KAAK,WAAW,CAAC;CAClD,MAAM,aAAa,OAAO,QAAQ;AAElC,YAAW,UAAU;CAErB,MAAM,QAAQ,aACX,UAAgC;AAC/B,MAAI,CAAC,cAAc,OAAO,WAAW,YAAa;EAElD,MAAM,UAAU,WAAW;EAC3B,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,QAAQ,CAAC,SAC7C,QAAQ,SAAS,IAA2B,CAC7C;AAED,MAAI,CAAC,QAAQ,OAAQ;AAErB,MAAI;GACF,MAAM,OAAO;IACX,GAAG,KAAK,WAAW;IACnB,GAAG,OAAO,YAAY,QAAQ;IAC/B;AAED,UAAO,aAAa,QAAQ,SAAS,YAAY,KAAK,UAAU,KAAK,CAAC;UAChE;IAIV,CAAC,WAAW,CACb;AAED,QAAO;EACL,SAAS,aAAa,UAAU,EAAE;EAElC,MAAM,QAA6B,CAAC,CAAC,cAAc,QAAQ,SAAS,IAAI;EACxE;EACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { CubeTableAlign, CubeTableCellContext, CubeTableColumn, CubeTableColumnHeader, CubeTableHeaderContext, CubeTableRowContext, CubeTableRowSection, CubeTableSort, CubeTableSortDirection } from "./TableBase/types.js";
|
|
3
|
+
import { CubeDataTableColumn, CubeDataTableProps } from "./DataTable/types.js";
|
|
4
|
+
import { _DataTable } from "./DataTable/DataTable.js";
|
|
5
|
+
import "./DataTable/index.js";
|
|
6
|
+
import { CubeTableRowRenderProps } from "./TableBase/TableView.js";
|
|
7
|
+
import { CubeItemTableColumn, CubeItemTableProps } from "./ItemTable/types.js";
|
|
8
|
+
import { _ItemTable } from "./ItemTable/ItemTable.js";
|
|
9
|
+
import "./ItemTable/index.js";
|
|
10
|
+
import "./TableBase/index.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-52c46a3 | 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 { _Text } from "../../content/Text.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-52c46a3 | 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 { FormContext } from "../../form/Form/Form.js";
|
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
|
|
2
2
|
import { FieldBaseProps } from "../../../shared/form.js";
|
|
3
3
|
import "../../../shared/index.js";
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ColorSpace } from "../color/channels.js";
|
|
8
|
-
import { CubeColorSwatchItem } from "../ColorSwatchGroup/ColorSwatchGroup.js";
|
|
9
|
-
import "../ColorSwatchGroup/index.js";
|
|
10
|
-
import { BaseProps, BlockStyleProps, OuterStyleProps, Styles } from "@tenphi/tasty";
|
|
4
|
+
import { ColorFormat } from "./color.js";
|
|
5
|
+
import { ColorSpace } from "./channels.js";
|
|
6
|
+
import { BaseProps, BaseStyleProps, BlockStyleProps, ColorStyleProps, OuterStyleProps, Styles } from "@tenphi/tasty";
|
|
11
7
|
import * as react from "react";
|
|
12
|
-
import {
|
|
8
|
+
import { FocusEvent } from "react";
|
|
13
9
|
|
|
14
10
|
//#region src/components/fields/ColorPicker/ColorPicker.d.ts
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* How the text in the input relates to the committed value.
|
|
13
|
+
*
|
|
14
|
+
* - `forced` — the text is rewritten in `format` whenever it is not mid-edit,
|
|
15
|
+
* and the value is always written in `format`.
|
|
16
|
+
* - `derive` — the user's own notation is left alone, and the value is
|
|
17
|
+
* normalized in whichever notation the text is written in.
|
|
18
|
+
* - `free` — the text *is* the value, verbatim. It is still verified, so an
|
|
19
|
+
* unparsable entry falls back to the last valid one.
|
|
20
|
+
*/
|
|
21
|
+
type ColorPickerFormatMode = 'forced' | 'derive' | 'free';
|
|
22
|
+
interface CubeColorPickerProps extends BaseProps, BaseStyleProps, OuterStyleProps, BlockStyleProps, ColorStyleProps, FieldBaseProps {
|
|
16
23
|
/** The selected color, as a color string. */
|
|
17
24
|
value?: string | null;
|
|
18
25
|
/** The initial color of an uncontrolled picker. */
|
|
19
26
|
defaultValue?: string | null;
|
|
20
|
-
/** Called with the color string, or `null` when
|
|
27
|
+
/** Called with the normalized color string, or `null` when the field is cleared. */
|
|
21
28
|
onChange?: (value: string | null) => void;
|
|
22
|
-
/** Notation the value is written in. */
|
|
29
|
+
/** Notation the value is written in, and the one `forced` mode displays. */
|
|
23
30
|
format?: ColorFormat;
|
|
31
|
+
/** How strictly the input text is tied to `format`. */
|
|
32
|
+
formatMode?: ColorPickerFormatMode;
|
|
24
33
|
/** Color concept the popover opens with. */
|
|
25
34
|
defaultSpace?: ColorSpace;
|
|
26
35
|
/** Whether the popover is open. Makes the disclosure controlled. */
|
|
@@ -29,36 +38,30 @@ interface CubeColorPickerProps extends BaseProps, OuterStyleProps, BlockStylePro
|
|
|
29
38
|
defaultOpen?: boolean;
|
|
30
39
|
/** Called when the popover opens or closes. */
|
|
31
40
|
onOpenChange?: (isOpen: boolean) => void;
|
|
32
|
-
/** Whether the popover may flip to the other side of the
|
|
41
|
+
/** Whether the popover may flip to the other side of the input. */
|
|
33
42
|
shouldFlip?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/** Tooltip for the trigger, separate from the field tooltip. */
|
|
44
|
-
triggerTooltip?: CubeItemProps['tooltip'];
|
|
45
|
-
/** Colors to offer under the editor, for picking without dialing one in. */
|
|
46
|
-
swatches?: CubeColorSwatchItem[];
|
|
47
|
-
/** How many swatches per row. Defaults to a single row. */
|
|
48
|
-
swatchColumns?: number;
|
|
43
|
+
/** Text shown while the field is empty. */
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
/** The size of the input. */
|
|
46
|
+
size?: 'small' | 'medium' | 'large' | (string & {});
|
|
47
|
+
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
48
|
+
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
49
|
+
'aria-label'?: string;
|
|
50
|
+
'aria-labelledby'?: string;
|
|
51
|
+
'aria-describedby'?: string;
|
|
49
52
|
styles?: Styles;
|
|
50
|
-
/** Styles of the
|
|
53
|
+
/** Styles of the text input element. */
|
|
54
|
+
inputStyles?: Styles;
|
|
55
|
+
/** Styles of the popover trigger button. */
|
|
51
56
|
triggerStyles?: Styles;
|
|
52
|
-
/** Styles of the color swatch. */
|
|
57
|
+
/** Styles of the color swatch shown inside the input. */
|
|
53
58
|
swatchStyles?: Styles;
|
|
54
|
-
'aria-label'?: string;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
|
-
* A color
|
|
58
|
-
*
|
|
59
|
-
* typed: a toolbar, a chart legend, a cell in a dense table.
|
|
61
|
+
* A color field: the color as text, a swatch of the current value, and a
|
|
62
|
+
* popover to dial it in across OKHST, OKLCH and RGB.
|
|
60
63
|
*/
|
|
61
64
|
declare const ColorPicker: react.ForwardRefExoticComponent<CubeColorPickerProps & react.RefAttributes<HTMLElement>>;
|
|
62
65
|
//#endregion
|
|
63
|
-
export { ColorPicker, CubeColorPickerProps };
|
|
66
|
+
export { ColorPicker, ColorPickerFormatMode, CubeColorPickerProps };
|
|
64
67
|
//# sourceMappingURL=ColorPicker.d.ts.map
|
|
@@ -1,188 +1,239 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
2
|
-
import {
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-52c46a3 | Cube Dev Team */
|
|
2
|
+
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getValidationTheme } from "../../form/validation/resolve-validation-props.js";
|
|
7
|
-
import { getValidationIcon } from "../../form/validation/ValidationIndicator.js";
|
|
4
|
+
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
5
|
+
import { PipetteIcon } from "../../../icons/PipetteIcon.js";
|
|
8
6
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
9
|
-
import { wrapWithField } from "../../form/wrapper.js";
|
|
10
7
|
import { Dialog } from "../../overlays/Dialog/Dialog.js";
|
|
11
8
|
import { DialogTrigger } from "../../overlays/Dialog/DialogTrigger.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { ColorInput } from "../ColorInput/ColorInput.js";
|
|
17
|
-
import { ColorSwatchGroup } from "../ColorSwatchGroup/ColorSwatchGroup.js";
|
|
18
|
-
import { BLOCK_STYLES, OUTER_STYLES, tasty } from "@tenphi/tasty";
|
|
9
|
+
import { TextInputBase } from "../TextInput/TextInputBase.js";
|
|
10
|
+
import { detectFormat, formatColor, parseColor, toHex } from "./color.js";
|
|
11
|
+
import { ColorPickerPanel } from "./ColorPickerPanel.js";
|
|
12
|
+
import { tasty } from "@tenphi/tasty";
|
|
19
13
|
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
20
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { useTextField } from "react-aria";
|
|
21
16
|
|
|
22
17
|
//#region src/components/fields/ColorPicker/ColorPicker.tsx
|
|
23
|
-
/**
|
|
24
|
-
* A popover caps its height at half the viewport. The panel can exceed that on
|
|
25
|
-
* a short screen, and would otherwise spill outside the popover's own border.
|
|
26
|
-
*/
|
|
27
|
-
const POPOVER_STYLES = { overflow: "auto" };
|
|
28
|
-
/**
|
|
29
|
-
* The rule separating the palette from the editor. `Divider` is not used: it
|
|
30
|
-
* places itself on named grid lines meant for menu layouts, which this panel
|
|
31
|
-
* does not define, so it lands in the wrong row and spawns a stray column.
|
|
32
|
-
*/
|
|
33
|
-
const PALETTE_STYLES = {
|
|
34
|
-
border: "top",
|
|
35
|
-
padding: "1x top",
|
|
36
|
-
width: "100%"
|
|
37
|
-
};
|
|
38
18
|
/** What the popover starts from when there is no color to edit yet. */
|
|
39
19
|
const FALLBACK_COLOR = {
|
|
40
20
|
h: 264,
|
|
41
21
|
s: .8,
|
|
42
22
|
l: .6
|
|
43
23
|
};
|
|
44
|
-
const
|
|
45
|
-
qa: "
|
|
24
|
+
const SwatchElement = tasty({
|
|
25
|
+
qa: "ColorSwatch",
|
|
46
26
|
styles: {
|
|
47
|
-
display: "
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
27
|
+
display: "block",
|
|
28
|
+
width: "2.5x",
|
|
29
|
+
height: "2.5x",
|
|
30
|
+
radius: "1r",
|
|
31
|
+
fill: {
|
|
32
|
+
"": "(#color-picker, #clear)",
|
|
33
|
+
empty: "#clear"
|
|
34
|
+
},
|
|
35
|
+
shadow: "inset 0 0 0 1bw #dark.15",
|
|
36
|
+
image: {
|
|
37
|
+
"": false,
|
|
38
|
+
empty: "linear-gradient(to bottom right, #clear 46%, #danger 46%, #danger 54%, #clear 54%)"
|
|
39
|
+
}
|
|
52
40
|
}
|
|
53
41
|
});
|
|
42
|
+
const ColorPickerButton = tasty(ItemAction, {
|
|
43
|
+
qa: "ColorPickerButton",
|
|
44
|
+
icon: /* @__PURE__ */ jsx(PipetteIcon, {})
|
|
45
|
+
});
|
|
54
46
|
/**
|
|
55
|
-
* A color
|
|
56
|
-
*
|
|
57
|
-
* typed: a toolbar, a chart legend, a cell in a dense table.
|
|
47
|
+
* A color field: the color as text, a swatch of the current value, and a
|
|
48
|
+
* popover to dial it in across OKHST, OKLCH and RGB.
|
|
58
49
|
*/
|
|
59
50
|
const ColorPicker = forwardRef(function ColorPicker(allProps, ref) {
|
|
60
51
|
const props = useFieldProps(allProps, {
|
|
61
|
-
defaultValidationTrigger: "
|
|
52
|
+
defaultValidationTrigger: "onBlur",
|
|
62
53
|
valuePropsMapper: ({ value, onChange }) => ({
|
|
63
54
|
value,
|
|
64
55
|
onChange
|
|
65
56
|
})
|
|
66
57
|
});
|
|
67
|
-
const { qa,
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const isEditingDisabled = isDisabled || isLoading;
|
|
75
|
-
const [color, setColor] = useState(() => parseColor((value ?? defaultValue ?? "").toString()));
|
|
58
|
+
const { qa, value, defaultValue, onChange, format = "hex", formatMode = "forced", defaultSpace = "hst", isOpen: controlledOpen, defaultOpen, onOpenChange, shouldFlip, placeholder = "Pick a color", size, isDisabled, isReadOnly, isInvalid, isValid, isLoading, autoFocus, inputStyles, triggerStyles, swatchStyles, labelProps: userLabelProps, onBlur: userOnBlur, onFocus, label, description, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, id } = props;
|
|
59
|
+
const initialText = (value ?? defaultValue ?? "").toString();
|
|
60
|
+
const [text, setText] = useState(() => {
|
|
61
|
+
const parsed = parseColor(initialText);
|
|
62
|
+
return parsed && formatMode === "forced" ? formatColor(parsed, format) : initialText;
|
|
63
|
+
});
|
|
64
|
+
const [color, setColor] = useState(() => parseColor(initialText));
|
|
76
65
|
const [space, setSpace] = useState(defaultSpace);
|
|
77
66
|
const [isOpen, setOpen] = useState(defaultOpen ?? false);
|
|
78
|
-
|
|
67
|
+
const targetRef = useRef(null);
|
|
68
|
+
const inputRef = useRef(null);
|
|
69
|
+
/** The last text that parsed, so an invalid entry has something to fall back to. */
|
|
70
|
+
const validText = useRef(parseColor(initialText) ? text : "");
|
|
71
|
+
/** What was last handed to `onChange`, to tell our own updates from outside ones. */
|
|
79
72
|
const emitted = useRef(value);
|
|
73
|
+
const emit = useEvent((next) => {
|
|
74
|
+
emitted.current = next;
|
|
75
|
+
onChange?.(next);
|
|
76
|
+
});
|
|
77
|
+
/** The notation a value should be written in, given the current text. */
|
|
78
|
+
const outputFormat = (source) => formatMode === "forced" ? format : detectFormat(source) ?? format;
|
|
80
79
|
useEffect(() => {
|
|
81
80
|
if (value === void 0 || value === emitted.current) return;
|
|
82
81
|
emitted.current = value;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
const raw = (value ?? "").toString();
|
|
83
|
+
const parsed = parseColor(raw);
|
|
84
|
+
const nextText = parsed && formatMode === "forced" ? formatColor(parsed, format) : raw;
|
|
85
|
+
setColor(parsed);
|
|
86
|
+
setText(nextText);
|
|
87
|
+
validText.current = parsed ? nextText : "";
|
|
88
|
+
}, [
|
|
89
|
+
value,
|
|
90
|
+
format,
|
|
91
|
+
formatMode
|
|
92
|
+
]);
|
|
93
|
+
const handleTextChange = useEvent((nextText) => {
|
|
94
|
+
setText(nextText);
|
|
95
|
+
if (!nextText.trim()) {
|
|
96
|
+
setColor(null);
|
|
97
|
+
validText.current = "";
|
|
98
|
+
emit(null);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const parsed = parseColor(nextText);
|
|
102
|
+
if (!parsed) return;
|
|
103
|
+
setColor(parsed);
|
|
104
|
+
validText.current = nextText;
|
|
105
|
+
emit(formatMode === "free" ? nextText.trim() : formatColor(parsed, outputFormat(nextText)));
|
|
106
|
+
});
|
|
107
|
+
/** Resolve whatever is in the input into a real color, or undo it. */
|
|
108
|
+
const settle = useEvent(() => {
|
|
109
|
+
if (!text.trim()) return;
|
|
110
|
+
const parsed = parseColor(text);
|
|
111
|
+
if (!parsed) {
|
|
112
|
+
setText(validText.current);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (formatMode === "forced") setText(formatColor(parsed, format));
|
|
90
116
|
});
|
|
91
|
-
const colorText = color ? formatColor(color, format) : null;
|
|
92
117
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
118
|
+
* Focusing offers the whole value up for replacement, the way a hex field
|
|
119
|
+
* does. The string is the unit of editing here: a single channel is tuned
|
|
120
|
+
* with the sliders, not by hand-editing one number inside `oklch(…)`.
|
|
121
|
+
*
|
|
122
|
+
* Read off the event rather than `inputRef`, which `TextInputBase` re-points
|
|
123
|
+
* through `useCombinedRefs`.
|
|
96
124
|
*/
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
125
|
+
const handleFocus = useEvent((event) => {
|
|
126
|
+
event.currentTarget.select();
|
|
127
|
+
onFocus?.(event);
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* A click would otherwise drop a caret and undo that selection — the browser
|
|
131
|
+
* applies it after the focus handler has run. Suppressing the default action
|
|
132
|
+
* of the focusing press means no caret is ever placed; focus is then moved
|
|
133
|
+
* here instead, which selects.
|
|
134
|
+
*
|
|
135
|
+
* Only the press that *takes* focus is suppressed, so clicking a field that
|
|
136
|
+
* already has focus still positions the caret, and dragging still selects a
|
|
137
|
+
* range.
|
|
138
|
+
*/
|
|
139
|
+
const handleMouseDown = useEvent((event) => {
|
|
140
|
+
if (document.activeElement === event.currentTarget) return;
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
event.currentTarget.focus();
|
|
143
|
+
});
|
|
144
|
+
const handleBlur = useEvent((event) => {
|
|
145
|
+
settle();
|
|
146
|
+
userOnBlur?.(event);
|
|
147
|
+
});
|
|
148
|
+
const handleKeyDown = useEvent((event) => {
|
|
149
|
+
if (event.key === "Enter") settle();
|
|
150
|
+
});
|
|
151
|
+
const handleColorChange = useEvent((nextColor) => {
|
|
152
|
+
const nextText = formatColor(nextColor, outputFormat(text));
|
|
153
|
+
setColor(nextColor);
|
|
154
|
+
setText(nextText);
|
|
155
|
+
validText.current = nextText;
|
|
156
|
+
emit(nextText);
|
|
101
157
|
});
|
|
102
158
|
const handleOpenChange = useEvent((next) => {
|
|
103
159
|
setOpen(next);
|
|
104
160
|
onOpenChange?.(next);
|
|
105
161
|
});
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
162
|
+
const { labelProps, inputProps } = useTextField({
|
|
163
|
+
id,
|
|
164
|
+
label,
|
|
165
|
+
description,
|
|
166
|
+
"aria-label": ariaLabel,
|
|
167
|
+
"aria-labelledby": ariaLabelledby,
|
|
168
|
+
"aria-describedby": ariaDescribedby,
|
|
169
|
+
isDisabled,
|
|
170
|
+
isReadOnly,
|
|
171
|
+
isInvalid,
|
|
172
|
+
autoFocus,
|
|
173
|
+
placeholder,
|
|
174
|
+
value: text,
|
|
175
|
+
type: "text",
|
|
176
|
+
onChange: handleTextChange,
|
|
177
|
+
onFocus: handleFocus,
|
|
178
|
+
onBlur: handleBlur,
|
|
179
|
+
onKeyDown: handleKeyDown
|
|
180
|
+
}, inputRef);
|
|
181
|
+
return /* @__PURE__ */ jsx(TextInputBase, {
|
|
182
|
+
...props,
|
|
183
|
+
ref,
|
|
184
|
+
qa: qa || "ColorPicker",
|
|
185
|
+
size,
|
|
186
|
+
autocomplete: "off",
|
|
187
|
+
icon: /* @__PURE__ */ jsx(SwatchElement, {
|
|
188
|
+
mods: { empty: !color },
|
|
189
|
+
styles: swatchStyles,
|
|
190
|
+
style: color ? { "--color-picker-color": toHex(color) } : void 0
|
|
191
|
+
}),
|
|
192
|
+
inputRef,
|
|
193
|
+
inputProps: {
|
|
194
|
+
...inputProps,
|
|
195
|
+
spellCheck: false,
|
|
196
|
+
onMouseDown: handleMouseDown
|
|
197
|
+
},
|
|
198
|
+
inputStyles,
|
|
199
|
+
labelProps: mergeProps$1(labelProps, userLabelProps),
|
|
200
|
+
wrapperRef: targetRef,
|
|
201
|
+
isDisabled,
|
|
202
|
+
isReadOnly,
|
|
203
|
+
isInvalid,
|
|
204
|
+
isValid,
|
|
205
|
+
isLoading,
|
|
206
|
+
suffixPosition: "after",
|
|
207
|
+
suffix: /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
110
208
|
hideArrow: true,
|
|
111
209
|
type: "popover",
|
|
112
210
|
mobileType: "tray",
|
|
113
|
-
placement: "bottom
|
|
211
|
+
placement: "bottom right",
|
|
212
|
+
targetRef,
|
|
114
213
|
isOpen: controlledOpen ?? isOpen,
|
|
115
214
|
shouldFlip,
|
|
116
215
|
onOpenChange: handleOpenChange,
|
|
117
|
-
children: [/* @__PURE__ */ jsx(
|
|
118
|
-
"data-popover-trigger": true,
|
|
119
|
-
id,
|
|
120
|
-
qa: qa || "ColorPickerTrigger",
|
|
121
|
-
"data-input-type": "colorpicker",
|
|
122
|
-
type,
|
|
123
|
-
theme: getValidationTheme(theme, {
|
|
124
|
-
isInvalid,
|
|
125
|
-
isValid
|
|
126
|
-
}),
|
|
216
|
+
children: [/* @__PURE__ */ jsx(ColorPickerButton, {
|
|
127
217
|
size,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}),
|
|
132
|
-
rightIcon: getValidationIcon({
|
|
133
|
-
isInvalid,
|
|
134
|
-
isValid
|
|
135
|
-
}),
|
|
136
|
-
tooltip: triggerTooltip,
|
|
137
|
-
isDisabled: isEditingDisabled || isReadOnly,
|
|
138
|
-
autoFocus,
|
|
139
|
-
"aria-label": ariaLabel,
|
|
140
|
-
mods: { placeholder: !color },
|
|
141
|
-
styles: triggerStyles,
|
|
142
|
-
children: label
|
|
218
|
+
"aria-label": "Open the color picker",
|
|
219
|
+
isDisabled: isDisabled || isReadOnly,
|
|
220
|
+
styles: triggerStyles
|
|
143
221
|
}), /* @__PURE__ */ jsx(Dialog, {
|
|
144
222
|
"aria-label": "Color picker",
|
|
145
223
|
width: "max-content",
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
previewFormat: format,
|
|
154
|
-
input: /* @__PURE__ */ jsx(ColorInput, {
|
|
155
|
-
"aria-label": "Color value",
|
|
156
|
-
format,
|
|
157
|
-
value: colorText,
|
|
158
|
-
isDisabled: isEditingDisabled,
|
|
159
|
-
isReadOnly,
|
|
160
|
-
onChange: handleValueChange
|
|
161
|
-
}),
|
|
162
|
-
swatches: swatches?.length ? /* @__PURE__ */ jsx(ColorSwatchGroup, {
|
|
163
|
-
"aria-label": "Palette",
|
|
164
|
-
styles: PALETTE_STYLES,
|
|
165
|
-
colors: swatches,
|
|
166
|
-
columns: swatchColumns,
|
|
167
|
-
format,
|
|
168
|
-
value: colorText,
|
|
169
|
-
isDisabled: isEditingDisabled || isReadOnly,
|
|
170
|
-
onChange: handleValueChange
|
|
171
|
-
}) : null,
|
|
172
|
-
onChange: handleColorChange,
|
|
173
|
-
onSpaceChange: setSpace
|
|
174
|
-
})
|
|
224
|
+
children: /* @__PURE__ */ jsx(ColorPickerPanel, {
|
|
225
|
+
color: color ?? FALLBACK_COLOR,
|
|
226
|
+
space,
|
|
227
|
+
isDisabled: isDisabled || isReadOnly,
|
|
228
|
+
previewFormat: outputFormat(text),
|
|
229
|
+
onChange: handleColorChange,
|
|
230
|
+
onSpaceChange: setSpace
|
|
175
231
|
})
|
|
176
232
|
})]
|
|
177
233
|
})
|
|
178
|
-
})
|
|
234
|
+
});
|
|
179
235
|
});
|
|
180
|
-
|
|
181
|
-
* Drives the legacy `<Field>` wiring: `Picker` validates on change and passes
|
|
182
|
-
* the value through untouched, where `Text` would default to `onBlur` and
|
|
183
|
-
* coerce `null` into an empty string.
|
|
184
|
-
*/
|
|
185
|
-
ColorPicker.cubeInputType = "Picker";
|
|
236
|
+
ColorPicker.cubeInputType = "Text";
|
|
186
237
|
|
|
187
238
|
//#endregion
|
|
188
239
|
export { ColorPicker };
|