@cgi-learning-hub/ui 0.0.1-dev.1708959744 → 0.0.1-dev.1708964890
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-7uR7JZiM.cjs +1 -0
- package/dist/Box-CPGTKTgx.js +56 -0
- package/dist/{ButtonBase-Bw43M3TO.js → ButtonBase-B0tkJ9zf.js} +2 -2
- package/dist/{ButtonBase-XPViWbp_.cjs → ButtonBase-DCL6Xlnm.cjs} +1 -1
- package/dist/{CircularProgress-BCdQaPFF.cjs → CircularProgress-CZX5SfKt.cjs} +1 -1
- package/dist/{CircularProgress-DRE9BLTL.js → CircularProgress-CguDBnxV.js} +2 -2
- package/dist/IconButton-CJ1Nt-jf.js +182 -0
- package/dist/IconButton-De7ZdW2q.cjs +2 -0
- package/dist/{InputBase-BbXy6VDy.js → InputBase-C_yPRkam.js} +109 -112
- package/dist/InputBase-Dvr5GnwD.cjs +4 -0
- package/dist/Tab-Bhm9hCrX.cjs +1 -0
- package/dist/{Tab-CWxCqAvH.js → Tab-C4l6V01S.js} +9 -9
- package/dist/{Typography-B1bdo7yt.js → Typography-CyFLZjnE.js} +99 -74
- package/dist/Typography-DwsN2Ttm.cjs +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/components/Dropzone/Dropzone.cjs.js +5 -5
- package/dist/components/Dropzone/Dropzone.es.js +12 -11
- package/dist/components/Dropzone/Dropzone.stories.cjs.js +1 -0
- package/dist/components/{AnotherComponent/AnotherComponent.stories.d.ts → Dropzone/Dropzone.stories.d.ts} +1 -2
- package/dist/components/Dropzone/Dropzone.stories.es.js +17 -0
- package/dist/components/buttons/DefaultButton/DefaultButton.cjs.js +1 -1
- package/dist/components/buttons/DefaultButton/DefaultButton.es.js +474 -126
- package/dist/components/buttons/DefaultButton/DefaultButtonIcon.cjs.js +1 -1
- package/dist/components/buttons/DefaultButton/DefaultButtonIcon.es.js +4 -4
- package/dist/components/buttons/IconButton.stories.cjs.js +1 -0
- package/dist/components/buttons/IconButton.stories.d.ts +4 -0
- package/dist/components/buttons/IconButton.stories.es.js +27 -0
- package/dist/components/buttons/PrimaryButton/PrimaryButton.cjs.js +1 -1
- package/dist/components/buttons/PrimaryButton/PrimaryButton.es.js +1 -1
- package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.cjs.js +1 -1
- package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.d.ts +1 -1
- package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.es.js +8 -7
- package/dist/components/buttons/SecondaryButton/SecondaryButton.cjs.js +1 -1
- package/dist/components/buttons/SecondaryButton/SecondaryButton.es.js +1 -1
- package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.cjs.js +1 -1
- package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.d.ts +1 -1
- package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.es.js +10 -9
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.es.js +18 -22
- package/dist/components/inputs/SearchInput/SearchInput.cjs.js +1 -1
- package/dist/components/inputs/SearchInput/SearchInput.es.js +10 -10
- package/dist/components/inputs/SearchInput/SearchInput.stories.cjs.js +1 -0
- package/dist/components/inputs/SearchInput/SearchInput.stories.d.ts +4 -0
- package/dist/components/inputs/SearchInput/SearchInput.stories.es.js +16 -0
- package/dist/components/inputs/TextInput/TextInput.cjs.js +11 -11
- package/dist/components/inputs/TextInput/TextInput.es.js +1905 -1655
- package/dist/components/inputs/TextInput/TextInput.stories.cjs.js +1 -0
- package/dist/components/inputs/TextInput/TextInput.stories.d.ts +4 -0
- package/dist/components/inputs/TextInput/TextInput.stories.es.js +17 -0
- package/dist/components/lists/FileList/FileList.cjs.js +1 -1
- package/dist/components/lists/FileList/FileList.es.js +1 -1
- package/dist/components/lists/FileList/FileList.stories.cjs.js +1 -0
- package/dist/components/lists/FileList/FileList.stories.d.ts +4 -0
- package/dist/components/lists/FileList/FileList.stories.es.js +28 -0
- package/dist/components/lists/FileList/FileListItem.cjs.js +1 -2
- package/dist/components/lists/FileList/FileListItem.es.js +26 -201
- package/dist/components/lists/TabList.stories.cjs.js +4 -0
- package/dist/components/lists/TabList.stories.d.ts +4 -0
- package/dist/components/lists/TabList.stories.es.js +1027 -0
- package/dist/{createSvgIcon-BivvPRyr.cjs → createSvgIcon-B6bZPuto.cjs} +1 -1
- package/dist/createSvgIcon-BX8WQ5r-.cjs +2 -0
- package/dist/{createSvgIcon-DLZM3vHe.js → createSvgIcon-KaSN8JhZ.js} +7 -7
- package/dist/createSvgIcon-m_wsenOJ.js +84 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +18 -22
- package/dist/isHostComponent-PydJW4A4.cjs +1 -0
- package/dist/isHostComponent-kiaBvYVo.js +6 -0
- package/dist/{ownerWindow-BoRkeomM.js → ownerWindow-C7EH1lr6.js} +2 -2
- package/dist/{refType-dllUCpD8.cjs → refType-CHSN6ysS.cjs} +1 -1
- package/dist/{refType-CMQbzE37.js → refType-Hh9tfnoF.js} +1 -1
- package/dist/unsupportedProp-Bn6XWqwH.cjs +1 -0
- package/dist/unsupportedProp-BuVD30Gh.js +9 -0
- package/dist/useSlotProps-MoAYME1z.js +70 -0
- package/dist/useSlotProps-R4s13HHI.cjs +1 -0
- package/dist/{useTheme-C-LTLVMt.cjs → useTheme-BDPYLOoP.cjs} +1 -1
- package/dist/{useTheme-BSwuVDD3.js → useTheme-DJEDOopE.js} +1 -1
- package/dist/{useThemeProps-kb_vU-1P.js → useThemeProps-Dg9Uoq7q.js} +656 -689
- package/dist/useThemeProps-jkB5q9ie.cjs +65 -0
- package/package.json +1 -1
- package/dist/Button-CmBnwwn3.js +0 -356
- package/dist/Button-wMPAZpnO.cjs +0 -1
- package/dist/Input-DHic6dYE.cjs +0 -1
- package/dist/Input-Dk-cN0Fb.js +0 -322
- package/dist/InputBase-WBNJQn8V.cjs +0 -4
- package/dist/Tab-C2Tmr8Sv.cjs +0 -1
- package/dist/Typography-CO64FVmw.cjs +0 -1
- package/dist/components/AnotherComponent/AnotherComponent.cjs.js +0 -1
- package/dist/components/AnotherComponent/AnotherComponent.d.ts +0 -2
- package/dist/components/AnotherComponent/AnotherComponent.es.js +0 -15
- package/dist/components/AnotherComponent/AnotherComponent.stories.cjs.js +0 -1
- package/dist/components/AnotherComponent/AnotherComponent.stories.es.js +0 -22
- package/dist/components/AnotherComponent/index.cjs.js +0 -1
- package/dist/components/AnotherComponent/index.d.ts +0 -2
- package/dist/components/AnotherComponent/index.es.js +0 -4
- package/dist/components/BasicButtons/BasicButtons.cjs.js +0 -1
- package/dist/components/BasicButtons/BasicButtons.d.ts +0 -2
- package/dist/components/BasicButtons/BasicButtons.es.js +0 -189
- package/dist/components/BasicButtons/BasicButtons.stories.cjs.js +0 -1
- package/dist/components/BasicButtons/BasicButtons.stories.d.ts +0 -5
- package/dist/components/BasicButtons/BasicButtons.stories.es.js +0 -22
- package/dist/components/BasicButtons/index.cjs.js +0 -1
- package/dist/components/BasicButtons/index.d.ts +0 -2
- package/dist/components/BasicButtons/index.es.js +0 -4
- package/dist/createSvgIcon-9NfUaq9H.js +0 -143
- package/dist/createSvgIcon-B7HVs3ZC.cjs +0 -2
- package/dist/extendSxProp-CVD6j4mA.js +0 -29
- package/dist/extendSxProp-D5gpnasP.cjs +0 -1
- package/dist/useThemeProps-C6ClLEqN.cjs +0 -65
|
@@ -1,51 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as f, _ as p, m as C, n as O, a as W, g as j, s as _, c as d, b as M, f as $, P as r, h as N } from "./useThemeProps-Dg9Uoq7q.js";
|
|
2
2
|
import * as R from "react";
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { jsx as U } from "react/jsx-runtime";
|
|
4
|
+
const A = ["sx"], E = (o) => {
|
|
5
|
+
var t, a;
|
|
6
|
+
const n = {
|
|
7
|
+
systemProps: {},
|
|
8
|
+
otherProps: {}
|
|
9
|
+
}, s = (t = o == null || (a = o.theme) == null ? void 0 : a.unstable_sxConfig) != null ? t : C;
|
|
10
|
+
return Object.keys(o).forEach((e) => {
|
|
11
|
+
s[e] ? n.systemProps[e] = o[e] : n.otherProps[e] = o[e];
|
|
12
|
+
}), n;
|
|
13
|
+
};
|
|
14
|
+
function D(o) {
|
|
15
|
+
const {
|
|
16
|
+
sx: t
|
|
17
|
+
} = o, a = f(o, A), {
|
|
18
|
+
systemProps: n,
|
|
19
|
+
otherProps: s
|
|
20
|
+
} = E(a);
|
|
21
|
+
let e;
|
|
22
|
+
return Array.isArray(t) ? e = [n, ...t] : typeof t == "function" ? e = (...l) => {
|
|
23
|
+
const i = t(...l);
|
|
24
|
+
return O(i) ? p({}, n, i) : n;
|
|
25
|
+
} : e = p({}, n, t), p({}, s, {
|
|
26
|
+
sx: e
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function L(o) {
|
|
30
|
+
return W("MuiTypography", o);
|
|
7
31
|
}
|
|
8
32
|
j("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
|
|
9
|
-
const
|
|
33
|
+
const V = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"], k = (o) => {
|
|
10
34
|
const {
|
|
11
|
-
align:
|
|
12
|
-
gutterBottom:
|
|
13
|
-
noWrap:
|
|
14
|
-
paragraph:
|
|
15
|
-
variant:
|
|
16
|
-
classes:
|
|
17
|
-
} =
|
|
18
|
-
root: ["root",
|
|
35
|
+
align: t,
|
|
36
|
+
gutterBottom: a,
|
|
37
|
+
noWrap: n,
|
|
38
|
+
paragraph: s,
|
|
39
|
+
variant: e,
|
|
40
|
+
classes: l
|
|
41
|
+
} = o, i = {
|
|
42
|
+
root: ["root", e, o.align !== "inherit" && `align${d(t)}`, a && "gutterBottom", n && "noWrap", s && "paragraph"]
|
|
19
43
|
};
|
|
20
|
-
return N(
|
|
21
|
-
},
|
|
44
|
+
return N(i, L, l);
|
|
45
|
+
}, z = _("span", {
|
|
22
46
|
name: "MuiTypography",
|
|
23
47
|
slot: "Root",
|
|
24
|
-
overridesResolver: (
|
|
48
|
+
overridesResolver: (o, t) => {
|
|
25
49
|
const {
|
|
26
|
-
ownerState:
|
|
27
|
-
} =
|
|
28
|
-
return [
|
|
50
|
+
ownerState: a
|
|
51
|
+
} = o;
|
|
52
|
+
return [t.root, a.variant && t[a.variant], a.align !== "inherit" && t[`align${d(a.align)}`], a.noWrap && t.noWrap, a.gutterBottom && t.gutterBottom, a.paragraph && t.paragraph];
|
|
29
53
|
}
|
|
30
54
|
})(({
|
|
31
|
-
theme:
|
|
32
|
-
ownerState:
|
|
33
|
-
}) =>
|
|
55
|
+
theme: o,
|
|
56
|
+
ownerState: t
|
|
57
|
+
}) => p({
|
|
34
58
|
margin: 0
|
|
35
|
-
},
|
|
59
|
+
}, t.variant === "inherit" && {
|
|
36
60
|
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
|
|
37
61
|
font: "inherit"
|
|
38
|
-
},
|
|
39
|
-
textAlign:
|
|
40
|
-
},
|
|
62
|
+
}, t.variant !== "inherit" && o.typography[t.variant], t.align !== "inherit" && {
|
|
63
|
+
textAlign: t.align
|
|
64
|
+
}, t.noWrap && {
|
|
41
65
|
overflow: "hidden",
|
|
42
66
|
textOverflow: "ellipsis",
|
|
43
67
|
whiteSpace: "nowrap"
|
|
44
|
-
},
|
|
68
|
+
}, t.gutterBottom && {
|
|
45
69
|
marginBottom: "0.35em"
|
|
46
|
-
},
|
|
70
|
+
}, t.paragraph && {
|
|
47
71
|
marginBottom: 16
|
|
48
|
-
})),
|
|
72
|
+
})), y = {
|
|
49
73
|
h1: "h1",
|
|
50
74
|
h2: "h2",
|
|
51
75
|
h3: "h3",
|
|
@@ -57,46 +81,46 @@ const D = ["align", "className", "component", "gutterBottom", "noWrap", "paragra
|
|
|
57
81
|
body1: "p",
|
|
58
82
|
body2: "p",
|
|
59
83
|
inherit: "p"
|
|
60
|
-
},
|
|
84
|
+
}, J = {
|
|
61
85
|
primary: "primary.main",
|
|
62
86
|
textPrimary: "text.primary",
|
|
63
87
|
secondary: "secondary.main",
|
|
64
88
|
textSecondary: "text.secondary",
|
|
65
89
|
error: "error.main"
|
|
66
|
-
},
|
|
67
|
-
const
|
|
68
|
-
props:
|
|
90
|
+
}, S = (o) => J[o] || o, b = /* @__PURE__ */ R.forwardRef(function(t, a) {
|
|
91
|
+
const n = M({
|
|
92
|
+
props: t,
|
|
69
93
|
name: "MuiTypography"
|
|
70
|
-
}),
|
|
71
|
-
color:
|
|
94
|
+
}), s = S(n.color), e = D(p({}, n, {
|
|
95
|
+
color: s
|
|
72
96
|
})), {
|
|
73
|
-
align:
|
|
74
|
-
className:
|
|
75
|
-
component:
|
|
76
|
-
gutterBottom:
|
|
77
|
-
noWrap:
|
|
78
|
-
paragraph:
|
|
79
|
-
variant:
|
|
80
|
-
variantMapping:
|
|
81
|
-
} =
|
|
82
|
-
align:
|
|
83
|
-
color:
|
|
84
|
-
className:
|
|
85
|
-
component:
|
|
86
|
-
gutterBottom:
|
|
87
|
-
noWrap:
|
|
88
|
-
paragraph:
|
|
89
|
-
variant:
|
|
90
|
-
variantMapping:
|
|
91
|
-
}),
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
as:
|
|
94
|
-
ref:
|
|
95
|
-
ownerState:
|
|
96
|
-
className:
|
|
97
|
+
align: l = "inherit",
|
|
98
|
+
className: i,
|
|
99
|
+
component: c,
|
|
100
|
+
gutterBottom: v = !1,
|
|
101
|
+
noWrap: x = !1,
|
|
102
|
+
paragraph: g = !1,
|
|
103
|
+
variant: h = "body1",
|
|
104
|
+
variantMapping: u = y
|
|
105
|
+
} = e, T = f(e, V), m = p({}, e, {
|
|
106
|
+
align: l,
|
|
107
|
+
color: s,
|
|
108
|
+
className: i,
|
|
109
|
+
component: c,
|
|
110
|
+
gutterBottom: v,
|
|
111
|
+
noWrap: x,
|
|
112
|
+
paragraph: g,
|
|
113
|
+
variant: h,
|
|
114
|
+
variantMapping: u
|
|
115
|
+
}), P = c || (g ? "p" : u[h] || y[h]) || "span", B = k(m);
|
|
116
|
+
return /* @__PURE__ */ U(z, p({
|
|
117
|
+
as: P,
|
|
118
|
+
ref: a,
|
|
119
|
+
ownerState: m,
|
|
120
|
+
className: $(B.root, i)
|
|
97
121
|
}, T));
|
|
98
122
|
});
|
|
99
|
-
process.env.NODE_ENV !== "production" && (
|
|
123
|
+
process.env.NODE_ENV !== "production" && (b.propTypes = {
|
|
100
124
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
101
125
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
102
126
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -105,29 +129,29 @@ process.env.NODE_ENV !== "production" && (d.propTypes = {
|
|
|
105
129
|
* Set the text-align on the component.
|
|
106
130
|
* @default 'inherit'
|
|
107
131
|
*/
|
|
108
|
-
align:
|
|
132
|
+
align: r.oneOf(["center", "inherit", "justify", "left", "right"]),
|
|
109
133
|
/**
|
|
110
134
|
* The content of the component.
|
|
111
135
|
*/
|
|
112
|
-
children:
|
|
136
|
+
children: r.node,
|
|
113
137
|
/**
|
|
114
138
|
* Override or extend the styles applied to the component.
|
|
115
139
|
*/
|
|
116
|
-
classes:
|
|
140
|
+
classes: r.object,
|
|
117
141
|
/**
|
|
118
142
|
* @ignore
|
|
119
143
|
*/
|
|
120
|
-
className:
|
|
144
|
+
className: r.string,
|
|
121
145
|
/**
|
|
122
146
|
* The component used for the root node.
|
|
123
147
|
* Either a string to use a HTML element or a component.
|
|
124
148
|
*/
|
|
125
|
-
component:
|
|
149
|
+
component: r.elementType,
|
|
126
150
|
/**
|
|
127
151
|
* If `true`, the text will have a bottom margin.
|
|
128
152
|
* @default false
|
|
129
153
|
*/
|
|
130
|
-
gutterBottom:
|
|
154
|
+
gutterBottom: r.bool,
|
|
131
155
|
/**
|
|
132
156
|
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
|
133
157
|
*
|
|
@@ -135,21 +159,21 @@ process.env.NODE_ENV !== "production" && (d.propTypes = {
|
|
|
135
159
|
* (the element needs to have a width in order to overflow).
|
|
136
160
|
* @default false
|
|
137
161
|
*/
|
|
138
|
-
noWrap:
|
|
162
|
+
noWrap: r.bool,
|
|
139
163
|
/**
|
|
140
164
|
* If `true`, the element will be a paragraph element.
|
|
141
165
|
* @default false
|
|
142
166
|
*/
|
|
143
|
-
paragraph:
|
|
167
|
+
paragraph: r.bool,
|
|
144
168
|
/**
|
|
145
169
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
146
170
|
*/
|
|
147
|
-
sx:
|
|
171
|
+
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
|
|
148
172
|
/**
|
|
149
173
|
* Applies the theme typography styles.
|
|
150
174
|
* @default 'body1'
|
|
151
175
|
*/
|
|
152
|
-
variant:
|
|
176
|
+
variant: r.oneOfType([r.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), r.string]),
|
|
153
177
|
/**
|
|
154
178
|
* The component maps the variant prop to a range of different HTML element types.
|
|
155
179
|
* For instance, subtitle1 to `<h6>`.
|
|
@@ -169,9 +193,10 @@ process.env.NODE_ENV !== "production" && (d.propTypes = {
|
|
|
169
193
|
* inherit: 'p',
|
|
170
194
|
* }
|
|
171
195
|
*/
|
|
172
|
-
variantMapping:
|
|
196
|
+
variantMapping: r.object
|
|
173
197
|
});
|
|
174
|
-
const
|
|
198
|
+
const F = b;
|
|
175
199
|
export {
|
|
176
|
-
|
|
200
|
+
F as T,
|
|
201
|
+
D as e
|
|
177
202
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./useThemeProps-jkB5q9ie.cjs"),v=require("react"),_=require("react/jsx-runtime");function O(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>o[r]})}}return t.default=o,Object.freeze(t)}const j=O(v),B=["sx"],W=o=>{var t,r;const n={systemProps:{},otherProps:{}},s=(t=o==null||(r=o.theme)==null?void 0:r.unstable_sxConfig)!=null?t:e.defaultSxConfig;return Object.keys(o).forEach(a=>{s[a]?n.systemProps[a]=o[a]:n.otherProps[a]=o[a]}),n};function m(o){const{sx:t}=o,r=e._objectWithoutPropertiesLoose(o,B),{systemProps:n,otherProps:s}=W(r);let a;return Array.isArray(t)?a=[n,...t]:typeof t=="function"?a=(...p)=>{const i=t(...p);return e.isPlainObject(i)?e._extends({},n,i):n}:a=e._extends({},n,t),e._extends({},s,{sx:a})}function C(o){return e.generateUtilityClass("MuiTypography",o)}e.generateUtilityClasses("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const M=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],$=o=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:s,variant:a,classes:p}=o,i={root:["root",a,o.align!=="inherit"&&`align${e.capitalize(t)}`,r&&"gutterBottom",n&&"noWrap",s&&"paragraph"]};return e.composeClasses(i,C,p)},N=e.styled("span",{name:"MuiTypography",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:r}=o;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${e.capitalize(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:o,ownerState:t})=>e._extends({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&o.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},R={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},q=o=>R[o]||o,f=j.forwardRef(function(t,r){const n=e.useThemeProps({props:t,name:"MuiTypography"}),s=q(n.color),a=m(e._extends({},n,{color:s})),{align:p="inherit",className:i,component:l,gutterBottom:d=!1,noWrap:T=!1,paragraph:h=!1,variant:c="body1",variantMapping:y=g}=a,P=e._objectWithoutPropertiesLoose(a,M),u=e._extends({},a,{align:p,color:s,className:i,component:l,gutterBottom:d,noWrap:T,paragraph:h,variant:c,variantMapping:y}),b=l||(h?"p":y[c]||g[c])||"span",x=$(u);return _.jsx(N,e._extends({as:b,ref:r,ownerState:u,className:e.clsx(x.root,i)},P))});process.env.NODE_ENV!=="production"&&(f.propTypes={align:e.PropTypes.oneOf(["center","inherit","justify","left","right"]),children:e.PropTypes.node,classes:e.PropTypes.object,className:e.PropTypes.string,component:e.PropTypes.elementType,gutterBottom:e.PropTypes.bool,noWrap:e.PropTypes.bool,paragraph:e.PropTypes.bool,sx:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.oneOfType([e.PropTypes.func,e.PropTypes.object,e.PropTypes.bool])),e.PropTypes.func,e.PropTypes.object]),variant:e.PropTypes.oneOfType([e.PropTypes.oneOf(["body1","body2","button","caption","h1","h2","h3","h4","h5","h6","inherit","overline","subtitle1","subtitle2"]),e.PropTypes.string]),variantMapping:e.PropTypes.object});const D=f;exports.Typography=D;exports.extendSxProp=m;
|
package/dist/assets/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex}.w-full{width:100%}.
|
|
1
|
+
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex}.w-full{width:100%}.border{border-width:1px}.text-start{text-align:start}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";const
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function or(e,r){if(e){if(typeof e=="string")return be(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return be(e,r)}}function be(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
5
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sr(e,r){if(e){if(typeof e=="string")return he(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return he(e,r)}}function he(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function dt(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,o=!1,c,l;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(g){o=!0,l=g}finally{try{!i&&t.return!=null&&t.return()}finally{if(o)throw l}}return n}}function gt(e){if(Array.isArray(e))return e}function Qe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function d(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Qe(Object(t),!0).forEach(function(n){De(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function De(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ee(e,r){if(e==null)return{};var t=mt(e,r),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function mt(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var Ee=f.forwardRef(function(e,r){var t=e.children,n=ee(e,ot),i=fr(n),o=i.open,c=ee(i,it);return f.useImperativeHandle(r,function(){return{open:o}},[o]),f.createElement(f.Fragment,null,t(d(d({},c),{},{open:o})))});Ee.displayName="Dropzone";var lr={disabled:!1,getFilesFromEvent:Pr,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Ee.defaultProps=lr;Ee.propTypes={children:p.PropTypes.func,accept:p.PropTypes.objectOf(p.PropTypes.arrayOf(p.PropTypes.string)),multiple:p.PropTypes.bool,preventDropOnDocument:p.PropTypes.bool,noClick:p.PropTypes.bool,noKeyboard:p.PropTypes.bool,noDrag:p.PropTypes.bool,noDragEventsBubbling:p.PropTypes.bool,minSize:p.PropTypes.number,maxSize:p.PropTypes.number,maxFiles:p.PropTypes.number,disabled:p.PropTypes.bool,getFilesFromEvent:p.PropTypes.func,onFileDialogCancel:p.PropTypes.func,onFileDialogOpen:p.PropTypes.func,useFsAccessApi:p.PropTypes.bool,autoFocus:p.PropTypes.bool,onDragEnter:p.PropTypes.func,onDragLeave:p.PropTypes.func,onDragOver:p.PropTypes.func,onDrop:p.PropTypes.func,onDropAccepted:p.PropTypes.func,onDropRejected:p.PropTypes.func,onError:p.PropTypes.func,validator:p.PropTypes.func};var we={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=d(d({},lr),e),t=r.accept,n=r.disabled,i=r.getFilesFromEvent,o=r.maxSize,c=r.minSize,l=r.multiple,g=r.maxFiles,s=r.onDragEnter,m=r.onDragLeave,b=r.onDragOver,R=r.onDrop,k=r.onDropAccepted,z=r.onDropRejected,M=r.onFileDialogCancel,re=r.onFileDialogOpen,Oe=r.useFsAccessApi,Fe=r.autoFocus,te=r.preventDropOnDocument,Pe=r.noClick,ne=r.noKeyboard,_e=r.noDrag,O=r.noDragEventsBubbling,oe=r.onError,L=r.validator,$=f.useMemo(function(){return rt(t)},[t]),je=f.useMemo(function(){return et(t)},[t]),ie=f.useMemo(function(){return typeof re=="function"?re:Xe},[re]),W=f.useMemo(function(){return typeof M=="function"?M:Xe},[M]),h=f.useRef(null),x=f.useRef(null),pr=f.useReducer(yt,we),Te=ye(pr,2),ae=Te[0],D=Te[1],dr=ae.isFocused,Se=ae.isFileDialogActive,U=f.useRef(typeof window<"u"&&window.isSecureContext&&Oe&&Zr()),Ce=function(){!U.current&&Se&&setTimeout(function(){if(x.current){var u=x.current.files;u.length||(D({type:"closeDialog"}),W())}},300)};f.useEffect(function(){return window.addEventListener("focus",Ce,!1),function(){window.removeEventListener("focus",Ce,!1)}},[x,Se,W,U]);var _=f.useRef([]),Ie=function(u){h.current&&h.current.contains(u.target)||(u.preventDefault(),_.current=[])};f.useEffect(function(){return te&&(document.addEventListener("dragover",Je,!1),document.addEventListener("drop",Ie,!1)),function(){te&&(document.removeEventListener("dragover",Je),document.removeEventListener("drop",Ie))}},[h,te]),f.useEffect(function(){return!n&&Fe&&h.current&&h.current.focus(),function(){}},[h,Fe,n]);var F=f.useCallback(function(a){oe?oe(a):console.error(a)},[oe]),Re=f.useCallback(function(a){a.preventDefault(),a.persist(),V(a),_.current=[].concat(ct(_.current),[a.target]),Q(a)&&Promise.resolve(i(a)).then(function(u){if(!(Z(a)&&!O)){var y=u.length,v=y>0&&Vr({files:u,accept:$,minSize:c,maxSize:o,multiple:l,maxFiles:g,validator:L}),w=y>0&&!v;D({isDragAccept:v,isDragReject:w,isDragActive:!0,type:"setDraggedFiles"}),s&&s(a)}}).catch(function(u){return F(u)})},[i,s,F,O,$,c,o,l,g,L]),ke=f.useCallback(function(a){a.preventDefault(),a.persist(),V(a);var u=Q(a);if(u&&a.dataTransfer)try{a.dataTransfer.dropEffect="copy"}catch{}return u&&b&&b(a),!1},[b,O]),ze=f.useCallback(function(a){a.preventDefault(),a.persist(),V(a);var u=_.current.filter(function(v){return h.current&&h.current.contains(v)}),y=u.indexOf(a.target);y!==-1&&u.splice(y,1),_.current=u,!(u.length>0)&&(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Q(a)&&m&&m(a))},[h,m,O]),N=f.useCallback(function(a,u){var y=[],v=[];a.forEach(function(w){var K=ir(w,$),S=ye(K,2),ce=S[0],se=S[1],le=ar(w,c,o),J=ye(le,2),fe=J[0],pe=J[1],de=L?L(w):null;if(ce&&fe&&!de)y.push(w);else{var ge=[se,pe];de&&(ge=ge.concat(de)),v.push({file:w,errors:ge.filter(function(vr){return vr})})}}),(!l&&y.length>1||l&&g>=1&&y.length>g)&&(y.forEach(function(w){v.push({file:w,errors:[Yr]})}),y.splice(0)),D({acceptedFiles:y,fileRejections:v,type:"setFiles"}),R&&R(y,v,u),v.length>0&&z&&z(v,u),y.length>0&&k&&k(y,u)},[D,l,$,c,o,g,R,k,z,L]),G=f.useCallback(function(a){a.preventDefault(),a.persist(),V(a),_.current=[],Q(a)&&Promise.resolve(i(a)).then(function(u){Z(a)&&!O||N(u,a)}).catch(function(u){return F(u)}),D({type:"reset"})},[i,N,F,O]),j=f.useCallback(function(){if(U.current){D({type:"openDialog"}),ie();var a={multiple:l,types:je};window.showOpenFilePicker(a).then(function(u){return i(u)}).then(function(u){N(u,null),D({type:"closeDialog"})}).catch(function(u){tt(u)?(W(u),D({type:"closeDialog"})):nt(u)?(U.current=!1,x.current?(x.current.value=null,x.current.click()):F(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):F(u)});return}x.current&&(D({type:"openDialog"}),ie(),x.current.value=null,x.current.click())},[D,ie,W,Oe,N,F,je,l]),Me=f.useCallback(function(a){!h.current||!h.current.isEqualNode(a.target)||(a.key===" "||a.key==="Enter"||a.keyCode===32||a.keyCode===13)&&(a.preventDefault(),j())},[h,j]),Le=f.useCallback(function(){D({type:"focus"})},[]),$e=f.useCallback(function(){D({type:"blur"})},[]),Ke=f.useCallback(function(){Pe||(Xr()?setTimeout(j,0):j())},[Pe,j]),T=function(u){return n?null:u},ue=function(u){return ne?null:T(u)},Y=function(u){return _e?null:T(u)},V=function(u){O&&u.stopPropagation()},gr=f.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.refKey,y=u===void 0?"ref":u,v=a.role,w=a.onKeyDown,K=a.onFocus,S=a.onBlur,ce=a.onClick,se=a.onDragEnter,le=a.onDragOver,J=a.onDragLeave,fe=a.onDrop,pe=ee(a,at);return d(d(De({onKeyDown:ue(E(w,Me)),onFocus:ue(E(K,Le)),onBlur:ue(E(S,$e)),onClick:T(E(ce,Ke)),onDragEnter:Y(E(se,Re)),onDragOver:Y(E(le,ke)),onDragLeave:Y(E(J,ze)),onDrop:Y(E(fe,G)),role:typeof v=="string"&&v!==""?v:"presentation"},y,h),!n&&!ne?{tabIndex:0}:{}),pe)}},[h,Me,Le,$e,Ke,Re,ke,ze,G,ne,_e,n]),mr=f.useCallback(function(a){a.stopPropagation()},[]),yr=f.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.refKey,y=u===void 0?"ref":u,v=a.onChange,w=a.onClick,K=ee(a,ut),S=De({accept:$,multiple:l,type:"file",style:{display:"none"},onChange:T(E(v,G)),onClick:T(E(w,mr)),tabIndex:-1},y,x);return d(d({},S),K)}},[x,t,l,G,n]);return d(d({},ae),{},{isFocused:dr&&!n,getRootProps:gr,getInputProps:yr,rootRef:h,inputRef:x,open:T(j)})}function yt(e,r){switch(r.type){case"focus":return d(d({},e),{},{isFocused:!0});case"blur":return d(d({},e),{},{isFocused:!1});case"openDialog":return d(d({},we),{},{isFileDialogActive:!0});case"closeDialog":return d(d({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return d(d({},e),{},{isDragActive:r.isDragActive,isDragAccept:r.isDragAccept,isDragReject:r.isDragReject});case"setFiles":return d(d({},e),{},{acceptedFiles:r.acceptedFiles,fileRejections:r.fileRejections});case"reset":return d({},we);default:return e}}function Xe(){}const vt=p.styled(q.Box)(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",padding:"0.5rem",width:"20rem",height:"10rem",border:"1px dashed",borderColor:e.palette.grey[500],borderRadius:4,cursor:"pointer"})),bt=e=>{const{getRootProps:r,getInputProps:t,isDragActive:n}=fr({onDrop:e.onDrop}),{information:i}=e;return A.jsxs(vt,{...r(),children:[A.jsx("input",{...t()}),n?A.jsxs(A.Fragment,{children:[A.jsx(Ze,{color:"primary"}),A.jsx(me.Typography,{children:"Déposer les fichiers ici"})]}):A.jsxs(A.Fragment,{children:[A.jsx(er,{color:"primary"}),A.jsx(me.Typography,{children:"Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers"}),i?A.jsx(me.Typography,{fontSize:"0.875rem",color:"grey",children:i}):null]})]})};module.exports=bt;
|
|
1
|
+
"use strict";const x=require("react/jsx-runtime"),ee=require("../../createSvgIcon-BX8WQ5r-.cjs"),f=require("react"),p=require("../../useThemeProps-jkB5q9ie.cjs"),br=require("../../Box-7uR7JZiM.cjs"),me=require("../../Typography-DwsN2Ttm.cjs");var xe={},hr=ee.interopRequireDefaultExports;Object.defineProperty(xe,"__esModule",{value:!0});var Ze=xe.default=void 0,Dr=hr(ee.requireCreateSvgIcon()),wr=x;Ze=xe.default=(0,Dr.default)((0,wr.jsx)("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"}),"FileUpload");var Ae={},xr=ee.interopRequireDefaultExports;Object.defineProperty(Ae,"__esModule",{value:!0});var er=Ae.default=void 0,Ar=xr(ee.requireCreateSvgIcon()),Er=x;er=Ae.default=(0,Ar.default)((0,Er.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFile");function C(e,r,t,n){function i(o){return o instanceof t?o:new t(function(c){c(o)})}return new(t||(t=Promise))(function(o,c){function l(m){try{s(n.next(m))}catch(b){c(b)}}function g(m){try{s(n.throw(m))}catch(b){c(b)}}function s(m){m.done?o(m.value):i(m.value).then(l,g)}s((n=n.apply(e,r||[])).next())})}function I(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(s){return function(m){return g([s,m])}}function g(s){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,s[0]&&(t=0)),t;)try{if(n=1,i&&(o=s[0]&2?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[s[0]&2,o.value]),s[0]){case 0:case 1:o=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,i=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){t.label=s[1];break}if(s[0]===6&&t.label<o[1]){t.label=o[1],o=s;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(s);break}o[2]&&t.ops.pop(),t.trys.pop();continue}s=r.call(e,t)}catch(m){s=[6,m],i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function He(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),i,o=[],c;try{for(;(r===void 0||r-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return o}function qe(e,r,t){if(t||arguments.length===2)for(var n=0,i=r.length,o;n<i;n++)(o||!(n in r))&&(o||(o=Array.prototype.slice.call(r,0,n)),o[n]=r[n]);return e.concat(o||Array.prototype.slice.call(r))}var Or=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function q(e,r){var t=Fr(e);if(typeof t.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof r=="string"?r:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}function Fr(e){var r=e.name,t=r&&r.lastIndexOf(".")!==-1;if(t&&!e.type){var n=r.split(".").pop().toLowerCase(),i=Or.get(n);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var Pr=[".DS_Store","Thumbs.db"];function _r(e){return C(this,void 0,void 0,function(){return I(this,function(r){return Q(e)&&jr(e.dataTransfer)?[2,Ir(e.dataTransfer,e.type)]:Tr(e)?[2,Sr(e)]:Array.isArray(e)&&e.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,Cr(e)]:[2,[]]})})}function jr(e){return Q(e)}function Tr(e){return Q(e)&&Q(e.target)}function Q(e){return typeof e=="object"&&e!==null}function Sr(e){return ve(e.target.files).map(function(r){return q(r)})}function Cr(e){return C(this,void 0,void 0,function(){var r;return I(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return r=t.sent(),[2,r.map(function(n){return q(n)})]}})})}function Ir(e,r){return C(this,void 0,void 0,function(){var t,n;return I(this,function(i){switch(i.label){case 0:return e.items?(t=ve(e.items).filter(function(o){return o.kind==="file"}),r!=="drop"?[2,t]:[4,Promise.all(t.map(Rr))]):[3,2];case 1:return n=i.sent(),[2,Be(rr(n))];case 2:return[2,Be(ve(e.files).map(function(o){return q(o)}))]}})})}function Be(e){return e.filter(function(r){return Pr.indexOf(r.name)===-1})}function ve(e){if(e===null)return[];for(var r=[],t=0;t<e.length;t++){var n=e[t];r.push(n)}return r}function Rr(e){if(typeof e.webkitGetAsEntry!="function")return We(e);var r=e.webkitGetAsEntry();return r&&r.isDirectory?tr(r):We(e)}function rr(e){return e.reduce(function(r,t){return qe(qe([],He(r),!1),He(Array.isArray(t)?rr(t):[t]),!1)},[])}function We(e){var r=e.getAsFile();if(!r)return Promise.reject("".concat(e," is not a File"));var t=q(r);return Promise.resolve(t)}function kr(e){return C(this,void 0,void 0,function(){return I(this,function(r){return[2,e.isDirectory?tr(e):zr(e)]})})}function tr(e){var r=e.createReader();return new Promise(function(t,n){var i=[];function o(){var c=this;r.readEntries(function(l){return C(c,void 0,void 0,function(){var g,s,m;return I(this,function(b){switch(b.label){case 0:if(l.length)return[3,5];b.label=1;case 1:return b.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return g=b.sent(),t(g),[3,4];case 3:return s=b.sent(),n(s),[3,4];case 4:return[3,6];case 5:m=Promise.all(l.map(kr)),i.push(m),o(),b.label=6;case 6:return[2]}})})},function(l){n(l)})}o()})}function zr(e){return C(this,void 0,void 0,function(){return I(this,function(r){return[2,new Promise(function(t,n){e.file(function(i){var o=q(i,e.fullPath);t(o)},function(i){n(i)})})]})})}var Mr=function(e,r){if(e&&r){var t=Array.isArray(r)?r:r.split(","),n=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return t.some(function(c){var l=c.trim().toLowerCase();return l.charAt(0)==="."?n.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):i===l})}return!0};function Ue(e){return Kr(e)||$r(e)||or(e)||Lr()}function Lr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $r(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kr(e){if(Array.isArray(e))return be(e)}function Ne(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ge(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ne(Object(t),!0).forEach(function(n){nr(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function nr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function H(e,r){return Br(e)||qr(e,r)||or(e,r)||Hr()}function Hr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function or(e,r){if(e){if(typeof e=="string")return be(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return be(e,r)}}function be(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function qr(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,o=!1,c,l;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(g){o=!0,l=g}finally{try{!i&&t.return!=null&&t.return()}finally{if(o)throw l}}return n}}function Br(e){if(Array.isArray(e))return e}var Wr="file-invalid-type",Ur="file-too-large",Nr="file-too-small",Gr="too-many-files",Yr=function(r){r=Array.isArray(r)&&r.length===1?r[0]:r;var t=Array.isArray(r)?"one of ".concat(r.join(", ")):r;return{code:Wr,message:"File type must be ".concat(t)}},Ye=function(r){return{code:Ur,message:"File is larger than ".concat(r," ").concat(r===1?"byte":"bytes")}},Ve=function(r){return{code:Nr,message:"File is smaller than ".concat(r," ").concat(r===1?"byte":"bytes")}},Vr={code:Gr,message:"Too many files"};function ir(e,r){var t=e.type==="application/x-moz-file"||Mr(e,r);return[t,t?null:Yr(r)]}function ar(e,r,t){if(P(e.size))if(P(r)&&P(t)){if(e.size>t)return[!1,Ye(t)];if(e.size<r)return[!1,Ve(r)]}else{if(P(r)&&e.size<r)return[!1,Ve(r)];if(P(t)&&e.size>t)return[!1,Ye(t)]}return[!0,null]}function P(e){return e!=null}function Jr(e){var r=e.files,t=e.accept,n=e.minSize,i=e.maxSize,o=e.multiple,c=e.maxFiles,l=e.validator;return!o&&r.length>1||o&&c>=1&&r.length>c?!1:r.every(function(g){var s=ir(g,t),m=H(s,1),b=m[0],R=ar(g,n,i),k=H(R,1),z=k[0],M=l?l(g):null;return b&&z&&!M})}function X(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function J(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(r){return r==="Files"||r==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Je(e){e.preventDefault()}function Qr(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Xr(e){return e.indexOf("Edge/")!==-1}function Zr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Qr(e)||Xr(e)}function E(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return function(n){for(var i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];return r.some(function(l){return!X(n)&&l&&l.apply(void 0,[n].concat(o)),X(n)})}}function et(){return"showOpenFilePicker"in window}function rt(e){if(P(e)){var r=Object.entries(e).filter(function(t){var n=H(t,2),i=n[0],o=n[1],c=!0;return ur(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(o)||!o.every(cr))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(t,n){var i=H(n,2),o=i[0],c=i[1];return Ge(Ge({},t),{},nr({},o,c))},{});return[{description:"Files",accept:r}]}return e}function tt(e){if(P(e))return Object.entries(e).reduce(function(r,t){var n=H(t,2),i=n[0],o=n[1];return[].concat(Ue(r),[i],Ue(o))},[]).filter(function(r){return ur(r)||cr(r)}).join(",")}function nt(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function ot(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ur(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function cr(e){return/^.*\.[\w]+$/.test(e)}var it=["children"],at=["open"],ut=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],ct=["refKey","onChange","onClick"];function st(e){return pt(e)||ft(e)||sr(e)||lt()}function lt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pt(e){if(Array.isArray(e))return he(e)}function ye(e,r){return mt(e)||gt(e,r)||sr(e,r)||dt()}function dt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sr(e,r){if(e){if(typeof e=="string")return he(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return he(e,r)}}function he(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function gt(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,o=!1,c,l;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(g){o=!0,l=g}finally{try{!i&&t.return!=null&&t.return()}finally{if(o)throw l}}return n}}function mt(e){if(Array.isArray(e))return e}function Qe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function d(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Qe(Object(t),!0).forEach(function(n){De(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function De(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Z(e,r){if(e==null)return{};var t=yt(e,r),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function yt(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var Ee=f.forwardRef(function(e,r){var t=e.children,n=Z(e,it),i=fr(n),o=i.open,c=Z(i,at);return f.useImperativeHandle(r,function(){return{open:o}},[o]),f.createElement(f.Fragment,null,t(d(d({},c),{},{open:o})))});Ee.displayName="Dropzone";var lr={disabled:!1,getFilesFromEvent:_r,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Ee.defaultProps=lr;Ee.propTypes={children:p.PropTypes.func,accept:p.PropTypes.objectOf(p.PropTypes.arrayOf(p.PropTypes.string)),multiple:p.PropTypes.bool,preventDropOnDocument:p.PropTypes.bool,noClick:p.PropTypes.bool,noKeyboard:p.PropTypes.bool,noDrag:p.PropTypes.bool,noDragEventsBubbling:p.PropTypes.bool,minSize:p.PropTypes.number,maxSize:p.PropTypes.number,maxFiles:p.PropTypes.number,disabled:p.PropTypes.bool,getFilesFromEvent:p.PropTypes.func,onFileDialogCancel:p.PropTypes.func,onFileDialogOpen:p.PropTypes.func,useFsAccessApi:p.PropTypes.bool,autoFocus:p.PropTypes.bool,onDragEnter:p.PropTypes.func,onDragLeave:p.PropTypes.func,onDragOver:p.PropTypes.func,onDrop:p.PropTypes.func,onDropAccepted:p.PropTypes.func,onDropRejected:p.PropTypes.func,onError:p.PropTypes.func,validator:p.PropTypes.func};var we={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=d(d({},lr),e),t=r.accept,n=r.disabled,i=r.getFilesFromEvent,o=r.maxSize,c=r.minSize,l=r.multiple,g=r.maxFiles,s=r.onDragEnter,m=r.onDragLeave,b=r.onDragOver,R=r.onDrop,k=r.onDropAccepted,z=r.onDropRejected,M=r.onFileDialogCancel,re=r.onFileDialogOpen,Oe=r.useFsAccessApi,Fe=r.autoFocus,te=r.preventDropOnDocument,Pe=r.noClick,ne=r.noKeyboard,_e=r.noDrag,O=r.noDragEventsBubbling,oe=r.onError,L=r.validator,$=f.useMemo(function(){return tt(t)},[t]),je=f.useMemo(function(){return rt(t)},[t]),ie=f.useMemo(function(){return typeof re=="function"?re:Xe},[re]),B=f.useMemo(function(){return typeof M=="function"?M:Xe},[M]),h=f.useRef(null),A=f.useRef(null),pr=f.useReducer(vt,we),Te=ye(pr,2),ae=Te[0],D=Te[1],dr=ae.isFocused,Se=ae.isFileDialogActive,W=f.useRef(typeof window<"u"&&window.isSecureContext&&Oe&&et()),Ce=function(){!W.current&&Se&&setTimeout(function(){if(A.current){var u=A.current.files;u.length||(D({type:"closeDialog"}),B())}},300)};f.useEffect(function(){return window.addEventListener("focus",Ce,!1),function(){window.removeEventListener("focus",Ce,!1)}},[A,Se,B,W]);var _=f.useRef([]),Ie=function(u){h.current&&h.current.contains(u.target)||(u.preventDefault(),_.current=[])};f.useEffect(function(){return te&&(document.addEventListener("dragover",Je,!1),document.addEventListener("drop",Ie,!1)),function(){te&&(document.removeEventListener("dragover",Je),document.removeEventListener("drop",Ie))}},[h,te]),f.useEffect(function(){return!n&&Fe&&h.current&&h.current.focus(),function(){}},[h,Fe,n]);var F=f.useCallback(function(a){oe?oe(a):console.error(a)},[oe]),Re=f.useCallback(function(a){a.preventDefault(),a.persist(),Y(a),_.current=[].concat(st(_.current),[a.target]),J(a)&&Promise.resolve(i(a)).then(function(u){if(!(X(a)&&!O)){var y=u.length,v=y>0&&Jr({files:u,accept:$,minSize:c,maxSize:o,multiple:l,maxFiles:g,validator:L}),w=y>0&&!v;D({isDragAccept:v,isDragReject:w,isDragActive:!0,type:"setDraggedFiles"}),s&&s(a)}}).catch(function(u){return F(u)})},[i,s,F,O,$,c,o,l,g,L]),ke=f.useCallback(function(a){a.preventDefault(),a.persist(),Y(a);var u=J(a);if(u&&a.dataTransfer)try{a.dataTransfer.dropEffect="copy"}catch{}return u&&b&&b(a),!1},[b,O]),ze=f.useCallback(function(a){a.preventDefault(),a.persist(),Y(a);var u=_.current.filter(function(v){return h.current&&h.current.contains(v)}),y=u.indexOf(a.target);y!==-1&&u.splice(y,1),_.current=u,!(u.length>0)&&(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),J(a)&&m&&m(a))},[h,m,O]),U=f.useCallback(function(a,u){var y=[],v=[];a.forEach(function(w){var K=ir(w,$),S=ye(K,2),ce=S[0],se=S[1],le=ar(w,c,o),V=ye(le,2),fe=V[0],pe=V[1],de=L?L(w):null;if(ce&&fe&&!de)y.push(w);else{var ge=[se,pe];de&&(ge=ge.concat(de)),v.push({file:w,errors:ge.filter(function(vr){return vr})})}}),(!l&&y.length>1||l&&g>=1&&y.length>g)&&(y.forEach(function(w){v.push({file:w,errors:[Vr]})}),y.splice(0)),D({acceptedFiles:y,fileRejections:v,type:"setFiles"}),R&&R(y,v,u),v.length>0&&z&&z(v,u),y.length>0&&k&&k(y,u)},[D,l,$,c,o,g,R,k,z,L]),N=f.useCallback(function(a){a.preventDefault(),a.persist(),Y(a),_.current=[],J(a)&&Promise.resolve(i(a)).then(function(u){X(a)&&!O||U(u,a)}).catch(function(u){return F(u)}),D({type:"reset"})},[i,U,F,O]),j=f.useCallback(function(){if(W.current){D({type:"openDialog"}),ie();var a={multiple:l,types:je};window.showOpenFilePicker(a).then(function(u){return i(u)}).then(function(u){U(u,null),D({type:"closeDialog"})}).catch(function(u){nt(u)?(B(u),D({type:"closeDialog"})):ot(u)?(W.current=!1,A.current?(A.current.value=null,A.current.click()):F(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):F(u)});return}A.current&&(D({type:"openDialog"}),ie(),A.current.value=null,A.current.click())},[D,ie,B,Oe,U,F,je,l]),Me=f.useCallback(function(a){!h.current||!h.current.isEqualNode(a.target)||(a.key===" "||a.key==="Enter"||a.keyCode===32||a.keyCode===13)&&(a.preventDefault(),j())},[h,j]),Le=f.useCallback(function(){D({type:"focus"})},[]),$e=f.useCallback(function(){D({type:"blur"})},[]),Ke=f.useCallback(function(){Pe||(Zr()?setTimeout(j,0):j())},[Pe,j]),T=function(u){return n?null:u},ue=function(u){return ne?null:T(u)},G=function(u){return _e?null:T(u)},Y=function(u){O&&u.stopPropagation()},gr=f.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.refKey,y=u===void 0?"ref":u,v=a.role,w=a.onKeyDown,K=a.onFocus,S=a.onBlur,ce=a.onClick,se=a.onDragEnter,le=a.onDragOver,V=a.onDragLeave,fe=a.onDrop,pe=Z(a,ut);return d(d(De({onKeyDown:ue(E(w,Me)),onFocus:ue(E(K,Le)),onBlur:ue(E(S,$e)),onClick:T(E(ce,Ke)),onDragEnter:G(E(se,Re)),onDragOver:G(E(le,ke)),onDragLeave:G(E(V,ze)),onDrop:G(E(fe,N)),role:typeof v=="string"&&v!==""?v:"presentation"},y,h),!n&&!ne?{tabIndex:0}:{}),pe)}},[h,Me,Le,$e,Ke,Re,ke,ze,N,ne,_e,n]),mr=f.useCallback(function(a){a.stopPropagation()},[]),yr=f.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.refKey,y=u===void 0?"ref":u,v=a.onChange,w=a.onClick,K=Z(a,ct),S=De({accept:$,multiple:l,type:"file",style:{display:"none"},onChange:T(E(v,N)),onClick:T(E(w,mr)),tabIndex:-1},y,A);return d(d({},S),K)}},[A,t,l,N,n]);return d(d({},ae),{},{isFocused:dr&&!n,getRootProps:gr,getInputProps:yr,rootRef:h,inputRef:A,open:T(j)})}function vt(e,r){switch(r.type){case"focus":return d(d({},e),{},{isFocused:!0});case"blur":return d(d({},e),{},{isFocused:!1});case"openDialog":return d(d({},we),{},{isFileDialogActive:!0});case"closeDialog":return d(d({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return d(d({},e),{},{isDragActive:r.isDragActive,isDragAccept:r.isDragAccept,isDragReject:r.isDragReject});case"setFiles":return d(d({},e),{},{acceptedFiles:r.acceptedFiles,fileRejections:r.fileRejections});case"reset":return d({},we);default:return e}}function Xe(){}const bt=p.styled(br.Box)(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",padding:"0.5rem",width:"20rem",height:"10rem",border:"1px dashed",borderColor:e.palette.grey[500],borderRadius:4,cursor:"pointer"})),ht=e=>{const{getRootProps:r,getInputProps:t,isDragActive:n}=fr({onDrop:e.onDrop}),{information:i}=e;return x.jsxs(bt,{...r(),children:[x.jsx("input",{...t()}),n?x.jsxs(x.Fragment,{children:[x.jsx(Ze,{color:"primary"}),x.jsx(me.Typography,{children:"Déposer les fichiers ici"})]}):x.jsxs(x.Fragment,{children:[x.jsx(er,{color:"primary"}),x.jsx(me.Typography,{children:"Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers"}),i?x.jsx(me.Typography,{fontSize:"0.875rem",color:"grey",children:i}):null]})]})};module.exports=ht;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import nr, { jsxs as ve, jsx as T, Fragment as Ue } from "react/jsx-runtime";
|
|
2
|
-
import { r as or, i as ir
|
|
3
|
-
import
|
|
4
|
-
import { P as f, s as
|
|
5
|
-
import {
|
|
2
|
+
import { r as or, i as ir } from "../../createSvgIcon-m_wsenOJ.js";
|
|
3
|
+
import xr, { useMemo as I, useRef as Q, useReducer as Fr, useEffect as ye, useCallback as A, forwardRef as _r, useImperativeHandle as jr, Fragment as Sr } from "react";
|
|
4
|
+
import { P as f, s as Pr } from "../../useThemeProps-Dg9Uoq7q.js";
|
|
5
|
+
import { B as Tr } from "../../Box-CPGTKTgx.js";
|
|
6
|
+
import { T as be } from "../../Typography-CyFLZjnE.js";
|
|
6
7
|
var xe = {}, Ir = ir;
|
|
7
8
|
Object.defineProperty(xe, "__esModule", {
|
|
8
9
|
value: !0
|
|
@@ -732,13 +733,13 @@ function St(e, r) {
|
|
|
732
733
|
i = n[o], !(r.indexOf(i) >= 0) && (t[i] = e[i]);
|
|
733
734
|
return t;
|
|
734
735
|
}
|
|
735
|
-
var _e = /* @__PURE__ */
|
|
736
|
+
var _e = /* @__PURE__ */ _r(function(e, r) {
|
|
736
737
|
var t = e.children, n = re(e, bt), i = br(n), o = i.open, c = re(i, ht);
|
|
737
|
-
return
|
|
738
|
+
return jr(r, function() {
|
|
738
739
|
return {
|
|
739
740
|
open: o
|
|
740
741
|
};
|
|
741
|
-
}, [o]), /* @__PURE__ */
|
|
742
|
+
}, [o]), /* @__PURE__ */ xr.createElement(Sr, null, t(p(p({}, c), {}, {
|
|
742
743
|
open: o
|
|
743
744
|
})));
|
|
744
745
|
});
|
|
@@ -946,7 +947,7 @@ function br() {
|
|
|
946
947
|
return typeof te == "function" ? te : tr;
|
|
947
948
|
}, [te]), U = I(function() {
|
|
948
949
|
return typeof M == "function" ? M : tr;
|
|
949
|
-
}, [M]), b = Q(null), w = Q(null), hr =
|
|
950
|
+
}, [M]), b = Q(null), w = Q(null), hr = Fr(Pt, Oe), Ce = he(hr, 2), ue = Ce[0], h = Ce[1], Dr = ue.isFocused, Re = ue.isFileDialogActive, q = Q(typeof window < "u" && window.isSecureContext && je && dt()), ze = function() {
|
|
950
951
|
!q.current && Re && setTimeout(function() {
|
|
951
952
|
if (w.current) {
|
|
952
953
|
var u = w.current.files;
|
|
@@ -1175,7 +1176,7 @@ function Pt(e, r) {
|
|
|
1175
1176
|
}
|
|
1176
1177
|
function tr() {
|
|
1177
1178
|
}
|
|
1178
|
-
const Tt = Tr
|
|
1179
|
+
const Tt = Pr(Tr)(({ theme: e }) => ({
|
|
1179
1180
|
display: "flex",
|
|
1180
1181
|
flexDirection: "column",
|
|
1181
1182
|
justifyContent: "center",
|
|
@@ -1188,7 +1189,7 @@ const Tt = Tr(xr)(({ theme: e }) => ({
|
|
|
1188
1189
|
borderColor: e.palette.grey[500],
|
|
1189
1190
|
borderRadius: 4,
|
|
1190
1191
|
cursor: "pointer"
|
|
1191
|
-
})),
|
|
1192
|
+
})), Mt = (e) => {
|
|
1192
1193
|
const { getRootProps: r, getInputProps: t, isDragActive: n } = br({
|
|
1193
1194
|
onDrop: e.onDrop
|
|
1194
1195
|
}), { information: i } = e;
|
|
@@ -1205,5 +1206,5 @@ const Tt = Tr(xr)(({ theme: e }) => ({
|
|
|
1205
1206
|
] });
|
|
1206
1207
|
};
|
|
1207
1208
|
export {
|
|
1208
|
-
|
|
1209
|
+
Mt as default
|
|
1209
1210
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("./Dropzone.cjs.js"),n={title:"Components/Dropzone",component:o,argTypes:{}},s=e=>r.jsx(o,{...e}),t=s.bind({});t.args={information:"SVG, PNG, JPG or GIF (max. 3MB)",onDrop:e=>alert("dropped")};exports.Default=t;exports.default=n;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import t from "./Dropzone.es.js";
|
|
3
|
+
const a = {
|
|
4
|
+
title: "Components/Dropzone",
|
|
5
|
+
component: t,
|
|
6
|
+
argTypes: {
|
|
7
|
+
// Définissez ici vos paramètres d'histoires spécifiques aux arguments (args).
|
|
8
|
+
}
|
|
9
|
+
}, r = (o) => /* @__PURE__ */ e(t, { ...o }), n = r.bind({});
|
|
10
|
+
n.args = {
|
|
11
|
+
information: "SVG, PNG, JPG or GIF (max. 3MB)",
|
|
12
|
+
onDrop: (o) => alert("dropped")
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
n as Default,
|
|
16
|
+
a as default
|
|
17
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),C=require("react"),h=require("./DefaultButtonIcon.cjs.js"),t=require("../../../useThemeProps-C6ClLEqN.cjs"),T=require("../../../Button-wMPAZpnO.cjs"),$=require("../../../useId-Cw0TtD-8.cjs"),j=require("../../../refType-dllUCpD8.cjs"),_=require("../../../CircularProgress-BCdQaPFF.cjs"),E=require("../../../useTheme-C-LTLVMt.cjs");function O(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const i in o)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(n,i,a.get?a:{enumerable:!0,get:()=>o[i]})}}return n.default=o,Object.freeze(n)}const L=O(C);function q(o){return t.generateUtilityClass("MuiLoadingButton",o)}const R=t.generateUtilityClasses("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),e=R,z=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],M=o=>{const{loading:n,loadingPosition:i,classes:a}=o,r={root:["root",n&&"loading"],startIcon:[n&&`startIconLoading${t.capitalize(i)}`],endIcon:[n&&`endIconLoading${t.capitalize(i)}`],loadingIndicator:["loadingIndicator",n&&`loadingIndicator${t.capitalize(i)}`]},d=t.composeClasses(r,q,a);return t._extends({},a,d)},W=o=>o!=="ownerState"&&o!=="theme"&&o!=="sx"&&o!=="as"&&o!=="classes",D=t.styled(T.Button,{shouldForwardProp:o=>W(o)||o==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(o,n)=>[n.root,n.startIconLoadingStart&&{[`& .${e.startIconLoadingStart}`]:n.startIconLoadingStart},n.endIconLoadingEnd&&{[`& .${e.endIconLoadingEnd}`]:n.endIconLoadingEnd}]})(({ownerState:o,theme:n})=>t._extends({[`& .${e.startIconLoadingStart}, & .${e.endIconLoadingEnd}`]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0}},o.loadingPosition==="center"&&{transition:n.transitions.create(["background-color","box-shadow","border-color"],{duration:n.transitions.duration.short}),[`&.${e.loading}`]:{color:"transparent"}},o.loadingPosition==="start"&&o.fullWidth&&{[`& .${e.startIconLoadingStart}, & .${e.endIconLoadingEnd}`]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0,marginRight:-8}},o.loadingPosition==="end"&&o.fullWidth&&{[`& .${e.startIconLoadingStart}, & .${e.endIconLoadingEnd}`]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0,marginLeft:-8}})),U=t.styled("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(o,n)=>{const{ownerState:i}=o;return[n.loadingIndicator,n[`loadingIndicator${t.capitalize(i.loadingPosition)}`]]}})(({theme:o,ownerState:n})=>t._extends({position:"absolute",visibility:"visible",display:"flex"},n.loadingPosition==="start"&&(n.variant==="outlined"||n.variant==="contained")&&{left:n.size==="small"?10:14},n.loadingPosition==="start"&&n.variant==="text"&&{left:6},n.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(o.vars||o).palette.action.disabled},n.loadingPosition==="end"&&(n.variant==="outlined"||n.variant==="contained")&&{right:n.size==="small"?10:14},n.loadingPosition==="end"&&n.variant==="text"&&{right:6},n.loadingPosition==="start"&&n.fullWidth&&{position:"relative",left:-10},n.loadingPosition==="end"&&n.fullWidth&&{position:"relative",right:-10})),v=L.forwardRef(function(n,i){const a=L.useContext(T.ButtonGroupContext),r=t.resolveProps(a,n),d=t.useThemeProps({props:r,name:"MuiLoadingButton"}),{children:u,disabled:g=!1,id:x,loading:c=!1,loadingIndicator:p,loadingPosition:m="center",variant:P="text"}=d,B=t._objectWithoutPropertiesLoose(d,z),I=$.useId(x),f=p??s.jsx(_.CircularProgress,{"aria-labelledby":I,color:"inherit",size:16}),l=t._extends({},d,{disabled:g,loading:c,loadingIndicator:f,loadingPosition:m,variant:P}),y=M(l),b=c?s.jsx(U,{className:y.loadingIndicator,ownerState:l,children:f}):null;return s.jsxs(D,t._extends({disabled:g||c,id:I,ref:i},B,{variant:P,classes:y,ownerState:l,children:[l.loadingPosition==="end"?u:b,l.loadingPosition==="end"?b:u]}))});process.env.NODE_ENV!=="production"&&(v.propTypes={children:t.PropTypes.node,classes:t.PropTypes.object,disabled:t.PropTypes.bool,id:t.PropTypes.string,loading:t.PropTypes.bool,loadingIndicator:t.PropTypes.node,loadingPosition:j.chainPropTypes(t.PropTypes.oneOf(["start","end","center"]),o=>o.loadingPosition==="start"&&!o.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):o.loadingPosition==="end"&&!o.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:t.PropTypes.oneOfType([t.PropTypes.arrayOf(t.PropTypes.oneOfType([t.PropTypes.func,t.PropTypes.object,t.PropTypes.bool])),t.PropTypes.func,t.PropTypes.object]),variant:t.PropTypes.oneOfType([t.PropTypes.oneOf(["contained","outlined","text"]),t.PropTypes.string])});const N=v,k=t.styled(N,{shouldForwardProp:o=>o!=="contentColor"&&o!=="hoverColor"})(({contentColor:o,hoverColor:n,theme:i})=>({justifyContent:"center",alignItems:"center",columnGap:8,minHeight:38,paddingLeft:12,paddingRight:12,textTransform:"none",color:o,borderColor:o,borderRadius:5,borderWidth:2,"&:hover":{color:i.palette.common.white,backgroundColor:n,borderColor:n,borderWidth:2}})),F=({icon:o,text:n,...i})=>{const a=E.useTheme(),r=i.contentColor??a.palette.primary.main;return s.jsxs(k,{...i,variant:"outlined",contentColor:r,hoverColor:i.hoverColor??r,children:[(o==null?void 0:o.position)==="left"?s.jsx(h,{...o}):null,n,(o==null?void 0:o.position)==="right"?s.jsx(h,{...o}):null]})};module.exports=F;
|
|
1
|
+
"use strict";const d=require("react/jsx-runtime"),q=require("react"),L=require("./DefaultButtonIcon.cjs.js"),t=require("../../../useThemeProps-jkB5q9ie.cjs"),D=require("../../../ButtonBase-DCL6Xlnm.cjs"),U=require("../../../useId-Cw0TtD-8.cjs"),F=require("../../../refType-CHSN6ysS.cjs"),G=require("../../../CircularProgress-CZX5SfKt.cjs"),S=require("../../../useTheme-BDPYLOoP.cjs");function H(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const i in o)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(n,i,a.get?a:{enumerable:!0,get:()=>o[i]})}}return n.default=o,Object.freeze(n)}const p=H(q);function A(o){return t.generateUtilityClass("MuiButton",o)}const J=t.generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),$=J,m=p.createContext({});process.env.NODE_ENV!=="production"&&(m.displayName="ButtonGroupContext");const E=m,O=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(O.displayName="ButtonGroupButtonContext");const K=O,Q=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],X=o=>{const{color:n,disableElevation:i,fullWidth:a,size:r,variant:e,classes:s}=o,u={root:["root",e,`${e}${t.capitalize(n)}`,`size${t.capitalize(r)}`,`${e}Size${t.capitalize(r)}`,n==="inherit"&&"colorInherit",i&&"disableElevation",a&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${t.capitalize(r)}`],endIcon:["endIcon",`iconSize${t.capitalize(r)}`]},y=t.composeClasses(u,A,s);return t._extends({},s,y)},R=o=>t._extends({},o.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},o.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},o.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Y=t.styled(D.ButtonBase,{shouldForwardProp:o=>t.rootShouldForwardProp(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,n)=>{const{ownerState:i}=o;return[n.root,n[i.variant],n[`${i.variant}${t.capitalize(i.color)}`],n[`size${t.capitalize(i.size)}`],n[`${i.variant}Size${t.capitalize(i.size)}`],i.color==="inherit"&&n.colorInherit,i.disableElevation&&n.disableElevation,i.fullWidth&&n.fullWidth]}})(({theme:o,ownerState:n})=>{var i,a;const r=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],e=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return t._extends({},o.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":t._extends({textDecoration:"none",backgroundColor:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:t.alpha(o.palette.text.primary,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},n.variant==="text"&&n.color!=="inherit"&&{backgroundColor:o.vars?`rgba(${o.vars.palette[n.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:t.alpha(o.palette[n.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},n.variant==="outlined"&&n.color!=="inherit"&&{border:`1px solid ${(o.vars||o).palette[n.color].main}`,backgroundColor:o.vars?`rgba(${o.vars.palette[n.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:t.alpha(o.palette[n.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},n.variant==="contained"&&{backgroundColor:o.vars?o.vars.palette.Button.inheritContainedHoverBg:e,boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2],backgroundColor:(o.vars||o).palette.grey[300]}},n.variant==="contained"&&n.color!=="inherit"&&{backgroundColor:(o.vars||o).palette[n.color].dark,"@media (hover: none)":{backgroundColor:(o.vars||o).palette[n.color].main}}),"&:active":t._extends({},n.variant==="contained"&&{boxShadow:(o.vars||o).shadows[8]}),[`&.${$.focusVisible}`]:t._extends({},n.variant==="contained"&&{boxShadow:(o.vars||o).shadows[6]}),[`&.${$.disabled}`]:t._extends({color:(o.vars||o).palette.action.disabled},n.variant==="outlined"&&{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`},n.variant==="contained"&&{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground})},n.variant==="text"&&{padding:"6px 8px"},n.variant==="text"&&n.color!=="inherit"&&{color:(o.vars||o).palette[n.color].main},n.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},n.variant==="outlined"&&n.color!=="inherit"&&{color:(o.vars||o).palette[n.color].main,border:o.vars?`1px solid rgba(${o.vars.palette[n.color].mainChannel} / 0.5)`:`1px solid ${t.alpha(o.palette[n.color].main,.5)}`},n.variant==="contained"&&{color:o.vars?o.vars.palette.text.primary:(i=(a=o.palette).getContrastText)==null?void 0:i.call(a,o.palette.grey[300]),backgroundColor:o.vars?o.vars.palette.Button.inheritContainedBg:r,boxShadow:(o.vars||o).shadows[2]},n.variant==="contained"&&n.color!=="inherit"&&{color:(o.vars||o).palette[n.color].contrastText,backgroundColor:(o.vars||o).palette[n.color].main},n.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},n.size==="small"&&n.variant==="text"&&{padding:"4px 5px",fontSize:o.typography.pxToRem(13)},n.size==="large"&&n.variant==="text"&&{padding:"8px 11px",fontSize:o.typography.pxToRem(15)},n.size==="small"&&n.variant==="outlined"&&{padding:"3px 9px",fontSize:o.typography.pxToRem(13)},n.size==="large"&&n.variant==="outlined"&&{padding:"7px 21px",fontSize:o.typography.pxToRem(15)},n.size==="small"&&n.variant==="contained"&&{padding:"4px 10px",fontSize:o.typography.pxToRem(13)},n.size==="large"&&n.variant==="contained"&&{padding:"8px 22px",fontSize:o.typography.pxToRem(15)},n.fullWidth&&{width:"100%"})},({ownerState:o})=>o.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${$.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${$.disabled}`]:{boxShadow:"none"}}),Z=t.styled("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,n)=>{const{ownerState:i}=o;return[n.startIcon,n[`iconSize${t.capitalize(i.size)}`]]}})(({ownerState:o})=>t._extends({display:"inherit",marginRight:8,marginLeft:-4},o.size==="small"&&{marginLeft:-2},R(o))),w=t.styled("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,n)=>{const{ownerState:i}=o;return[n.endIcon,n[`iconSize${t.capitalize(i.size)}`]]}})(({ownerState:o})=>t._extends({display:"inherit",marginRight:-4,marginLeft:8},o.size==="small"&&{marginRight:-2},R(o))),_=p.forwardRef(function(n,i){const a=p.useContext(E),r=p.useContext(K),e=t.resolveProps(a,n),s=t.useThemeProps({props:e,name:"MuiButton"}),{children:u,color:y="primary",component:g="button",className:f,disabled:P=!1,disableElevation:T=!1,disableFocusRipple:I=!1,endIcon:v,focusVisibleClassName:C,fullWidth:c=!1,size:z="medium",startIcon:b,type:B,variant:j="text"}=s,k=t._objectWithoutPropertiesLoose(s,Q),h=t._extends({},s,{color:y,component:g,disabled:P,disableElevation:T,disableFocusRipple:I,fullWidth:c,size:z,type:B,variant:j}),x=X(h),W=b&&d.jsx(Z,{className:x.startIcon,ownerState:h,children:b}),M=v&&d.jsx(w,{className:x.endIcon,ownerState:h,children:v}),V=r||"";return d.jsxs(Y,t._extends({ownerState:h,className:t.clsx(a.className,x.root,f,V),component:g,disabled:P,focusRipple:!I,focusVisibleClassName:t.clsx(x.focusVisible,C),ref:i,type:B},k,{classes:x,children:[W,u,M]}))});process.env.NODE_ENV!=="production"&&(_.propTypes={children:t.PropTypes.node,classes:t.PropTypes.object,className:t.PropTypes.string,color:t.PropTypes.oneOfType([t.PropTypes.oneOf(["inherit","primary","secondary","success","error","info","warning"]),t.PropTypes.string]),component:t.PropTypes.elementType,disabled:t.PropTypes.bool,disableElevation:t.PropTypes.bool,disableFocusRipple:t.PropTypes.bool,disableRipple:t.PropTypes.bool,endIcon:t.PropTypes.node,focusVisibleClassName:t.PropTypes.string,fullWidth:t.PropTypes.bool,href:t.PropTypes.string,size:t.PropTypes.oneOfType([t.PropTypes.oneOf(["small","medium","large"]),t.PropTypes.string]),startIcon:t.PropTypes.node,sx:t.PropTypes.oneOfType([t.PropTypes.arrayOf(t.PropTypes.oneOfType([t.PropTypes.func,t.PropTypes.object,t.PropTypes.bool])),t.PropTypes.func,t.PropTypes.object]),type:t.PropTypes.oneOfType([t.PropTypes.oneOf(["button","reset","submit"]),t.PropTypes.string]),variant:t.PropTypes.oneOfType([t.PropTypes.oneOf(["contained","outlined","text"]),t.PropTypes.string])});const oo=_;function no(o){return t.generateUtilityClass("MuiLoadingButton",o)}const to=t.generateUtilityClasses("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),l=to,io=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],ao=o=>{const{loading:n,loadingPosition:i,classes:a}=o,r={root:["root",n&&"loading"],startIcon:[n&&`startIconLoading${t.capitalize(i)}`],endIcon:[n&&`endIconLoading${t.capitalize(i)}`],loadingIndicator:["loadingIndicator",n&&`loadingIndicator${t.capitalize(i)}`]},e=t.composeClasses(r,no,a);return t._extends({},a,e)},ro=o=>o!=="ownerState"&&o!=="theme"&&o!=="sx"&&o!=="as"&&o!=="classes",eo=t.styled(oo,{shouldForwardProp:o=>ro(o)||o==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(o,n)=>[n.root,n.startIconLoadingStart&&{[`& .${l.startIconLoadingStart}`]:n.startIconLoadingStart},n.endIconLoadingEnd&&{[`& .${l.endIconLoadingEnd}`]:n.endIconLoadingEnd}]})(({ownerState:o,theme:n})=>t._extends({[`& .${l.startIconLoadingStart}, & .${l.endIconLoadingEnd}`]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0}},o.loadingPosition==="center"&&{transition:n.transitions.create(["background-color","box-shadow","border-color"],{duration:n.transitions.duration.short}),[`&.${l.loading}`]:{color:"transparent"}},o.loadingPosition==="start"&&o.fullWidth&&{[`& .${l.startIconLoadingStart}, & .${l.endIconLoadingEnd}`]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0,marginRight:-8}},o.loadingPosition==="end"&&o.fullWidth&&{[`& .${l.startIconLoadingStart}, & .${l.endIconLoadingEnd}`]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0,marginLeft:-8}})),so=t.styled("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(o,n)=>{const{ownerState:i}=o;return[n.loadingIndicator,n[`loadingIndicator${t.capitalize(i.loadingPosition)}`]]}})(({theme:o,ownerState:n})=>t._extends({position:"absolute",visibility:"visible",display:"flex"},n.loadingPosition==="start"&&(n.variant==="outlined"||n.variant==="contained")&&{left:n.size==="small"?10:14},n.loadingPosition==="start"&&n.variant==="text"&&{left:6},n.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(o.vars||o).palette.action.disabled},n.loadingPosition==="end"&&(n.variant==="outlined"||n.variant==="contained")&&{right:n.size==="small"?10:14},n.loadingPosition==="end"&&n.variant==="text"&&{right:6},n.loadingPosition==="start"&&n.fullWidth&&{position:"relative",left:-10},n.loadingPosition==="end"&&n.fullWidth&&{position:"relative",right:-10})),N=p.forwardRef(function(n,i){const a=p.useContext(E),r=t.resolveProps(a,n),e=t.useThemeProps({props:r,name:"MuiLoadingButton"}),{children:s,disabled:u=!1,id:y,loading:g=!1,loadingIndicator:f,loadingPosition:P="center",variant:T="text"}=e,I=t._objectWithoutPropertiesLoose(e,io),v=U.useId(y),C=f??d.jsx(G.CircularProgress,{"aria-labelledby":v,color:"inherit",size:16}),c=t._extends({},e,{disabled:u,loading:g,loadingIndicator:C,loadingPosition:P,variant:T}),z=ao(c),b=g?d.jsx(so,{className:z.loadingIndicator,ownerState:c,children:C}):null;return d.jsxs(eo,t._extends({disabled:u||g,id:v,ref:i},I,{variant:T,classes:z,ownerState:c,children:[c.loadingPosition==="end"?s:b,c.loadingPosition==="end"?b:s]}))});process.env.NODE_ENV!=="production"&&(N.propTypes={children:t.PropTypes.node,classes:t.PropTypes.object,disabled:t.PropTypes.bool,id:t.PropTypes.string,loading:t.PropTypes.bool,loadingIndicator:t.PropTypes.node,loadingPosition:F.chainPropTypes(t.PropTypes.oneOf(["start","end","center"]),o=>o.loadingPosition==="start"&&!o.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):o.loadingPosition==="end"&&!o.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:t.PropTypes.oneOfType([t.PropTypes.arrayOf(t.PropTypes.oneOfType([t.PropTypes.func,t.PropTypes.object,t.PropTypes.bool])),t.PropTypes.func,t.PropTypes.object]),variant:t.PropTypes.oneOfType([t.PropTypes.oneOf(["contained","outlined","text"]),t.PropTypes.string])});const lo=N,co=t.styled(lo,{shouldForwardProp:o=>o!=="contentColor"&&o!=="hoverColor"})(({contentColor:o,hoverColor:n,theme:i})=>({justifyContent:"center",alignItems:"center",columnGap:8,minHeight:38,paddingLeft:12,paddingRight:12,textTransform:"none",color:o,borderColor:o,borderRadius:5,borderWidth:2,"&:hover":{color:i.palette.common.white,backgroundColor:n,borderColor:n,borderWidth:2}})),po=({icon:o,text:n,...i})=>{const a=S.useTheme(),r=i.contentColor??a.palette.primary.main;return d.jsxs(co,{...i,variant:"outlined",contentColor:r,hoverColor:i.hoverColor??r,children:[(o==null?void 0:o.position)==="left"?d.jsx(L,{...o}):null,n,(o==null?void 0:o.position)==="right"?d.jsx(L,{...o}):null]})};module.exports=po;
|