@epam/ai-dial-editor-builder 1.1.0-dev.391

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,5 @@
1
+ import { FC } from 'react';
2
+ import { AddAvatarProps } from '../../models/add-avatar-props';
3
+ /** Avatar preview box with an "Add avatar" button and a format/size caption, for entity-icon editing flows. */
4
+ export declare const AddAvatar: FC<AddAvatarProps>;
5
+ //# sourceMappingURL=AddAvatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/AddAvatar/AddAvatar.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGpE,+GAA+G;AAC/G,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAmExC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { EditorLayoutProps } from '../../models/editor-layout-props';
3
+ /**
4
+ * Two-column editor shell with a header row (back button, title, actions).
5
+ * On mobile/tablet, `actions` move out of the header into a dedicated bar
6
+ * pinned to the bottom of the page, outside the scrollable body.
7
+ */
8
+ export declare const EditorLayout: FC<EditorLayoutProps>;
9
+ //# sourceMappingURL=EditorLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorLayout.d.ts","sourceRoot":"","sources":["../../../src/components/EditorLayout/EditorLayout.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAS,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAG1E;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+F9C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { EditorSectionProps } from '../../models/editor-section-props';
3
+ /** Bordered card wrapper for a named section inside an editor layout. */
4
+ export declare const EditorSection: FC<EditorSectionProps>;
5
+ //# sourceMappingURL=EditorSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorSection.d.ts","sourceRoot":"","sources":["../../../src/components/EditorSection/EditorSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAG5E,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA0BhD,CAAC"}
package/index.css ADDED
@@ -0,0 +1,2 @@
1
+ ._section_l1mnx_1{border-color:var(--es-border-color,var(--stroke-tertiary,#e0e6f0))}._title_l1mnx_5{color:var(--es-title-color,var(--text-primary,#161b2d))}._headerBorder_1kidu_1{border-bottom-color:var(--el-header-border-color,var(--stroke-tertiary,#e0e6f0))}._footerBorder_1kidu_5{border-top-color:var(--el-header-border-color,var(--stroke-tertiary,#e0e6f0))}._sidebarBorder_1kidu_9{border-inline-end-color:var(--el-sidebar-border-color,var(--stroke-tertiary,#e0e6f0))}._box_c9as8_1{background:var(--aa-box-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--aa-box-border,var(--stroke-tertiary,#e0e6f0))}._icon_c9as8_6{color:var(--aa-icon,var(--text-secondary,#57647a))}._caption_c9as8_10{color:var(--aa-caption,var(--text-tertiary,#848e9c))}
2
+ /*$vite$:1*/
package/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export type { EditorSectionProps, EditorSectionStyles, } from './models/editor-section-props';
2
+ export type { EditorLayoutProps, EditorLayoutLabels, EditorLayoutStyles, } from './models/editor-layout-props';
3
+ export type { AddAvatarProps, AddAvatarColors, AddAvatarStyles, } from './models/add-avatar-props';
4
+ export { EditorSection } from './components/EditorSection/EditorSection';
5
+ export { EditorLayout } from './components/EditorLayout/EditorLayout';
6
+ export { AddAvatar } from './components/AddAvatar/AddAvatar';
7
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC"}
package/index.js ADDED
@@ -0,0 +1,130 @@
1
+ import { buildCssVars as e, mergeClasses as t } from "@epam/ai-dial-chat-shared";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { DIAL_ICON_SIZE as i, DIAL_KIT_ICON_STROKE as a, ElementSize as o, GhostIconButton as s, Label as c, LinkButton as l } from "@epam/ai-dial-ui-kit";
4
+ import { IconArrowNarrowLeft as u, IconPhoto as d, IconPlus as f } from "@tabler/icons-react";
5
+ import { useId as p } from "react";
6
+ var m = {
7
+ section: "_section_l1mnx_1",
8
+ title: "_title_l1mnx_5"
9
+ }, h = ({ title: i, children: a, styles: o, className: s }) => {
10
+ let c = e({
11
+ "--es-border-color": o?.colors?.borderColor,
12
+ "--es-title-color": o?.colors?.titleColor
13
+ });
14
+ return /* @__PURE__ */ r("section", {
15
+ className: t("flex flex-col gap-4 rounded border p-6", m.section, s),
16
+ style: c,
17
+ children: [i != null && /* @__PURE__ */ n("h2", {
18
+ className: t("dial-h3-text", m.title),
19
+ children: i
20
+ }), a]
21
+ });
22
+ }, g = {
23
+ headerBorder: "_headerBorder_1kidu_1",
24
+ footerBorder: "_footerBorder_1kidu_5",
25
+ sidebarBorder: "_sidebarBorder_1kidu_9"
26
+ }, _ = ({ title: o, onBack: c, backAriaLabel: l = "Back", actions: d, leftContent: f, rightContent: m, isSaving: h = !1, labels: _, styles: v, dir: y }) => {
27
+ let b = p(), x = h ? _?.savingStatusLabel ?? "Saving" : "";
28
+ return /* @__PURE__ */ r("div", {
29
+ dir: y,
30
+ className: "flex min-h-0 flex-1 flex-col",
31
+ style: e({
32
+ "--el-header-border-color": v?.colors?.headerBorderColor,
33
+ "--el-sidebar-border-color": v?.colors?.sidebarBorderColor
34
+ }),
35
+ children: [
36
+ /* @__PURE__ */ n("span", {
37
+ role: "status",
38
+ "aria-live": "polite",
39
+ className: "sr-only",
40
+ id: b,
41
+ children: x
42
+ }),
43
+ /* @__PURE__ */ r("div", {
44
+ className: t("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", g.headerBorder),
45
+ children: [/* @__PURE__ */ r("div", {
46
+ className: "flex min-w-0 flex-1 items-center gap-2",
47
+ children: [/* @__PURE__ */ n(s, {
48
+ icon: /* @__PURE__ */ n(u, {
49
+ size: i.LG,
50
+ stroke: a,
51
+ "aria-hidden": !0,
52
+ className: "rtl:scale-x-[-1]"
53
+ }),
54
+ "aria-label": l,
55
+ onClick: c
56
+ }), /* @__PURE__ */ n("h1", {
57
+ className: "dial-h2-text min-w-0 truncate",
58
+ children: o
59
+ })]
60
+ }), d != null && /* @__PURE__ */ n("div", {
61
+ className: "hidden shrink-0 items-center gap-2 desktop:flex",
62
+ children: d
63
+ })]
64
+ }),
65
+ /* @__PURE__ */ r("div", {
66
+ className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
67
+ children: [/* @__PURE__ */ n("div", {
68
+ className: t(m == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", m == null ? void 0 : g.sidebarBorder),
69
+ children: f
70
+ }), m != null && /* @__PURE__ */ n("div", {
71
+ className: "desktop:flex-1 desktop:overflow-y-auto",
72
+ children: m
73
+ })]
74
+ }),
75
+ d != null && /* @__PURE__ */ n("div", {
76
+ className: t("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", g.footerBorder),
77
+ children: d
78
+ })
79
+ ]
80
+ });
81
+ }, v = {
82
+ box: "_box_c9as8_1",
83
+ icon: "_icon_c9as8_6",
84
+ caption: "_caption_c9as8_10"
85
+ }, y = ({ label: s, avatarUrl: u, avatarAlt: p = "", addAvatarLabel: m = "Add avatar", captionText: h = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: g, styles: _, className: y }) => {
86
+ let b = e({
87
+ "--aa-box-bg": _?.colors?.boxBackgroundColor,
88
+ "--aa-box-border": _?.colors?.boxBorderColor,
89
+ "--aa-icon": _?.colors?.placeholderIconColor,
90
+ "--aa-caption": _?.colors?.captionColor
91
+ });
92
+ return /* @__PURE__ */ r("div", {
93
+ className: t("flex flex-col gap-2", y),
94
+ style: b,
95
+ children: [/* @__PURE__ */ n(c, { label: s }), /* @__PURE__ */ r("div", {
96
+ className: "flex items-start gap-3",
97
+ children: [/* @__PURE__ */ n("div", {
98
+ className: t("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", v.box),
99
+ children: u ? /* @__PURE__ */ n("img", {
100
+ src: u,
101
+ alt: p,
102
+ className: "h-16 w-16 object-cover"
103
+ }) : /* @__PURE__ */ n(d, {
104
+ size: i.LG,
105
+ stroke: a,
106
+ "aria-hidden": !0,
107
+ className: v.icon
108
+ })
109
+ }), /* @__PURE__ */ r("div", {
110
+ className: "flex flex-col gap-3",
111
+ children: [/* @__PURE__ */ n(l, {
112
+ size: o.Small,
113
+ iconBefore: /* @__PURE__ */ n(f, {
114
+ size: i.SM,
115
+ stroke: a,
116
+ "aria-hidden": !0
117
+ }),
118
+ className: "w-fit",
119
+ label: m,
120
+ onClick: g
121
+ }), /* @__PURE__ */ n("span", {
122
+ className: t("dial-tiny-text", v.caption),
123
+ children: h
124
+ })]
125
+ })]
126
+ })]
127
+ });
128
+ };
129
+ //#endregion
130
+ export { y as AddAvatar, _ as EditorLayout, h as EditorSection };
@@ -0,0 +1,36 @@
1
+ /** CSS custom property overrides for `AddAvatar`. */
2
+ export interface AddAvatarColors {
3
+ /** Background color of the 64x64 preview box shown when no avatar is set. Defaults to `--bg-layer-raised`. */
4
+ boxBackgroundColor?: string;
5
+ /** Border color of the 64x64 preview box. Defaults to `--stroke-tertiary`. */
6
+ boxBorderColor?: string;
7
+ /** Color of the placeholder photo icon shown when no avatar is set. Defaults to `--text-secondary`. */
8
+ placeholderIconColor?: string;
9
+ /** Color of the format/size caption text. Defaults to `--text-tertiary`. */
10
+ captionColor?: string;
11
+ }
12
+ /** Style overrides for `AddAvatar`. */
13
+ export interface AddAvatarStyles {
14
+ /** Color token overrides. */
15
+ colors?: AddAvatarColors;
16
+ }
17
+ /** Props for `AddAvatar`. */
18
+ export interface AddAvatarProps {
19
+ /** Field label rendered above the preview box and button (e.g. `'Avatar'`). */
20
+ label: string;
21
+ /** URL of the currently selected avatar image. When set, it fills the 64x64 preview box instead of the placeholder icon. */
22
+ avatarUrl?: string;
23
+ /** Alt text for the avatar image. Defaults to `''` (decorative — the field label and button already describe the control). */
24
+ avatarAlt?: string;
25
+ /** Label for the "Add avatar" button. Defaults to `'Add avatar'`. */
26
+ addAvatarLabel?: string;
27
+ /** Caption text describing the accepted formats and max size. Defaults to `'PNG, JPG or SVG (max 1 MB)'`. */
28
+ captionText?: string;
29
+ /** Called when the "Add avatar" button is clicked. The host opens its own file picker/manager and, once a file is chosen, passes its URL back in as `avatarUrl`. */
30
+ onAddAvatarClick: () => void;
31
+ /** Style overrides applied via CSS custom properties. */
32
+ styles?: AddAvatarStyles;
33
+ /** Additional CSS class applied to the root element. */
34
+ className?: string;
35
+ }
36
+ //# sourceMappingURL=add-avatar-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-avatar-props.d.ts","sourceRoot":"","sources":["../../src/models/add-avatar-props.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,8GAA8G;IAC9G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,6BAA6B;AAC7B,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,4HAA4H;IAC5H,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8HAA8H;IAC9H,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6GAA6G;IAC7G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oKAAoK;IACpK,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,yDAAyD;IACzD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+ /** Text labels for `EditorLayout`. All strings have English defaults. */
3
+ export interface EditorLayoutLabels {
4
+ /** SR-only text announced while `isSaving` is `true`. Defaults to `'Saving'`. */
5
+ savingStatusLabel?: string;
6
+ }
7
+ /** CSS custom property overrides for `EditorLayout`. */
8
+ export interface EditorLayoutColors {
9
+ /** Bottom border color of the header row. Defaults to `--stroke-tertiary`. */
10
+ headerBorderColor?: string;
11
+ /** Inline-end border color of the left sidebar panel. Defaults to `--stroke-tertiary`. */
12
+ sidebarBorderColor?: string;
13
+ }
14
+ /** Style overrides for `EditorLayout`. */
15
+ export interface EditorLayoutStyles {
16
+ /** Color token overrides. */
17
+ colors?: EditorLayoutColors;
18
+ }
19
+ /** Props for `EditorLayout`. */
20
+ export interface EditorLayoutProps {
21
+ /** Heading text rendered as `<h1>` in the header row. */
22
+ title: string;
23
+ /** Called when the back-arrow button is clicked. */
24
+ onBack: () => void;
25
+ /** Accessible label for the back-arrow button. Defaults to `'Back'`. */
26
+ backAriaLabel?: string;
27
+ /** Inline-end slot in the header row — typically Cancel + Save buttons. */
28
+ actions?: ReactNode;
29
+ /** Left column content (Metadata section at desktop; top on mobile). */
30
+ leftContent?: ReactNode;
31
+ /** Right column content (Setup section at desktop; bottom on mobile). When absent, left content fills full width. */
32
+ rightContent?: ReactNode;
33
+ /** When `true`, the SR-only saving status region announces `labels.savingStatusLabel`. */
34
+ isSaving?: boolean;
35
+ /** Text labels with English defaults. */
36
+ labels?: EditorLayoutLabels;
37
+ /** Style overrides applied via CSS custom properties. */
38
+ styles?: EditorLayoutStyles;
39
+ /** `dir` attribute forwarded to the root element for explicit direction override. */
40
+ dir?: 'ltr' | 'rtl';
41
+ }
42
+ //# sourceMappingURL=editor-layout-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-layout-props.d.ts","sourceRoot":"","sources":["../../src/models/editor-layout-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,gCAAgC;AAChC,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wEAAwE;IACxE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,qHAAqH;IACrH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,yDAAyD;IACzD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,qFAAqF;IACrF,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CACrB"}
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from 'react';
2
+ /** CSS custom property overrides for `EditorSection`. */
3
+ export interface EditorSectionColors {
4
+ /** Border color of the section card. Defaults to `--stroke-tertiary`. */
5
+ borderColor?: string;
6
+ /** Color of the section title heading. Defaults to `--text-primary`. */
7
+ titleColor?: string;
8
+ }
9
+ /** Style overrides for `EditorSection`. */
10
+ export interface EditorSectionStyles {
11
+ /** Color token overrides. */
12
+ colors?: EditorSectionColors;
13
+ }
14
+ /** Props for `EditorSection`. */
15
+ export interface EditorSectionProps {
16
+ /** Optional heading rendered above the section body. */
17
+ title?: string;
18
+ /** Section body content. */
19
+ children?: ReactNode;
20
+ /** Optional style overrides applied via CSS custom properties. */
21
+ styles?: EditorSectionStyles;
22
+ /** Additional CSS class applied to the root element. */
23
+ className?: string;
24
+ }
25
+ //# sourceMappingURL=editor-section-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-section-props.d.ts","sourceRoot":"","sources":["../../src/models/editor-section-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAED,iCAAiC;AACjC,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kEAAkE;IAClE,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@epam/ai-dial-editor-builder",
3
+ "description": "Shared two-column editor layout and section wrapper for DIAL authoring UIs",
4
+ "version": "1.1.0-dev.391",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "main": "./index.js",
8
+ "module": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ "./package.json": "./package.json",
12
+ ".": {
13
+ "types": "./index.d.ts",
14
+ "import": "./index.js",
15
+ "default": "./index.js"
16
+ }
17
+ },
18
+ "peerDependencies": {
19
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.391",
20
+ "@epam/ai-dial-ui-kit": "*",
21
+ "@tabler/icons-react": "^3.0.0",
22
+ "react": "^19.0.0"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/epam/ai-dial-chat.git",
27
+ "directory": "libs/editor-builder"
28
+ }
29
+ }