@a4banana/react-layout-primitives 1.1.0 → 1.3.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.js CHANGED
@@ -1,528 +1,9 @@
1
- import Re, { forwardRef as Ae, useMemo as he } from "react";
2
- const je = {
3
- Start: "start",
4
- End: "end",
5
- Center: "center",
6
- SpaceBetween: "space-between",
7
- SpaceAround: "space-around",
8
- SpaceEvenly: "space-evenly"
9
- }, ke = {
10
- Top: "top",
11
- Bottom: "bottom",
12
- Center: "center",
13
- SpaceBetween: "space-between",
14
- SpaceAround: "space-around",
15
- SpaceEvenly: "space-evenly"
16
- }, Oe = {
17
- Start: "start",
18
- Center: "center",
19
- End: "end",
20
- Stretch: "stretch"
21
- }, Ne = {
22
- Top: "top",
23
- Center: "center",
24
- Bottom: "bottom",
25
- Stretch: "stretch"
26
- }, me = {
27
- start: "flex-start",
28
- end: "flex-end",
29
- top: "flex-start",
30
- bottom: "flex-end",
31
- center: "center",
32
- stretch: "stretch",
33
- "space-between": "space-between",
34
- "space-around": "space-around",
35
- "space-evenly": "space-evenly"
36
- };
37
- var N = { exports: {} }, A = {};
38
- /**
39
- * @license React
40
- * react-jsx-runtime.production.js
41
- *
42
- * Copyright (c) Meta Platforms, Inc. and affiliates.
43
- *
44
- * This source code is licensed under the MIT license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */
47
- var ve;
48
- function Pe() {
49
- if (ve) return A;
50
- ve = 1;
51
- var s = Symbol.for("react.transitional.element"), x = Symbol.for("react.fragment");
52
- function b(w, c, i) {
53
- var f = null;
54
- if (i !== void 0 && (f = "" + i), c.key !== void 0 && (f = "" + c.key), "key" in c) {
55
- i = {};
56
- for (var d in c)
57
- d !== "key" && (i[d] = c[d]);
58
- } else i = c;
59
- return c = i.ref, {
60
- $$typeof: s,
61
- type: w,
62
- key: f,
63
- ref: c !== void 0 ? c : null,
64
- props: i
65
- };
66
- }
67
- return A.Fragment = x, A.jsx = b, A.jsxs = b, A;
68
- }
69
- var h = {};
70
- /**
71
- * @license React
72
- * react-jsx-runtime.development.js
73
- *
74
- * Copyright (c) Meta Platforms, Inc. and affiliates.
75
- *
76
- * This source code is licensed under the MIT license found in the
77
- * LICENSE file in the root directory of this source tree.
78
- */
79
- var be;
80
- function Ye() {
81
- return be || (be = 1, process.env.NODE_ENV !== "production" && function() {
82
- function s(e) {
83
- if (e == null) return null;
84
- if (typeof e == "function")
85
- return e.$$typeof === _e ? null : e.displayName || e.name || null;
86
- if (typeof e == "string") return e;
87
- switch (e) {
88
- case U:
89
- return "Fragment";
90
- case we:
91
- return "Portal";
92
- case Q:
93
- return "Profiler";
94
- case Z:
95
- return "StrictMode";
96
- case z:
97
- return "Suspense";
98
- case q:
99
- return "SuspenseList";
100
- }
101
- if (typeof e == "object")
102
- switch (typeof e.tag == "number" && console.error(
103
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
104
- ), e.$$typeof) {
105
- case D:
106
- return (e.displayName || "Context") + ".Provider";
107
- case K:
108
- return (e._context.displayName || "Context") + ".Consumer";
109
- case V:
110
- var r = e.render;
111
- return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
112
- case B:
113
- return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
114
- case J:
115
- r = e._payload, e = e._init;
116
- try {
117
- return s(e(r));
118
- } catch {
119
- }
120
- }
121
- return null;
122
- }
123
- function x(e) {
124
- return "" + e;
125
- }
126
- function b(e) {
127
- try {
128
- x(e);
129
- var r = !1;
130
- } catch {
131
- r = !0;
132
- }
133
- if (r) {
134
- r = console;
135
- var t = r.error, o = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
136
- return t.call(
137
- r,
138
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
139
- o
140
- ), x(e);
141
- }
142
- }
143
- function w() {
144
- }
145
- function c() {
146
- if (C === 0) {
147
- te = console.log, ne = console.info, oe = console.warn, ae = console.error, ue = console.group, le = console.groupCollapsed, se = console.groupEnd;
148
- var e = {
149
- configurable: !0,
150
- enumerable: !0,
151
- value: w,
152
- writable: !0
153
- };
154
- Object.defineProperties(console, {
155
- info: e,
156
- log: e,
157
- warn: e,
158
- error: e,
159
- group: e,
160
- groupCollapsed: e,
161
- groupEnd: e
162
- });
163
- }
164
- C++;
165
- }
166
- function i() {
167
- if (C--, C === 0) {
168
- var e = { configurable: !0, enumerable: !0, writable: !0 };
169
- Object.defineProperties(console, {
170
- log: p({}, e, { value: te }),
171
- info: p({}, e, { value: ne }),
172
- warn: p({}, e, { value: oe }),
173
- error: p({}, e, { value: ae }),
174
- group: p({}, e, { value: ue }),
175
- groupCollapsed: p({}, e, { value: le }),
176
- groupEnd: p({}, e, { value: se })
177
- });
178
- }
179
- 0 > C && console.error(
180
- "disabledDepth fell below zero. This is a bug in React. Please file an issue."
181
- );
182
- }
183
- function f(e) {
184
- if (G === void 0)
185
- try {
186
- throw Error();
187
- } catch (t) {
188
- var r = t.stack.trim().match(/\n( *(at )?)/);
189
- G = r && r[1] || "", ce = -1 < t.stack.indexOf(`
190
- at`) ? " (<anonymous>)" : -1 < t.stack.indexOf("@") ? "@unknown:0:0" : "";
191
- }
192
- return `
193
- ` + G + e + ce;
194
- }
195
- function d(e, r) {
196
- if (!e || X) return "";
197
- var t = L.get(e);
198
- if (t !== void 0) return t;
199
- X = !0, t = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
200
- var o = null;
201
- o = g.H, g.H = null, c();
202
- try {
203
- var u = {
204
- DetermineComponentFrameRoot: function() {
205
- try {
206
- if (r) {
207
- var v = function() {
208
- throw Error();
209
- };
210
- if (Object.defineProperty(v.prototype, "props", {
211
- set: function() {
212
- throw Error();
213
- }
214
- }), typeof Reflect == "object" && Reflect.construct) {
215
- try {
216
- Reflect.construct(v, []);
217
- } catch (m) {
218
- var O = m;
219
- }
220
- Reflect.construct(e, [], v);
221
- } else {
222
- try {
223
- v.call();
224
- } catch (m) {
225
- O = m;
226
- }
227
- e.call(v.prototype);
228
- }
229
- } else {
230
- try {
231
- throw Error();
232
- } catch (m) {
233
- O = m;
234
- }
235
- (v = e()) && typeof v.catch == "function" && v.catch(function() {
236
- });
237
- }
238
- } catch (m) {
239
- if (m && O && typeof m.stack == "string")
240
- return [m.stack, O.stack];
241
- }
242
- return [null, null];
243
- }
244
- };
245
- u.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
246
- var a = Object.getOwnPropertyDescriptor(
247
- u.DetermineComponentFrameRoot,
248
- "name"
249
- );
250
- a && a.configurable && Object.defineProperty(
251
- u.DetermineComponentFrameRoot,
252
- "name",
253
- { value: "DetermineComponentFrameRoot" }
254
- );
255
- var n = u.DetermineComponentFrameRoot(), E = n[0], T = n[1];
256
- if (E && T) {
257
- var l = E.split(`
258
- `), y = T.split(`
259
- `);
260
- for (n = a = 0; a < l.length && !l[a].includes(
261
- "DetermineComponentFrameRoot"
262
- ); )
263
- a++;
264
- for (; n < y.length && !y[n].includes(
265
- "DetermineComponentFrameRoot"
266
- ); )
267
- n++;
268
- if (a === l.length || n === y.length)
269
- for (a = l.length - 1, n = y.length - 1; 1 <= a && 0 <= n && l[a] !== y[n]; )
270
- n--;
271
- for (; 1 <= a && 0 <= n; a--, n--)
272
- if (l[a] !== y[n]) {
273
- if (a !== 1 || n !== 1)
274
- do
275
- if (a--, n--, 0 > n || l[a] !== y[n]) {
276
- var R = `
277
- ` + l[a].replace(
278
- " at new ",
279
- " at "
280
- );
281
- return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, R), R;
282
- }
283
- while (1 <= a && 0 <= n);
284
- break;
285
- }
286
- }
287
- } finally {
288
- X = !1, g.H = o, i(), Error.prepareStackTrace = t;
289
- }
290
- return l = (l = e ? e.displayName || e.name : "") ? f(l) : "", typeof e == "function" && L.set(e, l), l;
291
- }
292
- function _(e) {
293
- if (e == null) return "";
294
- if (typeof e == "function") {
295
- var r = e.prototype;
296
- return d(
297
- e,
298
- !(!r || !r.isReactComponent)
299
- );
300
- }
301
- if (typeof e == "string") return f(e);
302
- switch (e) {
303
- case z:
304
- return f("Suspense");
305
- case q:
306
- return f("SuspenseList");
307
- }
308
- if (typeof e == "object")
309
- switch (e.$$typeof) {
310
- case V:
311
- return e = d(e.render, !1), e;
312
- case B:
313
- return _(e.type);
314
- case J:
315
- r = e._payload, e = e._init;
316
- try {
317
- return _(e(r));
318
- } catch {
319
- }
320
- }
321
- return "";
322
- }
323
- function S() {
324
- var e = g.A;
325
- return e === null ? null : e.getOwner();
326
- }
327
- function j(e) {
328
- if (re.call(e, "key")) {
329
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
330
- if (r && r.isReactWarning) return !1;
331
- }
332
- return e.key !== void 0;
333
- }
334
- function P(e, r) {
335
- function t() {
336
- fe || (fe = !0, console.error(
337
- "%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://react.dev/link/special-props)",
338
- r
339
- ));
340
- }
341
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
342
- get: t,
343
- configurable: !0
344
- });
345
- }
346
- function Y() {
347
- var e = s(this.type);
348
- return ie[e] || (ie[e] = !0, console.error(
349
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
350
- )), e = this.props.ref, e !== void 0 ? e : null;
351
- }
352
- function M(e, r, t, o, u, a) {
353
- return t = a.ref, e = {
354
- $$typeof: W,
355
- type: e,
356
- key: r,
357
- props: a,
358
- _owner: u
359
- }, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
360
- enumerable: !1,
361
- get: Y
362
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
363
- configurable: !1,
364
- enumerable: !1,
365
- writable: !0,
366
- value: 0
367
- }), Object.defineProperty(e, "_debugInfo", {
368
- configurable: !1,
369
- enumerable: !1,
370
- writable: !0,
371
- value: null
372
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
373
- }
374
- function k(e, r, t, o, u, a) {
375
- if (typeof e == "string" || typeof e == "function" || e === U || e === Q || e === Z || e === z || e === q || e === Te || typeof e == "object" && e !== null && (e.$$typeof === J || e.$$typeof === B || e.$$typeof === D || e.$$typeof === K || e.$$typeof === V || e.$$typeof === Se || e.getModuleId !== void 0)) {
376
- var n = r.children;
377
- if (n !== void 0)
378
- if (o)
379
- if (H(n)) {
380
- for (o = 0; o < n.length; o++)
381
- F(n[o], e);
382
- Object.freeze && Object.freeze(n);
383
- } else
384
- console.error(
385
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
386
- );
387
- else F(n, e);
388
- } else
389
- n = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (n += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? o = "null" : H(e) ? o = "array" : e !== void 0 && e.$$typeof === W ? (o = "<" + (s(e.type) || "Unknown") + " />", n = " Did you accidentally export a JSX literal instead of a component?") : o = typeof e, console.error(
390
- "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
391
- o,
392
- n
393
- );
394
- if (re.call(r, "key")) {
395
- n = s(e);
396
- var E = Object.keys(r).filter(function(l) {
397
- return l !== "key";
398
- });
399
- o = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", de[n + o] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
400
- `A props object containing a "key" prop is being spread into JSX:
401
- let props = %s;
402
- <%s {...props} />
403
- React keys must be passed directly to JSX without using spread:
404
- let props = %s;
405
- <%s key={someKey} {...props} />`,
406
- o,
407
- n,
408
- E,
409
- n
410
- ), de[n + o] = !0);
411
- }
412
- if (n = null, t !== void 0 && (b(t), n = "" + t), j(r) && (b(r.key), n = "" + r.key), "key" in r) {
413
- t = {};
414
- for (var T in r)
415
- T !== "key" && (t[T] = r[T]);
416
- } else t = r;
417
- return n && P(
418
- t,
419
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
420
- ), M(e, n, a, u, S(), t);
421
- }
422
- function F(e, r) {
423
- if (typeof e == "object" && e && e.$$typeof !== Ce) {
424
- if (H(e))
425
- for (var t = 0; t < e.length; t++) {
426
- var o = e[t];
427
- $(o) && I(o, r);
428
- }
429
- else if ($(e))
430
- e._store && (e._store.validated = 1);
431
- else if (e === null || typeof e != "object" ? t = null : (t = ee && e[ee] || e["@@iterator"], t = typeof t == "function" ? t : null), typeof t == "function" && t !== e.entries && (t = t.call(e), t !== e))
432
- for (; !(e = t.next()).done; )
433
- $(e.value) && I(e.value, r);
434
- }
435
- }
436
- function $(e) {
437
- return typeof e == "object" && e !== null && e.$$typeof === W;
438
- }
439
- function I(e, r) {
440
- if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, r = ye(r), !Ee[r])) {
441
- Ee[r] = !0;
442
- var t = "";
443
- e && e._owner != null && e._owner !== S() && (t = null, typeof e._owner.tag == "number" ? t = s(e._owner.type) : typeof e._owner.name == "string" && (t = e._owner.name), t = " It was passed a child from " + t + ".");
444
- var o = g.getCurrentStack;
445
- g.getCurrentStack = function() {
446
- var u = _(e.type);
447
- return o && (u += o() || ""), u;
448
- }, console.error(
449
- 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
450
- r,
451
- t
452
- ), g.getCurrentStack = o;
453
- }
454
- }
455
- function ye(e) {
456
- var r = "", t = S();
457
- return t && (t = s(t.type)) && (r = `
458
-
459
- Check the render method of \`` + t + "`."), r || (e = s(e)) && (r = `
460
-
461
- Check the top-level render call using <` + e + ">."), r;
462
- }
463
- var xe = Re, W = Symbol.for("react.transitional.element"), we = Symbol.for("react.portal"), U = Symbol.for("react.fragment"), Z = Symbol.for("react.strict_mode"), Q = Symbol.for("react.profiler"), K = Symbol.for("react.consumer"), D = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), q = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), Te = Symbol.for("react.offscreen"), ee = Symbol.iterator, _e = Symbol.for("react.client.reference"), g = xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, p = Object.assign, Se = Symbol.for("react.client.reference"), H = Array.isArray, C = 0, te, ne, oe, ae, ue, le, se;
464
- w.__reactDisabledLog = !0;
465
- var G, ce, X = !1, L = new (typeof WeakMap == "function" ? WeakMap : Map)(), Ce = Symbol.for("react.client.reference"), fe, ie = {}, de = {}, Ee = {};
466
- h.Fragment = U, h.jsx = function(e, r, t, o, u) {
467
- return k(e, r, t, !1, o, u);
468
- }, h.jsxs = function(e, r, t, o, u) {
469
- return k(e, r, t, !0, o, u);
470
- };
471
- }()), h;
472
- }
473
- var ge;
474
- function Me() {
475
- return ge || (ge = 1, process.env.NODE_ENV === "production" ? N.exports = Pe() : N.exports = Ye()), N.exports;
476
- }
477
- var $e = Me();
478
- function pe(s) {
479
- const { direction: x, defaultArrangement: b, defaultAlignment: w } = s;
480
- return Ae(({
481
- children: i = null,
482
- arrangement: f = b,
483
- alignment: d = w,
484
- style: _ = {},
485
- className: S = "",
486
- gap: j = 0,
487
- as: P = "div",
488
- ...Y
489
- }, M) => {
490
- const k = he(() => ({
491
- display: "flex",
492
- flexDirection: x,
493
- gap: `${j}px`,
494
- justifyContent: me[f] ?? f,
495
- alignItems: me[d] ?? d
496
- }), [j, f, d]);
497
- return /* @__PURE__ */ $e.jsx(
498
- P,
499
- {
500
- ref: M,
501
- style: { ...k, ..._ },
502
- className: S,
503
- ...Y,
504
- children: i
505
- }
506
- );
507
- });
508
- }
509
- const We = pe({
510
- direction: "row",
511
- defaultArrangement: je.Start,
512
- defaultAlignment: Ne.Stretch
513
- });
514
- We.displayName = "Row";
515
- const Ue = pe({
516
- direction: "column",
517
- defaultArrangement: ke.Top,
518
- defaultAlignment: Oe.Stretch
519
- });
520
- Ue.displayName = "Column";
1
+ import { C as r, H as e, a as t, R as o, V as l, b as i } from "./Column-CIsJNLGH.js";
521
2
  export {
522
- Ue as Column,
523
- Oe as HorizontalAlignment,
524
- je as HorizontalArrangement,
525
- We as Row,
526
- Ne as VerticalAlignment,
527
- ke as VerticalArrangement
3
+ r as Column,
4
+ e as HorizontalAlignment,
5
+ t as HorizontalArrangement,
6
+ o as Row,
7
+ l as VerticalAlignment,
8
+ i as VerticalArrangement
528
9
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("motion/react"),e=require("./Column-CS66eSYd.cjs"),t={Row:o.motion.create(e.Row),Column:o.motion.create(e.Column)};exports.motion=t;