@hai-dev/ui-kit 1.1.12 → 1.2.0
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-TrgOqpYk.js → Box-BgNAyP2L.js} +2 -2
- package/dist/{Button-BN3fv8kr.js → Button-DTV8ztWw.js} +5 -5
- package/dist/{ButtonBase-CSWuFxUv.js → ButtonBase-C4krg_zd.js} +3 -3
- package/dist/{CircularProgress-sPARyPfh.js → CircularProgress-BoaEg4rF.js} +3 -3
- package/dist/{Dialog-Cf0d7zi7.js → Dialog-BK9lMUKV.js} +12 -11
- package/dist/{DialogTitle-BtvmXSZP.js → DialogTitle-ByUfLB5M.js} +4 -4
- package/dist/{Typography-Bjd6ZHeX.js → Typography-BMyz0ZCh.js} +4 -4
- package/dist/assets/button.css +1 -1
- package/dist/assets/circular-progress-loader.css +1 -1
- package/dist/assets/code-input.css +1 -1
- package/dist/assets/error-upload-dialog.css +1 -1
- package/dist/assets/inter.css +1 -0
- package/dist/assets/photo-list.css +1 -1
- package/dist/assets/upload-dialog-errors.css +1 -1
- package/dist/button.module-C0UNQnBk.js +40 -0
- package/dist/chainPropTypes-DgqFdXGi.js +532 -0
- package/dist/components/button/button-content.js +11 -11
- package/dist/components/button/button.d.ts +18 -0
- package/dist/components/button/button.js +42 -35
- package/dist/components/button/constants.d.ts +17 -0
- package/dist/components/button/constants.js +28 -11
- package/dist/components/button/types.d.ts +11 -8
- package/dist/components/button/utils/get-button-classnames.d.ts +6 -0
- package/dist/components/button/utils/get-button-classnames.js +22 -10
- package/dist/components/circular-progress-loader/circular-progress-loader.js +14 -13
- package/dist/components/code-input/code-input.js +114 -112
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +22 -21
- package/dist/components/photo-crop-uploader/components/photo-list/constants.d.ts +5 -1
- package/dist/components/photo-crop-uploader/components/photo-list/constants.js +6 -2
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +136 -33
- package/dist/components/photo-crop-uploader/components/photo-list/types.d.ts +2 -0
- package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.d.ts +4 -0
- package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.js +22 -0
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.d.ts +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.js +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +4 -3
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +156 -145
- package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.d.ts +4 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.js +31 -0
- package/dist/components/photo-crop-uploader/locale.js +6 -2
- package/dist/{createTheme-D8R2Cz2N.js → createTheme-BoOmbNvy.js} +426 -390
- package/dist/{extendSxProp-Cw_ym9sl.js → extendSxProp-BaUCVMKV.js} +2 -1
- package/dist/{index-CL3JU48X.js → index-h5oTv8GF.js} +3 -3
- package/dist/{memoTheme-D5VCpQCz.js → memoTheme-BYBJ2Fe6.js} +1 -1
- package/dist/refType-CsohaiiT.js +60 -0
- package/dist/{upload-dialog-errors-DHl0bh1n.js → upload-dialog-errors-CCRxzIZp.js} +53 -53
- package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
- package/dist/utils/debounce.d.ts +5 -0
- package/dist/utils/debounce.js +12 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +4 -0
- package/package.json +10 -2
- package/dist/button.module-BZPPmSAS.js +0 -21
- package/dist/chainPropTypes-DiJb1lGa.js +0 -568
- package/dist/refType-CUEs_vK5.js +0 -61
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as u from "react";
|
|
2
|
-
import { f, h as a, i as m, j as l } from "./createTheme-
|
|
2
|
+
import { f, h as a, i as m, j as l } from "./createTheme-BoOmbNvy.js";
|
|
3
3
|
function h(t) {
|
|
4
4
|
return Object.keys(t).length === 0;
|
|
5
5
|
}
|
|
@@ -44,6 +44,7 @@ function j(t) {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
47
|
+
x as a,
|
|
47
48
|
j as e,
|
|
48
49
|
b as u
|
|
49
50
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { u as y, e as m } from "./extendSxProp-
|
|
4
|
-
import { P as e, k as d, T as b } from "./createTheme-
|
|
5
|
-
import { G as T, d as h } from "./chainPropTypes-
|
|
3
|
+
import { u as y, e as m } from "./extendSxProp-BaUCVMKV.js";
|
|
4
|
+
import { P as e, k as d, T as b } from "./createTheme-BoOmbNvy.js";
|
|
5
|
+
import { G as T, d as h } from "./chainPropTypes-DgqFdXGi.js";
|
|
6
6
|
function E(t) {
|
|
7
7
|
return t == null || Object.keys(t).length === 0;
|
|
8
8
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { u as l } from "./useEnhancedEffect-CJGo-L3B.js";
|
|
3
|
+
import { P as a } from "./createTheme-BoOmbNvy.js";
|
|
4
|
+
import { b as p } from "./chainPropTypes-DgqFdXGi.js";
|
|
5
|
+
function h(t) {
|
|
6
|
+
const e = u.useRef(t);
|
|
7
|
+
return l(() => {
|
|
8
|
+
e.current = t;
|
|
9
|
+
}), u.useRef((...c) => (
|
|
10
|
+
// @ts-expect-error hide `this`
|
|
11
|
+
(0, e.current)(...c)
|
|
12
|
+
)).current;
|
|
13
|
+
}
|
|
14
|
+
function C(...t) {
|
|
15
|
+
const e = u.useRef(void 0), c = u.useCallback((r) => {
|
|
16
|
+
const f = t.map((n) => {
|
|
17
|
+
if (n == null)
|
|
18
|
+
return null;
|
|
19
|
+
if (typeof n == "function") {
|
|
20
|
+
const i = n, o = i(r);
|
|
21
|
+
return typeof o == "function" ? o : () => {
|
|
22
|
+
i(null);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return n.current = r, () => {
|
|
26
|
+
n.current = null;
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
f.forEach((n) => n?.());
|
|
31
|
+
};
|
|
32
|
+
}, t);
|
|
33
|
+
return u.useMemo(() => t.every((r) => r == null) ? null : (r) => {
|
|
34
|
+
e.current && (e.current(), e.current = void 0), r != null && (e.current = c(r));
|
|
35
|
+
}, t);
|
|
36
|
+
}
|
|
37
|
+
function s(t) {
|
|
38
|
+
const {
|
|
39
|
+
prototype: e = {}
|
|
40
|
+
} = t;
|
|
41
|
+
return !!e.isReactComponent;
|
|
42
|
+
}
|
|
43
|
+
function d(t, e, c, r, f) {
|
|
44
|
+
const n = t[e], i = f || e;
|
|
45
|
+
if (n == null || // When server-side rendering React doesn't warn either.
|
|
46
|
+
// This is not an accurate check for SSR.
|
|
47
|
+
// This is only in place for emotion compat.
|
|
48
|
+
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
|
|
49
|
+
typeof window > "u")
|
|
50
|
+
return null;
|
|
51
|
+
let o;
|
|
52
|
+
return typeof n == "function" && !s(n) && (o = "Did you accidentally provide a plain function component instead?"), n === u.Fragment && (o = "Did you accidentally provide a React.Fragment instead?"), o !== void 0 ? new Error(`Invalid ${r} \`${i}\` supplied to \`${c}\`. Expected an element type that can hold a ref. ${o} For more information see https://v7.mui.com/r/caveat-with-refs-guide`) : null;
|
|
53
|
+
}
|
|
54
|
+
const E = p(a.elementType, d), T = a.oneOfType([a.func, a.object]);
|
|
55
|
+
export {
|
|
56
|
+
h as a,
|
|
57
|
+
E as e,
|
|
58
|
+
T as r,
|
|
59
|
+
C as u
|
|
60
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
1
|
+
import { jsx as s, jsxs as h, Fragment as y } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "./index-YnD2EP-S.js";
|
|
3
3
|
import { localizedText as f } from "./components/photo-crop-uploader/locale.js";
|
|
4
|
-
import { EN_LOCALE as
|
|
5
|
-
import
|
|
4
|
+
import { EN_LOCALE as S, DASH_SYMBOL as L } from "./constants.js";
|
|
5
|
+
import './assets/inter.css';import './assets/upload-dialog-errors.css';/* empty css */
|
|
6
|
+
import { D as I, a as R, b as W } from "./DialogTitle-ByUfLB5M.js";
|
|
6
7
|
import * as O from "react";
|
|
7
|
-
import { g as V, a as k, c as B, P as r } from "./createTheme-
|
|
8
|
-
import { m as C } from "./memoTheme-
|
|
9
|
-
import { u as $, c as z, s as w } from "./chainPropTypes-
|
|
10
|
-
import { Button as
|
|
11
|
-
|
|
8
|
+
import { g as V, a as k, c as B, P as r } from "./createTheme-BoOmbNvy.js";
|
|
9
|
+
import { m as C } from "./memoTheme-BYBJ2Fe6.js";
|
|
10
|
+
import { u as $, c as z, s as w } from "./chainPropTypes-DgqFdXGi.js";
|
|
11
|
+
import { Button as x } from "./components/button/button.js";
|
|
12
|
+
function E(e) {
|
|
12
13
|
return V("MuiDivider", e);
|
|
13
14
|
}
|
|
14
15
|
k("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
|
|
@@ -16,17 +17,17 @@ const M = (e) => {
|
|
|
16
17
|
const {
|
|
17
18
|
absolute: t,
|
|
18
19
|
children: o,
|
|
19
|
-
classes:
|
|
20
|
-
flexItem:
|
|
20
|
+
classes: p,
|
|
21
|
+
flexItem: g,
|
|
21
22
|
light: i,
|
|
22
23
|
orientation: n,
|
|
23
24
|
textAlign: l,
|
|
24
25
|
variant: a
|
|
25
26
|
} = e;
|
|
26
27
|
return z({
|
|
27
|
-
root: ["root", t && "absolute", a, i && "light", n === "vertical" && "vertical",
|
|
28
|
+
root: ["root", t && "absolute", a, i && "light", n === "vertical" && "vertical", g && "flexItem", o && "withChildren", o && n === "vertical" && "withChildrenVertical", l === "right" && n !== "vertical" && "textAlignRight", l === "left" && n !== "vertical" && "textAlignLeft"],
|
|
28
29
|
wrapper: ["wrapper", n === "vertical" && "wrapperVertical"]
|
|
29
|
-
}, E,
|
|
30
|
+
}, E, p);
|
|
30
31
|
}, U = w("div", {
|
|
31
32
|
name: "MuiDivider",
|
|
32
33
|
slot: "Root",
|
|
@@ -193,50 +194,50 @@ const M = (e) => {
|
|
|
193
194
|
paddingBottom: `calc(${e.spacing(1)} * 1.2)`
|
|
194
195
|
}
|
|
195
196
|
}]
|
|
196
|
-
}))),
|
|
197
|
-
const
|
|
197
|
+
}))), m = /* @__PURE__ */ O.forwardRef(function(t, o) {
|
|
198
|
+
const p = $({
|
|
198
199
|
props: t,
|
|
199
200
|
name: "MuiDivider"
|
|
200
201
|
}), {
|
|
201
|
-
absolute:
|
|
202
|
+
absolute: g = !1,
|
|
202
203
|
children: i,
|
|
203
204
|
className: n,
|
|
204
205
|
orientation: l = "horizontal",
|
|
205
206
|
component: a = i || l === "vertical" ? "div" : "hr",
|
|
206
207
|
flexItem: b = !1,
|
|
207
208
|
light: A = !1,
|
|
208
|
-
role:
|
|
209
|
+
role: u = a !== "hr" ? "separator" : void 0,
|
|
209
210
|
textAlign: D = "center",
|
|
210
211
|
variant: N = "fullWidth",
|
|
211
212
|
...T
|
|
212
|
-
} =
|
|
213
|
-
...
|
|
214
|
-
absolute:
|
|
213
|
+
} = p, v = {
|
|
214
|
+
...p,
|
|
215
|
+
absolute: g,
|
|
215
216
|
component: a,
|
|
216
217
|
flexItem: b,
|
|
217
218
|
light: A,
|
|
218
219
|
orientation: l,
|
|
219
|
-
role:
|
|
220
|
+
role: u,
|
|
220
221
|
textAlign: D,
|
|
221
222
|
variant: N
|
|
222
|
-
}, _ = M(
|
|
223
|
+
}, _ = M(v);
|
|
223
224
|
return /* @__PURE__ */ s(U, {
|
|
224
225
|
as: a,
|
|
225
226
|
className: B(_.root, n),
|
|
226
|
-
role:
|
|
227
|
+
role: u,
|
|
227
228
|
ref: o,
|
|
228
|
-
ownerState:
|
|
229
|
-
"aria-orientation":
|
|
229
|
+
ownerState: v,
|
|
230
|
+
"aria-orientation": u === "separator" && (a !== "hr" || l === "vertical") ? l : void 0,
|
|
230
231
|
...T,
|
|
231
232
|
children: i ? /* @__PURE__ */ s(j, {
|
|
232
233
|
className: _.wrapper,
|
|
233
|
-
ownerState:
|
|
234
|
+
ownerState: v,
|
|
234
235
|
children: i
|
|
235
236
|
}) : null
|
|
236
237
|
});
|
|
237
238
|
});
|
|
238
|
-
|
|
239
|
-
process.env.NODE_ENV !== "production" && (
|
|
239
|
+
m && (m.muiSkipListHighlight = !0);
|
|
240
|
+
process.env.NODE_ENV !== "production" && (m.propTypes = {
|
|
240
241
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
241
242
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
242
243
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -299,7 +300,7 @@ process.env.NODE_ENV !== "production" && (v.propTypes = {
|
|
|
299
300
|
*/
|
|
300
301
|
variant: r.oneOfType([r.oneOf(["fullWidth", "inset", "middle"]), r.string])
|
|
301
302
|
});
|
|
302
|
-
const H = "
|
|
303
|
+
const H = "_dialog_1y4gd_1", P = "_dark_1y4gd_4", F = "_errorContent_1y4gd_8", Y = "_errorItem_1y4gd_60", q = "_fileName_1y4gd_67", G = "_topActions_1y4gd_70", J = "_close_1y4gd_76", K = "_botActions_1y4gd_84", Q = "_button_1y4gd_90", X = "_title_1y4gd_95", Z = "_content_1y4gd_102", tt = "_many_1y4gd_124", et = "_crop_1y4gd_128", ot = "_dialogText_1y4gd_176", d = {
|
|
303
304
|
dialog: H,
|
|
304
305
|
dark: P,
|
|
305
306
|
errorContent: F,
|
|
@@ -312,49 +313,48 @@ const H = "_dialog_n5vpn_1", P = "_dark_n5vpn_1", F = "_errorContent_n5vpn_5", Y
|
|
|
312
313
|
title: X,
|
|
313
314
|
content: Z,
|
|
314
315
|
many: tt,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}, gt = (e) => {
|
|
316
|
+
crop: et,
|
|
317
|
+
dialogText: ot
|
|
318
|
+
}, ht = (e) => {
|
|
319
319
|
const {
|
|
320
320
|
photoSources: t,
|
|
321
321
|
errors: o = [],
|
|
322
|
-
onCloseDialogHandler:
|
|
323
|
-
onClearErrors:
|
|
324
|
-
locale: i =
|
|
322
|
+
onCloseDialogHandler: p,
|
|
323
|
+
onClearErrors: g,
|
|
324
|
+
locale: i = S
|
|
325
325
|
} = e;
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */ s(I, { className: c(
|
|
328
|
-
/* @__PURE__ */ s(R, { className: c(
|
|
329
|
-
!!a && /* @__PURE__ */ s(
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */ s("span", { className: c(
|
|
326
|
+
return /* @__PURE__ */ h(y, { children: [
|
|
327
|
+
/* @__PURE__ */ s(I, { className: c(d.title), children: t.length ? f[i]["some-not-uploaded"] : f[i]["not-uploaded"] }),
|
|
328
|
+
/* @__PURE__ */ s(R, { className: c(d.errorContent), children: o.map(({ photoName: n, errorMessage: l }, a) => /* @__PURE__ */ h(y, { children: [
|
|
329
|
+
!!a && /* @__PURE__ */ s(m, {}),
|
|
330
|
+
/* @__PURE__ */ h("div", { className: c(d.errorItem), children: [
|
|
331
|
+
/* @__PURE__ */ s("span", { className: c(d.fileName), children: n }),
|
|
332
332
|
" ",
|
|
333
|
-
` ${
|
|
333
|
+
` ${L} ${l}`
|
|
334
334
|
] })
|
|
335
335
|
] }, a)) }),
|
|
336
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ h(W, { className: c(d.botActions), children: [
|
|
337
337
|
/* @__PURE__ */ s(
|
|
338
|
-
|
|
338
|
+
x,
|
|
339
339
|
{
|
|
340
340
|
buttonSize: "small",
|
|
341
|
-
buttonColor: "
|
|
341
|
+
buttonColor: "red",
|
|
342
342
|
buttonVariant: "outlined",
|
|
343
343
|
buttonWeight: 500,
|
|
344
|
-
onClick:
|
|
345
|
-
className: c(
|
|
344
|
+
onClick: p,
|
|
345
|
+
className: c(d.button),
|
|
346
346
|
children: f[i].close
|
|
347
347
|
}
|
|
348
348
|
),
|
|
349
349
|
!!t.length && /* @__PURE__ */ s(
|
|
350
|
-
|
|
350
|
+
x,
|
|
351
351
|
{
|
|
352
352
|
buttonSize: "small",
|
|
353
353
|
buttonColor: "blue",
|
|
354
|
-
buttonVariant: "
|
|
354
|
+
buttonVariant: "outlined",
|
|
355
355
|
buttonWeight: 500,
|
|
356
|
-
onClick:
|
|
357
|
-
className: c(
|
|
356
|
+
onClick: g,
|
|
357
|
+
className: c(d.button),
|
|
358
358
|
children: f[i].continue
|
|
359
359
|
}
|
|
360
360
|
)
|
|
@@ -362,6 +362,6 @@ const H = "_dialog_n5vpn_1", P = "_dark_n5vpn_1", F = "_errorContent_n5vpn_5", Y
|
|
|
362
362
|
] });
|
|
363
363
|
};
|
|
364
364
|
export {
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
ht as U,
|
|
366
|
+
d as s
|
|
367
367
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { debounce } from './debounce';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hai-dev/ui-kit",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Vladislav Knitrunov",
|
|
@@ -22,7 +22,15 @@
|
|
|
22
22
|
"preview": "vite preview",
|
|
23
23
|
"storybook": "storybook dev -p 6006",
|
|
24
24
|
"build-storybook": "storybook build",
|
|
25
|
-
"prepare": "husky"
|
|
25
|
+
"prepare": "husky",
|
|
26
|
+
"sync:setup": "node scripts/sync.cjs setup",
|
|
27
|
+
"sync:update": "node scripts/sync.cjs update",
|
|
28
|
+
"sync:pull:all": "node scripts/sync.cjs pull:all",
|
|
29
|
+
"sync:pull:existing": "node scripts/sync.cjs pull:existing",
|
|
30
|
+
"sync:pull:new": "node scripts/sync.cjs pull:new",
|
|
31
|
+
"sync:push:all": "node scripts/sync.cjs push:all",
|
|
32
|
+
"sync:push:new": "node scripts/sync.cjs push:new",
|
|
33
|
+
"sync:push:existing": "node scripts/sync.cjs push:existing"
|
|
26
34
|
},
|
|
27
35
|
"peerDependencies": {
|
|
28
36
|
"@emotion/react": "11.14.0",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import './assets/button.css';const t = "_button_fufd7_1", _ = "_startContent_fufd7_9", n = "_endContent_fufd7_12", e = "_link_fufd7_15", f = "_description_fufd7_24", s = "_text_fufd7_29", d = "_withDescription_fufd7_33", i = "_specific_fufd7_36", o = "_small_fufd7_46", c = "_filled_fufd7_51", l = "_white_fufd7_51", u = "_blue_fufd7_61", a = "_gray_fufd7_68", r = "_outlined_fufd7_72", p = "_disabled_fufd7_97", b = {
|
|
2
|
-
button: t,
|
|
3
|
-
startContent: _,
|
|
4
|
-
endContent: n,
|
|
5
|
-
link: e,
|
|
6
|
-
description: f,
|
|
7
|
-
text: s,
|
|
8
|
-
withDescription: d,
|
|
9
|
-
specific: i,
|
|
10
|
-
default: "_default_fufd7_40",
|
|
11
|
-
small: o,
|
|
12
|
-
filled: c,
|
|
13
|
-
white: l,
|
|
14
|
-
blue: u,
|
|
15
|
-
gray: a,
|
|
16
|
-
outlined: r,
|
|
17
|
-
disabled: p
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
b as s
|
|
21
|
-
};
|