@object-ui/layout 3.1.0 → 3.1.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.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +19 -0
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +1 -1
- package/package.json +5 -5
- package/src/AppShell.tsx +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @object-ui/layout@3.1.
|
|
2
|
+
> @object-ui/layout@3.1.2 build /home/runner/work/objectui/objectui/packages/layout
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v7.3.1 [32mbuilding client environment for production...[36m[39m
|
|
@@ -9,8 +9,8 @@ rendering chunks...
|
|
|
9
9
|
[32m
|
|
10
10
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
11
11
|
computing gzip size...
|
|
12
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m103.
|
|
13
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
12
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m103.90 kB[22m[1m[22m[2m │ gzip: 27.41 kB[22m
|
|
13
|
+
[32m[36m[vite:dts][32m Declaration files built in 36623ms.
|
|
14
14
|
[39m
|
|
15
15
|
[33mNo name was provided for external module "@object-ui/core" in "output.globals" – guessing "core".[39m
|
|
16
16
|
[33mNo name was provided for external module "react" in "output.globals" – guessing "React".[39m
|
|
@@ -20,5 +20,5 @@ computing gzip size...
|
|
|
20
20
|
[33mNo name was provided for external module "react-dom" in "output.globals" – guessing "reactDom".[39m
|
|
21
21
|
[33mNo name was provided for external module "@object-ui/types" in "output.globals" – guessing "types".[39m
|
|
22
22
|
[33mNo name was provided for external module "@object-ui/react" in "output.globals" – guessing "react".[39m
|
|
23
|
-
[2mdist/[22m[36mindex.umd.cjs [39m[1m[2m70.
|
|
24
|
-
[32m✓ built in
|
|
23
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[2m70.10 kB[22m[1m[22m[2m │ gzip: 23.15 kB[22m
|
|
24
|
+
[32m✓ built in 40.09s[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @object-ui/layout
|
|
2
2
|
|
|
3
|
+
## 3.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @object-ui/types@3.1.2
|
|
8
|
+
- @object-ui/core@3.1.2
|
|
9
|
+
- @object-ui/react@3.1.2
|
|
10
|
+
- @object-ui/components@3.1.2
|
|
11
|
+
|
|
12
|
+
## 3.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @object-ui/types@3.1.1
|
|
18
|
+
- @object-ui/components@3.1.1
|
|
19
|
+
- @object-ui/core@3.1.1
|
|
20
|
+
- @object-ui/react@3.1.1
|
|
21
|
+
|
|
3
22
|
## 3.0.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -342,8 +342,8 @@ function In({
|
|
|
342
342
|
e,
|
|
343
343
|
/* @__PURE__ */ l.jsxs(dr, { children: [
|
|
344
344
|
/* @__PURE__ */ l.jsxs("header", { className: "flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4", children: [
|
|
345
|
-
/* @__PURE__ */ l.jsx(fr, { className: "-ml-1" }),
|
|
346
|
-
/* @__PURE__ */ l.jsx("div", { className: "w-px h-4 bg-border mx-1 sm:mx-2" }),
|
|
345
|
+
/* @__PURE__ */ l.jsx(fr, { className: "-ml-1 hidden md:inline-flex" }),
|
|
346
|
+
/* @__PURE__ */ l.jsx("div", { className: "w-px h-4 bg-border mx-1 sm:mx-2 hidden md:block" }),
|
|
347
347
|
t
|
|
348
348
|
] }),
|
|
349
349
|
/* @__PURE__ */ l.jsx("main", { className: it("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", r), children: n })
|
package/dist/index.umd.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,R,$,J,$),be[$+R]=!0)}if($=null,O!==void 0&&(n(O),$=""+O),i(w)&&(n(w.key),$=""+w.key),"key"in w){O={};for(var Q in w)Q!=="key"&&(O[Q]=w[Q])}else O=w;return $&&a(O,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,$,O,o(),ue,X)}function h(f){b(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===A&&(f._payload.status==="fulfilled"?b(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function b(f){return typeof f=="object"&&f!==null&&f.$$typeof===S}var p=l,S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),Y=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,W=Array.isArray,B=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(f){return f()}};var le,q={},je=p.react_stack_bottom_frame.bind(p,s)(),re=B(r(s)),be={};ze.Fragment=m,ze.jsx=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!1,R?Error("react-stack-top-frame"):je,R?B(r(f)):re)},ze.jsxs=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!0,R?Error("react-stack-top-frame"):je,R?B(r(f)):re)}})()),ze}var Gt;function Gn(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?et.exports=Fn():et.exports=Yn()),et.exports}var c=Gn();function tt({title:e,description:t,action:n,className:r,children:o,...s}){return c.jsx("div",{className:v.cn("flex flex-col gap-4 pb-4 md:pb-8",r),...s,children:c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),(n||o)&&c.jsxs("div",{className:"flex items-center gap-2",children:[n,o]})]})})}function Vt(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return null;const n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,o=parseInt(t[3],16)/255,s=Math.max(n,r,o),i=Math.min(n,r,o);let a=0,u=0;const d=(s+i)/2;if(s!==i){const g=s-i;switch(u=d>.5?g/(2-s-i):g/(s+i),s){case n:a=((r-o)/g+(r<o?6:0))/6;break;case r:a=((o-n)/g+2)/6;break;case o:a=((n-r)/g+4)/6;break}}return`${Math.round(a*360)} ${Math.round(u*100)}% ${Math.round(d*100)}%`}function Ut(e,t){l.useEffect(()=>{const n=document.documentElement;if(e?.primaryColor){const r=Vt(e.primaryColor);r&&(n.style.setProperty("--brand-primary",e.primaryColor),n.style.setProperty("--brand-primary-hsl",r))}else n.style.removeProperty("--brand-primary"),n.style.removeProperty("--brand-primary-hsl");if(e?.accentColor){const r=Vt(e.accentColor);r&&(n.style.setProperty("--brand-accent",e.accentColor),n.style.setProperty("--brand-accent-hsl",r))}else n.style.removeProperty("--brand-accent"),n.style.removeProperty("--brand-accent-hsl");if(e?.favicon){const r=document.querySelector("#favicon")||document.querySelector('link[rel="icon"]');r&&(r.href=e.favicon)}return t&&(document.title=t),()=>{n.style.removeProperty("--brand-primary"),n.style.removeProperty("--brand-primary-hsl"),n.style.removeProperty("--brand-accent"),n.style.removeProperty("--brand-accent-hsl")}},[e?.primaryColor,e?.accentColor,e?.favicon,t])}function pt({sidebar:e,navbar:t,children:n,className:r,defaultOpen:o=!0,branding:s}){return Ut(s,s?.title),c.jsxs(v.SidebarProvider,{defaultOpen:o,children:[e,c.jsxs(v.SidebarInset,{children:[c.jsxs("header",{className:"flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",children:[c.jsx(v.SidebarTrigger,{className:"-ml-1"}),c.jsx("div",{className:"w-px h-4 bg-border mx-1 sm:mx-2"}),t]}),c.jsx("main",{className:v.cn("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6",r),children:n})]})]})}function Wt({className:e,children:t,...n}){return c.jsx("div",{className:v.cn("rounded-xl border bg-card text-card-foreground shadow",e),...n,children:c.jsx("div",{className:"p-6",children:t})})}const Vn={xs:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",6:"md:grid-cols-6",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",6:"xl:grid-cols-6",12:"xl:grid-cols-12"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",6:"2xl:grid-cols-6",12:"2xl:grid-cols-12"}};function Un(e){if(!e)return"grid-cols-1";const t=[];for(const[n,r]of Object.entries(e)){const o=Vn[n];if(o&&r){const i=Object.keys(o).map(Number).reduce((a,u)=>Math.abs(u-r)<Math.abs(a-r)?u:a);t.push(o[i])}}return t.join(" ")||"grid-cols-1"}const Wn={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},qt=({columns:e,gap:t=4,className:n,children:r})=>{const o=Un(e),s=typeof t=="number"?Wn[t]||`gap-${t}`:"";return c.jsx("div",{className:v.cn("grid",o,s,n),children:r})};function qn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vt(e){return"nodeType"in e}function K(e){var t,n;return e?Ee(e)?e:vt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=K(e);return e instanceof t}function Be(e){return Ee(e)?!1:e instanceof K(e).HTMLElement}function Xt(e){return e instanceof K(e).SVGElement}function Ne(e){return e?Ee(e)?e.document:vt(e)?bt(e)?e:Be(e)||Xt(e)?e.ownerDocument:document:document:document}const ce=nt?l.useLayoutEffect:l.useEffect;function xt(e){const t=l.useRef(e);return ce(()=>{t.current=e}),l.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Xn(){const e=l.useRef(null),t=l.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=l.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Fe(e,t){t===void 0&&(t=[e]);const n=l.useRef(e);return ce(()=>{n.current!==e&&(n.current=e)},t),n}function Ye(e,t){const n=l.useRef();return l.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function rt(e){const t=xt(e),n=l.useRef(null),r=l.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function mt(e){const t=l.useRef();return l.useEffect(()=>{t.current=e},[e]),t.current}let yt={};function Ge(e,t){return l.useMemo(()=>{if(t)return t;const n=yt[e]==null?0:yt[e]+1;return yt[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const a=Object.entries(i);for(const[u,d]of a){const g=s[u];g!=null&&(s[u]=g+e*d)}return s},{...t})}}const De=Ht(1),ot=Ht(-1);function Hn(e){return"clientX"in e&&"clientY"in e}function wt(e){if(!e)return!1;const{KeyboardEvent:t}=K(e.target);return t&&e instanceof t}function Jn(e){if(!e)return!1;const{TouchEvent:t}=K(e.target);return t&&e instanceof t}function St(e){if(Jn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Hn(e)?{x:e.clientX,y:e.clientY}:null}const Ve=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ve.Translate.toString(e),Ve.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Jt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kn(e){return e.matches(Jt)?e:e.querySelector(Jt)}const Qn={display:"none"};function Zn(e){let{id:t,value:n}=e;return l.createElement("div",{id:t,style:Qn},n)}function er(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return l.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function tr(){const[e,t]=l.useState("");return{announce:l.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Kt=l.createContext(null);function nr(e){const t=l.useContext(Kt);l.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rr(){const[e]=l.useState(()=>new Set),t=l.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[l.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const or={draggable:`
|
|
6
|
+
<%s key={someKey} {...props} />`,R,$,J,$),be[$+R]=!0)}if($=null,O!==void 0&&(n(O),$=""+O),i(w)&&(n(w.key),$=""+w.key),"key"in w){O={};for(var Q in w)Q!=="key"&&(O[Q]=w[Q])}else O=w;return $&&a(O,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,$,O,o(),ue,X)}function h(f){b(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===A&&(f._payload.status==="fulfilled"?b(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function b(f){return typeof f=="object"&&f!==null&&f.$$typeof===S}var p=l,S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),Y=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,W=Array.isArray,B=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(f){return f()}};var le,q={},je=p.react_stack_bottom_frame.bind(p,s)(),re=B(r(s)),be={};ze.Fragment=m,ze.jsx=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!1,R?Error("react-stack-top-frame"):je,R?B(r(f)):re)},ze.jsxs=function(f,w,O){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(f,w,O,!0,R?Error("react-stack-top-frame"):je,R?B(r(f)):re)}})()),ze}var Gt;function Gn(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?et.exports=Fn():et.exports=Yn()),et.exports}var c=Gn();function tt({title:e,description:t,action:n,className:r,children:o,...s}){return c.jsx("div",{className:v.cn("flex flex-col gap-4 pb-4 md:pb-8",r),...s,children:c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),(n||o)&&c.jsxs("div",{className:"flex items-center gap-2",children:[n,o]})]})})}function Vt(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return null;const n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,o=parseInt(t[3],16)/255,s=Math.max(n,r,o),i=Math.min(n,r,o);let a=0,u=0;const d=(s+i)/2;if(s!==i){const g=s-i;switch(u=d>.5?g/(2-s-i):g/(s+i),s){case n:a=((r-o)/g+(r<o?6:0))/6;break;case r:a=((o-n)/g+2)/6;break;case o:a=((n-r)/g+4)/6;break}}return`${Math.round(a*360)} ${Math.round(u*100)}% ${Math.round(d*100)}%`}function Ut(e,t){l.useEffect(()=>{const n=document.documentElement;if(e?.primaryColor){const r=Vt(e.primaryColor);r&&(n.style.setProperty("--brand-primary",e.primaryColor),n.style.setProperty("--brand-primary-hsl",r))}else n.style.removeProperty("--brand-primary"),n.style.removeProperty("--brand-primary-hsl");if(e?.accentColor){const r=Vt(e.accentColor);r&&(n.style.setProperty("--brand-accent",e.accentColor),n.style.setProperty("--brand-accent-hsl",r))}else n.style.removeProperty("--brand-accent"),n.style.removeProperty("--brand-accent-hsl");if(e?.favicon){const r=document.querySelector("#favicon")||document.querySelector('link[rel="icon"]');r&&(r.href=e.favicon)}return t&&(document.title=t),()=>{n.style.removeProperty("--brand-primary"),n.style.removeProperty("--brand-primary-hsl"),n.style.removeProperty("--brand-accent"),n.style.removeProperty("--brand-accent-hsl")}},[e?.primaryColor,e?.accentColor,e?.favicon,t])}function pt({sidebar:e,navbar:t,children:n,className:r,defaultOpen:o=!0,branding:s}){return Ut(s,s?.title),c.jsxs(v.SidebarProvider,{defaultOpen:o,children:[e,c.jsxs(v.SidebarInset,{children:[c.jsxs("header",{className:"flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",children:[c.jsx(v.SidebarTrigger,{className:"-ml-1 hidden md:inline-flex"}),c.jsx("div",{className:"w-px h-4 bg-border mx-1 sm:mx-2 hidden md:block"}),t]}),c.jsx("main",{className:v.cn("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6",r),children:n})]})]})}function Wt({className:e,children:t,...n}){return c.jsx("div",{className:v.cn("rounded-xl border bg-card text-card-foreground shadow",e),...n,children:c.jsx("div",{className:"p-6",children:t})})}const Vn={xs:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",6:"md:grid-cols-6",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",6:"xl:grid-cols-6",12:"xl:grid-cols-12"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",6:"2xl:grid-cols-6",12:"2xl:grid-cols-12"}};function Un(e){if(!e)return"grid-cols-1";const t=[];for(const[n,r]of Object.entries(e)){const o=Vn[n];if(o&&r){const i=Object.keys(o).map(Number).reduce((a,u)=>Math.abs(u-r)<Math.abs(a-r)?u:a);t.push(o[i])}}return t.join(" ")||"grid-cols-1"}const Wn={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},qt=({columns:e,gap:t=4,className:n,children:r})=>{const o=Un(e),s=typeof t=="number"?Wn[t]||`gap-${t}`:"";return c.jsx("div",{className:v.cn("grid",o,s,n),children:r})};function qn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vt(e){return"nodeType"in e}function K(e){var t,n;return e?Ee(e)?e:vt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=K(e);return e instanceof t}function Be(e){return Ee(e)?!1:e instanceof K(e).HTMLElement}function Xt(e){return e instanceof K(e).SVGElement}function Ne(e){return e?Ee(e)?e.document:vt(e)?bt(e)?e:Be(e)||Xt(e)?e.ownerDocument:document:document:document}const ce=nt?l.useLayoutEffect:l.useEffect;function xt(e){const t=l.useRef(e);return ce(()=>{t.current=e}),l.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Xn(){const e=l.useRef(null),t=l.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=l.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Fe(e,t){t===void 0&&(t=[e]);const n=l.useRef(e);return ce(()=>{n.current!==e&&(n.current=e)},t),n}function Ye(e,t){const n=l.useRef();return l.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function rt(e){const t=xt(e),n=l.useRef(null),r=l.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function mt(e){const t=l.useRef();return l.useEffect(()=>{t.current=e},[e]),t.current}let yt={};function Ge(e,t){return l.useMemo(()=>{if(t)return t;const n=yt[e]==null?0:yt[e]+1;return yt[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const a=Object.entries(i);for(const[u,d]of a){const g=s[u];g!=null&&(s[u]=g+e*d)}return s},{...t})}}const De=Ht(1),ot=Ht(-1);function Hn(e){return"clientX"in e&&"clientY"in e}function wt(e){if(!e)return!1;const{KeyboardEvent:t}=K(e.target);return t&&e instanceof t}function Jn(e){if(!e)return!1;const{TouchEvent:t}=K(e.target);return t&&e instanceof t}function St(e){if(Jn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Hn(e)?{x:e.clientX,y:e.clientY}:null}const Ve=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ve.Translate.toString(e),Ve.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Jt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kn(e){return e.matches(Jt)?e:e.querySelector(Jt)}const Qn={display:"none"};function Zn(e){let{id:t,value:n}=e;return l.createElement("div",{id:t,style:Qn},n)}function er(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return l.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function tr(){const[e,t]=l.useState("");return{announce:l.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Kt=l.createContext(null);function nr(e){const t=l.useContext(Kt);l.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rr(){const[e]=l.useState(()=>new Set),t=l.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[l.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const or={draggable:`
|
|
7
7
|
To pick up a draggable item, press the space bar.
|
|
8
8
|
While dragging, use the arrow keys to move the item.
|
|
9
9
|
Press space again to drop the item in its new position, or press escape to cancel.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/layout",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.umd.cjs",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"react": "19.2.4",
|
|
23
23
|
"react-dom": "19.2.4",
|
|
24
24
|
"tailwind-merge": "^3.5.0",
|
|
25
|
-
"@object-ui/components": "3.1.
|
|
26
|
-
"@object-ui/core": "3.1.
|
|
27
|
-
"@object-ui/react": "3.1.
|
|
28
|
-
"@object-ui/types": "3.1.
|
|
25
|
+
"@object-ui/components": "3.1.2",
|
|
26
|
+
"@object-ui/core": "3.1.2",
|
|
27
|
+
"@object-ui/react": "3.1.2",
|
|
28
|
+
"@object-ui/types": "3.1.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": "^18.0.0 || ^19.0.0",
|
package/src/AppShell.tsx
CHANGED
|
@@ -136,8 +136,8 @@ export function AppShell({
|
|
|
136
136
|
{sidebar}
|
|
137
137
|
<SidebarInset>
|
|
138
138
|
<header className="flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4">
|
|
139
|
-
<SidebarTrigger className="-ml-1" />
|
|
140
|
-
<div className="w-px h-4 bg-border mx-1 sm:mx-2" />
|
|
139
|
+
<SidebarTrigger className="-ml-1 hidden md:inline-flex" />
|
|
140
|
+
<div className="w-px h-4 bg-border mx-1 sm:mx-2 hidden md:block" />
|
|
141
141
|
{navbar}
|
|
142
142
|
</header>
|
|
143
143
|
<main className={cn("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", className)}>
|