@moodlehq/design-system 0.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js DELETED
@@ -1,628 +0,0 @@
1
- import Pe from "react";
2
- import { Button as fr } from "react-bootstrap";
3
- var U = { exports: {} }, F = {};
4
- var Te;
5
- function cr() {
6
- if (Te) return F;
7
- Te = 1;
8
- var C = Pe, E = /* @__PURE__ */ Symbol.for("react.element"), j = /* @__PURE__ */ Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, I = C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, $ = { key: !0, ref: !0, __self: !0, __source: !0 };
9
- function x(R, f, O) {
10
- var p, y = {}, _ = null, W = null;
11
- O !== void 0 && (_ = "" + O), f.key !== void 0 && (_ = "" + f.key), f.ref !== void 0 && (W = f.ref);
12
- for (p in f) b.call(f, p) && !$.hasOwnProperty(p) && (y[p] = f[p]);
13
- if (R && R.defaultProps) for (p in f = R.defaultProps, f) y[p] === void 0 && (y[p] = f[p]);
14
- return { $$typeof: E, type: R, key: _, ref: W, props: y, _owner: I.current };
15
- }
16
- return F.Fragment = j, F.jsx = x, F.jsxs = x, F;
17
- }
18
- var A = {};
19
- var Oe;
20
- function dr() {
21
- return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
22
- var C = Pe, E = /* @__PURE__ */ Symbol.for("react.element"), j = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), I = /* @__PURE__ */ Symbol.for("react.strict_mode"), $ = /* @__PURE__ */ Symbol.for("react.profiler"), x = /* @__PURE__ */ Symbol.for("react.provider"), R = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), O = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), y = /* @__PURE__ */ Symbol.for("react.memo"), _ = /* @__PURE__ */ Symbol.for("react.lazy"), W = /* @__PURE__ */ Symbol.for("react.offscreen"), H = Symbol.iterator, we = "@@iterator";
23
- function Ce(e) {
24
- if (e === null || typeof e != "object")
25
- return null;
26
- var r = H && e[H] || e[we];
27
- return typeof r == "function" ? r : null;
28
- }
29
- var S = C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
30
- function c(e) {
31
- {
32
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
33
- t[n - 1] = arguments[n];
34
- je("error", e, t);
35
- }
36
- }
37
- function je(e, r, t) {
38
- {
39
- var n = S.ReactDebugCurrentFrame, o = n.getStackAddendum();
40
- o !== "" && (r += "%s", t = t.concat([o]));
41
- var u = t.map(function(i) {
42
- return String(i);
43
- });
44
- u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
45
- }
46
- }
47
- var xe = !1, ke = !1, De = !1, Fe = !1, Ae = !1, Z;
48
- Z = /* @__PURE__ */ Symbol.for("react.module.reference");
49
- function Ie(e) {
50
- return !!(typeof e == "string" || typeof e == "function" || e === b || e === $ || Ae || e === I || e === O || e === p || Fe || e === W || xe || ke || De || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === y || e.$$typeof === x || e.$$typeof === R || e.$$typeof === f || // This needs to include all possible module reference object
51
- // types supported by any Flight configuration anywhere since
52
- // we don't know which Flight build this will end up being used
53
- // with.
54
- e.$$typeof === Z || e.getModuleId !== void 0));
55
- }
56
- function $e(e, r, t) {
57
- var n = e.displayName;
58
- if (n)
59
- return n;
60
- var o = r.displayName || r.name || "";
61
- return o !== "" ? t + "(" + o + ")" : t;
62
- }
63
- function Q(e) {
64
- return e.displayName || "Context";
65
- }
66
- function h(e) {
67
- if (e == null)
68
- return null;
69
- if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
70
- return e.displayName || e.name || null;
71
- if (typeof e == "string")
72
- return e;
73
- switch (e) {
74
- case b:
75
- return "Fragment";
76
- case j:
77
- return "Portal";
78
- case $:
79
- return "Profiler";
80
- case I:
81
- return "StrictMode";
82
- case O:
83
- return "Suspense";
84
- case p:
85
- return "SuspenseList";
86
- }
87
- if (typeof e == "object")
88
- switch (e.$$typeof) {
89
- case R:
90
- var r = e;
91
- return Q(r) + ".Consumer";
92
- case x:
93
- var t = e;
94
- return Q(t._context) + ".Provider";
95
- case f:
96
- return $e(e, e.render, "ForwardRef");
97
- case y:
98
- var n = e.displayName || null;
99
- return n !== null ? n : h(e.type) || "Memo";
100
- case _: {
101
- var o = e, u = o._payload, i = o._init;
102
- try {
103
- return h(i(u));
104
- } catch {
105
- return null;
106
- }
107
- }
108
- }
109
- return null;
110
- }
111
- var m = Object.assign, k = 0, ee, re, te, ne, ae, ie, oe;
112
- function ue() {
113
- }
114
- ue.__reactDisabledLog = !0;
115
- function We() {
116
- {
117
- if (k === 0) {
118
- ee = console.log, re = console.info, te = console.warn, ne = console.error, ae = console.group, ie = console.groupCollapsed, oe = console.groupEnd;
119
- var e = {
120
- configurable: !0,
121
- enumerable: !0,
122
- value: ue,
123
- writable: !0
124
- };
125
- Object.defineProperties(console, {
126
- info: e,
127
- log: e,
128
- warn: e,
129
- error: e,
130
- group: e,
131
- groupCollapsed: e,
132
- groupEnd: e
133
- });
134
- }
135
- k++;
136
- }
137
- }
138
- function Ye() {
139
- {
140
- if (k--, k === 0) {
141
- var e = {
142
- configurable: !0,
143
- enumerable: !0,
144
- writable: !0
145
- };
146
- Object.defineProperties(console, {
147
- log: m({}, e, {
148
- value: ee
149
- }),
150
- info: m({}, e, {
151
- value: re
152
- }),
153
- warn: m({}, e, {
154
- value: te
155
- }),
156
- error: m({}, e, {
157
- value: ne
158
- }),
159
- group: m({}, e, {
160
- value: ae
161
- }),
162
- groupCollapsed: m({}, e, {
163
- value: ie
164
- }),
165
- groupEnd: m({}, e, {
166
- value: oe
167
- })
168
- });
169
- }
170
- k < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
171
- }
172
- }
173
- var N = S.ReactCurrentDispatcher, B;
174
- function Y(e, r, t) {
175
- {
176
- if (B === void 0)
177
- try {
178
- throw Error();
179
- } catch (o) {
180
- var n = o.stack.trim().match(/\n( *(at )?)/);
181
- B = n && n[1] || "";
182
- }
183
- return `
184
- ` + B + e;
185
- }
186
- }
187
- var J = !1, V;
188
- {
189
- var Ve = typeof WeakMap == "function" ? WeakMap : Map;
190
- V = new Ve();
191
- }
192
- function se(e, r) {
193
- if (!e || J)
194
- return "";
195
- {
196
- var t = V.get(e);
197
- if (t !== void 0)
198
- return t;
199
- }
200
- var n;
201
- J = !0;
202
- var o = Error.prepareStackTrace;
203
- Error.prepareStackTrace = void 0;
204
- var u;
205
- u = N.current, N.current = null, We();
206
- try {
207
- if (r) {
208
- var i = function() {
209
- throw Error();
210
- };
211
- if (Object.defineProperty(i.prototype, "props", {
212
- set: function() {
213
- throw Error();
214
- }
215
- }), typeof Reflect == "object" && Reflect.construct) {
216
- try {
217
- Reflect.construct(i, []);
218
- } catch (v) {
219
- n = v;
220
- }
221
- Reflect.construct(e, [], i);
222
- } else {
223
- try {
224
- i.call();
225
- } catch (v) {
226
- n = v;
227
- }
228
- e.call(i.prototype);
229
- }
230
- } else {
231
- try {
232
- throw Error();
233
- } catch (v) {
234
- n = v;
235
- }
236
- e();
237
- }
238
- } catch (v) {
239
- if (v && n && typeof v.stack == "string") {
240
- for (var a = v.stack.split(`
241
- `), d = n.stack.split(`
242
- `), s = a.length - 1, l = d.length - 1; s >= 1 && l >= 0 && a[s] !== d[l]; )
243
- l--;
244
- for (; s >= 1 && l >= 0; s--, l--)
245
- if (a[s] !== d[l]) {
246
- if (s !== 1 || l !== 1)
247
- do
248
- if (s--, l--, l < 0 || a[s] !== d[l]) {
249
- var g = `
250
- ` + a[s].replace(" at new ", " at ");
251
- return e.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, g), g;
252
- }
253
- while (s >= 1 && l >= 0);
254
- break;
255
- }
256
- }
257
- } finally {
258
- J = !1, N.current = u, Ye(), Error.prepareStackTrace = o;
259
- }
260
- var w = e ? e.displayName || e.name : "", T = w ? Y(w) : "";
261
- return typeof e == "function" && V.set(e, T), T;
262
- }
263
- function Le(e, r, t) {
264
- return se(e, !1);
265
- }
266
- function Me(e) {
267
- var r = e.prototype;
268
- return !!(r && r.isReactComponent);
269
- }
270
- function L(e, r, t) {
271
- if (e == null)
272
- return "";
273
- if (typeof e == "function")
274
- return se(e, Me(e));
275
- if (typeof e == "string")
276
- return Y(e);
277
- switch (e) {
278
- case O:
279
- return Y("Suspense");
280
- case p:
281
- return Y("SuspenseList");
282
- }
283
- if (typeof e == "object")
284
- switch (e.$$typeof) {
285
- case f:
286
- return Le(e.render);
287
- case y:
288
- return L(e.type, r, t);
289
- case _: {
290
- var n = e, o = n._payload, u = n._init;
291
- try {
292
- return L(u(o), r, t);
293
- } catch {
294
- }
295
- }
296
- }
297
- return "";
298
- }
299
- var D = Object.prototype.hasOwnProperty, le = {}, fe = S.ReactDebugCurrentFrame;
300
- function M(e) {
301
- if (e) {
302
- var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
303
- fe.setExtraStackFrame(t);
304
- } else
305
- fe.setExtraStackFrame(null);
306
- }
307
- function Ue(e, r, t, n, o) {
308
- {
309
- var u = Function.call.bind(D);
310
- for (var i in e)
311
- if (u(e, i)) {
312
- var a = void 0;
313
- try {
314
- if (typeof e[i] != "function") {
315
- var d = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
316
- throw d.name = "Invariant Violation", d;
317
- }
318
- a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
319
- } catch (s) {
320
- a = s;
321
- }
322
- a && !(a instanceof Error) && (M(o), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), M(null)), a instanceof Error && !(a.message in le) && (le[a.message] = !0, M(o), c("Failed %s type: %s", t, a.message), M(null));
323
- }
324
- }
325
- }
326
- var Ne = Array.isArray;
327
- function q(e) {
328
- return Ne(e);
329
- }
330
- function Be(e) {
331
- {
332
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
333
- return t;
334
- }
335
- }
336
- function Je(e) {
337
- try {
338
- return ce(e), !1;
339
- } catch {
340
- return !0;
341
- }
342
- }
343
- function ce(e) {
344
- return "" + e;
345
- }
346
- function de(e) {
347
- if (Je(e))
348
- return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), ce(e);
349
- }
350
- var ve = S.ReactCurrentOwner, qe = {
351
- key: !0,
352
- ref: !0,
353
- __self: !0,
354
- __source: !0
355
- }, pe, ge;
356
- function Ke(e) {
357
- if (D.call(e, "ref")) {
358
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
359
- if (r && r.isReactWarning)
360
- return !1;
361
- }
362
- return e.ref !== void 0;
363
- }
364
- function Ge(e) {
365
- if (D.call(e, "key")) {
366
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
367
- if (r && r.isReactWarning)
368
- return !1;
369
- }
370
- return e.key !== void 0;
371
- }
372
- function ze(e, r) {
373
- typeof e.ref == "string" && ve.current;
374
- }
375
- function Xe(e, r) {
376
- {
377
- var t = function() {
378
- pe || (pe = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
379
- };
380
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
381
- get: t,
382
- configurable: !0
383
- });
384
- }
385
- }
386
- function He(e, r) {
387
- {
388
- var t = function() {
389
- ge || (ge = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
390
- };
391
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
392
- get: t,
393
- configurable: !0
394
- });
395
- }
396
- }
397
- var Ze = function(e, r, t, n, o, u, i) {
398
- var a = {
399
- // This tag allows us to uniquely identify this as a React Element
400
- $$typeof: E,
401
- // Built-in properties that belong on the element
402
- type: e,
403
- key: r,
404
- ref: t,
405
- props: i,
406
- // Record the component responsible for creating this element.
407
- _owner: u
408
- };
409
- return a._store = {}, Object.defineProperty(a._store, "validated", {
410
- configurable: !1,
411
- enumerable: !1,
412
- writable: !0,
413
- value: !1
414
- }), Object.defineProperty(a, "_self", {
415
- configurable: !1,
416
- enumerable: !1,
417
- writable: !1,
418
- value: n
419
- }), Object.defineProperty(a, "_source", {
420
- configurable: !1,
421
- enumerable: !1,
422
- writable: !1,
423
- value: o
424
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
425
- };
426
- function Qe(e, r, t, n, o) {
427
- {
428
- var u, i = {}, a = null, d = null;
429
- t !== void 0 && (de(t), a = "" + t), Ge(r) && (de(r.key), a = "" + r.key), Ke(r) && (d = r.ref, ze(r, o));
430
- for (u in r)
431
- D.call(r, u) && !qe.hasOwnProperty(u) && (i[u] = r[u]);
432
- if (e && e.defaultProps) {
433
- var s = e.defaultProps;
434
- for (u in s)
435
- i[u] === void 0 && (i[u] = s[u]);
436
- }
437
- if (a || d) {
438
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
439
- a && Xe(i, l), d && He(i, l);
440
- }
441
- return Ze(e, a, d, o, n, ve.current, i);
442
- }
443
- }
444
- var K = S.ReactCurrentOwner, ye = S.ReactDebugCurrentFrame;
445
- function P(e) {
446
- if (e) {
447
- var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
448
- ye.setExtraStackFrame(t);
449
- } else
450
- ye.setExtraStackFrame(null);
451
- }
452
- var G;
453
- G = !1;
454
- function z(e) {
455
- return typeof e == "object" && e !== null && e.$$typeof === E;
456
- }
457
- function Ee() {
458
- {
459
- if (K.current) {
460
- var e = h(K.current.type);
461
- if (e)
462
- return `
463
-
464
- Check the render method of \`` + e + "`.";
465
- }
466
- return "";
467
- }
468
- }
469
- function er(e) {
470
- return "";
471
- }
472
- var be = {};
473
- function rr(e) {
474
- {
475
- var r = Ee();
476
- if (!r) {
477
- var t = typeof e == "string" ? e : e.displayName || e.name;
478
- t && (r = `
479
-
480
- Check the top-level render call using <` + t + ">.");
481
- }
482
- return r;
483
- }
484
- }
485
- function he(e, r) {
486
- {
487
- if (!e._store || e._store.validated || e.key != null)
488
- return;
489
- e._store.validated = !0;
490
- var t = rr(r);
491
- if (be[t])
492
- return;
493
- be[t] = !0;
494
- var n = "";
495
- e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + h(e._owner.type) + "."), P(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), P(null);
496
- }
497
- }
498
- function Re(e, r) {
499
- {
500
- if (typeof e != "object")
501
- return;
502
- if (q(e))
503
- for (var t = 0; t < e.length; t++) {
504
- var n = e[t];
505
- z(n) && he(n, r);
506
- }
507
- else if (z(e))
508
- e._store && (e._store.validated = !0);
509
- else if (e) {
510
- var o = Ce(e);
511
- if (typeof o == "function" && o !== e.entries)
512
- for (var u = o.call(e), i; !(i = u.next()).done; )
513
- z(i.value) && he(i.value, r);
514
- }
515
- }
516
- }
517
- function tr(e) {
518
- {
519
- var r = e.type;
520
- if (r == null || typeof r == "string")
521
- return;
522
- var t;
523
- if (typeof r == "function")
524
- t = r.propTypes;
525
- else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
526
- // Inner props are checked in the reconciler.
527
- r.$$typeof === y))
528
- t = r.propTypes;
529
- else
530
- return;
531
- if (t) {
532
- var n = h(r);
533
- Ue(t, e.props, "prop", n, e);
534
- } else if (r.PropTypes !== void 0 && !G) {
535
- G = !0;
536
- var o = h(r);
537
- c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
538
- }
539
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
540
- }
541
- }
542
- function nr(e) {
543
- {
544
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
545
- var n = r[t];
546
- if (n !== "children" && n !== "key") {
547
- P(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), P(null);
548
- break;
549
- }
550
- }
551
- e.ref !== null && (P(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), P(null));
552
- }
553
- }
554
- var _e = {};
555
- function me(e, r, t, n, o, u) {
556
- {
557
- var i = Ie(e);
558
- if (!i) {
559
- var a = "";
560
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
561
- var d = er();
562
- d ? a += d : a += Ee();
563
- var s;
564
- e === null ? s = "null" : q(e) ? s = "array" : e !== void 0 && e.$$typeof === E ? (s = "<" + (h(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
565
- }
566
- var l = Qe(e, r, t, o, u);
567
- if (l == null)
568
- return l;
569
- if (i) {
570
- var g = r.children;
571
- if (g !== void 0)
572
- if (n)
573
- if (q(g)) {
574
- for (var w = 0; w < g.length; w++)
575
- Re(g[w], e);
576
- Object.freeze && Object.freeze(g);
577
- } else
578
- c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
579
- else
580
- Re(g, e);
581
- }
582
- if (D.call(r, "key")) {
583
- var T = h(e), v = Object.keys(r).filter(function(lr) {
584
- return lr !== "key";
585
- }), X = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
586
- if (!_e[T + X]) {
587
- var sr = v.length > 0 ? "{" + v.join(": ..., ") + ": ...}" : "{}";
588
- c(`A props object containing a "key" prop is being spread into JSX:
589
- let props = %s;
590
- <%s {...props} />
591
- React keys must be passed directly to JSX without using spread:
592
- let props = %s;
593
- <%s key={someKey} {...props} />`, X, T, sr, T), _e[T + X] = !0;
594
- }
595
- }
596
- return e === b ? nr(l) : tr(l), l;
597
- }
598
- }
599
- function ar(e, r, t) {
600
- return me(e, r, t, !0);
601
- }
602
- function ir(e, r, t) {
603
- return me(e, r, t, !1);
604
- }
605
- var or = ir, ur = ar;
606
- A.Fragment = b, A.jsx = or, A.jsxs = ur;
607
- })()), A;
608
- }
609
- var Se;
610
- function vr() {
611
- return Se || (Se = 1, process.env.NODE_ENV === "production" ? U.exports = cr() : U.exports = dr()), U.exports;
612
- }
613
- var pr = vr();
614
- const gr = [
615
- "primary",
616
- "secondary",
617
- "danger",
618
- "outline-primary",
619
- "outline-secondary",
620
- "outline-danger"
621
- ], br = ({ label: C, variant: E, ...j }) => {
622
- const b = gr.includes(E ?? "") ? E : "primary";
623
- return /* @__PURE__ */ pr.jsx(fr, { className: "mds-btn", variant: b, ...j, children: C });
624
- };
625
- export {
626
- br as Button
627
- };
628
- //# sourceMappingURL=index.es.js.map