@sikka/hawa 0.1.95 → 0.1.97

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/index.d.mts CHANGED
@@ -175,10 +175,11 @@ type SubItem$2 = {
175
175
  };
176
176
  type MenuItemType = {
177
177
  icon?: any;
178
- label: string;
179
- value: string;
178
+ label?: string;
179
+ value?: string;
180
180
  end?: any;
181
181
  presist?: boolean;
182
+ type?: "separator" | "label";
182
183
  action?: () => void;
183
184
  highlighted?: boolean;
184
185
  subitems?: SubItem$2[];
@@ -196,6 +197,7 @@ interface DropdownMenuProps {
196
197
  align?: ExtendedDropdownMenuContentProps["align"];
197
198
  alignOffset?: ExtendedDropdownMenuContentProps["alignOffset"];
198
199
  width?: "default" | "sm" | "lg" | "parent";
200
+ size?: "default" | "sm";
199
201
  selectCallback?: any;
200
202
  }
201
203
  declare const DropdownMenu: React$1.FC<DropdownMenuProps>;
@@ -214,6 +216,8 @@ type TableTypes = {
214
216
  pagination?: boolean;
215
217
  columns: ColTypes[];
216
218
  actions?: MenuItemType[];
219
+ actionsWidth?: "default" | "sm" | "lg" | "parent";
220
+ actionsSize?: "default" | "sm";
217
221
  direction?: "rtl" | "ltr";
218
222
  rows?: RowTypes[][];
219
223
  handleActionClick?: any;
@@ -365,6 +369,7 @@ type StatTypes = {
365
369
  color?: string;
366
370
  number?: string;
367
371
  helperText?: string;
372
+ chart?: any;
368
373
  icon?: any;
369
374
  variant?: "default" | "plain" | "contained" | "outlined" | "brutalist" | "dropshadow";
370
375
  width?: "full" | "min" | "normal";
@@ -953,6 +958,7 @@ type AppLayoutTypes = {
953
958
  avatarImage?: any;
954
959
  drawerSize?: "sm" | "md" | "large";
955
960
  profileMenuItems?: MenuItemType[];
961
+ profileMenuWidth: "default" | "sm" | "lg" | "parent";
956
962
  onSettingsClick?: () => void;
957
963
  DrawerFooterActions?: any;
958
964
  clickedItem?: any;
@@ -1310,6 +1316,7 @@ declare const SignUpForm: FC<SignUpFormTypes>;
1310
1316
 
1311
1317
  type NewPasswordTypes = {
1312
1318
  handleNewPassword: () => void;
1319
+ direction?: "rtl" | "ltr";
1313
1320
  passwordChanged: any;
1314
1321
  texts: {
1315
1322
  passwordPlaceholder: string;
package/dist/index.d.ts CHANGED
@@ -175,10 +175,11 @@ type SubItem$2 = {
175
175
  };
176
176
  type MenuItemType = {
177
177
  icon?: any;
178
- label: string;
179
- value: string;
178
+ label?: string;
179
+ value?: string;
180
180
  end?: any;
181
181
  presist?: boolean;
182
+ type?: "separator" | "label";
182
183
  action?: () => void;
183
184
  highlighted?: boolean;
184
185
  subitems?: SubItem$2[];
@@ -196,6 +197,7 @@ interface DropdownMenuProps {
196
197
  align?: ExtendedDropdownMenuContentProps["align"];
197
198
  alignOffset?: ExtendedDropdownMenuContentProps["alignOffset"];
198
199
  width?: "default" | "sm" | "lg" | "parent";
200
+ size?: "default" | "sm";
199
201
  selectCallback?: any;
200
202
  }
201
203
  declare const DropdownMenu: React$1.FC<DropdownMenuProps>;
@@ -214,6 +216,8 @@ type TableTypes = {
214
216
  pagination?: boolean;
215
217
  columns: ColTypes[];
216
218
  actions?: MenuItemType[];
219
+ actionsWidth?: "default" | "sm" | "lg" | "parent";
220
+ actionsSize?: "default" | "sm";
217
221
  direction?: "rtl" | "ltr";
218
222
  rows?: RowTypes[][];
219
223
  handleActionClick?: any;
@@ -365,6 +369,7 @@ type StatTypes = {
365
369
  color?: string;
366
370
  number?: string;
367
371
  helperText?: string;
372
+ chart?: any;
368
373
  icon?: any;
369
374
  variant?: "default" | "plain" | "contained" | "outlined" | "brutalist" | "dropshadow";
370
375
  width?: "full" | "min" | "normal";
@@ -953,6 +958,7 @@ type AppLayoutTypes = {
953
958
  avatarImage?: any;
954
959
  drawerSize?: "sm" | "md" | "large";
955
960
  profileMenuItems?: MenuItemType[];
961
+ profileMenuWidth: "default" | "sm" | "lg" | "parent";
956
962
  onSettingsClick?: () => void;
957
963
  DrawerFooterActions?: any;
958
964
  clickedItem?: any;
@@ -1310,6 +1316,7 @@ declare const SignUpForm: FC<SignUpFormTypes>;
1310
1316
 
1311
1317
  type NewPasswordTypes = {
1312
1318
  handleNewPassword: () => void;
1319
+ direction?: "rtl" | "ltr";
1313
1320
  passwordChanged: any;
1314
1321
  texts: {
1315
1322
  passwordPlaceholder: string;
package/dist/index.js CHANGED
@@ -509,7 +509,7 @@ var HawaRadio = function(_param) {
509
509
  setSelectedOption(opt.value);
510
510
  props.onChangeTab(opt.value);
511
511
  },
512
- className: cn("w-full cursor-pointer", orientation === "horizontal" && parentDirection === "ltr" && "rounded-none first:rounded-l last:rounded-r", orientation === "horizontal" && parentDirection === "rtl" && "rounded-none first:rounded-r last:rounded-l", orientation === "vertical" && "rounded-none first:rounded-t last:rounded-b", "last flex flex-row items-center justify-center gap-2 ", selectedOption === opt.value ? activeTabStyle : inactiveTabStyle),
512
+ className: cn("w-full cursor-pointer ", orientation === "horizontal" && parentDirection === "ltr" && "rounded-none first:rounded-l last:rounded-r", orientation === "horizontal" && parentDirection === "rtl" && "rounded-none first:rounded-r last:rounded-l", orientation === "vertical" && "rounded-none first:rounded-t last:rounded-b", "last flex flex-row items-center justify-center gap-2 ", selectedOption === opt.value ? activeTabStyle : inactiveTabStyle),
513
513
  key: o
514
514
  }, opt.icon && opt.icon, opt.label);
515
515
  });
@@ -1260,13 +1260,17 @@ var DropdownMenuShortcut = function(_param) {
1260
1260
  };
1261
1261
  DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
1262
1262
  var DropdownMenu = function(param) {
1263
- var trigger = param.trigger, items = param.items, direction = param.direction, onItemSelect = param.onItemSelect, sideOffset = param.sideOffset, side = param.side, className = param.className, triggerClassname = param.triggerClassname, align = param.align, alignOffset = param.alignOffset, selectCallback = param.selectCallback, _param_width = param.width, width = _param_width === void 0 ? "default" : _param_width;
1263
+ var trigger = param.trigger, items = param.items, direction = param.direction, onItemSelect = param.onItemSelect, sideOffset = param.sideOffset, side = param.side, className = param.className, triggerClassname = param.triggerClassname, align = param.align, alignOffset = param.alignOffset, selectCallback = param.selectCallback, _param_size = param.size, size = _param_size === void 0 ? "default" : _param_size, _param_width = param.width, width = _param_width === void 0 ? "default" : _param_width;
1264
1264
  var widthStyles2 = {
1265
1265
  default: "min-w-[8rem]",
1266
1266
  sm: "w-fit",
1267
1267
  lg: "w-[200px]",
1268
1268
  parent: "ddm-w-parent"
1269
1269
  };
1270
+ var sizeStyles2 = {
1271
+ default: "px-2 py-3 ",
1272
+ sm: "text-xs px-1.5 py-1.5"
1273
+ };
1270
1274
  return /* @__PURE__ */ React19.createElement(DropdownMenuRoot, {
1271
1275
  dir: direction
1272
1276
  }, /* @__PURE__ */ React19.createElement(DropdownMenuTrigger, {
@@ -1278,43 +1282,50 @@ var DropdownMenu = function(param) {
1278
1282
  align: align,
1279
1283
  alignOffset: alignOffset
1280
1284
  }, items.map(function(item, index) {
1281
- return item.subitems ? /* @__PURE__ */ React19.createElement(DropdownMenuSub, {
1282
- key: index
1283
- }, /* @__PURE__ */ React19.createElement(DropdownMenuSubTrigger, {
1284
- dir: direction
1285
- }, item.icon && item.icon, item.label && item.label), /* @__PURE__ */ React19.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React19.createElement(DropdownMenuSubContent, null, item.subitems.map(function(subitem, subIndex) {
1286
- return /* @__PURE__ */ React19.createElement(DropdownMenuItem, {
1287
- disabled: subitem.disabled,
1288
- className: "px-2 py-3",
1289
- onSelect: function() {
1290
- subitem.action();
1291
- if (selectCallback) {
1292
- selectCallback(subitem.value);
1293
- }
1294
- },
1295
- key: subIndex
1296
- }, subitem.icon && subitem.icon, subitem.label && subitem.label);
1297
- })))) : /* @__PURE__ */ React19.createElement(DropdownMenuItem, {
1298
- disabled: item.disabled,
1299
- key: index,
1300
- onSelect: function(e) {
1301
- if (item.presist) {
1302
- e.preventDefault();
1303
- }
1304
- if (item.action) {
1305
- item.action();
1306
- if (selectCallback) {
1307
- selectCallback(item.value);
1285
+ if (item.type === "separator") {
1286
+ return /* @__PURE__ */ React19.createElement(DropdownMenuSeparator, null);
1287
+ } else if (item.type === "label") {
1288
+ return /* @__PURE__ */ React19.createElement(DropdownMenuLabel, null, item.label);
1289
+ } else {
1290
+ return item.subitems ? /* @__PURE__ */ React19.createElement(DropdownMenuSub, {
1291
+ key: index
1292
+ }, /* @__PURE__ */ React19.createElement(DropdownMenuSubTrigger, {
1293
+ className: cn(sizeStyles2[size]),
1294
+ dir: direction
1295
+ }, item.icon && item.icon, item.label && item.label), /* @__PURE__ */ React19.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React19.createElement(DropdownMenuSubContent, null, item.subitems.map(function(subitem, subIndex) {
1296
+ return /* @__PURE__ */ React19.createElement(DropdownMenuItem, {
1297
+ className: cn(sizeStyles2[size], !item.icon && !item.label ? "px-0 py-0 focus:bg-transparent" : "focus:bg-accent"),
1298
+ disabled: subitem.disabled,
1299
+ onSelect: function() {
1300
+ subitem.action();
1301
+ if (selectCallback) {
1302
+ selectCallback(subitem.value);
1303
+ }
1304
+ },
1305
+ key: subIndex
1306
+ }, subitem.icon && subitem.icon, subitem.label && subitem.label);
1307
+ })))) : /* @__PURE__ */ React19.createElement(DropdownMenuItem, {
1308
+ disabled: item.disabled,
1309
+ key: index,
1310
+ onSelect: function(e) {
1311
+ if (item.presist) {
1312
+ e.preventDefault();
1308
1313
  }
1309
- } else {
1310
- if (selectCallback) {
1311
- selectCallback(item.value);
1314
+ if (item.action) {
1315
+ item.action();
1316
+ if (selectCallback) {
1317
+ selectCallback(item.value);
1318
+ }
1319
+ } else {
1320
+ if (selectCallback) {
1321
+ selectCallback(item.value);
1322
+ }
1312
1323
  }
1313
- }
1314
- },
1315
- end: item.end,
1316
- className: !item.icon && !item.label ? "px-0 py-0 focus:bg-transparent " : "px-2 py-3 focus:bg-accent "
1317
- }, item.icon && item.icon, item.label && item.label);
1324
+ },
1325
+ end: item.end,
1326
+ className: cn(sizeStyles2[size], !item.icon && !item.label ? "px-0 py-0 focus:bg-transparent " : "focus:bg-accent ", item.presist && "focus:bg-transparent")
1327
+ }, item.icon && item.icon, item.label && item.label);
1328
+ }
1318
1329
  }))));
1319
1330
  };
1320
1331
  // src/elements/HawaTable.tsx
@@ -1385,7 +1396,7 @@ var HawaTable = function(_param) {
1385
1396
  page
1386
1397
  ]);
1387
1398
  return /* @__PURE__ */ React6.default.createElement("div", {
1388
- className: "relative flex flex-col gap-2 "
1399
+ className: "relative flex flex-col gap-2 "
1389
1400
  }, /* @__PURE__ */ React6.default.createElement("div", {
1390
1401
  className: "overflow-x-auto rounded bg-".concat(headerColor)
1391
1402
  }, props.headerTools && /* @__PURE__ */ React6.default.createElement("div", {
@@ -1484,7 +1495,8 @@ var HawaTable = function(_param) {
1484
1495
  }, /* @__PURE__ */ React6.default.createElement("div", {
1485
1496
  className: "flex items-center justify-center"
1486
1497
  }, /* @__PURE__ */ React6.default.createElement(DropdownMenu, {
1487
- width: "sm",
1498
+ width: props.actionsWidth,
1499
+ size: props.actionsSize,
1488
1500
  direction: direction,
1489
1501
  side: "right",
1490
1502
  items: props.actions,
@@ -4383,7 +4395,9 @@ var HawaStats = function(_param) {
4383
4395
  className: "mt-2 h-4 w-1/2"
4384
4396
  }) : props.helperText && /* @__PURE__ */ React6.default.createElement("p", {
4385
4397
  className: "text-xs text-muted-foreground"
4386
- }, props.helperText)));
4398
+ }, props.helperText), props.isLoading && props.chart ? /* @__PURE__ */ React6.default.createElement(Skeleton, {
4399
+ className: "mt-2 h-4 w-1/2"
4400
+ }) : props.chart));
4387
4401
  };
4388
4402
  // src/elements/HawaCodeBlock.tsx
4389
4403
  // src/elements/Tooltip.tsx
@@ -7955,7 +7969,12 @@ var AppLayout = function(_param) {
7955
7969
  alignOffset: 8,
7956
7970
  side: "bottom",
7957
7971
  sideOffset: 5,
7972
+ width: props.profileMenuWidth,
7958
7973
  direction: isRTL ? "rtl" : "ltr",
7974
+ items: props.profileMenuItems,
7975
+ onItemSelect: function(e) {
7976
+ return console.log("selecting item ", e);
7977
+ },
7959
7978
  trigger: /* @__PURE__ */ React6.default.createElement("div", {
7960
7979
  className: "relative h-8 w-8 cursor-pointer overflow-clip rounded ring-1 ring-primary/30 dark:bg-gray-600"
7961
7980
  }, props.avatarImage ? /* @__PURE__ */ React6.default.createElement("img", {
@@ -7970,11 +7989,7 @@ var AppLayout = function(_param) {
7970
7989
  fillRule: "evenodd",
7971
7990
  d: "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",
7972
7991
  clipRule: "evenodd"
7973
- }))),
7974
- items: props.profileMenuItems,
7975
- onItemSelect: function(e) {
7976
- return console.log("selecting item ", e);
7977
- }
7992
+ })))
7978
7993
  }))), /* @__PURE__ */ React6.default.createElement("div", {
7979
7994
  className: _clsx2.default.call(void 0, "fixed z-40 flex flex-col justify-between overflow-x-clip transition-all", design === "floating" ? isRTL ? "right-5 top-5" : "bottom-5 left-5 top-5" : isRTL ? "right-0 top-0 h-full" : "left-0 top-0 h-full"),
7980
7995
  style: {
@@ -10074,7 +10089,9 @@ var NewPasswordForm = function(props) {
10074
10089
  setMatchError(true);
10075
10090
  }
10076
10091
  };
10077
- return /* @__PURE__ */ React6.default.createElement(Card, null, matchError && /* @__PURE__ */ React6.default.createElement(HawaAlert, {
10092
+ return /* @__PURE__ */ React6.default.createElement(Card, {
10093
+ dir: props.direction
10094
+ }, matchError && /* @__PURE__ */ React6.default.createElement(HawaAlert, {
10078
10095
  text: props.texts.passwordMatchError,
10079
10096
  severity: "error"
10080
10097
  }), props.passwordChanged ? /* @__PURE__ */ React6.default.createElement(CardContent, {