@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.mjs CHANGED
@@ -317,12 +317,13 @@ var HawaRadio = ({
317
317
  props.onChangeTab(opt.value);
318
318
  },
319
319
  className: cn(
320
- "w-full cursor-pointer",
320
+ "w-full cursor-pointer ",
321
321
  orientation === "horizontal" && parentDirection === "ltr" && "rounded-none first:rounded-l last:rounded-r",
322
322
  orientation === "horizontal" && parentDirection === "rtl" && "rounded-none first:rounded-r last:rounded-l",
323
323
  orientation === "vertical" && "rounded-none first:rounded-t last:rounded-b",
324
324
  "last flex flex-row items-center justify-center gap-2 ",
325
325
  selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
326
+ // "bg-red-500"
326
327
  ),
327
328
  key: o
328
329
  },
@@ -1160,6 +1161,7 @@ var DropdownMenu = ({
1160
1161
  align,
1161
1162
  alignOffset,
1162
1163
  selectCallback,
1164
+ size = "default",
1163
1165
  width = "default"
1164
1166
  }) => {
1165
1167
  const widthStyles2 = {
@@ -1168,6 +1170,10 @@ var DropdownMenu = ({
1168
1170
  lg: "w-[200px]",
1169
1171
  parent: "ddm-w-parent"
1170
1172
  };
1173
+ const sizeStyles2 = {
1174
+ default: "px-2 py-3 ",
1175
+ sm: "text-xs px-1.5 py-1.5"
1176
+ };
1171
1177
  return /* @__PURE__ */ React19.createElement(DropdownMenuRoot, { dir: direction }, /* @__PURE__ */ React19.createElement(DropdownMenuTrigger, { className: triggerClassname }, trigger), /* @__PURE__ */ React19.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React19.createElement(
1172
1178
  DropdownMenuContent,
1173
1179
  {
@@ -1178,47 +1184,68 @@ var DropdownMenu = ({
1178
1184
  alignOffset
1179
1185
  },
1180
1186
  items.map((item, index) => {
1181
- return item.subitems ? /* @__PURE__ */ React19.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React19.createElement(DropdownMenuSubTrigger, { dir: direction }, item.icon && item.icon, item.label && item.label), /* @__PURE__ */ React19.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React19.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => /* @__PURE__ */ React19.createElement(
1182
- DropdownMenuItem,
1183
- {
1184
- disabled: subitem.disabled,
1185
- className: "px-2 py-3",
1186
- onSelect: () => {
1187
- subitem.action();
1188
- if (selectCallback) {
1189
- selectCallback(subitem.value);
1190
- }
1187
+ if (item.type === "separator") {
1188
+ return /* @__PURE__ */ React19.createElement(DropdownMenuSeparator, null);
1189
+ } else if (item.type === "label") {
1190
+ return /* @__PURE__ */ React19.createElement(DropdownMenuLabel, null, item.label);
1191
+ } else {
1192
+ return item.subitems ? /* @__PURE__ */ React19.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React19.createElement(
1193
+ DropdownMenuSubTrigger,
1194
+ {
1195
+ className: cn(sizeStyles2[size]),
1196
+ dir: direction
1191
1197
  },
1192
- key: subIndex
1193
- },
1194
- subitem.icon && subitem.icon,
1195
- subitem.label && subitem.label
1196
- ))))) : /* @__PURE__ */ React19.createElement(
1197
- DropdownMenuItem,
1198
- {
1199
- disabled: item.disabled,
1200
- key: index,
1201
- onSelect: (e) => {
1202
- if (item.presist) {
1203
- e.preventDefault();
1204
- }
1205
- if (item.action) {
1206
- item.action();
1198
+ item.icon && item.icon,
1199
+ item.label && item.label
1200
+ ), /* @__PURE__ */ React19.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React19.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => /* @__PURE__ */ React19.createElement(
1201
+ DropdownMenuItem,
1202
+ {
1203
+ className: cn(
1204
+ sizeStyles2[size],
1205
+ !item.icon && !item.label ? "px-0 py-0 focus:bg-transparent" : "focus:bg-accent"
1206
+ ),
1207
+ disabled: subitem.disabled,
1208
+ onSelect: () => {
1209
+ subitem.action();
1207
1210
  if (selectCallback) {
1208
- selectCallback(item.value);
1211
+ selectCallback(subitem.value);
1209
1212
  }
1210
- } else {
1211
- if (selectCallback) {
1212
- selectCallback(item.value);
1213
+ },
1214
+ key: subIndex
1215
+ },
1216
+ subitem.icon && subitem.icon,
1217
+ subitem.label && subitem.label
1218
+ ))))) : /* @__PURE__ */ React19.createElement(
1219
+ DropdownMenuItem,
1220
+ {
1221
+ disabled: item.disabled,
1222
+ key: index,
1223
+ onSelect: (e) => {
1224
+ if (item.presist) {
1225
+ e.preventDefault();
1213
1226
  }
1214
- }
1227
+ if (item.action) {
1228
+ item.action();
1229
+ if (selectCallback) {
1230
+ selectCallback(item.value);
1231
+ }
1232
+ } else {
1233
+ if (selectCallback) {
1234
+ selectCallback(item.value);
1235
+ }
1236
+ }
1237
+ },
1238
+ end: item.end,
1239
+ className: cn(
1240
+ sizeStyles2[size],
1241
+ !item.icon && !item.label ? "px-0 py-0 focus:bg-transparent " : "focus:bg-accent ",
1242
+ item.presist && "focus:bg-transparent"
1243
+ )
1215
1244
  },
1216
- end: item.end,
1217
- className: !item.icon && !item.label ? "px-0 py-0 focus:bg-transparent " : "px-2 py-3 focus:bg-accent "
1218
- },
1219
- item.icon && item.icon,
1220
- item.label && item.label
1221
- );
1245
+ item.icon && item.icon,
1246
+ item.label && item.label
1247
+ );
1248
+ }
1222
1249
  })
1223
1250
  )));
1224
1251
  };
@@ -1292,7 +1319,7 @@ var HawaTable = ({
1292
1319
  useEffect6(() => {
1293
1320
  changePage();
1294
1321
  }, [slice, page]);
1295
- return /* @__PURE__ */ React20.createElement("div", { className: "relative flex flex-col gap-2 " }, /* @__PURE__ */ React20.createElement("div", { className: `overflow-x-auto rounded bg-${headerColor}` }, props.headerTools && /* @__PURE__ */ React20.createElement("div", { className: "flex flex-row items-center justify-between gap-2 border bg-background px-2 py-2" }, props.headerTools), /* @__PURE__ */ React20.createElement(
1322
+ return /* @__PURE__ */ React20.createElement("div", { className: "relative flex flex-col gap-2 " }, /* @__PURE__ */ React20.createElement("div", { className: `overflow-x-auto rounded bg-${headerColor}` }, props.headerTools && /* @__PURE__ */ React20.createElement("div", { className: "flex flex-row items-center justify-between gap-2 border bg-background px-2 py-2" }, props.headerTools), /* @__PURE__ */ React20.createElement(
1296
1323
  "table",
1297
1324
  {
1298
1325
  className: clsx7(
@@ -1399,7 +1426,8 @@ var HawaTable = ({
1399
1426
  /* @__PURE__ */ React20.createElement("div", { className: "flex items-center justify-center" }, /* @__PURE__ */ React20.createElement(
1400
1427
  DropdownMenu,
1401
1428
  {
1402
- width: "sm",
1429
+ width: props.actionsWidth,
1430
+ size: props.actionsSize,
1403
1431
  direction,
1404
1432
  side: "right",
1405
1433
  items: props.actions,
@@ -4161,7 +4189,7 @@ function Skeleton({
4161
4189
 
4162
4190
  // src/elements/HawaStats.tsx
4163
4191
  var HawaStats = ({ variant = "default", ...props }) => {
4164
- return /* @__PURE__ */ React33.createElement(Card, { onClick: props.handleClick, clickable: Boolean(props.handleClick) }, /* @__PURE__ */ React33.createElement(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2" }, /* @__PURE__ */ React33.createElement(CardTitle, { className: "text-sm font-medium" }, props.label), props.icon && props.icon), /* @__PURE__ */ React33.createElement(CardContent, null, props.isLoading ? /* @__PURE__ */ React33.createElement(Skeleton, { className: "h-8 w-3/4" }) : /* @__PURE__ */ React33.createElement("div", { className: "text-2xl font-bold" }, props.number), props.isLoading && props.helperText ? /* @__PURE__ */ React33.createElement(Skeleton, { className: "mt-2 h-4 w-1/2" }) : props.helperText && /* @__PURE__ */ React33.createElement("p", { className: "text-xs text-muted-foreground" }, props.helperText)));
4192
+ return /* @__PURE__ */ React33.createElement(Card, { onClick: props.handleClick, clickable: Boolean(props.handleClick) }, /* @__PURE__ */ React33.createElement(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2" }, /* @__PURE__ */ React33.createElement(CardTitle, { className: "text-sm font-medium" }, props.label), props.icon && props.icon), /* @__PURE__ */ React33.createElement(CardContent, null, props.isLoading ? /* @__PURE__ */ React33.createElement(Skeleton, { className: "h-8 w-3/4" }) : /* @__PURE__ */ React33.createElement("div", { className: "text-2xl font-bold" }, props.number), props.isLoading && props.helperText ? /* @__PURE__ */ React33.createElement(Skeleton, { className: "mt-2 h-4 w-1/2" }) : props.helperText && /* @__PURE__ */ React33.createElement("p", { className: "text-xs text-muted-foreground" }, props.helperText), props.isLoading && props.chart ? /* @__PURE__ */ React33.createElement(Skeleton, { className: "mt-2 h-4 w-1/2" }) : props.chart));
4165
4193
  };
4166
4194
 
4167
4195
  // src/elements/HawaCodeBlock.tsx
@@ -7731,7 +7759,10 @@ var AppLayout = ({
7731
7759
  alignOffset: 8,
7732
7760
  side: "bottom",
7733
7761
  sideOffset: 5,
7762
+ width: props.profileMenuWidth,
7734
7763
  direction: isRTL ? "rtl" : "ltr",
7764
+ items: props.profileMenuItems,
7765
+ onItemSelect: (e) => console.log("selecting item ", e),
7735
7766
  trigger: /* @__PURE__ */ React78.createElement("div", { className: "relative h-8 w-8 cursor-pointer overflow-clip rounded ring-1 ring-primary/30 dark:bg-gray-600" }, props.avatarImage ? /* @__PURE__ */ React78.createElement("img", { src: props.avatarImage, alt: "User Avatar" }) : /* @__PURE__ */ React78.createElement(
7736
7767
  "svg",
7737
7768
  {
@@ -7748,9 +7779,7 @@ var AppLayout = ({
7748
7779
  clipRule: "evenodd"
7749
7780
  }
7750
7781
  )
7751
- )),
7752
- items: props.profileMenuItems,
7753
- onItemSelect: (e) => console.log("selecting item ", e)
7782
+ ))
7754
7783
  }
7755
7784
  )
7756
7785
  )
@@ -9854,7 +9883,7 @@ var NewPasswordForm = (props) => {
9854
9883
  setMatchError(true);
9855
9884
  }
9856
9885
  };
9857
- return /* @__PURE__ */ React91.createElement(Card, null, matchError && /* @__PURE__ */ React91.createElement(HawaAlert, { text: props.texts.passwordMatchError, severity: "error" }), props.passwordChanged ? /* @__PURE__ */ React91.createElement(CardContent, { headless: true }, /* @__PURE__ */ React91.createElement("div", { className: "text-center" }, props.texts.passwordChanged)) : /* @__PURE__ */ React91.createElement(FormProvider3, { ...methods }, /* @__PURE__ */ React91.createElement("form", { onSubmit: handleSubmit(handleSubmission) }, /* @__PURE__ */ React91.createElement(CardHeader, null, /* @__PURE__ */ React91.createElement(CardTitle, null, "Create Password"), /* @__PURE__ */ React91.createElement(CardDescription, null, "Set a new password for your account")), /* @__PURE__ */ React91.createElement(CardContent, null, /* @__PURE__ */ React91.createElement(
9886
+ return /* @__PURE__ */ React91.createElement(Card, { dir: props.direction }, matchError && /* @__PURE__ */ React91.createElement(HawaAlert, { text: props.texts.passwordMatchError, severity: "error" }), props.passwordChanged ? /* @__PURE__ */ React91.createElement(CardContent, { headless: true }, /* @__PURE__ */ React91.createElement("div", { className: "text-center" }, props.texts.passwordChanged)) : /* @__PURE__ */ React91.createElement(FormProvider3, { ...methods }, /* @__PURE__ */ React91.createElement("form", { onSubmit: handleSubmit(handleSubmission) }, /* @__PURE__ */ React91.createElement(CardHeader, null, /* @__PURE__ */ React91.createElement(CardTitle, null, "Create Password"), /* @__PURE__ */ React91.createElement(CardDescription, null, "Set a new password for your account")), /* @__PURE__ */ React91.createElement(CardContent, null, /* @__PURE__ */ React91.createElement(
9858
9887
  Controller5,
9859
9888
  {
9860
9889
  control,