@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 CHANGED
@@ -48,9 +48,7 @@
48
48
 
49
49
  **Note:** Current npm tags 👇
50
50
 
51
- `@beta` is archived.
52
-
53
- `@next` only points to pre-releases.
51
+ `@next` for the pre-releases (can be unstable).
54
52
 
55
53
  `@latest` for the latest stable release.
56
54
 
@@ -58,8 +56,6 @@
58
56
  npm install @sikka/hawa
59
57
  ```
60
58
 
61
- </br>
62
-
63
59
  ## Contributing
64
60
 
65
61
  Please see our [contributing.md](/CONTRIBUTING.md).
@@ -110,8 +110,6 @@ type AppLayoutTypes = {
110
110
  * - 'parent': Inherits width from parent element.
111
111
  */
112
112
  profileMenuWidth?: "default" | "sm" | "lg" | "parent";
113
- /** Event handler for drawer expansion. */
114
- onDrawerExpand?: (e: any) => void;
115
113
  /** Specifies additional actions for the drawer footer. */
116
114
  DrawerFooterActions?: any;
117
115
  /** Specifies the item that was clicked. */
@@ -110,8 +110,6 @@ type AppLayoutTypes = {
110
110
  * - 'parent': Inherits width from parent element.
111
111
  */
112
112
  profileMenuWidth?: "default" | "sm" | "lg" | "parent";
113
- /** Event handler for drawer expansion. */
114
- onDrawerExpand?: (e: any) => void;
115
113
  /** Specifies additional actions for the drawer footer. */
116
114
  DrawerFooterActions?: any;
117
115
  /** Specifies the item that was clicked. */
@@ -68,6 +68,9 @@ function useClickOutside(handler, events, nodes) {
68
68
  return ref;
69
69
  }
70
70
 
71
+ // layout/appLayout/AppLayout.tsx
72
+ var Dialog = __toESM(require("@radix-ui/react-dialog"));
73
+
71
74
  // util/index.ts
72
75
  var import_clsx = require("clsx");
73
76
  var import_tailwind_merge = require("tailwind-merge");
@@ -1220,7 +1223,7 @@ var AppLayout = ({
1220
1223
  ...props
1221
1224
  }) => {
1222
1225
  var _a, _b;
1223
- (0, import_react10.useLayoutEffect)(() => {
1226
+ (0, import_react10.useEffect)(() => {
1224
1227
  let isDrawerOpen = localStorage.getItem(LOCAL_STORAGE_KEY);
1225
1228
  if (isDrawerOpen === null) {
1226
1229
  localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(false));
@@ -1245,6 +1248,7 @@ var AppLayout = ({
1245
1248
  const savedState = localStorage.getItem(LOCAL_STORAGE_KEY);
1246
1249
  return savedState ? JSON.parse(savedState) : false;
1247
1250
  });
1251
+ const [container, setContainer] = import_react10.default.useState(null);
1248
1252
  const [keepDrawerOpen, setKeepDrawerOpen] = (0, import_react10.useState)(() => {
1249
1253
  const savedState = localStorage.getItem(LOCAL_STORAGE_KEY);
1250
1254
  return savedState ? JSON.parse(savedState) : false;
@@ -1264,6 +1268,8 @@ var AppLayout = ({
1264
1268
  setSize(window.innerWidth);
1265
1269
  if (window.innerWidth > 600) {
1266
1270
  setKeepDrawerOpen(false);
1271
+ } else {
1272
+ localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(false));
1267
1273
  }
1268
1274
  };
1269
1275
  resize();
@@ -1293,7 +1299,7 @@ var AppLayout = ({
1293
1299
  {
1294
1300
  dir: direction,
1295
1301
  className: cn(
1296
- "hawa-fixed hawa-end-0 hawa-start-0 hawa-top-0 hawa-z-0 hawa-flex hawa-h-14 hawa-w-full hawa-items-center hawa-justify-between hawa-bg-primary-foreground hawa-p-2",
1302
+ "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",
1297
1303
  bordered && "hawa-border-b-[1px]"
1298
1304
  )
1299
1305
  },
@@ -1321,7 +1327,7 @@ var AppLayout = ({
1321
1327
  "div",
1322
1328
  {
1323
1329
  onClick: () => setOpenSideMenu(true),
1324
- className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all hover:hawa-bg-gray-100"
1330
+ className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all "
1325
1331
  },
1326
1332
  /* @__PURE__ */ import_react10.default.createElement(MenuIcon, null)
1327
1333
  ),
@@ -1366,13 +1372,13 @@ var AppLayout = ({
1366
1372
  )
1367
1373
  }
1368
1374
  ))
1369
- ), /* @__PURE__ */ import_react10.default.createElement(
1375
+ ), /* @__PURE__ */ import_react10.default.createElement("div", { ref: setContainer }, /* @__PURE__ */ import_react10.default.createElement(
1370
1376
  "div",
1371
1377
  {
1372
1378
  className: cn(
1373
- "hawa-fixed hawa-z-0 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",
1379
+ "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",
1374
1380
  isRTL ? "hawa-right-0" : "hawa-left-0",
1375
- bordered ? direction === "rtl" ? "hawa-border-s-[1px]" : "hawa-border-e-[1px]" : ""
1381
+ bordered ? size > 600 ? direction === "rtl" ? "hawa-border-s-[1px]" : "hawa-border-e-[1px]" : "" : ""
1376
1382
  ),
1377
1383
  style: {
1378
1384
  width: size > 600 ? openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : `${drawerSizeStyle["closed"][drawerSize]}px` : openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : "0px"
@@ -1512,10 +1518,17 @@ var AppLayout = ({
1512
1518
  )
1513
1519
  ) : null
1514
1520
  )
1521
+ )), /* @__PURE__ */ import_react10.default.createElement(
1522
+ Dialog.Root,
1523
+ {
1524
+ open: size < 600 && openSideMenu,
1525
+ onOpenChange: setOpenSideMenu
1526
+ },
1527
+ /* @__PURE__ */ import_react10.default.createElement(Dialog.Portal, { container }, /* @__PURE__ */ import_react10.default.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" }))
1515
1528
  ), /* @__PURE__ */ import_react10.default.createElement(
1516
1529
  "div",
1517
1530
  {
1518
- className: "hawa-fixed -hawa-z-10 hawa-overflow-y-auto hawa-transition-all",
1531
+ className: "hawa-fixed hawa-overflow-y-auto hawa-transition-all hawa-z-0",
1519
1532
  style: isRTL ? {
1520
1533
  left: "0px",
1521
1534
  top: props.topBar ? "56px" : "0px",