@hai-dev/ui-kit 1.0.0 → 1.0.1
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/Button-0AB7oP6Y.js +655 -0
- package/dist/ButtonBase-Bw_3RZmN.js +5453 -0
- package/dist/CircularProgress-BD6BPlN2.js +290 -0
- package/dist/{DialogTitle-1A3dJ174.js → DialogTitle-iOQ7wKEt.js} +78 -78
- package/dist/assets/button.css +1 -0
- package/dist/assets/upload-button.css +1 -1
- package/dist/assets/upload-dialog.css +1 -1
- package/dist/button.module-BZPPmSAS.js +21 -0
- package/dist/components/button/button-content.d.ts +3 -0
- package/dist/components/button/button-content.js +17 -0
- package/dist/components/button/button.d.ts +3 -0
- package/dist/components/button/button.js +65 -0
- package/dist/components/button/button.stories.d.ts +7 -0
- package/dist/components/button/constants.d.ts +12 -0
- package/dist/components/button/constants.js +15 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.js +4 -0
- package/dist/components/button/types.d.ts +38 -0
- package/dist/components/button/types.js +1 -0
- package/dist/components/button/utils/get-button-classnames.d.ts +2 -0
- package/dist/components/button/utils/get-button-classnames.js +17 -0
- package/dist/components/button/utils/index.d.ts +1 -0
- package/dist/components/button/utils/index.js +4 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +4 -2
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +10 -9
- package/dist/components/photo-crop-uploader/components/upload-button/constants.d.ts +1 -1
- package/dist/components/photo-crop-uploader/components/upload-button/constants.js +1 -1
- package/dist/components/photo-crop-uploader/components/upload-button/types.d.ts +5 -1
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +81 -58
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +354 -87
- package/dist/components/photo-crop-uploader/constants.d.ts +1 -1
- package/dist/components/photo-crop-uploader/constants.js +1 -1
- package/dist/components/photo-crop-uploader/locale.js +4 -4
- package/dist/components/photo-crop-uploader/photo-crop-uploader.js +81 -70
- package/dist/components/photo-crop-uploader/types.d.ts +8 -1
- package/dist/index-B2JRaoNz.js +48 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -13
- package/package.json +73 -73
- package/dist/Button-BjNjCLw8.js +0 -6428
|
@@ -1,123 +1,390 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as
|
|
3
|
-
import {
|
|
4
|
-
import { localizedText as
|
|
5
|
-
import { EN_LOCALE as
|
|
6
|
-
import { DEFAULT_MIN_DIMENSION as
|
|
7
|
-
import {
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
1
|
+
import { jsxs as T, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { S as j } from "../../../../index-BiffjjQq.js";
|
|
3
|
+
import { c as r } from "../../../../index-B2JRaoNz.js";
|
|
4
|
+
import { localizedText as b } from "../../locale.js";
|
|
5
|
+
import { EN_LOCALE as w } from "../../../../constants.js";
|
|
6
|
+
import { DEFAULT_MIN_DIMENSION as O, DEFAULT_ASPECT_RATIO as D } from "../../constants.js";
|
|
7
|
+
import { D as P, d as z, a as E, b as M, c as U } from "../../../../DialogTitle-iOQ7wKEt.js";
|
|
8
|
+
import * as x from "react";
|
|
9
|
+
import { g as $, a as F, u as W, s as A, c as V, b as g, d as H, B as Y, P as t, f as Z } from "../../../../ButtonBase-Bw_3RZmN.js";
|
|
10
|
+
import { u as q, m as N, c as R, C as G } from "../../../../CircularProgress-BD6BPlN2.js";
|
|
11
|
+
import { Button as J } from "../../../button/button.js";
|
|
12
|
+
import '../../../../assets/upload-dialog.css';function K(o) {
|
|
13
|
+
return F("MuiIconButton", o);
|
|
14
|
+
}
|
|
15
|
+
const L = $("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), Q = (o) => {
|
|
10
16
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
17
|
+
classes: e,
|
|
18
|
+
disabled: a,
|
|
19
|
+
color: l,
|
|
20
|
+
edge: d,
|
|
21
|
+
size: u,
|
|
22
|
+
loading: m
|
|
23
|
+
} = o, p = {
|
|
24
|
+
root: ["root", m && "loading", a && "disabled", l !== "default" && `color${g(l)}`, d && `edge${g(d)}`, `size${g(u)}`],
|
|
25
|
+
loadingIndicator: ["loadingIndicator"],
|
|
26
|
+
loadingWrapper: ["loadingWrapper"]
|
|
27
|
+
};
|
|
28
|
+
return H(p, K, e);
|
|
29
|
+
}, X = A(Y, {
|
|
30
|
+
name: "MuiIconButton",
|
|
31
|
+
slot: "Root",
|
|
32
|
+
overridesResolver: (o, e) => {
|
|
33
|
+
const {
|
|
34
|
+
ownerState: a
|
|
35
|
+
} = o;
|
|
36
|
+
return [e.root, a.loading && e.loading, a.color !== "default" && e[`color${g(a.color)}`], a.edge && e[`edge${g(a.edge)}`], e[`size${g(a.size)}`]];
|
|
37
|
+
}
|
|
38
|
+
})(N(({
|
|
39
|
+
theme: o
|
|
40
|
+
}) => ({
|
|
41
|
+
textAlign: "center",
|
|
42
|
+
flex: "0 0 auto",
|
|
43
|
+
fontSize: o.typography.pxToRem(24),
|
|
44
|
+
padding: 8,
|
|
45
|
+
borderRadius: "50%",
|
|
46
|
+
color: (o.vars || o).palette.action.active,
|
|
47
|
+
transition: o.transitions.create("background-color", {
|
|
48
|
+
duration: o.transitions.duration.shortest
|
|
49
|
+
}),
|
|
50
|
+
variants: [{
|
|
51
|
+
props: (e) => !e.disableRipple,
|
|
52
|
+
style: {
|
|
53
|
+
"--IconButton-hoverBg": o.alpha((o.vars || o).palette.action.active, (o.vars || o).palette.action.hoverOpacity),
|
|
54
|
+
"&:hover": {
|
|
55
|
+
backgroundColor: "var(--IconButton-hoverBg)",
|
|
56
|
+
// Reset on touch devices, it doesn't add specificity
|
|
57
|
+
"@media (hover: none)": {
|
|
58
|
+
backgroundColor: "transparent"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
props: {
|
|
64
|
+
edge: "start"
|
|
65
|
+
},
|
|
66
|
+
style: {
|
|
67
|
+
marginLeft: -12
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
props: {
|
|
71
|
+
edge: "start",
|
|
72
|
+
size: "small"
|
|
73
|
+
},
|
|
74
|
+
style: {
|
|
75
|
+
marginLeft: -3
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
props: {
|
|
79
|
+
edge: "end"
|
|
80
|
+
},
|
|
81
|
+
style: {
|
|
82
|
+
marginRight: -12
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
props: {
|
|
86
|
+
edge: "end",
|
|
87
|
+
size: "small"
|
|
88
|
+
},
|
|
89
|
+
style: {
|
|
90
|
+
marginRight: -3
|
|
91
|
+
}
|
|
92
|
+
}]
|
|
93
|
+
})), N(({
|
|
94
|
+
theme: o
|
|
95
|
+
}) => ({
|
|
96
|
+
variants: [{
|
|
97
|
+
props: {
|
|
98
|
+
color: "inherit"
|
|
99
|
+
},
|
|
100
|
+
style: {
|
|
101
|
+
color: "inherit"
|
|
102
|
+
}
|
|
103
|
+
}, ...Object.entries(o.palette).filter(R()).map(([e]) => ({
|
|
104
|
+
props: {
|
|
105
|
+
color: e
|
|
106
|
+
},
|
|
107
|
+
style: {
|
|
108
|
+
color: (o.vars || o).palette[e].main
|
|
109
|
+
}
|
|
110
|
+
})), ...Object.entries(o.palette).filter(R()).map(([e]) => ({
|
|
111
|
+
props: {
|
|
112
|
+
color: e
|
|
113
|
+
},
|
|
114
|
+
style: {
|
|
115
|
+
"--IconButton-hoverBg": o.alpha((o.vars || o).palette[e].main, (o.vars || o).palette.action.hoverOpacity)
|
|
116
|
+
}
|
|
117
|
+
})), {
|
|
118
|
+
props: {
|
|
119
|
+
size: "small"
|
|
120
|
+
},
|
|
121
|
+
style: {
|
|
122
|
+
padding: 5,
|
|
123
|
+
fontSize: o.typography.pxToRem(18)
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
props: {
|
|
127
|
+
size: "large"
|
|
128
|
+
},
|
|
129
|
+
style: {
|
|
130
|
+
padding: 12,
|
|
131
|
+
fontSize: o.typography.pxToRem(28)
|
|
132
|
+
}
|
|
133
|
+
}],
|
|
134
|
+
[`&.${L.disabled}`]: {
|
|
135
|
+
backgroundColor: "transparent",
|
|
136
|
+
color: (o.vars || o).palette.action.disabled
|
|
137
|
+
},
|
|
138
|
+
[`&.${L.loading}`]: {
|
|
139
|
+
color: "transparent"
|
|
140
|
+
}
|
|
141
|
+
}))), oo = A("span", {
|
|
142
|
+
name: "MuiIconButton",
|
|
143
|
+
slot: "LoadingIndicator"
|
|
144
|
+
})(({
|
|
145
|
+
theme: o
|
|
146
|
+
}) => ({
|
|
147
|
+
display: "none",
|
|
148
|
+
position: "absolute",
|
|
149
|
+
visibility: "visible",
|
|
150
|
+
top: "50%",
|
|
151
|
+
left: "50%",
|
|
152
|
+
transform: "translate(-50%, -50%)",
|
|
153
|
+
color: (o.vars || o).palette.action.disabled,
|
|
154
|
+
variants: [{
|
|
155
|
+
props: {
|
|
156
|
+
loading: !0
|
|
157
|
+
},
|
|
158
|
+
style: {
|
|
159
|
+
display: "flex"
|
|
160
|
+
}
|
|
161
|
+
}]
|
|
162
|
+
})), S = /* @__PURE__ */ x.forwardRef(function(e, a) {
|
|
163
|
+
const l = W({
|
|
164
|
+
props: e,
|
|
165
|
+
name: "MuiIconButton"
|
|
166
|
+
}), {
|
|
167
|
+
edge: d = !1,
|
|
168
|
+
children: u,
|
|
169
|
+
className: m,
|
|
170
|
+
color: p = "default",
|
|
171
|
+
disabled: y = !1,
|
|
172
|
+
disableFocusRipple: f = !1,
|
|
173
|
+
size: C = "medium",
|
|
174
|
+
id: i,
|
|
175
|
+
loading: c = null,
|
|
176
|
+
loadingIndicator: v,
|
|
177
|
+
...I
|
|
178
|
+
} = l, h = q(i), k = v ?? /* @__PURE__ */ n(G, {
|
|
179
|
+
"aria-labelledby": h,
|
|
180
|
+
color: "inherit",
|
|
181
|
+
size: 16
|
|
182
|
+
}), _ = {
|
|
183
|
+
...l,
|
|
184
|
+
edge: d,
|
|
185
|
+
color: p,
|
|
186
|
+
disabled: y,
|
|
187
|
+
disableFocusRipple: f,
|
|
188
|
+
loading: c,
|
|
189
|
+
loadingIndicator: k,
|
|
190
|
+
size: C
|
|
191
|
+
}, B = Q(_);
|
|
192
|
+
return /* @__PURE__ */ T(X, {
|
|
193
|
+
id: c ? h : i,
|
|
194
|
+
className: V(B.root, m),
|
|
195
|
+
centerRipple: !0,
|
|
196
|
+
focusRipple: !f,
|
|
197
|
+
disabled: y || c,
|
|
198
|
+
ref: a,
|
|
199
|
+
...I,
|
|
200
|
+
ownerState: _,
|
|
201
|
+
children: [typeof c == "boolean" && // use plain HTML span to minimize the runtime overhead
|
|
202
|
+
/* @__PURE__ */ n("span", {
|
|
203
|
+
className: B.loadingWrapper,
|
|
204
|
+
style: {
|
|
205
|
+
display: "contents"
|
|
206
|
+
},
|
|
207
|
+
children: /* @__PURE__ */ n(oo, {
|
|
208
|
+
className: B.loadingIndicator,
|
|
209
|
+
ownerState: _,
|
|
210
|
+
children: c && k
|
|
211
|
+
})
|
|
212
|
+
}), u]
|
|
31
213
|
});
|
|
32
|
-
}
|
|
33
|
-
const V = I("MuiBox", ["root"]), W = j(), D = G({
|
|
34
|
-
themeId: S,
|
|
35
|
-
defaultTheme: W,
|
|
36
|
-
defaultClassName: V.root,
|
|
37
|
-
generateClassName: O.generate
|
|
38
214
|
});
|
|
39
|
-
process.env.NODE_ENV !== "production" && (
|
|
215
|
+
process.env.NODE_ENV !== "production" && (S.propTypes = {
|
|
40
216
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
41
217
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
42
218
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
43
219
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
220
|
+
/**
|
|
221
|
+
* The icon to display.
|
|
222
|
+
*/
|
|
223
|
+
children: Z(t.node, (o) => x.Children.toArray(o.children).some((a) => /* @__PURE__ */ x.isValidElement(a) && a.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(`
|
|
224
|
+
`)) : null),
|
|
225
|
+
/**
|
|
226
|
+
* Override or extend the styles applied to the component.
|
|
227
|
+
*/
|
|
228
|
+
classes: t.object,
|
|
229
|
+
/**
|
|
230
|
+
* @ignore
|
|
231
|
+
*/
|
|
232
|
+
className: t.string,
|
|
233
|
+
/**
|
|
234
|
+
* The color of the component.
|
|
235
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
236
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
237
|
+
* @default 'default'
|
|
238
|
+
*/
|
|
239
|
+
color: t.oneOfType([t.oneOf(["inherit", "default", "primary", "secondary", "error", "info", "success", "warning"]), t.string]),
|
|
240
|
+
/**
|
|
241
|
+
* If `true`, the component is disabled.
|
|
242
|
+
* @default false
|
|
243
|
+
*/
|
|
244
|
+
disabled: t.bool,
|
|
245
|
+
/**
|
|
246
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
247
|
+
* @default false
|
|
248
|
+
*/
|
|
249
|
+
disableFocusRipple: t.bool,
|
|
250
|
+
/**
|
|
251
|
+
* If `true`, the ripple effect is disabled.
|
|
252
|
+
*
|
|
253
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
254
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
255
|
+
* @default false
|
|
256
|
+
*/
|
|
257
|
+
disableRipple: t.bool,
|
|
258
|
+
/**
|
|
259
|
+
* If given, uses a negative margin to counteract the padding on one
|
|
260
|
+
* side (this is often helpful for aligning the left or right
|
|
261
|
+
* side of the icon with content above or below, without ruining the border
|
|
262
|
+
* size and shape).
|
|
263
|
+
* @default false
|
|
264
|
+
*/
|
|
265
|
+
edge: t.oneOf(["end", "start", !1]),
|
|
44
266
|
/**
|
|
45
267
|
* @ignore
|
|
46
268
|
*/
|
|
47
|
-
|
|
269
|
+
id: t.string,
|
|
270
|
+
/**
|
|
271
|
+
* If `true`, the loading indicator is visible and the button is disabled.
|
|
272
|
+
* If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
|
|
273
|
+
* @default null
|
|
274
|
+
*/
|
|
275
|
+
loading: t.bool,
|
|
276
|
+
/**
|
|
277
|
+
* Element placed before the children if the button is in loading state.
|
|
278
|
+
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
279
|
+
* By default, it renders a `CircularProgress` that is labeled by the button itself.
|
|
280
|
+
* @default <CircularProgress color="inherit" size={16} />
|
|
281
|
+
*/
|
|
282
|
+
loadingIndicator: t.node,
|
|
48
283
|
/**
|
|
49
|
-
* The
|
|
50
|
-
*
|
|
284
|
+
* The size of the component.
|
|
285
|
+
* `small` is equivalent to the dense button styling.
|
|
286
|
+
* @default 'medium'
|
|
51
287
|
*/
|
|
52
|
-
|
|
288
|
+
size: t.oneOfType([t.oneOf(["small", "medium", "large"]), t.string]),
|
|
53
289
|
/**
|
|
54
290
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
55
291
|
*/
|
|
56
|
-
sx:
|
|
292
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
57
293
|
});
|
|
58
|
-
const
|
|
59
|
-
dialog:
|
|
60
|
-
|
|
61
|
-
|
|
294
|
+
const to = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.3434%2015.4595C16.8227%2014.9388%2015.9785%2014.9388%2015.4578%2015.4595C14.9371%2015.9802%2014.9371%2016.8244%2015.4578%2017.3451L21.1146%2023.002L15.4578%2028.6588C14.9371%2029.1795%2014.9371%2030.0237%2015.4578%2030.5444C15.9785%2031.0651%2016.8227%2031.0651%2017.3434%2030.5444L23.0002%2024.8876L28.6571%2030.5444C29.1778%2031.0651%2030.022%2031.0651%2030.5427%2030.5444C31.0634%2030.0237%2031.0634%2029.1795%2030.5427%2028.6588L24.8858%2023.002L30.5427%2017.3451C31.0634%2016.8244%2031.0634%2015.9802%2030.5427%2015.4595C30.022%2014.9388%2029.1778%2014.9388%2028.6571%2015.4595L23.0002%2021.1163L17.3434%2015.4595Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", eo = "_dialog_ujd1k_1", ao = "_topActions_ujd1k_6", no = "_close_ujd1k_12", io = "_botActions_ujd1k_16", ro = "_title_ujd1k_19", so = "_content_ujd1k_25", lo = "_crop_ujd1k_33", co = "_dialogText_ujd1k_42", s = {
|
|
295
|
+
dialog: eo,
|
|
296
|
+
topActions: ao,
|
|
297
|
+
close: no,
|
|
298
|
+
botActions: io,
|
|
299
|
+
title: ro,
|
|
300
|
+
content: so,
|
|
301
|
+
crop: lo,
|
|
302
|
+
dialogText: co
|
|
303
|
+
}, Io = (o) => {
|
|
62
304
|
const {
|
|
63
|
-
onCloseDialogHandler:
|
|
64
|
-
photoSource:
|
|
305
|
+
onCloseDialogHandler: e,
|
|
306
|
+
photoSource: a,
|
|
65
307
|
photoCrop: l,
|
|
66
|
-
onCropChange:
|
|
308
|
+
onCropChange: d = () => {
|
|
67
309
|
},
|
|
68
|
-
onPhotoLoad:
|
|
69
|
-
imageRef:
|
|
70
|
-
photoError:
|
|
71
|
-
onPhotoCrop:
|
|
72
|
-
minDimension:
|
|
73
|
-
aspectRatio:
|
|
74
|
-
locale:
|
|
75
|
-
circular:
|
|
76
|
-
keepSelection:
|
|
77
|
-
className:
|
|
78
|
-
...
|
|
79
|
-
} =
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
|
|
310
|
+
onPhotoLoad: u,
|
|
311
|
+
imageRef: m,
|
|
312
|
+
photoError: p,
|
|
313
|
+
onPhotoCrop: y,
|
|
314
|
+
minDimension: f = O,
|
|
315
|
+
aspectRatio: C = D,
|
|
316
|
+
locale: i = w,
|
|
317
|
+
circular: c,
|
|
318
|
+
keepSelection: v = !0,
|
|
319
|
+
className: I,
|
|
320
|
+
...h
|
|
321
|
+
} = o;
|
|
322
|
+
return /* @__PURE__ */ T(
|
|
323
|
+
P,
|
|
82
324
|
{
|
|
83
|
-
className:
|
|
84
|
-
onClose:
|
|
85
|
-
...
|
|
325
|
+
className: r(s.dialog, I),
|
|
326
|
+
onClose: e,
|
|
327
|
+
...h,
|
|
86
328
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
329
|
+
/* @__PURE__ */ n(z, { className: r(s.topActions), children: /* @__PURE__ */ n(
|
|
330
|
+
S,
|
|
331
|
+
{
|
|
332
|
+
onClick: e,
|
|
333
|
+
className: r(s.close),
|
|
334
|
+
"aria-label": b[i].back,
|
|
335
|
+
children: /* @__PURE__ */ n(
|
|
336
|
+
"img",
|
|
337
|
+
{
|
|
338
|
+
width: 40,
|
|
339
|
+
height: 40,
|
|
340
|
+
src: to,
|
|
341
|
+
alt: b[i].back
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
) }),
|
|
346
|
+
/* @__PURE__ */ n(E, { className: r(s.title), children: b[i]["photo-crop"] }),
|
|
347
|
+
/* @__PURE__ */ T(M, { className: r(s.content), children: [
|
|
348
|
+
a && /* @__PURE__ */ n(
|
|
349
|
+
j,
|
|
91
350
|
{
|
|
351
|
+
className: r(s.crop),
|
|
92
352
|
crop: l,
|
|
93
|
-
circularCrop:
|
|
94
|
-
keepSelection:
|
|
95
|
-
aspect:
|
|
96
|
-
minWidth:
|
|
97
|
-
minHeight:
|
|
98
|
-
onChange:
|
|
99
|
-
children: /* @__PURE__ */
|
|
353
|
+
circularCrop: c,
|
|
354
|
+
keepSelection: v,
|
|
355
|
+
aspect: C,
|
|
356
|
+
minWidth: f,
|
|
357
|
+
minHeight: f,
|
|
358
|
+
onChange: d,
|
|
359
|
+
children: /* @__PURE__ */ n(
|
|
100
360
|
"img",
|
|
101
361
|
{
|
|
102
|
-
onLoad:
|
|
103
|
-
src:
|
|
104
|
-
ref:
|
|
105
|
-
alt:
|
|
362
|
+
onLoad: u,
|
|
363
|
+
src: a,
|
|
364
|
+
ref: m,
|
|
365
|
+
alt: b[i]["photo-crop"],
|
|
106
366
|
draggable: !1
|
|
107
367
|
}
|
|
108
368
|
)
|
|
109
369
|
}
|
|
110
|
-
)
|
|
111
|
-
|
|
370
|
+
),
|
|
371
|
+
p && /* @__PURE__ */ n(U, { className: r(s.dialogText), children: p })
|
|
112
372
|
] }),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
373
|
+
/* @__PURE__ */ n(z, { className: r(s.botActions), children: /* @__PURE__ */ n(
|
|
374
|
+
J,
|
|
375
|
+
{
|
|
376
|
+
minWidth: "100%",
|
|
377
|
+
buttonSize: "small",
|
|
378
|
+
buttonColor: "blue",
|
|
379
|
+
buttonVariant: "filled",
|
|
380
|
+
onClick: y,
|
|
381
|
+
children: b[i].crop
|
|
382
|
+
}
|
|
383
|
+
) })
|
|
117
384
|
]
|
|
118
385
|
}
|
|
119
386
|
);
|
|
120
387
|
};
|
|
121
388
|
export {
|
|
122
|
-
|
|
389
|
+
Io as UploadDialog
|
|
123
390
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const DEFAULT_ASPECT_RATIO = 1;
|
|
2
|
-
export declare const DEFAULT_MIN_DIMENSION =
|
|
2
|
+
export declare const DEFAULT_MIN_DIMENSION = 670;
|
|
3
3
|
export declare const JPG_IMAGE_EXT = ".jpg";
|
|
4
4
|
export declare const JPEG_IMAGE_EXT = ".jpeg";
|
|
5
5
|
export declare const PNG_IMAGE_EXT = ".png";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BYTE_TO_KILOBYTE as T } from "../../constants.js";
|
|
2
|
-
const S = 1, e =
|
|
2
|
+
const S = 1, e = 670, E = ".jpg", _ = ".jpeg", G = ".png", M = ".svg", P = ".bmp", o = ".gif", I = ".ico", A = ".webp", p = [
|
|
3
3
|
E,
|
|
4
4
|
_,
|
|
5
5
|
G,
|
|
@@ -2,8 +2,8 @@ const e = {
|
|
|
2
2
|
en: {
|
|
3
3
|
upload: "Upload a photo",
|
|
4
4
|
drop: "Drop the file here",
|
|
5
|
-
"photo-crop": "
|
|
6
|
-
crop: "
|
|
5
|
+
"photo-crop": "Select the display area",
|
|
6
|
+
crop: "Save",
|
|
7
7
|
back: "Back",
|
|
8
8
|
"photo-size-error": "The photo size must be at least",
|
|
9
9
|
pixels: "pixels",
|
|
@@ -23,8 +23,8 @@ const e = {
|
|
|
23
23
|
ru: {
|
|
24
24
|
upload: "Загрузить фото",
|
|
25
25
|
drop: "Отпустите файл здесь",
|
|
26
|
-
"photo-crop": "
|
|
27
|
-
crop: "
|
|
26
|
+
"photo-crop": "Выберите отображаемую область",
|
|
27
|
+
crop: "Сохранить",
|
|
28
28
|
back: "Назад",
|
|
29
29
|
"photo-size-error": "Размер фотографии должен быть не меньше",
|
|
30
30
|
pixels: "пикселей",
|