@epam/ai-dial-ui-kit 0.16.0-dev.62 → 0.16.0-dev.66

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.
@@ -0,0 +1,67 @@
1
+ import { jsxs as E, Fragment as g, jsx as e } from "react/jsx-runtime";
2
+ import { IconAlertTriangle as I } from "@tabler/icons-react";
3
+ import { useState as v, useRef as A, useEffect as L, Component as S } from "react";
4
+ import { DIAL_KIT_ICON_STROKE as _ } from "../constants/icon.js";
5
+ import { DIAL_ICON_SIZE as D } from "../../../constants/icon.js";
6
+ import { LiveRegionPoliteness as O } from "../../../types/live-region.js";
7
+ import { PrimaryButton as F } from "../Button/ButtonWrappers.js";
8
+ import { LiveRegion as T } from "../LiveRegion/LiveRegion.js";
9
+ import { StateScreen as j } from "../StateScreen/StateScreen.js";
10
+ class x extends S {
11
+ state = { hasError: !1 };
12
+ static getDerivedStateFromError = () => ({ hasError: !0 });
13
+ componentDidCatch(r, o) {
14
+ this.props.onCatch(r, o);
15
+ }
16
+ render() {
17
+ return this.state.hasError ? null : this.props.children;
18
+ }
19
+ }
20
+ const N = /* @__PURE__ */ e(I, { size: D.LG, stroke: _ }), R = (t = [], r = []) => t.length !== r.length || t.some((o, i) => !Object.is(o, r[i])), K = ({
21
+ children: t,
22
+ title: r,
23
+ description: o,
24
+ actionLabel: i,
25
+ onReset: c,
26
+ resetKeys: n,
27
+ onError: m,
28
+ icon: h = N,
29
+ className: f
30
+ }) => {
31
+ const [s, a] = v(!1), l = A(n);
32
+ L(() => {
33
+ s && R(l.current, n) && a(!1), l.current = n;
34
+ }, [s, n]);
35
+ const u = (d, C) => {
36
+ a(!0), m?.(d, C);
37
+ }, p = () => {
38
+ if (!c) {
39
+ window.location.reload();
40
+ return;
41
+ }
42
+ c(), a(!1);
43
+ };
44
+ return /* @__PURE__ */ E(g, { children: [
45
+ /* @__PURE__ */ e(T, { politeness: O.Assertive, visuallyHidden: !0, children: s && r }),
46
+ s ? /* @__PURE__ */ e(
47
+ j,
48
+ {
49
+ icon: h,
50
+ title: r,
51
+ description: o,
52
+ className: f,
53
+ action: /* @__PURE__ */ e(
54
+ F,
55
+ {
56
+ autoFocus: !0,
57
+ label: i,
58
+ onClick: p
59
+ }
60
+ )
61
+ }
62
+ ) : /* @__PURE__ */ e(x, { onCatch: u, children: t })
63
+ ] });
64
+ };
65
+ export {
66
+ K as ErrorBoundary
67
+ };
@@ -1,26 +1,31 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { mergeClasses as n } from "../../utils/merge-classes.js";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { mergeClasses as l } from "../../utils/merge-classes.js";
3
3
  import { DIAL_KIT_CLASS as o } from "../../constants/public-class-names.js";
4
- const d = ({
4
+ const f = ({
5
5
  size: e = 40,
6
- className: s,
6
+ className: i,
7
7
  fullWidth: t = !1,
8
- ariaLabel: i = "Loading"
9
- }) => /* @__PURE__ */ r(
8
+ fullScreen: a = !1,
9
+ ariaLabel: n = "Loading",
10
+ focusRef: r
11
+ }) => /* @__PURE__ */ s(
10
12
  "div",
11
13
  {
12
14
  role: "status",
13
- className: n(
15
+ className: l(
14
16
  "flex items-center justify-center",
15
17
  { "size-full": t },
16
- s,
18
+ { "fixed inset-0 z-popup bg-layer-base": a },
19
+ i,
17
20
  o.spinner
18
21
  ),
19
- children: /* @__PURE__ */ r(
22
+ children: /* @__PURE__ */ s(
20
23
  "div",
21
24
  {
25
+ ref: r,
26
+ tabIndex: r ? -1 : void 0,
22
27
  role: "img",
23
- "aria-label": i,
28
+ "aria-label": n,
24
29
  style: { width: e, height: e },
25
30
  className: "rounded-full border-2 border-secondary border-t-accent animate-spin-steps shrink-0"
26
31
  }
@@ -28,5 +33,5 @@ const d = ({
28
33
  }
29
34
  );
30
35
  export {
31
- d as Spinner
36
+ f as Spinner
32
37
  };
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.16.0-dev.62",
3
- "generatedAt": "2026-11-02T12:21:52.558Z",
2
+ "version": "0.16.0-dev.66",
3
+ "generatedAt": "2026-11-02T14:50:07.690Z",
4
4
  "kit": {
5
5
  "name": "@epam/ai-dial-ui-kit",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",
@@ -27,27 +27,46 @@
27
27
  "name": "size",
28
28
  "type": "number",
29
29
  "required": false,
30
- "defaultValue": "40"
30
+ "defaultValue": "40",
31
+ "description": "Ring diameter in px."
31
32
  },
32
33
  {
33
34
  "name": "className",
34
35
  "type": "string",
35
- "required": false
36
+ "required": false,
37
+ "description": "Additional container classes."
36
38
  },
37
39
  {
38
40
  "name": "fullWidth",
39
41
  "type": "boolean",
40
42
  "required": false,
41
- "defaultValue": "false"
43
+ "defaultValue": "false",
44
+ "description": "Stretches the container to its parent's width and height."
45
+ },
46
+ {
47
+ "name": "fullScreen",
48
+ "type": "boolean",
49
+ "required": false,
50
+ "defaultValue": "false",
51
+ "description": "Covers the whole viewport with the ring centred."
42
52
  },
43
53
  {
44
54
  "name": "ariaLabel",
45
55
  "type": "string",
46
56
  "required": false,
47
- "defaultValue": "'Loading'"
57
+ "defaultValue": "'Loading'",
58
+ "description": "Accessible label for screen readers."
59
+ },
60
+ {
61
+ "name": "focusRef",
62
+ "type": "Ref<HTMLDivElement>",
63
+ "required": false,
64
+ "description": "Makes the ring focusable and points this ref at it."
48
65
  }
49
66
  ],
50
- "examples": [],
67
+ "examples": [
68
+ "<Spinner fullScreen size={48} ariaLabel=\"Checking your session…\" />"
69
+ ],
51
70
  "sourceFile": "components/Spinner/Spinner.tsx"
52
71
  },
53
72
  {
@@ -553,6 +572,18 @@
553
572
  "required": false,
554
573
  "defaultValue": "true",
555
574
  "description": "`time` mode only: shows a clock button that opens an hour/minute list popover next to the typeable field"
575
+ },
576
+ {
577
+ "name": "renderTimeField",
578
+ "type": "(props: CalendarTimeFieldRenderProps) => ReactNode",
579
+ "required": false,
580
+ "description": "`datetime` mode only: renders a custom control in place of the popover footer's time field; receives the `\"HH:mm\"` value, `onChange`, `onBlur`, `disabled`, `invalid`, `ariaLabel` and `timezoneLabel`"
581
+ },
582
+ {
583
+ "name": "pickerButtonClassName",
584
+ "type": "string",
585
+ "required": false,
586
+ "description": "`time` mode only: classes merged onto the clock button after its defaults, so a conflicting utility overrides them"
556
587
  }
557
588
  ],
558
589
  "examples": [
@@ -5860,6 +5891,73 @@
5860
5891
  ],
5861
5892
  "sourceFile": "components/New/StateScreen/StateScreen.tsx"
5862
5893
  },
5894
+ {
5895
+ "name": "ErrorBoundary",
5896
+ "category": "Components_2_0",
5897
+ "generation": "2.0",
5898
+ "description": "Catches a render error in its subtree and replaces the subtree with a\nfull-container error screen that has one way out.\naliases: ErrorFallback|CrashScreen|ErrorPage|SomethingWentWrong|RootErrorBoundary\nDesign system 2.0\n\nThe fallback is a `StateScreen` with a warning badge and a `PrimaryButton`\nthat takes focus, since the control the user was on is gone. The crash is\nannounced through an assertive `LiveRegion` that is mounted with the\nboundary, before any error: a region mounted together with its message is\noften not read.\n\nThe button calls `onReset` and renders the children again, or reloads the\npage when `onReset` is omitted. `resetKeys` clears the error without a click.\nLike every React error boundary, it does not catch errors in event handlers,\nasync code or the boundary itself. All text comes from props.",
5899
+ "props": [
5900
+ {
5901
+ "name": "children",
5902
+ "type": "ReactNode",
5903
+ "required": false,
5904
+ "description": "The subtree to guard."
5905
+ },
5906
+ {
5907
+ "name": "title",
5908
+ "type": "ReactNode",
5909
+ "required": true,
5910
+ "description": "Headline of the fallback; also the announcement."
5911
+ },
5912
+ {
5913
+ "name": "description",
5914
+ "type": "ReactNode",
5915
+ "required": false,
5916
+ "description": "Optional line under the title."
5917
+ },
5918
+ {
5919
+ "name": "actionLabel",
5920
+ "type": "string",
5921
+ "required": true,
5922
+ "description": "Text of the recovery button."
5923
+ },
5924
+ {
5925
+ "name": "onReset",
5926
+ "type": "() => void",
5927
+ "required": false,
5928
+ "description": "Recovery handler; the page reloads without one."
5929
+ },
5930
+ {
5931
+ "name": "resetKeys",
5932
+ "type": "readonly unknown[]",
5933
+ "required": false,
5934
+ "description": "Values that clear the error when one of them changes."
5935
+ },
5936
+ {
5937
+ "name": "onError",
5938
+ "type": "(error: unknown, info: ErrorInfo) => void",
5939
+ "required": false,
5940
+ "description": "Called once per caught error."
5941
+ },
5942
+ {
5943
+ "name": "icon",
5944
+ "type": "ReactNode",
5945
+ "required": false,
5946
+ "defaultValue": "DEFAULT_ICON",
5947
+ "description": "Glyph in the fallback badge; `null` drops it."
5948
+ },
5949
+ {
5950
+ "name": "className",
5951
+ "type": "string",
5952
+ "required": false,
5953
+ "description": "Additional CSS classes for the fallback screen."
5954
+ }
5955
+ ],
5956
+ "examples": [
5957
+ "<ErrorBoundary\n title={t('error.title')}\n description={t('error.description')}\n actionLabel={t('error.reload')}\n onError={(error) => logger.error(error)}\n>\n <App />\n</ErrorBoundary>\n\n<ErrorBoundary\n title={t('error.title')}\n actionLabel={t('error.tryAgain')}\n onReset={() => {}}\n resetKeys={[pathname]}\n>\n <SettingsPage />\n</ErrorBoundary>"
5958
+ ],
5959
+ "sourceFile": "components/New/ErrorBoundary/ErrorBoundary.tsx"
5960
+ },
5863
5961
  {
5864
5962
  "name": "LoginScreen",
5865
5963
  "category": "Components_2_0",