@hai-dev/ui-kit 1.0.6 → 1.0.7

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 (33) hide show
  1. package/dist/{Box-CiYPzbPd.js → Box-D8oKffw9.js} +18 -17
  2. package/dist/{Button-chJUX25I.js → Button-BBF8hp7e.js} +16 -15
  3. package/dist/{ButtonBase-DZwhOh56.js → ButtonBase-T2KH9jsD.js} +2 -2
  4. package/dist/{CircularProgress-BCrSQadM.js → CircularProgress-BQQkuSse.js} +110 -136
  5. package/dist/{DialogTitle-BUcXvkzd.js → Dialog-B97c7WYP.js} +765 -1010
  6. package/dist/DialogTitle-Du4tqTs0.js +254 -0
  7. package/dist/{Typography-BmYEfS8y.js → Typography-r_TXEM1e.js} +4 -4
  8. package/dist/assets/upload-dialog-errors.css +1 -0
  9. package/dist/assets/upload-dialog.css +1 -1
  10. package/dist/{chainPropTypes-HYSaT0L0.js → chainPropTypes-KIxDwPzf.js} +15 -15
  11. package/dist/components/button/button.js +1 -1
  12. package/dist/components/circular-progress-loader/circular-progress-loader.js +3 -3
  13. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +26 -25
  14. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +1 -1
  15. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +17 -17
  16. package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +12 -1
  17. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.d.ts +3 -0
  18. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +10 -0
  19. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +152 -129
  20. package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
  21. package/dist/components/photo-crop-uploader/constants.js +35 -32
  22. package/dist/components/photo-crop-uploader/locale.js +8 -2
  23. package/dist/components/photo-crop-uploader/photo-crop-uploader.js +169 -145
  24. package/dist/components/photo-crop-uploader/types.d.ts +4 -0
  25. package/dist/constants.d.ts +1 -0
  26. package/dist/constants.js +2 -1
  27. package/dist/createSimplePaletteValueFilter-nb0wSOzC.js +30 -0
  28. package/dist/{createTheme-BfVKUMHQ.js → createTheme-RvzX1VSA.js} +9 -9
  29. package/dist/extendSxProp-BW9e6LtL.js +36 -0
  30. package/dist/upload-dialog-errors-ku54UrUb.js +365 -0
  31. package/dist/useTheme-CsjkCBFJ.js +16 -0
  32. package/package.json +1 -1
  33. package/dist/extendSxProp-bpz0eCso.js +0 -49
@@ -0,0 +1,365 @@
1
+ import { jsx as s, jsxs as m, Fragment as x } from "react/jsx-runtime";
2
+ import { c } from "./index-B2JRaoNz.js";
3
+ import { localizedText as g } from "./components/photo-crop-uploader/locale.js";
4
+ import { EN_LOCALE as S, DASH_SYMBOL as L } from "./constants.js";
5
+ import { D as I, a as R, b as W } from "./DialogTitle-Du4tqTs0.js";
6
+ import * as O from "react";
7
+ import { g as V, a as B, c as $, P as r } from "./createTheme-RvzX1VSA.js";
8
+ import { m as C } from "./createSimplePaletteValueFilter-nb0wSOzC.js";
9
+ import { u as z, s as w, c as E } from "./chainPropTypes-KIxDwPzf.js";
10
+ import { Button as y } from "./components/button/button.js";
11
+ import './assets/upload-dialog-errors.css';function M(e) {
12
+ return V("MuiDivider", e);
13
+ }
14
+ B("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
15
+ const U = (e) => {
16
+ const {
17
+ absolute: t,
18
+ children: o,
19
+ classes: p,
20
+ flexItem: f,
21
+ light: i,
22
+ orientation: n,
23
+ textAlign: l,
24
+ variant: a
25
+ } = e;
26
+ return E({
27
+ root: ["root", t && "absolute", a, i && "light", n === "vertical" && "vertical", f && "flexItem", o && "withChildren", o && n === "vertical" && "withChildrenVertical", l === "right" && n !== "vertical" && "textAlignRight", l === "left" && n !== "vertical" && "textAlignLeft"],
28
+ wrapper: ["wrapper", n === "vertical" && "wrapperVertical"]
29
+ }, M, p);
30
+ }, j = w("div", {
31
+ name: "MuiDivider",
32
+ slot: "Root",
33
+ overridesResolver: (e, t) => {
34
+ const {
35
+ ownerState: o
36
+ } = e;
37
+ return [t.root, o.absolute && t.absolute, t[o.variant], o.light && t.light, o.orientation === "vertical" && t.vertical, o.flexItem && t.flexItem, o.children && t.withChildren, o.children && o.orientation === "vertical" && t.withChildrenVertical, o.textAlign === "right" && o.orientation !== "vertical" && t.textAlignRight, o.textAlign === "left" && o.orientation !== "vertical" && t.textAlignLeft];
38
+ }
39
+ })(C(({
40
+ theme: e
41
+ }) => ({
42
+ margin: 0,
43
+ // Reset browser default style.
44
+ flexShrink: 0,
45
+ borderWidth: 0,
46
+ borderStyle: "solid",
47
+ borderColor: (e.vars || e).palette.divider,
48
+ borderBottomWidth: "thin",
49
+ variants: [{
50
+ props: {
51
+ absolute: !0
52
+ },
53
+ style: {
54
+ position: "absolute",
55
+ bottom: 0,
56
+ left: 0,
57
+ width: "100%"
58
+ }
59
+ }, {
60
+ props: {
61
+ light: !0
62
+ },
63
+ style: {
64
+ borderColor: e.alpha((e.vars || e).palette.divider, 0.08)
65
+ }
66
+ }, {
67
+ props: {
68
+ variant: "inset"
69
+ },
70
+ style: {
71
+ marginLeft: 72
72
+ }
73
+ }, {
74
+ props: {
75
+ variant: "middle",
76
+ orientation: "horizontal"
77
+ },
78
+ style: {
79
+ marginLeft: e.spacing(2),
80
+ marginRight: e.spacing(2)
81
+ }
82
+ }, {
83
+ props: {
84
+ variant: "middle",
85
+ orientation: "vertical"
86
+ },
87
+ style: {
88
+ marginTop: e.spacing(1),
89
+ marginBottom: e.spacing(1)
90
+ }
91
+ }, {
92
+ props: {
93
+ orientation: "vertical"
94
+ },
95
+ style: {
96
+ height: "100%",
97
+ borderBottomWidth: 0,
98
+ borderRightWidth: "thin"
99
+ }
100
+ }, {
101
+ props: {
102
+ flexItem: !0
103
+ },
104
+ style: {
105
+ alignSelf: "stretch",
106
+ height: "auto"
107
+ }
108
+ }, {
109
+ props: ({
110
+ ownerState: t
111
+ }) => !!t.children,
112
+ style: {
113
+ display: "flex",
114
+ textAlign: "center",
115
+ border: 0,
116
+ borderTopStyle: "solid",
117
+ borderLeftStyle: "solid",
118
+ "&::before, &::after": {
119
+ content: '""',
120
+ alignSelf: "center"
121
+ }
122
+ }
123
+ }, {
124
+ props: ({
125
+ ownerState: t
126
+ }) => t.children && t.orientation !== "vertical",
127
+ style: {
128
+ "&::before, &::after": {
129
+ width: "100%",
130
+ borderTop: `thin solid ${(e.vars || e).palette.divider}`,
131
+ borderTopStyle: "inherit"
132
+ }
133
+ }
134
+ }, {
135
+ props: ({
136
+ ownerState: t
137
+ }) => t.orientation === "vertical" && t.children,
138
+ style: {
139
+ flexDirection: "column",
140
+ "&::before, &::after": {
141
+ height: "100%",
142
+ borderLeft: `thin solid ${(e.vars || e).palette.divider}`,
143
+ borderLeftStyle: "inherit"
144
+ }
145
+ }
146
+ }, {
147
+ props: ({
148
+ ownerState: t
149
+ }) => t.textAlign === "right" && t.orientation !== "vertical",
150
+ style: {
151
+ "&::before": {
152
+ width: "90%"
153
+ },
154
+ "&::after": {
155
+ width: "10%"
156
+ }
157
+ }
158
+ }, {
159
+ props: ({
160
+ ownerState: t
161
+ }) => t.textAlign === "left" && t.orientation !== "vertical",
162
+ style: {
163
+ "&::before": {
164
+ width: "10%"
165
+ },
166
+ "&::after": {
167
+ width: "90%"
168
+ }
169
+ }
170
+ }]
171
+ }))), k = w("span", {
172
+ name: "MuiDivider",
173
+ slot: "Wrapper",
174
+ overridesResolver: (e, t) => {
175
+ const {
176
+ ownerState: o
177
+ } = e;
178
+ return [t.wrapper, o.orientation === "vertical" && t.wrapperVertical];
179
+ }
180
+ })(C(({
181
+ theme: e
182
+ }) => ({
183
+ display: "inline-block",
184
+ paddingLeft: `calc(${e.spacing(1)} * 1.2)`,
185
+ paddingRight: `calc(${e.spacing(1)} * 1.2)`,
186
+ whiteSpace: "nowrap",
187
+ variants: [{
188
+ props: {
189
+ orientation: "vertical"
190
+ },
191
+ style: {
192
+ paddingTop: `calc(${e.spacing(1)} * 1.2)`,
193
+ paddingBottom: `calc(${e.spacing(1)} * 1.2)`
194
+ }
195
+ }]
196
+ }))), h = /* @__PURE__ */ O.forwardRef(function(t, o) {
197
+ const p = z({
198
+ props: t,
199
+ name: "MuiDivider"
200
+ }), {
201
+ absolute: f = !1,
202
+ children: i,
203
+ className: n,
204
+ orientation: l = "horizontal",
205
+ component: a = i || l === "vertical" ? "div" : "hr",
206
+ flexItem: b = !1,
207
+ light: A = !1,
208
+ role: u = a !== "hr" ? "separator" : void 0,
209
+ textAlign: D = "center",
210
+ variant: N = "fullWidth",
211
+ ...T
212
+ } = p, v = {
213
+ ...p,
214
+ absolute: f,
215
+ component: a,
216
+ flexItem: b,
217
+ light: A,
218
+ orientation: l,
219
+ role: u,
220
+ textAlign: D,
221
+ variant: N
222
+ }, _ = U(v);
223
+ return /* @__PURE__ */ s(j, {
224
+ as: a,
225
+ className: $(_.root, n),
226
+ role: u,
227
+ ref: o,
228
+ ownerState: v,
229
+ "aria-orientation": u === "separator" && (a !== "hr" || l === "vertical") ? l : void 0,
230
+ ...T,
231
+ children: i ? /* @__PURE__ */ s(k, {
232
+ className: _.wrapper,
233
+ ownerState: v,
234
+ children: i
235
+ }) : null
236
+ });
237
+ });
238
+ h && (h.muiSkipListHighlight = !0);
239
+ process.env.NODE_ENV !== "production" && (h.propTypes = {
240
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
241
+ // │ These PropTypes are generated from the TypeScript type definitions. │
242
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
243
+ // └─────────────────────────────────────────────────────────────────────┘
244
+ /**
245
+ * Absolutely position the element.
246
+ * @default false
247
+ */
248
+ absolute: r.bool,
249
+ /**
250
+ * The content of the component.
251
+ */
252
+ children: r.node,
253
+ /**
254
+ * Override or extend the styles applied to the component.
255
+ */
256
+ classes: r.object,
257
+ /**
258
+ * @ignore
259
+ */
260
+ className: r.string,
261
+ /**
262
+ * The component used for the root node.
263
+ * Either a string to use a HTML element or a component.
264
+ */
265
+ component: r.elementType,
266
+ /**
267
+ * If `true`, a vertical divider will have the correct height when used in flex container.
268
+ * (By default, a vertical divider will have a calculated height of `0px` if it is the child of a flex container.)
269
+ * @default false
270
+ */
271
+ flexItem: r.bool,
272
+ /**
273
+ * If `true`, the divider will have a lighter color.
274
+ * @default false
275
+ * @deprecated Use <Divider sx={{ opacity: 0.6 }} /> (or any opacity or color) instead. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
276
+ */
277
+ light: r.bool,
278
+ /**
279
+ * The component orientation.
280
+ * @default 'horizontal'
281
+ */
282
+ orientation: r.oneOf(["horizontal", "vertical"]),
283
+ /**
284
+ * @ignore
285
+ */
286
+ role: r.string,
287
+ /**
288
+ * The system prop that allows defining system overrides as well as additional CSS styles.
289
+ */
290
+ sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
291
+ /**
292
+ * The text alignment.
293
+ * @default 'center'
294
+ */
295
+ textAlign: r.oneOf(["center", "left", "right"]),
296
+ /**
297
+ * The variant to use.
298
+ * @default 'fullWidth'
299
+ */
300
+ variant: r.oneOfType([r.oneOf(["fullWidth", "inset", "middle"]), r.string])
301
+ });
302
+ const H = "_dialog_1mcfu_1", P = "_errorContent_1mcfu_7", F = "_errorItem_1mcfu_22", Y = "_fileName_1mcfu_28", q = "_topActions_1mcfu_34", G = "_close_1mcfu_40", J = "_botActions_1mcfu_44", K = "_button_1mcfu_49", Q = "_title_1mcfu_53", X = "_content_1mcfu_59", Z = "_many_1mcfu_67", tt = "_crop_1mcfu_74", et = "_dialogText_1mcfu_83", d = {
303
+ dialog: H,
304
+ errorContent: P,
305
+ errorItem: F,
306
+ fileName: Y,
307
+ topActions: q,
308
+ close: G,
309
+ botActions: J,
310
+ button: K,
311
+ title: Q,
312
+ content: X,
313
+ many: Z,
314
+ crop: tt,
315
+ dialogText: et
316
+ }, pt = (e) => {
317
+ const {
318
+ photoSources: t,
319
+ errors: o = [],
320
+ onCloseDialogHandler: p,
321
+ onClearErrors: f,
322
+ locale: i = S
323
+ } = e;
324
+ return /* @__PURE__ */ m(x, { children: [
325
+ /* @__PURE__ */ s(I, { className: c(d.title), children: t.length ? g[i]["some-not-uploaded"] : g[i]["not-uploaded"] }),
326
+ /* @__PURE__ */ s(R, { className: c(d.errorContent), children: o.map(({ photoName: n, errorMessage: l }, a) => /* @__PURE__ */ m(x, { children: [
327
+ !!a && /* @__PURE__ */ s(h, {}),
328
+ /* @__PURE__ */ m("div", { className: c(d.errorItem), children: [
329
+ /* @__PURE__ */ s("span", { className: c(d.fileName), children: n }),
330
+ " ",
331
+ ` ${L} ${l}`
332
+ ] })
333
+ ] }, a)) }),
334
+ /* @__PURE__ */ m(W, { className: c(d.botActions), children: [
335
+ /* @__PURE__ */ s(
336
+ y,
337
+ {
338
+ buttonSize: "small",
339
+ buttonColor: "blue",
340
+ buttonVariant: "outlined",
341
+ buttonWeight: 500,
342
+ onClick: p,
343
+ className: c(d.button),
344
+ children: g[i].close
345
+ }
346
+ ),
347
+ !!t.length && /* @__PURE__ */ s(
348
+ y,
349
+ {
350
+ buttonSize: "small",
351
+ buttonColor: "blue",
352
+ buttonVariant: "filled",
353
+ buttonWeight: 500,
354
+ onClick: f,
355
+ className: c(d.button),
356
+ children: g[i].continue
357
+ }
358
+ )
359
+ ] })
360
+ ] });
361
+ };
362
+ export {
363
+ pt as U,
364
+ d as s
365
+ };
@@ -0,0 +1,16 @@
1
+ import { T as n, e as o } from "./createTheme-RvzX1VSA.js";
2
+ import * as s from "react";
3
+ function m(e) {
4
+ return Object.keys(e).length === 0;
5
+ }
6
+ function r(e = null) {
7
+ const t = s.useContext(n);
8
+ return !t || m(t) ? e : t;
9
+ }
10
+ const u = o();
11
+ function a(e = u) {
12
+ return r(e);
13
+ }
14
+ export {
15
+ a as u
16
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hai-dev/ui-kit",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "license": "UNLICENSED",
6
6
  "author": {
7
7
  "name": "Vladislav Knitrunov",
@@ -1,49 +0,0 @@
1
- import { f as u, h as f, i as a, j as m } from "./createTheme-BfVKUMHQ.js";
2
- import * as l from "react";
3
- function h(t) {
4
- return Object.keys(t).length === 0;
5
- }
6
- function x(t = null) {
7
- const e = l.useContext(u);
8
- return !e || h(e) ? t : e;
9
- }
10
- const y = f();
11
- function b(t = y) {
12
- return x(t);
13
- }
14
- const P = (t) => {
15
- const e = {
16
- systemProps: {},
17
- otherProps: {}
18
- }, r = t?.theme?.unstable_sxConfig ?? m;
19
- return Object.keys(t).forEach((s) => {
20
- r[s] ? e.systemProps[s] = t[s] : e.otherProps[s] = t[s];
21
- }), e;
22
- };
23
- function j(t) {
24
- const {
25
- sx: e,
26
- ...r
27
- } = t, {
28
- systemProps: s,
29
- otherProps: c
30
- } = P(r);
31
- let n;
32
- return Array.isArray(e) ? n = [s, ...e] : typeof e == "function" ? n = (...i) => {
33
- const o = e(...i);
34
- return a(o) ? {
35
- ...s,
36
- ...o
37
- } : s;
38
- } : n = {
39
- ...s,
40
- ...e
41
- }, {
42
- ...c,
43
- sx: n
44
- };
45
- }
46
- export {
47
- j as e,
48
- b as u
49
- };