@a4banana/react-layout-primitives 1.1.0 → 1.2.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/Column-BQyZsRY7.cjs +6 -0
- package/dist/Column-CQXZX7F9.js +348 -0
- package/dist/index.cjs +1 -31
- package/dist/index.d.ts +12 -4
- package/dist/index.js +7 -526
- package/dist/motion.cjs +1 -0
- package/dist/motion.d.ts +675 -0
- package/dist/motion.js +9 -0
- package/package.json +25 -11
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const M=require("react"),z={Start:"start",End:"end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},W={Top:"top",Bottom:"bottom",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},U={Start:"start",Center:"center",End:"end",Stretch:"stretch"},q={Top:"top",Center:"center",Bottom:"bottom",Stretch:"stretch"},F={start:"flex-start",end:"flex-end",top:"flex-start",bottom:"flex-end",center:"center",stretch:"stretch","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"};var S={exports:{}},_={};var D;function ce(){if(D)return _;D=1;var l=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function i(f,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:l,type:f,key:c,ref:o!==void 0?o:null,props:s}}return _.Fragment=d,_.jsx=i,_.jsxs=i,_}var b={};var L;function ue(){return L||(L=1,process.env.NODE_ENV!=="production"&&(function(){function l(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case Z:return"Profiler";case X:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case H:return"Portal";case K:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:l(e.type)||"Memo";case g:r=e._payload,e=e._init;try{return l(e(r))}catch{}}return null}function d(e){return""+e}function i(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),d(e)}}function f(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===g)return"<...>";try{var r=l(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function o(){var e=x.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function c(e){if(j.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function u(e,r){function t(){C||(C=!0,console.error("%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)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function y(){var e=l(this.type);return N[e]||(N[e]=!0,console.error("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.")),e=this.props.ref,e!==void 0?e:null}function k(e,r,t,n,A,h){var a=t.ref;return e={$$typeof:T,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:h}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function E(e,r,t,n,A,h){var a=r.children;if(a!==void 0)if(n)if(se(a)){for(n=0;n<a.length;n++)v(a[n]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(a);if(j.call(r,"key")){a=l(e);var p=Object.keys(r).filter(function(le){return le!=="key"});n=0<p.length?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}",I[a+n]||(p=0<p.length?"{"+p.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,n,a,p,a),I[a+n]=!0)}if(a=null,t!==void 0&&(i(t),a=""+t),c(r)&&(i(r.key),a=""+r.key),"key"in r){t={};for(var P in r)P!=="key"&&(t[P]=r[P])}else t=r;return a&&u(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),k(e,a,t,o(),A,h)}function v(e){R(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===g&&(e._payload.status==="fulfilled"?R(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function R(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}var m=M,T=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),x=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,se=Array.isArray,O=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var C,N={},Y=m.react_stack_bottom_frame.bind(m,s)(),$=O(f(s)),I={};b.Fragment=w,b.jsx=function(e,r,t){var n=1e4>x.recentlyCreatedOwnerStacks++;return E(e,r,t,!1,n?Error("react-stack-top-frame"):Y,n?O(f(e)):$)},b.jsxs=function(e,r,t){var n=1e4>x.recentlyCreatedOwnerStacks++;return E(e,r,t,!0,n?Error("react-stack-top-frame"):Y,n?O(f(e)):$)}})()),b}var V;function ie(){return V||(V=1,process.env.NODE_ENV==="production"?S.exports=ce():S.exports=ue()),S.exports}var fe=ie();function J(l){const{direction:d,defaultArrangement:i,defaultAlignment:f}=l;return({children:s=null,arrangement:c=i,alignment:u=f,style:y={},className:k="",gap:E=0,as:v="div",ref:R,...m})=>{const T=M.useMemo(()=>({display:"flex",flexDirection:d,gap:`${E}px`,justifyContent:F[c]??c,alignItems:F[u]??u}),[E,c,u]);return fe.jsx(v,{ref:R,style:{...T,...y},className:k,...m,children:s})}}const B=J({direction:"row",defaultArrangement:z.Start,defaultAlignment:q.Stretch});B.displayName="Row";const G=J({direction:"column",defaultArrangement:W.Top,defaultAlignment:U.Stretch});G.displayName="Column";exports.Column=G;exports.HorizontalAlignment=U;exports.HorizontalArrangement=z;exports.Row=B;exports.VerticalAlignment=q;exports.VerticalArrangement=W;
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import re, { useMemo as te } from "react";
|
|
2
|
+
const ne = {
|
|
3
|
+
Start: "start",
|
|
4
|
+
End: "end",
|
|
5
|
+
Center: "center",
|
|
6
|
+
SpaceBetween: "space-between",
|
|
7
|
+
SpaceAround: "space-around",
|
|
8
|
+
SpaceEvenly: "space-evenly"
|
|
9
|
+
}, ae = {
|
|
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
|
+
}, se = {
|
|
22
|
+
Top: "top",
|
|
23
|
+
Center: "center",
|
|
24
|
+
Bottom: "bottom",
|
|
25
|
+
Stretch: "stretch"
|
|
26
|
+
}, F = {
|
|
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 A = { exports: {} }, _ = {};
|
|
38
|
+
var D;
|
|
39
|
+
function le() {
|
|
40
|
+
if (D) return _;
|
|
41
|
+
D = 1;
|
|
42
|
+
var l = /* @__PURE__ */ Symbol.for("react.transitional.element"), d = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
43
|
+
function i(f, o, s) {
|
|
44
|
+
var c = null;
|
|
45
|
+
if (s !== void 0 && (c = "" + s), o.key !== void 0 && (c = "" + o.key), "key" in o) {
|
|
46
|
+
s = {};
|
|
47
|
+
for (var u in o)
|
|
48
|
+
u !== "key" && (s[u] = o[u]);
|
|
49
|
+
} else s = o;
|
|
50
|
+
return o = s.ref, {
|
|
51
|
+
$$typeof: l,
|
|
52
|
+
type: f,
|
|
53
|
+
key: c,
|
|
54
|
+
ref: o !== void 0 ? o : null,
|
|
55
|
+
props: s
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return _.Fragment = d, _.jsx = i, _.jsxs = i, _;
|
|
59
|
+
}
|
|
60
|
+
var b = {};
|
|
61
|
+
var L;
|
|
62
|
+
function ce() {
|
|
63
|
+
return L || (L = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
64
|
+
function l(e) {
|
|
65
|
+
if (e == null) return null;
|
|
66
|
+
if (typeof e == "function")
|
|
67
|
+
return e.$$typeof === Q ? null : e.displayName || e.name || null;
|
|
68
|
+
if (typeof e == "string") return e;
|
|
69
|
+
switch (e) {
|
|
70
|
+
case w:
|
|
71
|
+
return "Fragment";
|
|
72
|
+
case z:
|
|
73
|
+
return "Profiler";
|
|
74
|
+
case U:
|
|
75
|
+
return "StrictMode";
|
|
76
|
+
case G:
|
|
77
|
+
return "Suspense";
|
|
78
|
+
case H:
|
|
79
|
+
return "SuspenseList";
|
|
80
|
+
case Z:
|
|
81
|
+
return "Activity";
|
|
82
|
+
}
|
|
83
|
+
if (typeof e == "object")
|
|
84
|
+
switch (typeof e.tag == "number" && console.error(
|
|
85
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
86
|
+
), e.$$typeof) {
|
|
87
|
+
case W:
|
|
88
|
+
return "Portal";
|
|
89
|
+
case J:
|
|
90
|
+
return e.displayName || "Context";
|
|
91
|
+
case q:
|
|
92
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
93
|
+
case B:
|
|
94
|
+
var r = e.render;
|
|
95
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
96
|
+
case X:
|
|
97
|
+
return r = e.displayName || null, r !== null ? r : l(e.type) || "Memo";
|
|
98
|
+
case x:
|
|
99
|
+
r = e._payload, e = e._init;
|
|
100
|
+
try {
|
|
101
|
+
return l(e(r));
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
function d(e) {
|
|
108
|
+
return "" + e;
|
|
109
|
+
}
|
|
110
|
+
function i(e) {
|
|
111
|
+
try {
|
|
112
|
+
d(e);
|
|
113
|
+
var r = !1;
|
|
114
|
+
} catch {
|
|
115
|
+
r = !0;
|
|
116
|
+
}
|
|
117
|
+
if (r) {
|
|
118
|
+
r = console;
|
|
119
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
120
|
+
return t.call(
|
|
121
|
+
r,
|
|
122
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
123
|
+
n
|
|
124
|
+
), d(e);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function f(e) {
|
|
128
|
+
if (e === w) return "<>";
|
|
129
|
+
if (typeof e == "object" && e !== null && e.$$typeof === x)
|
|
130
|
+
return "<...>";
|
|
131
|
+
try {
|
|
132
|
+
var r = l(e);
|
|
133
|
+
return r ? "<" + r + ">" : "<...>";
|
|
134
|
+
} catch {
|
|
135
|
+
return "<...>";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function o() {
|
|
139
|
+
var e = O.A;
|
|
140
|
+
return e === null ? null : e.getOwner();
|
|
141
|
+
}
|
|
142
|
+
function s() {
|
|
143
|
+
return Error("react-stack-top-frame");
|
|
144
|
+
}
|
|
145
|
+
function c(e) {
|
|
146
|
+
if (j.call(e, "key")) {
|
|
147
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
148
|
+
if (r && r.isReactWarning) return !1;
|
|
149
|
+
}
|
|
150
|
+
return e.key !== void 0;
|
|
151
|
+
}
|
|
152
|
+
function u(e, r) {
|
|
153
|
+
function t() {
|
|
154
|
+
C || (C = !0, console.error(
|
|
155
|
+
"%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)",
|
|
156
|
+
r
|
|
157
|
+
));
|
|
158
|
+
}
|
|
159
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
160
|
+
get: t,
|
|
161
|
+
configurable: !0
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function y() {
|
|
165
|
+
var e = l(this.type);
|
|
166
|
+
return N[e] || (N[e] = !0, console.error(
|
|
167
|
+
"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."
|
|
168
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
169
|
+
}
|
|
170
|
+
function k(e, r, t, n, S, h) {
|
|
171
|
+
var a = t.ref;
|
|
172
|
+
return e = {
|
|
173
|
+
$$typeof: T,
|
|
174
|
+
type: e,
|
|
175
|
+
key: r,
|
|
176
|
+
props: t,
|
|
177
|
+
_owner: n
|
|
178
|
+
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
179
|
+
enumerable: !1,
|
|
180
|
+
get: y
|
|
181
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
182
|
+
configurable: !1,
|
|
183
|
+
enumerable: !1,
|
|
184
|
+
writable: !0,
|
|
185
|
+
value: 0
|
|
186
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
187
|
+
configurable: !1,
|
|
188
|
+
enumerable: !1,
|
|
189
|
+
writable: !0,
|
|
190
|
+
value: null
|
|
191
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
192
|
+
configurable: !1,
|
|
193
|
+
enumerable: !1,
|
|
194
|
+
writable: !0,
|
|
195
|
+
value: S
|
|
196
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
197
|
+
configurable: !1,
|
|
198
|
+
enumerable: !1,
|
|
199
|
+
writable: !0,
|
|
200
|
+
value: h
|
|
201
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
202
|
+
}
|
|
203
|
+
function E(e, r, t, n, S, h) {
|
|
204
|
+
var a = r.children;
|
|
205
|
+
if (a !== void 0)
|
|
206
|
+
if (n)
|
|
207
|
+
if (K(a)) {
|
|
208
|
+
for (n = 0; n < a.length; n++)
|
|
209
|
+
v(a[n]);
|
|
210
|
+
Object.freeze && Object.freeze(a);
|
|
211
|
+
} else
|
|
212
|
+
console.error(
|
|
213
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
214
|
+
);
|
|
215
|
+
else v(a);
|
|
216
|
+
if (j.call(r, "key")) {
|
|
217
|
+
a = l(e);
|
|
218
|
+
var p = Object.keys(r).filter(function(ee) {
|
|
219
|
+
return ee !== "key";
|
|
220
|
+
});
|
|
221
|
+
n = 0 < p.length ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (p = 0 < p.length ? "{" + p.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
222
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
223
|
+
let props = %s;
|
|
224
|
+
<%s {...props} />
|
|
225
|
+
React keys must be passed directly to JSX without using spread:
|
|
226
|
+
let props = %s;
|
|
227
|
+
<%s key={someKey} {...props} />`,
|
|
228
|
+
n,
|
|
229
|
+
a,
|
|
230
|
+
p,
|
|
231
|
+
a
|
|
232
|
+
), I[a + n] = !0);
|
|
233
|
+
}
|
|
234
|
+
if (a = null, t !== void 0 && (i(t), a = "" + t), c(r) && (i(r.key), a = "" + r.key), "key" in r) {
|
|
235
|
+
t = {};
|
|
236
|
+
for (var P in r)
|
|
237
|
+
P !== "key" && (t[P] = r[P]);
|
|
238
|
+
} else t = r;
|
|
239
|
+
return a && u(
|
|
240
|
+
t,
|
|
241
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
242
|
+
), k(
|
|
243
|
+
e,
|
|
244
|
+
a,
|
|
245
|
+
t,
|
|
246
|
+
o(),
|
|
247
|
+
S,
|
|
248
|
+
h
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
function v(e) {
|
|
252
|
+
R(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === x && (e._payload.status === "fulfilled" ? R(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
253
|
+
}
|
|
254
|
+
function R(e) {
|
|
255
|
+
return typeof e == "object" && e !== null && e.$$typeof === T;
|
|
256
|
+
}
|
|
257
|
+
var m = re, T = /* @__PURE__ */ Symbol.for("react.transitional.element"), W = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), U = /* @__PURE__ */ Symbol.for("react.strict_mode"), z = /* @__PURE__ */ Symbol.for("react.profiler"), q = /* @__PURE__ */ Symbol.for("react.consumer"), J = /* @__PURE__ */ Symbol.for("react.context"), B = /* @__PURE__ */ Symbol.for("react.forward_ref"), G = /* @__PURE__ */ Symbol.for("react.suspense"), H = /* @__PURE__ */ Symbol.for("react.suspense_list"), X = /* @__PURE__ */ Symbol.for("react.memo"), x = /* @__PURE__ */ Symbol.for("react.lazy"), Z = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.client.reference"), O = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, K = Array.isArray, g = console.createTask ? console.createTask : function() {
|
|
258
|
+
return null;
|
|
259
|
+
};
|
|
260
|
+
m = {
|
|
261
|
+
react_stack_bottom_frame: function(e) {
|
|
262
|
+
return e();
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
var C, N = {}, Y = m.react_stack_bottom_frame.bind(
|
|
266
|
+
m,
|
|
267
|
+
s
|
|
268
|
+
)(), $ = g(f(s)), I = {};
|
|
269
|
+
b.Fragment = w, b.jsx = function(e, r, t) {
|
|
270
|
+
var n = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
271
|
+
return E(
|
|
272
|
+
e,
|
|
273
|
+
r,
|
|
274
|
+
t,
|
|
275
|
+
!1,
|
|
276
|
+
n ? Error("react-stack-top-frame") : Y,
|
|
277
|
+
n ? g(f(e)) : $
|
|
278
|
+
);
|
|
279
|
+
}, b.jsxs = function(e, r, t) {
|
|
280
|
+
var n = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
281
|
+
return E(
|
|
282
|
+
e,
|
|
283
|
+
r,
|
|
284
|
+
t,
|
|
285
|
+
!0,
|
|
286
|
+
n ? Error("react-stack-top-frame") : Y,
|
|
287
|
+
n ? g(f(e)) : $
|
|
288
|
+
);
|
|
289
|
+
};
|
|
290
|
+
})()), b;
|
|
291
|
+
}
|
|
292
|
+
var M;
|
|
293
|
+
function ue() {
|
|
294
|
+
return M || (M = 1, process.env.NODE_ENV === "production" ? A.exports = le() : A.exports = ce()), A.exports;
|
|
295
|
+
}
|
|
296
|
+
var ie = ue();
|
|
297
|
+
function V(l) {
|
|
298
|
+
const { direction: d, defaultArrangement: i, defaultAlignment: f } = l;
|
|
299
|
+
return ({
|
|
300
|
+
children: s = null,
|
|
301
|
+
arrangement: c = i,
|
|
302
|
+
alignment: u = f,
|
|
303
|
+
style: y = {},
|
|
304
|
+
className: k = "",
|
|
305
|
+
gap: E = 0,
|
|
306
|
+
as: v = "div",
|
|
307
|
+
ref: R,
|
|
308
|
+
...m
|
|
309
|
+
}) => {
|
|
310
|
+
const T = te(() => ({
|
|
311
|
+
display: "flex",
|
|
312
|
+
flexDirection: d,
|
|
313
|
+
gap: `${E}px`,
|
|
314
|
+
justifyContent: F[c] ?? c,
|
|
315
|
+
alignItems: F[u] ?? u
|
|
316
|
+
}), [E, c, u]);
|
|
317
|
+
return /* @__PURE__ */ ie.jsx(
|
|
318
|
+
v,
|
|
319
|
+
{
|
|
320
|
+
ref: R,
|
|
321
|
+
style: { ...T, ...y },
|
|
322
|
+
className: k,
|
|
323
|
+
...m,
|
|
324
|
+
children: s
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
const fe = V({
|
|
330
|
+
direction: "row",
|
|
331
|
+
defaultArrangement: ne.Start,
|
|
332
|
+
defaultAlignment: se.Stretch
|
|
333
|
+
});
|
|
334
|
+
fe.displayName = "Row";
|
|
335
|
+
const de = V({
|
|
336
|
+
direction: "column",
|
|
337
|
+
defaultArrangement: ae.Top,
|
|
338
|
+
defaultAlignment: oe.Stretch
|
|
339
|
+
});
|
|
340
|
+
de.displayName = "Column";
|
|
341
|
+
export {
|
|
342
|
+
de as C,
|
|
343
|
+
oe as H,
|
|
344
|
+
fe as R,
|
|
345
|
+
se as V,
|
|
346
|
+
ne as a,
|
|
347
|
+
ae as b
|
|
348
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -1,31 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var be;function Pe(){if(be)return R;be=1;var s=Symbol.for("react.transitional.element"),w=Symbol.for("react.fragment");function b(x,c,i){var f=null;if(i!==void 0&&(f=""+i),c.key!==void 0&&(f=""+c.key),"key"in c){i={};for(var d in c)d!=="key"&&(i[d]=c[d])}else i=c;return c=i.ref,{$$typeof:s,type:x,key:f,ref:c!==void 0?c:null,props:i}}return R.Fragment=w,R.jsx=b,R.jsxs=b,R}var h={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ge;function Ye(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ke?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case he:return"Portal";case K:return"Profiler";case Q:return"StrictMode";case U:return"Suspense";case q:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ee:return(e.displayName||"Context")+".Provider";case D:return(e._context.displayName||"Context")+".Consumer";case z:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case B:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function w(e){return""+e}function b(e){try{w(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),w(e)}}function x(){}function c(){if(A===0){ne=console.log,oe=console.info,ae=console.warn,ue=console.error,le=console.group,se=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:x,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}function i(){if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:p({},e,{value:ne}),info:p({},e,{value:oe}),warn:p({},e,{value:ae}),error:p({},e,{value:ue}),group:p({},e,{value:le}),groupCollapsed:p({},e,{value:se}),groupEnd:p({},e,{value:ce})})}0>A&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function f(e){if(G===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);G=r&&r[1]||"",fe=-1<t.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+G+e+fe}function d(e,r){if(!e||X)return"";var t=L.get(e);if(t!==void 0)return t;X=!0,t=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var o=null;o=g.H,g.H=null,c();try{var u={DetermineComponentFrameRoot:function(){try{if(r){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(m){var O=m}Reflect.construct(e,[],v)}else{try{v.call()}catch(m){O=m}e.call(v.prototype)}}else{try{throw Error()}catch(m){O=m}(v=e())&&typeof v.catch=="function"&&v.catch(function(){})}}catch(m){if(m&&O&&typeof m.stack=="string")return[m.stack,O.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=u.DetermineComponentFrameRoot(),E=n[0],T=n[1];if(E&&T){var l=E.split(`
|
|
20
|
-
`),y=T.split(`
|
|
21
|
-
`);for(n=a=0;a<l.length&&!l[a].includes("DetermineComponentFrameRoot");)a++;for(;n<y.length&&!y[n].includes("DetermineComponentFrameRoot");)n++;if(a===l.length||n===y.length)for(a=l.length-1,n=y.length-1;1<=a&&0<=n&&l[a]!==y[n];)n--;for(;1<=a&&0<=n;a--,n--)if(l[a]!==y[n]){if(a!==1||n!==1)do if(a--,n--,0>n||l[a]!==y[n]){var C=`
|
|
22
|
-
`+l[a].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,C),C}while(1<=a&&0<=n);break}}}finally{X=!1,g.H=o,i(),Error.prepareStackTrace=t}return l=(l=e?e.displayName||e.name:"")?f(l):"",typeof e=="function"&&L.set(e,l),l}function S(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return d(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return f(e);switch(e){case U:return f("Suspense");case q:return f("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case z:return e=d(e.render,!1),e;case H:return S(e.type);case B:r=e._payload,e=e._init;try{return S(e(r))}catch{}}return""}function _(){var e=g.A;return e===null?null:e.getOwner()}function j(e){if(te.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function P(e,r){function t(){ie||(ie=!0,console.error("%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)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function Y(){var e=s(this.type);return de[e]||(de[e]=!0,console.error("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.")),e=this.props.ref,e!==void 0?e:null}function M(e,r,t,o,u,a){return t=a.ref,e={$$typeof:W,type:e,key:r,props:a,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function k(e,r,t,o,u,a){if(typeof e=="string"||typeof e=="function"||e===V||e===K||e===Q||e===U||e===q||e===je||typeof e=="object"&&e!==null&&(e.$$typeof===B||e.$$typeof===H||e.$$typeof===ee||e.$$typeof===D||e.$$typeof===z||e.$$typeof===Oe||e.getModuleId!==void 0)){var n=r.children;if(n!==void 0)if(o)if(J(n)){for(o=0;o<n.length;o++)I(n[o],e);Object.freeze&&Object.freeze(n)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else I(n,e)}else 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":J(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("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",o,n);if(te.call(r,"key")){n=s(e);var E=Object.keys(r).filter(function(l){return l!=="key"});o=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",Ee[n+o]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
|
-
let props = %s;
|
|
24
|
-
<%s {...props} />
|
|
25
|
-
React keys must be passed directly to JSX without using spread:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,o,n,E,n),Ee[n+o]=!0)}if(n=null,t!==void 0&&(b(t),n=""+t),j(r)&&(b(r.key),n=""+r.key),"key"in r){t={};for(var T in r)T!=="key"&&(t[T]=r[T])}else t=r;return n&&P(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),M(e,n,a,u,_(),t)}function I(e,r){if(typeof e=="object"&&e&&e.$$typeof!==Ne){if(J(e))for(var t=0;t<e.length;t++){var o=e[t];$(o)&&Z(o,r)}else if($(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?t=null:(t=re&&e[re]||e["@@iterator"],t=typeof t=="function"?t:null),typeof t=="function"&&t!==e.entries&&(t=t.call(e),t!==e))for(;!(e=t.next()).done;)$(e.value)&&Z(e.value,r)}}function $(e){return typeof e=="object"&&e!==null&&e.$$typeof===W}function Z(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=Ce(r),!me[r])){me[r]=!0;var t="";e&&e._owner!=null&&e._owner!==_()&&(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+".");var o=g.getCurrentStack;g.getCurrentStack=function(){var u=S(e.type);return o&&(u+=o()||""),u},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,t),g.getCurrentStack=o}}function Ce(e){var r="",t=_();return t&&(t=s(t.type))&&(r=`
|
|
28
|
-
|
|
29
|
-
Check the render method of \``+t+"`."),r||(e=s(e))&&(r=`
|
|
30
|
-
|
|
31
|
-
Check the top-level render call using <`+e+">."),r}var Re=F,W=Symbol.for("react.transitional.element"),he=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),je=Symbol.for("react.offscreen"),re=Symbol.iterator,ke=Symbol.for("react.client.reference"),g=Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,p=Object.assign,Oe=Symbol.for("react.client.reference"),J=Array.isArray,A=0,ne,oe,ae,ue,le,se,ce;x.__reactDisabledLog=!0;var G,fe,X=!1,L=new(typeof WeakMap=="function"?WeakMap:Map),Ne=Symbol.for("react.client.reference"),ie,de={},Ee={},me={};h.Fragment=V,h.jsx=function(e,r,t,o,u){return k(e,r,t,!1,o,u)},h.jsxs=function(e,r,t,o,u){return k(e,r,t,!0,o,u)}}()),h}var pe;function Me(){return pe||(pe=1,process.env.NODE_ENV==="production"?N.exports=Pe():N.exports=Ye()),N.exports}var $e=Me();function Se(s){const{direction:w,defaultArrangement:b,defaultAlignment:x}=s;return F.forwardRef(({children:i=null,arrangement:f=b,alignment:d=x,style:S={},className:_="",gap:j=0,as:P="div",...Y},M)=>{const k=F.useMemo(()=>({display:"flex",flexDirection:w,gap:`${j}px`,justifyContent:ve[f]??f,alignItems:ve[d]??d}),[j,f,d]);return $e.jsx(P,{ref:M,style:{...k,...S},className:_,...Y,children:i})})}const _e=Se({direction:"row",defaultArrangement:ye.Start,defaultAlignment:Te.Stretch});_e.displayName="Row";const Ae=Se({direction:"column",defaultArrangement:we.Top,defaultAlignment:xe.Stretch});Ae.displayName="Column";exports.Column=Ae;exports.HorizontalAlignment=xe;exports.HorizontalArrangement=ye;exports.Row=_e;exports.VerticalAlignment=Te;exports.VerticalArrangement=we;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./Column-BQyZsRY7.cjs");exports.Column=n.Column;exports.HorizontalAlignment=n.HorizontalAlignment;exports.HorizontalArrangement=n.HorizontalArrangement;exports.Row=n.Row;exports.VerticalAlignment=n.VerticalAlignment;exports.VerticalArrangement=n.VerticalArrangement;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
3
|
import { ElementType } from 'react';
|
|
4
|
-
import { ForwardRefExoticComponent } from 'react';
|
|
5
4
|
import { ReactNode } from 'react';
|
|
5
|
+
import { Ref } from 'react';
|
|
6
6
|
|
|
7
|
-
export declare const Column:
|
|
7
|
+
export declare const Column: {
|
|
8
|
+
(props: ColumnProps): React.JSX.Element;
|
|
9
|
+
displayName?: string;
|
|
10
|
+
};
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* Props for the Column component.
|
|
@@ -55,7 +58,7 @@ export declare type HorizontalArrangement = typeof HorizontalArrangement[keyof t
|
|
|
55
58
|
* Base props for all layout primitive components.
|
|
56
59
|
* Extends React's div props while adding custom layout properties.
|
|
57
60
|
*/
|
|
58
|
-
export declare interface LayoutPrimitivesProps extends Omit<ComponentPropsWithRef<'div'>, 'as'> {
|
|
61
|
+
export declare interface LayoutPrimitivesProps extends Omit<ComponentPropsWithRef<'div'>, 'as' | 'ref'> {
|
|
59
62
|
readonly children?: ReactNode;
|
|
60
63
|
readonly style?: CSSProperties;
|
|
61
64
|
readonly className?: string;
|
|
@@ -63,9 +66,14 @@ export declare interface LayoutPrimitivesProps extends Omit<ComponentPropsWithRe
|
|
|
63
66
|
readonly gap?: number;
|
|
64
67
|
/** The element type to render as */
|
|
65
68
|
readonly as?: ElementType;
|
|
69
|
+
/** Ref to the underlying DOM element (React 19+ ref-as-prop) */
|
|
70
|
+
readonly ref?: Ref<HTMLElement>;
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
export declare const Row:
|
|
73
|
+
export declare const Row: {
|
|
74
|
+
(props: RowProps): React.JSX.Element;
|
|
75
|
+
displayName?: string;
|
|
76
|
+
};
|
|
69
77
|
|
|
70
78
|
/**
|
|
71
79
|
* Props for the Row component.
|