@amateescu/portal-ui-components 0.0.6 → 0.0.7-beta1

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.
@@ -0,0 +1,226 @@
1
+ import * as $ from "react";
2
+ import { ThemeContext as N, css as w, keyframes as O } from "@emotion/react";
3
+ import { d as R, f as E, g as U, u as z, h as l, i as I, j as g, c as F, P as t, k as K } from "./generateUtilityClasses-yRWzVVZS.js";
4
+ import { _ as V, a as i } from "./index-kNWC7pFF.js";
5
+ import { jsx as y } from "react/jsx-runtime";
6
+ function W(e) {
7
+ return Object.keys(e).length === 0;
8
+ }
9
+ function B(e = null) {
10
+ const r = $.useContext(N);
11
+ return !r || W(r) ? e : r;
12
+ }
13
+ const G = R();
14
+ function oe(e = G) {
15
+ return B(e);
16
+ }
17
+ function L(e) {
18
+ return E("MuiCircularProgress", e);
19
+ }
20
+ U("MuiCircularProgress", ["root", "determinate", "indeterminate", "colorPrimary", "colorSecondary", "svg", "circle", "circleDeterminate", "circleIndeterminate", "circleDisableShrink"]);
21
+ const Y = ["className", "color", "disableShrink", "size", "style", "thickness", "value", "variant"];
22
+ let u = (e) => e, P, S, T, D;
23
+ const o = 44, Z = O(P || (P = u`
24
+ 0% {
25
+ transform: rotate(0deg);
26
+ }
27
+
28
+ 100% {
29
+ transform: rotate(360deg);
30
+ }
31
+ `)), q = O(S || (S = u`
32
+ 0% {
33
+ stroke-dasharray: 1px, 200px;
34
+ stroke-dashoffset: 0;
35
+ }
36
+
37
+ 50% {
38
+ stroke-dasharray: 100px, 200px;
39
+ stroke-dashoffset: -15px;
40
+ }
41
+
42
+ 100% {
43
+ stroke-dasharray: 100px, 200px;
44
+ stroke-dashoffset: -125px;
45
+ }
46
+ `)), A = (e) => {
47
+ const {
48
+ classes: r,
49
+ variant: s,
50
+ color: a,
51
+ disableShrink: m
52
+ } = e, d = {
53
+ root: ["root", s, `color${l(a)}`],
54
+ svg: ["svg"],
55
+ circle: ["circle", `circle${l(s)}`, m && "circleDisableShrink"]
56
+ };
57
+ return I(d, L, r);
58
+ }, H = g("span", {
59
+ name: "MuiCircularProgress",
60
+ slot: "Root",
61
+ overridesResolver: (e, r) => {
62
+ const {
63
+ ownerState: s
64
+ } = e;
65
+ return [r.root, r[s.variant], r[`color${l(s.color)}`]];
66
+ }
67
+ })(({
68
+ ownerState: e,
69
+ theme: r
70
+ }) => i({
71
+ display: "inline-block"
72
+ }, e.variant === "determinate" && {
73
+ transition: r.transitions.create("transform")
74
+ }, e.color !== "inherit" && {
75
+ color: (r.vars || r).palette[e.color].main
76
+ }), ({
77
+ ownerState: e
78
+ }) => e.variant === "indeterminate" && w(T || (T = u`
79
+ animation: ${0} 1.4s linear infinite;
80
+ `), Z)), J = g("svg", {
81
+ name: "MuiCircularProgress",
82
+ slot: "Svg",
83
+ overridesResolver: (e, r) => r.svg
84
+ })({
85
+ display: "block"
86
+ // Keeps the progress centered
87
+ }), Q = g("circle", {
88
+ name: "MuiCircularProgress",
89
+ slot: "Circle",
90
+ overridesResolver: (e, r) => {
91
+ const {
92
+ ownerState: s
93
+ } = e;
94
+ return [r.circle, r[`circle${l(s.variant)}`], s.disableShrink && r.circleDisableShrink];
95
+ }
96
+ })(({
97
+ ownerState: e,
98
+ theme: r
99
+ }) => i({
100
+ stroke: "currentColor"
101
+ }, e.variant === "determinate" && {
102
+ transition: r.transitions.create("stroke-dashoffset")
103
+ }, e.variant === "indeterminate" && {
104
+ // Some default value that looks fine waiting for the animation to kicks in.
105
+ strokeDasharray: "80px, 200px",
106
+ strokeDashoffset: 0
107
+ // Add the unit to fix a Edge 16 and below bug.
108
+ }), ({
109
+ ownerState: e
110
+ }) => e.variant === "indeterminate" && !e.disableShrink && w(D || (D = u`
111
+ animation: ${0} 1.4s ease-in-out infinite;
112
+ `), q)), X = /* @__PURE__ */ $.forwardRef(function(r, s) {
113
+ const a = z({
114
+ props: r,
115
+ name: "MuiCircularProgress"
116
+ }), {
117
+ className: m,
118
+ color: d = "primary",
119
+ disableShrink: _ = !1,
120
+ size: f = 40,
121
+ style: j,
122
+ thickness: n = 3.6,
123
+ value: h = 0,
124
+ variant: k = "indeterminate"
125
+ } = a, M = V(a, Y), c = i({}, a, {
126
+ color: d,
127
+ disableShrink: _,
128
+ size: f,
129
+ thickness: n,
130
+ value: h,
131
+ variant: k
132
+ }), p = A(c), v = {}, b = {}, x = {};
133
+ if (k === "determinate") {
134
+ const C = 2 * Math.PI * ((o - n) / 2);
135
+ v.strokeDasharray = C.toFixed(3), x["aria-valuenow"] = Math.round(h), v.strokeDashoffset = `${((100 - h) / 100 * C).toFixed(3)}px`, b.transform = "rotate(-90deg)";
136
+ }
137
+ return /* @__PURE__ */ y(H, i({
138
+ className: F(p.root, m),
139
+ style: i({
140
+ width: f,
141
+ height: f
142
+ }, b, j),
143
+ ownerState: c,
144
+ ref: s,
145
+ role: "progressbar"
146
+ }, x, M, {
147
+ children: /* @__PURE__ */ y(J, {
148
+ className: p.svg,
149
+ ownerState: c,
150
+ viewBox: `${o / 2} ${o / 2} ${o} ${o}`,
151
+ children: /* @__PURE__ */ y(Q, {
152
+ className: p.circle,
153
+ style: v,
154
+ ownerState: c,
155
+ cx: o,
156
+ cy: o,
157
+ r: (o - n) / 2,
158
+ fill: "none",
159
+ strokeWidth: n
160
+ })
161
+ })
162
+ }));
163
+ });
164
+ process.env.NODE_ENV !== "production" && (X.propTypes = {
165
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
166
+ // │ These PropTypes are generated from the TypeScript type definitions. │
167
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
168
+ // └─────────────────────────────────────────────────────────────────────┘
169
+ /**
170
+ * Override or extend the styles applied to the component.
171
+ */
172
+ classes: t.object,
173
+ /**
174
+ * @ignore
175
+ */
176
+ className: t.string,
177
+ /**
178
+ * The color of the component.
179
+ * It supports both default and custom theme colors, which can be added as shown in the
180
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
181
+ * @default 'primary'
182
+ */
183
+ color: t.oneOfType([t.oneOf(["inherit", "primary", "secondary", "error", "info", "success", "warning"]), t.string]),
184
+ /**
185
+ * If `true`, the shrink animation is disabled.
186
+ * This only works if variant is `indeterminate`.
187
+ * @default false
188
+ */
189
+ disableShrink: K(t.bool, (e) => e.disableShrink && e.variant && e.variant !== "indeterminate" ? new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect.") : null),
190
+ /**
191
+ * The size of the component.
192
+ * If using a number, the pixel unit is assumed.
193
+ * If using a string, you need to provide the CSS unit, for example '3rem'.
194
+ * @default 40
195
+ */
196
+ size: t.oneOfType([t.number, t.string]),
197
+ /**
198
+ * @ignore
199
+ */
200
+ style: t.object,
201
+ /**
202
+ * The system prop that allows defining system overrides as well as additional CSS styles.
203
+ */
204
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
205
+ /**
206
+ * The thickness of the circle.
207
+ * @default 3.6
208
+ */
209
+ thickness: t.number,
210
+ /**
211
+ * The value of the progress indicator for the determinate variant.
212
+ * Value between 0 and 100.
213
+ * @default 0
214
+ */
215
+ value: t.number,
216
+ /**
217
+ * The variant to use.
218
+ * Use indeterminate when there is no progress value.
219
+ * @default 'indeterminate'
220
+ */
221
+ variant: t.oneOf(["determinate", "indeterminate"])
222
+ });
223
+ export {
224
+ X as C,
225
+ oe as u
226
+ };