@lablup/ui-common 0.1.0-alpha.8 → 0.2.0-alpha.15

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 (909) hide show
  1. package/NOTICE +62 -0
  2. package/README.md +490 -68
  3. package/astryx/components/AlertModal.doc.mjs +91 -0
  4. package/astryx/components/AlertModal.tsx +3 -0
  5. package/astryx/components/BoardItemTitle.doc.mjs +51 -0
  6. package/astryx/components/BoardItemTitle.tsx +3 -0
  7. package/astryx/components/BooleanToken.doc.mjs +57 -0
  8. package/astryx/components/BooleanToken.tsx +3 -0
  9. package/astryx/components/BulkEditFormItem.doc.mjs +68 -0
  10. package/astryx/components/BulkEditFormItem.tsx +3 -0
  11. package/astryx/components/BulkErrorModal.doc.mjs +75 -0
  12. package/astryx/components/BulkErrorModal.tsx +3 -0
  13. package/astryx/components/ColorPicker.doc.mjs +88 -0
  14. package/astryx/components/ColorPicker.tsx +3 -0
  15. package/astryx/components/ConfirmPopover.doc.mjs +99 -0
  16. package/astryx/components/ConfirmPopover.tsx +3 -0
  17. package/astryx/components/CountBadge.doc.mjs +93 -0
  18. package/astryx/components/CountBadge.tsx +3 -0
  19. package/astryx/components/CountdownBorder.doc.mjs +57 -0
  20. package/astryx/components/CountdownBorder.tsx +3 -0
  21. package/astryx/components/DataGrid.doc.mjs +166 -0
  22. package/astryx/components/DataGrid.tsx +3 -0
  23. package/astryx/components/DeleteConfirmModal.doc.mjs +163 -0
  24. package/astryx/components/DeleteConfirmModal.tsx +3 -0
  25. package/astryx/components/DividedRow.doc.mjs +85 -0
  26. package/astryx/components/DividedRow.tsx +3 -0
  27. package/astryx/components/DoubleBadge.doc.mjs +40 -0
  28. package/astryx/components/DoubleBadge.tsx +3 -0
  29. package/astryx/components/DoubleToken.doc.mjs +38 -0
  30. package/astryx/components/DoubleToken.tsx +3 -0
  31. package/astryx/components/Form.doc.mjs +113 -0
  32. package/astryx/components/Form.tsx +3 -0
  33. package/astryx/components/IconWithTooltip.doc.mjs +57 -0
  34. package/astryx/components/IconWithTooltip.tsx +3 -0
  35. package/astryx/components/ImageWithFallback.doc.mjs +47 -0
  36. package/astryx/components/ImageWithFallback.tsx +3 -0
  37. package/astryx/components/ListBanner.doc.mjs +50 -0
  38. package/astryx/components/ListBanner.tsx +3 -0
  39. package/astryx/components/Modal.doc.mjs +176 -0
  40. package/astryx/components/Modal.tsx +3 -0
  41. package/astryx/components/NotificationItem.doc.mjs +52 -0
  42. package/astryx/components/NotificationItem.tsx +3 -0
  43. package/astryx/components/NotificationStack.doc.mjs +66 -0
  44. package/astryx/components/NotificationStack.tsx +3 -0
  45. package/astryx/components/OverlayScrollbar.doc.mjs +49 -0
  46. package/astryx/components/OverlayScrollbar.tsx +3 -0
  47. package/astryx/components/PageHeader.doc.mjs +94 -0
  48. package/astryx/components/PageHeader.tsx +3 -0
  49. package/astryx/components/PagedSelector.doc.mjs +183 -0
  50. package/astryx/components/PagedSelector.tsx +3 -0
  51. package/astryx/components/ProgressWithLabel.doc.mjs +69 -0
  52. package/astryx/components/ProgressWithLabel.tsx +3 -0
  53. package/astryx/components/SelectionLabel.doc.mjs +55 -0
  54. package/astryx/components/SelectionLabel.tsx +3 -0
  55. package/astryx/components/Statistic.doc.mjs +84 -0
  56. package/astryx/components/Statistic.tsx +3 -0
  57. package/astryx/components/StepNumberInput.doc.mjs +102 -0
  58. package/astryx/components/StepNumberInput.tsx +3 -0
  59. package/astryx/components/TextHighlighter.doc.mjs +47 -0
  60. package/astryx/components/TextHighlighter.tsx +3 -0
  61. package/astryx/components/TokenList.doc.mjs +58 -0
  62. package/astryx/components/TokenList.tsx +3 -0
  63. package/astryx/components/TokenRow.doc.mjs +62 -0
  64. package/astryx/components/TokenRow.tsx +3 -0
  65. package/astryx/components/UncontrolledInput.doc.mjs +68 -0
  66. package/astryx/components/UncontrolledInput.tsx +3 -0
  67. package/astryx/components/UnitGrid.doc.mjs +107 -0
  68. package/astryx/components/UnitGrid.tsx +3 -0
  69. package/astryx/docs/ui-common.doc.mjs +112 -0
  70. package/astryx.integration.mjs +35 -0
  71. package/dist/assets/components/BoardItemTitle/BoardItemTitle.css +2 -0
  72. package/dist/assets/components/BulkErrorModal/BulkErrorModal.css +2 -0
  73. package/dist/assets/components/ColorPicker/ColorPicker.css +2 -0
  74. package/dist/assets/components/CountBadge/CountBadge.css +2 -0
  75. package/dist/assets/components/CountdownBorder/CountdownBorder.css +2 -0
  76. package/dist/assets/components/DataGrid/DataGrid.css +2 -0
  77. package/dist/assets/components/DeleteConfirmModal/DeleteConfirmModal.css +2 -0
  78. package/dist/assets/components/DigitPopIn/DigitPopIn.css +2 -0
  79. package/dist/assets/components/DividedRow/DividedRow.css +2 -0
  80. package/dist/assets/components/DoubleBadge/DoubleBadge.css +2 -0
  81. package/dist/assets/components/DoubleToken/DoubleToken.css +2 -0
  82. package/dist/assets/components/ErrorState/ErrorState.css +2 -1
  83. package/dist/assets/components/Form/FormItemVisual.css +2 -0
  84. package/dist/assets/components/IconWithTooltip/IconWithTooltip.css +2 -0
  85. package/dist/assets/components/ImageWithFallback/ImageWithFallback.css +2 -0
  86. package/dist/assets/components/ListBanner/ListBanner.css +2 -0
  87. package/dist/assets/components/Modal/Modal.css +2 -0
  88. package/dist/assets/components/NotificationItem/NotificationItem.css +2 -0
  89. package/dist/assets/components/NotificationStack/NotificationStack.css +2 -0
  90. package/dist/assets/components/OverlayScrollbar/OverlayScrollbar.css +2 -0
  91. package/dist/assets/components/PageHeader/PageHeader.css +2 -1
  92. package/dist/assets/components/PageLayout/PageLayout.css +2 -1
  93. package/dist/assets/components/PagedSelector/PagedSelector.css +2 -0
  94. package/dist/assets/components/ProgressWithLabel/ProgressWithLabel.css +2 -0
  95. package/dist/assets/components/Skeleton/SkeletonCard.css +2 -1
  96. package/dist/assets/components/Skeleton/SkeletonChart.css +2 -1
  97. package/dist/assets/components/Skeleton/SkeletonRow.css +2 -1
  98. package/dist/assets/components/Skeleton/SkeletonShape.css +2 -0
  99. package/dist/assets/components/Skeleton/SkeletonText.css +2 -1
  100. package/dist/assets/components/SmoothHeight/SmoothHeight.css +2 -1
  101. package/dist/assets/components/StatCard/StatCard.css +2 -1
  102. package/dist/assets/components/Statistic/Statistic.css +2 -0
  103. package/dist/assets/components/StepNumberInput/NumberStepper.css +2 -0
  104. package/dist/assets/components/TextHighlighter/TextHighlighter.css +2 -0
  105. package/dist/assets/components/TokenList/TokenList.css +2 -0
  106. package/dist/assets/components/TokenRow/TokenRow.css +2 -0
  107. package/dist/assets/components/UnitGrid/UnitGrid.css +2 -0
  108. package/dist/astryx/AppShell.d.ts +1 -0
  109. package/dist/astryx/AppShell.js +1 -0
  110. package/dist/astryx/AspectRatio.d.ts +1 -0
  111. package/dist/astryx/AspectRatio.js +1 -0
  112. package/dist/astryx/Avatar.d.ts +1 -0
  113. package/dist/astryx/Avatar.js +1 -0
  114. package/dist/astryx/AvatarGroup.d.ts +1 -0
  115. package/dist/astryx/AvatarGroup.js +1 -0
  116. package/dist/astryx/Badge.d.ts +1 -0
  117. package/dist/astryx/Badge.js +1 -0
  118. package/dist/astryx/Banner.d.ts +1 -0
  119. package/dist/astryx/Banner.js +1 -0
  120. package/dist/astryx/BaseProps.d.ts +1 -0
  121. package/dist/astryx/BaseProps.js +1 -0
  122. package/dist/astryx/Blockquote.d.ts +1 -0
  123. package/dist/astryx/Blockquote.js +1 -0
  124. package/dist/astryx/BottomSheet.d.ts +1 -0
  125. package/dist/astryx/BottomSheet.js +1 -0
  126. package/dist/astryx/Breadcrumbs.d.ts +1 -0
  127. package/dist/astryx/Breadcrumbs.js +1 -0
  128. package/dist/astryx/Button.d.ts +1 -0
  129. package/dist/astryx/Button.js +1 -0
  130. package/dist/astryx/ButtonGroup.d.ts +1 -0
  131. package/dist/astryx/ButtonGroup.js +1 -0
  132. package/dist/astryx/Calendar/utils.d.ts +1 -0
  133. package/dist/astryx/Calendar/utils.js +1 -0
  134. package/dist/astryx/Calendar.d.ts +1 -0
  135. package/dist/astryx/Calendar.js +1 -0
  136. package/dist/astryx/Card.d.ts +1 -0
  137. package/dist/astryx/Card.js +1 -0
  138. package/dist/astryx/Carousel.d.ts +1 -0
  139. package/dist/astryx/Carousel.js +1 -0
  140. package/dist/astryx/Center.d.ts +1 -0
  141. package/dist/astryx/Center.js +1 -0
  142. package/dist/astryx/Chat.d.ts +1 -0
  143. package/dist/astryx/Chat.js +1 -0
  144. package/dist/astryx/CheckboxInput.d.ts +1 -0
  145. package/dist/astryx/CheckboxInput.js +1 -0
  146. package/dist/astryx/CheckboxList.d.ts +1 -0
  147. package/dist/astryx/CheckboxList.js +1 -0
  148. package/dist/astryx/Citation.d.ts +1 -0
  149. package/dist/astryx/Citation.js +1 -0
  150. package/dist/astryx/ClickableCard.d.ts +1 -0
  151. package/dist/astryx/ClickableCard.js +1 -0
  152. package/dist/astryx/Code.d.ts +1 -0
  153. package/dist/astryx/Code.js +1 -0
  154. package/dist/astryx/CodeBlock.d.ts +1 -0
  155. package/dist/astryx/CodeBlock.js +1 -0
  156. package/dist/astryx/Collapsible.d.ts +1 -0
  157. package/dist/astryx/Collapsible.js +1 -0
  158. package/dist/astryx/CommandPalette.d.ts +1 -0
  159. package/dist/astryx/CommandPalette.js +1 -0
  160. package/dist/astryx/ContextMenu.d.ts +1 -0
  161. package/dist/astryx/ContextMenu.js +1 -0
  162. package/dist/astryx/DateInput.d.ts +1 -0
  163. package/dist/astryx/DateInput.js +1 -0
  164. package/dist/astryx/DateRangeInput.d.ts +1 -0
  165. package/dist/astryx/DateRangeInput.js +1 -0
  166. package/dist/astryx/DateTimeInput.d.ts +1 -0
  167. package/dist/astryx/DateTimeInput.js +1 -0
  168. package/dist/astryx/Divider.d.ts +1 -0
  169. package/dist/astryx/Divider.js +1 -0
  170. package/dist/astryx/DropdownMenu.d.ts +1 -0
  171. package/dist/astryx/DropdownMenu.js +1 -0
  172. package/dist/astryx/EmptyState.d.ts +1 -0
  173. package/dist/astryx/EmptyState.js +1 -0
  174. package/dist/astryx/Field.d.ts +1 -0
  175. package/dist/astryx/Field.js +1 -0
  176. package/dist/astryx/FieldStatus.d.ts +1 -0
  177. package/dist/astryx/FieldStatus.js +1 -0
  178. package/dist/astryx/FileInput.d.ts +1 -0
  179. package/dist/astryx/FileInput.js +1 -0
  180. package/dist/astryx/FormLayout.d.ts +1 -0
  181. package/dist/astryx/FormLayout.js +1 -0
  182. package/dist/astryx/Grid.d.ts +1 -0
  183. package/dist/astryx/Grid.js +1 -0
  184. package/dist/astryx/HStack.d.ts +1 -0
  185. package/dist/astryx/HStack.js +1 -0
  186. package/dist/astryx/Heading.d.ts +1 -0
  187. package/dist/astryx/Heading.js +1 -0
  188. package/dist/astryx/HoverCard.d.ts +1 -0
  189. package/dist/astryx/HoverCard.js +1 -0
  190. package/dist/astryx/Icon.d.ts +1 -0
  191. package/dist/astryx/Icon.js +1 -0
  192. package/dist/astryx/IconButton.d.ts +1 -0
  193. package/dist/astryx/IconButton.js +1 -0
  194. package/dist/astryx/Indicator.d.ts +1 -0
  195. package/dist/astryx/Indicator.js +1 -0
  196. package/dist/astryx/InputGroup.d.ts +1 -0
  197. package/dist/astryx/InputGroup.js +1 -0
  198. package/dist/astryx/InteractiveRoleContext.d.ts +1 -0
  199. package/dist/astryx/InteractiveRoleContext.js +1 -0
  200. package/dist/astryx/Item.d.ts +1 -0
  201. package/dist/astryx/Item.js +1 -0
  202. package/dist/astryx/Kbd.d.ts +1 -0
  203. package/dist/astryx/Kbd.js +1 -0
  204. package/dist/astryx/Layer.d.ts +1 -0
  205. package/dist/astryx/Layer.js +1 -0
  206. package/dist/astryx/Layout.d.ts +1 -0
  207. package/dist/astryx/Layout.js +1 -0
  208. package/dist/astryx/Lightbox.d.ts +1 -0
  209. package/dist/astryx/Lightbox.js +1 -0
  210. package/dist/astryx/Link.d.ts +1 -0
  211. package/dist/astryx/Link.js +1 -0
  212. package/dist/astryx/List.d.ts +1 -0
  213. package/dist/astryx/List.js +1 -0
  214. package/dist/astryx/Markdown/utils.d.ts +1 -0
  215. package/dist/astryx/Markdown/utils.js +1 -0
  216. package/dist/astryx/Markdown.d.ts +1 -0
  217. package/dist/astryx/Markdown.js +1 -0
  218. package/dist/astryx/MetadataList.d.ts +1 -0
  219. package/dist/astryx/MetadataList.js +1 -0
  220. package/dist/astryx/MobileNav.d.ts +1 -0
  221. package/dist/astryx/MobileNav.js +1 -0
  222. package/dist/astryx/MoreMenu.d.ts +1 -0
  223. package/dist/astryx/MoreMenu.js +1 -0
  224. package/dist/astryx/MultiSelector.d.ts +1 -0
  225. package/dist/astryx/MultiSelector.js +1 -0
  226. package/dist/astryx/NavIcon.d.ts +1 -0
  227. package/dist/astryx/NavIcon.js +1 -0
  228. package/dist/astryx/NavMenu.d.ts +1 -0
  229. package/dist/astryx/NavMenu.js +1 -0
  230. package/dist/astryx/NumberInput.d.ts +1 -0
  231. package/dist/astryx/NumberInput.js +1 -0
  232. package/dist/astryx/Outline.d.ts +1 -0
  233. package/dist/astryx/Outline.js +1 -0
  234. package/dist/astryx/OverflowList.d.ts +1 -0
  235. package/dist/astryx/OverflowList.js +1 -0
  236. package/dist/astryx/Overlay.d.ts +1 -0
  237. package/dist/astryx/Overlay.js +1 -0
  238. package/dist/astryx/Pagination.d.ts +1 -0
  239. package/dist/astryx/Pagination.js +1 -0
  240. package/dist/astryx/Popover.d.ts +1 -0
  241. package/dist/astryx/Popover.js +1 -0
  242. package/dist/astryx/PowerSearch/utils.d.ts +1 -0
  243. package/dist/astryx/PowerSearch/utils.js +1 -0
  244. package/dist/astryx/PowerSearch.d.ts +1 -0
  245. package/dist/astryx/PowerSearch.js +1 -0
  246. package/dist/astryx/ProgressBar.d.ts +1 -0
  247. package/dist/astryx/ProgressBar.js +1 -0
  248. package/dist/astryx/RadioList.d.ts +1 -0
  249. package/dist/astryx/RadioList.js +1 -0
  250. package/dist/astryx/Resizable/utils.d.ts +1 -0
  251. package/dist/astryx/Resizable/utils.js +1 -0
  252. package/dist/astryx/Resizable.d.ts +1 -0
  253. package/dist/astryx/Resizable.js +1 -0
  254. package/dist/astryx/ScrollableArea.d.ts +1 -0
  255. package/dist/astryx/ScrollableArea.js +1 -0
  256. package/dist/astryx/Section.d.ts +1 -0
  257. package/dist/astryx/Section.js +1 -0
  258. package/dist/astryx/SegmentedControl.d.ts +1 -0
  259. package/dist/astryx/SegmentedControl.js +1 -0
  260. package/dist/astryx/SelectableCard.d.ts +1 -0
  261. package/dist/astryx/SelectableCard.js +1 -0
  262. package/dist/astryx/Selector/utils.d.ts +1 -0
  263. package/dist/astryx/Selector/utils.js +1 -0
  264. package/dist/astryx/Selector.d.ts +1 -0
  265. package/dist/astryx/Selector.js +1 -0
  266. package/dist/astryx/SideNav.d.ts +1 -0
  267. package/dist/astryx/SideNav.js +1 -0
  268. package/dist/astryx/SizeContext.d.ts +1 -0
  269. package/dist/astryx/SizeContext.js +1 -0
  270. package/dist/astryx/Skeleton.d.ts +1 -0
  271. package/dist/astryx/Skeleton.js +1 -0
  272. package/dist/astryx/Slider.d.ts +1 -0
  273. package/dist/astryx/Slider.js +1 -0
  274. package/dist/astryx/Spinner.d.ts +1 -0
  275. package/dist/astryx/Spinner.js +1 -0
  276. package/dist/astryx/Stack.d.ts +1 -0
  277. package/dist/astryx/Stack.js +1 -0
  278. package/dist/astryx/StatusDot.d.ts +1 -0
  279. package/dist/astryx/StatusDot.js +1 -0
  280. package/dist/astryx/Stepper.d.ts +1 -0
  281. package/dist/astryx/Stepper.js +1 -0
  282. package/dist/astryx/Switch.d.ts +1 -0
  283. package/dist/astryx/Switch.js +1 -0
  284. package/dist/astryx/TabList.d.ts +1 -0
  285. package/dist/astryx/TabList.js +1 -0
  286. package/dist/astryx/Table/utils.d.ts +1 -0
  287. package/dist/astryx/Table/utils.js +1 -0
  288. package/dist/astryx/Table.d.ts +1 -0
  289. package/dist/astryx/Table.js +1 -0
  290. package/dist/astryx/Text.d.ts +1 -0
  291. package/dist/astryx/Text.js +1 -0
  292. package/dist/astryx/TextArea.d.ts +1 -0
  293. package/dist/astryx/TextArea.js +1 -0
  294. package/dist/astryx/TextInput.d.ts +1 -0
  295. package/dist/astryx/TextInput.js +1 -0
  296. package/dist/astryx/Thumbnail.d.ts +1 -0
  297. package/dist/astryx/Thumbnail.js +1 -0
  298. package/dist/astryx/TimeInput.d.ts +1 -0
  299. package/dist/astryx/TimeInput.js +1 -0
  300. package/dist/astryx/Timestamp.d.ts +1 -0
  301. package/dist/astryx/Timestamp.js +1 -0
  302. package/dist/astryx/Toast.d.ts +1 -0
  303. package/dist/astryx/Toast.js +1 -0
  304. package/dist/astryx/ToggleButton.d.ts +1 -0
  305. package/dist/astryx/ToggleButton.js +1 -0
  306. package/dist/astryx/Token.d.ts +1 -0
  307. package/dist/astryx/Token.js +1 -0
  308. package/dist/astryx/Tokenizer.d.ts +1 -0
  309. package/dist/astryx/Tokenizer.js +1 -0
  310. package/dist/astryx/Toolbar.d.ts +1 -0
  311. package/dist/astryx/Toolbar.js +1 -0
  312. package/dist/astryx/Tooltip.d.ts +1 -0
  313. package/dist/astryx/Tooltip.js +1 -0
  314. package/dist/astryx/TopNav.d.ts +1 -0
  315. package/dist/astryx/TopNav.js +1 -0
  316. package/dist/astryx/TreeList.d.ts +1 -0
  317. package/dist/astryx/TreeList.js +1 -0
  318. package/dist/astryx/Typeahead/utils.d.ts +1 -0
  319. package/dist/astryx/Typeahead/utils.js +1 -0
  320. package/dist/astryx/Typeahead.d.ts +1 -0
  321. package/dist/astryx/Typeahead.js +1 -0
  322. package/dist/astryx/VStack.d.ts +1 -0
  323. package/dist/astryx/VStack.js +1 -0
  324. package/dist/astryx/VisuallyHidden.d.ts +1 -0
  325. package/dist/astryx/VisuallyHidden.js +1 -0
  326. package/dist/astryx/astryx.css +3 -0
  327. package/dist/astryx/hooks.d.ts +1 -0
  328. package/dist/astryx/hooks.js +1 -0
  329. package/dist/astryx/i18n.d.ts +1 -0
  330. package/dist/astryx/i18n.js +1 -0
  331. package/dist/astryx/lab/lab.css +3 -0
  332. package/dist/astryx/lab.d.ts +6 -0
  333. package/dist/astryx/lab.js +6 -0
  334. package/dist/astryx/naming.d.ts +1 -0
  335. package/dist/astryx/naming.js +1 -0
  336. package/dist/astryx/reset.css +3 -0
  337. package/dist/astryx/tailwind-theme.css +3 -0
  338. package/dist/astryx/theme/neutral/built.d.ts +1 -0
  339. package/dist/astryx/theme/neutral/built.js +1 -0
  340. package/dist/astryx/theme/neutral/theme.css +3 -0
  341. package/dist/astryx/theme/neutral.d.ts +1 -0
  342. package/dist/astryx/theme/neutral.js +1 -0
  343. package/dist/astryx/theme/syntax.d.ts +1 -0
  344. package/dist/astryx/theme/syntax.js +1 -0
  345. package/dist/astryx/theme/tokens.d.ts +1 -0
  346. package/dist/astryx/theme/tokens.js +1 -0
  347. package/dist/astryx/theme/tokens.stylex.d.ts +1 -0
  348. package/dist/astryx/theme/tokens.stylex.js +1 -0
  349. package/dist/astryx/theme.d.ts +1 -0
  350. package/dist/astryx/theme.js +1 -0
  351. package/dist/astryx/utils.d.ts +1 -0
  352. package/dist/astryx/utils.js +1 -0
  353. package/dist/components/AlertModal/AlertModal.d.ts +14 -0
  354. package/dist/components/AlertModal/AlertModal.js +56 -0
  355. package/dist/components/AlertModal/AlertModal.js.map +1 -0
  356. package/dist/components/AlertModal/index.d.ts +2 -0
  357. package/dist/components/AlertModal/index.js +2 -0
  358. package/dist/components/BoardItemTitle/BoardItemTitle.d.ts +15 -0
  359. package/dist/components/BoardItemTitle/BoardItemTitle2.js +42 -0
  360. package/dist/components/BoardItemTitle/BoardItemTitle2.js.map +1 -0
  361. package/dist/components/BoardItemTitle/index.d.ts +2 -0
  362. package/dist/components/BoardItemTitle/index.js +2 -0
  363. package/dist/components/BooleanToken/BooleanToken.d.ts +15 -0
  364. package/dist/components/BooleanToken/BooleanToken.js +19 -0
  365. package/dist/components/BooleanToken/BooleanToken.js.map +1 -0
  366. package/dist/components/BooleanToken/BooleanToken.messages.d.ts +10 -0
  367. package/dist/components/BooleanToken/BooleanToken.messages.js +16 -0
  368. package/dist/components/BooleanToken/BooleanToken.messages.js.map +1 -0
  369. package/dist/components/BooleanToken/index.d.ts +2 -0
  370. package/dist/components/BooleanToken/index.js +2 -0
  371. package/dist/components/BulkEditFormItem/BulkEditFormItem.d.ts +24 -0
  372. package/dist/components/BulkEditFormItem/BulkEditFormItem.js +93 -0
  373. package/dist/components/BulkEditFormItem/BulkEditFormItem.js.map +1 -0
  374. package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.d.ts +14 -0
  375. package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.js +20 -0
  376. package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.js.map +1 -0
  377. package/dist/components/BulkEditFormItem/index.d.ts +2 -0
  378. package/dist/components/BulkEditFormItem/index.js +2 -0
  379. package/dist/components/BulkErrorModal/BulkErrorModal.d.ts +23 -0
  380. package/dist/components/BulkErrorModal/BulkErrorModal.messages.d.ts +10 -0
  381. package/dist/components/BulkErrorModal/BulkErrorModal.messages.js +16 -0
  382. package/dist/components/BulkErrorModal/BulkErrorModal.messages.js.map +1 -0
  383. package/dist/components/BulkErrorModal/BulkErrorModal2.js +55 -0
  384. package/dist/components/BulkErrorModal/BulkErrorModal2.js.map +1 -0
  385. package/dist/components/BulkErrorModal/index.d.ts +2 -0
  386. package/dist/components/BulkErrorModal/index.js +2 -0
  387. package/dist/components/ColorPicker/ColorPicker.d.ts +43 -0
  388. package/dist/components/ColorPicker/ColorPicker.messages.d.ts +18 -0
  389. package/dist/components/ColorPicker/ColorPicker.messages.js +24 -0
  390. package/dist/components/ColorPicker/ColorPicker.messages.js.map +1 -0
  391. package/dist/components/ColorPicker/ColorPicker2.js +117 -0
  392. package/dist/components/ColorPicker/ColorPicker2.js.map +1 -0
  393. package/dist/components/ColorPicker/index.d.ts +2 -0
  394. package/dist/components/ColorPicker/index.js +2 -0
  395. package/dist/components/ConfirmPopover/ConfirmPopover.d.ts +35 -0
  396. package/dist/components/ConfirmPopover/ConfirmPopover.js +75 -0
  397. package/dist/components/ConfirmPopover/ConfirmPopover.js.map +1 -0
  398. package/dist/components/ConfirmPopover/index.d.ts +2 -0
  399. package/dist/components/ConfirmPopover/index.js +2 -0
  400. package/dist/components/CountBadge/CountBadge.d.ts +24 -0
  401. package/dist/components/CountBadge/CountBadge2.js +35 -0
  402. package/dist/components/CountBadge/CountBadge2.js.map +1 -0
  403. package/dist/components/CountBadge/index.d.ts +2 -0
  404. package/dist/components/CountBadge/index.js +2 -0
  405. package/dist/components/CountdownBorder/CountdownBorder.d.ts +22 -0
  406. package/dist/components/CountdownBorder/CountdownBorder2.js +63 -0
  407. package/dist/components/CountdownBorder/CountdownBorder2.js.map +1 -0
  408. package/dist/components/CountdownBorder/index.d.ts +2 -0
  409. package/dist/components/CountdownBorder/index.js +2 -0
  410. package/dist/components/DataGrid/DataGrid.d.ts +212 -0
  411. package/dist/components/DataGrid/DataGrid.messages.d.ts +70 -0
  412. package/dist/components/DataGrid/DataGrid.messages.js +76 -0
  413. package/dist/components/DataGrid/DataGrid.messages.js.map +1 -0
  414. package/dist/components/DataGrid/DataGrid2.js +447 -0
  415. package/dist/components/DataGrid/DataGrid2.js.map +1 -0
  416. package/dist/components/DataGrid/DataGridExportModal.d.ts +30 -0
  417. package/dist/components/DataGrid/DataGridExportModal.js +125 -0
  418. package/dist/components/DataGrid/DataGridExportModal.js.map +1 -0
  419. package/dist/components/DataGrid/DataGridSettingsModal.d.ts +36 -0
  420. package/dist/components/DataGrid/DataGridSettingsModal.js +177 -0
  421. package/dist/components/DataGrid/DataGridSettingsModal.js.map +1 -0
  422. package/dist/components/DataGrid/index.d.ts +6 -0
  423. package/dist/components/DataGrid/index.js +4 -0
  424. package/dist/components/DataGrid/nodeToPlainText.d.ts +6 -0
  425. package/dist/components/DataGrid/nodeToPlainText.js +9 -0
  426. package/dist/components/DataGrid/nodeToPlainText.js.map +1 -0
  427. package/dist/components/DeleteConfirmModal/DeleteConfirmModal.d.ts +78 -0
  428. package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.d.ts +30 -0
  429. package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.js +36 -0
  430. package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.js.map +1 -0
  431. package/dist/components/DeleteConfirmModal/DeleteConfirmModal2.js +102 -0
  432. package/dist/components/DeleteConfirmModal/DeleteConfirmModal2.js.map +1 -0
  433. package/dist/components/DeleteConfirmModal/index.d.ts +2 -0
  434. package/dist/components/DeleteConfirmModal/index.js +2 -0
  435. package/dist/components/DigitPopIn/DigitPopIn.d.ts +8 -0
  436. package/dist/components/DigitPopIn/DigitPopIn2.js +30 -0
  437. package/dist/components/DigitPopIn/DigitPopIn2.js.map +1 -0
  438. package/dist/components/DigitPopIn/index.d.ts +2 -0
  439. package/dist/components/DigitPopIn/index.js +2 -0
  440. package/dist/components/DividedRow/DividedRow.d.ts +27 -0
  441. package/dist/components/DividedRow/DividedRow2.js +63 -0
  442. package/dist/components/DividedRow/DividedRow2.js.map +1 -0
  443. package/dist/components/DividedRow/index.d.ts +2 -0
  444. package/dist/components/DividedRow/index.js +2 -0
  445. package/dist/components/DoubleBadge/DoubleBadge.d.ts +14 -0
  446. package/dist/components/DoubleBadge/DoubleBadge2.js +28 -0
  447. package/dist/components/DoubleBadge/DoubleBadge2.js.map +1 -0
  448. package/dist/components/DoubleBadge/index.d.ts +2 -0
  449. package/dist/components/DoubleBadge/index.js +2 -0
  450. package/dist/components/DoubleToken/DoubleToken.d.ts +24 -0
  451. package/dist/components/DoubleToken/DoubleToken2.js +38 -0
  452. package/dist/components/DoubleToken/DoubleToken2.js.map +1 -0
  453. package/dist/components/DoubleToken/index.d.ts +2 -0
  454. package/dist/components/DoubleToken/index.js +2 -0
  455. package/dist/components/ErrorState/ErrorState.d.ts +7 -16
  456. package/dist/components/ErrorState/ErrorState2.js +33 -33
  457. package/dist/components/ErrorState/ErrorState2.js.map +1 -1
  458. package/dist/components/Form/ErrorList.d.ts +13 -0
  459. package/dist/components/Form/ErrorList.js +21 -0
  460. package/dist/components/Form/ErrorList.js.map +1 -0
  461. package/dist/components/Form/Field.d.ts +88 -0
  462. package/dist/components/Form/Field.js +212 -0
  463. package/dist/components/Form/Field.js.map +1 -0
  464. package/dist/components/Form/Form.d.ts +70 -0
  465. package/dist/components/Form/Form.js +130 -0
  466. package/dist/components/Form/Form.js.map +1 -0
  467. package/dist/components/Form/Form.messages.d.ts +96 -0
  468. package/dist/components/Form/Form.messages.js +96 -0
  469. package/dist/components/Form/Form.messages.js.map +1 -0
  470. package/dist/components/Form/FormConfigProvider.d.ts +20 -0
  471. package/dist/components/Form/FormConfigProvider.js +31 -0
  472. package/dist/components/Form/FormConfigProvider.js.map +1 -0
  473. package/dist/components/Form/FormItem.d.ts +56 -0
  474. package/dist/components/Form/FormItem.js +164 -0
  475. package/dist/components/Form/FormItem.js.map +1 -0
  476. package/dist/components/Form/FormItemVisual.d.ts +56 -0
  477. package/dist/components/Form/FormItemVisual2.js +117 -0
  478. package/dist/components/Form/FormItemVisual2.js.map +1 -0
  479. package/dist/components/Form/FormStore.d.ts +109 -0
  480. package/dist/components/Form/FormStore.js +494 -0
  481. package/dist/components/Form/FormStore.js.map +1 -0
  482. package/dist/components/Form/List.d.ts +22 -0
  483. package/dist/components/Form/List.js +65 -0
  484. package/dist/components/Form/List.js.map +1 -0
  485. package/dist/components/Form/context.d.ts +91 -0
  486. package/dist/components/Form/context.js +34 -0
  487. package/dist/components/Form/context.js.map +1 -0
  488. package/dist/components/Form/feedbackIcons.d.ts +13 -0
  489. package/dist/components/Form/feedbackIcons.js +45 -0
  490. package/dist/components/Form/feedbackIcons.js.map +1 -0
  491. package/dist/components/Form/index.d.ts +30 -0
  492. package/dist/components/Form/index.js +18 -0
  493. package/dist/components/Form/index.js.map +1 -0
  494. package/dist/components/Form/interface.d.ts +212 -0
  495. package/dist/components/Form/isEqual.d.ts +1 -0
  496. package/dist/components/Form/isEqual.js +61 -0
  497. package/dist/components/Form/isEqual.js.map +1 -0
  498. package/dist/components/Form/messages.d.ts +15 -0
  499. package/dist/components/Form/messages.js +52 -0
  500. package/dist/components/Form/messages.js.map +1 -0
  501. package/dist/components/Form/namePath.d.ts +78 -0
  502. package/dist/components/Form/namePath.js +120 -0
  503. package/dist/components/Form/namePath.js.map +1 -0
  504. package/dist/components/Form/useWatch.d.ts +11 -0
  505. package/dist/components/Form/useWatch.js +43 -0
  506. package/dist/components/Form/useWatch.js.map +1 -0
  507. package/dist/components/Form/validate.d.ts +16 -0
  508. package/dist/components/Form/validate.js +214 -0
  509. package/dist/components/Form/validate.js.map +1 -0
  510. package/dist/components/IconWithTooltip/IconWithTooltip.d.ts +19 -0
  511. package/dist/components/IconWithTooltip/IconWithTooltip2.js +38 -0
  512. package/dist/components/IconWithTooltip/IconWithTooltip2.js.map +1 -0
  513. package/dist/components/IconWithTooltip/accessibleLabel.d.ts +2 -0
  514. package/dist/components/IconWithTooltip/accessibleLabel.js +33 -0
  515. package/dist/components/IconWithTooltip/accessibleLabel.js.map +1 -0
  516. package/dist/components/IconWithTooltip/index.d.ts +2 -0
  517. package/dist/components/IconWithTooltip/index.js +2 -0
  518. package/dist/components/ImageWithFallback/ImageWithFallback.d.ts +11 -0
  519. package/dist/components/ImageWithFallback/ImageWithFallback2.js +28 -0
  520. package/dist/components/ImageWithFallback/ImageWithFallback2.js.map +1 -0
  521. package/dist/components/ImageWithFallback/index.d.ts +2 -0
  522. package/dist/components/ImageWithFallback/index.js +2 -0
  523. package/dist/components/ListBanner/ListBanner.d.ts +17 -0
  524. package/dist/components/ListBanner/ListBanner2.js +27 -0
  525. package/dist/components/ListBanner/ListBanner2.js.map +1 -0
  526. package/dist/components/ListBanner/index.d.ts +2 -0
  527. package/dist/components/ListBanner/index.js +2 -0
  528. package/dist/components/Modal/Modal.d.ts +65 -0
  529. package/dist/components/Modal/Modal2.js +226 -0
  530. package/dist/components/Modal/Modal2.js.map +1 -0
  531. package/dist/components/Modal/index.d.ts +15 -0
  532. package/dist/components/Modal/index.js +4 -0
  533. package/dist/components/Modal/modalStack.d.ts +64 -0
  534. package/dist/components/Modal/modalStack.js +81 -0
  535. package/dist/components/Modal/modalStack.js.map +1 -0
  536. package/dist/components/NotificationItem/NotificationItem.d.ts +14 -0
  537. package/dist/components/NotificationItem/NotificationItem2.js +40 -0
  538. package/dist/components/NotificationItem/NotificationItem2.js.map +1 -0
  539. package/dist/components/NotificationItem/index.d.ts +2 -0
  540. package/dist/components/NotificationItem/index.js +2 -0
  541. package/dist/components/NotificationStack/NotificationStack.d.ts +56 -0
  542. package/dist/components/NotificationStack/NotificationStack.messages.d.ts +6 -0
  543. package/dist/components/NotificationStack/NotificationStack.messages.js +10 -0
  544. package/dist/components/NotificationStack/NotificationStack.messages.js.map +1 -0
  545. package/dist/components/NotificationStack/NotificationStack2.js +154 -0
  546. package/dist/components/NotificationStack/NotificationStack2.js.map +1 -0
  547. package/dist/components/NotificationStack/index.d.ts +2 -0
  548. package/dist/components/NotificationStack/index.js +2 -0
  549. package/dist/components/OverlayScrollbar/OverlayScrollbar.d.ts +13 -0
  550. package/dist/components/OverlayScrollbar/OverlayScrollbar2.js +69 -0
  551. package/dist/components/OverlayScrollbar/OverlayScrollbar2.js.map +1 -0
  552. package/dist/components/OverlayScrollbar/index.d.ts +2 -0
  553. package/dist/components/OverlayScrollbar/index.js +2 -0
  554. package/dist/components/PageHeader/PageHeader.d.ts +24 -8
  555. package/dist/components/PageHeader/PageHeader.messages.d.ts +6 -0
  556. package/dist/components/PageHeader/PageHeader.messages.js +10 -0
  557. package/dist/components/PageHeader/PageHeader.messages.js.map +1 -0
  558. package/dist/components/PageHeader/PageHeader2.js +57 -30
  559. package/dist/components/PageHeader/PageHeader2.js.map +1 -1
  560. package/dist/components/PageLayout/PageLayout2.js +2 -2
  561. package/dist/components/PageLayout/PageLayout2.js.map +1 -1
  562. package/dist/components/PagedSelector/PagedSelector.d.ts +107 -0
  563. package/dist/components/PagedSelector/PagedSelector.messages.d.ts +30 -0
  564. package/dist/components/PagedSelector/PagedSelector.messages.js +36 -0
  565. package/dist/components/PagedSelector/PagedSelector.messages.js.map +1 -0
  566. package/dist/components/PagedSelector/PagedSelector2.js +220 -0
  567. package/dist/components/PagedSelector/PagedSelector2.js.map +1 -0
  568. package/dist/components/PagedSelector/PanelSearchInput.d.ts +22 -0
  569. package/dist/components/PagedSelector/PanelSearchInput.js +95 -0
  570. package/dist/components/PagedSelector/PanelSearchInput.js.map +1 -0
  571. package/dist/components/PagedSelector/index.d.ts +2 -0
  572. package/dist/components/PagedSelector/index.js +2 -0
  573. package/dist/components/ProgressWithLabel/ProgressWithLabel.d.ts +26 -0
  574. package/dist/components/ProgressWithLabel/ProgressWithLabel2.js +44 -0
  575. package/dist/components/ProgressWithLabel/ProgressWithLabel2.js.map +1 -0
  576. package/dist/components/ProgressWithLabel/index.d.ts +2 -0
  577. package/dist/components/ProgressWithLabel/index.js +2 -0
  578. package/dist/components/SelectionLabel/SelectionLabel.d.ts +23 -0
  579. package/dist/components/SelectionLabel/SelectionLabel.js +29 -0
  580. package/dist/components/SelectionLabel/SelectionLabel.js.map +1 -0
  581. package/dist/components/SelectionLabel/SelectionLabel.messages.d.ts +10 -0
  582. package/dist/components/SelectionLabel/SelectionLabel.messages.js +16 -0
  583. package/dist/components/SelectionLabel/SelectionLabel.messages.js.map +1 -0
  584. package/dist/components/SelectionLabel/index.d.ts +2 -0
  585. package/dist/components/SelectionLabel/index.js +2 -0
  586. package/dist/components/Skeleton/Skeleton.messages.d.ts +18 -0
  587. package/dist/components/Skeleton/Skeleton.messages.js +24 -0
  588. package/dist/components/Skeleton/Skeleton.messages.js.map +1 -0
  589. package/dist/components/Skeleton/SkeletonCard.d.ts +4 -9
  590. package/dist/components/Skeleton/SkeletonCard2.js +53 -53
  591. package/dist/components/Skeleton/SkeletonCard2.js.map +1 -1
  592. package/dist/components/Skeleton/SkeletonChart.d.ts +5 -11
  593. package/dist/components/Skeleton/SkeletonChart2.js +51 -45
  594. package/dist/components/Skeleton/SkeletonChart2.js.map +1 -1
  595. package/dist/components/Skeleton/SkeletonRow.d.ts +5 -10
  596. package/dist/components/Skeleton/SkeletonRow2.js +35 -34
  597. package/dist/components/Skeleton/SkeletonRow2.js.map +1 -1
  598. package/dist/components/Skeleton/SkeletonShape.d.ts +10 -0
  599. package/dist/components/Skeleton/SkeletonShape2.js +23 -0
  600. package/dist/components/Skeleton/SkeletonShape2.js.map +1 -0
  601. package/dist/components/Skeleton/SkeletonText.d.ts +4 -9
  602. package/dist/components/Skeleton/SkeletonText2.js +22 -17
  603. package/dist/components/Skeleton/SkeletonText2.js.map +1 -1
  604. package/dist/components/Skeleton/index.d.ts +3 -5
  605. package/dist/components/Skeleton/index.js +4 -5
  606. package/dist/components/SmoothHeight/SmoothHeight2.js +2 -2
  607. package/dist/components/SmoothHeight/SmoothHeight2.js.map +1 -1
  608. package/dist/components/StatCard/StatCard.d.ts +28 -16
  609. package/dist/components/StatCard/StatCard2.js +96 -89
  610. package/dist/components/StatCard/StatCard2.js.map +1 -1
  611. package/dist/components/StatCard/index.d.ts +1 -1
  612. package/dist/components/Statistic/Statistic.d.ts +30 -0
  613. package/dist/components/Statistic/Statistic.messages.d.ts +6 -0
  614. package/dist/components/Statistic/Statistic.messages.js +10 -0
  615. package/dist/components/Statistic/Statistic.messages.js.map +1 -0
  616. package/dist/components/Statistic/Statistic2.js +75 -0
  617. package/dist/components/Statistic/Statistic2.js.map +1 -0
  618. package/dist/components/Statistic/index.d.ts +2 -0
  619. package/dist/components/Statistic/index.js +2 -0
  620. package/dist/components/StepNumberInput/NumberStepper.d.ts +29 -0
  621. package/dist/components/StepNumberInput/NumberStepper.messages.d.ts +10 -0
  622. package/dist/components/StepNumberInput/NumberStepper.messages.js +16 -0
  623. package/dist/components/StepNumberInput/NumberStepper.messages.js.map +1 -0
  624. package/dist/components/StepNumberInput/NumberStepper2.js +50 -0
  625. package/dist/components/StepNumberInput/NumberStepper2.js.map +1 -0
  626. package/dist/components/StepNumberInput/StepNumberInput.d.ts +33 -0
  627. package/dist/components/StepNumberInput/StepNumberInput.js +48 -0
  628. package/dist/components/StepNumberInput/StepNumberInput.js.map +1 -0
  629. package/dist/components/StepNumberInput/index.d.ts +4 -0
  630. package/dist/components/StepNumberInput/index.js +3 -0
  631. package/dist/components/TextHighlighter/TextHighlighter.d.ts +14 -0
  632. package/dist/components/TextHighlighter/TextHighlighter2.js +29 -0
  633. package/dist/components/TextHighlighter/TextHighlighter2.js.map +1 -0
  634. package/dist/components/TextHighlighter/index.d.ts +2 -0
  635. package/dist/components/TextHighlighter/index.js +2 -0
  636. package/dist/components/TokenList/TokenList.d.ts +18 -0
  637. package/dist/components/TokenList/TokenList2.js +55 -0
  638. package/dist/components/TokenList/TokenList2.js.map +1 -0
  639. package/dist/components/TokenList/index.d.ts +2 -0
  640. package/dist/components/TokenList/index.js +2 -0
  641. package/dist/components/TokenRow/TokenRow.d.ts +27 -0
  642. package/dist/components/TokenRow/TokenRow.messages.d.ts +6 -0
  643. package/dist/components/TokenRow/TokenRow.messages.js +10 -0
  644. package/dist/components/TokenRow/TokenRow.messages.js.map +1 -0
  645. package/dist/components/TokenRow/TokenRow2.js +29 -0
  646. package/dist/components/TokenRow/TokenRow2.js.map +1 -0
  647. package/dist/components/TokenRow/index.d.ts +2 -0
  648. package/dist/components/TokenRow/index.js +2 -0
  649. package/dist/components/UncontrolledInput/UncontrolledInput.d.ts +29 -0
  650. package/dist/components/UncontrolledInput/UncontrolledInput.js +49 -0
  651. package/dist/components/UncontrolledInput/UncontrolledInput.js.map +1 -0
  652. package/dist/components/UncontrolledInput/UncontrolledInput.messages.d.ts +6 -0
  653. package/dist/components/UncontrolledInput/UncontrolledInput.messages.js +10 -0
  654. package/dist/components/UncontrolledInput/UncontrolledInput.messages.js.map +1 -0
  655. package/dist/components/UncontrolledInput/index.d.ts +2 -0
  656. package/dist/components/UncontrolledInput/index.js +2 -0
  657. package/dist/components/UnitGrid/UnitGrid.d.ts +56 -0
  658. package/dist/components/UnitGrid/UnitGrid.geometry.d.ts +102 -0
  659. package/dist/components/UnitGrid/UnitGrid.geometry.js +172 -0
  660. package/dist/components/UnitGrid/UnitGrid.geometry.js.map +1 -0
  661. package/dist/components/UnitGrid/UnitGrid.messages.d.ts +14 -0
  662. package/dist/components/UnitGrid/UnitGrid.messages.js +20 -0
  663. package/dist/components/UnitGrid/UnitGrid.messages.js.map +1 -0
  664. package/dist/components/UnitGrid/UnitGrid2.js +393 -0
  665. package/dist/components/UnitGrid/UnitGrid2.js.map +1 -0
  666. package/dist/components/UnitGrid/UnitGridSkeleton.d.ts +9 -0
  667. package/dist/components/UnitGrid/UnitGridSkeleton.js +73 -0
  668. package/dist/components/UnitGrid/UnitGridSkeleton.js.map +1 -0
  669. package/dist/components/UnitGrid/index.d.ts +4 -0
  670. package/dist/components/UnitGrid/index.js +3 -0
  671. package/dist/forks/ComplexSelector/ComplexSelector.d.ts +144 -0
  672. package/dist/forks/ComplexSelector/ComplexSelector.js +157 -0
  673. package/dist/forks/ComplexSelector/ComplexSelector.js.map +1 -0
  674. package/dist/forks/ComplexSelector/ComplexSelector.styles.d.ts +125 -0
  675. package/dist/forks/ComplexSelector/ComplexSelector.styles.js +129 -0
  676. package/dist/forks/ComplexSelector/ComplexSelector.styles.js.map +1 -0
  677. package/dist/forks/ComplexSelector/index.d.ts +7 -0
  678. package/dist/forks/ComplexSelector/index.js +2 -0
  679. package/dist/forks/Drawer/Drawer.d.ts +98 -0
  680. package/dist/forks/Drawer/Drawer.js +94 -0
  681. package/dist/forks/Drawer/Drawer.js.map +1 -0
  682. package/dist/forks/Drawer/Drawer.styles.d.ts +99 -0
  683. package/dist/forks/Drawer/Drawer.styles.js +94 -0
  684. package/dist/forks/Drawer/Drawer.styles.js.map +1 -0
  685. package/dist/forks/Drawer/index.d.ts +6 -0
  686. package/dist/forks/Drawer/index.js +2 -0
  687. package/dist/forks/Drawer/useDrawerDialogPresence.d.ts +19 -0
  688. package/dist/forks/Drawer/useDrawerDialogPresence.js +62 -0
  689. package/dist/forks/Drawer/useDrawerDialogPresence.js.map +1 -0
  690. package/dist/forks/Tour/Tour.d.ts +58 -0
  691. package/dist/forks/Tour/Tour.js +55 -0
  692. package/dist/forks/Tour/Tour.js.map +1 -0
  693. package/dist/forks/Tour/TourContext.d.ts +37 -0
  694. package/dist/forks/Tour/TourContext.js +8 -0
  695. package/dist/forks/Tour/TourContext.js.map +1 -0
  696. package/dist/forks/Tour/TourStep.d.ts +43 -0
  697. package/dist/forks/Tour/TourStep.js +134 -0
  698. package/dist/forks/Tour/TourStep.js.map +1 -0
  699. package/dist/forks/Tour/TourStep.styles.d.ts +23 -0
  700. package/dist/forks/Tour/TourStep.styles.js +28 -0
  701. package/dist/forks/Tour/TourStep.styles.js.map +1 -0
  702. package/dist/forks/Tour/index.d.ts +11 -0
  703. package/dist/forks/Tour/index.js +4 -0
  704. package/dist/forks/Tour/useTour.d.ts +26 -0
  705. package/dist/forks/Tour/useTour.js +20 -0
  706. package/dist/forks/Tour/useTour.js.map +1 -0
  707. package/dist/forks/compiled.d.ts +5 -0
  708. package/dist/forks/compiled.js +8 -0
  709. package/dist/forks/compiled.js.map +1 -0
  710. package/dist/i18n/catalog.d.ts +12 -0
  711. package/dist/i18n/catalog.js +46 -0
  712. package/dist/i18n/catalog.js.map +1 -0
  713. package/dist/i18n/common.messages.d.ts +31 -0
  714. package/dist/i18n/common.messages.js +32 -0
  715. package/dist/i18n/common.messages.js.map +1 -0
  716. package/dist/i18n/index.d.ts +21 -0
  717. package/dist/i18n/index.js +3 -0
  718. package/dist/i18n/locales/de-DE.js +331 -0
  719. package/dist/i18n/locales/de-DE.js.map +1 -0
  720. package/dist/i18n/locales/el-GR.js +331 -0
  721. package/dist/i18n/locales/el-GR.js.map +1 -0
  722. package/dist/i18n/locales/es-ES.js +331 -0
  723. package/dist/i18n/locales/es-ES.js.map +1 -0
  724. package/dist/i18n/locales/fi-FI.js +331 -0
  725. package/dist/i18n/locales/fi-FI.js.map +1 -0
  726. package/dist/i18n/locales/fr-FR.js +331 -0
  727. package/dist/i18n/locales/fr-FR.js.map +1 -0
  728. package/dist/i18n/locales/id-ID.js +331 -0
  729. package/dist/i18n/locales/id-ID.js.map +1 -0
  730. package/dist/i18n/locales/it-IT.js +331 -0
  731. package/dist/i18n/locales/it-IT.js.map +1 -0
  732. package/dist/i18n/locales/ja-JP.js +351 -0
  733. package/dist/i18n/locales/ja-JP.js.map +1 -0
  734. package/dist/i18n/locales/ko-KR.js +351 -0
  735. package/dist/i18n/locales/ko-KR.js.map +1 -0
  736. package/dist/i18n/locales/mn-MN.js +327 -0
  737. package/dist/i18n/locales/mn-MN.js.map +1 -0
  738. package/dist/i18n/locales/ms-MY.js +331 -0
  739. package/dist/i18n/locales/ms-MY.js.map +1 -0
  740. package/dist/i18n/locales/pl-PL.js +331 -0
  741. package/dist/i18n/locales/pl-PL.js.map +1 -0
  742. package/dist/i18n/locales/pt-BR.js +331 -0
  743. package/dist/i18n/locales/pt-BR.js.map +1 -0
  744. package/dist/i18n/locales/pt-PT.js +331 -0
  745. package/dist/i18n/locales/pt-PT.js.map +1 -0
  746. package/dist/i18n/locales/ru-RU.js +331 -0
  747. package/dist/i18n/locales/ru-RU.js.map +1 -0
  748. package/dist/i18n/locales/th-TH.js +331 -0
  749. package/dist/i18n/locales/th-TH.js.map +1 -0
  750. package/dist/i18n/locales/tr-TR.js +331 -0
  751. package/dist/i18n/locales/tr-TR.js.map +1 -0
  752. package/dist/i18n/locales/vi-VN.js +331 -0
  753. package/dist/i18n/locales/vi-VN.js.map +1 -0
  754. package/dist/i18n/locales/zh-CN.js +331 -0
  755. package/dist/i18n/locales/zh-CN.js.map +1 -0
  756. package/dist/i18n/locales/zh-TW.js +331 -0
  757. package/dist/i18n/locales/zh-TW.js.map +1 -0
  758. package/dist/i18n/messages.d.ts +13 -0
  759. package/dist/i18n/messages.js +63 -0
  760. package/dist/i18n/messages.js.map +1 -0
  761. package/dist/i18n/translateWithNodes.d.ts +3 -0
  762. package/dist/i18n/translateWithNodes.js +14 -0
  763. package/dist/i18n/translateWithNodes.js.map +1 -0
  764. package/dist/i18n/useUicTranslator.d.ts +5 -0
  765. package/dist/i18n/useUicTranslator.js +38 -0
  766. package/dist/i18n/useUicTranslator.js.map +1 -0
  767. package/dist/index.d.ts +101 -27
  768. package/dist/index.js +63 -23
  769. package/dist/instance.d.ts +31 -0
  770. package/dist/instance.js +33 -0
  771. package/dist/instance.js.map +1 -0
  772. package/dist/legacy-tokens.css +177 -0
  773. package/dist/locales/af-ZA.json +954 -0
  774. package/dist/locales/ar-SA.json +994 -0
  775. package/dist/locales/ca-ES.json +970 -0
  776. package/dist/locales/cs-CZ.json +986 -0
  777. package/dist/locales/da-DK.json +962 -0
  778. package/dist/locales/de-DE.json +962 -0
  779. package/dist/locales/el-GR.json +986 -0
  780. package/dist/locales/en.json +1482 -0
  781. package/dist/locales/es-ES.json +974 -0
  782. package/dist/locales/fi-FI.json +986 -0
  783. package/dist/locales/fr-FR.json +950 -0
  784. package/dist/locales/he-IL.json +986 -0
  785. package/dist/locales/hu-HU.json +986 -0
  786. package/dist/locales/it-IT.json +974 -0
  787. package/dist/locales/ja-JP.json +994 -0
  788. package/dist/locales/ko-KR.json +986 -0
  789. package/dist/locales/nl-NL.json +950 -0
  790. package/dist/locales/no-NO.json +974 -0
  791. package/dist/locales/pl-PL.json +978 -0
  792. package/dist/locales/pseudo.json +1112 -0
  793. package/dist/locales/pt-BR.json +978 -0
  794. package/dist/locales/pt-PT.json +978 -0
  795. package/dist/locales/ro-RO.json +978 -0
  796. package/dist/locales/ru-RU.json +986 -0
  797. package/dist/locales/sr-SP.json +986 -0
  798. package/dist/locales/sv-SE.json +982 -0
  799. package/dist/locales/tr-TR.json +986 -0
  800. package/dist/locales/uk-UA.json +986 -0
  801. package/dist/locales/vi-VN.json +982 -0
  802. package/dist/locales/zh-CN.json +994 -0
  803. package/dist/locales/zh-TW.json +994 -0
  804. package/dist/styles/base.css +29 -2
  805. package/dist/styles/themes/orange-dark.css +4 -0
  806. package/dist/styles/themes/orange-light.css +4 -0
  807. package/dist/theme/lablup/built/lablup.d.ts +13 -0
  808. package/dist/theme/lablup/built/lablup.js +567 -0
  809. package/dist/theme/lablup/built/lablup.variants.d.ts +16 -0
  810. package/dist/theme/lablup/built/theme.css +716 -0
  811. package/dist/theme/lablup/index.d.ts +9 -0
  812. package/dist/theme/lablup/index.js +2 -0
  813. package/dist/theme/lablup/lablupTheme.d.ts +10 -0
  814. package/dist/theme/lablup/lablupTheme.js +21 -0
  815. package/dist/theme/lablup/lablupTheme.js.map +1 -0
  816. package/dist/ui-common-locales/de-DE.json +326 -0
  817. package/dist/ui-common-locales/el-GR.json +326 -0
  818. package/dist/ui-common-locales/en.json +346 -0
  819. package/dist/ui-common-locales/es-ES.json +326 -0
  820. package/dist/ui-common-locales/fi-FI.json +326 -0
  821. package/dist/ui-common-locales/fr-FR.json +326 -0
  822. package/dist/ui-common-locales/id-ID.json +326 -0
  823. package/dist/ui-common-locales/it-IT.json +326 -0
  824. package/dist/ui-common-locales/ja-JP.json +346 -0
  825. package/dist/ui-common-locales/ko-KR.json +346 -0
  826. package/dist/ui-common-locales/mn-MN.json +322 -0
  827. package/dist/ui-common-locales/ms-MY.json +326 -0
  828. package/dist/ui-common-locales/pl-PL.json +326 -0
  829. package/dist/ui-common-locales/pt-BR.json +326 -0
  830. package/dist/ui-common-locales/pt-PT.json +326 -0
  831. package/dist/ui-common-locales/ru-RU.json +326 -0
  832. package/dist/ui-common-locales/th-TH.json +326 -0
  833. package/dist/ui-common-locales/tr-TR.json +326 -0
  834. package/dist/ui-common-locales/vi-VN.json +326 -0
  835. package/dist/ui-common-locales/zh-CN.json +326 -0
  836. package/dist/ui-common-locales/zh-TW.json +326 -0
  837. package/dist/ui-common.css +51 -0
  838. package/exports.customs.json +62 -0
  839. package/exports.exclude.json +47 -0
  840. package/package.json +565 -21
  841. package/dist/assets/components/Badge/Badge.css +0 -1
  842. package/dist/assets/components/BaseCard/BaseCard.css +0 -1
  843. package/dist/assets/components/Button/Button.css +0 -1
  844. package/dist/assets/components/DataTable/DataTable.css +0 -1
  845. package/dist/assets/components/Drawer/Drawer.css +0 -1
  846. package/dist/assets/components/EmptyState/EmptyState.css +0 -1
  847. package/dist/assets/components/ProgressBar/ProgressBar.css +0 -1
  848. package/dist/assets/components/Skeleton/Skeleton.css +0 -1
  849. package/dist/assets/components/StatusTag/StatusTag.css +0 -1
  850. package/dist/assets/components/Tabs/Tabs.css +0 -1
  851. package/dist/assets/components/Tooltip/Tooltip.css +0 -1
  852. package/dist/components/Badge/Badge.d.ts +0 -7
  853. package/dist/components/Badge/Badge2.js +0 -20
  854. package/dist/components/Badge/Badge2.js.map +0 -1
  855. package/dist/components/Badge/index.d.ts +0 -2
  856. package/dist/components/Badge/index.js +0 -2
  857. package/dist/components/BaseCard/BaseCard.d.ts +0 -57
  858. package/dist/components/BaseCard/BaseCard2.js +0 -37
  859. package/dist/components/BaseCard/BaseCard2.js.map +0 -1
  860. package/dist/components/BaseCard/index.d.ts +0 -2
  861. package/dist/components/BaseCard/index.js +0 -2
  862. package/dist/components/Button/Button.d.ts +0 -54
  863. package/dist/components/Button/Button2.js +0 -75
  864. package/dist/components/Button/Button2.js.map +0 -1
  865. package/dist/components/Button/index.d.ts +0 -5
  866. package/dist/components/Button/index.js +0 -2
  867. package/dist/components/DataTable/DataTable.d.ts +0 -144
  868. package/dist/components/DataTable/DataTable2.js +0 -244
  869. package/dist/components/DataTable/DataTable2.js.map +0 -1
  870. package/dist/components/DataTable/index.d.ts +0 -2
  871. package/dist/components/DataTable/index.js +0 -2
  872. package/dist/components/Drawer/Drawer.d.ts +0 -25
  873. package/dist/components/Drawer/Drawer2.js +0 -107
  874. package/dist/components/Drawer/Drawer2.js.map +0 -1
  875. package/dist/components/Drawer/index.d.ts +0 -2
  876. package/dist/components/Drawer/index.js +0 -2
  877. package/dist/components/EmptyState/EmptyState.d.ts +0 -52
  878. package/dist/components/EmptyState/EmptyState.example.d.ts +0 -8
  879. package/dist/components/EmptyState/EmptyState2.js +0 -62
  880. package/dist/components/EmptyState/EmptyState2.js.map +0 -1
  881. package/dist/components/EmptyState/index.d.ts +0 -10
  882. package/dist/components/EmptyState/index.js +0 -2
  883. package/dist/components/ProgressBar/ProgressBar.d.ts +0 -22
  884. package/dist/components/ProgressBar/ProgressBar2.js +0 -37
  885. package/dist/components/ProgressBar/ProgressBar2.js.map +0 -1
  886. package/dist/components/ProgressBar/index.d.ts +0 -2
  887. package/dist/components/ProgressBar/index.js +0 -2
  888. package/dist/components/Skeleton/Skeleton.d.ts +0 -25
  889. package/dist/components/Skeleton/Skeleton2.js +0 -27
  890. package/dist/components/Skeleton/Skeleton2.js.map +0 -1
  891. package/dist/components/StatusTag/StatusTag.d.ts +0 -38
  892. package/dist/components/StatusTag/StatusTag2.js +0 -45
  893. package/dist/components/StatusTag/StatusTag2.js.map +0 -1
  894. package/dist/components/StatusTag/index.d.ts +0 -2
  895. package/dist/components/StatusTag/index.js +0 -2
  896. package/dist/components/Tabs/Tabs.d.ts +0 -94
  897. package/dist/components/Tabs/Tabs2.js +0 -412
  898. package/dist/components/Tabs/Tabs2.js.map +0 -1
  899. package/dist/components/Tabs/index.d.ts +0 -2
  900. package/dist/components/Tabs/index.js +0 -2
  901. package/dist/components/Tooltip/Tooltip.d.ts +0 -16
  902. package/dist/components/Tooltip/Tooltip2.js +0 -68
  903. package/dist/components/Tooltip/Tooltip2.js.map +0 -1
  904. package/dist/components/Tooltip/index.d.ts +0 -2
  905. package/dist/components/Tooltip/index.js +0 -2
  906. package/dist/hooks/index.js +0 -2
  907. package/dist/icons/AlertCircleIcon.d.ts +0 -11
  908. package/dist/icons/AlertCircleIcon.js +0 -26
  909. package/dist/icons/AlertCircleIcon.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal2.js","names":[],"sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["/**\n * Modal\n *\n * ui-common's dialog. It replaces Astryx `Dialog`, which ui-common does not\n * re-export (exports.exclude.json), and takes every `Dialog` prop, so a\n * `Dialog` call site moves over by renaming the import.\n *\n * What it changes about `Dialog`:\n *\n * - **Portalled, not top layer.** The surface renders into a `document.body`\n * portal instead of a native `<dialog>` promoted with `showModal()`. While\n * it is open the page behind it is inert and the topmost surface is\n * `aria-modal`, as `showModal()` would make them, but an element marked\n * `MODAL_LIVE_ATTRIBUTE` (`NotificationStack` is) stays reachable, so\n * notices stay visible and clickable over an open modal. Covered modal\n * roots are inert too; see modalStack.ts. Inside a modal `<dialog>` (a\n * scrimmed `Drawer`) it renders into that dialog and enters the top layer\n * as a manual popover instead, since the rest of the page is inert there.\n * - **Nesting.** A modal opened from inside another paints above it, and\n * only the topmost one traps focus and answers Escape.\n * - **Content lifecycle.** Children mount on first open and stay mounted\n * while closed, as a native `<dialog>`'s do. `unmountOnClose` drops them,\n * and their state, on close. `afterOpenChange` reports each open and close.\n * - **Structure, when asked for.** With `title`, `onAction` or `footer`, the\n * modal lays out a header (`ModalHeader`), the body, and a footer with a\n * primary action and a Cancel button. Without them it renders `children`\n * as they are, exactly like `Dialog`.\n *\n * @example\n * <Modal\n * isOpen={isOpen}\n * onOpenChange={setIsOpen}\n * title=\"Rename folder\"\n * actionLabel=\"Rename\"\n * onAction={async () => {\n * await rename();\n * setIsOpen(false);\n * }}\n * >\n * <TextInput label=\"Name\" value={name} onChange={setName} />\n * </Modal>\n */\nimport {\n useContext,\n useEffect,\n useEffectEvent,\n useId,\n useInsertionEffect,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n Button,\n type ButtonProps,\n type ButtonVariant,\n} from \"@astryxdesign/core/Button\";\nimport { Dialog, DialogHeader, type DialogProps } from \"@astryxdesign/core/Dialog\";\nimport type { DialogPosition } from \"@astryxdesign/core/Dialog\";\nimport { useFocusTrap, useScrollLock } from \"@astryxdesign/core/hooks\";\nimport { useLayerDismissal } from \"@astryxdesign/core/Layer\";\nimport { Layout, LayoutContent, LayoutFooter } from \"@astryxdesign/core/Layout\";\nimport { dataAttr } from \"@astryxdesign/core/naming\";\nimport { HStack } from \"@astryxdesign/core/Stack\";\nimport { useThemeName } from \"@astryxdesign/core/theme\";\nimport { devWarn, isFocusDetached, mergeRefs } from \"@astryxdesign/core/utils\";\n\nimport { useUicTranslator } from \"../../i18n/useUicTranslator\";\nimport { SkeletonText } from \"../Skeleton/SkeletonText\";\nimport { MODAL_OPEN_ATTRIBUTE, ModalPortalContext, useModalLevel } from \"./modalStack\";\nimport \"./Modal.css\";\n\nconst HEADING_SELECTOR = '[role=\"heading\"], h1, h2, h3, h4, h5, h6';\nconst DIALOG_SELECTOR = 'dialog, [role=\"dialog\"], [role=\"alertdialog\"]';\n\n/** Props for the primary action button, beyond what `Modal` sets itself. */\nexport type ModalActionButtonProps = Partial<\n Omit<ButtonProps, \"label\" | \"variant\" | \"clickAction\" | \"onClick\" | \"ref\">\n>;\n\nexport interface ModalProps extends Omit<DialogProps, \"ref\" | \"children\"> {\n /** Ref to the element carrying `role=\"dialog\"`: a `div`, not a `<dialog>`. */\n ref?: Ref<HTMLDivElement>;\n /** The body. Without `title`, `onAction` or `footer`, the whole surface. */\n children?: ReactNode;\n /**\n * Asks for a z-index inside the modal band. The stack still places a modal\n * opened later above this one, and a value outside the band is ignored.\n */\n zIndex?: number;\n /**\n * Called with the new visibility right after `isOpen` changes, never on\n * mount. There is no exit animation, so a close edge is the end of the\n * close.\n */\n afterOpenChange?: (isOpen: boolean) => void;\n /** Unmount the content, and drop its state, when the modal closes. */\n unmountOnClose?: boolean;\n\n /** Header title. Names the dialog. A node is rendered as given. */\n title?: ReactNode;\n /** Secondary line under the title. */\n subtitle?: string;\n /** Content before the title, e.g. a back button. */\n headerStartContent?: ReactNode;\n /** Content after the title, before the close button. */\n headerEndContent?: ReactNode;\n /** Whether the header shows a close button. Default: true */\n hasCloseButton?: boolean;\n /** Class name on the generated header, for a product's own header geometry. */\n headerClassName?: string;\n\n /**\n * Replaces the generated footer. `null` removes the footer. Left\n * `undefined`, a footer is generated when `onAction` is set.\n */\n footer?: ReactNode | null;\n /** Primary action. Returning a promise shows the button pending until it settles. It does not close the modal. */\n onAction?: () => unknown;\n /** Primary action label. Default: the catalog's `uic.common.ok` (\"OK\") */\n actionLabel?: string;\n /** Primary action variant. Default: \"primary\" */\n actionVariant?: ButtonVariant;\n /** Shows the primary action as pending, for work the modal does not await. */\n isActionLoading?: boolean;\n /** Disables the primary action. */\n isActionDisabled?: boolean;\n /** More props for the primary action button (`type`, `form`, `icon`, ...). */\n actionButtonProps?: ModalActionButtonProps;\n /** Cancel label. Default: the catalog's `uic.common.cancel` (\"Cancel\") */\n cancelLabel?: string;\n /** Whether the generated footer has a Cancel button. Default: true */\n hasCancelButton?: boolean;\n /** Class name on the generated footer. */\n footerClassName?: string;\n /** Shows a text skeleton in place of the body. */\n isLoading?: boolean;\n}\n\n/** Restores focus to the opener if focus was lost with the dialog. */\nfunction restoreTriggerFocus(trigger: HTMLElement | null, root: HTMLElement | null) {\n const focusWasLost =\n isFocusDetached() || root?.contains(document.activeElement) === true;\n if (focusWasLost && trigger?.isConnected) trigger.focus();\n}\n\n/** The dialog's own title, never a heading of a dialog nested inside it. */\nfunction findDialogTitle(node: HTMLElement): HTMLElement | null {\n for (const heading of node.querySelectorAll<HTMLElement>(HEADING_SELECTOR)) {\n if (heading.closest(DIALOG_SELECTOR) === node) return heading;\n }\n return null;\n}\n\n/**\n * Trigger → viewport-centre direction, for the entry motion.\n * SYNC: mirrors `getDialogDirection` in `@astryxdesign/core/Dialog/Dialog`,\n * which is not exported; diff it on an Astryx bump.\n */\nfunction getDialogDirection(triggerEl: HTMLElement, distance = 16) {\n const rect = triggerEl.getBoundingClientRect();\n const dx = rect.left + rect.width / 2 - window.innerWidth / 2;\n const dy = rect.top + rect.height / 2 - window.innerHeight / 2;\n const dist = Math.sqrt(dx * dx + dy * dy) || 1;\n return {\n x: Math.round((dx / dist) * distance),\n y: Math.round((dy / dist) * distance),\n };\n}\n\nfunction toCssLength(value: number | string): string {\n return typeof value === \"number\" ? `${value}px` : value;\n}\n\n/**\n * Logical `start`/`end` become `inset-inline-*`; unset offsets are `auto`.\n * SYNC: mirrors `resolveDialogPositionOffsets` in `@astryxdesign/core/Dialog`.\n */\nfunction resolvePosition(position: Readonly<DialogPosition>): CSSProperties {\n const { top, bottom, start, end } = position;\n return {\n top: top !== undefined ? toCssLength(top) : \"auto\",\n bottom: bottom !== undefined ? toCssLength(bottom) : \"auto\",\n insetInlineStart: start !== undefined ? toCssLength(start) : \"auto\",\n insetInlineEnd: end !== undefined ? toCssLength(end) : \"auto\",\n };\n}\n\n/** One key per portal host, so a Modal remounts when its host changes. */\nconst hostKeys = new WeakMap<HTMLElement, string>();\nlet hostCount = 0;\nfunction hostKey(host: HTMLElement | null): string {\n if (!host) return \"body\";\n let key = hostKeys.get(host);\n if (!key) {\n hostCount += 1;\n key = `dialog-${hostCount}`;\n hostKeys.set(host, key);\n }\n return key;\n}\n\nexport function Modal(props: ModalProps) {\n // Inside a modal <dialog> (a scrimmed Drawer) the page outside it is inert,\n // so the surface renders into that dialog and enters the top layer. A new\n // host remounts the surface: its level claim, inert background and popover\n // all belong to one root element.\n const dialogHost = useContext(ModalPortalContext);\n return <ModalSurface key={hostKey(dialogHost)} {...props} dialogHost={dialogHost} />;\n}\n\nfunction ModalSurface({\n dialogHost,\n isOpen,\n onOpenChange,\n isInline = false,\n width = 400,\n maxHeight,\n position,\n variant = \"standard\",\n purpose = \"info\",\n padding,\n zIndex,\n afterOpenChange,\n unmountOnClose = false,\n title,\n subtitle,\n headerStartContent,\n headerEndContent,\n hasCloseButton = true,\n headerClassName,\n footer,\n onAction,\n actionLabel,\n actionVariant = \"primary\",\n isActionLoading,\n isActionDisabled,\n actionButtonProps,\n cancelLabel,\n hasCancelButton = true,\n footerClassName,\n isLoading = false,\n role,\n children,\n xstyle,\n className,\n style,\n ref,\n ...rest\n}: ModalProps & { dialogHost: HTMLElement | null }) {\n const t = useUicTranslator();\n\n // Content mounts on the first open and then follows `unmountOnClose`.\n const [hasOpened, setHasOpened] = useState(isOpen);\n if (isOpen && !hasOpened) setHasOpened(true);\n const isMounted = isOpen || (hasOpened && !unmountOnClose);\n\n const wasOpenRef = useRef(isOpen);\n const notifyOpenChange = useEffectEvent((open: boolean) => afterOpenChange?.(open));\n useEffect(() => {\n if (wasOpenRef.current === isOpen) return;\n wasOpenRef.current = isOpen;\n notifyOpenChange(isOpen);\n // An effect event is not a dependency; this plugin version predates it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n // Theme CSS is scoped to `[data-astryx-theme]`, and the portal leaves the\n // themed subtree, so the root re-emits the nearest theme's name.\n const themeName = useThemeName();\n\n const allowEscape = purpose !== \"required\";\n const allowBackdropClick = purpose === \"info\";\n const hasConsumerName = rest[\"aria-label\"] != null || rest[\"aria-labelledby\"] != null;\n const titleId = useId();\n\n const close = () => onOpenChange(false);\n\n const rootRef = useRef<HTMLDivElement>(null);\n // An insertion effect runs before any layout effect of this commit: before\n // content mounting with the open autofocuses (a layout-phase focus), and\n // before the level stack inerts the covering root, which blurs its focus.\n const triggerRef = useRef<HTMLElement | null>(null);\n useInsertionEffect(() => {\n if (!isOpen || isInline) return;\n const active = document.activeElement;\n triggerRef.current =\n active instanceof HTMLElement && !rootRef.current?.contains(active)\n ? active\n : null;\n }, [isOpen, isInline]);\n\n const isActive = isOpen && !isInline;\n const isTopmost = useModalLevel(rootRef, isActive, zIndex);\n\n // Inside a modal <dialog>, the top layer is the only way above it.\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!isActive || !dialogHost || typeof root?.showPopover !== \"function\") return;\n root.showPopover();\n return () => {\n if (root.matches(\":popover-open\")) root.hidePopover();\n };\n }, [isActive, dialogHost]);\n\n const { containerRef, focusFirst } = useFocusTrap<HTMLDivElement>({\n isActive: isActive && isTopmost,\n });\n\n // Escape goes through Astryx's shared layer stack, which routes one press\n // to the top-most layer: a popover inside the modal closes alone.\n useLayerDismissal({\n isActive,\n escapeBehavior: allowEscape ? \"close\" : \"block\",\n onDismiss: close,\n getContainer: () => containerRef.current,\n });\n\n // Passive, not layout: React restores the selection it captured before the\n // commit at the end of the mutation phase, undoing an earlier focus move.\n useEffect(() => {\n if (!isActive) return;\n const root = rootRef.current;\n // triggerRef is not cleared: StrictMode replays this cleanup on mount, and\n // the insertion effect that captured it does not run again.\n return () => restoreTriggerFocus(triggerRef.current, root);\n }, [isActive]);\n\n useScrollLock(isActive);\n\n // `Dialog isInline` provides the context `ModalHeader` renders its title id\n // from, but nothing points the surface at it. This does.\n useEffect(() => {\n const node = containerRef.current;\n if (!isActive || !node || hasConsumerName) return;\n const heading = findDialogTitle(node);\n if (!heading) {\n node.removeAttribute(\"aria-labelledby\");\n return;\n }\n if (!heading.id) heading.id = titleId;\n node.setAttribute(\"aria-labelledby\", heading.id);\n });\n\n // Entry motion from the trigger's direction, set before first paint.\n useLayoutEffect(() => {\n const node = containerRef.current;\n if (!isActive || !node) return;\n const trigger = triggerRef.current;\n const reduced =\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n if (!reduced && trigger instanceof HTMLElement && trigger !== document.body) {\n const { x, y } = getDialogDirection(trigger);\n node.style.setProperty(\"--modal-dir-x\", `${x}px`);\n node.style.setProperty(\"--modal-dir-y\", `${y}px`);\n }\n return () => {\n node.style.removeProperty(\"--modal-dir-x\");\n node.style.removeProperty(\"--modal-dir-y\");\n };\n }, [isActive, containerRef]);\n\n // `[data-autofocus]` wins, then the title, then the first focusable.\n useEffect(() => {\n const node = containerRef.current;\n if (!isActive || !node) return;\n const target =\n node.querySelector<HTMLElement>(\"[data-autofocus]\") ?? findDialogTitle(node);\n target?.focus();\n if (document.activeElement !== target) focusFirst();\n }, [isActive, containerRef, focusFirst]);\n\n const hasWarnedRef = useRef(false);\n useEffect(() => {\n const node = containerRef.current;\n if (!isActive || hasConsumerName || hasWarnedRef.current || !node) return;\n if (findDialogTitle(node) != null) return;\n hasWarnedRef.current = true;\n devWarn(\n \"Modal\",\n \"open modal has no accessible name. Pass `title`, render a ModalHeader, \" +\n \"or pass `aria-label`/`aria-labelledby`.\",\n );\n }, [isActive, hasConsumerName, containerRef]);\n\n const maskRef = useRef<HTMLDivElement>(null);\n const pointerDownOnMaskRef = useRef(false);\n const handleMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n pointerDownOnMaskRef.current = event.target === maskRef.current;\n };\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n // A drag that started inside the surface must not dismiss it.\n const isBackdropClick =\n pointerDownOnMaskRef.current && event.target === maskRef.current;\n pointerDownOnMaskRef.current = false;\n if (isBackdropClick && allowBackdropClick) close();\n };\n\n // ------------------------------------------------------------------ body\n const isStructured =\n title !== undefined || onAction !== undefined || footer !== undefined;\n\n const generatedFooter =\n onAction !== undefined ? (\n <HStack justify=\"end\" align=\"center\" gap={2}>\n {hasCancelButton && (\n <Button\n variant=\"secondary\"\n label={cancelLabel ?? t(\"uic.common.cancel\")}\n onClick={close}\n />\n )}\n <Button\n {...actionButtonProps}\n variant={actionVariant}\n label={actionLabel ?? t(\"uic.common.ok\")}\n isLoading={isActionLoading ?? actionButtonProps?.isLoading}\n isDisabled={isActionDisabled ?? actionButtonProps?.isDisabled}\n clickAction={async () => {\n await onAction();\n }}\n />\n </HStack>\n ) : null;\n const resolvedFooter = footer === undefined ? generatedFooter : footer;\n\n const body = isLoading ? <SkeletonText lines={4} /> : children;\n\n const content = isStructured ? (\n <Layout\n header={\n title !== undefined || headerStartContent || headerEndContent ? (\n <DialogHeader\n hasDivider\n // `title` is typed string but renders through `Heading`, whose\n // children are a node; the cast keeps DialogHeader's a11y wiring.\n title={(title ?? \"\") as unknown as string}\n subtitle={subtitle}\n startContent={headerStartContent}\n endContent={headerEndContent}\n onOpenChange={hasCloseButton ? (next) => !next && close() : undefined}\n className={headerClassName}\n />\n ) : undefined\n }\n content={<LayoutContent>{body}</LayoutContent>}\n footer={\n resolvedFooter ? (\n <LayoutFooter hasDivider className={footerClassName}>\n {resolvedFooter}\n </LayoutFooter>\n ) : undefined\n }\n />\n ) : (\n body\n );\n\n if (isInline) {\n return (\n <Dialog\n {...rest}\n isInline\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n width={width}\n maxHeight={maxHeight}\n variant={variant}\n purpose={purpose}\n padding={padding}\n xstyle={xstyle}\n className={className}\n style={style}\n >\n {content}\n </Dialog>\n );\n }\n\n if (!isMounted || typeof document === \"undefined\") return null;\n\n const isFullscreen = variant === \"fullscreen\";\n const hasPosition = position != null && !isFullscreen;\n\n return createPortal(\n <div\n ref={rootRef}\n popover={dialogHost ? \"manual\" : undefined}\n className={[\"uic-modal\", !isOpen && \"uic-modal--closed\"]\n .filter(Boolean)\n .join(\" \")}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n {...{\n [MODAL_OPEN_ATTRIBUTE]: isOpen ? \"\" : undefined,\n [dataAttr(\"theme\")]: themeName ?? undefined,\n }}\n >\n <div ref={maskRef} className=\"uic-modal__mask\" />\n <div\n {...(rest as HTMLAttributes<HTMLDivElement>)}\n ref={mergeRefs<HTMLDivElement>(ref, containerRef)}\n className={[\"uic-modal__wrap\", hasPosition && \"uic-modal__wrap--positioned\"]\n .filter(Boolean)\n .join(\" \")}\n // `width` sizes the wrap so a percentage resolves against the\n // viewport, not the surface. `maxHeight` stays on the surface, which\n // also feeds it to its scroll container.\n style={{\n ...(hasPosition ? resolvePosition(position) : null),\n width: isFullscreen ? undefined : toCssLength(width),\n }}\n role={\n isOpen\n ? (role ?? (purpose === \"required\" ? \"alertdialog\" : \"dialog\"))\n : undefined\n }\n // True: modalStack makes everything outside inert, except what is\n // marked MODAL_LIVE_ATTRIBUTE (a notification stack).\n aria-modal={isOpen && isTopmost ? true : undefined}\n >\n <Dialog\n isInline\n isOpen\n onOpenChange={onOpenChange}\n width=\"100%\"\n maxHeight={maxHeight}\n variant={variant}\n padding={padding}\n xstyle={xstyle}\n className={className}\n style={style}\n >\n {content}\n </Dialog>\n </div>\n </div>,\n dialogHost ?? document.body,\n );\n}\n\nModal.displayName = \"Modal\";\n"],"mappings":";;;;;;;;;;;;;;;;;AA8EA,IAAM,IAAmB,8CACnB,IAAkB;AAmExB,SAAS,GAAoB,GAA6B,GAA0B;CAGlF,CADE,EAAgB,KAAK,GAAM,SAAS,SAAS,aAAa,MAAM,OAC9C,GAAS,eAAa,EAAQ,MAAM;AAC1D;AAGA,SAAS,EAAgB,GAAuC;CAC9D,KAAK,IAAM,KAAW,EAAK,iBAA8B,CAAgB,GACvE,IAAI,EAAQ,QAAQ,CAAe,MAAM,GAAM,OAAO;CAExD,OAAO;AACT;AAOA,SAAS,GAAmB,GAAwB,IAAW,IAAI;CACjE,IAAM,IAAO,EAAU,sBAAsB,GACvC,IAAK,EAAK,OAAO,EAAK,QAAQ,IAAI,OAAO,aAAa,GACtD,IAAK,EAAK,MAAM,EAAK,SAAS,IAAI,OAAO,cAAc,GACvD,IAAO,KAAK,KAAK,IAAK,IAAK,IAAK,CAAE,KAAK;CAC7C,OAAO;EACL,GAAG,KAAK,MAAO,IAAK,IAAQ,CAAQ;EACpC,GAAG,KAAK,MAAO,IAAK,IAAQ,CAAQ;CACtC;AACF;AAEA,SAAS,EAAY,GAAgC;CACnD,OAAO,OAAO,KAAU,WAAW,GAAG,EAAM,MAAM;AACpD;AAMA,SAAS,GAAgB,GAAmD;CAC1E,IAAM,EAAE,QAAK,WAAQ,UAAO,WAAQ;CACpC,OAAO;EACL,KAAK,MAAQ,KAAA,IAA+B,SAAnB,EAAY,CAAG;EACxC,QAAQ,MAAW,KAAA,IAAkC,SAAtB,EAAY,CAAM;EACjD,kBAAkB,MAAU,KAAA,IAAiC,SAArB,EAAY,CAAK;EACzD,gBAAgB,MAAQ,KAAA,IAA+B,SAAnB,EAAY,CAAG;CACrD;AACF;AAGA,IAAM,oB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K,GAA0B,IAAK,CAAY;GAChD,WAAW,CAAC,mBAAmB,KAAe,6BAA6B,CAAC,CACzE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GAIX,OAAO;IACL,GAAI,IAAc,GAAgB,CAAQ,IAAI;IAC9C,OAAO,IAAe,KAAA,IAAY,EAAY,CAAK;GACrD;GACA,MACE,IACK,OAAS,MAAY,aAAa,gBAAgB,YACnD,KAAA;GAIN,cAAY,KAAU,IAAY,KAAO,KAAA;GAEzC,UAAA,kBAAC,GAAD;IACE,UAAA;IACA,QAAA;IACc;IACd,OAAM;IACK;IACF;IACA;IACD;IACG;IACJ;IAEN,UAAA;GACK,CAAA;EACL,CAAA,CACF;CACL,CAAA,GAAA,KAAc,SAAS,IACzB;AACF;AAEA,EAAM,cAAc"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `@lablup/ui-common/Modal`: ui-common's dialog, in place of Astryx `Dialog`.
3
+ *
4
+ * `ModalHeader`, `ModalPosition`, `ModalPurpose` and `ModalVariant` are
5
+ * Astryx's `DialogHeader`, `DialogPosition`, `DialogPurpose` and
6
+ * `DialogVariant` under Modal names. The Dialog names are re-exported too,
7
+ * unchanged, so moving a `@astryxdesign/core/Dialog` import here takes only
8
+ * `Dialog` → `Modal` and `DialogProps` → `ModalProps`.
9
+ */
10
+ export { Modal } from './Modal';
11
+ export type { ModalActionButtonProps, ModalProps } from './Modal';
12
+ export { DialogHeader, DialogHeader as ModalHeader } from '@astryxdesign/core/Dialog';
13
+ export type { DialogHeaderProps, DialogHeaderProps as ModalHeaderProps, DialogPosition, DialogPosition as ModalPosition, DialogPurpose, DialogPurpose as ModalPurpose, DialogVariant, DialogVariant as ModalVariant, } from '@astryxdesign/core/Dialog';
14
+ export { MAX_MODAL_LEVEL, MODAL_LIVE_ATTRIBUTE, MODAL_OPEN_ATTRIBUTE, configureModalZIndex, refreshModalBackground, useModalLevel, } from './modalStack';
15
+ export type { ModalZIndexBand } from './modalStack';
@@ -0,0 +1,4 @@
1
+ import { MAX_MODAL_LEVEL as e, MODAL_LIVE_ATTRIBUTE as t, MODAL_OPEN_ATTRIBUTE as n, configureModalZIndex as r, refreshModalBackground as i, useModalLevel as a } from "./modalStack.js";
2
+ import { Modal as o } from "./Modal2.js";
3
+ import { DialogHeader as s, DialogHeader as c } from "@astryxdesign/core/Dialog";
4
+ export { s as DialogHeader, e as MAX_MODAL_LEVEL, t as MODAL_LIVE_ATTRIBUTE, n as MODAL_OPEN_ATTRIBUTE, o as Modal, c as ModalHeader, r as configureModalZIndex, i as refreshModalBackground, a as useModalLevel };
@@ -0,0 +1,64 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Marks an open modal root. Scope document queries to it through this
4
+ * constant rather than retyping the string.
5
+ */
6
+ export declare const MODAL_OPEN_ATTRIBUTE = "data-uic-modal-open";
7
+ /**
8
+ * The open modal `<dialog>` a surface inside it renders into, instead of
9
+ * `document.body`. `showModal()` makes everything outside the dialog inert,
10
+ * so a `Modal` portalled to the body from inside a scrimmed drawer would sit
11
+ * behind the drawer, unreachable. `Drawer` (src/forks/Drawer) provides its
12
+ * dialog while it is modal; `Modal` renders there and enters the top layer
13
+ * itself, as a manual popover, so it paints above the drawer and escapes the
14
+ * panel's clipping and transform. Internal: not exported from the package.
15
+ */
16
+ export declare const ModalPortalContext: import('react').Context<HTMLElement | null>;
17
+ /** Nesting depth ceiling. Two surfaces past it share a level. */
18
+ export declare const MAX_MODAL_LEVEL = 80;
19
+ /**
20
+ * The z-index band modal roots paint in. `base` is the first level, each
21
+ * nested level adds `step`, and nothing paints above `max`, so whatever the
22
+ * app layers above the band (a notification stack) stays above every modal.
23
+ */
24
+ export interface ModalZIndexBand {
25
+ base: number;
26
+ step: number;
27
+ max: number;
28
+ }
29
+ /**
30
+ * Sets the z-index band for every modal opened after the call. Call it once,
31
+ * at startup, to fit the app's own layer ladder. The default is
32
+ * `{ base: 1100, step: 10, max: 10999 }`. Pass nothing to restore it.
33
+ */
34
+ export declare function configureModalZIndex(next?: Partial<ModalZIndexBand>): void;
35
+ /** A claim on the stack. Released by reference, never by level. */
36
+ export interface ModalLevelEntry {
37
+ level: number;
38
+ zIndex: number;
39
+ isTopmost: boolean;
40
+ root: HTMLElement | null;
41
+ setIsTopmost: (isTopmost: boolean) => void;
42
+ }
43
+ /**
44
+ * Marks an element that stays reachable while a modal is open: it, and the
45
+ * ancestors it needs, are never made inert. `NotificationStack` sets it on
46
+ * its root, so a notice raised over a modal can still be read and dismissed.
47
+ * The mark is read when a modal opens or closes and on
48
+ * `refreshModalBackground()`; call that after mounting a marked element while
49
+ * a modal is open.
50
+ */
51
+ export declare const MODAL_LIVE_ATTRIBUTE = "data-uic-modal-live";
52
+ /**
53
+ * Re-reads which elements are marked `MODAL_LIVE_ATTRIBUTE` (and which modal
54
+ * roots are in the document) while a modal is open. A no-op otherwise.
55
+ */
56
+ export declare function refreshModalBackground(): void;
57
+ export declare function claimModalLevel(root: HTMLElement | null, setIsTopmost: (isTopmost: boolean) => void, requestedZIndex?: number): ModalLevelEntry;
58
+ export declare function releaseModalLevel(entry: ModalLevelEntry): void;
59
+ /**
60
+ * Claims a level for `rootRef` while `isOpen`, and writes the level and the
61
+ * resolved z-index onto the root as `--modal-level` and `--modal-z`.
62
+ * Returns whether this surface is the topmost one; gate a focus trap on it.
63
+ */
64
+ export declare function useModalLevel(rootRef: RefObject<HTMLElement | null>, isOpen: boolean, zIndex?: number): boolean;
@@ -0,0 +1,81 @@
1
+ import { registerInstance as e } from "../../instance.js";
2
+ import { createContext as t, useEffectEvent as n, useLayoutEffect as r, useState as i } from "react";
3
+ import { devWarn as a } from "@astryxdesign/core/utils";
4
+ //#region src/components/Modal/modalStack.ts
5
+ var o = "data-uic-modal-open", s = t(null), c = 80, l = {
6
+ base: 1100,
7
+ step: 10,
8
+ max: 10999
9
+ }, u = l;
10
+ function d(e) {
11
+ u = {
12
+ ...l,
13
+ ...e
14
+ };
15
+ }
16
+ var f = "--modal-level", p = "--modal-z", m = [];
17
+ function h(e, t) {
18
+ let n = t;
19
+ n != null && (n < u.base || n > u.max) && (a("Modal", `zIndex ${n} is outside the modal band (${u.base}..${u.max}); ignoring it. Change the band with configureModalZIndex instead.`), n = void 0);
20
+ let r = e?.zIndex ?? u.base - u.step;
21
+ return Math.min(Math.max(r + u.step, n ?? 0), u.max);
22
+ }
23
+ var g = "data-uic-modal-live", _ = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set([
24
+ "SCRIPT",
25
+ "STYLE",
26
+ "LINK",
27
+ "TEMPLATE",
28
+ "NOSCRIPT"
29
+ ]);
30
+ function y(e) {
31
+ let t = new Set(e), n = /* @__PURE__ */ new Set();
32
+ for (let t of e) for (let e = t.parentElement; e && e !== document.body;) n.add(e), e = e.parentElement;
33
+ let r = [], i = (e) => {
34
+ for (let a of Array.from(e.children)) t.has(a) || v.has(a.tagName) || (n.has(a) ? i(a) : r.push(a));
35
+ };
36
+ return i(document.body), r;
37
+ }
38
+ function b() {
39
+ if (typeof document > "u" || !document.body) return;
40
+ let e = m.map((e) => e.root).filter((e) => e != null && e.isConnected), t = new Set(m.length === 0 ? [] : y([...e, ...Array.from(document.querySelectorAll(`[${g}]`))]));
41
+ for (let e of _) t.has(e) || (e.removeAttribute("inert"), _.delete(e));
42
+ for (let e of t) _.has(e) || e.hasAttribute("inert") || (e.setAttribute("inert", ""), _.add(e));
43
+ }
44
+ function x() {
45
+ (m.length > 0 || _.size > 0) && b();
46
+ }
47
+ function S() {
48
+ b(), m.forEach((e, t) => {
49
+ let n = t === m.length - 1;
50
+ e.root?.toggleAttribute("inert", !n), e.isTopmost !== n && (e.isTopmost = n, e.setIsTopmost(n));
51
+ });
52
+ }
53
+ function C(t, n, r) {
54
+ e();
55
+ let i = m.at(-1), a = {
56
+ level: Math.min((i?.level ?? -1) + 1, 80),
57
+ zIndex: h(i, r),
58
+ isTopmost: !0,
59
+ root: t,
60
+ setIsTopmost: n
61
+ };
62
+ return m.push(a), S(), a;
63
+ }
64
+ function w(e) {
65
+ let t = m.indexOf(e);
66
+ t !== -1 && (e.root?.removeAttribute("inert"), m.splice(t, 1), S());
67
+ }
68
+ function T(e, t, a) {
69
+ let [o, s] = i(!0), c = n(() => a);
70
+ return r(() => {
71
+ if (!t) return;
72
+ let n = e.current, r = C(n, s, c());
73
+ return n?.style.setProperty(f, String(r.level)), n?.style.setProperty(p, String(r.zIndex)), () => {
74
+ w(r), n?.style.removeProperty(f), n?.style.removeProperty(p);
75
+ };
76
+ }, [t, e]), o;
77
+ }
78
+ //#endregion
79
+ export { c as MAX_MODAL_LEVEL, g as MODAL_LIVE_ATTRIBUTE, o as MODAL_OPEN_ATTRIBUTE, s as ModalPortalContext, C as claimModalLevel, d as configureModalZIndex, x as refreshModalBackground, w as releaseModalLevel, T as useModalLevel };
80
+
81
+ //# sourceMappingURL=modalStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modalStack.js","names":[],"sources":["../../../src/components/Modal/modalStack.ts"],"sourcesContent":["/**\n * The one level stack every portalled modal surface shares.\n *\n * `Modal` renders into a `document.body` portal instead of the browser's top\n * layer (see Modal.tsx for why). Without the top layer, stacking and\n * inertness are this module's job: a surface opened from inside another\n * paints above it, only the topmost one is interactive, and while any is\n * open the page behind them is inert, except what is marked\n * `MODAL_LIVE_ATTRIBUTE`.\n *\n * Other portalled modal surfaces (a scrimmed drawer, say) claim a level with\n * `useModalLevel` so they stack on the same order as `Modal`.\n */\nimport {\n createContext,\n useEffectEvent,\n useLayoutEffect,\n useState,\n type RefObject,\n} from \"react\";\nimport { devWarn } from \"@astryxdesign/core/utils\";\n\nimport { registerInstance } from \"../../instance\";\n\n/**\n * Marks an open modal root. Scope document queries to it through this\n * constant rather than retyping the string.\n */\nexport const MODAL_OPEN_ATTRIBUTE = \"data-uic-modal-open\";\n\n/**\n * The open modal `<dialog>` a surface inside it renders into, instead of\n * `document.body`. `showModal()` makes everything outside the dialog inert,\n * so a `Modal` portalled to the body from inside a scrimmed drawer would sit\n * behind the drawer, unreachable. `Drawer` (src/forks/Drawer) provides its\n * dialog while it is modal; `Modal` renders there and enters the top layer\n * itself, as a manual popover, so it paints above the drawer and escapes the\n * panel's clipping and transform. Internal: not exported from the package.\n */\nexport const ModalPortalContext = createContext<HTMLElement | null>(null);\n\n/** Nesting depth ceiling. Two surfaces past it share a level. */\nexport const MAX_MODAL_LEVEL = 80;\n\n/**\n * The z-index band modal roots paint in. `base` is the first level, each\n * nested level adds `step`, and nothing paints above `max`, so whatever the\n * app layers above the band (a notification stack) stays above every modal.\n */\nexport interface ModalZIndexBand {\n base: number;\n step: number;\n max: number;\n}\n\nconst DEFAULT_BAND: ModalZIndexBand = { base: 1100, step: 10, max: 10999 };\nlet band: ModalZIndexBand = DEFAULT_BAND;\n\n/**\n * Sets the z-index band for every modal opened after the call. Call it once,\n * at startup, to fit the app's own layer ladder. The default is\n * `{ base: 1100, step: 10, max: 10999 }`. Pass nothing to restore it.\n */\nexport function configureModalZIndex(next?: Partial<ModalZIndexBand>): void {\n band = { ...DEFAULT_BAND, ...next };\n}\n\nconst LEVEL_CSS_VAR = \"--modal-level\";\nconst Z_INDEX_CSS_VAR = \"--modal-z\";\n\n/** A claim on the stack. Released by reference, never by level. */\nexport interface ModalLevelEntry {\n level: number;\n zIndex: number;\n isTopmost: boolean;\n root: HTMLElement | null;\n setIsTopmost: (isTopmost: boolean) => void;\n}\n\nconst openModals: ModalLevelEntry[] = [];\n\n/**\n * One step above the topmost surface (or the band's base), raised by an\n * accepted override. Stacking and inertness therefore run on one order: a\n * surface opened later paints above an earlier one, whatever that one asked.\n */\nfunction resolveZIndex(\n topmost: ModalLevelEntry | undefined,\n requested?: number,\n): number {\n let override = requested;\n if (override != null && (override < band.base || override > band.max)) {\n devWarn(\n \"Modal\",\n `zIndex ${override} is outside the modal band (${band.base}..${band.max}); ` +\n \"ignoring it. Change the band with configureModalZIndex instead.\",\n );\n override = undefined;\n }\n const floor = topmost?.zIndex ?? band.base - band.step;\n return Math.min(Math.max(floor + band.step, override ?? 0), band.max);\n}\n\n/**\n * Marks an element that stays reachable while a modal is open: it, and the\n * ancestors it needs, are never made inert. `NotificationStack` sets it on\n * its root, so a notice raised over a modal can still be read and dismissed.\n * The mark is read when a modal opens or closes and on\n * `refreshModalBackground()`; call that after mounting a marked element while\n * a modal is open.\n */\nexport const MODAL_LIVE_ATTRIBUTE = \"data-uic-modal-live\";\n\n/** The background elements this module made inert, and only those. */\nconst inertedBackground = new Set<Element>();\n\nconst NEVER_INERT = new Set([\"SCRIPT\", \"STYLE\", \"LINK\", \"TEMPLATE\", \"NOSCRIPT\"]);\n\n/**\n * The elements to inert while `keep` stays reachable: every child of\n * `document.body` that holds none of them, and, inside a body child that\n * does, every sibling on the way down to them.\n */\nfunction backgroundOf(keep: Element[]): Element[] {\n const kept = new Set(keep);\n const onPath = new Set<Element>();\n for (const el of keep) {\n for (let node = el.parentElement; node && node !== document.body;) {\n onPath.add(node);\n node = node.parentElement;\n }\n }\n const out: Element[] = [];\n const visit = (parent: Element) => {\n for (const child of Array.from(parent.children)) {\n if (kept.has(child) || NEVER_INERT.has(child.tagName)) continue;\n if (onPath.has(child)) visit(child);\n else out.push(child);\n }\n };\n visit(document.body);\n return out;\n}\n\n/**\n * While any modal is open the rest of the page is `inert`, which is what\n * `aria-modal` promises. Modal roots (a drawer's too, when it claims a level\n * through `useModalLevel`) and elements marked `MODAL_LIVE_ATTRIBUTE` are\n * spared. An `inert` the page set itself is left alone, before and after.\n */\nfunction syncBackground(): void {\n if (typeof document === \"undefined\" || !document.body) return;\n const roots = openModals\n .map((entry) => entry.root)\n .filter((root): root is HTMLElement => root != null && root.isConnected);\n const target = new Set(\n openModals.length === 0\n ? []\n : backgroundOf([\n ...roots,\n ...Array.from(document.querySelectorAll(`[${MODAL_LIVE_ATTRIBUTE}]`)),\n ]),\n );\n for (const el of inertedBackground) {\n if (target.has(el)) continue;\n el.removeAttribute(\"inert\");\n inertedBackground.delete(el);\n }\n for (const el of target) {\n if (inertedBackground.has(el) || el.hasAttribute(\"inert\")) continue;\n el.setAttribute(\"inert\", \"\");\n inertedBackground.add(el);\n }\n}\n\n/**\n * Re-reads which elements are marked `MODAL_LIVE_ATTRIBUTE` (and which modal\n * roots are in the document) while a modal is open. A no-op otherwise.\n */\nexport function refreshModalBackground(): void {\n if (openModals.length > 0 || inertedBackground.size > 0) syncBackground();\n}\n\n/**\n * Only the topmost surface stays interactive. A covered one drops its focus\n * trap and goes `inert`: the trap alone lets Tab escape to the parent, and\n * `inert` alone leaves the covered trap swallowing Tab with nothing to focus.\n */\nfunction syncCovered(): void {\n syncBackground();\n openModals.forEach((entry, index) => {\n const isTopmost = index === openModals.length - 1;\n entry.root?.toggleAttribute(\"inert\", !isTopmost);\n if (entry.isTopmost !== isTopmost) {\n entry.isTopmost = isTopmost;\n entry.setIsTopmost(isTopmost);\n }\n });\n}\n\nexport function claimModalLevel(\n root: HTMLElement | null,\n setIsTopmost: (isTopmost: boolean) => void,\n requestedZIndex?: number,\n): ModalLevelEntry {\n registerInstance();\n const topmost = openModals.at(-1);\n const entry: ModalLevelEntry = {\n level: Math.min((topmost?.level ?? -1) + 1, MAX_MODAL_LEVEL),\n zIndex: resolveZIndex(topmost, requestedZIndex),\n isTopmost: true,\n root,\n setIsTopmost,\n };\n openModals.push(entry);\n syncCovered();\n return entry;\n}\n\nexport function releaseModalLevel(entry: ModalLevelEntry): void {\n const index = openModals.indexOf(entry);\n if (index === -1) return;\n entry.root?.removeAttribute(\"inert\");\n openModals.splice(index, 1);\n syncCovered();\n}\n\n/**\n * Claims a level for `rootRef` while `isOpen`, and writes the level and the\n * resolved z-index onto the root as `--modal-level` and `--modal-z`.\n * Returns whether this surface is the topmost one; gate a focus trap on it.\n */\nexport function useModalLevel(\n rootRef: RefObject<HTMLElement | null>,\n isOpen: boolean,\n zIndex?: number,\n): boolean {\n const [isTopmost, setIsTopmost] = useState(true);\n // Read at claim time only: re-claiming would move an open surface to the\n // top of the stack and inert whatever legitimately covered it.\n const readZIndex = useEffectEvent(() => zIndex);\n\n useLayoutEffect(() => {\n if (!isOpen) return;\n const root = rootRef.current;\n const entry = claimModalLevel(root, setIsTopmost, readZIndex());\n root?.style.setProperty(LEVEL_CSS_VAR, String(entry.level));\n root?.style.setProperty(Z_INDEX_CSS_VAR, String(entry.zIndex));\n return () => {\n releaseModalLevel(entry);\n root?.style.removeProperty(LEVEL_CSS_VAR);\n root?.style.removeProperty(Z_INDEX_CSS_VAR);\n };\n // An effect event is not a dependency; this plugin version predates it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, rootRef]);\n\n return isTopmost;\n}\n"],"mappings":";;;;AA4BA,IAAa,IAAuB,uBAWvB,IAAqB,EAAkC,IAAI,GAG3D,IAAkB,IAazB,IAAgC;CAAE,MAAM;CAAM,MAAM;CAAI,KAAK;AAAM,GACrE,IAAwB;AAO5B,SAAgB,EAAqB,GAAuC;CAC1E,IAAO;EAAE,GAAG;EAAc,GAAG;CAAK;AACpC;AAEA,IAAM,IAAgB,iBAChB,IAAkB,aAWlB,IAAgC,CAAC;AAOvC,SAAS,EACP,GACA,GACQ;CACR,IAAI,IAAW;CACf,AAAI,KAAY,SAAS,IAAW,EAAK,QAAQ,IAAW,EAAK,SAC/D,EACE,SACA,UAAU,EAAS,8BAA8B,EAAK,KAAK,IAAI,EAAK,IAAI,mEAE1E,GACA,IAAW,KAAA;CAEb,IAAM,IAAQ,GAAS,UAAU,EAAK,OAAO,EAAK;CAClD,OAAO,KAAK,IAAI,KAAK,IAAI,IAAQ,EAAK,MAAM,KAAY,CAAC,GAAG,EAAK,GAAG;AACtE;AAUA,IAAa,IAAuB,uBAG9B,oBAAoB,IAAI,IAAa,GAErC,oBAAc,IAAI,IAAI;CAAC;CAAU;CAAS;CAAQ;CAAY;AAAU,CAAC;AAO/E,SAAS,EAAa,GAA4B;CAChD,IAAM,IAAO,IAAI,IAAI,CAAI,GACnB,oBAAS,IAAI,IAAa;CAChC,KAAK,IAAM,KAAM,GACf,KAAK,IAAI,I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EACd,GACA,GACA,GACiB;CACjB,EAAiB;CACjB,IAAM,IAAU,EAAW,GAAG,EAAE,GAC1B,IAAyB;EAC7B,OAAO,KAAK,KAAK,GAAS,SAAS,MAAM,GAAA,EAAkB;EAC3D,QAAQ,EAAc,GAAS,CAAe;EAC9C,WAAW;EACX;EACA;CACF;CAGA,OAFA,EAAW,KAAK,CAAK,GACrB,EAAY,GACL;AACT;AAEA,SAAgB,EAAkB,GAA8B;CAC9D,IAAM,IAAQ,EAAW,QAAQ,CAAK;CAClC,MAAU,OACd,EAAM,MAAM,gBAAgB,OAAO,GACnC,EAAW,OAAO,GAAO,CAAC,GAC1B,EAAY;AACd;AAOA,SAAgB,EACd,GACA,GACA,GACS;CACT,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAI,GAGzC,IAAa,QAAqB,CAAM;CAiB9C,OAfA,QAAsB;EACpB,IAAI,CAAC,GAAQ;EACb,IAAM,IAAO,EAAQ,SACf,IAAQ,EAAgB,GAAM,GAAc,EAAW,CAAC;EAG9D,OAFA,GAAM,MAAM,YAAY,GAAe,OAAO,EAAM,KAAK,CAAC,GAC1D,GAAM,MAAM,YAAY,GAAiB,OAAO,EAAM,MAAM,CAAC,SAChD;GAGX,AAFA,EAAkB,CAAK,GACvB,GAAM,MAAM,eAAe,CAAa,GACxC,GAAM,MAAM,eAAe,CAAe;EAC5C;CAGF,GAAG,CAAC,GAAQ,CAAO,CAAC,GAEb;AACT"}
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ export interface NotificationItemProps {
3
+ title?: ReactNode;
4
+ description?: ReactNode;
5
+ /** Actions, at the end of their own row. */
6
+ action?: ReactNode;
7
+ /** A quiet note at the end, such as when the notice arrived. */
8
+ footer?: ReactNode;
9
+ className?: string;
10
+ }
11
+ export declare function NotificationItem({ title, description, action, footer, className, }: NotificationItemProps): import("react").JSX.Element;
12
+ export declare namespace NotificationItem {
13
+ var displayName: string;
14
+ }
@@ -0,0 +1,40 @@
1
+ /* empty css */
2
+ import { HStack as e, VStack as t } from "@astryxdesign/core/Stack";
3
+ import { Text as n } from "@astryxdesign/core/Text";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/components/NotificationItem/NotificationItem.tsx
6
+ var a = (e) => typeof e == "string" || typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ r(n, { children: e }) : e;
7
+ function o({ title: n, description: o, action: s, footer: c, className: l }) {
8
+ return /* @__PURE__ */ r("div", {
9
+ className: ["uic-notification-item", l].filter(Boolean).join(" "),
10
+ children: /* @__PURE__ */ i(t, {
11
+ gap: 1,
12
+ align: "stretch",
13
+ className: "uic-notification-item__stack",
14
+ children: [
15
+ n && /* @__PURE__ */ r("div", {
16
+ className: "uic-notification-item__title",
17
+ children: a(n)
18
+ }),
19
+ o && /* @__PURE__ */ r("div", { children: a(o) }),
20
+ s && /* @__PURE__ */ r(e, {
21
+ gap: 1,
22
+ align: "end",
23
+ justify: "end",
24
+ className: "uic-notification-item__action",
25
+ children: s
26
+ }),
27
+ c && /* @__PURE__ */ r("div", {
28
+ className: "uic-notification-item__footer",
29
+ children: a(c)
30
+ })
31
+ ]
32
+ })
33
+ });
34
+ }
35
+ o.displayName = "NotificationItem";
36
+ //#endregion
37
+ export { o as NotificationItem };
38
+
39
+ //# sourceMappingURL=NotificationItem2.js.map
40
+ import "../../assets/components/NotificationItem/NotificationItem.css";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationItem2.js","names":[],"sources":["../../../src/components/NotificationItem/NotificationItem.tsx"],"sourcesContent":["/**\n * NotificationItem\n *\n * The body of one notice: a title, a description, actions and a footer (a\n * timestamp, say), stacked, with the actions and the footer at the end. A\n * string or number in a slot renders as body `Text`; a node renders as is.\n * The title leaves room at the end for the notice's close button.\n *\n * @example\n * <NotificationItem\n * title=\"Upload finished\"\n * description=\"report.csv\"\n * action={<Button label=\"Open\" />}\n * footer=\"2 minutes ago\"\n * />\n */\nimport type { ReactNode } from \"react\";\nimport { HStack, VStack } from \"@astryxdesign/core/Stack\";\nimport { Text } from \"@astryxdesign/core/Text\";\n\nimport \"./NotificationItem.css\";\n\nexport interface NotificationItemProps {\n title?: ReactNode;\n description?: ReactNode;\n /** Actions, at the end of their own row. */\n action?: ReactNode;\n /** A quiet note at the end, such as when the notice arrived. */\n footer?: ReactNode;\n className?: string;\n}\n\nconst asText = (content: ReactNode) =>\n typeof content === \"string\" ||\n typeof content === \"number\" ||\n typeof content === \"bigint\" ? (\n <Text>{content}</Text>\n ) : (\n content\n );\n\nexport function NotificationItem({\n title,\n description,\n action,\n footer,\n className,\n}: NotificationItemProps) {\n return (\n <div className={[\"uic-notification-item\", className].filter(Boolean).join(\" \")}>\n <VStack gap={1} align=\"stretch\" className=\"uic-notification-item__stack\">\n {title && <div className=\"uic-notification-item__title\">{asText(title)}</div>}\n {description && <div>{asText(description)}</div>}\n {action && (\n <HStack\n gap={1}\n align=\"end\"\n justify=\"end\"\n className=\"uic-notification-item__action\"\n >\n {action}\n </HStack>\n )}\n {footer && (\n <div className=\"uic-notification-item__footer\">{asText(footer)}</div>\n )}\n </VStack>\n </div>\n );\n}\n\nNotificationItem.displayName = \"NotificationItem\";\n"],"mappings":";;;;;AAgCA,IAAM,KAAU,MACd,OAAO,KAAY,YACnB,OAAO,KAAY,YACnB,OAAO,KAAY,WACjB,kBAAC,GAAD,EAAA,UAAO,EAAc,CAAA,IAErB;AAGJ,SAAgB,EAAiB,EAC/B,UACA,gBACA,WACA,WACA,gBACwB;CACxB,OACE,kBAAC,OAAD;EAAK,WAAW,CAAC,yBAAyB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC3E,UAAA,kBAAC,GAAD;GAAQ,KAAK;GAAG,OAAM;GAAU,WAAU;GAA1C,UAAA;IACG,KAAS,kBAAC,OAAD;KAAK,WAAU;KAAgC,UAAA,EAAO,CAAK;IAAO,CAAA;IAC3E,KAAe,kBAAC,OAAD,EAAA,UAAM,EAAO,CAAW,EAAO,CAAA;IAC9C,KACC,kBAAC,GAAD;KACE,KAAK;KACL,OAAM;KACN,SAAQ;KACR,WAAU;KAET,UAAA;IACK,CAAA;IAET,KACC,kBAAC,OAAD;KAAK,WAAU;KAAiC,UAAA,EAAO,CAAM;IAAO,CAAA;GAEhE;;CACL,CAAA;AAET;AAEA,EAAiB,cAAc"}
@@ -0,0 +1,2 @@
1
+ export { NotificationItem } from './NotificationItem';
2
+ export type { NotificationItemProps } from './NotificationItem';
@@ -0,0 +1,2 @@
1
+ import { NotificationItem as e } from "./NotificationItem2.js";
2
+ export { e as NotificationItem };
@@ -0,0 +1,56 @@
1
+ import { Key, ReactNode } from 'react';
2
+ import { BannerStatus } from '@astryxdesign/core/Banner';
3
+ export interface NotificationStackItem {
4
+ key: Key;
5
+ /** Headline. */
6
+ title: ReactNode;
7
+ description?: ReactNode;
8
+ /** Drives the Banner's icon and colour. @default 'info' */
9
+ status?: BannerStatus;
10
+ /** Background-task progress, 0-100. Omit for a notice with no task. */
11
+ percent?: number;
12
+ /** A task that is running with no measurable progress yet. */
13
+ isProgressIndeterminate?: boolean;
14
+ /**
15
+ * Accessible name of the progress bar.
16
+ * @default the title when it is a string, else the catalog's uic.NotificationStack.progress
17
+ */
18
+ progressLabel?: string;
19
+ /** Label of the navigation action ("View folder"). Shown with `onAction`. */
20
+ actionText?: string;
21
+ onAction?: () => void;
22
+ /** @default the catalog's uic.common.retry ("Retry") */
23
+ retryText?: string;
24
+ onRetry?: () => void;
25
+ /** @default the catalog's uic.common.cancel ("Cancel") */
26
+ cancelText?: string;
27
+ onCancel?: () => void;
28
+ /**
29
+ * Seconds until the notice closes itself; `null` or `0` keeps it open until
30
+ * dismissed. The countdown pauses while the notice is hovered or focused.
31
+ */
32
+ duration?: number | null;
33
+ /** @default true */
34
+ isClosable?: boolean;
35
+ /** Overrides the status icon. */
36
+ icon?: ReactNode;
37
+ /** A complete notice body that replaces the title, description and progress. */
38
+ content?: ReactNode;
39
+ /** Collapsible detail below the header. */
40
+ children?: ReactNode;
41
+ }
42
+ export interface NotificationStackProps {
43
+ /** Oldest first; the last entry renders nearest the corner. */
44
+ notifications: Array<NotificationStackItem>;
45
+ /** Fired by the close button and by the auto-close timer. */
46
+ onClose?: (key: Key) => void;
47
+ /** Cap on simultaneously visible notices; the newest win. Unlimited when unset. */
48
+ maxVisible?: number;
49
+ /** Extra class names on the stack. */
50
+ className?: string;
51
+ "data-testid"?: string;
52
+ }
53
+ export declare function NotificationStack({ notifications, onClose, maxVisible, className, "data-testid": testId, }: NotificationStackProps): import("react").JSX.Element | null;
54
+ export declare namespace NotificationStack {
55
+ var displayName: string;
56
+ }
@@ -0,0 +1,6 @@
1
+ export declare const notificationStackMessages: {
2
+ readonly "uic.NotificationStack.progress": {
3
+ readonly defaultMessage: "Task progress";
4
+ readonly description: "Accessible name of a notice's progress bar when the notice title is not plain text";
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ import { defineMessages as e } from "../../i18n/catalog.js";
2
+ //#region src/components/NotificationStack/NotificationStack.messages.ts
3
+ var t = e({ "uic.NotificationStack.progress": {
4
+ defaultMessage: "Task progress",
5
+ description: "Accessible name of a notice's progress bar when the notice title is not plain text"
6
+ } });
7
+ //#endregion
8
+ export { t as notificationStackMessages };
9
+
10
+ //# sourceMappingURL=NotificationStack.messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationStack.messages.js","names":[],"sources":["../../../src/components/NotificationStack/NotificationStack.messages.ts"],"sourcesContent":["import { defineMessages } from \"../../i18n/catalog\";\n\nexport const notificationStackMessages = defineMessages({\n \"uic.NotificationStack.progress\": {\n defaultMessage: \"Task progress\",\n description:\n \"Accessible name of a notice's progress bar when the notice title is not plain text\",\n },\n});\n"],"mappings":";;AAEA,IAAa,IAA4B,EAAe,EACtD,kCAAkC;CAChC,gBAAgB;CAChB,aACE;AACJ,EACF,CAAC"}
@@ -0,0 +1,154 @@
1
+ import { useUicTranslator as e } from "../../i18n/useUicTranslator.js";
2
+ import { MODAL_LIVE_ATTRIBUTE as t, refreshModalBackground as n } from "../Modal/modalStack.js";
3
+ /* empty css */
4
+ import { useEffect as r, useEffectEvent as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
5
+ import { Button as l } from "@astryxdesign/core/Button";
6
+ import { HStack as u, VStack as d } from "@astryxdesign/core/Stack";
7
+ import { Text as f } from "@astryxdesign/core/Text";
8
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
+ import { Banner as h } from "@astryxdesign/core/Banner";
10
+ import { ProgressBar as g } from "@astryxdesign/core/ProgressBar";
11
+ //#region src/components/NotificationStack/NotificationStack.tsx
12
+ var _ = 200;
13
+ function v({ item: t, isExiting: n, onClose: a }) {
14
+ let o = e(), { key: _, duration: v } = t, y = i(() => a?.(_)), [b, x] = c(!1), [S, C] = c(!1), w = b || S, T = (t.status ?? "info") === "error", [E, D] = c(null), O = E ?? T, k = typeof v == "number" && v > 0 ? v * 1e3 : null, A = s(k);
15
+ r(() => {
16
+ A.current = k;
17
+ }, [k]), r(() => {
18
+ if (k === null || n || w) return;
19
+ let e = A.current ?? k, t = Date.now(), r = window.setTimeout(() => y(), e);
20
+ return () => {
21
+ window.clearTimeout(r), A.current = Math.max(0, e - (Date.now() - t));
22
+ };
23
+ }, [
24
+ k,
25
+ n,
26
+ w
27
+ ]);
28
+ let j = t.percent !== void 0 || t.isProgressIndeterminate === !0, M = !!(t.onCancel || t.onRetry || t.onAction), N = t.content != null, P = /* @__PURE__ */ m(u, {
29
+ gap: 2,
30
+ align: "center",
31
+ justify: "end",
32
+ wrap: "wrap",
33
+ children: [
34
+ t.onCancel ? /* @__PURE__ */ p(l, {
35
+ size: "sm",
36
+ variant: "ghost",
37
+ label: t.cancelText ?? o("uic.common.cancel"),
38
+ onClick: t.onCancel
39
+ }) : null,
40
+ t.onRetry ? /* @__PURE__ */ p(l, {
41
+ size: "sm",
42
+ variant: "secondary",
43
+ label: t.retryText ?? o("uic.common.retry"),
44
+ onClick: t.onRetry
45
+ }) : null,
46
+ t.onAction && t.actionText ? /* @__PURE__ */ p(l, {
47
+ size: "sm",
48
+ variant: "ghost",
49
+ label: t.actionText,
50
+ onClick: t.onAction
51
+ }) : null
52
+ ]
53
+ });
54
+ return /* @__PURE__ */ p("div", {
55
+ className: "uic-notification-stack__item",
56
+ "data-exiting": n ? "true" : "false",
57
+ "data-notification-key": String(_),
58
+ "data-status": t.status ?? "info",
59
+ "data-paused": w ? "true" : "false",
60
+ onMouseEnter: () => x(!0),
61
+ onMouseLeave: () => x(!1),
62
+ onFocus: () => C(!0),
63
+ onBlur: () => C(!1),
64
+ children: /* @__PURE__ */ p(h, {
65
+ status: t.status ?? "info",
66
+ title: N ? t.content : /* @__PURE__ */ p("span", {
67
+ "data-testid": "notification-title",
68
+ children: t.title
69
+ }),
70
+ icon: t.icon,
71
+ elevation: "high",
72
+ isDismissable: t.isClosable ?? !0,
73
+ onDismiss: () => a?.(_),
74
+ endContent: M ? P : void 0,
75
+ collapsible: {
76
+ isOpen: O,
77
+ onOpenChange: D
78
+ },
79
+ description: N ? void 0 : t.description || j ? /* @__PURE__ */ m(d, {
80
+ gap: 2,
81
+ align: "stretch",
82
+ children: [t.description ? /* @__PURE__ */ p("div", {
83
+ className: "uic-notification-stack__body",
84
+ children: typeof t.description == "string" ? /* @__PURE__ */ p(f, {
85
+ type: "supporting",
86
+ children: /* @__PURE__ */ p("span", {
87
+ "data-testid": "notification-description",
88
+ children: t.description
89
+ })
90
+ }) : t.description
91
+ }) : null, j ? /* @__PURE__ */ p(g, {
92
+ value: t.percent ?? 0,
93
+ max: 100,
94
+ label: t.progressLabel ?? (typeof t.title == "string" ? t.title : o("uic.NotificationStack.progress")),
95
+ isLabelHidden: !0,
96
+ hasValueLabel: !t.isProgressIndeterminate,
97
+ isIndeterminate: t.isProgressIndeterminate
98
+ }) : null]
99
+ }) : void 0,
100
+ children: t.children ? /* @__PURE__ */ p("div", {
101
+ className: "uic-notification-stack__body",
102
+ children: typeof t.children == "string" ? /* @__PURE__ */ p(f, {
103
+ type: "supporting",
104
+ children: t.children
105
+ }) : t.children
106
+ }) : null
107
+ })
108
+ });
109
+ }
110
+ function y({ notifications: e, onClose: i, maxVisible: l, className: u, "data-testid": d }) {
111
+ let [f, h] = c([]), g = s([]), y = s(/* @__PURE__ */ new Map()), b = s(null), x = o(() => l ? e.slice(-l) : e, [e, l]), S = e.at(-1)?.key;
112
+ r(() => {
113
+ let e = b.current;
114
+ e && (e.scrollTop = e.scrollHeight);
115
+ }, [S]), r(() => {
116
+ let t = new Set(e.map((e) => e.key)), n = g.current.filter((e) => !t.has(e.key));
117
+ if (g.current = x, n.length === 0) return;
118
+ let r = new Set(n.map((e) => e.key));
119
+ h((e) => [...e.filter((e) => !r.has(e.key)), ...n]);
120
+ let i = y.current;
121
+ for (let { key: e } of n) window.clearTimeout(i.get(e)), i.set(e, window.setTimeout(() => {
122
+ i.delete(e), h((t) => t.filter((t) => t.key !== e));
123
+ }, _));
124
+ }, [e, x]), r(() => {
125
+ let e = y.current;
126
+ return () => {
127
+ for (let t of e.values()) window.clearTimeout(t);
128
+ e.clear();
129
+ };
130
+ }, []);
131
+ let C = new Set(x.map((e) => e.key)), w = f.filter((e) => !C.has(e.key)), T = x.length > 0 || w.length > 0;
132
+ return a(() => (n(), () => queueMicrotask(n)), [T]), T ? /* @__PURE__ */ m("div", {
133
+ ref: b,
134
+ className: ["uic-notification-stack", u].filter(Boolean).join(" "),
135
+ "data-testid": d,
136
+ [t]: "",
137
+ role: "presentation",
138
+ children: [w.map((e) => /* @__PURE__ */ p(v, {
139
+ item: e,
140
+ isExiting: !0,
141
+ onClose: i
142
+ }, e.key)), x.map((e) => /* @__PURE__ */ p(v, {
143
+ item: e,
144
+ isExiting: !1,
145
+ onClose: i
146
+ }, e.key))]
147
+ }) : null;
148
+ }
149
+ y.displayName = "NotificationStack";
150
+ //#endregion
151
+ export { y as NotificationStack };
152
+
153
+ //# sourceMappingURL=NotificationStack2.js.map
154
+ import "../../assets/components/NotificationStack/NotificationStack.css";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationStack2.js","names":[],"sources":["../../../src/components/NotificationStack/NotificationStack.tsx"],"sourcesContent":["/**\n * NotificationStack\n *\n * Floating notices stacked in the bottom-end corner, newest nearest the\n * corner. Each notice is an Astryx `Banner` that can carry what a toast\n * cannot: background-task progress (determinate or not), Cancel / Retry and a\n * navigation action, a collapsible detail, and a body of the caller's own.\n *\n * It is presentational. The caller owns the list: it adds notices, removes\n * them in `onClose`, and updates a notice in place under the same `key`.\n *\n * - `duration` closes a notice after that many seconds; the countdown pauses\n * while the notice is hovered or holds focus. `null` or `0` keeps it open.\n * - An error notice opens its detail (`children`) up front; the reader's own\n * toggle wins after that.\n * - `maxVisible` caps how many render; the newest win, and the rest render as\n * room frees up.\n * - Removed notices slide out before they unmount, unless the reader asked\n * for reduced motion.\n * - A long description scrolls inside its notice, so the dismiss button stays\n * on screen; the stack scrolls once it reaches the top inset.\n *\n * Layout hooks, set on the stack or an ancestor:\n * `--notification-stack-z` (stacking order, default 11000, one above\n * `Modal`'s default band), `--notification-stack-inset-top` (space kept\n * free above the stack, such as an app header, default 0) and\n * `--notification-stack-body-max-height` (one notice's scroll cap, default 30vh).\n *\n * e2e hooks: each notice carries `data-notification-key`, `data-status` and\n * `data-paused`; its title and description carry `data-testid`\n * `notification-title` and `notification-description`.\n *\n * @example\n * <NotificationStack\n * notifications={[{ key: \"upload\", title: \"Uploading\", percent: 40 }]}\n * onClose={(key) => remove(key)}\n * />\n */\nimport {\n useEffect,\n useEffectEvent,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type Key,\n type ReactNode,\n} from \"react\";\nimport { Banner, type BannerStatus } from \"@astryxdesign/core/Banner\";\nimport { Button } from \"@astryxdesign/core/Button\";\nimport { ProgressBar } from \"@astryxdesign/core/ProgressBar\";\nimport { HStack, VStack } from \"@astryxdesign/core/Stack\";\nimport { Text } from \"@astryxdesign/core/Text\";\n\nimport { useUicTranslator } from \"../../i18n/useUicTranslator\";\nimport { MODAL_LIVE_ATTRIBUTE, refreshModalBackground } from \"../Modal/modalStack\";\nimport \"./NotificationStack.css\";\n\n/** Matches the exit animation's budget in NotificationStack.css. */\nconst EXIT_ANIMATION_MS = 200;\n\nexport interface NotificationStackItem {\n key: Key;\n /** Headline. */\n title: ReactNode;\n description?: ReactNode;\n /** Drives the Banner's icon and colour. @default 'info' */\n status?: BannerStatus;\n /** Background-task progress, 0-100. Omit for a notice with no task. */\n percent?: number;\n /** A task that is running with no measurable progress yet. */\n isProgressIndeterminate?: boolean;\n /**\n * Accessible name of the progress bar.\n * @default the title when it is a string, else the catalog's uic.NotificationStack.progress\n */\n progressLabel?: string;\n /** Label of the navigation action (\"View folder\"). Shown with `onAction`. */\n actionText?: string;\n onAction?: () => void;\n /** @default the catalog's uic.common.retry (\"Retry\") */\n retryText?: string;\n onRetry?: () => void;\n /** @default the catalog's uic.common.cancel (\"Cancel\") */\n cancelText?: string;\n onCancel?: () => void;\n /**\n * Seconds until the notice closes itself; `null` or `0` keeps it open until\n * dismissed. The countdown pauses while the notice is hovered or focused.\n */\n duration?: number | null;\n /** @default true */\n isClosable?: boolean;\n /** Overrides the status icon. */\n icon?: ReactNode;\n /** A complete notice body that replaces the title, description and progress. */\n content?: ReactNode;\n /** Collapsible detail below the header. */\n children?: ReactNode;\n}\n\nexport interface NotificationStackProps {\n /** Oldest first; the last entry renders nearest the corner. */\n notifications: Array<NotificationStackItem>;\n /** Fired by the close button and by the auto-close timer. */\n onClose?: (key: Key) => void;\n /** Cap on simultaneously visible notices; the newest win. Unlimited when unset. */\n maxVisible?: number;\n /** Extra class names on the stack. */\n className?: string;\n \"data-testid\"?: string;\n}\n\nfunction NotificationStackItemView({\n item,\n isExiting,\n onClose,\n}: {\n item: NotificationStackItem;\n isExiting: boolean;\n onClose?: (key: Key) => void;\n}) {\n const t = useUicTranslator();\n const { key, duration } = item;\n\n // The timer must not restart when the parent re-creates `onClose`, but\n // firing must still see the latest one.\n const fireClose = useEffectEvent(() => onClose?.(key));\n\n // A notice that closes under the pointer the reader moved there to read it\n // is lost; focus counts too, so keyboard users get the same reprieve.\n // Each holds the countdown on its own: leaving one must not resume it while\n // the other still holds.\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const isPaused = isHovered || isFocused;\n\n // Derived, not a default: a task is updated in place under the same key\n // (pending, then failed), so the item never remounts. `null` means the\n // reader has not touched the disclosure, so it follows the status.\n const isError = (item.status ?? \"info\") === \"error\";\n const [detailOpenByUser, setDetailOpenByUser] = useState<boolean | null>(null);\n const isDetailOpen = detailOpenByUser ?? isError;\n\n // `0` means \"stay open\", not \"close immediately\".\n const autoCloseMs =\n typeof duration === \"number\" && duration > 0 ? duration * 1000 : null;\n // What is left of the countdown, banked by the timer effect's cleanup so a\n // pause and resume continues rather than restarts.\n const remainingMsRef = useRef<number | null>(autoCloseMs);\n\n // A new duration is a new budget. Cleanups run before effects, so this\n // lands after the timer's cleanup banked the old value and before the timer\n // below reads it.\n useEffect(() => {\n remainingMsRef.current = autoCloseMs;\n }, [autoCloseMs]);\n\n useEffect(() => {\n if (autoCloseMs === null || isExiting || isPaused) return;\n const budget = remainingMsRef.current ?? autoCloseMs;\n const startedAt = Date.now();\n const timer = window.setTimeout(() => fireClose(), budget);\n return () => {\n window.clearTimeout(timer);\n remainingMsRef.current = Math.max(0, budget - (Date.now() - startedAt));\n };\n // An effect event is not a dependency; this plugin version predates it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [autoCloseMs, isExiting, isPaused]);\n\n const hasProgress =\n item.percent !== undefined || item.isProgressIndeterminate === true;\n const hasActions = !!(item.onCancel || item.onRetry || item.onAction);\n const hasOwnContent = item.content != null;\n\n // `wrap` lets the buttons stack inside the end area of a narrow notice\n // instead of pushing the header wider.\n const actions = (\n <HStack gap={2} align=\"center\" justify=\"end\" wrap=\"wrap\">\n {item.onCancel ? (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n label={item.cancelText ?? t(\"uic.common.cancel\")}\n onClick={item.onCancel}\n />\n ) : null}\n {item.onRetry ? (\n <Button\n size=\"sm\"\n variant=\"secondary\"\n label={item.retryText ?? t(\"uic.common.retry\")}\n onClick={item.onRetry}\n />\n ) : null}\n {item.onAction && item.actionText ? (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n label={item.actionText}\n onClick={item.onAction}\n />\n ) : null}\n </HStack>\n );\n\n return (\n <div\n className=\"uic-notification-stack__item\"\n data-exiting={isExiting ? \"true\" : \"false\"}\n data-notification-key={String(key)}\n data-status={item.status ?? \"info\"}\n data-paused={isPaused ? \"true\" : \"false\"}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n // React's onFocus/onBlur are the delegated focusin/focusout pair, so\n // focus anywhere inside the notice counts.\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n >\n <Banner\n status={item.status ?? \"info\"}\n title={\n hasOwnContent ? (\n item.content\n ) : (\n <span data-testid=\"notification-title\">{item.title}</span>\n )\n }\n icon={item.icon}\n // Banner is normally in flow; a floating notice needs a shadow.\n elevation=\"high\"\n isDismissable={item.isClosable ?? true}\n onDismiss={() => onClose?.(key)}\n endContent={hasActions ? actions : undefined}\n collapsible={{\n isOpen: isDetailOpen,\n onOpenChange: setDetailOpenByUser,\n }}\n description={\n hasOwnContent ? undefined : item.description || hasProgress ? (\n <VStack gap={2} align=\"stretch\">\n {/* The text scrolls; a progress bar outside it stays pinned. */}\n {item.description ? (\n <div className=\"uic-notification-stack__body\">\n {typeof item.description === \"string\" ? (\n <Text type=\"supporting\">\n <span data-testid=\"notification-description\">\n {item.description}\n </span>\n </Text>\n ) : (\n item.description\n )}\n </div>\n ) : null}\n {hasProgress ? (\n <ProgressBar\n value={item.percent ?? 0}\n max={100}\n // Hidden: the Banner title already names the task on screen.\n label={\n item.progressLabel ??\n (typeof item.title === \"string\"\n ? item.title\n : t(\"uic.NotificationStack.progress\"))\n }\n isLabelHidden\n hasValueLabel={!item.isProgressIndeterminate}\n isIndeterminate={item.isProgressIndeterminate}\n />\n ) : null}\n </VStack>\n ) : undefined\n }\n >\n {/* A bare string would take Banner's base size and tower over the\n description, so it gets the description's treatment. */}\n {item.children ? (\n <div className=\"uic-notification-stack__body\">\n {typeof item.children === \"string\" ? (\n <Text type=\"supporting\">{item.children}</Text>\n ) : (\n item.children\n )}\n </div>\n ) : null}\n </Banner>\n </div>\n );\n}\n\nexport function NotificationStack({\n notifications,\n onClose,\n maxVisible,\n className,\n \"data-testid\": testId,\n}: NotificationStackProps) {\n // Notices that left `notifications` but are still playing their exit.\n const [exiting, setExiting] = useState<Array<NotificationStackItem>>([]);\n const previousVisibleRef = useRef<Array<NotificationStackItem>>([]);\n // One prune timer per exiting key. They outlive the effect that starts\n // them: any re-render (a new array, the exit itself) re-runs that effect,\n // and cancelling there would leave the notice mounted for good.\n const exitTimersRef = useRef(new Map<Key, number>());\n const stackRef = useRef<HTMLDivElement>(null);\n\n const visible = useMemo(\n () => (maxVisible ? notifications.slice(-maxVisible) : notifications),\n [notifications, maxVisible],\n );\n const newestKey = notifications.at(-1)?.key;\n\n // Once the stack is capped it scrolls, and the newest notice is at the\n // scrolled end. Keyed on the newest notice, not the array: a running task\n // rebuilds the array constantly and would yank a reader back down.\n useEffect(() => {\n const el = stackRef.current;\n if (el) el.scrollTop = el.scrollHeight;\n }, [newestKey]);\n\n useEffect(() => {\n const currentKeys = new Set(notifications.map((n) => n.key));\n // Only a notice that was on screen animates out; one closed while hidden\n // behind `maxVisible` would otherwise flash into the corner.\n const removed = previousVisibleRef.current.filter((n) => !currentKeys.has(n.key));\n previousVisibleRef.current = visible;\n if (removed.length === 0) return;\n const removedKeys = new Set(removed.map((n) => n.key));\n setExiting((prev) => [...prev.filter((n) => !removedKeys.has(n.key)), ...removed]);\n const timers = exitTimersRef.current;\n for (const { key } of removed) {\n window.clearTimeout(timers.get(key));\n timers.set(\n key,\n window.setTimeout(() => {\n timers.delete(key);\n setExiting((prev) => prev.filter((n) => n.key !== key));\n }, EXIT_ANIMATION_MS),\n );\n }\n }, [notifications, visible]);\n\n useEffect(() => {\n const timers = exitTimersRef.current;\n return () => {\n for (const timer of timers.values()) window.clearTimeout(timer);\n timers.clear();\n };\n }, []);\n\n const visibleKeys = new Set(visible.map((n) => n.key));\n const stillExiting = exiting.filter((n) => !visibleKeys.has(n.key));\n\n const isRendered = visible.length > 0 || stillExiting.length > 0;\n // The stack is marked to stay reachable over an open Modal; the modal stack\n // re-reads the mark whenever the stack appears or goes.\n useLayoutEffect(() => {\n refreshModalBackground();\n return () => queueMicrotask(refreshModalBackground);\n }, [isRendered]);\n\n if (!isRendered) return null;\n\n return (\n <div\n ref={stackRef}\n className={[\"uic-notification-stack\", className].filter(Boolean).join(\" \")}\n data-testid={testId}\n {...{ [MODAL_LIVE_ATTRIBUTE]: \"\" }}\n // Each Banner announces itself; the container stays out of the tree.\n role=\"presentation\"\n >\n {stillExiting.map((item) => (\n <NotificationStackItemView\n key={item.key}\n item={item}\n isExiting\n onClose={onClose}\n />\n ))}\n {visible.map((item) => (\n <NotificationStackItemView\n key={item.key}\n item={item}\n isExiting={false}\n onClose={onClose}\n />\n ))}\n </div>\n );\n}\n\nNotificationStack.displayName = \"NotificationStack\";\n"],"mappings":";;;;;;;;;;;AA2DA,IAAM,IAAoB;AAsD1B,SAAS,EAA0B,EACjC,SACA,cACA,cAKC;CACD,IAAM,IAAI,EAAiB,GACrB,EAAE,QAAK,gBAAa,GAIpB,IAAY,QAAqB,IAAU,CAAG,CAAC,GAM/C,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,IAAW,KAAa,GAKxB,KAAW,EAAK,UAAU,YAAY,SACtC,CAAC,GAAkB,KAAuB,EAAyB,IAAI,GACvE,IAAe,KAAoB,GAGnC,IACJ,OAAO,KAAa,YAAY,IAAW,IAAI,IAAW,MAAO,MAG7D,IAAiB,EAAs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AAK,EAAa,SAAS;CAU/D,OAPA,SACE,EAAuB,SACV,eAAe,CAAsB,IACjD,CAAC,CAAU,CAAC,GAEV,IAGH,kBAAC,OAAD;EACE,KAAK;EACL,WAAW,CAAC,0BAA0B,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACzE,eAAa;GACN,IAAuB;EAE9B,MAAK;EANP,UAAA,CAQG,EAAa,KAAK,MACjB,kBAAC,GAAD;GAEQ;GACN,WAAA;GACS;EACV,GAJM,EAAK,GAIX,CACF,GACA,EAAQ,KAAK,MACZ,kBAAC,GAAD;GAEQ;GACN,WAAW;GACF;EACV,GAJM,EAAK,GAIX,CACF,CACE;MA3BiB;AA6B1B;AAEA,EAAkB,cAAc"}
@@ -0,0 +1,2 @@
1
+ export { NotificationStack } from './NotificationStack';
2
+ export type { NotificationStackItem, NotificationStackProps, } from './NotificationStack';
@@ -0,0 +1,2 @@
1
+ import { NotificationStack as e } from "./NotificationStack2.js";
2
+ export { e as NotificationStack };