@epam/ai-dial-deployment-creation-form 1.1.0-dev.280

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 { DeploymentCreationFormProps } from '../../models/deployment-creation-form';
3
+ /** Controlled field set for deployment creation: name, description, icon URL, version, and topics. */
4
+ export declare const DeploymentCreationForm: FC<DeploymentCreationFormProps>;
5
+ //# sourceMappingURL=DeploymentCreationForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentCreationForm.d.ts","sourceRoot":"","sources":["../../../src/components/DeploymentCreationForm/DeploymentCreationForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAGzF,sGAAsG;AACtG,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAoGlE,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { FC } from 'react';
2
+ import { DeploymentCreationFormLocaleEntry, DeploymentCreationFormLocaleLabels, DeploymentCreationFormLocaleOption } from '../../models/deployment-creation-form';
3
+ /** Props accepted by the `DeploymentLocalesField` component. */
4
+ export interface DeploymentLocalesFieldProps {
5
+ /** Current list of additional (non-primary) locale entries. */
6
+ value: DeploymentCreationFormLocaleEntry[];
7
+ /** Called with the full updated list when the user saves changes in the popup. */
8
+ onChange: (entries: DeploymentCreationFormLocaleEntry[]) => void;
9
+ /** Selectable language options for new/existing rows. Defaults to an empty list (no locales addable). */
10
+ availableLocaleOptions?: DeploymentCreationFormLocaleOption[];
11
+ /** Pre-translated labels for the summary row and popup. */
12
+ labels: DeploymentCreationFormLocaleLabels;
13
+ /** Class applied to the summary row container. */
14
+ className?: string;
15
+ /** Typography and color class applied to the summary text. Defaults to `'dial-body-text text-secondary'`. */
16
+ summaryClassName?: string;
17
+ /** Typography and color class applied to each row's heading. Defaults to `'dial-tiny-lead-text text-secondary'`, which uppercases the label itself. */
18
+ rowLabelClassName?: string;
19
+ /** Color class applied to the required-field asterisk on the per-locale name field. Defaults to `'text-error'`. */
20
+ requiredMarkClassName?: string;
21
+ }
22
+ /** Summary row ("Locales: [DE] Edit") plus the "Add locale" popup for editing additional name/description translations. */
23
+ export declare const DeploymentLocalesField: FC<DeploymentLocalesFieldProps>;
24
+ //# sourceMappingURL=DeploymentLocalesField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentLocalesField.d.ts","sourceRoot":"","sources":["../../../src/components/DeploymentLocalesField/DeploymentLocalesField.tsx"],"names":[],"mappings":"AAcA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,uCAAuC,CAAC;AAE/C,gEAAgE;AAChE,MAAM,WAAW,2BAA2B;IAC1C,+DAA+D;IAC/D,KAAK,EAAE,iCAAiC,EAAE,CAAC;IAC3C,kFAAkF;IAClF,QAAQ,EAAE,CAAC,OAAO,EAAE,iCAAiC,EAAE,KAAK,IAAI,CAAC;IACjE,yGAAyG;IACzG,sBAAsB,CAAC,EAAE,kCAAkC,EAAE,CAAC;IAC9D,2DAA2D;IAC3D,MAAM,EAAE,kCAAkC,CAAC;IAC3C,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6GAA6G;IAC7G,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uJAAuJ;IACvJ,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mHAAmH;IACnH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAeD,4HAA4H;AAC5H,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CA0NlE,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { DeploymentCreationForm } from './components/DeploymentCreationForm/DeploymentCreationForm';
2
+ export { DeploymentLocalesField } from './components/DeploymentLocalesField/DeploymentLocalesField';
3
+ export type { DeploymentLocalesFieldProps } from './components/DeploymentLocalesField/DeploymentLocalesField';
4
+ export type { DeploymentCreationFormFieldErrors, DeploymentCreationFormFieldLabels, DeploymentCreationFormLabels, DeploymentCreationFormLocaleEntry, DeploymentCreationFormLocaleLabels, DeploymentCreationFormLocaleOption, DeploymentCreationFormProps, DeploymentCreationFormStyles, DeploymentCreationFormValues, } from './models/deployment-creation-form';
5
+ export type { DeploymentCreationFormErrorCodes, DeploymentCreationFormValidationOptions, } from './models/validation';
6
+ export { DeploymentCreationFieldErrorCode } from './models/validation';
7
+ export { NAME_PATTERN, VERSION_PATTERN, validateDeploymentCreationFields, } from './utils/validate-deployment-creation-fields';
8
+ //# 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,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,YAAY,EAAE,2BAA2B,EAAE,MAAM,4DAA4D,CAAC;AAC9G,YAAY,EACV,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,gCAAgC,EAChC,uCAAuC,GACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gCAAgC,GACjC,MAAM,6CAA6C,CAAC"}
package/index.js ADDED
@@ -0,0 +1,226 @@
1
+ import { mergeClasses as e } from "@epam/ai-dial-chat-shared";
2
+ import { ButtonAppearance as t, ButtonVariant as n, DIAL_ICON_SIZE as r, DangerIconButton as i, ElementSize as a, Input as o, LinkButton as s, Popup as c, Select as l, TagInput as u, Textarea as d } from "@epam/ai-dial-ui-kit";
3
+ import { useEffect as f, useRef as p, useState as m } from "react";
4
+ import { IconPencil as h, IconPlus as g, IconTrashX as _ } from "@tabler/icons-react";
5
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
6
+ //#region src/components/DeploymentLocalesField/DeploymentLocalesField.tsx
7
+ var x = (e, t, n) => ({
8
+ id: e,
9
+ language: n.find((e) => !t.has(e.code))?.code ?? "",
10
+ name: "",
11
+ description: ""
12
+ }), S = ({ value: u, onChange: S, availableLocaleOptions: C = [], labels: w, className: T, summaryClassName: E = "dial-body-text text-secondary", rowLabelClassName: D = "dial-tiny-lead-text text-secondary", requiredMarkClassName: O = "text-error" }) => {
13
+ let { summaryLabel: k, editLabel: A, popupTitle: j, addLocaleLabel: M, localeRowLabel: N = "Locale", languageLabel: P, nameLabel: F, namePlaceholder: I, descriptionLabel: L, descriptionPlaceholder: R, deleteAriaLabel: z, cancelLabel: B = "Cancel", saveLabel: V = "Save" } = w, [H, U] = m(!1), [W, G] = m([]), K = p(0);
14
+ f(() => {
15
+ H && G(u.length > 0 ? u : [x(`locale-row-${++K.current}`, /* @__PURE__ */ new Set(), C)]);
16
+ }, [
17
+ H,
18
+ u,
19
+ C
20
+ ]);
21
+ let q = () => U(!0), J = () => U(!1), Y = () => {
22
+ S(W.filter((e) => e.language && e.name)), U(!1);
23
+ }, X = () => {
24
+ let e = new Set(W.map((e) => e.language).filter(Boolean));
25
+ G((t) => [...t, x(`locale-row-${++K.current}`, e, C)]);
26
+ }, Z = (e, t) => {
27
+ G((n) => n.map((n) => n.id === e ? {
28
+ ...n,
29
+ ...t
30
+ } : n));
31
+ }, Q = (e) => {
32
+ G((t) => t.filter((t) => t.id !== e));
33
+ }, $ = (e) => C.find((t) => t.code === e)?.label ?? e.toUpperCase(), ee = W.some((e) => !e.language || !e.name);
34
+ return /* @__PURE__ */ b("div", {
35
+ className: e("flex items-center gap-2", T),
36
+ children: [
37
+ /* @__PURE__ */ y("span", {
38
+ className: E,
39
+ children: `${k}: ${u.length > 0 ? u.map((e) => `[${$(e.language)}]`).join(", ") : "—"}`
40
+ }),
41
+ /* @__PURE__ */ y(s, {
42
+ label: A,
43
+ iconBefore: /* @__PURE__ */ y(h, {
44
+ size: r.SM,
45
+ "aria-hidden": !0
46
+ }),
47
+ className: "!px-0",
48
+ onClick: q
49
+ }),
50
+ /* @__PURE__ */ y(c, {
51
+ open: H,
52
+ header: j,
53
+ onClose: J,
54
+ mainButtons: [{
55
+ label: B,
56
+ onClick: J
57
+ }, {
58
+ label: V,
59
+ variant: n.Primary,
60
+ disabled: ee,
61
+ onClick: Y
62
+ }],
63
+ children: /* @__PURE__ */ b("div", {
64
+ className: "flex flex-col gap-8 px-6 py-3",
65
+ children: [W.map((e, n) => {
66
+ let s = new Set(W.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
67
+ return /* @__PURE__ */ b("div", {
68
+ className: "flex flex-col gap-2",
69
+ children: [/* @__PURE__ */ b("div", {
70
+ className: "flex items-center justify-between",
71
+ children: [/* @__PURE__ */ b("span", {
72
+ className: D,
73
+ children: [
74
+ N,
75
+ " ",
76
+ n + 1
77
+ ]
78
+ }), /* @__PURE__ */ y(i, {
79
+ appearance: t.Ghost,
80
+ size: a.Small,
81
+ icon: /* @__PURE__ */ y(_, {
82
+ size: r.SM,
83
+ "aria-hidden": !0
84
+ }),
85
+ "aria-label": `${z} ${n + 1}`,
86
+ onClick: () => Q(e.id)
87
+ })]
88
+ }), /* @__PURE__ */ b("div", {
89
+ role: "group",
90
+ "aria-label": `${N} ${n + 1}`,
91
+ className: "flex flex-col gap-5",
92
+ children: [/* @__PURE__ */ b("div", {
93
+ className: "flex items-start gap-5",
94
+ children: [/* @__PURE__ */ y(l, {
95
+ id: `${e.id}-language`,
96
+ labelProps: { label: P },
97
+ className: "shrink-0 basis-20",
98
+ options: C.map((e) => ({
99
+ value: e.code,
100
+ label: e.label,
101
+ disabled: s.has(e.code)
102
+ })),
103
+ value: e.language,
104
+ onChange: (t) => Z(e.id, { language: t })
105
+ }), /* @__PURE__ */ y(o, {
106
+ id: `${e.id}-name`,
107
+ containerClassName: "min-w-0 flex-1",
108
+ required: !0,
109
+ value: e.name,
110
+ onChange: (t) => Z(e.id, { name: t ?? "" }),
111
+ labelProps: { label: /* @__PURE__ */ b(v, { children: [F, /* @__PURE__ */ y("span", {
112
+ "aria-hidden": !0,
113
+ className: O,
114
+ children: "*"
115
+ })] }) },
116
+ placeholder: I
117
+ })]
118
+ }), /* @__PURE__ */ y(d, {
119
+ id: `${e.id}-description`,
120
+ resize: !0,
121
+ value: e.description,
122
+ onChange: (t) => Z(e.id, { description: t }),
123
+ labelProps: { label: L },
124
+ placeholder: R
125
+ })]
126
+ })]
127
+ }, e.id);
128
+ }), /* @__PURE__ */ y(s, {
129
+ label: M,
130
+ iconBefore: /* @__PURE__ */ y(g, {
131
+ size: r.SM,
132
+ "aria-hidden": !0
133
+ }),
134
+ className: "self-start",
135
+ onClick: X,
136
+ disabled: W.length >= C.length
137
+ })]
138
+ })
139
+ })
140
+ ]
141
+ });
142
+ }, C = ({ values: t, errors: n, onChange: r, onNameBlur: i, onVersionBlur: a, labels: s, styles: c, availableLocaleOptions: l = [] }) => {
143
+ let m = p(null), h = p(null), g = p(!1), _ = !!(n.name || n.version);
144
+ return f(() => {
145
+ _ && !g.current && (n.name ? m : h).current?.focus(), g.current = _;
146
+ }, [
147
+ _,
148
+ n.name,
149
+ n.version
150
+ ]), /* @__PURE__ */ b("div", {
151
+ role: s.ariaLabel ? "group" : void 0,
152
+ "aria-label": s.ariaLabel,
153
+ className: e("flex flex-col gap-4", c?.root),
154
+ children: [
155
+ /* @__PURE__ */ y(o, {
156
+ id: "deployment-creation-form-name",
157
+ inputRef: m,
158
+ value: t.name,
159
+ onChange: (e) => r({ name: e ?? "" }),
160
+ onBlur: i,
161
+ labelProps: {
162
+ label: s.name.label,
163
+ required: !0
164
+ },
165
+ placeholder: s.name.placeholder,
166
+ error: n.name || void 0,
167
+ invalid: !!n.name,
168
+ containerClassName: c?.field
169
+ }),
170
+ /* @__PURE__ */ y(d, {
171
+ id: "deployment-creation-form-description",
172
+ value: t.description,
173
+ onChange: (e) => r({ description: e }),
174
+ labelProps: { label: s.description.label },
175
+ placeholder: s.description.placeholder,
176
+ containerClassName: c?.field
177
+ }),
178
+ /* @__PURE__ */ y(S, {
179
+ value: t.otherLocales,
180
+ onChange: (e) => r({ otherLocales: e }),
181
+ availableLocaleOptions: l,
182
+ labels: s.otherLocales,
183
+ className: c?.field
184
+ }),
185
+ /* @__PURE__ */ y(o, {
186
+ id: "deployment-creation-form-icon-url",
187
+ value: t.iconUrl,
188
+ onChange: (e) => r({ iconUrl: e ?? "" }),
189
+ labelProps: { label: s.iconUrl.label },
190
+ placeholder: s.iconUrl.placeholder,
191
+ containerClassName: c?.field
192
+ }),
193
+ /* @__PURE__ */ y(o, {
194
+ id: "deployment-creation-form-version",
195
+ inputRef: h,
196
+ value: t.version,
197
+ onChange: (e) => r({ version: e ?? "" }),
198
+ onBlur: a,
199
+ labelProps: { label: s.version.label },
200
+ placeholder: s.version.placeholder,
201
+ error: n.version || void 0,
202
+ invalid: !!n.version,
203
+ containerClassName: c?.field
204
+ }),
205
+ /* @__PURE__ */ y("div", {
206
+ className: c?.field,
207
+ children: /* @__PURE__ */ y(u, {
208
+ id: "deployment-creation-form-topics",
209
+ labelProps: { label: s.topics.label },
210
+ placeholder: s.topics.placeholder,
211
+ value: t.topics,
212
+ onChange: (e) => r({ topics: e })
213
+ })
214
+ })
215
+ ]
216
+ });
217
+ }, w = /* @__PURE__ */ function(e) {
218
+ return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e;
219
+ }({}), T = /^[a-zA-Z0-9 _.-]+$/, E = /^[a-zA-Z0-9._-]+$/, D = (e, t = {}) => {
220
+ let n = {}, r = e.name.trim();
221
+ r ? t.validateNamePattern && !T.test(r) && (n.name = w.InvalidFormat) : n.name = w.Required;
222
+ let i = e.version.trim();
223
+ return t.validateVersionPattern && i && !E.test(i) && (n.version = w.InvalidFormat), n;
224
+ };
225
+ //#endregion
226
+ export { w as DeploymentCreationFieldErrorCode, C as DeploymentCreationForm, S as DeploymentLocalesField, T as NAME_PATTERN, E as VERSION_PATTERN, D as validateDeploymentCreationFields };
@@ -0,0 +1,120 @@
1
+ /** One additional (non-primary) locale's name/description translation, edited via the "Add locale" popup. */
2
+ export interface DeploymentCreationFormLocaleEntry {
3
+ /** Stable client-side id for list rendering; not part of the persisted locale map. */
4
+ id: string;
5
+ /** Locale code this entry translates into (e.g. `'de'`). */
6
+ language: string;
7
+ /** Translated name for this locale. */
8
+ name: string;
9
+ /** Translated description for this locale. */
10
+ description: string;
11
+ }
12
+ /** A selectable language option for an additional-locale row. */
13
+ export interface DeploymentCreationFormLocaleOption {
14
+ /** Locale code (e.g. `'de'`). */
15
+ code: string;
16
+ /** Display label for the option (e.g. `'DE'`). */
17
+ label: string;
18
+ }
19
+ /** Field values shared by Quick App and Toolset creation's General step. */
20
+ export interface DeploymentCreationFormValues {
21
+ /** Display name of the entity being created. */
22
+ name: string;
23
+ /** Long-form description of the entity. */
24
+ description: string;
25
+ /** Icon URL, entered as a plain URL text field. */
26
+ iconUrl: string;
27
+ /** Version string (e.g. `'1.0.0'`). */
28
+ version: string;
29
+ /** Free-entry topic tags. */
30
+ topics: string[];
31
+ /** Additional (non-primary) locale entries for name/description, edited via the "Add locale" popup. */
32
+ otherLocales: DeploymentCreationFormLocaleEntry[];
33
+ }
34
+ /** Translated, display-ready field errors for the shared form. */
35
+ export interface DeploymentCreationFormFieldErrors {
36
+ /** Error message for the name field. */
37
+ name?: string;
38
+ /** Error message for the version field. */
39
+ version?: string;
40
+ }
41
+ /** Label and placeholder text for a single field, supplied by the host app. */
42
+ export interface DeploymentCreationFormFieldLabels {
43
+ /** Field label text. */
44
+ label: string;
45
+ /** Placeholder text shown when the field is empty. */
46
+ placeholder?: string;
47
+ }
48
+ /** Pre-translated labels/placeholders for the "Add locale" summary row and popup, supplied by the host app. */
49
+ export interface DeploymentCreationFormLocaleLabels {
50
+ /** Text preceding the list of configured locale codes, e.g. `'Locales'`. */
51
+ summaryLabel: string;
52
+ /** Label for the link that opens the "Add locale" popup. */
53
+ editLabel: string;
54
+ /** Title of the "Add locale" popup. */
55
+ popupTitle: string;
56
+ /** Label for the button that adds a new locale row. */
57
+ addLocaleLabel: string;
58
+ /** Label prefix for each row's heading (e.g. `'Locale'` -> `'Locale 1'`). Defaults to `'Locale'`. */
59
+ localeRowLabel?: string;
60
+ /** Label for the language select field. */
61
+ languageLabel: string;
62
+ /** Label for the per-locale name field. */
63
+ nameLabel: string;
64
+ /** Placeholder for the per-locale name field. */
65
+ namePlaceholder?: string;
66
+ /** Label for the per-locale description field. */
67
+ descriptionLabel: string;
68
+ /** Placeholder for the per-locale description field. */
69
+ descriptionPlaceholder?: string;
70
+ /** Accessible name for a row's delete button. */
71
+ deleteAriaLabel: string;
72
+ /** Label for the popup's cancel button. */
73
+ cancelLabel?: string;
74
+ /** Label for the popup's save button. */
75
+ saveLabel?: string;
76
+ }
77
+ /** Pre-translated labels/placeholders for every field, supplied by the host app. */
78
+ export interface DeploymentCreationFormLabels {
79
+ /** Labels for the name field. */
80
+ name: DeploymentCreationFormFieldLabels;
81
+ /** Labels for the description field. */
82
+ description: DeploymentCreationFormFieldLabels;
83
+ /** Labels for the icon URL field. */
84
+ iconUrl: DeploymentCreationFormFieldLabels;
85
+ /** Labels for the version field. */
86
+ version: DeploymentCreationFormFieldLabels;
87
+ /** Labels for the topics field. */
88
+ topics: DeploymentCreationFormFieldLabels;
89
+ /** Labels for the additional-locales summary row and popup. */
90
+ otherLocales: DeploymentCreationFormLocaleLabels;
91
+ /** Accessible name for the field set group. */
92
+ ariaLabel?: string;
93
+ }
94
+ /** Optional per-slot class name overrides for visual composition by the host app. */
95
+ export interface DeploymentCreationFormStyles {
96
+ /** Class applied to the root container. Defaults to a vertical flex stack. */
97
+ root?: string;
98
+ /** Class applied to each individual field wrapper. */
99
+ field?: string;
100
+ }
101
+ /** Props accepted by the `DeploymentCreationForm` component. */
102
+ export interface DeploymentCreationFormProps {
103
+ /** Current field values. The component holds no state of its own. */
104
+ values: DeploymentCreationFormValues;
105
+ /** Field-level errors to surface, already translated by the host app. */
106
+ errors: DeploymentCreationFormFieldErrors;
107
+ /** Called with a partial patch whenever a field value changes. */
108
+ onChange: (patch: Partial<DeploymentCreationFormValues>) => void;
109
+ /** Called when the name field loses focus, so the host can run on-blur validation. */
110
+ onNameBlur?: () => void;
111
+ /** Called when the version field loses focus, so the host can run on-blur validation. */
112
+ onVersionBlur?: () => void;
113
+ /** Pre-translated labels/placeholders for every field. */
114
+ labels: DeploymentCreationFormLabels;
115
+ /** Optional per-slot class name overrides. */
116
+ styles?: DeploymentCreationFormStyles;
117
+ /** Selectable language options for additional-locale rows. Defaults to an empty list (no locales addable). */
118
+ availableLocaleOptions?: DeploymentCreationFormLocaleOption[];
119
+ }
120
+ //# sourceMappingURL=deployment-creation-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment-creation-form.d.ts","sourceRoot":"","sources":["../../src/models/deployment-creation-form.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,24 @@
1
+ /** Reason a shared field failed validation, for the host app to map to a translated message. */
2
+ export declare enum DeploymentCreationFieldErrorCode {
3
+ /** The field is required and was left empty. */
4
+ Required = "required",
5
+ /** The field's value does not match the required character pattern. */
6
+ InvalidFormat = "invalid-format",
7
+ /** The field's value exceeds its maximum length. */
8
+ TooLong = "too-long"
9
+ }
10
+ /** Untranslated error codes returned by `validateDeploymentCreationFields`. */
11
+ export interface DeploymentCreationFormErrorCodes {
12
+ /** Error code for the name field, if invalid. */
13
+ name?: DeploymentCreationFieldErrorCode;
14
+ /** Error code for the version field, if invalid. */
15
+ version?: DeploymentCreationFieldErrorCode;
16
+ }
17
+ /** Optional pattern-check toggles for field validation. */
18
+ export interface DeploymentCreationFormValidationOptions {
19
+ /** Whether to reject a name containing characters outside `NAME_PATTERN`. */
20
+ validateNamePattern?: boolean;
21
+ /** Whether to reject a non-empty version containing characters outside `VERSION_PATTERN`. */
22
+ validateVersionPattern?: boolean;
23
+ }
24
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/models/validation.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,oBAAY,gCAAgC;IAC1C,gDAAgD;IAChD,QAAQ,aAAa;IACrB,uEAAuE;IACvE,aAAa,mBAAmB;IAChC,oDAAoD;IACpD,OAAO,aAAa;CACrB;AAED,+EAA+E;AAC/E,MAAM,WAAW,gCAAgC;IAC/C,iDAAiD;IACjD,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,oDAAoD;IACpD,OAAO,CAAC,EAAE,gCAAgC,CAAC;CAC5C;AAED,2DAA2D;AAC3D,MAAM,WAAW,uCAAuC;IACtD,6EAA6E;IAC7E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6FAA6F;IAC7F,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC"}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@epam/ai-dial-deployment-creation-form",
3
+ "description": "Shared General-step field set for creating and editing a DIAL deployment",
4
+ "version": "1.1.0-dev.280",
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.280",
20
+ "@epam/ai-dial-ui-kit": "*",
21
+ "@tabler/icons-react": "*",
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/deployment-creation-form"
28
+ }
29
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { DeploymentCreationFormValues } from '../models/deployment-creation-form';
2
+ import { DeploymentCreationFormErrorCodes, DeploymentCreationFormValidationOptions } from '../models/validation';
3
+ /** Allowed characters for the name field: letters, digits, spaces, underscores, dots, dashes. */
4
+ export declare const NAME_PATTERN: RegExp;
5
+ /** Allowed characters for the version field: letters, digits, dots, underscores, dashes. */
6
+ export declare const VERSION_PATTERN: RegExp;
7
+ /** Validates the General-step fields and returns untranslated error codes; has no side effects. */
8
+ export declare const validateDeploymentCreationFields: (values: DeploymentCreationFormValues, options?: DeploymentCreationFormValidationOptions) => DeploymentCreationFormErrorCodes;
9
+ //# sourceMappingURL=validate-deployment-creation-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-deployment-creation-fields.d.ts","sourceRoot":"","sources":["../../src/utils/validate-deployment-creation-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,EACV,gCAAgC,EAChC,uCAAuC,EACxC,MAAM,sBAAsB,CAAC;AAG9B,iGAAiG;AACjG,eAAO,MAAM,YAAY,QAAuB,CAAC;AAEjD,4FAA4F;AAC5F,eAAO,MAAM,eAAe,QAAsB,CAAC;AAEnD,mGAAmG;AACnG,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,4BAA4B,EACpC,UAAS,uCAA4C,KACpD,gCAoBF,CAAC"}