@sikka/hawa 0.35.6-next → 0.36.1-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.
Files changed (96) hide show
  1. package/dist/{Chip-BtgTAs8x.d.mts → Chip-CGl24Kd9.d.mts} +2 -2
  2. package/dist/{Chip-DQsP5hFS.d.ts → Chip-Cato49ar.d.ts} +2 -2
  3. package/dist/accordion/index.d.mts +1 -1
  4. package/dist/accordion/index.d.ts +1 -1
  5. package/dist/accordion/index.js +6 -4
  6. package/dist/accordion/index.js.map +1 -1
  7. package/dist/accordion/index.mjs +6 -4
  8. package/dist/accordion/index.mjs.map +1 -1
  9. package/dist/appLayout/index.d.mts +0 -4
  10. package/dist/appLayout/index.d.ts +0 -4
  11. package/dist/appLayout/index.js +32 -15
  12. package/dist/appLayout/index.js.map +1 -1
  13. package/dist/appLayout/index.mjs +33 -16
  14. package/dist/appLayout/index.mjs.map +1 -1
  15. package/dist/blocks/auth/index.js +28 -5
  16. package/dist/blocks/auth/index.mjs +4 -4
  17. package/dist/blocks/feedback/index.js +0 -1
  18. package/dist/blocks/feedback/index.mjs +1 -1
  19. package/dist/blocks/index.js +34 -9
  20. package/dist/blocks/index.mjs +2 -2
  21. package/dist/blocks/misc/index.js +32 -7
  22. package/dist/blocks/misc/index.mjs +3 -3
  23. package/dist/blocks/pricing/index.js +6 -4
  24. package/dist/blocks/pricing/index.mjs +1 -1
  25. package/dist/chip/index.d.mts +2 -2
  26. package/dist/chip/index.d.ts +2 -2
  27. package/dist/chip/index.js +6 -4
  28. package/dist/chip/index.js.map +1 -1
  29. package/dist/chip/index.mjs +6 -4
  30. package/dist/chip/index.mjs.map +1 -1
  31. package/dist/{chunk-MZRUEJED.mjs → chunk-6QIOEUE2.mjs} +1 -1
  32. package/dist/{chunk-JEZLVXSU.mjs → chunk-BXBSZD5X.mjs} +26 -2
  33. package/dist/{chunk-LVXG3SMD.mjs → chunk-CJ57JBYA.mjs} +6 -4
  34. package/dist/{chunk-CD6AQVU3.mjs → chunk-HLYAX77R.mjs} +0 -1
  35. package/dist/{chunk-ANXGMZXS.mjs → chunk-NNPNQK6F.mjs} +6 -4
  36. package/dist/{chunk-57EAKTAP.mjs → chunk-T33FXOHA.mjs} +29 -6
  37. package/dist/colorPicker/index.js +1 -1
  38. package/dist/colorPicker/index.js.map +1 -1
  39. package/dist/colorPicker/index.mjs +1 -1
  40. package/dist/colorPicker/index.mjs.map +1 -1
  41. package/dist/dataTable/index.js +41 -5
  42. package/dist/dataTable/index.js.map +1 -1
  43. package/dist/dataTable/index.mjs +41 -5
  44. package/dist/dataTable/index.mjs.map +1 -1
  45. package/dist/datePicker/index.d.mts +1 -0
  46. package/dist/datePicker/index.d.ts +1 -0
  47. package/dist/datePicker/index.js +3 -2
  48. package/dist/datePicker/index.js.map +1 -1
  49. package/dist/datePicker/index.mjs +3 -2
  50. package/dist/datePicker/index.mjs.map +1 -1
  51. package/dist/elements/index.d.mts +8 -4
  52. package/dist/elements/index.d.ts +8 -4
  53. package/dist/elements/index.js +50 -13
  54. package/dist/elements/index.mjs +19 -7
  55. package/dist/index.css +10 -0
  56. package/dist/index.d.mts +8 -8
  57. package/dist/index.d.ts +8 -8
  58. package/dist/index.js +76 -24
  59. package/dist/index.mjs +77 -25
  60. package/dist/input/index.d.mts +6 -2
  61. package/dist/input/index.d.ts +6 -2
  62. package/dist/input/index.js +26 -2
  63. package/dist/input/index.js.map +1 -1
  64. package/dist/input/index.mjs +26 -2
  65. package/dist/input/index.mjs.map +1 -1
  66. package/dist/layout/index.d.mts +1 -5
  67. package/dist/layout/index.d.ts +1 -5
  68. package/dist/layout/index.js +32 -15
  69. package/dist/layout/index.mjs +29 -14
  70. package/dist/passwordInput/index.js +26 -2
  71. package/dist/passwordInput/index.js.map +1 -1
  72. package/dist/passwordInput/index.mjs +26 -2
  73. package/dist/passwordInput/index.mjs.map +1 -1
  74. package/dist/phoneInput/index.js +1 -2
  75. package/dist/phoneInput/index.js.map +1 -1
  76. package/dist/phoneInput/index.mjs +1 -2
  77. package/dist/phoneInput/index.mjs.map +1 -1
  78. package/dist/pinInput/index.js +1 -1
  79. package/dist/pinInput/index.js.map +1 -1
  80. package/dist/pinInput/index.mjs +1 -1
  81. package/dist/pinInput/index.mjs.map +1 -1
  82. package/dist/select/index.js +0 -1
  83. package/dist/select/index.js.map +1 -1
  84. package/dist/select/index.mjs +0 -1
  85. package/dist/select/index.mjs.map +1 -1
  86. package/dist/sidebar/index.js +6 -4
  87. package/dist/sidebar/index.js.map +1 -1
  88. package/dist/sidebar/index.mjs +6 -4
  89. package/dist/sidebar/index.mjs.map +1 -1
  90. package/dist/tabs/index.d.mts +1 -1
  91. package/dist/tabs/index.d.ts +1 -1
  92. package/dist/tabs/index.js +6 -4
  93. package/dist/tabs/index.js.map +1 -1
  94. package/dist/tabs/index.mjs +6 -4
  95. package/dist/tabs/index.mjs.map +1 -1
  96. package/package.json +7 -8
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  // layout/appLayout/AppLayout.tsx
4
- import React12, { useEffect as useEffect2, useState as useState2 } from "react";
4
+ import React12, { useEffect as useEffect2, useLayoutEffect, useState as useState2 } from "react";
5
5
 
6
6
  // hooks/useClickOutside.ts
7
7
  import { useEffect, useRef } from "react";
@@ -883,7 +883,8 @@ var Chip = React10.forwardRef(
883
883
  icon,
884
884
  color,
885
885
  radius = "inherit",
886
- dotType,
886
+ dot,
887
+ dotStatus = "none",
887
888
  ...rest
888
889
  }, ref) => {
889
890
  let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
@@ -902,7 +903,8 @@ var Chip = React10.forwardRef(
902
903
  normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
903
904
  large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
904
905
  };
905
- let dotTypeStyles = {
906
+ let dotStatusStyles = {
907
+ none: "hawa-bg-gray-500 dark:hawa-bg-gray-800",
906
908
  available: "hawa-bg-green-500",
907
909
  unavailable: "hawa-bg-red-500"
908
910
  };
@@ -930,10 +932,10 @@ var Chip = React10.forwardRef(
930
932
  color ? colorStyles[color] : "hawa-border hawa-bg-none"
931
933
  )
932
934
  },
933
- dotType && /* @__PURE__ */ React10.createElement(
935
+ dot && /* @__PURE__ */ React10.createElement(
934
936
  "span",
935
937
  {
936
- className: cn(dotStyles[size], dotTypeStyles[dotType])
938
+ className: cn(dotStyles[size], dotStatusStyles[dotStatus])
937
939
  }
938
940
  ),
939
941
  icon && icon,
@@ -1166,6 +1168,7 @@ var SidebarItem = ({
1166
1168
  };
1167
1169
 
1168
1170
  // layout/appLayout/AppLayout.tsx
1171
+ var LOCAL_STORAGE_KEY = "@sikka/hawa/keep-drawer-open";
1169
1172
  var AppLayout = ({
1170
1173
  profileMenuWidth = "default",
1171
1174
  DrawerFooterActions,
@@ -1176,14 +1179,18 @@ var AppLayout = ({
1176
1179
  drawerSize = "md",
1177
1180
  currentPage,
1178
1181
  clickedItem,
1179
- setKeepOpen,
1180
- keepOpen,
1181
1182
  DrawerLinkComponent,
1182
1183
  MenuLinkComponent,
1183
1184
  onAvatarClick,
1184
1185
  ...props
1185
1186
  }) => {
1186
1187
  var _a, _b;
1188
+ useLayoutEffect(() => {
1189
+ let isDrawerOpen = localStorage.getItem(LOCAL_STORAGE_KEY);
1190
+ if (isDrawerOpen === null) {
1191
+ localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(false));
1192
+ }
1193
+ }, []);
1187
1194
  let closeDrawerWidth = 56;
1188
1195
  let openDrawerWidth = 200;
1189
1196
  let drawerSizeStyle = {
@@ -1199,8 +1206,14 @@ var AppLayout = ({
1199
1206
  const [size, setSize] = useState2(
1200
1207
  typeof window !== "undefined" && window.innerWidth || 1200
1201
1208
  );
1202
- const [openSideMenu, setOpenSideMenu] = useState2(true);
1203
- const [keepDrawerOpen, setKeepDrawerOpen] = useState2(keepOpen);
1209
+ const [openSideMenu, setOpenSideMenu] = useState2(() => {
1210
+ const savedState = localStorage.getItem(LOCAL_STORAGE_KEY);
1211
+ return savedState ? JSON.parse(savedState) : false;
1212
+ });
1213
+ const [keepDrawerOpen, setKeepDrawerOpen] = useState2(() => {
1214
+ const savedState = localStorage.getItem(LOCAL_STORAGE_KEY);
1215
+ return savedState ? JSON.parse(savedState) : false;
1216
+ });
1204
1217
  const handleClickOutside = () => {
1205
1218
  if (typeof window !== "undefined") {
1206
1219
  if (window.innerWidth < 600) {
@@ -1226,12 +1239,16 @@ var AppLayout = ({
1226
1239
  }
1227
1240
  }, []);
1228
1241
  useEffect2(() => {
1229
- setKeepDrawerOpen(keepOpen);
1230
- }, [setKeepOpen]);
1242
+ setKeepDrawerOpen(() => {
1243
+ const savedState = localStorage.getItem(LOCAL_STORAGE_KEY);
1244
+ return savedState ? JSON.parse(savedState) : true;
1245
+ });
1246
+ }, [setKeepDrawerOpen]);
1231
1247
  useEffect2(() => {
1232
1248
  if (size > 600) {
1233
1249
  setOpenSideMenu(keepDrawerOpen);
1234
1250
  } else {
1251
+ setKeepDrawerOpen(false);
1235
1252
  setOpenSideMenu(false);
1236
1253
  }
1237
1254
  }, [size, keepDrawerOpen]);
@@ -1318,8 +1335,7 @@ var AppLayout = ({
1318
1335
  "div",
1319
1336
  {
1320
1337
  className: cn(
1321
- "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-red-500",
1322
- // 'hawa-bg-primary-foreground',
1338
+ "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",
1323
1339
  isRTL ? "hawa-right-0" : "hawa-left-0",
1324
1340
  bordered ? direction === "rtl" ? "hawa-border-s-[1px]" : "hawa-border-e-[1px]" : ""
1325
1341
  ),
@@ -1432,9 +1448,10 @@ var AppLayout = ({
1432
1448
  size: "smallIcon",
1433
1449
  onClick: () => {
1434
1450
  const newKeepOpenState = !keepDrawerOpen;
1435
- if (props.onDrawerExpand) {
1436
- props.onDrawerExpand(newKeepOpenState);
1437
- }
1451
+ localStorage.setItem(
1452
+ LOCAL_STORAGE_KEY,
1453
+ JSON.stringify(newKeepOpenState)
1454
+ );
1438
1455
  setKeepDrawerOpen(newKeepOpenState);
1439
1456
  }
1440
1457
  },