@hai-dev/ui-kit 1.0.4 → 1.0.6
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-CiYPzbPd.js +56 -0
- package/dist/{Button-DDlVTM6i.js → Button-chJUX25I.js} +26 -24
- package/dist/ButtonBase-DZwhOh56.js +966 -0
- package/dist/{CircularProgress-CscJm1An.js → CircularProgress-BCrSQadM.js} +113 -105
- package/dist/{DialogTitle-KN1sayHD.js → DialogTitle-BUcXvkzd.js} +638 -884
- package/dist/Typography-BmYEfS8y.js +257 -0
- package/dist/assets/circular-progress-loader.css +1 -0
- package/dist/chainPropTypes-HYSaT0L0.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 +30 -29
- 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 +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +13 -11
- package/dist/components/photo-crop-uploader/photo-crop-uploader.js +30 -30
- package/dist/components/photo-crop-uploader/types.d.ts +1 -4
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/{createTheme-DSHGFfg6.js → createTheme-BfVKUMHQ.js} +10 -10
- 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-CzeED7BH.js → extendSxProp-bpz0eCso.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -14
- package/dist/useId-CK6Kn3Tn.js +21 -0
- package/package.json +8 -8
- package/dist/ButtonBase-CXGZ-DBC.js +0 -1346
|
@@ -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, s = y("div", {
|
|
14
|
-
shouldForwardProp: (c) => c !== "theme" && c !== "sx" && c !== "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(s, {
|
|
23
|
-
as: _,
|
|
24
|
-
ref: N,
|
|
25
|
-
className: B(g, r ? r(a) : a),
|
|
26
|
-
theme: m && h[m] || 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", o = {
|
|
57
|
-
photoList: z,
|
|
58
|
-
item: R,
|
|
59
|
-
image: q
|
|
60
|
-
}, G = (l) => {
|
|
61
|
-
const { photoSources: m, photoIndex: p, className: a, ...r } = l, s = m.slice(p);
|
|
62
|
-
return s.length > u ? /* @__PURE__ */ f(d, { className: n(o.photoList, a), ...r, children: [
|
|
63
|
-
s.slice(0, u - 1).map((t) => /* @__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-CiYPzbPd.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
|
-
s.length -
|
|
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
|
};
|
|
@@ -5,7 +5,7 @@ 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-
|
|
8
|
+
import { B as H } from "../../../../Button-chJUX25I.js";
|
|
9
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", a = {
|
|
10
10
|
dragDropWrapper: F,
|
|
11
11
|
input: z
|
|
@@ -6,11 +6,13 @@ import { localizedText as p } from "../../locale.js";
|
|
|
6
6
|
import { EN_LOCALE as W } from "../../../../constants.js";
|
|
7
7
|
import { CLOSE_ICON_SIZE as R } from "./constants.js";
|
|
8
8
|
import { DEFAULT_MIN_DIMENSION as j, DEFAULT_ASPECT_RATIO as F } from "../../constants.js";
|
|
9
|
-
import { D as U, c as x, a as $, b as V } from "../../../../DialogTitle-
|
|
9
|
+
import { D as U, c as x, a as $, b as V } from "../../../../DialogTitle-BUcXvkzd.js";
|
|
10
10
|
import * as L from "react";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { u as
|
|
11
|
+
import { g as H, d as Z, c as Y, e as m, P as t } from "../../../../createTheme-BfVKUMHQ.js";
|
|
12
|
+
import { m as A, c as O, C as q } from "../../../../CircularProgress-BCrSQadM.js";
|
|
13
|
+
import { u as G, s as w, c as J, d as K } from "../../../../chainPropTypes-HYSaT0L0.js";
|
|
14
|
+
import { u as Q } from "../../../../useId-CK6Kn3Tn.js";
|
|
15
|
+
import { B as X } from "../../../../ButtonBase-DZwhOh56.js";
|
|
14
16
|
import { Button as T } from "../../../button/button.js";
|
|
15
17
|
import '../../../../assets/upload-dialog.css';function oo(o) {
|
|
16
18
|
return Z("MuiIconButton", o);
|
|
@@ -28,8 +30,8 @@ const k = H("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
28
30
|
loadingIndicator: ["loadingIndicator"],
|
|
29
31
|
loadingWrapper: ["loadingWrapper"]
|
|
30
32
|
};
|
|
31
|
-
return
|
|
32
|
-
}, eo = w(
|
|
33
|
+
return J(u, oo, e);
|
|
34
|
+
}, eo = w(X, {
|
|
33
35
|
name: "MuiIconButton",
|
|
34
36
|
slot: "Root",
|
|
35
37
|
overridesResolver: (o, e) => {
|
|
@@ -163,7 +165,7 @@ const k = H("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
163
165
|
}
|
|
164
166
|
}]
|
|
165
167
|
})), P = /* @__PURE__ */ L.forwardRef(function(e, n) {
|
|
166
|
-
const c =
|
|
168
|
+
const c = G({
|
|
167
169
|
props: e,
|
|
168
170
|
name: "MuiIconButton"
|
|
169
171
|
}), {
|
|
@@ -178,7 +180,7 @@ const k = H("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
178
180
|
loading: d = null,
|
|
179
181
|
loadingIndicator: s,
|
|
180
182
|
...S
|
|
181
|
-
} = c, _ =
|
|
183
|
+
} = c, _ = Q(h), v = s ?? /* @__PURE__ */ a(q, {
|
|
182
184
|
"aria-labelledby": _,
|
|
183
185
|
color: "inherit",
|
|
184
186
|
size: 16
|
|
@@ -223,7 +225,7 @@ process.env.NODE_ENV !== "production" && (P.propTypes = {
|
|
|
223
225
|
/**
|
|
224
226
|
* The icon to display.
|
|
225
227
|
*/
|
|
226
|
-
children:
|
|
228
|
+
children: K(t.node, (o) => L.Children.toArray(o.children).some((n) => /* @__PURE__ */ L.isValidElement(n) && n.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
|
|
227
229
|
`)) : null),
|
|
228
230
|
/**
|
|
229
231
|
* Override or extend the styles applied to the component.
|
|
@@ -305,7 +307,7 @@ const ao = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
|
|
|
305
307
|
many: uo,
|
|
306
308
|
crop: mo,
|
|
307
309
|
dialogText: bo
|
|
308
|
-
},
|
|
310
|
+
}, Ao = (o) => {
|
|
309
311
|
const {
|
|
310
312
|
onCloseDialogHandler: e,
|
|
311
313
|
photoSources: n = [],
|
|
@@ -423,5 +425,5 @@ const ao = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
|
|
|
423
425
|
);
|
|
424
426
|
};
|
|
425
427
|
export {
|
|
426
|
-
|
|
428
|
+
Ao as UploadDialog
|
|
427
429
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as io, Fragment as ho, jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import { useState as s, useRef as
|
|
2
|
+
import { useState as s, useRef as N } from "react";
|
|
3
3
|
import "../../index-BiffjjQq.js";
|
|
4
4
|
import { c as mo } from "../../index-B2JRaoNz.js";
|
|
5
5
|
import { localizedText as fo } from "./locale.js";
|
|
6
|
-
import { EN_LOCALE as
|
|
7
|
-
import { DEFAULT_MIN_DIMENSION as
|
|
6
|
+
import { EN_LOCALE as uo } from "../../constants.js";
|
|
7
|
+
import { DEFAULT_MIN_DIMENSION as Co, DEFAULT_ASPECT_RATIO as go, DEFAULT_TIMEOUT as Po, DEFAULT_FILE_MAX_SIZE as Eo } from "./constants.js";
|
|
8
8
|
import { UploadDialog as Do } from "./components/upload-dialog/upload-dialog.js";
|
|
9
9
|
import { UploadButton as So } from "./components/upload-button/upload-button.js";
|
|
10
10
|
import { ErrorUploadDialog as Lo } from "./components/error-upload-dialog/error-upload-dialog.js";
|
|
11
|
-
import { validatePhotoFile as
|
|
11
|
+
import { validatePhotoFile as b } from "./utils/validate-photo-file.js";
|
|
12
12
|
import { readPhoto as R } from "./utils/read-photo.js";
|
|
13
13
|
import { getPhotoCrop as wo } from "./utils/get-photo-crop.js";
|
|
14
|
-
import { getCropedPhoto as
|
|
15
|
-
import { getDefaultCroppedPhoto as
|
|
16
|
-
import '../../assets/photo-crop-uploader.css';const
|
|
17
|
-
photoCropCanvas:
|
|
14
|
+
import { getCropedPhoto as _o } from "./utils/get-croped-photo.js";
|
|
15
|
+
import { getDefaultCroppedPhoto as xo } from "./utils/get-default-cropped-photo.js";
|
|
16
|
+
import '../../assets/photo-crop-uploader.css';const Uo = "_photoCropCanvas_1i4lr_1", yo = {
|
|
17
|
+
photoCropCanvas: Uo
|
|
18
18
|
}, Xo = (k) => {
|
|
19
19
|
const {
|
|
20
20
|
buttonClassname: z = "",
|
|
@@ -37,9 +37,9 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
37
37
|
onClose: P = () => {
|
|
38
38
|
},
|
|
39
39
|
showErrorPopup: K = !1,
|
|
40
|
-
minDimension: a =
|
|
40
|
+
minDimension: a = Co,
|
|
41
41
|
aspectRatio: m = go,
|
|
42
|
-
locale: e =
|
|
42
|
+
locale: e = uo,
|
|
43
43
|
timeout: E = Po,
|
|
44
44
|
fileMaxSize: D = Eo,
|
|
45
45
|
allowedExtensions: d,
|
|
@@ -47,18 +47,18 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
47
47
|
circular: Q,
|
|
48
48
|
width: V,
|
|
49
49
|
keepSelection: W,
|
|
50
|
-
|
|
50
|
+
uploadButton: Y,
|
|
51
51
|
multiple: L,
|
|
52
52
|
fromSources: $,
|
|
53
53
|
...oo
|
|
54
|
-
} = k, [to, i] = s(!1), [p, w] = s([]), [f,
|
|
54
|
+
} = k, [to, i] = s(!1), [p, w] = s([]), [f, u] = s([]), [l, _] = s(0), x = N(null), U = N(null), [y, A] = s(!1), [T, v] = s(""), [ro, I] = s(!1), F = (o = []) => {
|
|
55
55
|
P(o, p), i(!1);
|
|
56
56
|
}, eo = () => {
|
|
57
57
|
P([], p), i(!1);
|
|
58
58
|
}, no = () => {
|
|
59
59
|
I(!1);
|
|
60
|
-
},
|
|
61
|
-
j(o), w(o),
|
|
60
|
+
}, C = (o) => {
|
|
61
|
+
j(o), w(o), u(Array(o.length)), _(0), i(!0), v("");
|
|
62
62
|
}, g = (o) => {
|
|
63
63
|
o instanceof Error && (console.warn(o.message), B(o), v(o.message), I(!0), w([]), i(!1));
|
|
64
64
|
}, ao = async (o) => {
|
|
@@ -68,7 +68,7 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
68
68
|
if (A(!0), H(), L) {
|
|
69
69
|
const t = Array.from(r);
|
|
70
70
|
t.forEach((c) => {
|
|
71
|
-
|
|
71
|
+
b(
|
|
72
72
|
c,
|
|
73
73
|
{ maxSize: D, allowedExtensions: d, allowedMimeTypes: S },
|
|
74
74
|
e
|
|
@@ -79,16 +79,16 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
79
79
|
(c) => R(c, a, e, E)
|
|
80
80
|
)
|
|
81
81
|
);
|
|
82
|
-
|
|
82
|
+
C(n);
|
|
83
83
|
} else {
|
|
84
84
|
const t = r[0];
|
|
85
|
-
|
|
85
|
+
b(
|
|
86
86
|
t,
|
|
87
87
|
{ maxSize: D, allowedExtensions: d, allowedMimeTypes: S },
|
|
88
88
|
e
|
|
89
89
|
);
|
|
90
90
|
const n = await R(t, a, e, E);
|
|
91
|
-
|
|
91
|
+
C([n]);
|
|
92
92
|
}
|
|
93
93
|
} catch (t) {
|
|
94
94
|
g(t);
|
|
@@ -97,21 +97,21 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
97
97
|
}
|
|
98
98
|
}, so = (o) => {
|
|
99
99
|
const { width: r, height: t } = o.currentTarget, n = wo(r, t, a, m);
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
return
|
|
100
|
+
u((c) => {
|
|
101
|
+
const M = [...c];
|
|
102
|
+
return M[l] = n, M;
|
|
103
103
|
});
|
|
104
104
|
}, lo = (o, r) => {
|
|
105
|
-
|
|
105
|
+
u((t) => {
|
|
106
106
|
const n = [...t];
|
|
107
107
|
return n[l] = r, n;
|
|
108
108
|
});
|
|
109
109
|
}, O = () => {
|
|
110
|
-
const o =
|
|
110
|
+
const o = U.current, r = x.current;
|
|
111
111
|
if (o && r && f)
|
|
112
112
|
try {
|
|
113
113
|
X();
|
|
114
|
-
const t =
|
|
114
|
+
const t = _o(
|
|
115
115
|
r,
|
|
116
116
|
o,
|
|
117
117
|
f[l],
|
|
@@ -122,13 +122,13 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
122
122
|
t instanceof Error && (console.warn(t), g(t));
|
|
123
123
|
}
|
|
124
124
|
}, po = () => {
|
|
125
|
-
O(),
|
|
125
|
+
O(), _((o) => o + 1);
|
|
126
126
|
}, co = async () => {
|
|
127
127
|
const o = p.slice(l);
|
|
128
128
|
try {
|
|
129
129
|
const r = await Promise.all(
|
|
130
130
|
o.map(
|
|
131
|
-
(t) =>
|
|
131
|
+
(t) => xo(t, a, m, e)
|
|
132
132
|
)
|
|
133
133
|
);
|
|
134
134
|
F(r);
|
|
@@ -141,7 +141,7 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
141
141
|
So,
|
|
142
142
|
{
|
|
143
143
|
onChange: ao,
|
|
144
|
-
onPhotoDataLoaded:
|
|
144
|
+
onPhotoDataLoaded: C,
|
|
145
145
|
buttonClassname: z,
|
|
146
146
|
disabled: y,
|
|
147
147
|
buttonDisabled: y,
|
|
@@ -151,7 +151,7 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
151
151
|
onDragDrop: J,
|
|
152
152
|
onDragLeave: G,
|
|
153
153
|
onDragOver: q,
|
|
154
|
-
button: Y
|
|
154
|
+
button: Y,
|
|
155
155
|
multiple: L,
|
|
156
156
|
fromSources: $,
|
|
157
157
|
...oo,
|
|
@@ -171,7 +171,7 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
171
171
|
onCropChange: lo,
|
|
172
172
|
onPhotoCrop: O,
|
|
173
173
|
onPhotoLoad: so,
|
|
174
|
-
imageRef:
|
|
174
|
+
imageRef: x,
|
|
175
175
|
minDimension: a,
|
|
176
176
|
aspectRatio: m,
|
|
177
177
|
locale: e,
|
|
@@ -195,7 +195,7 @@ import '../../assets/photo-crop-uploader.css';const xo = "_photoCropCanvas_1i4lr
|
|
|
195
195
|
className: mo(yo.photoCropCanvas),
|
|
196
196
|
width: a,
|
|
197
197
|
height: a,
|
|
198
|
-
ref:
|
|
198
|
+
ref: U
|
|
199
199
|
}
|
|
200
200
|
)
|
|
201
201
|
] });
|
|
@@ -10,9 +10,6 @@ export type PhotoFileOptions = {
|
|
|
10
10
|
allowedExtensions?: PhotoExtension[];
|
|
11
11
|
allowedMimeTypes?: PhotoMimeType[];
|
|
12
12
|
};
|
|
13
|
-
export type PhotoCropUploaderSlots = {
|
|
14
|
-
button?: ReactNode;
|
|
15
|
-
};
|
|
16
13
|
export type PhotoCropUploaderCustomProps = {
|
|
17
14
|
buttonClassname?: string;
|
|
18
15
|
onStartUpload?: () => unknown;
|
|
@@ -35,7 +32,7 @@ export type PhotoCropUploaderCustomProps = {
|
|
|
35
32
|
circular?: boolean;
|
|
36
33
|
keepSelection?: boolean;
|
|
37
34
|
width?: number;
|
|
38
|
-
|
|
35
|
+
uploadButton?: ReactNode;
|
|
39
36
|
fromSources?: PhotoDataUrl[];
|
|
40
37
|
};
|
|
41
38
|
export type PhotoCropUploaderProps = PhotoCropUploaderCustomProps & InputHTMLAttributes<HTMLInputElement>;
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -1831,7 +1831,7 @@ function vo() {
|
|
|
1831
1831
|
var So = /* @__PURE__ */ vo();
|
|
1832
1832
|
const je = /* @__PURE__ */ bn(So);
|
|
1833
1833
|
/**
|
|
1834
|
-
* @mui/styled-engine v7.3.
|
|
1834
|
+
* @mui/styled-engine v7.3.3
|
|
1835
1835
|
*
|
|
1836
1836
|
* @license MIT
|
|
1837
1837
|
* This source code is licensed under the MIT license found in the
|
|
@@ -4099,18 +4099,18 @@ export {
|
|
|
4099
4099
|
Ci as C,
|
|
4100
4100
|
ha as E,
|
|
4101
4101
|
je as P,
|
|
4102
|
-
|
|
4102
|
+
pa as T,
|
|
4103
4103
|
Mr as _,
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4104
|
+
Cr as a,
|
|
4105
|
+
Ca as b,
|
|
4106
|
+
va as c,
|
|
4107
|
+
sn as d,
|
|
4108
4108
|
tn as e,
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4109
|
+
Qt as f,
|
|
4110
|
+
Sa as g,
|
|
4111
|
+
vi as h,
|
|
4112
4112
|
xe as i,
|
|
4113
|
-
|
|
4113
|
+
Sr as j,
|
|
4114
4114
|
Gr as k,
|
|
4115
4115
|
Jt as l,
|
|
4116
4116
|
ma as m,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
const n = ({ children: e }) => /* @__PURE__ */ t(
|
|
3
|
+
"div",
|
|
4
|
+
{
|
|
5
|
+
style: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
display: "flex",
|
|
8
|
+
alignItems: "center",
|
|
9
|
+
justifyContent: "center"
|
|
10
|
+
},
|
|
11
|
+
children: e
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
export {
|
|
15
|
+
n as CenteredDecorator
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CenteredDecorator } from './centered-decorator';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as u, h as f, i as a, j as m } from "./createTheme-BfVKUMHQ.js";
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
function h(t) {
|
|
4
4
|
return Object.keys(t).length === 0;
|
|
@@ -20,7 +20,7 @@ const P = (t) => {
|
|
|
20
20
|
r[s] ? e.systemProps[s] = t[s] : e.otherProps[s] = t[s];
|
|
21
21
|
}), e;
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function j(t) {
|
|
24
24
|
const {
|
|
25
25
|
sx: e,
|
|
26
26
|
...r
|
|
@@ -44,6 +44,6 @@ function g(t) {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
j as e,
|
|
48
48
|
b as u
|
|
49
49
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PhotoCropUploader, Button } from './components';
|
|
1
|
+
export { PhotoCropUploader, Button, CircularProgressLoader, } from './components';
|
|
2
2
|
export type { Locale } from './types';
|
|
3
3
|
export type { PhotoDataUrl, PhotoFileSize, PhotoExtension, PhotoMimeType, PhotoFileOptions, PhotoCropUploaderProps, } from './components/photo-crop-uploader/types';
|
|
4
4
|
export { EN_LOCALE, RU_LOCALE, BYTE_TO_KILOBYTE } from './constants';
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { BYTE_TO_KILOBYTE as G, EN_LOCALE as I, RU_LOCALE as
|
|
2
|
-
import { BMP_IMAGE_EXT as
|
|
3
|
-
import { PhotoCropUploader as
|
|
4
|
-
import { Button as
|
|
1
|
+
import { BYTE_TO_KILOBYTE as G, EN_LOCALE as I, RU_LOCALE as P } from "./constants.js";
|
|
2
|
+
import { BMP_IMAGE_EXT as M, BMP_IMAGE_TYPE as A, GIF_IMAGE_EXT as o, GIF_IMAGE_TYPE as r, ICO_IMAGE_EXT as Y, ICO_IMAGE_TYPE as O, JPEG_IMAGE_EXT as e, JPEG_IMAGE_TYPE as t, JPG_IMAGE_EXT as C, JPG_IMAGE_TYPE as X, MICROSOFT_ICO_IMAGE_TYPE as p, PNG_IMAGE_EXT as B, PNG_IMAGE_TYPE as L, SVG_IMAGE_EXT as f, SVG_IMAGE_TYPE as m, WEBP_IMAGE_EXT as x, WEBP_IMAGE_TYPE as J } from "./components/photo-crop-uploader/constants.js";
|
|
3
|
+
import { PhotoCropUploader as F } from "./components/photo-crop-uploader/photo-crop-uploader.js";
|
|
4
|
+
import { Button as S } from "./components/button/button.js";
|
|
5
|
+
import { CircularProgressLoader as l } from "./components/circular-progress-loader/circular-progress-loader.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
M as BMP_IMAGE_EXT,
|
|
7
8
|
A as BMP_IMAGE_TYPE,
|
|
8
9
|
G as BYTE_TO_KILOBYTE,
|
|
9
|
-
|
|
10
|
+
S as Button,
|
|
11
|
+
l as CircularProgressLoader,
|
|
10
12
|
I as EN_LOCALE,
|
|
11
13
|
o as GIF_IMAGE_EXT,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
r as GIF_IMAGE_TYPE,
|
|
15
|
+
Y as ICO_IMAGE_EXT,
|
|
14
16
|
O as ICO_IMAGE_TYPE,
|
|
15
|
-
|
|
17
|
+
e as JPEG_IMAGE_EXT,
|
|
16
18
|
t as JPEG_IMAGE_TYPE,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
C as JPG_IMAGE_EXT,
|
|
20
|
+
X as JPG_IMAGE_TYPE,
|
|
19
21
|
p as MICROSOFT_ICO_IMAGE_TYPE,
|
|
20
|
-
|
|
22
|
+
B as PNG_IMAGE_EXT,
|
|
21
23
|
L as PNG_IMAGE_TYPE,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
F as PhotoCropUploader,
|
|
25
|
+
P as RU_LOCALE,
|
|
24
26
|
f as SVG_IMAGE_EXT,
|
|
25
27
|
m as SVG_IMAGE_TYPE,
|
|
26
28
|
x as WEBP_IMAGE_EXT,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
let n = 0;
|
|
3
|
+
function o(t) {
|
|
4
|
+
const [e, a] = u.useState(t), c = t || e;
|
|
5
|
+
return u.useEffect(() => {
|
|
6
|
+
e == null && (n += 1, a(`mui-${n}`));
|
|
7
|
+
}, [e]), c;
|
|
8
|
+
}
|
|
9
|
+
const f = {
|
|
10
|
+
...u
|
|
11
|
+
}, s = f.useId;
|
|
12
|
+
function l(t) {
|
|
13
|
+
if (s !== void 0) {
|
|
14
|
+
const e = s();
|
|
15
|
+
return t ?? e;
|
|
16
|
+
}
|
|
17
|
+
return o(t);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
l as u
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hai-dev/ui-kit",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
|
+
"license": "UNLICENSED",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "Vladislav Knitrunov",
|
|
7
8
|
"email": "kingvlad3008@gmail.com",
|
|
@@ -26,8 +27,7 @@
|
|
|
26
27
|
"peerDependencies": {
|
|
27
28
|
"@emotion/react": "^11.14.0",
|
|
28
29
|
"@emotion/styled": "^11.14.1",
|
|
29
|
-
"@mui/material": "^7.3.
|
|
30
|
-
"@types/node": "^24.5.2",
|
|
30
|
+
"@mui/material": "^7.3.4",
|
|
31
31
|
"classnames": "^2.5.1",
|
|
32
32
|
"react": "^19.1.1",
|
|
33
33
|
"react-dom": "^19.1.1",
|
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
"sass": "^1.93.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
+
"@commitlint/cli": "^20.0.0",
|
|
39
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
38
40
|
"@emotion/react": "^11.14.0",
|
|
39
41
|
"@emotion/styled": "^11.14.1",
|
|
40
42
|
"@eslint/js": "^9.36.0",
|
|
41
|
-
"@mui/material": "^7.3.
|
|
43
|
+
"@mui/material": "^7.3.4",
|
|
42
44
|
"@storybook/addon-docs": "9.1.8",
|
|
43
45
|
"@storybook/addon-onboarding": "9.1.8",
|
|
44
46
|
"@storybook/react-vite": "9.1.8",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"eslint-plugin-storybook": "9.1.8",
|
|
54
56
|
"glob": "^11.0.3",
|
|
55
57
|
"globals": "^16.4.0",
|
|
58
|
+
"husky": "^9.1.7",
|
|
56
59
|
"react": "^19.1.1",
|
|
57
60
|
"react-dom": "^19.1.1",
|
|
58
61
|
"react-image-crop": "^11.0.10",
|
|
@@ -62,10 +65,7 @@
|
|
|
62
65
|
"typescript-eslint": "^8.44.0",
|
|
63
66
|
"vite": "^7.1.7",
|
|
64
67
|
"vite-plugin-dts": "^4.5.4",
|
|
65
|
-
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
66
|
-
"@commitlint/cli": "^20.0.0",
|
|
67
|
-
"@commitlint/config-conventional": "^20.0.0",
|
|
68
|
-
"husky": "^9.1.7"
|
|
68
|
+
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
69
69
|
},
|
|
70
70
|
"sideEffects": [
|
|
71
71
|
"**/*.css"
|