@cube-dev/ui-kit 0.121.0 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +6 -0
- package/dist/_internal/hooks/use-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.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 +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/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/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/intl.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +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/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.d.ts +8 -2
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Select/Select.js.map +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/extract-field-wrapper-props.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/EditableTitle.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +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/FileTabs/FileTabs.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/CloudLogo/CloudLogo.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +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.js +1 -1
- package/dist/components/overlays/Modal/OpenTransition.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.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/base.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/BaseProperties.md +78 -0
- package/docs/ComplexLayout.md +459 -0
- package/docs/CreateComponent.md +410 -0
- package/docs/FieldProperties.md +117 -0
- package/docs/Introduction.md +122 -0
- package/docs/RenderCache.md +177 -0
- package/docs/Result.md +42 -0
- package/docs/SimpleLayout.md +26 -0
- package/docs/Typography.md +38 -0
- package/docs/components/Block.md +33 -0
- package/docs/components/CollectionItem.md +293 -0
- package/docs/components/GridProvider.md +38 -0
- package/docs/components/Root.md +50 -0
- package/docs/components/actions/Action.md +47 -0
- package/docs/components/actions/Banner.md +195 -0
- package/docs/components/actions/Button.md +209 -0
- package/docs/components/actions/ButtonGroup.md +46 -0
- package/docs/components/actions/ButtonSplit.md +199 -0
- package/docs/components/actions/CommandMenu.md +422 -0
- package/docs/components/actions/ItemAction.md +60 -0
- package/docs/components/actions/ItemButton.md +316 -0
- package/docs/components/actions/Link.md +325 -0
- package/docs/components/actions/Menu.md +485 -0
- package/docs/components/actions/MenuTrigger.md +47 -0
- package/docs/components/actions/SubMenuTrigger.md +38 -0
- package/docs/components/actions/use-anchored-menu.md +209 -0
- package/docs/components/actions/use-context-menu.md +218 -0
- package/docs/components/content/ActiveZone.md +37 -0
- package/docs/components/content/Alert.md +40 -0
- package/docs/components/content/Avatar.md +37 -0
- package/docs/components/content/Badge.md +194 -0
- package/docs/components/content/Card.md +40 -0
- package/docs/components/content/Content.md +44 -0
- package/docs/components/content/CopyPasteBlock.md +36 -0
- package/docs/components/content/CopySnippet.md +43 -0
- package/docs/components/content/Disclosure.md +181 -0
- package/docs/components/content/Divider.md +39 -0
- package/docs/components/content/Footer.md +35 -0
- package/docs/components/content/Header.md +35 -0
- package/docs/components/content/HotKeys.md +352 -0
- package/docs/components/content/Item.md +499 -0
- package/docs/components/content/ItemBadge.md +31 -0
- package/docs/components/content/ItemCard.md +131 -0
- package/docs/components/content/Layout.md +843 -0
- package/docs/components/content/Paragraph.md +32 -0
- package/docs/components/content/Placeholder.md +37 -0
- package/docs/components/content/PrismCode.md +36 -0
- package/docs/components/content/PrismDiffCode.md +29 -0
- package/docs/components/content/Result.md +46 -0
- package/docs/components/content/Skeleton.md +35 -0
- package/docs/components/content/Tag.md +165 -0
- package/docs/components/content/Text.md +54 -0
- package/docs/components/content/TextItem.md +217 -0
- package/docs/components/content/Title.md +45 -0
- package/docs/components/fields/Checkbox.md +176 -0
- package/docs/components/fields/ComboBox.md +651 -0
- package/docs/components/fields/DatePicker.md +227 -0
- package/docs/components/fields/FileInput.md +194 -0
- package/docs/components/fields/FilterListBox.md +726 -0
- package/docs/components/fields/FilterPicker.md +776 -0
- package/docs/components/fields/HueSlider.md +175 -0
- package/docs/components/fields/ListBox.md +714 -0
- package/docs/components/fields/NumberInput.md +180 -0
- package/docs/components/fields/PasswordInput.md +214 -0
- package/docs/components/fields/Picker.md +906 -0
- package/docs/components/fields/RadioGroup.md +310 -0
- package/docs/components/fields/SearchInput.md +224 -0
- package/docs/components/fields/Select.md +576 -0
- package/docs/components/fields/Slider.md +53 -0
- package/docs/components/fields/Switch.md +169 -0
- package/docs/components/fields/TextArea.md +61 -0
- package/docs/components/fields/TextInput.md +205 -0
- package/docs/components/fields/TextInputMapper.md +34 -0
- package/docs/components/form/Field.md +333 -0
- package/docs/components/form/Form.md +644 -0
- package/docs/components/form/FormInstance.md +307 -0
- package/docs/components/helpers/DisplayTransition.md +268 -0
- package/docs/components/helpers/IconSwitch.md +160 -0
- package/docs/components/layout/Flex.md +51 -0
- package/docs/components/layout/Flow.md +32 -0
- package/docs/components/layout/Grid.md +46 -0
- package/docs/components/layout/Panel.md +65 -0
- package/docs/components/layout/Prefix.md +37 -0
- package/docs/components/layout/ResizablePanel.md +69 -0
- package/docs/components/layout/Space.md +44 -0
- package/docs/components/layout/Suffix.md +39 -0
- package/docs/components/navigation/Tabs.md +726 -0
- package/docs/components/organisms/FileTabs.md +39 -0
- package/docs/components/organisms/StatsCard.md +40 -0
- package/docs/components/other/CloudLogo.md +33 -0
- package/docs/components/overlays/AlertDialog.md +51 -0
- package/docs/components/overlays/Dialog.md +200 -0
- package/docs/components/overlays/DialogContainer.md +201 -0
- package/docs/components/overlays/DialogForm.md +295 -0
- package/docs/components/overlays/DialogTrigger.md +191 -0
- package/docs/components/overlays/Notifications.md +402 -0
- package/docs/components/overlays/Toast.md +289 -0
- package/docs/components/overlays/Tooltip.md +400 -0
- package/docs/components/overlays/TooltipProvider.md +42 -0
- package/docs/components/overlays/TooltipTrigger.md +42 -0
- package/docs/components/overlays/UseDialogContainer.md +597 -0
- package/docs/components/portal/Portal.md +29 -0
- package/docs/components/status/LoadingAnimation.md +27 -0
- package/docs/components/status/Spin.md +35 -0
- package/docs/tasty/configuration.md +211 -0
- package/docs/tasty/debug.md +505 -0
- package/docs/tasty/injector.md +528 -0
- package/docs/tasty/styles.md +567 -0
- package/docs/tasty/tasty-static.md +376 -0
- package/docs/tasty/usage.md +643 -0
- package/package.json +4 -8
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
# Notification
|
|
2
|
+
|
|
3
|
+
Action-oriented overlay messages that support custom actions, a dismiss button, timer-based auto-dismiss, and persistent storage. Notifications share the same floating container with [Toast](./Toast.md) (top-center position) via the unified `OverlayProvider`.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- When a message requires user action (e.g., "View logs", "Upgrade", "Accept")
|
|
8
|
+
- When you need persistent notifications that remain in a list after dismissal
|
|
9
|
+
- When server-sourced events need to be stored for later review
|
|
10
|
+
- For simple dismissible messages with no custom actions (only the auto-appended "Dismiss" button)
|
|
11
|
+
- **If no actions are needed and no persistence is required, use [Toast](./Toast.md) instead**
|
|
12
|
+
|
|
13
|
+
## Component
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
### Base Properties
|
|
18
|
+
|
|
19
|
+
Supports [Base properties](../../BaseProperties.md)
|
|
20
|
+
|
|
21
|
+
### Styling Properties
|
|
22
|
+
|
|
23
|
+
#### styles
|
|
24
|
+
|
|
25
|
+
Customizes the root element of the notification.
|
|
26
|
+
|
|
27
|
+
**Sub-elements:**
|
|
28
|
+
- `Description` - The description text area below the title
|
|
29
|
+
|
|
30
|
+
## Variants
|
|
31
|
+
|
|
32
|
+
### Themes
|
|
33
|
+
|
|
34
|
+
- `success` - Positive outcome (CheckIcon)
|
|
35
|
+
- `danger` - Error or failure (ExclamationIcon)
|
|
36
|
+
- `warning` - Caution or attention needed (WarningIcon)
|
|
37
|
+
- `note` - Informational message (InfoIcon)
|
|
38
|
+
- No theme - Neutral styling with no icon
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
### Imperative API
|
|
43
|
+
|
|
44
|
+
Use `useNotifications()` to show notifications programmatically. Each hook instance acts as an owner scope — on unmount, all attached visible notifications are dismissed.
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
import { useNotifications, Notification } from '@cube-dev/ui-kit';
|
|
48
|
+
|
|
49
|
+
const { notify, record, dismiss } = useNotifications();
|
|
50
|
+
|
|
51
|
+
const handle = notify({
|
|
52
|
+
id: 'deploy:123',
|
|
53
|
+
theme: 'success',
|
|
54
|
+
title: 'Deployment completed',
|
|
55
|
+
description: 'Version 1.4.2 is live.',
|
|
56
|
+
actions: (
|
|
57
|
+
<>
|
|
58
|
+
<Notification.Action onPress={() => openLogs()}>
|
|
59
|
+
View logs
|
|
60
|
+
</Notification.Action>
|
|
61
|
+
<Notification.Action onPress={() => openDeployment()}>
|
|
62
|
+
Open
|
|
63
|
+
</Notification.Action>
|
|
64
|
+
</>
|
|
65
|
+
),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Dismiss programmatically
|
|
69
|
+
handle.dismiss();
|
|
70
|
+
// or
|
|
71
|
+
dismiss('deploy:123');
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Declarative API
|
|
75
|
+
|
|
76
|
+
The `<Notification>` component shows a notification while mounted and removes it on unmount.
|
|
77
|
+
|
|
78
|
+
```jsx
|
|
79
|
+
import { Notification } from '@cube-dev/ui-kit';
|
|
80
|
+
|
|
81
|
+
<Notification
|
|
82
|
+
id="release:new-version"
|
|
83
|
+
theme="warning"
|
|
84
|
+
title="New release available"
|
|
85
|
+
description="2.0.0 can be installed now."
|
|
86
|
+
actions={
|
|
87
|
+
<>
|
|
88
|
+
<Notification.Action onPress={() => upgrade()}>
|
|
89
|
+
Upgrade
|
|
90
|
+
</Notification.Action>
|
|
91
|
+
<Notification.Action isDismiss>Later</Notification.Action>
|
|
92
|
+
</>
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Notification.Action
|
|
98
|
+
|
|
99
|
+
Action buttons inside notifications. Every action auto-dismisses the notification by default (`closeOnPress: true`).
|
|
100
|
+
|
|
101
|
+
- **`onPress`** `() => void \| false \| Promise<void \| false>` — Called when the action is pressed. Return `false` to cancel the auto-dismiss.
|
|
102
|
+
- **`closeOnPress`** `boolean` (default: `true`) — Auto-dismiss the notification after press
|
|
103
|
+
- **`isDismiss`** `boolean` (default: `false`) — Marks this action as the dismiss button (see below)
|
|
104
|
+
- **`isDisabled`** `boolean` (default: `false`) — Disables the action
|
|
105
|
+
|
|
106
|
+
#### Cancelling dismiss
|
|
107
|
+
|
|
108
|
+
When `closeOnPress` is `true` (the default), the notification is dismissed after `onPress` completes. To conditionally prevent this — for example, when the user cancels a confirmation dialog — return `false` from `onPress`:
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
<Notification.Action
|
|
112
|
+
onPress={async () => {
|
|
113
|
+
const confirmed = await showConfirmDialog();
|
|
114
|
+
if (!confirmed) {
|
|
115
|
+
return false; // keep the notification visible
|
|
116
|
+
}
|
|
117
|
+
await performAction();
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
Resume
|
|
121
|
+
</Notification.Action>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
This works with both sync and async handlers. Returning `undefined` (the default `void` return) proceeds with dismiss as usual.
|
|
125
|
+
|
|
126
|
+
#### Dismiss behavior
|
|
127
|
+
|
|
128
|
+
By default, a "Dismiss" button is auto-appended to the right of the actions area (when `isDismissable` is `true`). To customize the dismiss label, add `isDismiss` to a `Notification.Action` — the default button is automatically suppressed via context detection (no extra prop needed).
|
|
129
|
+
|
|
130
|
+
When `actions` is omitted, only the default "Dismiss" button is shown.
|
|
131
|
+
|
|
132
|
+
Place the dismiss action **last** so it renders on the right (consistent with the auto-appended position):
|
|
133
|
+
|
|
134
|
+
```jsx
|
|
135
|
+
// Custom dismiss label — "Later" appears on the right.
|
|
136
|
+
// isDismiss auto-suppresses the default "Dismiss" button.
|
|
137
|
+
notify({
|
|
138
|
+
actions: (
|
|
139
|
+
<>
|
|
140
|
+
<Notification.Action onPress={() => alert('View plans')}>
|
|
141
|
+
View plans
|
|
142
|
+
</Notification.Action>
|
|
143
|
+
<Notification.Action isDismiss>Later</Notification.Action>
|
|
144
|
+
</>
|
|
145
|
+
),
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```jsx
|
|
150
|
+
// No isDismiss action — default "Dismiss" button is auto-appended on the right
|
|
151
|
+
notify({
|
|
152
|
+
actions: (
|
|
153
|
+
<Notification.Action onPress={() => openLogs()}>
|
|
154
|
+
View logs
|
|
155
|
+
</Notification.Action>
|
|
156
|
+
),
|
|
157
|
+
});
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```jsx
|
|
161
|
+
// No actions at all — only the default "Dismiss" button is shown
|
|
162
|
+
notify({
|
|
163
|
+
theme: 'success',
|
|
164
|
+
title: 'Saved successfully',
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Update by ID
|
|
169
|
+
|
|
170
|
+
Calling `notify()` with the same `id` performs an in-place update (instant content swap). The auto-dismiss timer resets when `title` or `description` changes (string values only).
|
|
171
|
+
|
|
172
|
+
```jsx
|
|
173
|
+
const { notify } = useNotifications();
|
|
174
|
+
|
|
175
|
+
// Initial notification
|
|
176
|
+
notify({
|
|
177
|
+
id: 'sync:workspace-42',
|
|
178
|
+
theme: 'warning',
|
|
179
|
+
title: 'Sync in progress',
|
|
180
|
+
persistent: true,
|
|
181
|
+
duration: null,
|
|
182
|
+
actions: (
|
|
183
|
+
<Notification.Action onPress={() => alert('Details')}>
|
|
184
|
+
Details
|
|
185
|
+
</Notification.Action>
|
|
186
|
+
),
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
// Later: update same id — timer resets because title changed
|
|
190
|
+
notify({
|
|
191
|
+
id: 'sync:workspace-42',
|
|
192
|
+
theme: 'success',
|
|
193
|
+
title: 'Sync complete',
|
|
194
|
+
persistent: true,
|
|
195
|
+
actions: (
|
|
196
|
+
<Notification.Action onPress={() => alert('Open')}>
|
|
197
|
+
Open
|
|
198
|
+
</Notification.Action>
|
|
199
|
+
),
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Persistent Notifications
|
|
204
|
+
|
|
205
|
+
Overlay notifications with `persistent: true` are stored in an in-memory list whenever they leave the overlay — whether by auto-dismiss timeout, user clicking an action, or the dismiss button. The only exception is programmatic cleanup (component unmount / `dismiss()` call), which removes the notification without archiving it.
|
|
206
|
+
|
|
207
|
+
Once a persistent notification has been archived, subsequent calls with the **same `id`** skip the overlay entirely and update the persistent list directly. This prevents the same notification from re-appearing as a popup after the user has already seen it. Removing the item from the persistent list (via `remove()`) permanently suppresses the notification — future calls with that `id` are completely ignored (no overlay, no persistent storage).
|
|
208
|
+
|
|
209
|
+
#### `record()` — Store Directly
|
|
210
|
+
|
|
211
|
+
Use `record()` to write notifications directly to the persistent list without rendering in the overlay. This is a shorthand for `notify({ mode: 'stored', ... })`.
|
|
212
|
+
|
|
213
|
+
The persistent list is **in-memory only** — it does not send data to a server. The intended flow is one-way: the server pushes events to the client, and the client uses `record()` to populate the list. Pass `createdAt` (epoch ms) to preserve the original server timestamp; if omitted it defaults to `Date.now()`.
|
|
214
|
+
|
|
215
|
+
```jsx
|
|
216
|
+
const { notify, record } = useNotifications();
|
|
217
|
+
const { items, count, remove, clear } = usePersistentNotifications();
|
|
218
|
+
|
|
219
|
+
// Overlay notification that persists after timeout
|
|
220
|
+
notify({
|
|
221
|
+
id: 'deploy:1',
|
|
222
|
+
theme: 'success',
|
|
223
|
+
title: 'Deployment completed',
|
|
224
|
+
persistent: true,
|
|
225
|
+
actions: (
|
|
226
|
+
<Notification.Action onPress={() => alert('View')}>
|
|
227
|
+
View
|
|
228
|
+
</Notification.Action>
|
|
229
|
+
),
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// Stored notification (no overlay, goes directly to list)
|
|
233
|
+
record({
|
|
234
|
+
id: 'server:alert-1',
|
|
235
|
+
theme: 'warning',
|
|
236
|
+
title: 'Server alert',
|
|
237
|
+
createdAt: serverEvent.timestamp, // preserve original server timestamp
|
|
238
|
+
actions: (
|
|
239
|
+
<Notification.Action onPress={() => alert('Details')}>
|
|
240
|
+
View details
|
|
241
|
+
</Notification.Action>
|
|
242
|
+
),
|
|
243
|
+
});
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### PersistentNotificationsList
|
|
247
|
+
|
|
248
|
+
Renders archived notifications with relative timestamps. Automatically marks all items as read after being visible for 2 seconds.
|
|
249
|
+
|
|
250
|
+
Reads items directly from the notification context store.
|
|
251
|
+
|
|
252
|
+
```jsx
|
|
253
|
+
import { PersistentNotificationsList, usePersistentNotifications } from '@cube-dev/ui-kit';
|
|
254
|
+
|
|
255
|
+
const { remove } = usePersistentNotifications();
|
|
256
|
+
|
|
257
|
+
<PersistentNotificationsList
|
|
258
|
+
onDismissItem={(item) => remove(item.id)}
|
|
259
|
+
emptyState="No notifications"
|
|
260
|
+
/>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Unread Count
|
|
264
|
+
|
|
265
|
+
Use `useNotificationsCount()` to track total and unread persistent notifications. Unread count resets when `PersistentNotificationsList` has been visible for 2 seconds.
|
|
266
|
+
|
|
267
|
+
```jsx
|
|
268
|
+
import { useNotificationsCount } from '@cube-dev/ui-kit';
|
|
269
|
+
|
|
270
|
+
const { total, unread } = useNotificationsCount();
|
|
271
|
+
|
|
272
|
+
<Button>
|
|
273
|
+
Notifications {unread > 0 && `(${unread})`}
|
|
274
|
+
</Button>
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Stack Cap
|
|
278
|
+
|
|
279
|
+
Maximum 5 notifications are visible at once. When a new notification arrives and the cap is reached, the oldest notification is evicted (dismissed) to make room. This ensures the most recent notifications are always visible. Evicted persistent notifications are moved to the persistent list.
|
|
280
|
+
|
|
281
|
+
## Duration Defaults
|
|
282
|
+
|
|
283
|
+
- **Non-persistent overlay** — 3000ms
|
|
284
|
+
- **Persistent overlay** — 5000ms
|
|
285
|
+
- **`duration: null`** — No auto-dismiss
|
|
286
|
+
|
|
287
|
+
All timers pause when any item in the container receives hover or focus, ensuring actionable notifications remain reliably clickable.
|
|
288
|
+
|
|
289
|
+
## Toast Collapse Behavior
|
|
290
|
+
|
|
291
|
+
When only toasts are visible in the overlay container (no notifications), hovering over the toast stack collapses all toasts behind the newest one. Moving the mouse away from the collapsed area expands them back. This reduces visual clutter for transient messages while keeping the latest toast visible.
|
|
292
|
+
|
|
293
|
+
Collapse is disabled when notifications are present, since notifications require user interaction.
|
|
294
|
+
|
|
295
|
+
## Accessibility
|
|
296
|
+
|
|
297
|
+
### ARIA Roles and Live Regions
|
|
298
|
+
|
|
299
|
+
- `success`, `note` themes: `role="status"`, `aria-live="polite"`
|
|
300
|
+
- `danger`, `warning` themes: `role="alert"`, `aria-live="assertive"`
|
|
301
|
+
- All live regions use `aria-atomic="true"` for full content announcement on updates
|
|
302
|
+
- `aria-relevant="additions text"` announces new items and text changes
|
|
303
|
+
- `PersistentNotificationsList` uses `role="log"` and `aria-label="Notifications"`
|
|
304
|
+
|
|
305
|
+
### Keyboard Navigation
|
|
306
|
+
|
|
307
|
+
- `Tab` - Moves focus to notification items (notifications are focusable)
|
|
308
|
+
- `Escape` - Dismisses the focused notification
|
|
309
|
+
- Action buttons are keyboard-focusable in tab order (left to right)
|
|
310
|
+
|
|
311
|
+
### Screen Reader Support
|
|
312
|
+
|
|
313
|
+
- Notifications do not steal focus on arrival
|
|
314
|
+
- Screen reader announcement is handled by `aria-live` regions
|
|
315
|
+
|
|
316
|
+
### Timer Behavior
|
|
317
|
+
|
|
318
|
+
- All timers pause when any item in the container receives hover or focus
|
|
319
|
+
- This ensures actionable notifications remain reliably clickable
|
|
320
|
+
|
|
321
|
+
## Best Practices
|
|
322
|
+
|
|
323
|
+
1. **Do**: Use notifications for action-oriented messages
|
|
324
|
+
```jsx
|
|
325
|
+
notify({
|
|
326
|
+
theme: 'success',
|
|
327
|
+
title: 'Deployment completed',
|
|
328
|
+
actions: (
|
|
329
|
+
<Notification.Action onPress={() => viewLogs()}>
|
|
330
|
+
View logs
|
|
331
|
+
</Notification.Action>
|
|
332
|
+
),
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
2. **Don't**: Use notifications for simple messages without actions — use Toast instead
|
|
337
|
+
```jsx
|
|
338
|
+
// Use toast.success('Copied to clipboard') instead
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
3. **Do**: Provide explicit `id` for persistent and stored notifications
|
|
342
|
+
```jsx
|
|
343
|
+
notify({ id: 'deploy:123', persistent: true, ... });
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
4. **Do**: Place the dismiss action last for consistent right-side positioning
|
|
347
|
+
```jsx
|
|
348
|
+
notify({
|
|
349
|
+
actions: (
|
|
350
|
+
<>
|
|
351
|
+
<Notification.Action onPress={() => upgrade()}>Upgrade</Notification.Action>
|
|
352
|
+
<Notification.Action isDismiss>Later</Notification.Action>
|
|
353
|
+
</>
|
|
354
|
+
),
|
|
355
|
+
});
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
5. **Do**: When using `isDismissable: false`, always provide actions — the user needs a way to interact
|
|
359
|
+
```jsx
|
|
360
|
+
// isDismissable: false hides the default "Dismiss" button and Escape key,
|
|
361
|
+
// but actions with closeOnPress (default true) still close the notification.
|
|
362
|
+
notify({
|
|
363
|
+
isDismissable: false,
|
|
364
|
+
duration: null,
|
|
365
|
+
actions: (
|
|
366
|
+
<>
|
|
367
|
+
<Notification.Action onPress={() => accept()}>Accept</Notification.Action>
|
|
368
|
+
<Notification.Action onPress={() => decline()}>Decline</Notification.Action>
|
|
369
|
+
</>
|
|
370
|
+
),
|
|
371
|
+
});
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
6. **Do**: Return `false` from `onPress` to keep the notification when the user cancels a confirmation flow
|
|
375
|
+
```jsx
|
|
376
|
+
<Notification.Action
|
|
377
|
+
onPress={async () => {
|
|
378
|
+
const confirmed = await showConfirmDialog();
|
|
379
|
+
if (!confirmed) return false;
|
|
380
|
+
await performAction();
|
|
381
|
+
}}
|
|
382
|
+
>
|
|
383
|
+
Upgrade
|
|
384
|
+
</Notification.Action>
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
7. **Do**: Use `record()` for server-sourced events that don't need overlay display. Pass `createdAt` to preserve the original timestamp.
|
|
388
|
+
```jsx
|
|
389
|
+
const { record } = useNotifications();
|
|
390
|
+
record({
|
|
391
|
+
id: 'alert:1',
|
|
392
|
+
theme: 'warning',
|
|
393
|
+
title: 'Server alert',
|
|
394
|
+
createdAt: serverEvent.timestamp,
|
|
395
|
+
});
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## Related Components
|
|
399
|
+
|
|
400
|
+
- [Toast](./Toast.md) - Lightweight transient messages without actions
|
|
401
|
+
- [Item](../content/Item.md) - Base component used for notification rendering
|
|
402
|
+
- [ItemAction](../actions/ItemAction.md) - Base action component wrapped by Notification.Action
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# Toast
|
|
2
|
+
|
|
3
|
+
Toast notifications provide brief, non-intrusive feedback to users about actions or events. They appear at the top center of the viewport and automatically dismiss after a configurable duration.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Provide feedback after user actions (e.g., "Copied to clipboard")
|
|
8
|
+
- Show success/error/warning messages that don't require user action
|
|
9
|
+
- Display progress states for ongoing operations
|
|
10
|
+
- Communicate non-critical information that doesn't interrupt workflow
|
|
11
|
+
|
|
12
|
+
## Component
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
### Properties
|
|
17
|
+
|
|
18
|
+
- **`title`** `ReactNode` — Primary content of the toast
|
|
19
|
+
- **`description`** `ReactNode` — Secondary content of the toast
|
|
20
|
+
- **`theme`** `'default' | 'success' | 'danger' | 'warning' | 'note'` (default: `'default'`) — Visual theme of the toast
|
|
21
|
+
|
|
22
|
+
### Base Properties
|
|
23
|
+
|
|
24
|
+
Supports [Base properties](../../BaseProperties.md)
|
|
25
|
+
|
|
26
|
+
### Styling Properties
|
|
27
|
+
|
|
28
|
+
#### styles
|
|
29
|
+
|
|
30
|
+
Customizes the root element of the toast. The toast uses the `Item` component with `type="card"` internally.
|
|
31
|
+
|
|
32
|
+
**Sub-elements:**
|
|
33
|
+
- `Label` - Primary content text
|
|
34
|
+
- `Description` - Secondary content text
|
|
35
|
+
- `Icon` - Icon container
|
|
36
|
+
|
|
37
|
+
## Themes
|
|
38
|
+
|
|
39
|
+
Available themes:
|
|
40
|
+
|
|
41
|
+
- `default` - Standard appearance
|
|
42
|
+
- `success` - Positive feedback (green)
|
|
43
|
+
- `danger` - Error or destructive action (red)
|
|
44
|
+
- `warning` - Caution or attention needed (yellow)
|
|
45
|
+
- `note` - Informational (blue)
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
### Using useToast Hook
|
|
50
|
+
|
|
51
|
+
The primary way to show toasts programmatically:
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
const toast = useToast();
|
|
55
|
+
|
|
56
|
+
// String shorthand
|
|
57
|
+
toast.success('Copied to clipboard');
|
|
58
|
+
|
|
59
|
+
// Object with options
|
|
60
|
+
toast.success({
|
|
61
|
+
title: 'Success',
|
|
62
|
+
description: 'File copied to clipboard',
|
|
63
|
+
icon: <CustomIcon />,
|
|
64
|
+
duration: 3000,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Available methods
|
|
68
|
+
toast(); // Default theme
|
|
69
|
+
toast.success(); // Success theme
|
|
70
|
+
toast.danger(); // Danger theme
|
|
71
|
+
toast.warning(); // Warning theme
|
|
72
|
+
toast.note(); // Note theme
|
|
73
|
+
toast.remove(id); // Remove a toast by id
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Declarative Toast Component
|
|
77
|
+
|
|
78
|
+
Use the `<Toast>` component for toasts that should be visible while mounted:
|
|
79
|
+
|
|
80
|
+
```jsx
|
|
81
|
+
// Simple toast (visible while mounted)
|
|
82
|
+
<Toast theme="success">Saved successfully</Toast>
|
|
83
|
+
|
|
84
|
+
// With description
|
|
85
|
+
<Toast title="Success" description="Changes saved" theme="success" />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Progress Toast
|
|
89
|
+
|
|
90
|
+
Use `useProgressToast` for operations that have loading, success, and error states. The hook manages the entire lifecycle of the toast automatically.
|
|
91
|
+
|
|
92
|
+
#### How It Works
|
|
93
|
+
|
|
94
|
+
The `useProgressToast` hook accepts an optional options object that controls the toast state. The toast only appears after `isLoading: true` is seen — non-loading initial states are silently ignored until a loading cycle occurs.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
interface ProgressToastOptions {
|
|
98
|
+
isLoading: boolean; // Whether the operation is in progress
|
|
99
|
+
title?: ReactNode; // Primary message
|
|
100
|
+
description?: ReactNode; // Secondary message
|
|
101
|
+
theme?: ToastType; // 'default' | 'success' | 'danger' | 'warning' | 'note'
|
|
102
|
+
icon?: ReactNode; // Custom icon (theme-based icons applied automatically when not loading)
|
|
103
|
+
id?: Key; // For deduplication
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Or pass empty value to immediately dismiss any existing toast
|
|
107
|
+
type ProgressToastEmpty = null | undefined | false | {};
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### State Transitions
|
|
111
|
+
|
|
112
|
+
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
|
+
**1. Loading State** (`isLoading: true`) — triggers initial appearance
|
|
115
|
+
- Toast appears immediately and persists until `isLoading` becomes `false`
|
|
116
|
+
- No auto-dismiss timer while loading
|
|
117
|
+
- This is the only state that can trigger the initial appearance of the toast
|
|
118
|
+
|
|
119
|
+
**2. Result State** (`isLoading: false` with content)
|
|
120
|
+
- Only shown after a prior loading state — ignored if loading was never seen
|
|
121
|
+
- When transitioning from loading to not loading, the toast updates to show the result
|
|
122
|
+
- Result toast auto-dismisses after 3 seconds
|
|
123
|
+
- Theme-based icons are automatically applied (success checkmark, danger X, etc.)
|
|
124
|
+
|
|
125
|
+
**3. Dismissed** (empty value, no argument, or no title when not loading)
|
|
126
|
+
- Pass `null`, `undefined`, `false`, `{}`, or call with no argument to immediately remove any existing toast
|
|
127
|
+
- Also resets the loading gate, so the next toast cycle requires `isLoading: true` again
|
|
128
|
+
- Useful for conditional rendering or cleanup
|
|
129
|
+
|
|
130
|
+
#### Basic Usage
|
|
131
|
+
|
|
132
|
+
```jsx
|
|
133
|
+
function SaveButton() {
|
|
134
|
+
const [status, setStatus] = useState('idle');
|
|
135
|
+
|
|
136
|
+
useProgressToast(
|
|
137
|
+
status === 'saving'
|
|
138
|
+
? { isLoading: true, title: 'Saving...' }
|
|
139
|
+
: status === 'success'
|
|
140
|
+
? { isLoading: false, title: 'Saved!', theme: 'success' }
|
|
141
|
+
: status === 'error'
|
|
142
|
+
? { isLoading: false, title: 'Failed to save', theme: 'danger' }
|
|
143
|
+
: null // idle state - no toast
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
return <Button onPress={() => setStatus('saving')}>Save</Button>;
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### With Error Handling
|
|
151
|
+
|
|
152
|
+
```jsx
|
|
153
|
+
function DataLoader() {
|
|
154
|
+
const { data, isLoading, error } = useQuery('data');
|
|
155
|
+
|
|
156
|
+
useProgressToast(
|
|
157
|
+
isLoading
|
|
158
|
+
? { isLoading: true, title: 'Loading data...' }
|
|
159
|
+
: error
|
|
160
|
+
? { isLoading: false, title: 'Error', description: error.message, theme: 'danger' }
|
|
161
|
+
: { isLoading: false, title: 'Data loaded', theme: 'success' }
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
return <div>{/* content */}</div>;
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### Conditional Display
|
|
169
|
+
|
|
170
|
+
Pass an empty value to prevent the toast from showing or to immediately remove an existing one:
|
|
171
|
+
|
|
172
|
+
```jsx
|
|
173
|
+
// Only show toast when needed
|
|
174
|
+
useProgressToast(
|
|
175
|
+
shouldShowProgress
|
|
176
|
+
? { isLoading: true, title: 'Processing...' }
|
|
177
|
+
: null
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
// All of these are equivalent "empty" values:
|
|
181
|
+
useProgressToast(null);
|
|
182
|
+
useProgressToast(undefined);
|
|
183
|
+
useProgressToast(false);
|
|
184
|
+
useProgressToast({});
|
|
185
|
+
useProgressToast(); // no argument also works
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### Custom Icons
|
|
189
|
+
|
|
190
|
+
When `isLoading` is `false`, the hook automatically applies theme-based icons. You can override this with a custom icon:
|
|
191
|
+
|
|
192
|
+
```jsx
|
|
193
|
+
useProgressToast({
|
|
194
|
+
isLoading: false,
|
|
195
|
+
title: 'Uploaded!',
|
|
196
|
+
theme: 'success',
|
|
197
|
+
icon: <IconCloudUpload />, // Custom icon instead of default checkmark
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### Declarative Alternative
|
|
202
|
+
|
|
203
|
+
For component-based usage, use `<Toast.Progress>`:
|
|
204
|
+
|
|
205
|
+
```jsx
|
|
206
|
+
<Toast.Progress
|
|
207
|
+
{...(isLoading
|
|
208
|
+
? { isLoading: true, title: 'Saving...' }
|
|
209
|
+
: { isLoading: false, title: 'Saved!', theme: 'success' }
|
|
210
|
+
)}
|
|
211
|
+
/>
|
|
212
|
+
|
|
213
|
+
### Interactive Progress State Toggle
|
|
214
|
+
|
|
215
|
+
<Story of={ToastStories.ProgressStateToggle} />
|
|
216
|
+
|
|
217
|
+
### Deduplication
|
|
218
|
+
|
|
219
|
+
Toasts with identical content are deduplicated. Clicking the same action multiple times will refresh the existing toast instead of creating duplicates:
|
|
220
|
+
|
|
221
|
+
<Story of={ToastStories.Deduplication} />
|
|
222
|
+
|
|
223
|
+
### Multiple Toasts
|
|
224
|
+
|
|
225
|
+
Maximum 3 toasts are visible at once. When the limit is exceeded, the oldest toast is removed:
|
|
226
|
+
|
|
227
|
+
<Story of={ToastStories.MultipleToasts} />
|
|
228
|
+
|
|
229
|
+
## Toast Behavior
|
|
230
|
+
|
|
231
|
+
### Positioning
|
|
232
|
+
- Fixed at top center of the viewport
|
|
233
|
+
- 16px from the top edge
|
|
234
|
+
- Toasts stack vertically (newest at bottom)
|
|
235
|
+
|
|
236
|
+
### Collapse on Hover
|
|
237
|
+
- When hovering over toasts, they collapse to reveal content behind them
|
|
238
|
+
- Only 8px of the newest toast remains visible
|
|
239
|
+
- Moving the mouse away restores the full toast display
|
|
240
|
+
|
|
241
|
+
### Auto-dismiss
|
|
242
|
+
- Default duration: 5 seconds
|
|
243
|
+
- Progress toasts remain visible while `isLoading` is true
|
|
244
|
+
- Set `duration: null` for persistent toasts
|
|
245
|
+
|
|
246
|
+
### Limits
|
|
247
|
+
- Maximum 3 visible toasts
|
|
248
|
+
- Progress toasts count toward the limit
|
|
249
|
+
- At least 1 temporal toast is always allowed, even with 3 progress toasts
|
|
250
|
+
|
|
251
|
+
## Accessibility
|
|
252
|
+
|
|
253
|
+
### Keyboard Navigation
|
|
254
|
+
|
|
255
|
+
- Toasts do not trap focus
|
|
256
|
+
- Close button is keyboard accessible
|
|
257
|
+
- Screen readers announce toast content
|
|
258
|
+
|
|
259
|
+
### Screen Reader Support
|
|
260
|
+
|
|
261
|
+
- Toasts are announced when they appear
|
|
262
|
+
- Uses appropriate ARIA live regions for notifications
|
|
263
|
+
|
|
264
|
+
### ARIA Properties
|
|
265
|
+
|
|
266
|
+
- `aria-label` - Provides accessible label for close button
|
|
267
|
+
|
|
268
|
+
## Best Practices
|
|
269
|
+
|
|
270
|
+
1. **Do**: Use clear, concise messages
|
|
271
|
+
|
|
272
|
+
```jsx
|
|
273
|
+
toast.success('Changes saved');
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
2. **Don't**: Use overly long or technical messages
|
|
277
|
+
|
|
278
|
+
```jsx
|
|
279
|
+
toast.success('The database transaction completed successfully with no errors');
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
3. **Accessibility**: Keep toast messages brief and actionable
|
|
283
|
+
|
|
284
|
+
4. **Performance**: Use deduplication for repeated actions to avoid toast spam
|
|
285
|
+
|
|
286
|
+
## Related Components
|
|
287
|
+
|
|
288
|
+
- [Item](/components/Item) - Base component used for toast rendering
|
|
289
|
+
- [Alert](/components/Alert) - For persistent, inline feedback
|