@genai-fi/base 3.0.2 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +6 -9
  2. package/dist/Button-CGKw9sMz.js +656 -0
  3. package/dist/CircularProgress-C6sMwjDC.js +1275 -0
  4. package/dist/{DefaultPropsProvider-C0Ib4Mye.js → DefaultPropsProvider-D2IJ8Qbs.js} +5 -1
  5. package/dist/{DialogQR-DVWhImXI.js → DialogQR-wJru73YO.js} +10 -5
  6. package/dist/{FlashWifi-CaAOKd3g.js → FlashWifi-CYp0UP0B.js} +1 -1
  7. package/dist/Portal-BqkDy0Wc.js +613 -0
  8. package/dist/SvgLayer-DQQ6Pb5G.js +37 -0
  9. package/dist/assets/IconButtonDot.css +1 -0
  10. package/dist/assets/LangSelect.css +1 -0
  11. package/dist/assets/Loading.css +1 -0
  12. package/dist/assets/PercentageBar.css +1 -0
  13. package/dist/assets/PieScore.css +1 -0
  14. package/dist/assets/SvgLayer.css +1 -0
  15. package/dist/assets/Widget.css +1 -0
  16. package/dist/assets/style.css +1 -1
  17. package/dist/assets/style2.css +1 -0
  18. package/dist/colours.module.css +4 -0
  19. package/dist/components/AlertPara/AlertPara.js +1 -1
  20. package/dist/components/Application/Application.d.ts +10 -0
  21. package/dist/components/Application/Application.js +1610 -0
  22. package/dist/components/BusyButton/BusyButton.js +7 -6
  23. package/dist/components/Button/Button.js +12 -4
  24. package/dist/components/ConnectionStatus/ConnectionStatus.d.ts +1 -5
  25. package/dist/components/ConnectionStatus/ConnectionStatus.js +48 -47
  26. package/dist/components/ConnectionStatus/FlashWifi.js +1 -1
  27. package/dist/components/ContentLoader/ContentError.js +1 -1
  28. package/dist/components/ContentLoader/ContentLoader.js +5 -1
  29. package/dist/components/ContentLoader/ContentProgress.js +1 -1
  30. package/dist/components/IconButtonDot/IconButtonDot.d.ts +7 -0
  31. package/dist/components/IconButtonDot/IconButtonDot.js +22 -0
  32. package/dist/components/IconMenu/IconMenu.d.ts +12 -0
  33. package/dist/components/IconMenu/IconMenu.js +26 -0
  34. package/dist/components/IconMenu/IconMenuInline.d.ts +6 -0
  35. package/dist/components/IconMenu/IconMenuInline.js +12 -0
  36. package/dist/components/IconMenu/Item.d.ts +9 -0
  37. package/dist/components/IconMenu/Item.js +34 -0
  38. package/dist/components/IconMenu/Spacer.d.ts +1 -0
  39. package/dist/components/IconMenu/Spacer.js +11 -0
  40. package/dist/components/IconMenu/context.d.ts +1 -0
  41. package/dist/components/IconMenu/context.js +5 -0
  42. package/dist/components/IconMenu/index.d.ts +4 -0
  43. package/dist/components/IconMenu/index.js +10 -0
  44. package/dist/components/LangSelect/LangSelect.d.ts +12 -0
  45. package/dist/components/LangSelect/LangSelect.js +46 -0
  46. package/dist/components/Loading/Loading.d.ts +7 -0
  47. package/dist/components/Loading/Loading.js +15 -0
  48. package/dist/components/Motd/Motd.js +1 -1
  49. package/dist/components/PercentageBar/PercentageBar.d.ts +7 -0
  50. package/dist/components/PercentageBar/PercentageBar.js +37 -0
  51. package/dist/components/PieScore/PieScore.d.ts +6 -0
  52. package/dist/components/PieScore/PieScore.js +10676 -0
  53. package/dist/components/QRCode/DialogQR.js +9 -4
  54. package/dist/components/QRCode/QRCode.js +1 -1
  55. package/dist/components/Webcam/Webcam.js +3 -3
  56. package/dist/components/WorkflowLayout/Layout.d.ts +7 -0
  57. package/dist/components/WorkflowLayout/Layout.js +44 -0
  58. package/dist/components/WorkflowLayout/SvgLayer.d.ts +14 -0
  59. package/dist/components/WorkflowLayout/SvgLayer.js +5 -0
  60. package/dist/components/WorkflowLayout/Widget.d.ts +19 -0
  61. package/dist/components/WorkflowLayout/Widget.js +7421 -0
  62. package/dist/components/WorkflowLayout/index.d.ts +4 -0
  63. package/dist/components/WorkflowLayout/index.js +11 -0
  64. package/dist/components/WorkflowLayout/lines.d.ts +17 -0
  65. package/dist/components/WorkflowLayout/lines.js +39 -0
  66. package/dist/{createSvgIcon-BfF8yuCp.js → createSvgIcon-DmrVEdN7.js} +2 -2
  67. package/dist/{createTheme-BIcG8YPQ.js → createTheme-a85zdZWm.js} +4 -0
  68. package/dist/hooks/peer.d.ts +25 -2
  69. package/dist/hooks/peer.js +196 -54
  70. package/dist/main.d.ts +6 -0
  71. package/dist/main.js +58 -33
  72. package/dist/react-D_xU5dL6.js +112 -0
  73. package/dist/state/webrtcState.js +5 -4
  74. package/dist/style/theme.js +1 -1
  75. package/dist/style.module-BAnhZ_KJ.js +9 -0
  76. package/dist/style.module-BDpZJv9y.js +26 -0
  77. package/dist/util/Observer.d.ts +7 -0
  78. package/dist/util/Observer.js +9 -0
  79. package/dist/{webrtcState-D0nJpE9Z.js → vanilla-BJxibF1U.js} +83 -85
  80. package/package.json +8 -2
  81. package/dist/Button-DQwRVw4a.js +0 -1918
  82. package/dist/react-D-b-Xrzv.js +0 -98
  83. package/dist/style.module-DSFm2eLD.js +0 -9
package/README.md CHANGED
@@ -1,18 +1,15 @@
1
- # Introduction
1
+ # Introduction
2
+
2
3
  [Generation AI](https://www.generation-ai-stn.fi) base code library for all common components of our educational apps.
3
4
 
4
5
  # Getting Started
6
+
5
7
  ```bash
6
- npm install @knicos/genai-base
8
+ npm install @genai-fi/base
7
9
  ```
8
10
 
9
- ```typescript
10
- import { ConnectionMonitor } from '@knicos/genai-base';
11
-
12
- function MyComponent() {
13
- return <ConnectionMonitor />;
14
- }
15
- ```
11
+ See the Ladle stories in the `src` folder.
16
12
 
17
13
  # Build and Test
14
+
18
15
  Use `npm run build` to build the library in the `dist` folder. Testing uses vitest with `npm test`.
@@ -0,0 +1,656 @@
1
+ import * as b from "react";
2
+ import { g as A, a as r, b as y, P as t } from "./createTheme-a85zdZWm.js";
3
+ import { g as q, r as J, u as K, s as x, c as R, a as Q, b as X, m as Y } from "./DefaultPropsProvider-D2IJ8Qbs.js";
4
+ import { u as Z, B as oo, c as to, C as ao } from "./CircularProgress-C6sMwjDC.js";
5
+ import { jsxs as no, jsx as d } from "react/jsx-runtime";
6
+ function io(o) {
7
+ return A("MuiButton", o);
8
+ }
9
+ const p = q("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", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge", "loading", "loadingWrapper", "loadingIconPlaceholder", "loadingIndicator", "loadingPositionCenter", "loadingPositionStart", "loadingPositionEnd"]), W = /* @__PURE__ */ b.createContext({});
10
+ process.env.NODE_ENV !== "production" && (W.displayName = "ButtonGroupContext");
11
+ const T = /* @__PURE__ */ b.createContext(void 0);
12
+ process.env.NODE_ENV !== "production" && (T.displayName = "ButtonGroupButtonContext");
13
+ const ro = (o) => {
14
+ const {
15
+ color: a,
16
+ disableElevation: n,
17
+ fullWidth: i,
18
+ size: c,
19
+ variant: u,
20
+ loading: g,
21
+ loadingPosition: z,
22
+ classes: f
23
+ } = o, S = {
24
+ root: ["root", g && "loading", u, `${u}${r(a)}`, `size${r(c)}`, `${u}Size${r(c)}`, `color${r(a)}`, n && "disableElevation", i && "fullWidth", g && `loadingPosition${r(z)}`],
25
+ startIcon: ["icon", "startIcon", `iconSize${r(c)}`],
26
+ endIcon: ["icon", "endIcon", `iconSize${r(c)}`],
27
+ loadingIndicator: ["loadingIndicator"],
28
+ loadingWrapper: ["loadingWrapper"]
29
+ }, I = Q(S, io, f);
30
+ return {
31
+ ...f,
32
+ // forward the focused, disabled, etc. classes to the ButtonBase
33
+ ...I
34
+ };
35
+ }, L = [{
36
+ props: {
37
+ size: "small"
38
+ },
39
+ style: {
40
+ "& > *:nth-of-type(1)": {
41
+ fontSize: 18
42
+ }
43
+ }
44
+ }, {
45
+ props: {
46
+ size: "medium"
47
+ },
48
+ style: {
49
+ "& > *:nth-of-type(1)": {
50
+ fontSize: 20
51
+ }
52
+ }
53
+ }, {
54
+ props: {
55
+ size: "large"
56
+ },
57
+ style: {
58
+ "& > *:nth-of-type(1)": {
59
+ fontSize: 22
60
+ }
61
+ }
62
+ }], eo = x(oo, {
63
+ shouldForwardProp: (o) => X(o) || o === "classes",
64
+ name: "MuiButton",
65
+ slot: "Root",
66
+ overridesResolver: (o, a) => {
67
+ const {
68
+ ownerState: n
69
+ } = o;
70
+ return [a.root, a[n.variant], a[`${n.variant}${r(n.color)}`], a[`size${r(n.size)}`], a[`${n.variant}Size${r(n.size)}`], n.color === "inherit" && a.colorInherit, n.disableElevation && a.disableElevation, n.fullWidth && a.fullWidth, n.loading && a.loading];
71
+ }
72
+ })(Y(({
73
+ theme: o
74
+ }) => {
75
+ const a = o.palette.mode === "light" ? o.palette.grey[300] : o.palette.grey[800], n = o.palette.mode === "light" ? o.palette.grey.A100 : o.palette.grey[700];
76
+ return {
77
+ ...o.typography.button,
78
+ minWidth: 64,
79
+ padding: "6px 16px",
80
+ border: 0,
81
+ borderRadius: (o.vars || o).shape.borderRadius,
82
+ transition: o.transitions.create(["background-color", "box-shadow", "border-color", "color"], {
83
+ duration: o.transitions.duration.short
84
+ }),
85
+ "&:hover": {
86
+ textDecoration: "none"
87
+ },
88
+ [`&.${p.disabled}`]: {
89
+ color: (o.vars || o).palette.action.disabled
90
+ },
91
+ variants: [{
92
+ props: {
93
+ variant: "contained"
94
+ },
95
+ style: {
96
+ color: "var(--variant-containedColor)",
97
+ backgroundColor: "var(--variant-containedBg)",
98
+ boxShadow: (o.vars || o).shadows[2],
99
+ "&:hover": {
100
+ boxShadow: (o.vars || o).shadows[4],
101
+ // Reset on touch devices, it doesn't add specificity
102
+ "@media (hover: none)": {
103
+ boxShadow: (o.vars || o).shadows[2]
104
+ }
105
+ },
106
+ "&:active": {
107
+ boxShadow: (o.vars || o).shadows[8]
108
+ },
109
+ [`&.${p.focusVisible}`]: {
110
+ boxShadow: (o.vars || o).shadows[6]
111
+ },
112
+ [`&.${p.disabled}`]: {
113
+ color: (o.vars || o).palette.action.disabled,
114
+ boxShadow: (o.vars || o).shadows[0],
115
+ backgroundColor: (o.vars || o).palette.action.disabledBackground
116
+ }
117
+ }
118
+ }, {
119
+ props: {
120
+ variant: "outlined"
121
+ },
122
+ style: {
123
+ padding: "5px 15px",
124
+ border: "1px solid currentColor",
125
+ borderColor: "var(--variant-outlinedBorder, currentColor)",
126
+ backgroundColor: "var(--variant-outlinedBg)",
127
+ color: "var(--variant-outlinedColor)",
128
+ [`&.${p.disabled}`]: {
129
+ border: `1px solid ${(o.vars || o).palette.action.disabledBackground}`
130
+ }
131
+ }
132
+ }, {
133
+ props: {
134
+ variant: "text"
135
+ },
136
+ style: {
137
+ padding: "6px 8px",
138
+ color: "var(--variant-textColor)",
139
+ backgroundColor: "var(--variant-textBg)"
140
+ }
141
+ }, ...Object.entries(o.palette).filter(to()).map(([i]) => ({
142
+ props: {
143
+ color: i
144
+ },
145
+ style: {
146
+ "--variant-textColor": (o.vars || o).palette[i].main,
147
+ "--variant-outlinedColor": (o.vars || o).palette[i].main,
148
+ "--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[i].mainChannel} / 0.5)` : y(o.palette[i].main, 0.5),
149
+ "--variant-containedColor": (o.vars || o).palette[i].contrastText,
150
+ "--variant-containedBg": (o.vars || o).palette[i].main,
151
+ "@media (hover: hover)": {
152
+ "&:hover": {
153
+ "--variant-containedBg": (o.vars || o).palette[i].dark,
154
+ "--variant-textBg": o.vars ? `rgba(${o.vars.palette[i].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : y(o.palette[i].main, o.palette.action.hoverOpacity),
155
+ "--variant-outlinedBorder": (o.vars || o).palette[i].main,
156
+ "--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[i].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : y(o.palette[i].main, o.palette.action.hoverOpacity)
157
+ }
158
+ }
159
+ }
160
+ })), {
161
+ props: {
162
+ color: "inherit"
163
+ },
164
+ style: {
165
+ color: "inherit",
166
+ borderColor: "currentColor",
167
+ "--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg : a,
168
+ "@media (hover: hover)": {
169
+ "&:hover": {
170
+ "--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg : n,
171
+ "--variant-textBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : y(o.palette.text.primary, o.palette.action.hoverOpacity),
172
+ "--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : y(o.palette.text.primary, o.palette.action.hoverOpacity)
173
+ }
174
+ }
175
+ }
176
+ }, {
177
+ props: {
178
+ size: "small",
179
+ variant: "text"
180
+ },
181
+ style: {
182
+ padding: "4px 5px",
183
+ fontSize: o.typography.pxToRem(13)
184
+ }
185
+ }, {
186
+ props: {
187
+ size: "large",
188
+ variant: "text"
189
+ },
190
+ style: {
191
+ padding: "8px 11px",
192
+ fontSize: o.typography.pxToRem(15)
193
+ }
194
+ }, {
195
+ props: {
196
+ size: "small",
197
+ variant: "outlined"
198
+ },
199
+ style: {
200
+ padding: "3px 9px",
201
+ fontSize: o.typography.pxToRem(13)
202
+ }
203
+ }, {
204
+ props: {
205
+ size: "large",
206
+ variant: "outlined"
207
+ },
208
+ style: {
209
+ padding: "7px 21px",
210
+ fontSize: o.typography.pxToRem(15)
211
+ }
212
+ }, {
213
+ props: {
214
+ size: "small",
215
+ variant: "contained"
216
+ },
217
+ style: {
218
+ padding: "4px 10px",
219
+ fontSize: o.typography.pxToRem(13)
220
+ }
221
+ }, {
222
+ props: {
223
+ size: "large",
224
+ variant: "contained"
225
+ },
226
+ style: {
227
+ padding: "8px 22px",
228
+ fontSize: o.typography.pxToRem(15)
229
+ }
230
+ }, {
231
+ props: {
232
+ disableElevation: !0
233
+ },
234
+ style: {
235
+ boxShadow: "none",
236
+ "&:hover": {
237
+ boxShadow: "none"
238
+ },
239
+ [`&.${p.focusVisible}`]: {
240
+ boxShadow: "none"
241
+ },
242
+ "&:active": {
243
+ boxShadow: "none"
244
+ },
245
+ [`&.${p.disabled}`]: {
246
+ boxShadow: "none"
247
+ }
248
+ }
249
+ }, {
250
+ props: {
251
+ fullWidth: !0
252
+ },
253
+ style: {
254
+ width: "100%"
255
+ }
256
+ }, {
257
+ props: {
258
+ loadingPosition: "center"
259
+ },
260
+ style: {
261
+ transition: o.transitions.create(["background-color", "box-shadow", "border-color"], {
262
+ duration: o.transitions.duration.short
263
+ }),
264
+ [`&.${p.loading}`]: {
265
+ color: "transparent"
266
+ }
267
+ }
268
+ }]
269
+ };
270
+ })), so = x("span", {
271
+ name: "MuiButton",
272
+ slot: "StartIcon",
273
+ overridesResolver: (o, a) => {
274
+ const {
275
+ ownerState: n
276
+ } = o;
277
+ return [a.startIcon, n.loading && a.startIconLoadingStart, a[`iconSize${r(n.size)}`]];
278
+ }
279
+ })(({
280
+ theme: o
281
+ }) => ({
282
+ display: "inherit",
283
+ marginRight: 8,
284
+ marginLeft: -4,
285
+ variants: [{
286
+ props: {
287
+ size: "small"
288
+ },
289
+ style: {
290
+ marginLeft: -2
291
+ }
292
+ }, {
293
+ props: {
294
+ loadingPosition: "start",
295
+ loading: !0
296
+ },
297
+ style: {
298
+ transition: o.transitions.create(["opacity"], {
299
+ duration: o.transitions.duration.short
300
+ }),
301
+ opacity: 0
302
+ }
303
+ }, {
304
+ props: {
305
+ loadingPosition: "start",
306
+ loading: !0,
307
+ fullWidth: !0
308
+ },
309
+ style: {
310
+ marginRight: -8
311
+ }
312
+ }, ...L]
313
+ })), lo = x("span", {
314
+ name: "MuiButton",
315
+ slot: "EndIcon",
316
+ overridesResolver: (o, a) => {
317
+ const {
318
+ ownerState: n
319
+ } = o;
320
+ return [a.endIcon, n.loading && a.endIconLoadingEnd, a[`iconSize${r(n.size)}`]];
321
+ }
322
+ })(({
323
+ theme: o
324
+ }) => ({
325
+ display: "inherit",
326
+ marginRight: -4,
327
+ marginLeft: 8,
328
+ variants: [{
329
+ props: {
330
+ size: "small"
331
+ },
332
+ style: {
333
+ marginRight: -2
334
+ }
335
+ }, {
336
+ props: {
337
+ loadingPosition: "end",
338
+ loading: !0
339
+ },
340
+ style: {
341
+ transition: o.transitions.create(["opacity"], {
342
+ duration: o.transitions.duration.short
343
+ }),
344
+ opacity: 0
345
+ }
346
+ }, {
347
+ props: {
348
+ loadingPosition: "end",
349
+ loading: !0,
350
+ fullWidth: !0
351
+ },
352
+ style: {
353
+ marginLeft: -8
354
+ }
355
+ }, ...L]
356
+ })), po = x("span", {
357
+ name: "MuiButton",
358
+ slot: "LoadingIndicator"
359
+ })(({
360
+ theme: o
361
+ }) => ({
362
+ display: "none",
363
+ position: "absolute",
364
+ visibility: "visible",
365
+ variants: [{
366
+ props: {
367
+ loading: !0
368
+ },
369
+ style: {
370
+ display: "flex"
371
+ }
372
+ }, {
373
+ props: {
374
+ loadingPosition: "start"
375
+ },
376
+ style: {
377
+ left: 14
378
+ }
379
+ }, {
380
+ props: {
381
+ loadingPosition: "start",
382
+ size: "small"
383
+ },
384
+ style: {
385
+ left: 10
386
+ }
387
+ }, {
388
+ props: {
389
+ variant: "text",
390
+ loadingPosition: "start"
391
+ },
392
+ style: {
393
+ left: 6
394
+ }
395
+ }, {
396
+ props: {
397
+ loadingPosition: "center"
398
+ },
399
+ style: {
400
+ left: "50%",
401
+ transform: "translate(-50%)",
402
+ color: (o.vars || o).palette.action.disabled
403
+ }
404
+ }, {
405
+ props: {
406
+ loadingPosition: "end"
407
+ },
408
+ style: {
409
+ right: 14
410
+ }
411
+ }, {
412
+ props: {
413
+ loadingPosition: "end",
414
+ size: "small"
415
+ },
416
+ style: {
417
+ right: 10
418
+ }
419
+ }, {
420
+ props: {
421
+ variant: "text",
422
+ loadingPosition: "end"
423
+ },
424
+ style: {
425
+ right: 6
426
+ }
427
+ }, {
428
+ props: {
429
+ loadingPosition: "start",
430
+ fullWidth: !0
431
+ },
432
+ style: {
433
+ position: "relative",
434
+ left: -10
435
+ }
436
+ }, {
437
+ props: {
438
+ loadingPosition: "end",
439
+ fullWidth: !0
440
+ },
441
+ style: {
442
+ position: "relative",
443
+ right: -10
444
+ }
445
+ }]
446
+ })), E = x("span", {
447
+ name: "MuiButton",
448
+ slot: "LoadingIconPlaceholder"
449
+ })({
450
+ display: "inline-block",
451
+ width: "1em",
452
+ height: "1em"
453
+ }), co = /* @__PURE__ */ b.forwardRef(function(a, n) {
454
+ const i = b.useContext(W), c = b.useContext(T), u = J(i, a), g = K({
455
+ props: u,
456
+ name: "MuiButton"
457
+ }), {
458
+ children: z,
459
+ color: f = "primary",
460
+ component: S = "button",
461
+ className: I,
462
+ disabled: C = !1,
463
+ disableElevation: M = !1,
464
+ disableFocusRipple: B = !1,
465
+ endIcon: P,
466
+ focusVisibleClassName: k,
467
+ fullWidth: V = !1,
468
+ id: h,
469
+ loading: s = null,
470
+ loadingIndicator: j,
471
+ loadingPosition: v = "center",
472
+ size: D = "medium",
473
+ startIcon: m,
474
+ type: w,
475
+ variant: F = "text",
476
+ ...G
477
+ } = g, $ = Z(h), O = j ?? /* @__PURE__ */ d(ao, {
478
+ "aria-labelledby": $,
479
+ color: "inherit",
480
+ size: 16
481
+ }), l = {
482
+ ...g,
483
+ color: f,
484
+ component: S,
485
+ disabled: C,
486
+ disableElevation: M,
487
+ disableFocusRipple: B,
488
+ fullWidth: V,
489
+ loading: s,
490
+ loadingIndicator: O,
491
+ loadingPosition: v,
492
+ size: D,
493
+ type: w,
494
+ variant: F
495
+ }, e = ro(l), U = (m || s && v === "start") && /* @__PURE__ */ d(so, {
496
+ className: e.startIcon,
497
+ ownerState: l,
498
+ children: m || /* @__PURE__ */ d(E, {
499
+ className: e.loadingIconPlaceholder,
500
+ ownerState: l
501
+ })
502
+ }), _ = (P || s && v === "end") && /* @__PURE__ */ d(lo, {
503
+ className: e.endIcon,
504
+ ownerState: l,
505
+ children: P || /* @__PURE__ */ d(E, {
506
+ className: e.loadingIconPlaceholder,
507
+ ownerState: l
508
+ })
509
+ }), H = c || "", N = typeof s == "boolean" ? (
510
+ // use plain HTML span to minimize the runtime overhead
511
+ /* @__PURE__ */ d("span", {
512
+ className: e.loadingWrapper,
513
+ style: {
514
+ display: "contents"
515
+ },
516
+ children: s && /* @__PURE__ */ d(po, {
517
+ className: e.loadingIndicator,
518
+ ownerState: l,
519
+ children: O
520
+ })
521
+ })
522
+ ) : null;
523
+ return /* @__PURE__ */ no(eo, {
524
+ ownerState: l,
525
+ className: R(i.className, e.root, I, H),
526
+ component: S,
527
+ disabled: C || s,
528
+ focusRipple: !B,
529
+ focusVisibleClassName: R(e.focusVisible, k),
530
+ ref: n,
531
+ type: w,
532
+ id: s ? $ : h,
533
+ ...G,
534
+ classes: e,
535
+ children: [U, v !== "end" && N, z, v === "end" && N, _]
536
+ });
537
+ });
538
+ process.env.NODE_ENV !== "production" && (co.propTypes = {
539
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
540
+ // │ These PropTypes are generated from the TypeScript type definitions. │
541
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
542
+ // └─────────────────────────────────────────────────────────────────────┘
543
+ /**
544
+ * The content of the component.
545
+ */
546
+ children: t.node,
547
+ /**
548
+ * Override or extend the styles applied to the component.
549
+ */
550
+ classes: t.object,
551
+ /**
552
+ * @ignore
553
+ */
554
+ className: t.string,
555
+ /**
556
+ * The color of the component.
557
+ * It supports both default and custom theme colors, which can be added as shown in the
558
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
559
+ * @default 'primary'
560
+ */
561
+ color: t.oneOfType([t.oneOf(["inherit", "primary", "secondary", "success", "error", "info", "warning"]), t.string]),
562
+ /**
563
+ * The component used for the root node.
564
+ * Either a string to use a HTML element or a component.
565
+ */
566
+ component: t.elementType,
567
+ /**
568
+ * If `true`, the component is disabled.
569
+ * @default false
570
+ */
571
+ disabled: t.bool,
572
+ /**
573
+ * If `true`, no elevation is used.
574
+ * @default false
575
+ */
576
+ disableElevation: t.bool,
577
+ /**
578
+ * If `true`, the keyboard focus ripple is disabled.
579
+ * @default false
580
+ */
581
+ disableFocusRipple: t.bool,
582
+ /**
583
+ * If `true`, the ripple effect is disabled.
584
+ *
585
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
586
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
587
+ * @default false
588
+ */
589
+ disableRipple: t.bool,
590
+ /**
591
+ * Element placed after the children.
592
+ */
593
+ endIcon: t.node,
594
+ /**
595
+ * @ignore
596
+ */
597
+ focusVisibleClassName: t.string,
598
+ /**
599
+ * If `true`, the button will take up the full width of its container.
600
+ * @default false
601
+ */
602
+ fullWidth: t.bool,
603
+ /**
604
+ * The URL to link to when the button is clicked.
605
+ * If defined, an `a` element will be used as the root node.
606
+ */
607
+ href: t.string,
608
+ /**
609
+ * @ignore
610
+ */
611
+ id: t.string,
612
+ /**
613
+ * If `true`, the loading indicator is visible and the button is disabled.
614
+ * If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
615
+ * @default null
616
+ */
617
+ loading: t.bool,
618
+ /**
619
+ * Element placed before the children if the button is in loading state.
620
+ * The node should contain an element with `role="progressbar"` with an accessible name.
621
+ * By default, it renders a `CircularProgress` that is labeled by the button itself.
622
+ * @default <CircularProgress color="inherit" size={16} />
623
+ */
624
+ loadingIndicator: t.node,
625
+ /**
626
+ * The loading indicator can be positioned on the start, end, or the center of the button.
627
+ * @default 'center'
628
+ */
629
+ loadingPosition: t.oneOf(["center", "end", "start"]),
630
+ /**
631
+ * The size of the component.
632
+ * `small` is equivalent to the dense button styling.
633
+ * @default 'medium'
634
+ */
635
+ size: t.oneOfType([t.oneOf(["small", "medium", "large"]), t.string]),
636
+ /**
637
+ * Element placed before the children.
638
+ */
639
+ startIcon: t.node,
640
+ /**
641
+ * The system prop that allows defining system overrides as well as additional CSS styles.
642
+ */
643
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
644
+ /**
645
+ * @ignore
646
+ */
647
+ type: t.oneOfType([t.oneOf(["button", "reset", "submit"]), t.string]),
648
+ /**
649
+ * The variant to use.
650
+ * @default 'text'
651
+ */
652
+ variant: t.oneOfType([t.oneOf(["contained", "outlined", "text"]), t.string])
653
+ });
654
+ export {
655
+ co as B
656
+ };