@sikka/hawa 0.36.1-next → 0.36.2-next
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/README.md +1 -5
- package/dist/appLayout/index.d.mts +0 -2
- package/dist/appLayout/index.d.ts +0 -2
- package/dist/appLayout/index.js +20 -7
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +21 -8
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.js +1 -1
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/command/index.mjs.map +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/elements/index.js +1 -1
- package/dist/elements/index.mjs +1 -1
- package/dist/index.css +6 -0
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +19 -8
- package/dist/index.mjs +20 -9
- package/dist/layout/index.d.mts +0 -2
- package/dist/layout/index.d.ts +0 -2
- package/dist/layout/index.js +20 -7
- package/dist/layout/index.mjs +19 -8
- package/package.json +1 -1
package/dist/appLayout/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
// layout/appLayout/AppLayout.tsx
|
4
|
-
import React12, { useEffect as useEffect2,
|
4
|
+
import React12, { useEffect as useEffect2, useState as useState2 } from "react";
|
5
5
|
|
6
6
|
// hooks/useClickOutside.ts
|
7
7
|
import { useEffect, useRef } from "react";
|
@@ -33,6 +33,9 @@ function useClickOutside(handler, events, nodes) {
|
|
33
33
|
return ref;
|
34
34
|
}
|
35
35
|
|
36
|
+
// layout/appLayout/AppLayout.tsx
|
37
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
38
|
+
|
36
39
|
// util/index.ts
|
37
40
|
import { clsx } from "clsx";
|
38
41
|
import { twMerge } from "tailwind-merge";
|
@@ -1185,7 +1188,7 @@ var AppLayout = ({
|
|
1185
1188
|
...props
|
1186
1189
|
}) => {
|
1187
1190
|
var _a, _b;
|
1188
|
-
|
1191
|
+
useEffect2(() => {
|
1189
1192
|
let isDrawerOpen = localStorage.getItem(LOCAL_STORAGE_KEY);
|
1190
1193
|
if (isDrawerOpen === null) {
|
1191
1194
|
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(false));
|
@@ -1210,6 +1213,7 @@ var AppLayout = ({
|
|
1210
1213
|
const savedState = localStorage.getItem(LOCAL_STORAGE_KEY);
|
1211
1214
|
return savedState ? JSON.parse(savedState) : false;
|
1212
1215
|
});
|
1216
|
+
const [container, setContainer] = React12.useState(null);
|
1213
1217
|
const [keepDrawerOpen, setKeepDrawerOpen] = useState2(() => {
|
1214
1218
|
const savedState = localStorage.getItem(LOCAL_STORAGE_KEY);
|
1215
1219
|
return savedState ? JSON.parse(savedState) : false;
|
@@ -1229,6 +1233,8 @@ var AppLayout = ({
|
|
1229
1233
|
setSize(window.innerWidth);
|
1230
1234
|
if (window.innerWidth > 600) {
|
1231
1235
|
setKeepDrawerOpen(false);
|
1236
|
+
} else {
|
1237
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(false));
|
1232
1238
|
}
|
1233
1239
|
};
|
1234
1240
|
resize();
|
@@ -1258,7 +1264,7 @@ var AppLayout = ({
|
|
1258
1264
|
{
|
1259
1265
|
dir: direction,
|
1260
1266
|
className: cn(
|
1261
|
-
"hawa-fixed hawa-end-0 hawa-start-0 hawa-top-0 hawa-z-
|
1267
|
+
"hawa-fixed hawa-end-0 hawa-start-0 hawa-top-0 hawa-z-10 hawa-flex hawa-h-14 hawa-w-full hawa-items-center hawa-justify-between hawa-bg-primary-foreground hawa-p-2",
|
1262
1268
|
bordered && "hawa-border-b-[1px]"
|
1263
1269
|
)
|
1264
1270
|
},
|
@@ -1286,7 +1292,7 @@ var AppLayout = ({
|
|
1286
1292
|
"div",
|
1287
1293
|
{
|
1288
1294
|
onClick: () => setOpenSideMenu(true),
|
1289
|
-
className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer
|
1295
|
+
className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all "
|
1290
1296
|
},
|
1291
1297
|
/* @__PURE__ */ React12.createElement(MenuIcon, null)
|
1292
1298
|
),
|
@@ -1331,13 +1337,13 @@ var AppLayout = ({
|
|
1331
1337
|
)
|
1332
1338
|
}
|
1333
1339
|
))
|
1334
|
-
), /* @__PURE__ */ React12.createElement(
|
1340
|
+
), /* @__PURE__ */ React12.createElement("div", { ref: setContainer }, /* @__PURE__ */ React12.createElement(
|
1335
1341
|
"div",
|
1336
1342
|
{
|
1337
1343
|
className: cn(
|
1338
|
-
"hawa-fixed hawa-z-
|
1344
|
+
"hawa-fixed hawa-z-40 hawa-flex hawa-flex-col hawa-justify-between hawa-overflow-x-clip hawa-transition-all hawa-top-0 hawa-h-[calc(100dvh)] hawa-bg-primary-foreground",
|
1339
1345
|
isRTL ? "hawa-right-0" : "hawa-left-0",
|
1340
|
-
bordered ? direction === "rtl" ? "hawa-border-s-[1px]" : "hawa-border-e-[1px]" : ""
|
1346
|
+
bordered ? size > 600 ? direction === "rtl" ? "hawa-border-s-[1px]" : "hawa-border-e-[1px]" : "" : ""
|
1341
1347
|
),
|
1342
1348
|
style: {
|
1343
1349
|
width: size > 600 ? openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : `${drawerSizeStyle["closed"][drawerSize]}px` : openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : "0px"
|
@@ -1477,10 +1483,17 @@ var AppLayout = ({
|
|
1477
1483
|
)
|
1478
1484
|
) : null
|
1479
1485
|
)
|
1486
|
+
)), /* @__PURE__ */ React12.createElement(
|
1487
|
+
Dialog.Root,
|
1488
|
+
{
|
1489
|
+
open: size < 600 && openSideMenu,
|
1490
|
+
onOpenChange: setOpenSideMenu
|
1491
|
+
},
|
1492
|
+
/* @__PURE__ */ React12.createElement(Dialog.Portal, { container }, /* @__PURE__ */ React12.createElement(Dialog.Overlay, { className: "hawa-fixed hawa-inset-0 hawa-bg-foreground/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out hawa-z-10 data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0" }))
|
1480
1493
|
), /* @__PURE__ */ React12.createElement(
|
1481
1494
|
"div",
|
1482
1495
|
{
|
1483
|
-
className: "hawa-fixed
|
1496
|
+
className: "hawa-fixed hawa-overflow-y-auto hawa-transition-all hawa-z-0",
|
1484
1497
|
style: isRTL ? {
|
1485
1498
|
left: "0px",
|
1486
1499
|
top: props.topBar ? "56px" : "0px",
|