@sikka/hawa 0.1.95 → 0.1.96
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 +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +62 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -44
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +7 -1
- package/package.json +3 -3
- package/src/blocks/AuthForms/NewPasswordForm.tsx +3 -1
- package/src/elements/DropdownMenu.tsx +103 -60
- package/src/elements/HawaRadio.tsx +3 -2
- package/src/elements/HawaStats.tsx +6 -0
- package/src/elements/HawaTable.tsx +3 -2
- package/src/layout/AppLayout.tsx +4 -2
- package/src/styles.css +7 -1
- package/src/tailwind.css +1 -1
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
|
|
179
|
-
value
|
|
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,7 @@ type TableTypes = {
|
|
|
214
216
|
pagination?: boolean;
|
|
215
217
|
columns: ColTypes[];
|
|
216
218
|
actions?: MenuItemType[];
|
|
219
|
+
actionsWidth?: "default" | "sm" | "lg" | "parent";
|
|
217
220
|
direction?: "rtl" | "ltr";
|
|
218
221
|
rows?: RowTypes[][];
|
|
219
222
|
handleActionClick?: any;
|
|
@@ -365,6 +368,7 @@ type StatTypes = {
|
|
|
365
368
|
color?: string;
|
|
366
369
|
number?: string;
|
|
367
370
|
helperText?: string;
|
|
371
|
+
chart?: any;
|
|
368
372
|
icon?: any;
|
|
369
373
|
variant?: "default" | "plain" | "contained" | "outlined" | "brutalist" | "dropshadow";
|
|
370
374
|
width?: "full" | "min" | "normal";
|
|
@@ -953,6 +957,7 @@ type AppLayoutTypes = {
|
|
|
953
957
|
avatarImage?: any;
|
|
954
958
|
drawerSize?: "sm" | "md" | "large";
|
|
955
959
|
profileMenuItems?: MenuItemType[];
|
|
960
|
+
profileMenuWidth: "default" | "sm" | "lg" | "parent";
|
|
956
961
|
onSettingsClick?: () => void;
|
|
957
962
|
DrawerFooterActions?: any;
|
|
958
963
|
clickedItem?: any;
|
|
@@ -1310,6 +1315,7 @@ declare const SignUpForm: FC<SignUpFormTypes>;
|
|
|
1310
1315
|
|
|
1311
1316
|
type NewPasswordTypes = {
|
|
1312
1317
|
handleNewPassword: () => void;
|
|
1318
|
+
direction?: "rtl" | "ltr";
|
|
1313
1319
|
passwordChanged: any;
|
|
1314
1320
|
texts: {
|
|
1315
1321
|
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
|
|
179
|
-
value
|
|
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,7 @@ type TableTypes = {
|
|
|
214
216
|
pagination?: boolean;
|
|
215
217
|
columns: ColTypes[];
|
|
216
218
|
actions?: MenuItemType[];
|
|
219
|
+
actionsWidth?: "default" | "sm" | "lg" | "parent";
|
|
217
220
|
direction?: "rtl" | "ltr";
|
|
218
221
|
rows?: RowTypes[][];
|
|
219
222
|
handleActionClick?: any;
|
|
@@ -365,6 +368,7 @@ type StatTypes = {
|
|
|
365
368
|
color?: string;
|
|
366
369
|
number?: string;
|
|
367
370
|
helperText?: string;
|
|
371
|
+
chart?: any;
|
|
368
372
|
icon?: any;
|
|
369
373
|
variant?: "default" | "plain" | "contained" | "outlined" | "brutalist" | "dropshadow";
|
|
370
374
|
width?: "full" | "min" | "normal";
|
|
@@ -953,6 +957,7 @@ type AppLayoutTypes = {
|
|
|
953
957
|
avatarImage?: any;
|
|
954
958
|
drawerSize?: "sm" | "md" | "large";
|
|
955
959
|
profileMenuItems?: MenuItemType[];
|
|
960
|
+
profileMenuWidth: "default" | "sm" | "lg" | "parent";
|
|
956
961
|
onSettingsClick?: () => void;
|
|
957
962
|
DrawerFooterActions?: any;
|
|
958
963
|
clickedItem?: any;
|
|
@@ -1310,6 +1315,7 @@ declare const SignUpForm: FC<SignUpFormTypes>;
|
|
|
1310
1315
|
|
|
1311
1316
|
type NewPasswordTypes = {
|
|
1312
1317
|
handleNewPassword: () => void;
|
|
1318
|
+
direction?: "rtl" | "ltr";
|
|
1313
1319
|
passwordChanged: any;
|
|
1314
1320
|
texts: {
|
|
1315
1321
|
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
|
-
|
|
1282
|
-
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
}
|
|
1286
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
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
|
-
|
|
1310
|
-
|
|
1311
|
-
selectCallback
|
|
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
|
-
|
|
1316
|
-
|
|
1317
|
-
}
|
|
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 bg-background "
|
|
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,7 @@ 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:
|
|
1498
|
+
width: props.actionsWidth,
|
|
1488
1499
|
direction: direction,
|
|
1489
1500
|
side: "right",
|
|
1490
1501
|
items: props.actions,
|
|
@@ -4383,7 +4394,9 @@ var HawaStats = function(_param) {
|
|
|
4383
4394
|
className: "mt-2 h-4 w-1/2"
|
|
4384
4395
|
}) : props.helperText && /* @__PURE__ */ React6.default.createElement("p", {
|
|
4385
4396
|
className: "text-xs text-muted-foreground"
|
|
4386
|
-
}, props.helperText)
|
|
4397
|
+
}, props.helperText), props.isLoading && props.chart ? /* @__PURE__ */ React6.default.createElement(Skeleton, {
|
|
4398
|
+
className: "mt-2 h-4 w-1/2"
|
|
4399
|
+
}) : props.chart));
|
|
4387
4400
|
};
|
|
4388
4401
|
// src/elements/HawaCodeBlock.tsx
|
|
4389
4402
|
// src/elements/Tooltip.tsx
|
|
@@ -7955,7 +7968,12 @@ var AppLayout = function(_param) {
|
|
|
7955
7968
|
alignOffset: 8,
|
|
7956
7969
|
side: "bottom",
|
|
7957
7970
|
sideOffset: 5,
|
|
7971
|
+
width: props.profileMenuWidth,
|
|
7958
7972
|
direction: isRTL ? "rtl" : "ltr",
|
|
7973
|
+
items: props.profileMenuItems,
|
|
7974
|
+
onItemSelect: function(e) {
|
|
7975
|
+
return console.log("selecting item ", e);
|
|
7976
|
+
},
|
|
7959
7977
|
trigger: /* @__PURE__ */ React6.default.createElement("div", {
|
|
7960
7978
|
className: "relative h-8 w-8 cursor-pointer overflow-clip rounded ring-1 ring-primary/30 dark:bg-gray-600"
|
|
7961
7979
|
}, props.avatarImage ? /* @__PURE__ */ React6.default.createElement("img", {
|
|
@@ -7970,11 +7988,7 @@ var AppLayout = function(_param) {
|
|
|
7970
7988
|
fillRule: "evenodd",
|
|
7971
7989
|
d: "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",
|
|
7972
7990
|
clipRule: "evenodd"
|
|
7973
|
-
})))
|
|
7974
|
-
items: props.profileMenuItems,
|
|
7975
|
-
onItemSelect: function(e) {
|
|
7976
|
-
return console.log("selecting item ", e);
|
|
7977
|
-
}
|
|
7991
|
+
})))
|
|
7978
7992
|
}))), /* @__PURE__ */ React6.default.createElement("div", {
|
|
7979
7993
|
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
7994
|
style: {
|
|
@@ -10074,7 +10088,9 @@ var NewPasswordForm = function(props) {
|
|
|
10074
10088
|
setMatchError(true);
|
|
10075
10089
|
}
|
|
10076
10090
|
};
|
|
10077
|
-
return /* @__PURE__ */ React6.default.createElement(Card,
|
|
10091
|
+
return /* @__PURE__ */ React6.default.createElement(Card, {
|
|
10092
|
+
dir: props.direction
|
|
10093
|
+
}, matchError && /* @__PURE__ */ React6.default.createElement(HawaAlert, {
|
|
10078
10094
|
text: props.texts.passwordMatchError,
|
|
10079
10095
|
severity: "error"
|
|
10080
10096
|
}), props.passwordChanged ? /* @__PURE__ */ React6.default.createElement(CardContent, {
|