@hai-dev/ui-kit 1.0.5 → 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.
- package/dist/Box-D8oKffw9.js +57 -0
- package/dist/{Button-DDlVTM6i.js → Button-BBF8hp7e.js} +30 -27
- package/dist/ButtonBase-T2KH9jsD.js +966 -0
- package/dist/CircularProgress-BQQkuSse.js +273 -0
- package/dist/{DialogTitle-KN1sayHD.js → Dialog-B97c7WYP.js} +910 -1401
- package/dist/DialogTitle-Du4tqTs0.js +254 -0
- package/dist/Typography-r_TXEM1e.js +257 -0
- package/dist/assets/circular-progress-loader.css +1 -0
- package/dist/assets/upload-dialog-errors.css +1 -0
- package/dist/assets/upload-dialog.css +1 -1
- package/dist/chainPropTypes-KIxDwPzf.js +387 -0
- package/dist/components/button/button.js +1 -1
- package/dist/components/circular-progress-loader/circular-progress-loader.d.ts +3 -0
- package/dist/components/circular-progress-loader/circular-progress-loader.js +44 -0
- package/dist/components/circular-progress-loader/circular-progress-loader.stories.d.ts +7 -0
- package/dist/components/circular-progress-loader/constants.d.ts +2 -0
- package/dist/components/circular-progress-loader/constants.js +5 -0
- package/dist/components/circular-progress-loader/index.d.ts +1 -0
- package/dist/components/circular-progress-loader/index.js +4 -0
- package/dist/components/circular-progress-loader/types.d.ts +6 -0
- package/dist/components/circular-progress-loader/types.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +6 -4
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +41 -39
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +22 -73
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +17 -17
- package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +12 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.d.ts +3 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +10 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +152 -127
- package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
- package/dist/components/photo-crop-uploader/constants.js +35 -32
- package/dist/components/photo-crop-uploader/locale.js +8 -2
- package/dist/components/photo-crop-uploader/photo-crop-uploader.js +169 -145
- package/dist/components/photo-crop-uploader/types.d.ts +4 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +3 -1
- package/dist/createSimplePaletteValueFilter-nb0wSOzC.js +30 -0
- package/dist/{createTheme-DSHGFfg6.js → createTheme-RvzX1VSA.js} +4 -4
- package/dist/decorators/centered-decorator.d.ts +3 -0
- package/dist/decorators/centered-decorator.js +16 -0
- package/dist/decorators/index.d.ts +1 -0
- package/dist/decorators/index.js +4 -0
- package/dist/decorators/types.d.ts +4 -0
- package/dist/decorators/types.js +1 -0
- package/dist/extendSxProp-BW9e6LtL.js +36 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -14
- package/dist/upload-dialog-errors-ku54UrUb.js +365 -0
- package/dist/useId-CK6Kn3Tn.js +21 -0
- package/dist/useTheme-CsjkCBFJ.js +16 -0
- package/package.json +8 -8
- package/dist/ButtonBase-CXGZ-DBC.js +0 -1346
- package/dist/CircularProgress-CscJm1An.js +0 -291
- package/dist/extendSxProp-CzeED7BH.js +0 -49
|
@@ -1,88 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { MAX_ITEMS_COUNT as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = l, t = y("div", {
|
|
14
|
-
shouldForwardProp: (o) => o !== "theme" && o !== "sx" && o !== "as"
|
|
15
|
-
})(C);
|
|
16
|
-
return /* @__PURE__ */ v.forwardRef(function(x, N) {
|
|
17
|
-
const h = E(p), {
|
|
18
|
-
className: g,
|
|
19
|
-
component: _ = "div",
|
|
20
|
-
...T
|
|
21
|
-
} = I(x);
|
|
22
|
-
return /* @__PURE__ */ i(t, {
|
|
23
|
-
as: _,
|
|
24
|
-
ref: N,
|
|
25
|
-
className: B(g, r ? r(a) : a),
|
|
26
|
-
theme: n && h[n] || h,
|
|
27
|
-
...T
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
const O = b("MuiBox", ["root"]), S = j(), d = M({
|
|
32
|
-
themeId: P,
|
|
33
|
-
defaultTheme: S,
|
|
34
|
-
defaultClassName: O.root,
|
|
35
|
-
generateClassName: L.generate
|
|
36
|
-
});
|
|
37
|
-
process.env.NODE_ENV !== "production" && (d.propTypes = {
|
|
38
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
39
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
40
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
41
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
42
|
-
/**
|
|
43
|
-
* @ignore
|
|
44
|
-
*/
|
|
45
|
-
children: e.node,
|
|
46
|
-
/**
|
|
47
|
-
* The component used for the root node.
|
|
48
|
-
* Either a string to use a HTML element or a component.
|
|
49
|
-
*/
|
|
50
|
-
component: e.elementType,
|
|
51
|
-
/**
|
|
52
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
53
|
-
*/
|
|
54
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
|
|
55
|
-
});
|
|
56
|
-
const z = "_photoList_rrp1z_1", R = "_item_rrp1z_6", q = "_image_rrp1z_17", s = {
|
|
57
|
-
photoList: z,
|
|
58
|
-
item: R,
|
|
59
|
-
image: q
|
|
60
|
-
}, G = (l) => {
|
|
61
|
-
const { photoSources: n, photoIndex: p, className: a, ...r } = l, t = n.slice(p);
|
|
62
|
-
return t.length > u ? /* @__PURE__ */ f(d, { className: m(s.photoList, a), ...r, children: [
|
|
63
|
-
t.slice(0, u - 1).map((c, o) => /* @__PURE__ */ i(
|
|
1
|
+
import { jsxs as p, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as o } from "../../../../index-B2JRaoNz.js";
|
|
3
|
+
import { MAX_ITEMS_COUNT as r } from "./constants.js";
|
|
4
|
+
import { B as n } from "../../../../Box-D8oKffw9.js";
|
|
5
|
+
import '../../../../assets/photo-list.css';const g = "_photoList_rrp1z_1", u = "_item_rrp1z_6", x = "_image_rrp1z_17", t = {
|
|
6
|
+
photoList: g,
|
|
7
|
+
item: u,
|
|
8
|
+
image: x
|
|
9
|
+
}, z = (l) => {
|
|
10
|
+
const { photoSources: h, photoIndex: _, className: a, ...c } = l, s = h.slice(_);
|
|
11
|
+
return s.length > r ? /* @__PURE__ */ p(n, { className: o(t.photoList, a), ...c, children: [
|
|
12
|
+
s.slice(0, r - 1).map((e, i) => /* @__PURE__ */ m(
|
|
64
13
|
"img",
|
|
65
14
|
{
|
|
66
|
-
className:
|
|
67
|
-
src:
|
|
15
|
+
className: o(t.item, t.image),
|
|
16
|
+
src: e,
|
|
68
17
|
alt: "photo in queue"
|
|
69
18
|
},
|
|
70
|
-
|
|
19
|
+
i
|
|
71
20
|
)),
|
|
72
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ p("div", { className: o(t.item), children: [
|
|
73
22
|
"Еще ",
|
|
74
|
-
|
|
23
|
+
s.length - r + 1
|
|
75
24
|
] })
|
|
76
|
-
] }) : /* @__PURE__ */
|
|
25
|
+
] }) : /* @__PURE__ */ m(n, { className: o(t.photoList, a), ...c, children: s.map((e, i) => /* @__PURE__ */ m(
|
|
77
26
|
"img",
|
|
78
27
|
{
|
|
79
|
-
className:
|
|
80
|
-
src:
|
|
28
|
+
className: o(t.item, t.image),
|
|
29
|
+
src: e,
|
|
81
30
|
alt: "photo in queue"
|
|
82
31
|
},
|
|
83
|
-
|
|
32
|
+
i
|
|
84
33
|
)) });
|
|
85
34
|
};
|
|
86
35
|
export {
|
|
87
|
-
|
|
36
|
+
z as PhotoList
|
|
88
37
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as v, Fragment as b } from "react/jsx-runtime";
|
|
2
2
|
import { useState as k, useRef as R } from "react";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as a } from "../../../../index-B2JRaoNz.js";
|
|
4
4
|
import { localizedText as x } from "../../locale.js";
|
|
5
5
|
import { EN_LOCALE as V } from "../../../../constants.js";
|
|
6
6
|
import { SUPPORTED_IMAGE_EXTENSIONS as y } from "../../constants.js";
|
|
7
7
|
import { UPLOAD_BUTTON_WIDTH_DEFAULT as W, UPLOAD_BUTTON_TAB_INDEX as j, UPLOAD_BUTTON_IMAGE_SIZE as T } from "./constants.js";
|
|
8
|
-
import { B as H } from "../../../../Button-
|
|
9
|
-
import '../../../../assets/upload-button.css';const M = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%201024%201024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cpath%20fill='%23ffffff'%20d='M544%20864V672h128L512%20480%20352%20672h128v192H320v-1.6c-5.376.32-10.496%201.6-16%201.6A240%20240%200%200%201%2064%20624c0-123.136%2093.12-223.488%20212.608-237.248A239.808%20239.808%200%200%201%20512%20192a239.872%20239.872%200%200%201%20235.456%20194.752c119.488%2013.76%20212.48%20114.112%20212.48%20237.248a240%20240%200%200%201-240%20240c-5.376%200-10.56-1.28-16-1.6v1.6H544z'/%3e%3c/g%3e%3c/svg%3e", F = "_dragDropWrapper_cgx9x_1", z = "_input_cgx9x_4",
|
|
8
|
+
import { B as H } from "../../../../Button-BBF8hp7e.js";
|
|
9
|
+
import '../../../../assets/upload-button.css';const M = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%201024%201024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cpath%20fill='%23ffffff'%20d='M544%20864V672h128L512%20480%20352%20672h128v192H320v-1.6c-5.376.32-10.496%201.6-16%201.6A240%20240%200%200%201%2064%20624c0-123.136%2093.12-223.488%20212.608-237.248A239.808%20239.808%200%200%201%20512%20192a239.872%20239.872%200%200%201%20235.456%20194.752c119.488%2013.76%20212.48%20114.112%20212.48%20237.248a240%20240%200%200%201-240%20240c-5.376%200-10.56-1.28-16-1.6v1.6H544z'/%3e%3c/g%3e%3c/svg%3e", F = "_dragDropWrapper_cgx9x_1", z = "_input_cgx9x_4", i = {
|
|
10
10
|
dragDropWrapper: F,
|
|
11
11
|
input: z
|
|
12
12
|
}, ee = (w) => {
|
|
13
13
|
const {
|
|
14
14
|
buttonClassname: C,
|
|
15
|
-
buttonDisabled:
|
|
15
|
+
buttonDisabled: r = !1,
|
|
16
16
|
children: E,
|
|
17
17
|
className: p,
|
|
18
18
|
onChange: o,
|
|
@@ -32,18 +32,18 @@ import '../../../../assets/upload-button.css';const M = "data:image/svg+xml,%3c!
|
|
|
32
32
|
fromSources: t,
|
|
33
33
|
...u
|
|
34
34
|
} = w, [P, l] = k(!1), c = R(null), h = (e) => {
|
|
35
|
-
e && e.length > 0 && o && o({
|
|
35
|
+
r || e && e.length > 0 && o && o({
|
|
36
36
|
target: {
|
|
37
37
|
files: e,
|
|
38
38
|
value: ""
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
}, U = (e) => {
|
|
42
|
-
t?.length || (e.preventDefault(), e.stopPropagation(), N(e),
|
|
42
|
+
t?.length || (e.preventDefault(), e.stopPropagation(), N(e), r || l(!0));
|
|
43
43
|
}, A = (e) => {
|
|
44
44
|
t?.length || (e.preventDefault(), e.stopPropagation(), S(e), l(!1));
|
|
45
45
|
}, B = (e) => {
|
|
46
|
-
if (t?.length || (e.preventDefault(), e.stopPropagation(), I(e), l(!1),
|
|
46
|
+
if (t?.length || (e.preventDefault(), e.stopPropagation(), I(e), l(!1), r)) return;
|
|
47
47
|
const _ = e.dataTransfer?.files;
|
|
48
48
|
h(_);
|
|
49
49
|
}, G = () => {
|
|
@@ -53,22 +53,22 @@ import '../../../../assets/upload-button.css';const M = "data:image/svg+xml,%3c!
|
|
|
53
53
|
}, m = (e) => {
|
|
54
54
|
h(e.target.files), o && o(e);
|
|
55
55
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ n(
|
|
57
57
|
"div",
|
|
58
58
|
{
|
|
59
|
-
className:
|
|
59
|
+
className: a(i.dragDropWrapper),
|
|
60
60
|
onDragOver: U,
|
|
61
61
|
onDragLeave: A,
|
|
62
62
|
onDrop: B,
|
|
63
63
|
onClick: G,
|
|
64
64
|
children: s ? /* @__PURE__ */ v(b, { children: [
|
|
65
65
|
s,
|
|
66
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ n(
|
|
67
67
|
"input",
|
|
68
68
|
{
|
|
69
69
|
onClick: D,
|
|
70
70
|
ref: c,
|
|
71
|
-
className:
|
|
71
|
+
className: a(i.input, p),
|
|
72
72
|
type: "file",
|
|
73
73
|
accept: d.join(", "),
|
|
74
74
|
onChange: m,
|
|
@@ -85,10 +85,10 @@ import '../../../../assets/upload-button.css';const M = "data:image/svg+xml,%3c!
|
|
|
85
85
|
},
|
|
86
86
|
role: "none",
|
|
87
87
|
variant: "contained",
|
|
88
|
-
disabled:
|
|
88
|
+
disabled: r,
|
|
89
89
|
tabIndex: j,
|
|
90
|
-
className:
|
|
91
|
-
startIcon: /* @__PURE__ */
|
|
90
|
+
className: a(i.uploadButton, C),
|
|
91
|
+
startIcon: /* @__PURE__ */ n(
|
|
92
92
|
"img",
|
|
93
93
|
{
|
|
94
94
|
width: T,
|
|
@@ -99,12 +99,12 @@ import '../../../../assets/upload-button.css';const M = "data:image/svg+xml,%3c!
|
|
|
99
99
|
),
|
|
100
100
|
children: [
|
|
101
101
|
P ? x[g].drop : E,
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ n(
|
|
103
103
|
"input",
|
|
104
104
|
{
|
|
105
105
|
onClick: D,
|
|
106
106
|
ref: c,
|
|
107
|
-
className:
|
|
107
|
+
className: a(i.input, p),
|
|
108
108
|
type: "file",
|
|
109
109
|
accept: d.join(", "),
|
|
110
110
|
onChange: m,
|
|
@@ -2,7 +2,7 @@ import { SyntheticEvent } from 'react';
|
|
|
2
2
|
import { DialogProps } from '@mui/material';
|
|
3
3
|
import { Crop, PercentCrop, PixelCrop } from 'react-image-crop';
|
|
4
4
|
import { Locale } from '../../../../types';
|
|
5
|
-
import { PhotoDataUrl } from '../../types';
|
|
5
|
+
import { FileErrorItem, PhotoDataUrl } from '../../types';
|
|
6
6
|
type OnPhotoLoad = (event: SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
7
7
|
type OnCropChange = (pixelCrop: PixelCrop, percentCrop: PercentCrop) => void;
|
|
8
8
|
type ImageRef = {
|
|
@@ -18,6 +18,7 @@ type UploadDialogCustomProps = {
|
|
|
18
18
|
onPhotoCrop?: () => void;
|
|
19
19
|
onNextPhoto?: () => void;
|
|
20
20
|
onSkipCrop?: () => void;
|
|
21
|
+
onClearErrors?: () => void;
|
|
21
22
|
photoCrops: Crop[];
|
|
22
23
|
minDimension?: number;
|
|
23
24
|
aspectRatio?: number;
|
|
@@ -25,6 +26,16 @@ type UploadDialogCustomProps = {
|
|
|
25
26
|
circular?: boolean;
|
|
26
27
|
keepSelection?: boolean;
|
|
27
28
|
photoIndex: number;
|
|
29
|
+
photoSourceLoading: boolean;
|
|
30
|
+
loadingValue?: number;
|
|
31
|
+
errors?: FileErrorItem[];
|
|
28
32
|
};
|
|
29
33
|
export type UploadDialogProps = UploadDialogCustomProps & DialogProps;
|
|
34
|
+
export type UploadDialogErrorsProps = {
|
|
35
|
+
photoSources: PhotoDataUrl[];
|
|
36
|
+
errors?: FileErrorItem[];
|
|
37
|
+
onCloseDialogHandler?: () => void;
|
|
38
|
+
onClearErrors?: () => void;
|
|
39
|
+
locale?: Locale;
|
|
40
|
+
};
|
|
30
41
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../../../index-B2JRaoNz.js";
|
|
3
|
+
import "../../locale.js";
|
|
4
|
+
import "../../../../constants.js";
|
|
5
|
+
import { U as s } from "../../../../upload-dialog-errors-ku54UrUb.js";
|
|
6
|
+
import "../../../../DialogTitle-Du4tqTs0.js";
|
|
7
|
+
import "../../../button/button.js";
|
|
8
|
+
export {
|
|
9
|
+
s as UploadDialogErrors
|
|
10
|
+
};
|