@epam/ai-dial-chat-shared 1.3.0-dev.98 → 1.4.0-dev.5

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 (155) 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 +6 -1
  5. package/components/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
  6. package/components/ConfirmationDialog/ConfirmationDialog.js +11 -9
  7. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +5 -4
  8. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +2 -2
  9. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -2
  10. package/components/ConfirmationView/ConfirmationFooter.d.ts.map +1 -1
  11. package/components/ConfirmationView/ConfirmationFooter.js +24 -25
  12. package/components/ConfirmationView/ConfirmationView.d.ts +2 -0
  13. package/components/ConfirmationView/ConfirmationView.d.ts.map +1 -1
  14. package/components/ConfirmationView/ConfirmationView.js +12 -12
  15. package/components/ConfirmationView/ConfirmationView.module.scss.js +6 -5
  16. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts +31 -0
  17. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts.map +1 -0
  18. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js +36 -0
  19. package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts +3 -0
  20. package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts.map +1 -1
  21. package/components/DeleteConfirmationView/DeleteConfirmationView.js +36 -27
  22. package/components/DeleteConfirmationView/DeleteConfirmationView.module.scss.js +5 -4
  23. package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -2
  24. package/components/EntityHeader/EntityHeader.js +1 -1
  25. package/components/InitialsAvatar/InitialsAvatar.d.ts +3 -0
  26. package/components/InitialsAvatar/InitialsAvatar.d.ts.map +1 -1
  27. package/components/InitialsAvatar/InitialsAvatar.js +4 -3
  28. package/components/ItemHeader/ItemHeader.module.scss.js +5 -4
  29. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +6 -2
  30. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +1 -1
  31. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +58 -58
  32. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +9 -8
  33. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +1 -1
  34. package/components/MarkdownRenderer/MarkdownRenderer.d.ts +6 -0
  35. package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -1
  36. package/components/MarkdownRenderer/MarkdownRenderer.js +29 -24
  37. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +9 -8
  38. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +5 -4
  39. package/components/MarkdownRenderer/PlainTextRenderer.js +1 -1
  40. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +4 -0
  41. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +1 -1
  42. package/components/MarkdownRenderer/Table/MarkdownTable.js +68 -63
  43. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +15 -13
  44. package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -2
  45. package/components/MarkdownRenderer/markdown-whitespace.js +2 -6
  46. package/components/NewVersionAlert/NewVersionAlert.d.ts +27 -0
  47. package/components/NewVersionAlert/NewVersionAlert.d.ts.map +1 -0
  48. package/components/NewVersionAlert/NewVersionAlert.js +28 -0
  49. package/components/NewVersionAlert/NewVersionAlert.module.scss.js +4 -0
  50. package/components/NotificationStack/NotificationStack.d.ts +48 -0
  51. package/components/NotificationStack/NotificationStack.d.ts.map +1 -0
  52. package/components/NotificationStack/NotificationStack.js +111 -0
  53. package/components/PanelEmptyState/PanelEmptyState.d.ts +12 -2
  54. package/components/PanelEmptyState/PanelEmptyState.d.ts.map +1 -1
  55. package/components/PanelEmptyState/PanelEmptyState.js +19 -9
  56. package/components/PanelEmptyState/PanelEmptyState.module.scss.js +6 -2
  57. package/components/ResourceSummary/ResourceSummary.module.scss.js +5 -4
  58. package/components/TextRefinementField/TextRefinementField.d.ts +4 -2
  59. package/components/TextRefinementField/TextRefinementField.d.ts.map +1 -1
  60. package/components/TextRefinementField/TextRefinementField.js +84 -55
  61. package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts +22 -0
  62. package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts.map +1 -0
  63. package/components/UnsavedChangesProvider/UnsavedChangesProvider.js +57 -0
  64. package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts +44 -0
  65. package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts.map +1 -0
  66. package/components/UnsavedChangesProvider/unsaved-changes-context.js +13 -0
  67. package/constants/breakpoint.d.ts +6 -0
  68. package/constants/breakpoint.d.ts.map +1 -1
  69. package/constants/breakpoint.js +2 -2
  70. package/conversation-transfer/conversation-transfer-queue.d.ts +16 -0
  71. package/conversation-transfer/conversation-transfer-queue.d.ts.map +1 -0
  72. package/conversation-transfer/conversation-transfer-queue.js +24 -0
  73. package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts +9 -0
  74. package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -1
  75. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +330 -269
  76. package/file-manager/DialFileManagerShell/DialFileManagerShell.module.scss.js +8 -0
  77. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts +7 -0
  78. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts.map +1 -1
  79. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +85 -80
  80. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.module.scss.js +7 -0
  81. package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts +5 -0
  82. package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts.map +1 -1
  83. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +25 -20
  84. package/file-manager/OperationLoaderModal/OperationLoaderModal.module.scss.js +4 -0
  85. package/file-manager/file-manager-controller.d.ts +11 -3
  86. package/file-manager/file-manager-controller.d.ts.map +1 -1
  87. package/file-manager/index.d.ts +1 -0
  88. package/file-manager/index.d.ts.map +1 -1
  89. package/file-manager/labels.d.ts +21 -2
  90. package/file-manager/labels.d.ts.map +1 -1
  91. package/file-manager/shell-styles.d.ts +37 -0
  92. package/file-manager/shell-styles.d.ts.map +1 -0
  93. package/file-manager/upload-batch.d.ts +46 -0
  94. package/file-manager/upload-batch.d.ts.map +1 -1
  95. package/file-manager/upload-batch.js +6 -2
  96. package/file-manager/upload-queue.d.ts +44 -4
  97. package/file-manager/upload-queue.d.ts.map +1 -1
  98. package/file-manager/upload-queue.js +45 -13
  99. package/file-manager.js +4 -4
  100. package/hooks/useAvailableHeightCap.js +1 -1
  101. package/hooks/useControlErrorAssociation.d.ts +3 -0
  102. package/hooks/useControlErrorAssociation.d.ts.map +1 -0
  103. package/hooks/useControlErrorAssociation.js +12 -0
  104. package/hooks/useIsMobile.js +1 -1
  105. package/hooks/useIsPhone.d.ts +3 -0
  106. package/hooks/useIsPhone.d.ts.map +1 -0
  107. package/hooks/useIsPhone.js +13 -0
  108. package/hooks/useIsTablet.d.ts +3 -0
  109. package/hooks/useIsTablet.d.ts.map +1 -0
  110. package/hooks/useIsTablet.js +13 -0
  111. package/hooks/useIsTextClipped.d.ts +26 -0
  112. package/hooks/useIsTextClipped.d.ts.map +1 -0
  113. package/hooks/useIsTextClipped.js +25 -0
  114. package/hooks/useIsVerticallyClamped.d.ts +16 -0
  115. package/hooks/useIsVerticallyClamped.d.ts.map +1 -0
  116. package/hooks/useIsVerticallyClamped.js +20 -0
  117. package/hooks/useTextRefinement.d.ts +1 -1
  118. package/hooks/useTextRefinement.d.ts.map +1 -1
  119. package/hooks/useTextRefinement.js +4 -4
  120. package/hooks/useUnsavedChangesGuard.js +1 -5
  121. package/hooks/useUnsavedChangesLeaveConfirmation.d.ts +12 -0
  122. package/hooks/useUnsavedChangesLeaveConfirmation.d.ts.map +1 -0
  123. package/hooks/useUnsavedChangesLeaveConfirmation.js +22 -0
  124. package/hooks/useUnsavedChangesLeaveGuard.d.ts +24 -0
  125. package/hooks/useUnsavedChangesLeaveGuard.d.ts.map +1 -0
  126. package/hooks/useUnsavedChangesLeaveGuard.js +24 -0
  127. package/index.css +2 -2
  128. package/index.d.ts +15 -0
  129. package/index.d.ts.map +1 -1
  130. package/index.js +93 -78
  131. package/models/auth.d.ts +2 -0
  132. package/models/auth.d.ts.map +1 -1
  133. package/models/chat.d.ts +19 -0
  134. package/models/chat.d.ts.map +1 -1
  135. package/models/conversation-classification.d.ts +5 -0
  136. package/models/conversation-classification.d.ts.map +1 -1
  137. package/models/conversation-classification.js +3 -1
  138. package/models/text-refinement.d.ts +6 -2
  139. package/models/text-refinement.d.ts.map +1 -1
  140. package/package.json +10 -17
  141. package/types/mime-type.d.ts +30 -0
  142. package/types/mime-type.d.ts.map +1 -1
  143. package/types/mime-type.js +1 -1
  144. package/utils/dom.d.ts +8 -0
  145. package/utils/dom.d.ts.map +1 -0
  146. package/utils/dom.js +10 -0
  147. package/utils/format-price.js +10 -10
  148. package/utils/inline-segments.js +1 -1
  149. package/utils/latex.d.ts +4 -3
  150. package/utils/latex.d.ts.map +1 -1
  151. package/utils/latex.js +47 -41
  152. package/utils/message-attachment-to-display.js +1 -1
  153. package/utils/mime-type.js +1 -1
  154. package/utils/prompt-variables.js +5 -9
  155. package/utils/syntax-highlighting.js +8 -8
@@ -1,15 +1,17 @@
1
- var e = {
2
- tableContainer: "_tableContainer_1qw2e_1",
3
- tableContainerLight: "_tableContainerLight_1qw2e_6",
4
- copiedIcon: "_copiedIcon_1qw2e_10",
5
- scrollContainer: "_scrollContainer_1qw2e_14",
6
- tableHeaderCell: "_tableHeaderCell_1qw2e_30",
7
- sectionRow: "_sectionRow_1qw2e_37",
8
- rowDivider: "_rowDivider_1qw2e_41",
9
- row: "_row_1qw2e_41",
10
- tableScrollFadeEnd: "_tableScrollFadeEnd_1qw2e_51",
11
- tableScrollFadeStart: "_tableScrollFadeStart_1qw2e_59",
12
- tableScrollFadeBoth: "_tableScrollFadeBoth_1qw2e_67"
1
+ //#region src/components/MarkdownRenderer/Table/MarkdownTable.module.scss
2
+ var e = "_tableContainer_82t2b_1", t = "_tableContainerLight_82t2b_6", n = "_actions_82t2b_10", r = "_copiedIcon_82t2b_15", i = "_scrollContainer_82t2b_19", a = "_tableHeaderCell_82t2b_35", o = "_sectionRow_82t2b_42", s = "_rowDivider_82t2b_46", c = "_row_82t2b_46", l = "_tableScrollFadeEnd_82t2b_56", u = "_tableScrollFadeStart_82t2b_64", d = "_tableScrollFadeBoth_82t2b_72", f = {
3
+ tableContainer: e,
4
+ tableContainerLight: t,
5
+ actions: n,
6
+ copiedIcon: r,
7
+ scrollContainer: i,
8
+ tableHeaderCell: a,
9
+ sectionRow: o,
10
+ rowDivider: s,
11
+ row: c,
12
+ tableScrollFadeEnd: l,
13
+ tableScrollFadeStart: u,
14
+ tableScrollFadeBoth: d
13
15
  };
14
16
  //#endregion
15
- export { e as default };
17
+ export { n as actions, r as copiedIcon, f as default, c as row, s as rowDivider, i as scrollContainer, o as sectionRow, e as tableContainer, t as tableContainerLight, a as tableHeaderCell, d as tableScrollFadeBoth, l as tableScrollFadeEnd, u as tableScrollFadeStart };
@@ -1,3 +1,4 @@
1
- var e = { tableHeader: "_tableHeader_1qvg8_1" };
1
+ //#region src/components/MarkdownRenderer/Table/TableHeader.module.scss
2
+ var e = "_tableHeader_1qvg8_1", t = { tableHeader: e };
2
3
  //#endregion
3
- export { e as default };
4
+ export { t as default, e as tableHeader };
@@ -1,16 +1,12 @@
1
1
  //#region src/components/MarkdownRenderer/markdown-whitespace.ts
2
- var e = new Set([
2
+ var e = /* @__PURE__ */ new Set([
3
3
  "code",
4
4
  "pre",
5
5
  "math",
6
6
  "script",
7
7
  "style"
8
8
  ]), t = "\xA0", n = / {2,}/g, r = (e) => `${t.repeat(e.length - 1)} `, i = (t) => {
9
- if (t.type === "text" && t.value) {
10
- t.value = t.value.replace(n, r);
11
- return;
12
- }
13
- t.type === "element" && t.tagName && e.has(t.tagName) || t.children?.forEach(i);
9
+ t.type === "text" && t.value ? t.value = t.value.replace(n, r) : t.type === "element" && t.tagName && e.has(t.tagName) || t.children?.forEach(i);
14
10
  }, a = () => (e) => {
15
11
  i(e);
16
12
  };
@@ -0,0 +1,27 @@
1
+ import { FC } from 'react';
2
+ /** User-visible strings of `NewVersionAlert`. */
3
+ export interface NewVersionAlertLabels {
4
+ /** Screen heading. Defaults to `'New version available'`. */
5
+ heading?: string;
6
+ /** Explanation under the heading. Defaults to `'Reload the page to get the latest version.'`. */
7
+ message?: string;
8
+ /** Reload button text. Defaults to `'Reload the page'`. */
9
+ reloadLabel?: string;
10
+ }
11
+ /** CSS custom-property overrides for `NewVersionAlert`. */
12
+ export interface NewVersionAlertColors {
13
+ /** Refresh icon color. Defaults to `--text-accent`. */
14
+ icon?: string;
15
+ }
16
+ /** Props for `NewVersionAlert`. */
17
+ export interface NewVersionAlertProps {
18
+ /** Called when the reload button is activated; the host reloads the page. */
19
+ onReload: () => void;
20
+ /** User-visible strings, each with an English default. */
21
+ labels?: NewVersionAlertLabels;
22
+ /** Color overrides applied as CSS custom properties. */
23
+ colors?: NewVersionAlertColors;
24
+ }
25
+ /** Full-screen prompt shown instead of the app once a newer build has been deployed. */
26
+ export declare const NewVersionAlert: FC<NewVersionAlertProps>;
27
+ //# sourceMappingURL=NewVersionAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NewVersionAlert.d.ts","sourceRoot":"","sources":["../../../src/components/NewVersionAlert/NewVersionAlert.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAItC,iDAAiD;AACjD,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,2DAA2D;AAC3D,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAGD,wFAAwF;AACxF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA6BpD,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { buildCssVars as e } from "../../utils/build-css-vars.js";
2
+ import t from "./NewVersionAlert.module.scss.js";
3
+ import { DIAL_ICON_SIZE as n, DIAL_KIT_ICON_STROKE as r, PrimaryButton as i, StateScreen as a } from "@epam/ai-dial-ui-kit";
4
+ import { memo as o } from "react";
5
+ import { jsx as s } from "react/jsx-runtime";
6
+ import { IconRefresh as c } from "@tabler/icons-react";
7
+ //#region src/components/NewVersionAlert/NewVersionAlert.tsx
8
+ var l = o(({ onReload: o, labels: l, colors: u }) => /* @__PURE__ */ s("div", {
9
+ className: "size-full",
10
+ style: e({ "--nva-icon": u?.icon }),
11
+ children: /* @__PURE__ */ s(a, {
12
+ icon: /* @__PURE__ */ s(c, {
13
+ "aria-hidden": "true",
14
+ size: n.LG,
15
+ stroke: r,
16
+ className: t.icon
17
+ }),
18
+ title: l?.heading ?? "New version available",
19
+ description: l?.message ?? "Reload the page to get the latest version.",
20
+ action: /* @__PURE__ */ s(i, {
21
+ autoFocus: !0,
22
+ label: l?.reloadLabel ?? "Reload the page",
23
+ onClick: o
24
+ })
25
+ })
26
+ }));
27
+ //#endregion
28
+ export { l as NewVersionAlert };
@@ -0,0 +1,4 @@
1
+ //#region src/components/NewVersionAlert/NewVersionAlert.module.scss
2
+ var e = "_icon_18yqy_1", t = { icon: e };
3
+ //#endregion
4
+ export { t as default, e as icon };
@@ -0,0 +1,48 @@
1
+ import { NotificationVariant } from '@epam/ai-dial-ui-kit';
2
+ import { FC, ReactNode } from 'react';
3
+ /** One toast in a `NotificationStack`. */
4
+ export interface NotificationStackItem {
5
+ /** Stable id, handed back to `onDismiss`. */
6
+ id: string;
7
+ /** Kit variant: icon, colour and live-region politeness. */
8
+ variant: NotificationVariant;
9
+ /** Optional heading above the message. */
10
+ title?: string;
11
+ /** Message body. */
12
+ message?: ReactNode;
13
+ /** Optional control at the toast's inline end; an action-bearing toast stays until dismissed. */
14
+ action?: ReactNode;
15
+ /** Trace id shown as a copyable "Request ID" row; a toast carrying one stays until dismissed. */
16
+ requestId?: string;
17
+ }
18
+ /** User-visible strings of `NotificationStack`. */
19
+ export interface NotificationStackLabels {
20
+ /** Label before the request id. Defaults to `'Request ID'`. */
21
+ requestId?: string;
22
+ /** Accessible name of the copy button. Defaults to `'Copy request ID'`. */
23
+ copyRequestIdAriaLabel?: string;
24
+ /** Announcement after a successful copy. Defaults to `'Request ID copied'`. */
25
+ requestIdCopied?: string;
26
+ /** Announcement after a failed copy. Defaults to `"Couldn't copy request ID"`. */
27
+ requestIdCopyFailed?: string;
28
+ /** Accessible name of each toast's close button. Defaults to `'Close notification'`. */
29
+ close?: string;
30
+ }
31
+ /** Props for `NotificationStack`. */
32
+ export interface NotificationStackProps {
33
+ /** Toasts in arrival order; the newest renders last. */
34
+ items: readonly NotificationStackItem[];
35
+ /** Called with a toast's id when it is closed or its dismiss delay ends. */
36
+ onDismiss: (id: string) => void;
37
+ /** User-visible strings, each with an English default. */
38
+ labels?: NotificationStackLabels;
39
+ /** Delay before a plain toast dismisses itself, in milliseconds. Defaults to `5000`. */
40
+ dismissDelayMs?: number;
41
+ /** Classes of the fixed stack, replacing the default bottom-edge (phone) / bottom-end corner (desktop) placement. */
42
+ className?: string;
43
+ /** CSS class applied to the request-id row. Defaults to `'dial-tiny-text'`. */
44
+ requestIdClassName?: string;
45
+ }
46
+ /** Portalled stack of toasts that auto-dismisses plain ones and keeps request-id and action toasts until closed. */
47
+ export declare const NotificationStack: FC<NotificationStackProps>;
48
+ //# sourceMappingURL=NotificationStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationStack.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationStack/NotificationStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAOL,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,OAAO,EAAE,mBAAmB,CAAC;IAC7B,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,iGAAiG;IACjG,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iGAAiG;IACjG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qCAAqC;AACrC,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxC,4EAA4E;IAC5E,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qHAAqH;IACrH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAkJD,oHAAoH;AACpH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAwDxD,CAAC"}
@@ -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 };
@@ -3,19 +3,29 @@ import { FC, ReactNode } from 'react';
3
3
  export interface PanelEmptyStateColors {
4
4
  /** Label text color. */
5
5
  label?: string;
6
+ /** Description text color. */
7
+ description?: string;
6
8
  }
7
9
  /** Props for `PanelEmptyState`. */
8
10
  export interface PanelEmptyStateProps {
9
11
  /** Primary message of the empty state. */
10
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;
11
17
  /** Color overrides applied as CSS custom properties. */
12
18
  colors?: PanelEmptyStateColors;
13
- /** CSS class applied to the label text. Defaults to `'dial-tiny-text'`. */
19
+ /** CSS class applied to the label text, on top of the kit's title typography. */
14
20
  labelClassName?: string;
21
+ /** CSS class applied to the description text, on top of the kit's description typography. */
22
+ descriptionClassName?: string;
15
23
  /** CSS class applied to the empty-state container. */
16
24
  containerClassName?: string;
17
- /** Decorative illustration above the label. Defaults to the kit's `NoDataContent` document mark. */
25
+ /** Decorative illustration above the label. Defaults to the kit's `NoDataContent` illustration. */
18
26
  icon?: ReactNode;
27
+ /** Announces the empty state to assistive tech as it appears, e.g. after a search. */
28
+ live?: boolean;
19
29
  }
20
30
  /** Centered empty-state block for use inside a sidebar panel body. */
21
31
  export declare const PanelEmptyState: FC<PanelEmptyStateProps>;
@@ -1 +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;CAChB;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oGAAoG;IACpG,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,sEAAsE;AACtE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAuBpD,CAAC"}
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 };
@@ -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 };
@@ -23,9 +23,11 @@ export interface TextRefinementFieldProps {
23
23
  feedbackClassName?: string;
24
24
  /** Class applied to the error message, after `feedbackClassName`. */
25
25
  errorClassName?: string;
26
- /** The refinable control, whose id must equal `fieldId`. */
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. */
27
29
  children: ReactNode;
28
30
  }
29
- /** Label row with Refine/Undo actions and live feedback around one refinable field. */
31
+ /** Label row with Refine, Restore original and Regenerate actions and live feedback around one refinable field. */
30
32
  export declare const TextRefinementField: FC<TextRefinementFieldProps>;
31
33
  //# sourceMappingURL=TextRefinementField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextRefinementField.d.ts","sourceRoot":"","sources":["../../../src/components/TextRefinementField/TextRefinementField.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAU,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,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,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,uFAAuF;AACvF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAsG5D,CAAC"}
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"}