@cube-dev/ui-kit 0.165.0 → 0.167.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/dist/CHANGELOG.md +48 -0
- package/dist/README.md +4 -7
- 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 +4 -4
- 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 -2
- package/dist/components/Root.js.map +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.d.ts +1 -0
- package/dist/components/actions/Button/Button.js +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.d.ts +7 -3
- package/dist/components/actions/use-anchored-menu.js +17 -12
- package/dist/components/actions/use-anchored-menu.js.map +1 -1
- package/dist/components/actions/use-context-menu.d.ts +6 -3
- package/dist/components/actions/use-context-menu.js +25 -13
- 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 +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/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.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/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-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.d.ts +2 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.d.ts +1 -0
- 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/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 +1 -1
- 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 +1 -0
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.d.ts +2 -0
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/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/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/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.d.ts +33 -7
- package/dist/components/layout/Board/Board.js +29 -11
- 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.d.ts +6 -3
- package/dist/components/layout/Board/BoardResponsive.js +3 -3
- package/dist/components/layout/Board/BoardResponsive.js.map +1 -1
- package/dist/components/layout/Board/Widget.d.ts +38 -1
- package/dist/components/layout/Board/Widget.js +6 -2
- package/dist/components/layout/Board/Widget.js.map +1 -1
- package/dist/components/layout/Board/WidgetHost.js +69 -18
- 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-context.js.map +1 -1
- package/dist/components/layout/Board/board-store.js +2 -2
- package/dist/components/layout/Board/board-store.js.map +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.d.ts +58 -0
- package/dist/components/layout/Board/grid-core/placement.js +153 -0
- package/dist/components/layout/Board/grid-core/placement.js.map +1 -0
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.d.ts +3 -1
- package/dist/components/layout/Board/index.js +2 -1
- package/dist/components/layout/Board/index.js.map +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.d.ts +26 -0
- package/dist/components/layout/Board/use-board-layout.js +4 -4
- package/dist/components/layout/Board/use-board-layout.js.map +1 -1
- package/dist/components/layout/Board/use-board-registry.js +5 -56
- package/dist/components/layout/Board/use-board-registry.js.map +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/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +2 -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.d.ts +1 -0
- 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 +1 -0
- 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 +2 -0
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +2 -1
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.d.ts +2 -0
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/index.d.ts +1 -0
- 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 +25 -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 +7 -3
- package/dist/index.js +5 -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.d.ts +10 -0
- package/dist/tokens/{index.js → all-tokens.js} +7 -25
- package/dist/tokens/all-tokens.js.map +1 -0
- package/dist/tokens/base.js +2 -1
- package/dist/tokens/base.js.map +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/index.d.ts +3 -10
- 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/resolve.d.ts +113 -0
- package/dist/tokens/resolve.js +403 -0
- package/dist/tokens/resolve.js.map +1 -0
- 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/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/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/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 +3 -3
- package/docs/Colors.md +16 -40
- package/docs/ComplexLayout.md +8 -0
- package/docs/CreateComponent.md +15 -8
- package/docs/Introduction.md +15 -36
- package/docs/RenderCache.md +8 -6
- package/docs/Theming.md +164 -497
- package/docs/Usage.md +129 -138
- package/docs/Utilities.md +2 -2
- package/docs/components/CollectionItem.md +1 -0
- package/docs/components/actions/Banner.md +1 -0
- package/docs/components/actions/Button.md +8 -36
- package/docs/components/actions/ButtonSplit.md +2 -0
- package/docs/components/actions/CommandMenu.md +8 -8
- package/docs/components/actions/ItemButton.md +6 -20
- package/docs/components/actions/Link.md +10 -5
- package/docs/components/actions/Menu.md +24 -11
- package/docs/components/actions/MenuTrigger.md +3 -12
- package/docs/components/actions/use-anchored-menu.md +5 -5
- package/docs/components/actions/use-context-menu.md +11 -7
- package/docs/components/content/Badge.md +3 -0
- package/docs/components/content/HotKeys.md +21 -14
- package/docs/components/content/InlineInput.md +14 -14
- package/docs/components/content/Item.md +25 -17
- package/docs/components/content/ItemCard.md +1 -0
- package/docs/components/content/Layout.md +12 -1
- package/docs/components/content/PrismCode.md +13 -18
- package/docs/components/content/Tag.md +1 -1
- package/docs/components/content/TextItem.md +5 -3
- package/docs/components/content/Tree.md +69 -154
- package/docs/components/data/DataTable.md +56 -168
- package/docs/components/data/ItemTable.md +182 -485
- package/docs/components/fields/Checkbox.md +2 -0
- package/docs/components/fields/ColorInput.md +38 -79
- package/docs/components/fields/ColorPicker.md +17 -39
- package/docs/components/fields/ColorSwatch.md +11 -30
- package/docs/components/fields/ColorSwatchGroup.md +18 -42
- package/docs/components/fields/ComboBox.md +13 -1
- package/docs/components/fields/CommandTextArea.md +10 -37
- package/docs/components/fields/DatePicker.md +3 -0
- package/docs/components/fields/FileInput.md +3 -0
- package/docs/components/fields/FilterListBox.md +34 -14
- package/docs/components/fields/FilterPicker.md +33 -16
- package/docs/components/fields/HueSlider.md +5 -5
- package/docs/components/fields/ListBox.md +35 -9
- package/docs/components/fields/NumberInput.md +3 -0
- package/docs/components/fields/PasswordInput.md +3 -0
- package/docs/components/fields/PeriodPicker.md +7 -17
- package/docs/components/fields/Picker.md +54 -29
- package/docs/components/fields/RadioGroup.md +13 -5
- package/docs/components/fields/SearchComboBox.md +3 -0
- package/docs/components/fields/SearchInput.md +4 -2
- package/docs/components/fields/Select.md +23 -13
- package/docs/components/fields/Switch.md +3 -0
- package/docs/components/fields/TextInput.md +3 -0
- package/docs/components/fields/TextInputMapper.md +1 -2
- package/docs/components/form/Field.md +5 -2
- package/docs/components/form/Form.md +5 -0
- package/docs/components/form/FormInstance.md +1 -1
- package/docs/components/helpers/DisplayTransition.md +10 -6
- package/docs/components/helpers/IconSwitch.md +1 -0
- package/docs/components/layout/Board.md +89 -193
- package/docs/components/navigation/Pagination.md +36 -75
- package/docs/components/navigation/Tabs.md +3 -15
- package/docs/components/other/Calendar.md +22 -39
- package/docs/components/other/CubeLogo.md +1 -1
- package/docs/components/overlays/Dialog.md +3 -0
- package/docs/components/overlays/DialogContainer.md +2 -0
- package/docs/components/overlays/DialogForm.md +6 -2
- package/docs/components/overlays/DialogTrigger.md +4 -2
- package/docs/components/overlays/Notifications.md +7 -0
- package/docs/components/overlays/Toast.md +12 -8
- package/docs/components/overlays/Tooltip.md +16 -0
- package/docs/components/overlays/UseDialogContainer.md +16 -10
- package/docs/components/status/LoadingAnimation.md +3 -9
- package/docs/tasty/configuration.md +195 -15
- package/docs/tasty/dsl.md +40 -5
- package/docs/tasty/injector.md +11 -0
- package/docs/tasty/methodology.md +1 -1
- package/docs/tasty/pipeline.md +1 -4
- package/docs/tasty/react-api.md +1 -1
- package/docs/tasty/styles.md +8 -1
- package/package.json +4 -4
- package/dist/tokens/index.js.map +0 -1
|
@@ -1,71 +1,40 @@
|
|
|
1
1
|
# Pagination
|
|
2
2
|
|
|
3
|
-
Pagination is the control for moving through a paged collection. It renders a
|
|
4
|
-
bounded run of page buttons, optional first/last jumps, an optional page-size
|
|
5
|
-
selector, and an optional item-range summary.
|
|
3
|
+
Pagination is the control for moving through a paged collection. It renders a bounded run of page buttons, optional first/last jumps, an optional page-size selector, and an optional item-range summary.
|
|
6
4
|
|
|
7
|
-
It is a pure control: it owns no data. Client-side slicing lives in the
|
|
8
|
-
companion `usePagination` hook, and `ItemTable` composes the two.
|
|
5
|
+
It is a pure control: it owns no data. Client-side slicing lives in the companion `usePagination` hook, and `ItemTable` composes the two.
|
|
9
6
|
|
|
10
7
|
## When to Use
|
|
11
8
|
|
|
12
|
-
- Paging through a list, table, or grid where the user needs to jump around
|
|
13
|
-
|
|
14
|
-
- Cursor pagination with an unknown total — supply `hasNextPage` and omit
|
|
15
|
-
`total`/`totalPages`, and the control degrades to prev/next.
|
|
9
|
+
- Paging through a list, table, or grid where the user needs to jump around rather than scroll.
|
|
10
|
+
- Cursor pagination with an unknown total — supply `hasNextPage` and omit `total`/`totalPages`, and the control degrades to prev/next.
|
|
16
11
|
- Anywhere you need a page-size selector wired to the same state.
|
|
17
12
|
|
|
18
|
-
Prefer infinite scroll when the collection is a feed the user skims, and
|
|
19
|
-
pagination when they need stable, addressable positions.
|
|
13
|
+
Prefer infinite scroll when the collection is a feed the user skims, and pagination when they need stable, addressable positions.
|
|
20
14
|
|
|
21
15
|
## Component
|
|
22
16
|
|
|
23
17
|
### Properties
|
|
24
18
|
|
|
25
|
-
- **`page`** `number` — Controlled current page, 1-based. Pair with
|
|
26
|
-
|
|
27
|
-
- **`
|
|
28
|
-
|
|
29
|
-
- **`
|
|
30
|
-
`1…totalPages` when the total is known.
|
|
31
|
-
- **`total`** `number` — Total items across all pages. Preferred over
|
|
32
|
-
`totalPages`; it also powers the range summary and the `select` type's range
|
|
33
|
-
labels.
|
|
34
|
-
- **`totalPages`** `number` — Total pages. Only needed when the item count is
|
|
35
|
-
genuinely unavailable. Wins over the value derived from `total` + `pageSize`.
|
|
19
|
+
- **`page`** `number` — Controlled current page, 1-based. Pair with `onPageChange`.
|
|
20
|
+
- **`defaultPage`** `number` (default: `1`) — Initial page for uncontrolled usage.
|
|
21
|
+
- **`onPageChange`** `(page: number) => void` — Never fires with a page outside `1…totalPages` when the total is known.
|
|
22
|
+
- **`total`** `number` — Total items across all pages. Preferred over `totalPages`; it also powers the range summary and the `select` type's range labels.
|
|
23
|
+
- **`totalPages`** `number` — Total pages. Only needed when the item count is genuinely unavailable. Wins over the value derived from `total` + `pageSize`.
|
|
36
24
|
- **`pageSize`** `number` — Controlled page size.
|
|
37
|
-
- **`defaultPageSize`** `number` (default: `50`) — Initial page size for
|
|
38
|
-
|
|
39
|
-
- **`
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- **`
|
|
43
|
-
renders the size selector.
|
|
44
|
-
- **`type`** `'numbers' | 'select' | 'compact'` (default: `'numbers'`) — How the
|
|
45
|
-
page control is rendered. `numbers` is the default because it is the only mode
|
|
46
|
-
whose rendered element count is independent of the page count; `select`
|
|
47
|
-
materializes one entry per page, so above a safety cap the component falls
|
|
48
|
-
back to `compact` on its own.
|
|
49
|
-
- **`siblingCount`** `number` (default: `1`) — Page buttons either side of the
|
|
50
|
-
current page.
|
|
51
|
-
- **`boundaryCount`** `number` (default: `1`) — Page buttons pinned at each end.
|
|
52
|
-
Together with `siblingCount` this bounds the rendered count at
|
|
53
|
-
`boundaryCount * 2 + siblingCount * 2 + 3`.
|
|
25
|
+
- **`defaultPageSize`** `number` (default: `50`) — Initial page size for uncontrolled usage.
|
|
26
|
+
- **`onPageSizeChange`** `(pageSize: number) => void` — Changing the size also resets to page 1, because the old page index no longer refers to the same items.
|
|
27
|
+
- **`pageSizeOptions`** `number[]` — Supplying this **and** `onPageSizeChange` renders the size selector.
|
|
28
|
+
- **`type`** `'numbers' | 'select' | 'compact'` (default: `'numbers'`) — How the page control is rendered. `numbers` is the default because it is the only mode whose rendered element count is independent of the page count; `select` materializes one entry per page, so above a safety cap the component falls back to `compact` on its own.
|
|
29
|
+
- **`siblingCount`** `number` (default: `1`) — Page buttons either side of the current page.
|
|
30
|
+
- **`boundaryCount`** `number` (default: `1`) — Page buttons pinned at each end. Together with `siblingCount` this bounds the rendered count at `boundaryCount * 2 + siblingCount * 2 + 3`.
|
|
54
31
|
- **`size`** `'small' | 'medium'` (default: `'small'`) — Control size.
|
|
55
32
|
- **`isDisabled`** `boolean` — Disable every control.
|
|
56
|
-
- **`hasNextPage`** `boolean` — Keeps "next" enabled when the total is unknown.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- **`
|
|
60
|
-
|
|
61
|
-
- **`summary`** `boolean | ((info: CubeTablePageInfo) => ReactNode)` (default:
|
|
62
|
-
`false`) — `true` renders the localized `1–50 of 1,204`, with numbers
|
|
63
|
-
formatted for the active locale. Pass a function for full control.
|
|
64
|
-
- **`labelFormatter`** `(info: CubeTablePageInfo) => ReactNode` — Labels the
|
|
65
|
-
entries of `type="select"`. Receives the page info with `page` set to the
|
|
66
|
-
entry being labelled.
|
|
67
|
-
- **`ariaLabel`** `string` — Labels the `<nav>` landmark. Defaults to the
|
|
68
|
-
localized "Pagination".
|
|
33
|
+
- **`hasNextPage`** `boolean` — Keeps "next" enabled when the total is unknown. Ignored once `total` or `totalPages` is supplied — a known total is always authoritative.
|
|
34
|
+
- **`isCompact`** `boolean` (default: `false`) — Hide the first/last jump buttons.
|
|
35
|
+
- **`summary`** `boolean | ((info: CubeTablePageInfo) => ReactNode)` (default: `false`) — `true` renders the localized `1–50 of 1,204`, with numbers formatted for the active locale. Pass a function for full control.
|
|
36
|
+
- **`labelFormatter`** `(info: CubeTablePageInfo) => ReactNode` — Labels the entries of `type="select"`. Receives the page info with `page` set to the entry being labelled.
|
|
37
|
+
- **`ariaLabel`** `string` — Labels the `<nav>` landmark. Defaults to the localized "Pagination".
|
|
69
38
|
|
|
70
39
|
#### `CubeTablePageInfo`
|
|
71
40
|
|
|
@@ -112,9 +81,9 @@ These properties allow direct style application without using the `styles` prop:
|
|
|
112
81
|
|
|
113
82
|
### Modifiers
|
|
114
83
|
|
|
115
|
-
| Modifier | Type
|
|
116
|
-
| -------- |
|
|
117
|
-
| `size`
|
|
84
|
+
| Modifier | Type | Description |
|
|
85
|
+
| -------- | --------------------- | ------------ |
|
|
86
|
+
| `size` | `'small' \| 'medium'` | Control size |
|
|
118
87
|
|
|
119
88
|
## Examples
|
|
120
89
|
|
|
@@ -204,34 +173,26 @@ Every control is a real `<button>`, so there is nothing bespoke to learn.
|
|
|
204
173
|
|
|
205
174
|
### Screen Reader Support
|
|
206
175
|
|
|
207
|
-
- The root is a `<nav>` landmark labelled "Pagination" (override with
|
|
208
|
-
`ariaLabel`).
|
|
176
|
+
- The root is a `<nav>` landmark labelled "Pagination" (override with `ariaLabel`).
|
|
209
177
|
- The current page button carries `aria-current="page"`.
|
|
210
|
-
- Every button has an explicit `aria-label` — "Page 3", "Next page", and so on
|
|
211
|
-
— so an icon-only button is never announced as unlabelled.
|
|
178
|
+
- Every button has an explicit `aria-label` — "Page 3", "Next page", and so on — so an icon-only button is never announced as unlabelled.
|
|
212
179
|
- The `…` gap is `aria-hidden`; it conveys nothing a screen reader user needs.
|
|
213
180
|
|
|
214
181
|
### ARIA Properties
|
|
215
182
|
|
|
216
|
-
| Property
|
|
217
|
-
|
|
|
218
|
-
| `aria-label`
|
|
219
|
-
| `aria-current="page"` | The current page button
|
|
220
|
-
| `aria-hidden="true"`
|
|
183
|
+
| Property | Applied to |
|
|
184
|
+
| --------------------- | ---------------------------- |
|
|
185
|
+
| `aria-label` | The `<nav>` and every button |
|
|
186
|
+
| `aria-current="page"` | The current page button |
|
|
187
|
+
| `aria-hidden="true"` | The `…` gap |
|
|
221
188
|
|
|
222
189
|
## Best Practices
|
|
223
190
|
|
|
224
|
-
- Do: pass `total` rather than `totalPages` when you know the item count — the
|
|
225
|
-
|
|
226
|
-
- Do:
|
|
227
|
-
|
|
228
|
-
-
|
|
229
|
-
a new filter). A stale page index against a smaller result set shows an empty
|
|
230
|
-
page.
|
|
231
|
-
- Don't: render `type="select"` over a large page count. It builds one
|
|
232
|
-
collection item per page.
|
|
233
|
-
- Don't: pass both `hasNextPage` and a known total and expect the former to win
|
|
234
|
-
— it doesn't.
|
|
191
|
+
- Do: pass `total` rather than `totalPages` when you know the item count — the summary and range labels both need it.
|
|
192
|
+
- Do: use `type="numbers"` (the default) for anything that can grow. It is the only mode whose cost does not scale with the page count.
|
|
193
|
+
- Do: reset to page 1 whenever the underlying query changes (a new search term, a new filter). A stale page index against a smaller result set shows an empty page.
|
|
194
|
+
- Don't: render `type="select"` over a large page count. It builds one collection item per page.
|
|
195
|
+
- Don't: pass both `hasNextPage` and a known total and expect the former to win — it doesn't.
|
|
235
196
|
|
|
236
197
|
## Suggested Improvements
|
|
237
198
|
|
|
@@ -142,9 +142,7 @@ DOM order is always "bar then panels" — visual order is controlled internally
|
|
|
142
142
|
|
|
143
143
|
#### Vertical tabs across types
|
|
144
144
|
|
|
145
|
-
`narrow` only makes sense for a horizontal strip (it collapses horizontal
|
|
146
|
-
label padding for a denser row). When `placement` is `'left'` or `'right'`,
|
|
147
|
-
`type="narrow"` is coerced to `type="default"`.
|
|
145
|
+
`narrow` only makes sense for a horizontal strip (it collapses horizontal label padding for a denser row). When `placement` is `'left'` or `'right'`, `type="narrow"` is coerced to `type="default"`.
|
|
148
146
|
|
|
149
147
|
## Compound Components
|
|
150
148
|
|
|
@@ -744,9 +742,7 @@ Override per-tab/panel:
|
|
|
744
742
|
|
|
745
743
|
### Optimized Lazy Rendering with `renderPanel`
|
|
746
744
|
|
|
747
|
-
For tabs with expensive content, use the `renderPanel` prop for optimized lazy rendering.
|
|
748
|
-
This prevents content from being evaluated on every parent render - only the active tab's
|
|
749
|
-
content is computed, while inactive tabs use cached content.
|
|
745
|
+
For tabs with expensive content, use the `renderPanel` prop for optimized lazy rendering. This prevents content from being evaluated on every parent render - only the active tab's content is computed, while inactive tabs use cached content.
|
|
750
746
|
|
|
751
747
|
```jsx
|
|
752
748
|
<Tabs
|
|
@@ -833,15 +829,7 @@ Tabs work seamlessly inside Layout components. When placed in a `Layout` or `Lay
|
|
|
833
829
|
|
|
834
830
|
### Inside a Board (spring-loaded switching)
|
|
835
831
|
|
|
836
|
-
When `Tabs` is rendered inside a [`Board`](../layout/Board.md), tab
|
|
837
|
-
switching becomes spring-loaded automatically: while a Board widget is being
|
|
838
|
-
dragged, hovering a tab header for a moment opens that tab, so a widget can be
|
|
839
|
-
dropped into it or moved between tabs. This requires no configuration - `Tabs`
|
|
840
|
-
detects the active Board drag and, for its duration, keeps panels mounted so the
|
|
841
|
-
tab a widget is dragged out of (and the board owning the in-flight gesture) is
|
|
842
|
-
not unmounted mid-drag. Spring-loading works with mouse and pen; touch drags
|
|
843
|
-
capture the pointer and do not trigger it. Outside a `Board` this behavior is
|
|
844
|
-
inert.
|
|
832
|
+
When `Tabs` is rendered inside a [`Board`](../layout/Board.md), tab switching becomes spring-loaded automatically: while a Board widget is being dragged, hovering a tab header for a moment opens that tab, so a widget can be dropped into it or moved between tabs. This requires no configuration - `Tabs` detects the active Board drag and, for its duration, keeps panels mounted so the tab a widget is dragged out of (and the board owning the in-flight gesture) is not unmounted mid-drag. Spring-loading works with mouse and pen; touch drags capture the pointer and do not trigger it. Outside a `Board` this behavior is inert.
|
|
845
833
|
|
|
846
834
|
## Accessibility
|
|
847
835
|
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
# Calendar
|
|
2
2
|
|
|
3
|
-
`Calendar` renders a month grid for picking a single date. `RangeCalendar` picks
|
|
4
|
-
a contiguous range, and `PeriodCalendar` picks a whole month, quarter or year.
|
|
5
|
-
All three are the panels behind the date fields — [DatePicker](../fields/DatePicker.md),
|
|
6
|
-
DateRangePicker and the
|
|
7
|
-
[period pickers](../fields/PeriodPicker.md) — and they are built on
|
|
8
|
-
React Aria's `useCalendar` / `useRangeCalendar`.
|
|
3
|
+
`Calendar` renders a month grid for picking a single date. `RangeCalendar` picks a contiguous range, and `PeriodCalendar` picks a whole month, quarter or year. All three are the panels behind the date fields — [DatePicker](../fields/DatePicker.md), DateRangePicker and the [period pickers](../fields/PeriodPicker.md) — and they are built on React Aria's `useCalendar` / `useRangeCalendar`.
|
|
9
4
|
|
|
10
|
-
The header title is the navigation: the month and the year are buttons that open
|
|
11
|
-
a month list and a year list, so reaching a date two years out takes two clicks
|
|
12
|
-
instead of twenty-four.
|
|
5
|
+
The header title is the navigation: the month and the year are buttons that open a month list and a year list, so reaching a date two years out takes two clicks instead of twenty-four.
|
|
13
6
|
|
|
14
7
|
## When to Use
|
|
15
8
|
|
|
16
9
|
- Embedding a calendar directly in a page or panel rather than behind a field
|
|
17
10
|
- Building a custom date input that needs the same grid and states
|
|
18
|
-
- Otherwise, prefer the date fields — they add the text input, label, validation
|
|
19
|
-
and popover for you
|
|
11
|
+
- Otherwise, prefer the date fields — they add the text input, label, validation and popover for you
|
|
20
12
|
|
|
21
13
|
## Component
|
|
22
14
|
|
|
@@ -40,14 +32,13 @@ instead of twenty-four.
|
|
|
40
32
|
|
|
41
33
|
#### RangeCalendar
|
|
42
34
|
|
|
43
|
-
Accepts React Aria's `AriaRangeCalendarProps` (a `{ start, end }` value) plus
|
|
44
|
-
**`hasMonthYearNavigation`**.
|
|
35
|
+
Accepts React Aria's `AriaRangeCalendarProps` (a `{ start, end }` value) plus **`hasMonthYearNavigation`**.
|
|
45
36
|
|
|
46
37
|
#### PeriodCalendar
|
|
47
38
|
|
|
48
39
|
- **`picker`** `'month' | 'quarter' | 'year'` — Which period the panel selects
|
|
49
40
|
- **`value`** `DateValue | null` — The selected period, represented by its start date
|
|
50
|
-
- **`minValue`** / **`maxValue`** `DateValue | null` — Range limits; a period is disabled only when
|
|
41
|
+
- **`minValue`** / **`maxValue`** `DateValue | null` — Range limits; a period is disabled only when _all_ of it falls outside
|
|
51
42
|
- **`isDateUnavailable`** `(date: DateValue) => boolean` — Called with the period's start date
|
|
52
43
|
- **`isDisabled`** `boolean`
|
|
53
44
|
- **`autoFocus`** `boolean` — Moves focus into the grid on mount
|
|
@@ -61,16 +52,16 @@ Supports [Base properties](../../BaseProperties.md)
|
|
|
61
52
|
|
|
62
53
|
Day cells and period cells share one set of modifiers:
|
|
63
54
|
|
|
64
|
-
| Modifier | Type | Description
|
|
65
|
-
| ------------- | --------- |
|
|
66
|
-
| `selected` | `boolean` | The cell is part of the current selection
|
|
67
|
-
| `current` | `boolean` | The cell contains today
|
|
68
|
-
| `outside` | `boolean` | The cell belongs to an adjacent month or decade
|
|
69
|
-
| `rangeHover` | `boolean` | The whole row is highlighted (week mode)
|
|
70
|
-
| `pressed` | `boolean` | The cell is being pressed
|
|
71
|
-
| `focused` | `boolean` | The cell holds keyboard focus
|
|
72
|
-
| `disabled` | `boolean` | The cell is outside `minValue` / `maxValue`
|
|
73
|
-
| `unavailable` | `boolean` | `isDateUnavailable` returned `true` for the cell
|
|
55
|
+
| Modifier | Type | Description |
|
|
56
|
+
| ------------- | --------- | ------------------------------------------------ |
|
|
57
|
+
| `selected` | `boolean` | The cell is part of the current selection |
|
|
58
|
+
| `current` | `boolean` | The cell contains today |
|
|
59
|
+
| `outside` | `boolean` | The cell belongs to an adjacent month or decade |
|
|
60
|
+
| `rangeHover` | `boolean` | The whole row is highlighted (week mode) |
|
|
61
|
+
| `pressed` | `boolean` | The cell is being pressed |
|
|
62
|
+
| `focused` | `boolean` | The cell holds keyboard focus |
|
|
63
|
+
| `disabled` | `boolean` | The cell is outside `minValue` / `maxValue` |
|
|
64
|
+
| `unavailable` | `boolean` | `isDateUnavailable` returned `true` for the cell |
|
|
74
65
|
|
|
75
66
|
## Examples
|
|
76
67
|
|
|
@@ -93,8 +84,7 @@ import { parseDate } from '@internationalized/date';
|
|
|
93
84
|
|
|
94
85
|
### Limited Range
|
|
95
86
|
|
|
96
|
-
Months and years that fall entirely outside `minValue` / `maxValue` are disabled
|
|
97
|
-
in the month and year lists too, and the navigation arrows stop at the edge.
|
|
87
|
+
Months and years that fall entirely outside `minValue` / `maxValue` are disabled in the month and year lists too, and the navigation arrows stop at the edge.
|
|
98
88
|
|
|
99
89
|
```jsx
|
|
100
90
|
<Calendar
|
|
@@ -153,32 +143,25 @@ Month and year lists:
|
|
|
153
143
|
### Screen Reader Support
|
|
154
144
|
|
|
155
145
|
- Each panel is a `grid`, labelled `Months` / `Quarters` / `Years`
|
|
156
|
-
- The visible month and year are the calendar's `heading`, and their buttons are
|
|
157
|
-
the controls that open the lists
|
|
146
|
+
- The visible month and year are the calendar's `heading`, and their buttons are the controls that open the lists
|
|
158
147
|
- Cells expose `aria-selected`; out-of-range periods are `disabled`
|
|
159
148
|
|
|
160
149
|
## Best Practices
|
|
161
150
|
|
|
162
|
-
1. **Do**: bound the calendar when the domain is bounded — the month and year
|
|
163
|
-
lists disable everything out of range, which is far clearer than letting the
|
|
164
|
-
user land somewhere unselectable.
|
|
151
|
+
1. **Do**: bound the calendar when the domain is bounded — the month and year lists disable everything out of range, which is far clearer than letting the user land somewhere unselectable.
|
|
165
152
|
|
|
166
153
|
```jsx
|
|
167
154
|
<Calendar minValue={today(getLocalTimeZone())} />
|
|
168
155
|
```
|
|
169
156
|
|
|
170
|
-
2. **Don't**: reach for `PeriodCalendar` to pick a day. Its value is always the
|
|
171
|
-
*start* of a period, never an exact date.
|
|
157
|
+
2. **Don't**: reach for `PeriodCalendar` to pick a day. Its value is always the _start_ of a period, never an exact date.
|
|
172
158
|
|
|
173
|
-
3. **Accessibility**: always give a standalone calendar an `aria-label` — inside
|
|
174
|
-
a field the label comes from the field.
|
|
159
|
+
3. **Accessibility**: always give a standalone calendar an `aria-label` — inside a field the label comes from the field.
|
|
175
160
|
|
|
176
161
|
## Suggested Improvements
|
|
177
162
|
|
|
178
|
-
- Range calendars paint every day in the range the same way; distinct start/end
|
|
179
|
-
|
|
180
|
-
- Multi-month (`visibleDuration`) layouts are not implemented; the header falls
|
|
181
|
-
back to a plain title when a range spans more than one month.
|
|
163
|
+
- Range calendars paint every day in the range the same way; distinct start/end caps would read better for long ranges.
|
|
164
|
+
- Multi-month (`visibleDuration`) layouts are not implemented; the header falls back to a plain title when a range spans more than one month.
|
|
182
165
|
|
|
183
166
|
## Related Components
|
|
184
167
|
|
|
@@ -47,7 +47,7 @@ That means the swap costs no re-render, is correct during SSR and before hydrati
|
|
|
47
47
|
|
|
48
48
|
### Pinning a scheme
|
|
49
49
|
|
|
50
|
-
`@dark` is a
|
|
50
|
+
`@dark` is a _state_, and it is resolved against the **document**. Where the background is known but the document scheme does not describe it, pass `scheme` to pin one mark:
|
|
51
51
|
|
|
52
52
|
```jsx
|
|
53
53
|
{/* A fixed-dark panel inside a light app */}
|
|
@@ -36,6 +36,7 @@ Supports [Base properties](../../BaseProperties.md)
|
|
|
36
36
|
Customizes the root element of the dialog.
|
|
37
37
|
|
|
38
38
|
**Sub-elements:**
|
|
39
|
+
|
|
39
40
|
- `Dialog` - The main dialog container
|
|
40
41
|
- `Content` - The content area wrapper
|
|
41
42
|
- `Header` - The header section wrapper
|
|
@@ -161,6 +162,7 @@ The `mods` property accepts the following modifiers you can override:
|
|
|
161
162
|
## Best Practices
|
|
162
163
|
|
|
163
164
|
1. **Do**: Provide clear titles and actionable buttons
|
|
165
|
+
|
|
164
166
|
```jsx
|
|
165
167
|
<Dialog>
|
|
166
168
|
<Header>
|
|
@@ -177,6 +179,7 @@ The `mods` property accepts the following modifiers you can override:
|
|
|
177
179
|
```
|
|
178
180
|
|
|
179
181
|
2. **Don't**: Use dialogs for trivial notifications
|
|
182
|
+
|
|
180
183
|
```jsx
|
|
181
184
|
{/* Avoid using dialogs for simple success messages */}
|
|
182
185
|
<Dialog>
|
|
@@ -172,6 +172,7 @@ function ConditionalDialog() {
|
|
|
172
172
|
## Best Practices
|
|
173
173
|
|
|
174
174
|
1. **Do**: Use DialogContainer for dialogs without specific triggers
|
|
175
|
+
|
|
175
176
|
```jsx
|
|
176
177
|
<DialogContainer isOpen={showErrorDialog} onDismiss={clearError}>
|
|
177
178
|
<Dialog>
|
|
@@ -186,6 +187,7 @@ function ConditionalDialog() {
|
|
|
186
187
|
```
|
|
187
188
|
|
|
188
189
|
2. **Don't**: Use DialogContainer when DialogTrigger is more appropriate
|
|
190
|
+
|
|
189
191
|
```jsx
|
|
190
192
|
{/* Prefer DialogTrigger when you have a specific trigger */}
|
|
191
193
|
<DialogContainer isOpen={buttonPressed}>
|
|
@@ -188,7 +188,7 @@ When you need custom action buttons, use `noActions` prop and the render functio
|
|
|
188
188
|
<>
|
|
189
189
|
<Input.Text name="field1" label="Field 1" />
|
|
190
190
|
<Input.Text name="field2" label="Field 2" />
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
<ButtonGroup>
|
|
193
193
|
<SubmitButton>Save</SubmitButton>
|
|
194
194
|
<Button onPress={() => {
|
|
@@ -263,22 +263,26 @@ See [Dialog Accessibility](./Dialog.md#accessibility) and [Form Accessibility](.
|
|
|
263
263
|
## Best Practices
|
|
264
264
|
|
|
265
265
|
1. **Use useDialogContainer for programmatic control**: Preferred method for better state management
|
|
266
|
+
|
|
266
267
|
```jsx
|
|
267
268
|
const dialog = useDialogContainer(MyFormDialog);
|
|
268
269
|
dialog.open({ initialData, onSubmit: handleSubmit });
|
|
269
270
|
```
|
|
270
271
|
|
|
271
272
|
2. **Provide clear titles**: Always set a descriptive `title` for context
|
|
273
|
+
|
|
272
274
|
```jsx
|
|
273
275
|
<DialogForm title="Edit User Profile" onSubmit={save}>
|
|
274
276
|
```
|
|
275
277
|
|
|
276
278
|
3. **Use danger theme for destructive actions**: Apply `danger` for delete/remove operations
|
|
279
|
+
|
|
277
280
|
```jsx
|
|
278
281
|
<DialogForm title="Delete Item" danger submitProps={{ label: 'Delete' }}>
|
|
279
282
|
```
|
|
280
283
|
|
|
281
284
|
4. **Customize button labels**: Make action buttons specific to the task
|
|
285
|
+
|
|
282
286
|
```jsx
|
|
283
287
|
<DialogForm
|
|
284
288
|
title="Create Project"
|
|
@@ -288,6 +292,7 @@ See [Dialog Accessibility](./Dialog.md#accessibility) and [Form Accessibility](.
|
|
|
288
292
|
```
|
|
289
293
|
|
|
290
294
|
5. **Handle submission errors**: Implement `onSubmitFailed` for error handling
|
|
295
|
+
|
|
291
296
|
```jsx
|
|
292
297
|
<DialogForm
|
|
293
298
|
onSubmit={save}
|
|
@@ -307,4 +312,3 @@ See [Dialog Accessibility](./Dialog.md#accessibility) and [Form Accessibility](.
|
|
|
307
312
|
- [Form](../form/Form.md) - Form component with validation
|
|
308
313
|
- [DialogTrigger](./DialogTrigger.md) - Alternative: manages dialog open/close state
|
|
309
314
|
- [AlertDialog](./AlertDialog.md) - For simple confirmations without forms
|
|
310
|
-
|
|
@@ -36,7 +36,7 @@ DialogTrigger serves as a wrapper around a Dialog and its associated trigger, li
|
|
|
36
36
|
- **`targetRef`** — The ref of the element the Dialog should visually attach itself to
|
|
37
37
|
- **`styles`** — The style map for the overlay
|
|
38
38
|
- **`shouldCloseOnInteractOutside`** — Function to determine if overlay should close on outside interaction
|
|
39
|
-
- **`shouldRestoreFocus`** `boolean` (default: `true`) — Whether focus returns to the trigger when the dialog closes. Only needed for a surface that claims focus
|
|
39
|
+
- **`shouldRestoreFocus`** `boolean` (default: `true`) — Whether focus returns to the trigger when the dialog closes. Only needed for a surface that claims focus _later_ than the restore (async load, entry animation); an action that focuses the surface it opens is already left alone — see [Focus Management](#best-practices)
|
|
40
40
|
|
|
41
41
|
### Base Properties
|
|
42
42
|
|
|
@@ -172,6 +172,7 @@ function ControlledDialog() {
|
|
|
172
172
|
## Best Practices
|
|
173
173
|
|
|
174
174
|
1. **Do**: Provide clear trigger labels
|
|
175
|
+
|
|
175
176
|
```jsx
|
|
176
177
|
<DialogTrigger>
|
|
177
178
|
<Button>Edit Profile</Button>
|
|
@@ -180,6 +181,7 @@ function ControlledDialog() {
|
|
|
180
181
|
```
|
|
181
182
|
|
|
182
183
|
2. **Don't**: Use vague trigger text
|
|
184
|
+
|
|
183
185
|
```jsx
|
|
184
186
|
<DialogTrigger>
|
|
185
187
|
<Button>Click</Button>
|
|
@@ -187,7 +189,7 @@ function ControlledDialog() {
|
|
|
187
189
|
</DialogTrigger>
|
|
188
190
|
```
|
|
189
191
|
|
|
190
|
-
3. **Focus Management**: Closing the dialog returns focus to the trigger, unless the action that closed it already moved focus somewhere else — an action that opens a panel or another dialog just focuses that surface, and the trigger leaves it alone. A single `focus()` from a mount effect is enough; no retry loop is needed. Reach for `shouldRestoreFocus={false}` only when the opened surface claims focus
|
|
192
|
+
3. **Focus Management**: Closing the dialog returns focus to the trigger, unless the action that closed it already moved focus somewhere else — an action that opens a panel or another dialog just focuses that surface, and the trigger leaves it alone. A single `focus()` from a mount effect is enough; no retry loop is needed. Reach for `shouldRestoreFocus={false}` only when the opened surface claims focus _later_ than the restore (after an async load or an entry animation), where the trigger would otherwise take focus first and flash.
|
|
191
193
|
4. **Mobile Considerations**: Use appropriate mobile types for better UX
|
|
192
194
|
5. **Dismissible**: Make modal dialogs dismissible unless absolutely necessary
|
|
193
195
|
|
|
@@ -25,6 +25,7 @@ Supports [Base properties](../../BaseProperties.md)
|
|
|
25
25
|
Customizes the root element of the notification.
|
|
26
26
|
|
|
27
27
|
**Sub-elements:**
|
|
28
|
+
|
|
28
29
|
- `Description` - The description text area below the title
|
|
29
30
|
|
|
30
31
|
## Variants
|
|
@@ -321,6 +322,7 @@ Collapse is disabled when notifications are present, since notifications require
|
|
|
321
322
|
## Best Practices
|
|
322
323
|
|
|
323
324
|
1. **Do**: Use notifications for action-oriented messages
|
|
325
|
+
|
|
324
326
|
```jsx
|
|
325
327
|
notify({
|
|
326
328
|
theme: 'success',
|
|
@@ -334,16 +336,19 @@ Collapse is disabled when notifications are present, since notifications require
|
|
|
334
336
|
```
|
|
335
337
|
|
|
336
338
|
2. **Don't**: Use notifications for simple messages without actions — use Toast instead
|
|
339
|
+
|
|
337
340
|
```jsx
|
|
338
341
|
// Use toast.success('Copied to clipboard') instead
|
|
339
342
|
```
|
|
340
343
|
|
|
341
344
|
3. **Do**: Provide explicit `id` for persistent and stored notifications
|
|
345
|
+
|
|
342
346
|
```jsx
|
|
343
347
|
notify({ id: 'deploy:123', persistent: true, ... });
|
|
344
348
|
```
|
|
345
349
|
|
|
346
350
|
4. **Do**: Place the dismiss action last for consistent right-side positioning
|
|
351
|
+
|
|
347
352
|
```jsx
|
|
348
353
|
notify({
|
|
349
354
|
actions: (
|
|
@@ -356,6 +361,7 @@ Collapse is disabled when notifications are present, since notifications require
|
|
|
356
361
|
```
|
|
357
362
|
|
|
358
363
|
5. **Do**: When using `isDismissable: false`, always provide actions — the user needs a way to interact
|
|
364
|
+
|
|
359
365
|
```jsx
|
|
360
366
|
// isDismissable: false hides the default "Dismiss" button and Escape key,
|
|
361
367
|
// but actions with closeOnPress (default true) still close the notification.
|
|
@@ -372,6 +378,7 @@ Collapse is disabled when notifications are present, since notifications require
|
|
|
372
378
|
```
|
|
373
379
|
|
|
374
380
|
6. **Do**: Return `false` from `onPress` to keep the notification when the user cancels a confirmation flow
|
|
381
|
+
|
|
375
382
|
```jsx
|
|
376
383
|
<Notification.Action
|
|
377
384
|
onPress={async () => {
|
|
@@ -30,6 +30,7 @@ Supports [Base properties](../../BaseProperties.md)
|
|
|
30
30
|
Customizes the root element of the toast. The toast uses the `Item` component with `type="card"` internally.
|
|
31
31
|
|
|
32
32
|
**Sub-elements:**
|
|
33
|
+
|
|
33
34
|
- `Label` - Primary content text
|
|
34
35
|
- `Description` - Secondary content text
|
|
35
36
|
- `Icon` - Icon container
|
|
@@ -112,17 +113,20 @@ type ProgressToastEmpty = null | undefined | false | {};
|
|
|
112
113
|
The hook requires a loading cycle (`isLoading: true`) before any toast becomes visible. If the initial state is not loading, no toast is shown until `isLoading: true` is passed. The hook handles three main scenarios:
|
|
113
114
|
|
|
114
115
|
**1. Loading State** (`isLoading: true`) — triggers initial appearance
|
|
116
|
+
|
|
115
117
|
- Toast appears immediately and persists until `isLoading` becomes `false`
|
|
116
118
|
- No auto-dismiss timer while loading
|
|
117
119
|
- This is the only state that can trigger the initial appearance of the toast
|
|
118
120
|
|
|
119
121
|
**2. Result State** (`isLoading: false` with content)
|
|
122
|
+
|
|
120
123
|
- Only shown after a prior loading state — ignored if loading was never seen
|
|
121
124
|
- When transitioning from loading to not loading, the toast updates to show the result
|
|
122
125
|
- Result toast auto-dismisses after 3 seconds
|
|
123
126
|
- Theme-based icons are automatically applied (success checkmark, danger X, etc.)
|
|
124
127
|
|
|
125
128
|
**3. Dismissed** (empty value, no argument, or no title when not loading)
|
|
129
|
+
|
|
126
130
|
- Pass `null`, `undefined`, `false`, `{}`, or call with no argument to immediately remove any existing toast
|
|
127
131
|
- Also resets the loading gate, so the next toast cycle requires `isLoading: true` again
|
|
128
132
|
- Useful for conditional rendering or cleanup
|
|
@@ -132,7 +136,7 @@ The hook requires a loading cycle (`isLoading: true`) before any toast becomes v
|
|
|
132
136
|
```jsx
|
|
133
137
|
function SaveButton() {
|
|
134
138
|
const [status, setStatus] = useState('idle');
|
|
135
|
-
|
|
139
|
+
|
|
136
140
|
useProgressToast(
|
|
137
141
|
status === 'saving'
|
|
138
142
|
? { isLoading: true, title: 'Saving...' }
|
|
@@ -142,7 +146,7 @@ function SaveButton() {
|
|
|
142
146
|
? { isLoading: false, title: 'Failed to save', theme: 'danger' }
|
|
143
147
|
: null // idle state - no toast
|
|
144
148
|
);
|
|
145
|
-
|
|
149
|
+
|
|
146
150
|
return <Button onPress={() => setStatus('saving')}>Save</Button>;
|
|
147
151
|
}
|
|
148
152
|
```
|
|
@@ -152,7 +156,7 @@ function SaveButton() {
|
|
|
152
156
|
```jsx
|
|
153
157
|
function DataLoader() {
|
|
154
158
|
const { data, isLoading, error } = useQuery('data');
|
|
155
|
-
|
|
159
|
+
|
|
156
160
|
useProgressToast(
|
|
157
161
|
isLoading
|
|
158
162
|
? { isLoading: true, title: 'Loading data...' }
|
|
@@ -160,7 +164,7 @@ function DataLoader() {
|
|
|
160
164
|
? { isLoading: false, title: 'Error', description: error.message, theme: 'danger' }
|
|
161
165
|
: { isLoading: false, title: 'Data loaded', theme: 'success' }
|
|
162
166
|
);
|
|
163
|
-
|
|
167
|
+
|
|
164
168
|
return <div>{/* content */}</div>;
|
|
165
169
|
}
|
|
166
170
|
```
|
|
@@ -172,8 +176,8 @@ Pass an empty value to prevent the toast from showing or to immediately remove a
|
|
|
172
176
|
```jsx
|
|
173
177
|
// Only show toast when needed
|
|
174
178
|
useProgressToast(
|
|
175
|
-
shouldShowProgress
|
|
176
|
-
? { isLoading: true, title: 'Processing...' }
|
|
179
|
+
shouldShowProgress
|
|
180
|
+
? { isLoading: true, title: 'Processing...' }
|
|
177
181
|
: null
|
|
178
182
|
);
|
|
179
183
|
|
|
@@ -202,7 +206,7 @@ useProgressToast({
|
|
|
202
206
|
|
|
203
207
|
For component-based usage, use `<Toast.Progress>`:
|
|
204
208
|
|
|
205
|
-
|
|
209
|
+
````jsx
|
|
206
210
|
<Toast.Progress
|
|
207
211
|
{...(isLoading
|
|
208
212
|
? { isLoading: true, title: 'Saving...' }
|
|
@@ -271,7 +275,7 @@ Maximum 3 toasts are visible at once. When the limit is exceeded, the oldest toa
|
|
|
271
275
|
|
|
272
276
|
```jsx
|
|
273
277
|
toast.success('Changes saved');
|
|
274
|
-
|
|
278
|
+
````
|
|
275
279
|
|
|
276
280
|
2. **Don't**: Use overly long or technical messages
|
|
277
281
|
|
|
@@ -59,6 +59,7 @@ Supports [Base properties](../../BaseProperties.md)
|
|
|
59
59
|
Customizes the root element of the tooltip.
|
|
60
60
|
|
|
61
61
|
**Sub-elements:**
|
|
62
|
+
|
|
62
63
|
- None
|
|
63
64
|
|
|
64
65
|
### Style Properties
|
|
@@ -138,6 +139,16 @@ Control where the tooltip appears relative to its trigger:
|
|
|
138
139
|
</TooltipProvider>
|
|
139
140
|
```
|
|
140
141
|
|
|
142
|
+
### Long Content
|
|
143
|
+
|
|
144
|
+
The tooltip is capped at `36x` wide (or the viewport minus `4x`, whichever is smaller) and wraps its content to stay inside that cap. Runs with no spaces — URLs, tokens, identifiers, error strings — are broken mid-word rather than allowed to overflow the bubble.
|
|
145
|
+
|
|
146
|
+
```jsx
|
|
147
|
+
<TooltipProvider title="https://cubecloud.example.com/deployments/12345/schema/files/model/cubes/very_long_cube_name.yml">
|
|
148
|
+
<Button>Hover me</Button>
|
|
149
|
+
</TooltipProvider>
|
|
150
|
+
```
|
|
151
|
+
|
|
141
152
|
### Light Theme
|
|
142
153
|
|
|
143
154
|
Use the light theme for tooltips on dark backgrounds:
|
|
@@ -244,6 +255,7 @@ Show tooltip only on focus, not on hover:
|
|
|
244
255
|
### Best Practices
|
|
245
256
|
|
|
246
257
|
1. **Keep it brief** - Tooltips should contain concise, supplementary information
|
|
258
|
+
|
|
247
259
|
```jsx
|
|
248
260
|
{/* Good */}
|
|
249
261
|
<TooltipProvider title="Save changes">
|
|
@@ -257,6 +269,7 @@ Show tooltip only on focus, not on hover:
|
|
|
257
269
|
```
|
|
258
270
|
|
|
259
271
|
2. **Don't hide critical information** - Never put essential information only in a tooltip
|
|
272
|
+
|
|
260
273
|
```jsx
|
|
261
274
|
{/* Good - tooltip adds context */}
|
|
262
275
|
<TooltipProvider title="Permanently delete this item">
|
|
@@ -270,6 +283,7 @@ Show tooltip only on focus, not on hover:
|
|
|
270
283
|
```
|
|
271
284
|
|
|
272
285
|
3. **Use appropriate delays** - Default delay (250ms) works for most cases
|
|
286
|
+
|
|
273
287
|
```jsx
|
|
274
288
|
{/* Good - default delay */}
|
|
275
289
|
<TooltipProvider title="Info">
|
|
@@ -283,6 +297,7 @@ Show tooltip only on focus, not on hover:
|
|
|
283
297
|
```
|
|
284
298
|
|
|
285
299
|
4. **Choose the right pattern** - Use function pattern only when necessary
|
|
300
|
+
|
|
286
301
|
```jsx
|
|
287
302
|
{/* Good - standard pattern for active elements */}
|
|
288
303
|
<TooltipProvider title="Click me">
|
|
@@ -305,6 +320,7 @@ Show tooltip only on focus, not on hover:
|
|
|
305
320
|
```
|
|
306
321
|
|
|
307
322
|
5. **Provide meaningful context** - Ensure tooltip text is descriptive
|
|
323
|
+
|
|
308
324
|
```jsx
|
|
309
325
|
{/* Good */}
|
|
310
326
|
<TooltipProvider title="Export as CSV">
|