@5ive-souls/controls 0.0.1 → 0.0.2

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 (57) hide show
  1. package/dist/5ive-souls-controls-0.0.2.tgz +0 -0
  2. package/dist/Section-Br38kDAa.js +754 -0
  3. package/dist/components/ClassNames.js +7 -0
  4. package/dist/components/DynamicForm/Builder/DynamicFormBuilder.js +64 -0
  5. package/dist/components/DynamicForm/Builder/Field/FieldBuilder.js +53 -0
  6. package/dist/components/DynamicForm/Builder/Section/SectionBuilder.js +16 -0
  7. package/dist/components/DynamicForm/Builder/index.js +8 -0
  8. package/dist/components/DynamicForm/DynamicForm.js +197 -0
  9. package/dist/components/DynamicForm/Interfaces/IField.js +0 -0
  10. package/dist/components/DynamicForm/Interfaces/IFieldGroup.js +0 -0
  11. package/dist/components/DynamicForm/Interfaces/IFormMetaData.js +0 -0
  12. package/dist/components/DynamicForm/Interfaces/IFormSection.js +0 -0
  13. package/dist/components/DynamicForm/Interfaces/index.js +0 -0
  14. package/dist/components/DynamicForm/index.js +10 -0
  15. package/dist/components/FiveSoulsProvider/FiveSouls.Types.js +4 -0
  16. package/dist/components/FiveSoulsProvider/FiveSoulsProvider.js +20 -0
  17. package/dist/components/FiveSoulsProvider/deviceContext.js +5 -0
  18. package/dist/components/FiveSoulsProvider/index.js +10 -0
  19. package/dist/components/FiveSoulsProvider/useDevice.js +10 -0
  20. package/dist/components/FlexBox/FlexBox.js +75 -0
  21. package/dist/components/FlexBox/FlexBoxItem/FlexBoxItem.js +15 -0
  22. package/dist/components/FlexBox/FlexBoxItem/index.js +4 -0
  23. package/dist/components/FlexBox/FlexBoxItemResizer/FlexBoxItemResizer.js +80 -0
  24. package/dist/components/FlexBox/FlexBoxItemResizer/index.js +4 -0
  25. package/dist/components/FlexBox/FlexBoxUtils.js +13 -0
  26. package/dist/components/FlexBox/ResizeUtils.js +31 -0
  27. package/dist/components/FlexBox/index.js +8 -0
  28. package/dist/components/Grid/Grid.js +97 -0
  29. package/dist/components/Grid/GridCell/GridCell.js +16 -0
  30. package/dist/components/Grid/GridCell/index.js +4 -0
  31. package/dist/components/Grid/GridContext.js +5 -0
  32. package/dist/components/Grid/GridUtils.js +10 -0
  33. package/dist/components/Grid/ResizableGridCell/ResizableGridCell.js +72 -0
  34. package/dist/components/Grid/ResizableGridCell/index.js +4 -0
  35. package/dist/components/Grid/index.js +12 -0
  36. package/dist/components/IComponentProps.js +0 -0
  37. package/dist/components/RichText/RichText.js +32 -0
  38. package/dist/components/RichText/index.js +4 -0
  39. package/dist/components/Section/Section.js +12 -0
  40. package/dist/components/Section/SectionUtils.js +15 -0
  41. package/dist/components/Section/index.js +4 -0
  42. package/dist/components/ThemePicker/ThemePicker.js +92 -0
  43. package/dist/components/ThemePicker/Themes/Cornflower/Cornflower.js +32 -0
  44. package/dist/components/ThemePicker/Themes/Crimson/Crimson.js +32 -0
  45. package/dist/components/ThemePicker/Themes/Forest/Forest.js +32 -0
  46. package/dist/components/ThemePicker/Themes/Royal/Royal.js +32 -0
  47. package/dist/components/ThemePicker/Themes/index.js +18 -0
  48. package/dist/components/ThemePicker/index.js +20 -0
  49. package/dist/components/Wizard/Wizard.js +99 -0
  50. package/dist/components/Wizard/WizardPanel/WizardPanel.js +14 -0
  51. package/dist/components/Wizard/WizardPanel/index.js +4 -0
  52. package/dist/components/Wizard/index.js +6 -0
  53. package/dist/components/index.js +59 -0
  54. package/dist/createFluentIcon-CwLxkjIW.js +503 -0
  55. package/dist/main.d.ts +588 -0
  56. package/dist/main.js +59 -0
  57. package/package.json +75 -64
@@ -0,0 +1,754 @@
1
+ import { jsxs as re, jsx as x } from "react/jsx-runtime";
2
+ import { makeStyles as ge, tokens as D, mergeClasses as X, Button as Te, Divider as be } from "@fluentui/react-components";
3
+ import * as p from "react";
4
+ import Ae from "react";
5
+ import { FlexBox as oe } from "./components/FlexBox/FlexBox.js";
6
+ import { FlexBoxItem as Y } from "./components/FlexBox/FlexBoxItem/FlexBoxItem.js";
7
+ import "./components/FlexBox/FlexBoxItemResizer/FlexBoxItemResizer.js";
8
+ import { ClassNames as Q } from "./components/ClassNames.js";
9
+ import { SectionUtils as xe } from "./components/Section/SectionUtils.js";
10
+ import { c as V } from "./createFluentIcon-CwLxkjIW.js";
11
+ const Et = /* @__PURE__ */ V("Checkmark32Filled", "32", ["M29.9 5.14c.48.5.46 1.3-.04 1.77l-19 18a1.25 1.25 0 0 1-1.77-.06L2.34 17.6a1.25 1.25 0 0 1 1.82-1.7l5.9 6.33L28.14 5.09c.5-.47 1.3-.45 1.77.05Z"]), Pe = /* @__PURE__ */ V("ChevronDoubleDown20Regular", "20", ["M15.85 8.65c.2.2.2.5 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 9.35a.5.5 0 1 1 .7-.7L10 13.8l5.15-5.16c.2-.2.5-.2.7 0Zm0-4c.2.2.2.5 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 5.35a.5.5 0 1 1 .7-.7L10 9.8l5.15-5.16c.2-.2.5-.2.7 0Z"]), we = /* @__PURE__ */ V("ChevronDoubleUp20Regular", "20", ["M4.15 9.65a.5.5 0 0 0 .7.7L10 5.2l5.15 5.16a.5.5 0 1 0 .7-.7L10.4 4.16a.55.55 0 0 0-.78 0L4.15 9.65Zm0 5a.5.5 0 0 0 .7.7L10 10.2l5.15 5.16a.5.5 0 1 0 .7-.7L10.4 9.16a.55.55 0 0 0-.78 0l-5.46 5.49Z"]), ht = /* @__PURE__ */ V("ChevronLeft32Filled", "32", ["M20.88 5.37c.5.48.5 1.28 0 1.76L12.02 16l8.86 8.87a1.25 1.25 0 0 1-1.76 1.76l-9.75-9.75a1.25 1.25 0 0 1 0-1.76l9.75-9.75a1.25 1.25 0 0 1 1.76 0Z"]), Ct = /* @__PURE__ */ V("ChevronRight32Filled", "32", ["M11.12 26.63a1.25 1.25 0 0 1 0-1.76L19.98 16l-8.86-8.87a1.25 1.25 0 0 1 1.76-1.76l9.75 9.75c.5.48.5 1.28 0 1.76l-9.75 9.75c-.48.5-1.28.5-1.76 0Z"]), Ie = {
12
+ durationUltraFast: 50,
13
+ durationFaster: 100,
14
+ durationFast: 150,
15
+ durationNormal: 200,
16
+ durationGentle: 250,
17
+ durationSlow: 300,
18
+ durationSlower: 400,
19
+ durationUltraSlow: 500
20
+ }, _e = {
21
+ curveAccelerateMax: "cubic-bezier(0.9,0.1,1,0.2)",
22
+ curveAccelerateMid: "cubic-bezier(1,0,1,1)",
23
+ curveAccelerateMin: "cubic-bezier(0.8,0,0.78,1)",
24
+ curveDecelerateMax: "cubic-bezier(0.1,0.9,0.2,1)",
25
+ curveDecelerateMid: "cubic-bezier(0,0,0,1)",
26
+ curveDecelerateMin: "cubic-bezier(0.33,0,0.1,1)",
27
+ curveEasyEaseMax: "cubic-bezier(0.8,0,0.2,1)",
28
+ curveEasyEase: "cubic-bezier(0.33,0,0.67,1)",
29
+ curveLinear: "cubic-bezier(0,0,1,1)"
30
+ }, b = {
31
+ ...Ie,
32
+ ..._e
33
+ }, ue = p.createContext(void 0), Ne = {
34
+ // eslint-disable-next-line @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals )
35
+ targetDocument: typeof document == "object" ? document : void 0,
36
+ dir: "ltr"
37
+ };
38
+ ue.Provider;
39
+ function ke() {
40
+ var e;
41
+ return (e = p.useContext(ue)) !== null && e !== void 0 ? e : Ne;
42
+ }
43
+ function Le() {
44
+ return (
45
+ /* eslint-disable @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals )*/
46
+ typeof window < "u" && !!(window.document && // eslint-disable-next-line @typescript-eslint/no-deprecated
47
+ window.document.createElement)
48
+ );
49
+ }
50
+ const G = Le() ? p.useLayoutEffect : p.useEffect, J = (e) => {
51
+ const r = p.useRef(() => {
52
+ throw new Error("Cannot call an event handler while rendering");
53
+ });
54
+ return G(() => {
55
+ r.current = e;
56
+ }, [
57
+ e
58
+ ]), p.useCallback((...n) => {
59
+ const o = r.current;
60
+ return o(...n);
61
+ }, [
62
+ r
63
+ ]);
64
+ };
65
+ function Oe() {
66
+ const e = p.useRef(!0);
67
+ return e.current ? (e.current = !1, !0) : e.current;
68
+ }
69
+ function De() {
70
+ return p.useReducer((e) => e + 1, 0)[1];
71
+ }
72
+ function ze(...e) {
73
+ "use no memo";
74
+ const r = p.useCallback(
75
+ (n) => {
76
+ r.current = n;
77
+ for (const o of e)
78
+ typeof o == "function" ? o(n) : o && (o.current = n);
79
+ },
80
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive
81
+ [
82
+ ...e
83
+ ]
84
+ );
85
+ return r;
86
+ }
87
+ function $e(e) {
88
+ if (e.playState === "running") {
89
+ var r;
90
+ if (e.overallProgress !== void 0) {
91
+ var n;
92
+ const l = (n = e.overallProgress) !== null && n !== void 0 ? n : 0;
93
+ return l > 0 && l < 1;
94
+ }
95
+ var o;
96
+ const u = Number((o = e.currentTime) !== null && o !== void 0 ? o : 0);
97
+ var a;
98
+ const d = Number((a = (r = e.effect) === null || r === void 0 ? void 0 : r.getTiming().duration) !== null && a !== void 0 ? a : 0);
99
+ return u > 0 && u < d;
100
+ }
101
+ return !1;
102
+ }
103
+ const Fe = {
104
+ fill: "forwards"
105
+ }, Be = {
106
+ duration: 1
107
+ };
108
+ function le() {
109
+ var e;
110
+ const r = typeof window < "u" && typeof ((e = window.Animation) === null || e === void 0 ? void 0 : e.prototype.persist) == "function";
111
+ return p.useCallback((n, o, a) => {
112
+ const u = Array.isArray(o) ? o : [
113
+ o
114
+ ], { isReducedMotion: d } = a, l = u.map((c) => {
115
+ const { keyframes: f, reducedMotion: m = Be, ...v } = c, { keyframes: C = f, ...y } = m, g = d ? C : f, T = {
116
+ ...Fe,
117
+ ...v,
118
+ // Use reduced motion overrides (e.g. duration, easing) when reduced motion is enabled
119
+ ...d && y
120
+ };
121
+ try {
122
+ const s = n.animate(g, T);
123
+ if (r)
124
+ s == null || s.persist();
125
+ else {
126
+ const R = g[g.length - 1];
127
+ var A;
128
+ Object.assign((A = n.style) !== null && A !== void 0 ? A : {}, R);
129
+ }
130
+ return s;
131
+ } catch {
132
+ return null;
133
+ }
134
+ }).filter((c) => !!c);
135
+ return {
136
+ set playbackRate(c) {
137
+ l.forEach((f) => {
138
+ f.playbackRate = c;
139
+ });
140
+ },
141
+ setMotionEndCallbacks(c, f) {
142
+ const m = l.map((v) => new Promise((C, y) => {
143
+ v.onfinish = () => C(), v.oncancel = () => y();
144
+ }));
145
+ Promise.all(m).then(() => {
146
+ c();
147
+ }).catch(() => {
148
+ f();
149
+ });
150
+ },
151
+ isRunning() {
152
+ return l.some((c) => $e(c));
153
+ },
154
+ cancel: () => {
155
+ l.forEach((c) => {
156
+ c.cancel();
157
+ });
158
+ },
159
+ pause: () => {
160
+ l.forEach((c) => {
161
+ c.pause();
162
+ });
163
+ },
164
+ play: () => {
165
+ l.forEach((c) => {
166
+ c.play();
167
+ });
168
+ },
169
+ finish: () => {
170
+ l.forEach((c) => {
171
+ c.finish();
172
+ });
173
+ },
174
+ reverse: () => {
175
+ l.forEach((c) => {
176
+ c.reverse();
177
+ });
178
+ }
179
+ };
180
+ }, [
181
+ r
182
+ ]);
183
+ }
184
+ function Ue() {
185
+ const [e, r] = p.useState(0), n = p.useRef(), o = le();
186
+ return p.useEffect(() => {
187
+ if (e > 0) {
188
+ var a;
189
+ (a = n.current) === null || a === void 0 || a.call(n);
190
+ }
191
+ }, [
192
+ e
193
+ ]), p.useCallback((a, u, d) => typeof a.animate == "function" ? o(a, u, d) : {
194
+ setMotionEndCallbacks(c) {
195
+ n.current = c, r((f) => f + 1);
196
+ },
197
+ set playbackRate(c) {
198
+ },
199
+ isRunning() {
200
+ return !1;
201
+ },
202
+ cancel() {
203
+ },
204
+ pause() {
205
+ },
206
+ play() {
207
+ },
208
+ finish() {
209
+ },
210
+ reverse() {
211
+ }
212
+ }, [
213
+ o
214
+ ]);
215
+ }
216
+ function Ye() {
217
+ "use no memo";
218
+ return process.env.NODE_ENV === "test" ? Ue() : le();
219
+ }
220
+ function Ve(e) {
221
+ const r = p.useRef();
222
+ return p.useImperativeHandle(e, () => ({
223
+ setPlayState: (n) => {
224
+ if (n === "running") {
225
+ var o;
226
+ (o = r.current) === null || o === void 0 || o.play();
227
+ }
228
+ if (n === "paused") {
229
+ var a;
230
+ (a = r.current) === null || a === void 0 || a.pause();
231
+ }
232
+ },
233
+ setPlaybackRate: (n) => {
234
+ r.current && (r.current.playbackRate = n);
235
+ }
236
+ })), r;
237
+ }
238
+ const je = "screen and (prefers-reduced-motion: reduce)";
239
+ function qe() {
240
+ const { targetDocument: e } = ke();
241
+ var r;
242
+ const n = (r = e == null ? void 0 : e.defaultView) !== null && r !== void 0 ? r : null, o = p.useRef(!1), a = p.useCallback(() => o.current, []);
243
+ return G(() => {
244
+ if (n === null || typeof n.matchMedia != "function")
245
+ return;
246
+ const u = n.matchMedia(je);
247
+ u.matches && (o.current = !0);
248
+ const d = (l) => {
249
+ o.current = l.matches;
250
+ };
251
+ return u.addEventListener("change", d), () => {
252
+ u.removeEventListener("change", d);
253
+ };
254
+ }, [
255
+ n
256
+ ]), a;
257
+ }
258
+ var ee = { exports: {} }, E = {};
259
+ /** @license React v17.0.2
260
+ * react-is.production.min.js
261
+ *
262
+ * Copyright (c) Facebook, Inc. and its affiliates.
263
+ *
264
+ * This source code is licensed under the MIT license found in the
265
+ * LICENSE file in the root directory of this source tree.
266
+ */
267
+ var ae;
268
+ function Ge() {
269
+ if (ae) return E;
270
+ ae = 1;
271
+ var e = 60103, r = 60106, n = 60107, o = 60108, a = 60114, u = 60109, d = 60110, l = 60112, c = 60113, f = 60120, m = 60115, v = 60116, C = 60121, y = 60122, g = 60117, T = 60129, A = 60131;
272
+ if (typeof Symbol == "function" && Symbol.for) {
273
+ var s = Symbol.for;
274
+ e = s("react.element"), r = s("react.portal"), n = s("react.fragment"), o = s("react.strict_mode"), a = s("react.profiler"), u = s("react.provider"), d = s("react.context"), l = s("react.forward_ref"), c = s("react.suspense"), f = s("react.suspense_list"), m = s("react.memo"), v = s("react.lazy"), C = s("react.block"), y = s("react.server.block"), g = s("react.fundamental"), T = s("react.debug_trace_mode"), A = s("react.legacy_hidden");
275
+ }
276
+ function R(t) {
277
+ if (typeof t == "object" && t !== null) {
278
+ var M = t.$$typeof;
279
+ switch (M) {
280
+ case e:
281
+ switch (t = t.type, t) {
282
+ case n:
283
+ case a:
284
+ case o:
285
+ case c:
286
+ case f:
287
+ return t;
288
+ default:
289
+ switch (t = t && t.$$typeof, t) {
290
+ case d:
291
+ case l:
292
+ case v:
293
+ case m:
294
+ case u:
295
+ return t;
296
+ default:
297
+ return M;
298
+ }
299
+ }
300
+ case r:
301
+ return M;
302
+ }
303
+ }
304
+ }
305
+ var P = u, S = e, z = l, w = n, I = v, $ = m, _ = r, N = a, k = o, L = c;
306
+ return E.ContextConsumer = d, E.ContextProvider = P, E.Element = S, E.ForwardRef = z, E.Fragment = w, E.Lazy = I, E.Memo = $, E.Portal = _, E.Profiler = N, E.StrictMode = k, E.Suspense = L, E.isAsyncMode = function() {
307
+ return !1;
308
+ }, E.isConcurrentMode = function() {
309
+ return !1;
310
+ }, E.isContextConsumer = function(t) {
311
+ return R(t) === d;
312
+ }, E.isContextProvider = function(t) {
313
+ return R(t) === u;
314
+ }, E.isElement = function(t) {
315
+ return typeof t == "object" && t !== null && t.$$typeof === e;
316
+ }, E.isForwardRef = function(t) {
317
+ return R(t) === l;
318
+ }, E.isFragment = function(t) {
319
+ return R(t) === n;
320
+ }, E.isLazy = function(t) {
321
+ return R(t) === v;
322
+ }, E.isMemo = function(t) {
323
+ return R(t) === m;
324
+ }, E.isPortal = function(t) {
325
+ return R(t) === r;
326
+ }, E.isProfiler = function(t) {
327
+ return R(t) === a;
328
+ }, E.isStrictMode = function(t) {
329
+ return R(t) === o;
330
+ }, E.isSuspense = function(t) {
331
+ return R(t) === c;
332
+ }, E.isValidElementType = function(t) {
333
+ return typeof t == "string" || typeof t == "function" || t === n || t === a || t === T || t === o || t === c || t === f || t === A || typeof t == "object" && t !== null && (t.$$typeof === v || t.$$typeof === m || t.$$typeof === u || t.$$typeof === d || t.$$typeof === l || t.$$typeof === g || t.$$typeof === C || t[0] === y);
334
+ }, E.typeOf = R, E;
335
+ }
336
+ var h = {};
337
+ /** @license React v17.0.2
338
+ * react-is.development.js
339
+ *
340
+ * Copyright (c) Facebook, Inc. and its affiliates.
341
+ *
342
+ * This source code is licensed under the MIT license found in the
343
+ * LICENSE file in the root directory of this source tree.
344
+ */
345
+ var ie;
346
+ function We() {
347
+ return ie || (ie = 1, process.env.NODE_ENV !== "production" && function() {
348
+ var e = 60103, r = 60106, n = 60107, o = 60108, a = 60114, u = 60109, d = 60110, l = 60112, c = 60113, f = 60120, m = 60115, v = 60116, C = 60121, y = 60122, g = 60117, T = 60129, A = 60131;
349
+ if (typeof Symbol == "function" && Symbol.for) {
350
+ var s = Symbol.for;
351
+ e = s("react.element"), r = s("react.portal"), n = s("react.fragment"), o = s("react.strict_mode"), a = s("react.profiler"), u = s("react.provider"), d = s("react.context"), l = s("react.forward_ref"), c = s("react.suspense"), f = s("react.suspense_list"), m = s("react.memo"), v = s("react.lazy"), C = s("react.block"), y = s("react.server.block"), g = s("react.fundamental"), s("react.scope"), s("react.opaque.id"), T = s("react.debug_trace_mode"), s("react.offscreen"), A = s("react.legacy_hidden");
352
+ }
353
+ var R = !1;
354
+ function P(i) {
355
+ return !!(typeof i == "string" || typeof i == "function" || i === n || i === a || i === T || i === o || i === c || i === f || i === A || R || typeof i == "object" && i !== null && (i.$$typeof === v || i.$$typeof === m || i.$$typeof === u || i.$$typeof === d || i.$$typeof === l || i.$$typeof === g || i.$$typeof === C || i[0] === y));
356
+ }
357
+ function S(i) {
358
+ if (typeof i == "object" && i !== null) {
359
+ var K = i.$$typeof;
360
+ switch (K) {
361
+ case e:
362
+ var q = i.type;
363
+ switch (q) {
364
+ case n:
365
+ case a:
366
+ case o:
367
+ case c:
368
+ case f:
369
+ return q;
370
+ default:
371
+ var ne = q && q.$$typeof;
372
+ switch (ne) {
373
+ case d:
374
+ case l:
375
+ case v:
376
+ case m:
377
+ case u:
378
+ return ne;
379
+ default:
380
+ return K;
381
+ }
382
+ }
383
+ case r:
384
+ return K;
385
+ }
386
+ }
387
+ }
388
+ var z = d, w = u, I = e, $ = l, _ = n, N = v, k = m, L = r, t = a, M = o, F = c, O = !1, B = !1;
389
+ function Z(i) {
390
+ return O || (O = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
391
+ }
392
+ function U(i) {
393
+ return B || (B = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
394
+ }
395
+ function j(i) {
396
+ return S(i) === d;
397
+ }
398
+ function H(i) {
399
+ return S(i) === u;
400
+ }
401
+ function pe(i) {
402
+ return typeof i == "object" && i !== null && i.$$typeof === e;
403
+ }
404
+ function ve(i) {
405
+ return S(i) === l;
406
+ }
407
+ function Ee(i) {
408
+ return S(i) === n;
409
+ }
410
+ function he(i) {
411
+ return S(i) === v;
412
+ }
413
+ function Ce(i) {
414
+ return S(i) === m;
415
+ }
416
+ function Re(i) {
417
+ return S(i) === r;
418
+ }
419
+ function Me(i) {
420
+ return S(i) === a;
421
+ }
422
+ function Se(i) {
423
+ return S(i) === o;
424
+ }
425
+ function ye(i) {
426
+ return S(i) === c;
427
+ }
428
+ h.ContextConsumer = z, h.ContextProvider = w, h.Element = I, h.ForwardRef = $, h.Fragment = _, h.Lazy = N, h.Memo = k, h.Portal = L, h.Profiler = t, h.StrictMode = M, h.Suspense = F, h.isAsyncMode = Z, h.isConcurrentMode = U, h.isContextConsumer = j, h.isContextProvider = H, h.isElement = pe, h.isForwardRef = ve, h.isFragment = Ee, h.isLazy = he, h.isMemo = Ce, h.isPortal = Re, h.isProfiler = Me, h.isStrictMode = Se, h.isSuspense = ye, h.isValidElementType = P, h.typeOf = S;
429
+ }()), h;
430
+ }
431
+ process.env.NODE_ENV === "production" ? ee.exports = Ge() : ee.exports = We();
432
+ var Ze = ee.exports;
433
+ function He(e) {
434
+ try {
435
+ const r = p.Children.only(e);
436
+ if (typeof r.type == "string" || Ze.isForwardRef(r))
437
+ return r;
438
+ } catch {
439
+ }
440
+ throw new Error([
441
+ "@fluentui/react-motion: Invalid child element.",
442
+ `
443
+ `,
444
+ "Motion factories require a single child element to be passed. ",
445
+ "That element element should support ref forwarding i.e. it should be either an intrinsic element (e.g. div) or a component that uses React.forwardRef()."
446
+ ].join(""));
447
+ }
448
+ const de = p.createContext(void 0);
449
+ de.Provider;
450
+ const Ke = () => {
451
+ var e;
452
+ return (e = p.useContext(de)) !== null && e !== void 0 ? e : "default";
453
+ }, Xe = p.createContext(void 0);
454
+ function Qe(e = !1, r = !1) {
455
+ const n = p.useRef(r ? e : !0), o = De(), a = p.useCallback((u) => {
456
+ n.current !== u && (n.current = u, o());
457
+ }, [
458
+ o
459
+ ]);
460
+ return p.useEffect(() => {
461
+ e && (n.current = e);
462
+ }), [
463
+ e || n.current,
464
+ a
465
+ ];
466
+ }
467
+ const Je = Symbol("MOTION_DEFINITION"), et = Symbol.for("interruptablePresence");
468
+ function W(e) {
469
+ return Object.assign((r) => {
470
+ "use no memo";
471
+ const o = {
472
+ ...p.useContext(Xe),
473
+ ...r
474
+ }, a = Ke() === "skip", { appear: u, children: d, imperativeRef: l, onExit: c, onMotionFinish: f, onMotionStart: m, onMotionCancel: v, visible: C, unmountOnExit: y, ...g } = o, T = g, [A, s] = Qe(C, y), R = He(d), P = Ve(l), S = p.useRef(), z = ze(S, R.ref), w = p.useRef({
475
+ appear: u,
476
+ params: T,
477
+ skipMotions: a
478
+ }), I = Ye(), $ = Oe(), _ = qe(), N = J((t) => {
479
+ m == null || m(null, {
480
+ direction: t
481
+ });
482
+ }), k = J((t) => {
483
+ f == null || f(null, {
484
+ direction: t
485
+ }), t === "exit" && y && (s(!1), c == null || c());
486
+ }), L = J((t) => {
487
+ v == null || v(null, {
488
+ direction: t
489
+ });
490
+ });
491
+ return G(() => {
492
+ w.current = {
493
+ appear: u,
494
+ params: T,
495
+ skipMotions: a
496
+ };
497
+ }), G(
498
+ () => {
499
+ const t = S.current;
500
+ if (!t)
501
+ return;
502
+ let M;
503
+ function F() {
504
+ M && (B && M.isRunning() || (M.cancel(), P.current = void 0));
505
+ }
506
+ const O = typeof e == "function" ? e({
507
+ element: t,
508
+ ...w.current.params
509
+ }) : e, B = O[et];
510
+ if (B && (M = P.current, M && M.isRunning()))
511
+ return M.reverse(), F;
512
+ const Z = C ? O.enter : O.exit, U = C ? "enter" : "exit", j = !w.current.appear && $, H = w.current.skipMotions;
513
+ return j || N(U), M = I(t, Z, {
514
+ isReducedMotion: _()
515
+ }), j ? (M.finish(), F) : (P.current = M, M.setMotionEndCallbacks(() => k(U), () => L(U)), H && M.finish(), F);
516
+ },
517
+ // Excluding `isFirstMount` from deps to prevent re-triggering the animation on subsequent renders
518
+ // eslint-disable-next-line react-hooks/exhaustive-deps
519
+ [
520
+ I,
521
+ P,
522
+ _,
523
+ k,
524
+ N,
525
+ L,
526
+ C
527
+ ]
528
+ ), A ? p.cloneElement(R, {
529
+ ref: z
530
+ }) : null;
531
+ }, {
532
+ // Heads up!
533
+ // Always normalize it to a function to simplify types
534
+ [Je]: typeof e == "function" ? e : () => e
535
+ });
536
+ }
537
+ const fe = (e, r) => {
538
+ const n = e === "horizontal" ? "maxWidth" : "maxHeight", o = e === "horizontal" ? "overflowX" : "overflowY", u = `${e === "horizontal" ? r.scrollWidth : r.scrollHeight}px`;
539
+ return {
540
+ sizeName: n,
541
+ overflowName: o,
542
+ toSize: u
543
+ };
544
+ }, tt = ({ orientation: e, duration: r, easing: n, element: o, fromSize: a = "0" }) => {
545
+ const { sizeName: u, overflowName: d, toSize: l } = fe(e, o);
546
+ return {
547
+ keyframes: [
548
+ {
549
+ [u]: a,
550
+ [d]: "hidden"
551
+ },
552
+ {
553
+ [u]: l,
554
+ offset: 0.9999,
555
+ [d]: "hidden"
556
+ },
557
+ {
558
+ [u]: "unset",
559
+ [d]: "unset"
560
+ }
561
+ ],
562
+ duration: r,
563
+ easing: n
564
+ };
565
+ }, nt = ({ orientation: e, duration: r, easing: n, element: o, delay: a = 0, fromSize: u = "0" }) => {
566
+ const { sizeName: d, overflowName: l, toSize: c } = fe(e, o);
567
+ return {
568
+ keyframes: [
569
+ {
570
+ [d]: c,
571
+ [l]: "hidden"
572
+ },
573
+ {
574
+ [d]: u,
575
+ [l]: "hidden"
576
+ }
577
+ ],
578
+ duration: r,
579
+ easing: n,
580
+ fill: "both",
581
+ delay: a
582
+ };
583
+ }, rt = (e) => e === "horizontal" ? {
584
+ paddingStart: "paddingInlineStart",
585
+ paddingEnd: "paddingInlineEnd",
586
+ marginStart: "marginInlineStart",
587
+ marginEnd: "marginInlineEnd"
588
+ } : {
589
+ paddingStart: "paddingBlockStart",
590
+ paddingEnd: "paddingBlockEnd",
591
+ marginStart: "marginBlockStart",
592
+ marginEnd: "marginBlockEnd"
593
+ }, ce = ({ direction: e, orientation: r, duration: n, easing: o, delay: a = 0 }) => {
594
+ const { paddingStart: u, paddingEnd: d, marginStart: l, marginEnd: c } = rt(r), f = e === "enter" ? 0 : 1, v = {
595
+ keyframes: [
596
+ {
597
+ [u]: "0",
598
+ [d]: "0",
599
+ [l]: "0",
600
+ [c]: "0",
601
+ offset: f
602
+ }
603
+ ],
604
+ duration: n,
605
+ easing: o,
606
+ delay: a
607
+ };
608
+ return e === "exit" && (v.fill = "forwards"), v;
609
+ }, se = ({ direction: e, duration: r, easing: n = b.curveLinear, fromValue: o = 0 }) => {
610
+ const a = [
611
+ {
612
+ opacity: o
613
+ },
614
+ {
615
+ opacity: 1
616
+ }
617
+ ];
618
+ return e === "exit" && a.reverse(), {
619
+ keyframes: a,
620
+ duration: r,
621
+ easing: n
622
+ };
623
+ }, me = ({
624
+ // enter
625
+ enterSizeDuration: e = b.durationNormal,
626
+ enterOpacityDuration: r = e,
627
+ enterEasing: n = b.curveEasyEaseMax,
628
+ enterDelay: o = 0,
629
+ // exit: durations and easing default to enter values for symmetry
630
+ exitSizeDuration: a = e,
631
+ exitOpacityDuration: u = r,
632
+ exitEasing: d = n,
633
+ exitDelay: l = 0
634
+ } = {}) => ({ element: c, animateOpacity: f = !0, orientation: m = "vertical" }) => {
635
+ const v = [
636
+ tt({
637
+ orientation: m,
638
+ duration: e,
639
+ easing: n,
640
+ element: c
641
+ }),
642
+ ce({
643
+ direction: "enter",
644
+ orientation: m,
645
+ duration: e,
646
+ easing: n
647
+ })
648
+ ];
649
+ f && v.push({
650
+ ...se({
651
+ direction: "enter",
652
+ duration: r,
653
+ easing: n
654
+ }),
655
+ delay: o,
656
+ fill: "both"
657
+ });
658
+ const C = [];
659
+ return f && C.push(se({
660
+ direction: "exit",
661
+ duration: u,
662
+ easing: d
663
+ })), C.push(nt({
664
+ orientation: m,
665
+ duration: a,
666
+ easing: d,
667
+ element: c,
668
+ delay: l
669
+ }), ce({
670
+ direction: "exit",
671
+ orientation: m,
672
+ duration: a,
673
+ easing: d,
674
+ delay: l
675
+ })), {
676
+ enter: v,
677
+ exit: C
678
+ };
679
+ }, te = ({ enterDuration: e = b.durationNormal, enterEasing: r = b.curveEasyEaseMax, exitDuration: n = e, exitEasing: o = r } = {}) => (
680
+ // Implement a regular collapse as a special case of the delayed collapse,
681
+ // where the delays are zero, and the size and opacity durations are equal.
682
+ me({
683
+ enterSizeDuration: e,
684
+ enterEasing: r,
685
+ exitSizeDuration: n,
686
+ exitEasing: o
687
+ })
688
+ ), ot = W(te());
689
+ W(te({
690
+ enterDuration: b.durationFast
691
+ }));
692
+ W(te({
693
+ enterDuration: b.durationSlower
694
+ }));
695
+ W(me({
696
+ enterSizeDuration: b.durationNormal,
697
+ enterOpacityDuration: b.durationSlower,
698
+ enterDelay: b.durationNormal,
699
+ exitDelay: b.durationSlower,
700
+ enterEasing: b.curveEasyEase
701
+ }));
702
+ const at = ge({
703
+ root: {
704
+ backgroundColor: D.colorNeutralBackground1,
705
+ boxSizing: "border-box"
706
+ },
707
+ default: {
708
+ border: "1px solid " + D.colorPaletteAnchorBorderActive,
709
+ borderRadius: D.borderRadiusMedium,
710
+ boxShadow: D.shadow16Brand,
711
+ transitionDuration: D.durationNormal,
712
+ transitionTimingFunction: "ease",
713
+ transitionProperty: "box-shadow",
714
+ ":hover": {
715
+ boxShadow: D.shadow28Brand
716
+ }
717
+ },
718
+ divider: {
719
+ flexGrow: 0
720
+ },
721
+ fill: {
722
+ height: "100%",
723
+ width: "100%"
724
+ },
725
+ content: {
726
+ boxSizing: "border-box"
727
+ }
728
+ }), it = (e) => {
729
+ var T;
730
+ const { children: r, icon: n, header: o, collapsible: a, className: u, fill: d, ref: l, id: c } = e, f = at(), [m, v] = Ae.useState(!0);
731
+ let C = X(Q.Section, f.root, f.default, u);
732
+ (d || (T = e.cellProps) != null && T.resizable) && (C = X(C, f.fill));
733
+ const y = xe.buildSectionStyles(e);
734
+ m || (y.height = "fit-content");
735
+ const g = m ? /* @__PURE__ */ x(we, {}) : /* @__PURE__ */ x(Pe, {});
736
+ return /* @__PURE__ */ re(oe, { id: c, className: C, style: y, ref: l, children: [
737
+ /* @__PURE__ */ x(Y, { className: Q.SectionHeader, children: /* @__PURE__ */ re(oe, { fill: !0, horizontal: !0, alignItems: "center", children: [
738
+ n && /* @__PURE__ */ x(Y, { padding: 8, children: n }),
739
+ /* @__PURE__ */ x(Y, { grow: 1, children: o && o }),
740
+ a && /* @__PURE__ */ x(Y, { children: /* @__PURE__ */ x(Te, { appearance: "transparent", icon: g, onClick: () => {
741
+ v(!m);
742
+ } }) })
743
+ ] }) }),
744
+ (n || o || a) && /* @__PURE__ */ x(be, { className: f.divider }),
745
+ /* @__PURE__ */ x(Y, { className: Q.SectionContent, grow: 1, children: /* @__PURE__ */ x(ot, { visible: m, children: /* @__PURE__ */ x("div", { className: X(f.fill, f.content), children: r }) }) })
746
+ ] });
747
+ };
748
+ it.displayName = "Section";
749
+ export {
750
+ ht as C,
751
+ it as S,
752
+ Ct as a,
753
+ Et as b
754
+ };