@epam/ai-dial-chat-shared 1.3.0-dev.35 → 1.3.0-dev.353

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 (333) hide show
  1. package/components/ActionMenu/ActionMenu.d.ts +26 -0
  2. package/components/ActionMenu/ActionMenu.d.ts.map +1 -0
  3. package/components/ActionMenu/ActionMenu.js +50 -0
  4. package/components/ConfirmationDialog/ConfirmationDialog.d.ts +46 -0
  5. package/components/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -0
  6. package/components/ConfirmationDialog/ConfirmationDialog.js +11 -9
  7. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.d.ts +33 -0
  8. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.d.ts.map +1 -0
  9. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +5 -4
  10. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.d.ts +33 -0
  11. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.d.ts.map +1 -0
  12. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +2 -2
  13. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -2
  14. package/components/ConfirmationView/ConfirmationFooter.d.ts +41 -0
  15. package/components/ConfirmationView/ConfirmationFooter.d.ts.map +1 -0
  16. package/components/ConfirmationView/ConfirmationFooter.js +25 -26
  17. package/components/ConfirmationView/ConfirmationView.d.ts +59 -0
  18. package/components/ConfirmationView/ConfirmationView.d.ts.map +1 -0
  19. package/components/ConfirmationView/ConfirmationView.js +12 -12
  20. package/components/ConfirmationView/ConfirmationView.module.scss.js +6 -5
  21. package/components/CopyButton/CopyButton.d.ts +19 -0
  22. package/components/CopyButton/CopyButton.d.ts.map +1 -0
  23. package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.d.ts +41 -0
  24. package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.d.ts.map +1 -0
  25. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts +31 -0
  26. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts.map +1 -0
  27. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js +36 -0
  28. package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts +52 -0
  29. package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts.map +1 -0
  30. package/components/DeleteConfirmationView/DeleteConfirmationView.js +36 -27
  31. package/components/DeleteConfirmationView/DeleteConfirmationView.module.scss.js +5 -4
  32. package/components/DeploymentIcon/DeploymentIcon.d.ts +36 -0
  33. package/components/DeploymentIcon/DeploymentIcon.d.ts.map +1 -0
  34. package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -2
  35. package/components/EntityHeader/EntityHeader.d.ts +38 -0
  36. package/components/EntityHeader/EntityHeader.d.ts.map +1 -0
  37. package/components/EntityHeader/EntityHeader.js +1 -1
  38. package/components/EntityTypeLabel/EntityTypeLabel.d.ts +18 -0
  39. package/components/EntityTypeLabel/EntityTypeLabel.d.ts.map +1 -0
  40. package/components/FeaturedChip/FeaturedChip.d.ts +16 -0
  41. package/components/FeaturedChip/FeaturedChip.d.ts.map +1 -0
  42. package/components/InitialsAvatar/InitialsAvatar.d.ts +18 -0
  43. package/components/InitialsAvatar/InitialsAvatar.d.ts.map +1 -0
  44. package/components/InitialsAvatar/InitialsAvatar.js +4 -3
  45. package/components/ItemHeader/ItemHeader.d.ts +40 -0
  46. package/components/ItemHeader/ItemHeader.d.ts.map +1 -0
  47. package/components/ItemHeader/ItemHeader.js +4 -1
  48. package/components/ItemHeader/ItemHeader.module.scss.js +5 -4
  49. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +57 -0
  50. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +1 -0
  51. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +58 -58
  52. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +9 -8
  53. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts +7 -0
  54. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +1 -0
  55. package/components/MarkdownRenderer/MDMessageViewer.d.ts +66 -0
  56. package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +1 -0
  57. package/components/MarkdownRenderer/MDMessageViewer.js +14 -12
  58. package/components/MarkdownRenderer/MarkdownRenderer.d.ts +145 -0
  59. package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -0
  60. package/components/MarkdownRenderer/MarkdownRenderer.js +146 -136
  61. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +9 -8
  62. package/components/MarkdownRenderer/Math/MarkdownMathBlock.d.ts +18 -0
  63. package/components/MarkdownRenderer/Math/MarkdownMathBlock.d.ts.map +1 -0
  64. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +1 -1
  65. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +5 -4
  66. package/components/MarkdownRenderer/PlainTextRenderer.d.ts +39 -0
  67. package/components/MarkdownRenderer/PlainTextRenderer.d.ts.map +1 -0
  68. package/components/MarkdownRenderer/PlainTextRenderer.js +1 -1
  69. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +51 -0
  70. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +1 -0
  71. package/components/MarkdownRenderer/Table/MarkdownTable.js +68 -63
  72. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +15 -13
  73. package/components/MarkdownRenderer/Table/TableHeader.d.ts +22 -0
  74. package/components/MarkdownRenderer/Table/TableHeader.d.ts.map +1 -0
  75. package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -2
  76. package/components/MarkdownRenderer/Table/table-serialization.d.ts +16 -0
  77. package/components/MarkdownRenderer/Table/table-serialization.d.ts.map +1 -0
  78. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts +27 -0
  79. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts.map +1 -0
  80. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +9 -0
  81. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts.map +1 -0
  82. package/components/MarkdownRenderer/ThinkingShimmer.d.ts +17 -0
  83. package/components/MarkdownRenderer/ThinkingShimmer.d.ts.map +1 -0
  84. package/components/MarkdownRenderer/markdown-class-names.d.ts +10 -0
  85. package/components/MarkdownRenderer/markdown-class-names.d.ts.map +1 -0
  86. package/components/MarkdownRenderer/markdown-whitespace.d.ts +15 -0
  87. package/components/MarkdownRenderer/markdown-whitespace.d.ts.map +1 -0
  88. package/components/MarkdownRenderer/markdown-whitespace.js +2 -6
  89. package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts +25 -0
  90. package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts.map +1 -0
  91. package/components/NewVersionAlert/NewVersionAlert.d.ts +27 -0
  92. package/components/NewVersionAlert/NewVersionAlert.d.ts.map +1 -0
  93. package/components/NewVersionAlert/NewVersionAlert.js +28 -0
  94. package/components/NewVersionAlert/NewVersionAlert.module.scss.js +4 -0
  95. package/components/NotificationStack/NotificationStack.d.ts +48 -0
  96. package/components/NotificationStack/NotificationStack.d.ts.map +1 -0
  97. package/components/NotificationStack/NotificationStack.js +111 -0
  98. package/components/PanelEmptyState/PanelEmptyState.d.ts +32 -0
  99. package/components/PanelEmptyState/PanelEmptyState.d.ts.map +1 -0
  100. package/components/PanelEmptyState/PanelEmptyState.js +19 -9
  101. package/components/PanelEmptyState/PanelEmptyState.module.scss.js +6 -2
  102. package/components/ResourceSummary/ResourceSummary.d.ts +49 -0
  103. package/components/ResourceSummary/ResourceSummary.d.ts.map +1 -0
  104. package/components/ResourceSummary/ResourceSummary.module.scss.js +5 -4
  105. package/components/TextRefinementField/TextRefinementField.d.ts +33 -0
  106. package/components/TextRefinementField/TextRefinementField.d.ts.map +1 -0
  107. package/components/TextRefinementField/TextRefinementField.js +84 -55
  108. package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts +22 -0
  109. package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts.map +1 -0
  110. package/components/UnsavedChangesProvider/UnsavedChangesProvider.js +57 -0
  111. package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts +44 -0
  112. package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts.map +1 -0
  113. package/components/UnsavedChangesProvider/unsaved-changes-context.js +13 -0
  114. package/constants/breakpoint.d.ts +15 -0
  115. package/constants/breakpoint.d.ts.map +1 -0
  116. package/constants/breakpoint.js +2 -2
  117. package/constants/dial.d.ts +5 -0
  118. package/constants/dial.d.ts.map +1 -0
  119. package/constants/entity-colors.d.ts +6 -0
  120. package/constants/entity-colors.d.ts.map +1 -0
  121. package/constants/icon.d.ts +14 -0
  122. package/constants/icon.d.ts.map +1 -0
  123. package/constants/markdown-editor.d.ts +2 -0
  124. package/constants/markdown-editor.d.ts.map +1 -0
  125. package/constants/mime-types.d.ts +27 -0
  126. package/constants/mime-types.d.ts.map +1 -0
  127. package/constants/public-class-names.d.ts +13 -0
  128. package/constants/public-class-names.d.ts.map +1 -0
  129. package/constants/resizable-fields.d.ts +5 -0
  130. package/constants/resizable-fields.d.ts.map +1 -0
  131. package/constants/select-list.d.ts +4 -0
  132. package/constants/select-list.d.ts.map +1 -0
  133. package/constants/tag-input.d.ts +2 -0
  134. package/constants/tag-input.d.ts.map +1 -0
  135. package/conversation-transfer/conversation-transfer-queue.d.ts +16 -0
  136. package/conversation-transfer/conversation-transfer-queue.d.ts.map +1 -0
  137. package/conversation-transfer/conversation-transfer-queue.js +24 -0
  138. package/entry-points/file-manager.d.ts +5 -0
  139. package/entry-points/file-manager.d.ts.map +1 -0
  140. package/entry-points/markdown.d.ts +19 -0
  141. package/entry-points/markdown.d.ts.map +1 -0
  142. package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts +67 -0
  143. package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -0
  144. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +330 -266
  145. package/file-manager/DialFileManagerShell/DialFileManagerShell.module.scss.js +8 -0
  146. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts +96 -0
  147. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts.map +1 -0
  148. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +85 -80
  149. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.module.scss.js +7 -0
  150. package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts +22 -0
  151. package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts.map +1 -0
  152. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +25 -20
  153. package/file-manager/OperationLoaderModal/OperationLoaderModal.module.scss.js +4 -0
  154. package/file-manager/attach-result.d.ts +9 -0
  155. package/file-manager/attach-result.d.ts.map +1 -0
  156. package/file-manager/file-manager-controller.d.ts +129 -0
  157. package/file-manager/file-manager-controller.d.ts.map +1 -0
  158. package/file-manager/file-manager-variant.d.ts +21 -0
  159. package/file-manager/file-manager-variant.d.ts.map +1 -0
  160. package/file-manager/file-upload-validation.d.ts +8 -0
  161. package/file-manager/file-upload-validation.d.ts.map +1 -0
  162. package/file-manager/index.d.ts +11 -0
  163. package/file-manager/index.d.ts.map +1 -0
  164. package/file-manager/labels.d.ts +177 -0
  165. package/file-manager/labels.d.ts.map +1 -0
  166. package/file-manager/path.d.ts +12 -0
  167. package/file-manager/path.d.ts.map +1 -0
  168. package/file-manager/shell-styles.d.ts +37 -0
  169. package/file-manager/shell-styles.d.ts.map +1 -0
  170. package/file-manager/upload-batch.d.ts +75 -0
  171. package/file-manager/upload-batch.d.ts.map +1 -0
  172. package/file-manager/upload-batch.js +6 -2
  173. package/file-manager/upload-queue.d.ts +45 -0
  174. package/file-manager/upload-queue.d.ts.map +1 -0
  175. package/file-manager/upload-queue.js +45 -13
  176. package/file-manager/useGridEditingScroll/useGridEditingScroll.d.ts +27 -0
  177. package/file-manager/useGridEditingScroll/useGridEditingScroll.d.ts.map +1 -0
  178. package/file-manager.d.ts +2 -506
  179. package/file-manager.js +4 -4
  180. package/hooks/useAvailableHeightCap.d.ts +30 -0
  181. package/hooks/useAvailableHeightCap.d.ts.map +1 -0
  182. package/hooks/useAvailableHeightCap.js +1 -1
  183. package/hooks/useCodeCopy.d.ts +6 -0
  184. package/hooks/useCodeCopy.d.ts.map +1 -0
  185. package/hooks/useCollapsedText.d.ts +27 -0
  186. package/hooks/useCollapsedText.d.ts.map +1 -0
  187. package/hooks/useControlErrorAssociation.d.ts +3 -0
  188. package/hooks/useControlErrorAssociation.d.ts.map +1 -0
  189. package/hooks/useControlErrorAssociation.js +12 -0
  190. package/hooks/useHorizontalOverflow.d.ts +21 -0
  191. package/hooks/useHorizontalOverflow.d.ts.map +1 -0
  192. package/hooks/useIsMobile.d.ts +3 -0
  193. package/hooks/useIsMobile.d.ts.map +1 -0
  194. package/hooks/useIsMobile.js +1 -1
  195. package/hooks/useIsPhone.d.ts +3 -0
  196. package/hooks/useIsPhone.d.ts.map +1 -0
  197. package/hooks/useIsPhone.js +13 -0
  198. package/hooks/useIsTablet.d.ts +3 -0
  199. package/hooks/useIsTablet.d.ts.map +1 -0
  200. package/hooks/useIsTablet.js +13 -0
  201. package/hooks/useIsTextClipped.d.ts +26 -0
  202. package/hooks/useIsTextClipped.d.ts.map +1 -0
  203. package/hooks/useIsTextClipped.js +25 -0
  204. package/hooks/useStreamedMarkdownContent.d.ts +3 -0
  205. package/hooks/useStreamedMarkdownContent.d.ts.map +1 -0
  206. package/hooks/useTextRefinement.d.ts +44 -0
  207. package/hooks/useTextRefinement.d.ts.map +1 -0
  208. package/hooks/useTextRefinement.js +4 -4
  209. package/hooks/useUnsavedChangesGuard.d.ts +14 -0
  210. package/hooks/useUnsavedChangesGuard.d.ts.map +1 -0
  211. package/hooks/useUnsavedChangesGuard.js +1 -5
  212. package/hooks/useUnsavedChangesLeaveConfirmation.d.ts +12 -0
  213. package/hooks/useUnsavedChangesLeaveConfirmation.d.ts.map +1 -0
  214. package/hooks/useUnsavedChangesLeaveConfirmation.js +22 -0
  215. package/hooks/useUnsavedChangesLeaveGuard.d.ts +24 -0
  216. package/hooks/useUnsavedChangesLeaveGuard.d.ts.map +1 -0
  217. package/hooks/useUnsavedChangesLeaveGuard.js +24 -0
  218. package/index.css +3 -2
  219. package/index.d.ts +93 -3167
  220. package/index.d.ts.map +1 -0
  221. package/index.js +92 -76
  222. package/markdown.d.ts +2 -465
  223. package/markdown.js +3 -2
  224. package/models/annotation.d.ts +143 -0
  225. package/models/annotation.d.ts.map +1 -0
  226. package/models/application-visualizer.d.ts +67 -0
  227. package/models/application-visualizer.d.ts.map +1 -0
  228. package/models/auth.d.ts +28 -0
  229. package/models/auth.d.ts.map +1 -0
  230. package/models/chat.d.ts +409 -0
  231. package/models/chat.d.ts.map +1 -0
  232. package/models/conversation-classification.d.ts +14 -0
  233. package/models/conversation-classification.d.ts.map +1 -0
  234. package/models/conversation-classification.js +3 -1
  235. package/models/conversation-transfer.d.ts +96 -0
  236. package/models/conversation-transfer.d.ts.map +1 -0
  237. package/models/custom-visualizer.d.ts +61 -0
  238. package/models/custom-visualizer.d.ts.map +1 -0
  239. package/models/deployment-configuration.d.ts +55 -0
  240. package/models/deployment-configuration.d.ts.map +1 -0
  241. package/models/deployment-features.d.ts +17 -0
  242. package/models/deployment-features.d.ts.map +1 -0
  243. package/models/deployment.d.ts +31 -0
  244. package/models/deployment.d.ts.map +1 -0
  245. package/models/dial-model.d.ts +19 -0
  246. package/models/dial-model.d.ts.map +1 -0
  247. package/models/entity.d.ts +15 -0
  248. package/models/entity.d.ts.map +1 -0
  249. package/models/import-export.d.ts +23 -0
  250. package/models/import-export.d.ts.map +1 -0
  251. package/models/inline-segment.d.ts +11 -0
  252. package/models/inline-segment.d.ts.map +1 -0
  253. package/models/locale.d.ts +19 -0
  254. package/models/locale.d.ts.map +1 -0
  255. package/models/text-refinement.d.ts +22 -0
  256. package/models/text-refinement.d.ts.map +1 -0
  257. package/models/theme.d.ts +36 -0
  258. package/models/theme.d.ts.map +1 -0
  259. package/models/tool-menu-item.d.ts +13 -0
  260. package/models/tool-menu-item.d.ts.map +1 -0
  261. package/package.json +10 -17
  262. package/types/attachment.d.ts +25 -0
  263. package/types/attachment.d.ts.map +1 -0
  264. package/types/code-editor.d.ts +8 -0
  265. package/types/code-editor.d.ts.map +1 -0
  266. package/types/entity-type.d.ts +10 -0
  267. package/types/entity-type.d.ts.map +1 -0
  268. package/types/file-manager-node.d.ts +17 -0
  269. package/types/file-manager-node.d.ts.map +1 -0
  270. package/types/mime-type.d.ts +59 -0
  271. package/types/mime-type.d.ts.map +1 -0
  272. package/utils/annotation.d.ts +29 -0
  273. package/utils/annotation.d.ts.map +1 -0
  274. package/utils/avatar-color.d.ts +10 -0
  275. package/utils/avatar-color.d.ts.map +1 -0
  276. package/utils/base64-json.d.ts +14 -0
  277. package/utils/base64-json.d.ts.map +1 -0
  278. package/utils/base64-json.js +4 -0
  279. package/utils/build-css-vars.d.ts +4 -0
  280. package/utils/build-css-vars.d.ts.map +1 -0
  281. package/utils/copy-to-clipboard.d.ts +18 -0
  282. package/utils/copy-to-clipboard.d.ts.map +1 -0
  283. package/utils/dom.d.ts +8 -0
  284. package/utils/dom.d.ts.map +1 -0
  285. package/utils/dom.js +10 -0
  286. package/utils/entity-field-limits.d.ts +11 -0
  287. package/utils/entity-field-limits.d.ts.map +1 -0
  288. package/utils/entity-type.d.ts +5 -0
  289. package/utils/entity-type.d.ts.map +1 -0
  290. package/utils/file-download.d.ts +21 -0
  291. package/utils/file-download.d.ts.map +1 -0
  292. package/utils/format-file-size.d.ts +3 -0
  293. package/utils/format-file-size.d.ts.map +1 -0
  294. package/utils/format-last-used.d.ts +3 -0
  295. package/utils/format-last-used.d.ts.map +1 -0
  296. package/utils/format-price.d.ts +7 -0
  297. package/utils/format-price.d.ts.map +1 -0
  298. package/utils/format-price.js +10 -10
  299. package/utils/generate-uuid.d.ts +3 -0
  300. package/utils/generate-uuid.d.ts.map +1 -0
  301. package/utils/initials.d.ts +3 -0
  302. package/utils/initials.d.ts.map +1 -0
  303. package/utils/inline-segments.d.ts +38 -0
  304. package/utils/inline-segments.d.ts.map +1 -0
  305. package/utils/inline-segments.js +53 -0
  306. package/utils/is-audio-transcription-supported.d.ts +3 -0
  307. package/utils/is-audio-transcription-supported.d.ts.map +1 -0
  308. package/utils/is-skill-selection-unsupported.d.ts +3 -0
  309. package/utils/is-skill-selection-unsupported.d.ts.map +1 -0
  310. package/utils/latex.d.ts +22 -0
  311. package/utils/latex.d.ts.map +1 -0
  312. package/utils/latex.js +47 -41
  313. package/utils/markdown-html.d.ts +14 -0
  314. package/utils/markdown-html.d.ts.map +1 -0
  315. package/utils/markdown-html.js +11 -0
  316. package/utils/merge-class.d.ts +4 -0
  317. package/utils/merge-class.d.ts.map +1 -0
  318. package/utils/message-attachment-to-display.d.ts +22 -0
  319. package/utils/message-attachment-to-display.d.ts.map +1 -0
  320. package/utils/message-attachment-to-display.js +1 -1
  321. package/utils/message.d.ts +4 -0
  322. package/utils/message.d.ts.map +1 -0
  323. package/utils/mime-type.d.ts +22 -0
  324. package/utils/mime-type.d.ts.map +1 -0
  325. package/utils/mime-type.js +1 -1
  326. package/utils/prompt-variables.d.ts +62 -0
  327. package/utils/prompt-variables.d.ts.map +1 -0
  328. package/utils/prompt-variables.js +5 -9
  329. package/utils/string-utils.d.ts +11 -0
  330. package/utils/string-utils.d.ts.map +1 -0
  331. package/utils/syntax-highlighting.d.ts +8 -0
  332. package/utils/syntax-highlighting.d.ts.map +1 -0
  333. package/utils/syntax-highlighting.js +8 -8
@@ -0,0 +1,111 @@
1
+ import { mergeClasses as e } from "../../utils/merge-class.js";
2
+ import { copyToClipboard as t } from "../../utils/copy-to-clipboard.js";
3
+ import { DIAL_ICON_SIZE as n, DIAL_KIT_ICON_STROKE as r, GhostIconButton as i, LiveRegion as a, LiveRegionElement as o, Notification as s } from "@epam/ai-dial-ui-kit";
4
+ import { memo as c, useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
5
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
6
+ import { IconCopy as _ } from "@tabler/icons-react";
7
+ import { createPortal as v } from "react-dom";
8
+ //#region src/components/NotificationStack/NotificationStack.tsx
9
+ var y = 2e3, b = "pointer-events-none fixed inset-x-0 bottom-[calc(1.5rem+env(safe-area-inset-bottom))] z-70 flex max-h-[calc(100dvh-3rem)] flex-col items-center gap-2 overflow-y-auto px-4 desktop:inset-s-auto desktop:me-6 desktop:w-[min(600px,calc(100vw-3rem))] desktop:items-end desktop:px-0", x = ({ requestId: s, labels: c, className: u }) => {
10
+ let [d, f] = p("idle");
11
+ l(() => {
12
+ if (d === "idle") return;
13
+ let e = window.setTimeout(() => f("idle"), y);
14
+ return () => window.clearTimeout(e);
15
+ }, [d]);
16
+ let m = async () => {
17
+ try {
18
+ let e = await t(s);
19
+ f(e ? "copied" : "failed");
20
+ } catch {
21
+ f("failed");
22
+ }
23
+ }, v = "";
24
+ return d === "copied" ? v = c.requestIdCopied : d === "failed" && (v = c.requestIdCopyFailed), /* @__PURE__ */ g("div", {
25
+ className: e("mt-1 flex min-w-0 items-center gap-1", u),
26
+ children: [
27
+ /* @__PURE__ */ g("span", {
28
+ className: "text-start",
29
+ children: [c.requestId, ":"]
30
+ }),
31
+ /* @__PURE__ */ h("span", {
32
+ dir: "ltr",
33
+ className: "min-w-0 truncate",
34
+ children: s
35
+ }),
36
+ /* @__PURE__ */ h(i, {
37
+ icon: /* @__PURE__ */ h(_, {
38
+ size: n.SM,
39
+ "aria-hidden": !0,
40
+ stroke: r
41
+ }),
42
+ "aria-label": c.copyRequestIdAriaLabel,
43
+ onClick: () => void m()
44
+ }),
45
+ /* @__PURE__ */ h(a, {
46
+ visuallyHidden: !0,
47
+ as: o.Span,
48
+ children: v
49
+ })
50
+ ]
51
+ });
52
+ }, S = c(({ item: e, onDismiss: t, dismissDelayMs: n, labels: r, requestIdClassName: i }) => {
53
+ l(() => {
54
+ if (e.requestId || e.action) return;
55
+ let r = setTimeout(() => t(e.id), n);
56
+ return () => clearTimeout(r);
57
+ }, [
58
+ e.id,
59
+ e.requestId,
60
+ e.action,
61
+ t,
62
+ n
63
+ ]);
64
+ let a = d(() => /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
65
+ className: "max-h-[30vh] overflow-y-auto wrap-anywhere",
66
+ children: e.message
67
+ }), e.requestId && /* @__PURE__ */ h(x, {
68
+ requestId: e.requestId,
69
+ labels: r,
70
+ className: i
71
+ })] }), [
72
+ e.message,
73
+ e.requestId,
74
+ r,
75
+ i
76
+ ]);
77
+ return /* @__PURE__ */ h(s, {
78
+ className: "pointer-events-auto w-full max-w-[min(600px,100%)] desktop:w-auto",
79
+ variant: e.variant,
80
+ title: e.title,
81
+ message: a,
82
+ action: e.action,
83
+ closable: !0,
84
+ closeAriaLabel: r.close,
85
+ onClose: () => t(e.id)
86
+ });
87
+ }), C = c(({ items: e, onDismiss: t, labels: n, dismissDelayMs: r = 5e3, className: i = b, requestIdClassName: a = "dial-tiny-text" }) => {
88
+ let o = f(null), s = f(/* @__PURE__ */ new Set()), c = d(() => ({
89
+ requestId: n?.requestId ?? "Request ID",
90
+ copyRequestIdAriaLabel: n?.copyRequestIdAriaLabel ?? "Copy request ID",
91
+ requestIdCopied: n?.requestIdCopied ?? "Request ID copied",
92
+ requestIdCopyFailed: n?.requestIdCopyFailed ?? "Couldn't copy request ID",
93
+ close: n?.close ?? "Close notification"
94
+ }), [n]);
95
+ return u(() => {
96
+ let t = o.current, n = s.current;
97
+ t && e.some(({ id: e }) => !n.has(e)) && (t.scrollTop = t.scrollHeight), s.current = new Set(e.map(({ id: e }) => e));
98
+ }, [e]), e.length ? v(/* @__PURE__ */ h("div", {
99
+ ref: o,
100
+ className: i,
101
+ children: e.map((e) => /* @__PURE__ */ h(S, {
102
+ item: e,
103
+ onDismiss: t,
104
+ dismissDelayMs: r,
105
+ labels: c,
106
+ requestIdClassName: a
107
+ }, e.id))
108
+ }), document.body) : null;
109
+ });
110
+ //#endregion
111
+ export { C as NotificationStack };
@@ -0,0 +1,32 @@
1
+ import { FC, ReactNode } from 'react';
2
+ /** CSS custom-property overrides for the `PanelEmptyState` component. */
3
+ export interface PanelEmptyStateColors {
4
+ /** Label text color. */
5
+ label?: string;
6
+ /** Description text color. */
7
+ description?: string;
8
+ }
9
+ /** Props for `PanelEmptyState`. */
10
+ export interface PanelEmptyStateProps {
11
+ /** Primary message of the empty state. */
12
+ label: string;
13
+ /** Secondary line under the label, e.g. what to do next. */
14
+ description?: string;
15
+ /** Optional way forward, such as a button, rendered under the text. */
16
+ action?: ReactNode;
17
+ /** Color overrides applied as CSS custom properties. */
18
+ colors?: PanelEmptyStateColors;
19
+ /** CSS class applied to the label text, on top of the kit's title typography. */
20
+ labelClassName?: string;
21
+ /** CSS class applied to the description text, on top of the kit's description typography. */
22
+ descriptionClassName?: string;
23
+ /** CSS class applied to the empty-state container. */
24
+ containerClassName?: string;
25
+ /** Decorative illustration above the label. Defaults to the kit's `NoDataContent` illustration. */
26
+ icon?: ReactNode;
27
+ /** Announces the empty state to assistive tech as it appears, e.g. after a search. */
28
+ live?: boolean;
29
+ }
30
+ /** Centered empty-state block for use inside a sidebar panel body. */
31
+ export declare const PanelEmptyState: FC<PanelEmptyStateProps>;
32
+ //# sourceMappingURL=PanelEmptyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelEmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelEmptyState.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtD,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6FAA6F;IAC7F,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mGAAmG;IACnG,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,sFAAsF;IACtF,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,sEAAsE;AACtE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAmCpD,CAAC"}
@@ -5,14 +5,24 @@ import { NoDataContent as r } from "@epam/ai-dial-ui-kit";
5
5
  import { memo as i } from "react";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
7
  //#region src/components/PanelEmptyState/PanelEmptyState.tsx
8
- var o = i(({ label: i, colors: o, labelClassName: s = "dial-tiny-text", containerClassName: c, icon: l }) => /* @__PURE__ */ a("div", {
9
- style: t({ "--pes-label-color": o?.label }),
10
- children: /* @__PURE__ */ a(r, {
11
- title: i,
12
- icon: l,
13
- titleClassName: e(n.label, s),
14
- className: c
15
- })
16
- }));
8
+ var o = i(({ label: i, description: o, action: s, colors: c, labelClassName: l, descriptionClassName: u, containerClassName: d, icon: f, live: p }) => {
9
+ let m = t({
10
+ "--pes-label-color": c?.label,
11
+ "--pes-description-color": c?.description
12
+ });
13
+ return /* @__PURE__ */ a("div", {
14
+ style: m,
15
+ children: /* @__PURE__ */ a(r, {
16
+ title: i,
17
+ description: o,
18
+ action: s,
19
+ icon: f,
20
+ live: p,
21
+ titleClassName: e(n.label, l),
22
+ descriptionClassName: e(n.description, u),
23
+ className: d
24
+ })
25
+ });
26
+ });
17
27
  //#endregion
18
28
  export { o as PanelEmptyState };
@@ -1,3 +1,7 @@
1
- var e = { label: "_label_12p89_1" };
1
+ //#region src/components/PanelEmptyState/PanelEmptyState.module.scss
2
+ var e = "_label_1qwvo_1", t = "_description_1qwvo_5", n = {
3
+ label: e,
4
+ description: t
5
+ };
2
6
  //#endregion
3
- export { e as default };
7
+ export { n as default, t as description, e as label };
@@ -0,0 +1,49 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { EntityHeaderItem } from '../../models/entity';
3
+ /** CSS custom-property overrides for the `ResourceSummary` row. */
4
+ export interface ResourceSummaryColors {
5
+ /** Row border color. Defaults to `--stroke-tertiary`. */
6
+ border?: string;
7
+ /** Row background color. Defaults to `--bg-layer-sunken`. */
8
+ background?: string;
9
+ /** Version tag border color. Defaults to `--stroke-tertiary`. */
10
+ versionTagBorder?: string;
11
+ /** Version tag background color. Defaults to `--bg-control-accent-alpha`. */
12
+ versionTagBackground?: string;
13
+ /** Version tag text color. Defaults to `--text-accent`. */
14
+ versionTagText?: string;
15
+ }
16
+ /** Typography overrides for the `ResourceSummary` row. */
17
+ export interface ResourceSummaryTypography {
18
+ /** Typography class applied to the version tag. Defaults to `'dial-tiny-text'`. */
19
+ versionTagClassName?: string;
20
+ }
21
+ /** Style overrides for `ResourceSummary`. */
22
+ export interface ResourceSummaryStyles {
23
+ /** Color overrides applied as CSS custom properties. */
24
+ colors?: ResourceSummaryColors;
25
+ /** Typography class overrides. */
26
+ typography?: ResourceSummaryTypography;
27
+ }
28
+ /** Props for `ResourceSummary`. */
29
+ export interface ResourceSummaryProps {
30
+ /** Entity shown in the row as an icon, type label, name, and version tag. Ignored when `children` is set. */
31
+ item?: EntityHeaderItem;
32
+ /** Row content rendered instead of the entity header and version tag. */
33
+ children?: ReactNode;
34
+ /** Version tag text; `{version}` is replaced with `item.version`. The tag is omitted when `item.version` is empty. Defaults to `'Version {version} · current'`. */
35
+ versionLabel?: string;
36
+ /** Whether the version is shown as a trailing tag. When `false` it is shown inline after the name instead. Defaults to `true`. */
37
+ hasVersionTag?: boolean;
38
+ /** Size of the entity icon. Defaults to `40`. */
39
+ iconSize?: number;
40
+ /** CSS class applied to the row. */
41
+ className?: string;
42
+ /** Style overrides. */
43
+ styles?: ResourceSummaryStyles;
44
+ /** Color overrides applied as CSS custom properties. Prefer `styles.colors`. */
45
+ colors?: ResourceSummaryColors;
46
+ }
47
+ /** Bordered summary row pairing an entity's identity block with its current-version tag. */
48
+ export declare const ResourceSummary: FC<ResourceSummaryProps>;
49
+ //# sourceMappingURL=ResourceSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceSummary.d.ts","sourceRoot":"","sources":["../../../src/components/ResourceSummary/ResourceSummary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D,mEAAmE;AACnE,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,0DAA0D;AAC1D,MAAM,WAAW,yBAAyB;IACxC,mFAAmF;IACnF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,6CAA6C;AAC7C,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,kCAAkC;IAClC,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACxC;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,6GAA6G;IAC7G,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mKAAmK;IACnK,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kIAAkI;IAClI,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,gFAAgF;IAChF,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED,4FAA4F;AAC5F,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA2DpD,CAAC"}
@@ -1,6 +1,7 @@
1
- var e = {
2
- row: "_row_1csuq_1",
3
- versionTag: "_versionTag_1csuq_7"
1
+ //#region src/components/ResourceSummary/ResourceSummary.module.scss
2
+ var e = "_row_1csuq_1", t = "_versionTag_1csuq_7", n = {
3
+ row: e,
4
+ versionTag: t
4
5
  };
5
6
  //#endregion
6
- export { e as default };
7
+ export { n as default, e as row, t as versionTag };
@@ -0,0 +1,33 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { TextRefinementResult } from '../../hooks/useTextRefinement';
3
+ import { TextRefinementLabels } from '../../models/text-refinement';
4
+ /** Props for `TextRefinementField`. */
5
+ export interface TextRefinementFieldProps {
6
+ /** When false, renders `children` alone — no label row, actions, or feedback. */
7
+ isEnabled: boolean;
8
+ /** Id of the labelled control; also the prefix for the label and error ids. */
9
+ fieldId: string;
10
+ /** Visible field label; names the group. */
11
+ label: string;
12
+ /** Class applied to the `<label>`, after the kit `Label` defaults. */
13
+ labelClassName?: string;
14
+ /** Marks the label as required. */
15
+ required?: boolean;
16
+ /** Action, status, and error copy. */
17
+ labels?: TextRefinementLabels;
18
+ /** The field's `useTextRefinement` result. */
19
+ refinement: TextRefinementResult;
20
+ /** Disables both actions. */
21
+ disabled: boolean;
22
+ /** Class applied to the status message and the error message. */
23
+ feedbackClassName?: string;
24
+ /** Class applied to the error message, after `feedbackClassName`. */
25
+ errorClassName?: string;
26
+ /** Caption shown at the end of the row below the control, beside the refinement status — e.g. a character counter. */
27
+ caption?: string;
28
+ /** The refinable control, whose id must equal `fieldId`; it is made read-only while a request is pending. */
29
+ children: ReactNode;
30
+ }
31
+ /** Label row with Refine, Restore original and Regenerate actions and live feedback around one refinable field. */
32
+ export declare const TextRefinementField: FC<TextRefinementFieldProps>;
33
+ //# sourceMappingURL=TextRefinementField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextRefinementField.d.ts","sourceRoot":"","sources":["../../../src/components/TextRefinementField/TextRefinementField.tsx"],"names":[],"mappings":"AAYA,OAAO,EAA2B,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,uCAAuC;AACvC,MAAM,WAAW,wBAAwB;IACvC,iFAAiF;IACjF,SAAS,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8CAA8C;IAC9C,UAAU,EAAE,oBAAoB,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sHAAsH;IACtH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6GAA6G;IAC7G,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,mHAAmH;AACnH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA2K5D,CAAC"}
@@ -1,86 +1,115 @@
1
1
  import { mergeClasses as e } from "../../utils/merge-class.js";
2
2
  import { TextRefinementState as t } from "../../hooks/useTextRefinement.js";
3
- import { CaptionText as n, DIAL_ICON_SIZE as r, DIAL_KIT_ICON_STROKE as i, ElementSize as a, ErrorText as o, GhostButton as s, Label as c, Spinner as l } from "@epam/ai-dial-ui-kit";
4
- import { useRef as u } from "react";
5
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
6
- import { IconSparkles as m } from "@tabler/icons-react";
3
+ import { CaptionText as n, DIAL_ICON_SIZE as r, DIAL_KIT_ICON_STROKE as i, ElementSize as a, ErrorText as o, GhostButton as s, Label as c, LiveRegionPoliteness as l, Spinner as u } from "@epam/ai-dial-ui-kit";
4
+ import { useLayoutEffect as d, useRef as f } from "react";
5
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
6
+ import { IconRestore as g, IconSparkles as _ } from "@tabler/icons-react";
7
7
  //#region src/components/TextRefinementField/TextRefinementField.tsx
8
- var h = ({ isEnabled: h, fieldId: g, label: _, labelClassName: v, required: y, labels: b, refinement: x, disabled: S, feedbackClassName: C, errorClassName: w, children: T }) => {
9
- let E = u(null);
10
- if (!h) return /* @__PURE__ */ f(d, { children: T });
11
- let D = x.state === t.Error, O = {
8
+ var v = ({ isEnabled: v, fieldId: y, label: b, labelClassName: x, required: S, labels: C, refinement: w, disabled: T, feedbackClassName: E, errorClassName: D, caption: O, children: k }) => {
9
+ let A = f(null), j = f(null), M = v && w.isPending;
10
+ d(() => {
11
+ if (!M) return;
12
+ let e = Array.from(j.current?.querySelectorAll("input, textarea") ?? []).find((e) => e.id === y);
13
+ if (!e) return;
14
+ let t = e.readOnly;
15
+ return e.readOnly = !0, () => {
16
+ e.readOnly = t;
17
+ };
18
+ }, [M, y]);
19
+ let N = O && /* @__PURE__ */ m(n, {
20
+ text: O,
21
+ className: "ms-auto shrink-0 text-end"
22
+ });
23
+ if (!v) return N ? /* @__PURE__ */ h("div", {
24
+ className: "flex min-w-0 flex-col gap-1",
25
+ children: [k, N]
26
+ }) : /* @__PURE__ */ m(p, { children: k });
27
+ let P = w.state === t.Error, F = w.canUndo, I = C?.refineWithAiLabel ?? "Refine with AI";
28
+ M ? I = C?.refineRefiningLabel ?? "Refining" : F && (I = C?.refineRegenerateLabel ?? "Regenerate");
29
+ let L = w.state === t.Pending || w.state === t.Success || w.state === t.Restored, R = {
12
30
  [t.Idle]: "",
13
- [t.Pending]: b?.refinePendingAriaLabel ?? "Refining text",
14
- [t.Success]: b?.refineSuccessAriaLabel ?? "Text refined. Undo is available.",
15
- [t.Restored]: b?.refineUndoAriaLabel ?? "Original text restored.",
16
- [t.Unchanged]: b?.refineUnchangedAriaLabel ?? "No changes were needed.",
31
+ [t.Pending]: C?.refinePendingAriaLabel ?? "Refining text",
32
+ [t.Success]: C?.refineSuccessAriaLabel ?? "Text refined",
33
+ [t.Restored]: C?.refineUndoAriaLabel ?? "Original text restored.",
34
+ [t.Unchanged]: C?.refineUnchangedAriaLabel ?? "No changes were needed.",
17
35
  [t.Error]: ""
18
- }[x.state];
19
- return /* @__PURE__ */ p("div", {
36
+ }[w.state];
37
+ return /* @__PURE__ */ h("div", {
20
38
  className: "flex min-w-0 flex-col gap-1",
21
39
  role: "group",
22
- "aria-labelledby": g + "-label",
23
- "aria-describedby": D ? g + "-refinement-error" : void 0,
40
+ "aria-labelledby": y + "-label",
41
+ "aria-describedby": P ? y + "-refinement-error" : void 0,
24
42
  children: [
25
- /* @__PURE__ */ p("div", {
43
+ /* @__PURE__ */ h("div", {
26
44
  className: "flex min-w-0 flex-wrap items-center gap-x-3",
27
- children: [/* @__PURE__ */ f(c, {
28
- id: g + "-label",
29
- htmlFor: g,
30
- className: v,
31
- label: _,
32
- required: y
33
- }), /* @__PURE__ */ p("div", {
34
- ref: E,
45
+ children: [/* @__PURE__ */ m(c, {
46
+ id: y + "-label",
47
+ htmlFor: y,
48
+ className: x,
49
+ label: b,
50
+ required: S
51
+ }), /* @__PURE__ */ h("div", {
52
+ ref: A,
35
53
  className: "ms-auto flex min-w-0 flex-wrap items-center",
36
- children: [/* @__PURE__ */ f(s, {
54
+ children: [F && !M && /* @__PURE__ */ m(s, {
37
55
  size: a.Small,
38
- label: b?.refineWithAiLabel ?? "Refine with AI",
39
- disabled: S || !x.canRefine,
56
+ label: C?.refineUndoLabel ?? "Restore original",
57
+ disabled: T,
40
58
  onClick: () => {
41
- x.refine();
59
+ w.undo();
60
+ let e = A.current?.querySelectorAll("button");
61
+ e?.[e.length - 1]?.focus();
42
62
  },
43
- iconBefore: x.isPending ? /* @__PURE__ */ f("span", {
63
+ iconBefore: /* @__PURE__ */ m(g, {
64
+ size: r.SM,
65
+ stroke: i,
66
+ "aria-hidden": !0
67
+ })
68
+ }), /* @__PURE__ */ m(s, {
69
+ size: a.Small,
70
+ label: I,
71
+ disabled: T || !w.canRefine,
72
+ onClick: () => {
73
+ w.refine();
74
+ },
75
+ iconBefore: M ? /* @__PURE__ */ m("span", {
44
76
  "aria-hidden": !0,
45
- children: /* @__PURE__ */ f(l, {
77
+ children: /* @__PURE__ */ m(u, {
46
78
  size: r.SM,
47
79
  ariaLabel: ""
48
80
  })
49
- }) : /* @__PURE__ */ f(m, {
81
+ }) : /* @__PURE__ */ m(_, {
50
82
  size: r.SM,
51
83
  stroke: i,
52
84
  "aria-hidden": !0
53
85
  })
54
- }), x.canUndo && /* @__PURE__ */ f(s, {
55
- size: a.Small,
56
- label: b?.refineUndoLabel ?? "Undo",
57
- disabled: S,
58
- onClick: () => {
59
- x.undo(), E.current?.querySelector("button")?.focus();
60
- }
61
86
  })]
62
87
  })]
63
88
  }),
64
- /* @__PURE__ */ f("div", {
65
- "aria-busy": x.isPending,
66
- children: T
89
+ /* @__PURE__ */ m("div", {
90
+ ref: j,
91
+ "aria-busy": w.isPending,
92
+ children: k
67
93
  }),
68
- /* @__PURE__ */ f("div", {
69
- role: "status",
70
- "aria-live": "polite",
71
- children: /* @__PURE__ */ f(n, {
72
- text: O,
73
- className: C
74
- })
94
+ /* @__PURE__ */ h("div", {
95
+ className: "flex min-w-0 items-start gap-3",
96
+ children: [/* @__PURE__ */ m("div", {
97
+ className: "min-w-0 flex-1",
98
+ children: /* @__PURE__ */ m(n, {
99
+ text: R,
100
+ announce: l.Polite,
101
+ className: e(E, L && "sr-only")
102
+ })
103
+ }), N]
75
104
  }),
76
- D && /* @__PURE__ */ f(o, {
77
- role: "alert",
78
- id: g + "-refinement-error",
79
- className: e(C, w),
80
- text: b?.refineErrorLabel ?? "Could not refine this text. Please try again."
105
+ /* @__PURE__ */ m(o, {
106
+ id: y + "-refinement-error",
107
+ announce: l.Assertive,
108
+ className: e(E, D),
109
+ text: P ? C?.refineErrorLabel ?? "Could not refine this text. Please try again." : ""
81
110
  })
82
111
  ]
83
112
  });
84
113
  };
85
114
  //#endregion
86
- export { h as TextRefinementField };
115
+ export { v as TextRefinementField };
@@ -0,0 +1,22 @@
1
+ import { FC, ReactNode } from 'react';
2
+ /** User-visible strings of the unsaved-changes dialog. */
3
+ export interface UnsavedChangesLabels {
4
+ /** Dialog title, which also names the dialog. Defaults to `'Discard unsaved changes?'`. */
5
+ title?: string;
6
+ /** Dialog message. Defaults to `'You have unsaved changes. Leaving now will discard them.'`. */
7
+ message?: string;
8
+ /** Label of the discarding action. Defaults to `'Discard changes'`. */
9
+ confirmLabel?: string;
10
+ /** Label of the action that keeps the edits. Defaults to `'Keep editing'`. */
11
+ cancelLabel?: string;
12
+ }
13
+ /** Props for `UnsavedChangesProvider`. */
14
+ export interface UnsavedChangesProviderProps {
15
+ /** Subtree whose forms and exits share the dialog. */
16
+ children: ReactNode;
17
+ /** User-visible strings of the dialog; each missing field keeps its English default. */
18
+ labels?: UnsavedChangesLabels;
19
+ }
20
+ /** Owns the single "Discard unsaved changes?" dialog and the dirty state of the one guarded form mounted below it. */
21
+ export declare const UnsavedChangesProvider: FC<UnsavedChangesProviderProps>;
22
+ //# sourceMappingURL=UnsavedChangesProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnsavedChangesProvider.d.ts","sourceRoot":"","sources":["../../../src/components/UnsavedChangesProvider/UnsavedChangesProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAQf,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AASD,0CAA0C;AAC1C,MAAM,WAAW,2BAA2B;IAC1C,sDAAsD;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB,wFAAwF;IACxF,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED,sHAAsH;AACtH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAiFlE,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { ConfirmationDialog as e } from "../ConfirmationDialog/ConfirmationDialog.js";
2
+ import { UnsavedChangesContext as t, UnsavedChangesInternalContext as n } from "./unsaved-changes-context.js";
3
+ import { ConfirmationPopupVariant as r } from "@epam/ai-dial-ui-kit";
4
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ //#region src/components/UnsavedChangesProvider/UnsavedChangesProvider.tsx
7
+ var d = {
8
+ title: "Discard unsaved changes?",
9
+ message: "You have unsaved changes. Leaving now will discard them.",
10
+ confirmLabel: "Discard changes",
11
+ cancelLabel: "Keep editing"
12
+ }, f = ({ children: f, labels: p }) => {
13
+ let [m, h] = c(!1), [g, _] = c(null), v = s(!1), y = {
14
+ title: p?.title ?? d.title,
15
+ message: p?.message ?? d.message,
16
+ confirmLabel: p?.confirmLabel ?? d.confirmLabel,
17
+ cancelLabel: p?.cancelLabel ?? d.cancelLabel
18
+ };
19
+ a(() => () => {
20
+ v.current = !1;
21
+ }, []);
22
+ let b = i((e) => (h(e), () => h(!1)), []), x = i((e) => (v.current = !1, _(e), () => _((t) => t === e ? null : t)), []), S = i((e) => {
23
+ x({
24
+ onDiscard: e,
25
+ shouldAllowUnload: !0
26
+ });
27
+ }, [x]), C = () => {
28
+ g && (_(null), g.shouldAllowUnload && (v.current = !0), g.onDiscard());
29
+ }, w = () => {
30
+ g && (_(null), g.onKeep?.());
31
+ }, T = o(() => ({
32
+ hasUnsavedChanges: m,
33
+ requestDiscard: S
34
+ }), [m, S]), E = o(() => ({
35
+ register: b,
36
+ open: x,
37
+ unloadAllowedRef: v
38
+ }), [b, x]);
39
+ return /* @__PURE__ */ l(n.Provider, {
40
+ value: E,
41
+ children: /* @__PURE__ */ u(t.Provider, {
42
+ value: T,
43
+ children: [f, /* @__PURE__ */ l(e, {
44
+ open: g != null,
45
+ title: y.title,
46
+ message: y.message,
47
+ confirmLabel: y.confirmLabel,
48
+ cancelLabel: y.cancelLabel,
49
+ variant: r.Danger,
50
+ onConfirm: C,
51
+ onClose: w
52
+ })]
53
+ })
54
+ });
55
+ };
56
+ //#endregion
57
+ export { f as UnsavedChangesProvider };
@@ -0,0 +1,44 @@
1
+ import { RefObject } from 'react';
2
+ /** Value of {@link useUnsavedChanges}. */
3
+ export interface UnsavedChangesContextValue {
4
+ /** Whether the guarded form reports unsaved changes. `false` when no form is registered. */
5
+ hasUnsavedChanges: boolean;
6
+ /**
7
+ * Opens the unsaved-changes dialog. **Discard changes** allows the next page
8
+ * unload, closes the dialog and runs `onDiscard`; **Keep editing** or any
9
+ * dismissal closes it and runs nothing. Used by exits that are not router
10
+ * transitions, such as Log out.
11
+ */
12
+ requestDiscard: (onDiscard: () => void) => void;
13
+ }
14
+ /** Actions run by the dialog's two outcomes. */
15
+ export interface PendingDiscard {
16
+ /** Runs when the user chooses Discard changes. */
17
+ onDiscard: () => void;
18
+ /** Runs when the user chooses Keep editing or dismisses the dialog. */
19
+ onKeep?: () => void;
20
+ /** Whether confirming lets the next `beforeunload` pass without the native prompt. Defaults to `false`. */
21
+ shouldAllowUnload?: boolean;
22
+ }
23
+ /** Registration and dialog plumbing shared by the provider and the leave-guard hooks. */
24
+ export interface UnsavedChangesInternalContextValue {
25
+ /** Registers the guarded form's dirty state; the returned callback unregisters it. */
26
+ register: (isDirty: boolean) => () => void;
27
+ /**
28
+ * Opens the dialog wired to the given outcomes. The returned callback closes
29
+ * it without running either outcome, and does nothing once the dialog has
30
+ * been answered or another request has replaced it.
31
+ */
32
+ open: (pending: PendingDiscard) => () => void;
33
+ /** Set once a discard has allowed the page to unload; the `beforeunload` listener skips its prompt while it is `true`. */
34
+ unloadAllowedRef: RefObject<boolean>;
35
+ }
36
+ /** Public unsaved-changes state, read through `useUnsavedChanges`. */
37
+ export declare const UnsavedChangesContext: import('react').Context<UnsavedChangesContextValue | undefined>;
38
+ /** Registration and dialog plumbing, read through `useUnsavedChangesInternal`. */
39
+ export declare const UnsavedChangesInternalContext: import('react').Context<UnsavedChangesInternalContextValue | undefined>;
40
+ /** Returns the guarded form's dirty state and the dialog entry point for exits that are not router transitions; throws outside `UnsavedChangesProvider`. */
41
+ export declare const useUnsavedChanges: () => UnsavedChangesContextValue;
42
+ /** Returns the registration and dialog plumbing for the leave-guard hooks; throws outside `UnsavedChangesProvider`. Not re-exported from the package. */
43
+ export declare const useUnsavedChangesInternal: () => UnsavedChangesInternalContextValue;
44
+ //# sourceMappingURL=unsaved-changes-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsaved-changes-context.d.ts","sourceRoot":"","sources":["../../../src/components/UnsavedChangesProvider/unsaved-changes-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,0CAA0C;AAC1C,MAAM,WAAW,0BAA0B;IACzC,4FAA4F;IAC5F,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACjD;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,2GAA2G;IAC3G,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,yFAAyF;AACzF,MAAM,WAAW,kCAAkC;IACjD,sFAAsF;IACtF,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;IAC3C;;;;OAIG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,IAAI,CAAC;IAC9C,0HAA0H;IAC1H,gBAAgB,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CACtC;AAED,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,iEAEtB,CAAC;AAEb,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,yEAE9B,CAAC;AAEb,4JAA4J;AAC5J,eAAO,MAAM,iBAAiB,QAAO,0BAQpC,CAAC;AAEF,yJAAyJ;AACzJ,eAAO,MAAM,yBAAyB,QAChC,kCAQH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { createContext as e, useContext as t } from "react";
2
+ //#region src/components/UnsavedChangesProvider/unsaved-changes-context.ts
3
+ var n = e(void 0), r = e(void 0), i = () => {
4
+ let e = t(n);
5
+ if (!e) throw Error("useUnsavedChanges must be used within an UnsavedChangesProvider");
6
+ return e;
7
+ }, a = () => {
8
+ let e = t(r);
9
+ if (!e) throw Error("The unsaved-changes leave guard must be used within an UnsavedChangesProvider");
10
+ return e;
11
+ };
12
+ //#endregion
13
+ export { n as UnsavedChangesContext, r as UnsavedChangesInternalContext, i as useUnsavedChanges, a as useUnsavedChangesInternal };
@@ -0,0 +1,15 @@
1
+ /** The viewport width (inclusive) where the desktop presentation begins. */
2
+ export declare const DESKTOP_BREAKPOINT_PX = 1280;
3
+ /** The largest viewport width that still renders the mobile/tablet presentation. */
4
+ export declare const MOBILE_MAX_WIDTH_PX: number;
5
+ /** `matchMedia` query matching the desktop band (1280px and wider). */
6
+ export declare const DESKTOP_MEDIA_QUERY = "(min-width: 1280px)";
7
+ /** `matchMedia` query matching the mobile/tablet band (up to 1279px). */
8
+ export declare const MOBILE_MEDIA_QUERY = "(max-width: 1279px)";
9
+ /** Inclusive boundary for anchored menus and bounded tablet panels, independent of layout. */
10
+ export declare const TABLET_BREAKPOINT_PX = 768;
11
+ /** Phone menu presentation, including fractional widths below 768px. */
12
+ export declare const PHONE_MEDIA_QUERY = "(width < 768px)";
13
+ /** Bounded overlays without changing the app's mobile layout policy. */
14
+ export declare const TABLET_MEDIA_QUERY = "(768px <= width < 1280px)";
15
+ //# sourceMappingURL=breakpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../../src/constants/breakpoint.ts"],"names":[],"mappings":"AAKA,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,QAA4B,CAAC;AAE7D,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,wBAA4C,CAAC;AAE7E,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,wBAA0C,CAAC;AAE1E,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,oBAAwC,CAAC;AAEvE,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,8BAAsE,CAAC"}