@5ive-souls/controls 0.0.4 → 0.0.6

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