@cube-dev/ui-kit 0.120.1 → 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.
Files changed (540) hide show
  1. package/dist/CHANGELOG.md +20 -0
  2. package/dist/_internal/hooks/use-chained-callback.js +1 -1
  3. package/dist/_internal/hooks/use-debounced-value.js +1 -1
  4. package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
  5. package/dist/_internal/hooks/use-event.js +1 -1
  6. package/dist/_internal/hooks/use-is-first-render.js +1 -1
  7. package/dist/_internal/hooks/use-sync-ref.js +1 -1
  8. package/dist/_internal/hooks/use-timer/timer.js +1 -1
  9. package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
  10. package/dist/_internal/hooks/use-warn.js +1 -1
  11. package/dist/components/Block.js +1 -1
  12. package/dist/components/CollectionItem.js +1 -1
  13. package/dist/components/GlobalStyles.js +1 -1
  14. package/dist/components/GridProvider.js +1 -1
  15. package/dist/components/HiddenInput.js +1 -1
  16. package/dist/components/Root.js +1 -1
  17. package/dist/components/actions/Action/Action.js +1 -1
  18. package/dist/components/actions/Banner/Banner.js +1 -1
  19. package/dist/components/actions/Button/Button.d.ts +1 -0
  20. package/dist/components/actions/Button/Button.js +34 -14
  21. package/dist/components/actions/Button/Button.js.map +1 -1
  22. package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
  23. package/dist/components/actions/ButtonSplit/ButtonSplit.d.ts +47 -0
  24. package/dist/components/actions/ButtonSplit/ButtonSplit.js +105 -0
  25. package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +1 -0
  26. package/dist/components/actions/ButtonSplit/context.d.ts +18 -0
  27. package/dist/components/actions/ButtonSplit/context.js +12 -0
  28. package/dist/components/actions/ButtonSplit/context.js.map +1 -0
  29. package/dist/components/actions/ButtonSplit/index.d.ts +3 -0
  30. package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
  31. package/dist/components/actions/CommandMenu/styled.js +1 -1
  32. package/dist/components/actions/ItemAction/ItemAction.js +1 -1
  33. package/dist/components/actions/ItemActionContext.js +1 -1
  34. package/dist/components/actions/ItemButton/ItemButton.js +1 -1
  35. package/dist/components/actions/Link/Link.js +1 -1
  36. package/dist/components/actions/Menu/Menu.d.ts +2 -2
  37. package/dist/components/actions/Menu/Menu.js +1 -1
  38. package/dist/components/actions/Menu/MenuItem.js +1 -1
  39. package/dist/components/actions/Menu/MenuSection.js +1 -1
  40. package/dist/components/actions/Menu/MenuTrigger.js +1 -1
  41. package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
  42. package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
  43. package/dist/components/actions/Menu/context.js +1 -1
  44. package/dist/components/actions/Menu/styled.js +1 -1
  45. package/dist/components/actions/index.d.ts +8 -3
  46. package/dist/components/actions/index.js +10 -5
  47. package/dist/components/actions/index.js.map +1 -1
  48. package/dist/components/actions/use-action.d.ts +1 -0
  49. package/dist/components/actions/use-action.js +21 -18
  50. package/dist/components/actions/use-action.js.map +1 -1
  51. package/dist/components/actions/use-anchored-menu.js +1 -1
  52. package/dist/components/actions/use-context-menu.js +1 -1
  53. package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
  54. package/dist/components/content/Alert/Alert.js +1 -1
  55. package/dist/components/content/Alert/use-alert.js +1 -1
  56. package/dist/components/content/Avatar/Avatar.js +1 -1
  57. package/dist/components/content/Badge/Badge.js +2 -1
  58. package/dist/components/content/Badge/Badge.js.map +1 -1
  59. package/dist/components/content/Card/Card.js +1 -1
  60. package/dist/components/content/Content.js +1 -1
  61. package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
  62. package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
  63. package/dist/components/content/Disclosure/Disclosure.js +5 -2
  64. package/dist/components/content/Disclosure/Disclosure.js.map +1 -1
  65. package/dist/components/content/Divider.js +1 -1
  66. package/dist/components/content/Footer.js +1 -1
  67. package/dist/components/content/Header.js +1 -1
  68. package/dist/components/content/HotKeys/HotKeys.js +1 -1
  69. package/dist/components/content/Item/Item.js +1 -1
  70. package/dist/components/content/ItemBadge/ItemBadge.js +3 -2
  71. package/dist/components/content/ItemBadge/ItemBadge.js.map +1 -1
  72. package/dist/components/content/ItemCard/ItemCard.js +1 -1
  73. package/dist/components/content/Layout/GridLayout.js +1 -1
  74. package/dist/components/content/Layout/Layout.js +1 -1
  75. package/dist/components/content/Layout/LayoutBlock.js +1 -1
  76. package/dist/components/content/Layout/LayoutCenter.js +1 -1
  77. package/dist/components/content/Layout/LayoutContainer.js +1 -1
  78. package/dist/components/content/Layout/LayoutContent.js +1 -1
  79. package/dist/components/content/Layout/LayoutContext.js +1 -1
  80. package/dist/components/content/Layout/LayoutFlex.js +1 -1
  81. package/dist/components/content/Layout/LayoutFooter.js +1 -1
  82. package/dist/components/content/Layout/LayoutGrid.js +1 -1
  83. package/dist/components/content/Layout/LayoutHeader.js +1 -1
  84. package/dist/components/content/Layout/LayoutPane.js +1 -1
  85. package/dist/components/content/Layout/LayoutPanel.js +1 -1
  86. package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
  87. package/dist/components/content/Layout/LayoutToolbar.js +1 -1
  88. package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
  89. package/dist/components/content/Layout/index.js +1 -1
  90. package/dist/components/content/Layout/utils.js +1 -1
  91. package/dist/components/content/Paragraph.js +1 -1
  92. package/dist/components/content/Placeholder/Placeholder.js +1 -1
  93. package/dist/components/content/PrismCode/PrismCode.js +1 -1
  94. package/dist/components/content/PrismCode/prismSetup.js +1 -1
  95. package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
  96. package/dist/components/content/Result/Result.js +1 -1
  97. package/dist/components/content/Skeleton/Skeleton.js +1 -1
  98. package/dist/components/content/Tag/Tag.js +2 -1
  99. package/dist/components/content/Tag/Tag.js.map +1 -1
  100. package/dist/components/content/Text.js +1 -1
  101. package/dist/components/content/TextItem/TextItem.js +1 -1
  102. package/dist/components/content/Title.js +1 -1
  103. package/dist/components/content/highlightText.js +1 -1
  104. package/dist/components/content/use-auto-tooltip.js +1 -1
  105. package/dist/components/fields/Checkbox/Checkbox.js +1 -1
  106. package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
  107. package/dist/components/fields/Checkbox/context.js +1 -1
  108. package/dist/components/fields/ComboBox/ComboBox.js +1 -1
  109. package/dist/components/fields/DatePicker/DateInput.js +1 -1
  110. package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
  111. package/dist/components/fields/DatePicker/DatePicker.js +1 -1
  112. package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
  113. package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
  114. package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
  115. package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
  116. package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
  117. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
  118. package/dist/components/fields/DatePicker/TimeInput.js +1 -1
  119. package/dist/components/fields/DatePicker/intl.js +1 -1
  120. package/dist/components/fields/DatePicker/parseDate.js +1 -1
  121. package/dist/components/fields/DatePicker/props.js +1 -1
  122. package/dist/components/fields/DatePicker/utils.js +1 -1
  123. package/dist/components/fields/FileInput/FileInput.js +1 -1
  124. package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
  125. package/dist/components/fields/FilterPicker/FilterPicker.js +2 -2
  126. package/dist/components/fields/Input/Input.js +1 -1
  127. package/dist/components/fields/ListBox/ListBox.js +1 -1
  128. package/dist/components/fields/NumberInput/NumberInput.js +1 -1
  129. package/dist/components/fields/NumberInput/StepButton.js +1 -1
  130. package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
  131. package/dist/components/fields/Picker/Picker.js +2 -2
  132. package/dist/components/fields/RadioGroup/Radio.js +3 -1
  133. package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
  134. package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
  135. package/dist/components/fields/RadioGroup/context.js +1 -1
  136. package/dist/components/fields/SearchInput/SearchInput.js +1 -1
  137. package/dist/components/fields/Select/Select.d.ts +8 -2
  138. package/dist/components/fields/Select/Select.js +1 -1
  139. package/dist/components/fields/Select/Select.js.map +1 -1
  140. package/dist/components/fields/Slider/Gradation.js +1 -1
  141. package/dist/components/fields/Slider/HueSlider.js +1 -1
  142. package/dist/components/fields/Slider/RangeSlider.js +1 -1
  143. package/dist/components/fields/Slider/Slider.js +1 -1
  144. package/dist/components/fields/Slider/SliderBase.js +1 -1
  145. package/dist/components/fields/Slider/SliderThumb.js +1 -1
  146. package/dist/components/fields/Slider/SliderTrack.js +1 -1
  147. package/dist/components/fields/Slider/elements.js +1 -1
  148. package/dist/components/fields/Slider/index.js +1 -1
  149. package/dist/components/fields/Switch/Switch.js +1 -1
  150. package/dist/components/fields/TextArea/TextArea.js +1 -1
  151. package/dist/components/fields/TextInput/TextInput.js +1 -1
  152. package/dist/components/fields/TextInput/TextInputBase.js +1 -1
  153. package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
  154. package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
  155. package/dist/components/form/FieldWrapper/extract-field-wrapper-props.js +1 -1
  156. package/dist/components/form/Form/Field.js +1 -1
  157. package/dist/components/form/Form/Form.js +1 -1
  158. package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
  159. package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
  160. package/dist/components/form/Form/SubmitError.js +1 -1
  161. package/dist/components/form/Form/index.js +1 -1
  162. package/dist/components/form/Form/use-field/use-field-props.js +1 -1
  163. package/dist/components/form/Form/use-field/use-field.js +1 -1
  164. package/dist/components/form/Form/use-form.js +1 -1
  165. package/dist/components/form/Form/validation.js +1 -1
  166. package/dist/components/form/Label.js +1 -1
  167. package/dist/components/form/wrapper.js +1 -1
  168. package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
  169. package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
  170. package/dist/components/layout/Flex.js +1 -1
  171. package/dist/components/layout/Flow.js +1 -1
  172. package/dist/components/layout/Grid.js +1 -1
  173. package/dist/components/layout/Panel.js +1 -1
  174. package/dist/components/layout/Prefix.js +1 -1
  175. package/dist/components/layout/ResizablePanel.js +1 -1
  176. package/dist/components/layout/Space.js +1 -1
  177. package/dist/components/layout/Suffix.js +1 -1
  178. package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
  179. package/dist/components/navigation/Tabs/EditableTitle.js +1 -1
  180. package/dist/components/navigation/Tabs/TabButton.js +1 -1
  181. package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
  182. package/dist/components/navigation/Tabs/TabPanel.js +1 -1
  183. package/dist/components/navigation/Tabs/TabPicker.js +2 -1
  184. package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
  185. package/dist/components/navigation/Tabs/Tabs.js +1 -1
  186. package/dist/components/navigation/Tabs/TabsAction.js +1 -1
  187. package/dist/components/navigation/Tabs/TabsContext.js +1 -1
  188. package/dist/components/navigation/Tabs/styled.js +3 -1
  189. package/dist/components/navigation/Tabs/styled.js.map +1 -1
  190. package/dist/components/navigation/Tabs/types.d.ts +2 -2
  191. package/dist/components/navigation/Tabs/types.js +1 -1
  192. package/dist/components/navigation/Tabs/types.js.map +1 -1
  193. package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
  194. package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
  195. package/dist/components/organisms/FileTabs/FileTabs.js +1 -1
  196. package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
  197. package/dist/components/other/Calendar/Calendar.js +1 -1
  198. package/dist/components/other/Calendar/CalendarCell.js +1 -1
  199. package/dist/components/other/Calendar/CalendarGrid.js +1 -1
  200. package/dist/components/other/Calendar/RangeCalendar.js +1 -1
  201. package/dist/components/other/CloudLogo/CloudLogo.js +1 -1
  202. package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
  203. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
  204. package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
  205. package/dist/components/overlays/Dialog/Dialog.js +2 -2
  206. package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
  207. package/dist/components/overlays/Dialog/DialogForm.js +1 -1
  208. package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
  209. package/dist/components/overlays/Dialog/context.js +1 -1
  210. package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
  211. package/dist/components/overlays/Modal/Modal.js +1 -1
  212. package/dist/components/overlays/Modal/OpenTransition.js +1 -1
  213. package/dist/components/overlays/Modal/Overlay.js +1 -1
  214. package/dist/components/overlays/Modal/Popover.js +1 -1
  215. package/dist/components/overlays/Modal/Tray.js +1 -1
  216. package/dist/components/overlays/Modal/Underlay.js +1 -1
  217. package/dist/components/overlays/Notifications/Notification.js +1 -1
  218. package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
  219. package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
  220. package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
  221. package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
  222. package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
  223. package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
  224. package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
  225. package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
  226. package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
  227. package/dist/components/overlays/Notifications/index.js +1 -1
  228. package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
  229. package/dist/components/overlays/Notifications/use-notifications.js +1 -1
  230. package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
  231. package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
  232. package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
  233. package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
  234. package/dist/components/overlays/Toast/ToastItem.js +1 -1
  235. package/dist/components/overlays/Toast/index.js +1 -1
  236. package/dist/components/overlays/Toast/useProgressToast.js +1 -1
  237. package/dist/components/overlays/Toast/useToast.js +1 -1
  238. package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
  239. package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
  240. package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
  241. package/dist/components/overlays/Tooltip/context.js +1 -1
  242. package/dist/components/portal/Portal.js +1 -1
  243. package/dist/components/portal/PortalProvider.js +1 -1
  244. package/dist/components/portal/usePortal.js +1 -1
  245. package/dist/components/shared/InvalidIcon.js +1 -1
  246. package/dist/components/shared/ValidIcon.js +1 -1
  247. package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
  248. package/dist/components/status/Spin/Cube.js +1 -1
  249. package/dist/components/status/Spin/InternalSpinner.js +1 -1
  250. package/dist/components/status/Spin/Spin.js +1 -1
  251. package/dist/components/status/Spin/SpinsContainer.js +1 -1
  252. package/dist/data/item-themes.js +6 -6
  253. package/dist/data/item-themes.js.map +1 -1
  254. package/dist/data/themes.js +1 -1
  255. package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
  256. package/dist/icons/AdjustmentsIcon.js +1 -1
  257. package/dist/icons/AiIcon.js +1 -1
  258. package/dist/icons/AreaChartIcon.js +1 -1
  259. package/dist/icons/BackwardIcon.js +1 -1
  260. package/dist/icons/BarChartIcon.js +1 -1
  261. package/dist/icons/BellFilledIcon.js +1 -1
  262. package/dist/icons/BellIcon.js +1 -1
  263. package/dist/icons/BooleanIcon.js +1 -1
  264. package/dist/icons/CalendarEditIcon.js +1 -1
  265. package/dist/icons/CalendarIcon.js +1 -1
  266. package/dist/icons/CaretDownIcon.js +1 -1
  267. package/dist/icons/CaretUpIcon.js +1 -1
  268. package/dist/icons/ChartAreaStackedIcon.js +1 -1
  269. package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
  270. package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
  271. package/dist/icons/ChartBarGroupedIcon.js +1 -1
  272. package/dist/icons/ChartBarHorizontalIcon.js +1 -1
  273. package/dist/icons/ChartBarLineIcon.js +1 -1
  274. package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
  275. package/dist/icons/ChartBarStackedIcon.js +1 -1
  276. package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
  277. package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
  278. package/dist/icons/ChartBoxPlot2Icon.js +1 -1
  279. package/dist/icons/ChartBoxPlotIcon.js +1 -1
  280. package/dist/icons/ChartBubbleIcon.js +1 -1
  281. package/dist/icons/ChartDonut2Icon.js +1 -1
  282. package/dist/icons/ChartFunnelIcon.js +1 -1
  283. package/dist/icons/ChartHeatmapIcon.js +1 -1
  284. package/dist/icons/ChartKPIIcon.js +1 -1
  285. package/dist/icons/ChartPie2Icon.js +1 -1
  286. package/dist/icons/ChartScatterIcon.js +1 -1
  287. package/dist/icons/CheckCircleFilledIcon.js +1 -1
  288. package/dist/icons/CheckCircleIcon.js +1 -1
  289. package/dist/icons/CheckIcon.js +1 -1
  290. package/dist/icons/CircleFilledIcon.js +1 -1
  291. package/dist/icons/ClearIcon.js +1 -1
  292. package/dist/icons/CloseCircleFilledIcon.js +1 -1
  293. package/dist/icons/CloseCircleIcon.js +1 -1
  294. package/dist/icons/CloseIcon.js +1 -1
  295. package/dist/icons/CodeIcon.js +1 -1
  296. package/dist/icons/ColumnTotalIcon.js +1 -1
  297. package/dist/icons/CopyIcon.js +1 -1
  298. package/dist/icons/CountIcon.js +1 -1
  299. package/dist/icons/CubeIcon.js +1 -1
  300. package/dist/icons/CubePauseIcon.js +1 -1
  301. package/dist/icons/CubePlayIcon.js +1 -1
  302. package/dist/icons/CurrencyDollarIcon.js +1 -1
  303. package/dist/icons/DangerIcon.js +1 -1
  304. package/dist/icons/DashboardIcon.js +1 -1
  305. package/dist/icons/DatabaseIcon.js +1 -1
  306. package/dist/icons/DecimalDecreaseIcon.js +1 -1
  307. package/dist/icons/DecimalIncreaseIcon.js +1 -1
  308. package/dist/icons/DirectionIcon.js +1 -1
  309. package/dist/icons/DonutIcon.js +1 -1
  310. package/dist/icons/DownIcon.js +1 -1
  311. package/dist/icons/EditIcon.js +1 -1
  312. package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
  313. package/dist/icons/ExclamationCircleIcon.js +1 -1
  314. package/dist/icons/ExclamationIcon.js +1 -1
  315. package/dist/icons/EyeIcon.js +1 -1
  316. package/dist/icons/EyeInvisibleIcon.js +1 -1
  317. package/dist/icons/FilterIcon.js +1 -1
  318. package/dist/icons/FolderFilledIcon.js +1 -1
  319. package/dist/icons/FolderIcon.js +1 -1
  320. package/dist/icons/FolderOpenFilledIcon.js +1 -1
  321. package/dist/icons/FolderOpenIcon.js +1 -1
  322. package/dist/icons/ForwardIcon.js +1 -1
  323. package/dist/icons/HierarchyIcon.js +1 -1
  324. package/dist/icons/HierarchyOpenIcon.js +1 -1
  325. package/dist/icons/Icon.js +1 -1
  326. package/dist/icons/InfoCircleIcon.js +1 -1
  327. package/dist/icons/InfoIcon.js +1 -1
  328. package/dist/icons/KeyIcon.js +1 -1
  329. package/dist/icons/LeftIcon.js +1 -1
  330. package/dist/icons/LineChartIcon.js +1 -1
  331. package/dist/icons/LoadingIcon.js +1 -1
  332. package/dist/icons/LockFilledIcon.js +1 -1
  333. package/dist/icons/LockIcon.js +1 -1
  334. package/dist/icons/MoreIcon.js +1 -1
  335. package/dist/icons/NotAllowedIcon.js +1 -1
  336. package/dist/icons/Number123Icon.js +1 -1
  337. package/dist/icons/NumberIcon.js +1 -1
  338. package/dist/icons/PauseCircleFilledIcon.js +1 -1
  339. package/dist/icons/PauseCircleIcon.js +1 -1
  340. package/dist/icons/PauseIcon.js +1 -1
  341. package/dist/icons/PercentageIcon.js +1 -1
  342. package/dist/icons/PieChartIcon.js +1 -1
  343. package/dist/icons/PlayCircleIcon.js +1 -1
  344. package/dist/icons/PlayIcon.js +1 -1
  345. package/dist/icons/PlusIcon.js +1 -1
  346. package/dist/icons/ProgressBarIcon.js +1 -1
  347. package/dist/icons/ReloadIcon.js +1 -1
  348. package/dist/icons/ReportIcon.js +1 -1
  349. package/dist/icons/ReturnIcon.js +1 -1
  350. package/dist/icons/RightIcon.js +1 -1
  351. package/dist/icons/RowTotalsIcon.js +1 -1
  352. package/dist/icons/SchemeIcon.js +1 -1
  353. package/dist/icons/SearchIcon.js +1 -1
  354. package/dist/icons/SemanticQueryIcon.js +1 -1
  355. package/dist/icons/SettingsIcon.js +1 -1
  356. package/dist/icons/ShieldFilledIcon.js +1 -1
  357. package/dist/icons/ShieldIcon.js +1 -1
  358. package/dist/icons/SlashIcon.js +1 -1
  359. package/dist/icons/SparklesIcon.js +1 -1
  360. package/dist/icons/SqlIcon.js +1 -1
  361. package/dist/icons/StatsIcon.js +1 -1
  362. package/dist/icons/StopIcon.js +1 -1
  363. package/dist/icons/StringIcon.js +1 -1
  364. package/dist/icons/SubtotalsIcon.js +1 -1
  365. package/dist/icons/SwitchIcon.js +1 -1
  366. package/dist/icons/TableIcon.js +1 -1
  367. package/dist/icons/ThumbsDownIcon.js +1 -1
  368. package/dist/icons/ThumbsUpIcon.js +1 -1
  369. package/dist/icons/ThunderboltCrossedIcon.js +1 -1
  370. package/dist/icons/ThunderboltFilledIcon.js +1 -1
  371. package/dist/icons/ThunderboltIcon.js +1 -1
  372. package/dist/icons/TimeIcon.js +1 -1
  373. package/dist/icons/TrashIcon.js +1 -1
  374. package/dist/icons/UnlockIcon.js +1 -1
  375. package/dist/icons/UpIcon.js +1 -1
  376. package/dist/icons/UserGroupIcon.js +1 -1
  377. package/dist/icons/UserIcon.js +1 -1
  378. package/dist/icons/UserLockIcon.js +1 -1
  379. package/dist/icons/ViewIcon.js +1 -1
  380. package/dist/icons/WarningFilledIcon.js +1 -1
  381. package/dist/icons/WarningIcon.js +1 -1
  382. package/dist/icons/wrap-icon.js +1 -1
  383. package/dist/index.d.ts +6 -4
  384. package/dist/index.js +7 -5
  385. package/dist/index.js.map +1 -1
  386. package/dist/provider.js +1 -1
  387. package/dist/providers/TrackingProvider.js +1 -1
  388. package/dist/providers/navigationAdapter.default.js +1 -1
  389. package/dist/tokens/base.js +1 -1
  390. package/dist/tokens/colors.js +1 -1
  391. package/dist/tokens/index.js +1 -1
  392. package/dist/tokens/layout.js +1 -1
  393. package/dist/tokens/shadows.js +1 -1
  394. package/dist/tokens/sizes.js +1 -1
  395. package/dist/tokens/spacing.js +1 -1
  396. package/dist/utils/ResizeSensor.js +1 -1
  397. package/dist/utils/is-dev-env.js +1 -1
  398. package/dist/utils/modules.js +1 -1
  399. package/dist/utils/promise.js +1 -1
  400. package/dist/utils/raf.js +1 -1
  401. package/dist/utils/random.js +1 -1
  402. package/dist/utils/range.js +1 -1
  403. package/dist/utils/react/RenderCache.js +1 -1
  404. package/dist/utils/react/Slots.js +1 -1
  405. package/dist/utils/react/chain.js +1 -1
  406. package/dist/utils/react/forwardRefWithGenerics.js +1 -1
  407. package/dist/utils/react/index.js +1 -1
  408. package/dist/utils/react/interactions.js +1 -1
  409. package/dist/utils/react/isTextOnly.js +1 -1
  410. package/dist/utils/react/mapProps.js +1 -1
  411. package/dist/utils/react/mergeProps.js +1 -1
  412. package/dist/utils/react/nullableValue.js +1 -1
  413. package/dist/utils/react/resolveIcon.js +1 -1
  414. package/dist/utils/react/sharedStore.js +1 -1
  415. package/dist/utils/react/useCombinedRefs.js +1 -1
  416. package/dist/utils/react/useControlledFocusVisible.js +1 -1
  417. package/dist/utils/react/useEventBus.js +1 -1
  418. package/dist/utils/react/useId.js +1 -1
  419. package/dist/utils/react/useIsDarwin.js +1 -1
  420. package/dist/utils/react/useKeySymbols.js +1 -1
  421. package/dist/utils/react/useLayoutEffect.js +1 -1
  422. package/dist/utils/react/useLocalStorage.js +1 -1
  423. package/dist/utils/react/useMergeStyles.js +1 -1
  424. package/dist/utils/react/useQaProps.js +1 -1
  425. package/dist/utils/react/useViewportSize.js +1 -1
  426. package/dist/utils/react/wrapNodeIfPlain.js +1 -1
  427. package/dist/utils/tree.js +1 -1
  428. package/dist/utils/warnings.js +1 -1
  429. package/dist/version.js +2 -2
  430. package/docs/BaseProperties.md +78 -0
  431. package/docs/ComplexLayout.md +459 -0
  432. package/docs/CreateComponent.md +410 -0
  433. package/docs/FieldProperties.md +117 -0
  434. package/docs/Introduction.md +122 -0
  435. package/docs/RenderCache.md +177 -0
  436. package/docs/Result.md +42 -0
  437. package/docs/SimpleLayout.md +26 -0
  438. package/docs/Typography.md +38 -0
  439. package/docs/components/Block.md +33 -0
  440. package/docs/components/CollectionItem.md +293 -0
  441. package/docs/components/GridProvider.md +38 -0
  442. package/docs/components/Root.md +50 -0
  443. package/docs/components/actions/Action.md +47 -0
  444. package/docs/components/actions/Banner.md +195 -0
  445. package/docs/components/actions/Button.md +209 -0
  446. package/docs/components/actions/ButtonGroup.md +46 -0
  447. package/docs/components/actions/ButtonSplit.md +199 -0
  448. package/docs/components/actions/CommandMenu.md +422 -0
  449. package/docs/components/actions/ItemAction.md +60 -0
  450. package/docs/components/actions/ItemButton.md +316 -0
  451. package/docs/components/actions/Link.md +325 -0
  452. package/docs/components/actions/Menu.md +485 -0
  453. package/docs/components/actions/MenuTrigger.md +47 -0
  454. package/docs/components/actions/SubMenuTrigger.md +38 -0
  455. package/docs/components/actions/use-anchored-menu.md +209 -0
  456. package/docs/components/actions/use-context-menu.md +218 -0
  457. package/docs/components/content/ActiveZone.md +37 -0
  458. package/docs/components/content/Alert.md +40 -0
  459. package/docs/components/content/Avatar.md +37 -0
  460. package/docs/components/content/Badge.md +194 -0
  461. package/docs/components/content/Card.md +40 -0
  462. package/docs/components/content/Content.md +44 -0
  463. package/docs/components/content/CopyPasteBlock.md +36 -0
  464. package/docs/components/content/CopySnippet.md +43 -0
  465. package/docs/components/content/Disclosure.md +181 -0
  466. package/docs/components/content/Divider.md +39 -0
  467. package/docs/components/content/Footer.md +35 -0
  468. package/docs/components/content/Header.md +35 -0
  469. package/docs/components/content/HotKeys.md +352 -0
  470. package/docs/components/content/Item.md +499 -0
  471. package/docs/components/content/ItemBadge.md +31 -0
  472. package/docs/components/content/ItemCard.md +131 -0
  473. package/docs/components/content/Layout.md +843 -0
  474. package/docs/components/content/Paragraph.md +32 -0
  475. package/docs/components/content/Placeholder.md +37 -0
  476. package/docs/components/content/PrismCode.md +36 -0
  477. package/docs/components/content/PrismDiffCode.md +29 -0
  478. package/docs/components/content/Result.md +46 -0
  479. package/docs/components/content/Skeleton.md +35 -0
  480. package/docs/components/content/Tag.md +165 -0
  481. package/docs/components/content/Text.md +54 -0
  482. package/docs/components/content/TextItem.md +217 -0
  483. package/docs/components/content/Title.md +45 -0
  484. package/docs/components/fields/Checkbox.md +176 -0
  485. package/docs/components/fields/ComboBox.md +651 -0
  486. package/docs/components/fields/DatePicker.md +227 -0
  487. package/docs/components/fields/FileInput.md +194 -0
  488. package/docs/components/fields/FilterListBox.md +726 -0
  489. package/docs/components/fields/FilterPicker.md +776 -0
  490. package/docs/components/fields/HueSlider.md +175 -0
  491. package/docs/components/fields/ListBox.md +714 -0
  492. package/docs/components/fields/NumberInput.md +180 -0
  493. package/docs/components/fields/PasswordInput.md +214 -0
  494. package/docs/components/fields/Picker.md +906 -0
  495. package/docs/components/fields/RadioGroup.md +310 -0
  496. package/docs/components/fields/SearchInput.md +224 -0
  497. package/docs/components/fields/Select.md +576 -0
  498. package/docs/components/fields/Slider.md +53 -0
  499. package/docs/components/fields/Switch.md +169 -0
  500. package/docs/components/fields/TextArea.md +61 -0
  501. package/docs/components/fields/TextInput.md +205 -0
  502. package/docs/components/fields/TextInputMapper.md +34 -0
  503. package/docs/components/form/Field.md +333 -0
  504. package/docs/components/form/Form.md +644 -0
  505. package/docs/components/form/FormInstance.md +307 -0
  506. package/docs/components/helpers/DisplayTransition.md +268 -0
  507. package/docs/components/helpers/IconSwitch.md +160 -0
  508. package/docs/components/layout/Flex.md +51 -0
  509. package/docs/components/layout/Flow.md +32 -0
  510. package/docs/components/layout/Grid.md +46 -0
  511. package/docs/components/layout/Panel.md +65 -0
  512. package/docs/components/layout/Prefix.md +37 -0
  513. package/docs/components/layout/ResizablePanel.md +69 -0
  514. package/docs/components/layout/Space.md +44 -0
  515. package/docs/components/layout/Suffix.md +39 -0
  516. package/docs/components/navigation/Tabs.md +726 -0
  517. package/docs/components/organisms/FileTabs.md +39 -0
  518. package/docs/components/organisms/StatsCard.md +40 -0
  519. package/docs/components/other/CloudLogo.md +33 -0
  520. package/docs/components/overlays/AlertDialog.md +51 -0
  521. package/docs/components/overlays/Dialog.md +200 -0
  522. package/docs/components/overlays/DialogContainer.md +201 -0
  523. package/docs/components/overlays/DialogForm.md +295 -0
  524. package/docs/components/overlays/DialogTrigger.md +191 -0
  525. package/docs/components/overlays/Notifications.md +402 -0
  526. package/docs/components/overlays/Toast.md +289 -0
  527. package/docs/components/overlays/Tooltip.md +400 -0
  528. package/docs/components/overlays/TooltipProvider.md +42 -0
  529. package/docs/components/overlays/TooltipTrigger.md +42 -0
  530. package/docs/components/overlays/UseDialogContainer.md +597 -0
  531. package/docs/components/portal/Portal.md +29 -0
  532. package/docs/components/status/LoadingAnimation.md +27 -0
  533. package/docs/components/status/Spin.md +35 -0
  534. package/docs/tasty/configuration.md +211 -0
  535. package/docs/tasty/debug.md +505 -0
  536. package/docs/tasty/injector.md +528 -0
  537. package/docs/tasty/styles.md +567 -0
  538. package/docs/tasty/tasty-static.md +376 -0
  539. package/docs/tasty/usage.md +643 -0
  540. package/package.json +5 -9
@@ -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