@sikka/hawa 0.1.103 → 0.1.105
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 +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +127 -93
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +320 -302
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +6 -0
- package/package.json +1 -1
- package/src/blocks/AuthForms/NewPasswordForm.tsx +10 -8
- package/src/elements/HawaCodeBlock.tsx +9 -19
- package/src/elements/HawaTable.tsx +198 -187
- package/src/elements/HawaTextField.tsx +40 -32
- package/src/hooks/useClipboard.ts +32 -0
- package/src/hooks/useFocusWithin.ts +80 -0
- package/src/hooks/useFullscreen.ts +123 -0
- package/src/hooks/useMediaQuery.ts +65 -0
- package/src/hooks/useWindowEvent.ts +14 -0
- package/src/hooks/useWindowScroll.ts +42 -0
- package/src/styles.css +6 -0
package/dist/index.d.mts
CHANGED
|
@@ -214,6 +214,7 @@ type ColTypes = {
|
|
|
214
214
|
};
|
|
215
215
|
type TableTypes = {
|
|
216
216
|
pagination?: boolean;
|
|
217
|
+
isLoading?: boolean;
|
|
217
218
|
columns: ColTypes[];
|
|
218
219
|
actions?: MenuItemType[];
|
|
219
220
|
actionsWidth?: "default" | "sm" | "lg" | "parent";
|
|
@@ -598,6 +599,7 @@ type StepTypes = {
|
|
|
598
599
|
declare const Timeline: FC<TimelineTypes>;
|
|
599
600
|
|
|
600
601
|
type TextFieldTypes = {
|
|
602
|
+
isLoading?: boolean;
|
|
601
603
|
margin?: "none" | "normal" | "large";
|
|
602
604
|
width?: "small" | "normal" | "full";
|
|
603
605
|
/** The label of the input field */
|
|
@@ -1301,6 +1303,7 @@ declare const SignUpForm: FC<SignUpFormTypes>;
|
|
|
1301
1303
|
type NewPasswordTypes = {
|
|
1302
1304
|
handleNewPassword: () => void;
|
|
1303
1305
|
direction?: "rtl" | "ltr";
|
|
1306
|
+
headless?: boolean;
|
|
1304
1307
|
passwordChanged: any;
|
|
1305
1308
|
texts: {
|
|
1306
1309
|
passwordPlaceholder: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -214,6 +214,7 @@ type ColTypes = {
|
|
|
214
214
|
};
|
|
215
215
|
type TableTypes = {
|
|
216
216
|
pagination?: boolean;
|
|
217
|
+
isLoading?: boolean;
|
|
217
218
|
columns: ColTypes[];
|
|
218
219
|
actions?: MenuItemType[];
|
|
219
220
|
actionsWidth?: "default" | "sm" | "lg" | "parent";
|
|
@@ -598,6 +599,7 @@ type StepTypes = {
|
|
|
598
599
|
declare const Timeline: FC<TimelineTypes>;
|
|
599
600
|
|
|
600
601
|
type TextFieldTypes = {
|
|
602
|
+
isLoading?: boolean;
|
|
601
603
|
margin?: "none" | "normal" | "large";
|
|
602
604
|
width?: "small" | "normal" | "full";
|
|
603
605
|
/** The label of the input field */
|
|
@@ -1301,6 +1303,7 @@ declare const SignUpForm: FC<SignUpFormTypes>;
|
|
|
1301
1303
|
type NewPasswordTypes = {
|
|
1302
1304
|
handleNewPassword: () => void;
|
|
1303
1305
|
direction?: "rtl" | "ltr";
|
|
1306
|
+
headless?: boolean;
|
|
1304
1307
|
passwordChanged: any;
|
|
1305
1308
|
texts: {
|
|
1306
1309
|
passwordPlaceholder: string;
|
package/dist/index.js
CHANGED
|
@@ -216,10 +216,10 @@ function _optionalChain(ops) {
|
|
|
216
216
|
} // src/elements/HawaCheckbox.tsx
|
|
217
217
|
var _react = require("react");
|
|
218
218
|
var React6 = _interopRequireWildcard(_react);
|
|
219
|
-
var
|
|
220
|
-
var
|
|
221
|
-
var
|
|
222
|
-
var
|
|
219
|
+
var React13 = _interopRequireWildcard(_react);
|
|
220
|
+
var React17 = _interopRequireWildcard(_react);
|
|
221
|
+
var React20 = _interopRequireWildcard(_react);
|
|
222
|
+
var React30 = _interopRequireWildcard(_react);
|
|
223
223
|
var React58 = _interopRequireWildcard(_react);
|
|
224
224
|
var React61 = _interopRequireWildcard(_react);
|
|
225
225
|
var React63 = _interopRequireWildcard(_react);
|
|
@@ -354,6 +354,15 @@ var Label = React6.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
|
354
354
|
}, props));
|
|
355
355
|
});
|
|
356
356
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
357
|
+
// src/elements/Skeleton.tsx
|
|
358
|
+
function Skeleton(_param) {
|
|
359
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
360
|
+
"className"
|
|
361
|
+
]);
|
|
362
|
+
return /* @__PURE__ */ React6.default.createElement("div", _object_spread({
|
|
363
|
+
className: cn("animate-pulse rounded-md bg-muted", className)
|
|
364
|
+
}, props));
|
|
365
|
+
}
|
|
357
366
|
// src/elements/HawaTextField.tsx
|
|
358
367
|
var HawaTextField = function(_param) {
|
|
359
368
|
var _param_margin = _param.margin, margin = _param_margin === void 0 ? "normal" : _param_margin, _param_width = _param.width, width = _param_width === void 0 ? "full" : _param_width, _param_preview = _param.preview, preview = _param_preview === void 0 ? false : _param_preview, props = _object_without_properties(_param, [
|
|
@@ -376,7 +385,9 @@ var HawaTextField = function(_param) {
|
|
|
376
385
|
var previewInputStyle = "block w-full rounded bg-gray-50 p-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500";
|
|
377
386
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
378
387
|
className: cn(defaultStyle, marginStyles[margin], widthStyles2[width])
|
|
379
|
-
}, props.label && /* @__PURE__ */ React6.default.createElement(Label, null, props.label), /* @__PURE__ */ React6.default.createElement(
|
|
388
|
+
}, props.label && /* @__PURE__ */ React6.default.createElement(Label, null, props.label), props.isLoading ? /* @__PURE__ */ React6.default.createElement(Skeleton, {
|
|
389
|
+
className: "h-[38px] w-full"
|
|
390
|
+
}) : /* @__PURE__ */ React6.default.createElement(React6.default.Fragment, null, /* @__PURE__ */ React6.default.createElement("div", {
|
|
380
391
|
className: cn("absolute top-[22px] h-[0.8px] w-full bg-gray-200 transition-all dark:bg-gray-800", preview ? "opacity-100" : "opacity-0")
|
|
381
392
|
}), /* @__PURE__ */ React6.default.createElement(React6.default.Fragment, null, /* @__PURE__ */ React6.default.createElement("div", {
|
|
382
393
|
className: cn("relative")
|
|
@@ -389,7 +400,7 @@ var HawaTextField = function(_param) {
|
|
|
389
400
|
className: "absolute right-1 top-[41px] -translate-y-1/2"
|
|
390
401
|
}, props.iconInside), props.helpertext ? /* @__PURE__ */ React6.default.createElement("p", {
|
|
391
402
|
className: "mb-0 mt-0 text-xs text-red-600 dark:text-red-500"
|
|
392
|
-
}, props.helpertext) : null));
|
|
403
|
+
}, props.helpertext) : null)));
|
|
393
404
|
};
|
|
394
405
|
// src/elements/HawaColorPicker.tsx
|
|
395
406
|
var HawaColorPicker = function(props) {
|
|
@@ -749,30 +760,30 @@ var thumbSize = {
|
|
|
749
760
|
default: "h-[21px] w-[21px]",
|
|
750
761
|
sm: "h-[16px] w-[16px]"
|
|
751
762
|
};
|
|
752
|
-
var Switch =
|
|
763
|
+
var Switch = React13.forwardRef(function(_param, ref) {
|
|
753
764
|
var className = _param.className, _param_size = _param.size, size = _param_size === void 0 ? "default" : _param_size, label = _param.label, props = _object_without_properties(_param, [
|
|
754
765
|
"className",
|
|
755
766
|
"size",
|
|
756
767
|
"label"
|
|
757
768
|
]);
|
|
758
|
-
var
|
|
759
|
-
var parentRef =
|
|
760
|
-
|
|
769
|
+
var _React13_useState = _sliced_to_array(React13.useState(null), 2), parentDirection = _React13_useState[0], setParentDirection = _React13_useState[1];
|
|
770
|
+
var parentRef = React13.useRef(null);
|
|
771
|
+
React13.useEffect(function() {
|
|
761
772
|
if (parentRef.current && parentRef.current.parentNode) {
|
|
762
773
|
var dir = window.getComputedStyle(parentRef.current.parentNode).direction;
|
|
763
774
|
setParentDirection(dir);
|
|
764
775
|
}
|
|
765
776
|
});
|
|
766
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
767
778
|
className: "flex flex-row items-center",
|
|
768
779
|
ref: parentRef
|
|
769
|
-
}, /* @__PURE__ */
|
|
780
|
+
}, /* @__PURE__ */ React13.createElement(SwitchPrimitives.Root, _object_spread_props(_object_spread({
|
|
770
781
|
className: cn("relative cursor-pointer rounded-full bg-primary/20 outline-none data-[state=checked]:bg-primary", className, rootSize[size])
|
|
771
782
|
}, props), {
|
|
772
783
|
ref: ref
|
|
773
|
-
}), /* @__PURE__ */
|
|
784
|
+
}), /* @__PURE__ */ React13.createElement(SwitchPrimitives.Thumb, {
|
|
774
785
|
className: cn(thumbSize[size], "block rounded-full bg-white transition-transform duration-100 will-change-transform data-[state=checked]:bg-primary-foreground dark:bg-background", parentDirection === "rtl" ? "-translate-x-0.5 data-[state=checked]:-translate-x-[19px]" : "translate-x-0.5 data-[state=checked]:translate-x-[19px]")
|
|
775
|
-
})), label && /* @__PURE__ */
|
|
786
|
+
})), label && /* @__PURE__ */ React13.createElement("span", {
|
|
776
787
|
className: "mx-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
777
788
|
}, label));
|
|
778
789
|
});
|
|
@@ -873,7 +884,7 @@ var buttonVariants = _classvarianceauthority.cva.call(void 0, "inline-flex items
|
|
|
873
884
|
size: "default"
|
|
874
885
|
}
|
|
875
886
|
});
|
|
876
|
-
var Button =
|
|
887
|
+
var Button = React17.forwardRef(function(_param, ref) {
|
|
877
888
|
var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, isLoading = _param.isLoading, children = _param.children, props = _object_without_properties(_param, [
|
|
878
889
|
"className",
|
|
879
890
|
"variant",
|
|
@@ -884,14 +895,14 @@ var Button = React16.forwardRef(function(_param, ref) {
|
|
|
884
895
|
]);
|
|
885
896
|
var Comp = "button";
|
|
886
897
|
var loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "bg-primary" : "bg-primary-foreground";
|
|
887
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ React17.createElement(Comp, _object_spread({
|
|
888
899
|
className: cn(buttonVariants({
|
|
889
900
|
variant: variant,
|
|
890
901
|
size: size,
|
|
891
902
|
className: className
|
|
892
903
|
})),
|
|
893
904
|
ref: ref
|
|
894
|
-
}, props), isLoading ? /* @__PURE__ */
|
|
905
|
+
}, props), isLoading ? /* @__PURE__ */ React17.createElement(HawaLoading, {
|
|
895
906
|
design: "dots-pulse",
|
|
896
907
|
color: loadingColor,
|
|
897
908
|
size: "button"
|
|
@@ -1112,18 +1123,18 @@ var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
|
|
1112
1123
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1113
1124
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
1114
1125
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1115
|
-
var DropdownMenuSubTrigger =
|
|
1126
|
+
var DropdownMenuSubTrigger = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1116
1127
|
var className = _param.className, inset = _param.inset, children = _param.children, props = _object_without_properties(_param, [
|
|
1117
1128
|
"className",
|
|
1118
1129
|
"inset",
|
|
1119
1130
|
"children"
|
|
1120
1131
|
]);
|
|
1121
|
-
return
|
|
1132
|
+
return React20.createElement(DropdownMenuPrimitive.SubTrigger, _object_spread({
|
|
1122
1133
|
ref: ref,
|
|
1123
1134
|
className: cn("flex cursor-default select-none items-center justify-between rounded-sm px-2 py-3 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className)
|
|
1124
|
-
}, props), /* @__PURE__ */
|
|
1135
|
+
}, props), /* @__PURE__ */ React20.createElement("div", {
|
|
1125
1136
|
className: "flex flex-row items-center gap-2"
|
|
1126
|
-
}, children), " ", /* @__PURE__ */
|
|
1137
|
+
}, children), " ", /* @__PURE__ */ React20.createElement("svg", {
|
|
1127
1138
|
"aria-label": "Chevron Right Icon",
|
|
1128
1139
|
stroke: "currentColor",
|
|
1129
1140
|
fill: "currentColor",
|
|
@@ -1132,61 +1143,61 @@ var DropdownMenuSubTrigger = React19.forwardRef(function(_param, ref) /* @__PURE
|
|
|
1132
1143
|
height: "1em",
|
|
1133
1144
|
width: "1em",
|
|
1134
1145
|
className: cn(props.dir === "rtl" ? "rotate-180" : "")
|
|
1135
|
-
}, /* @__PURE__ */
|
|
1146
|
+
}, /* @__PURE__ */ React20.createElement("path", {
|
|
1136
1147
|
fillRule: "evenodd",
|
|
1137
1148
|
d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
1138
1149
|
})));
|
|
1139
1150
|
});
|
|
1140
1151
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1141
|
-
var DropdownMenuSubContent =
|
|
1152
|
+
var DropdownMenuSubContent = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1142
1153
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1143
1154
|
"className"
|
|
1144
1155
|
]);
|
|
1145
|
-
return
|
|
1156
|
+
return React20.createElement(DropdownMenuPrimitive.SubContent, _object_spread({
|
|
1146
1157
|
ref: ref,
|
|
1147
1158
|
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
1148
1159
|
}, props));
|
|
1149
1160
|
});
|
|
1150
1161
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1151
|
-
var DropdownMenuContent =
|
|
1162
|
+
var DropdownMenuContent = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1152
1163
|
var className = _param.className, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
|
|
1153
1164
|
"className",
|
|
1154
1165
|
"sideOffset"
|
|
1155
1166
|
]);
|
|
1156
|
-
return
|
|
1167
|
+
return React20.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React20.createElement(DropdownMenuPrimitive.Content, _object_spread({
|
|
1157
1168
|
ref: ref,
|
|
1158
1169
|
sideOffset: sideOffset,
|
|
1159
1170
|
className: cn("z-50 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
1160
1171
|
}, props)));
|
|
1161
1172
|
});
|
|
1162
1173
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1163
|
-
var DropdownMenuItem =
|
|
1174
|
+
var DropdownMenuItem = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1164
1175
|
var className = _param.className, inset = _param.inset, props = _object_without_properties(_param, [
|
|
1165
1176
|
"className",
|
|
1166
1177
|
"inset"
|
|
1167
1178
|
]);
|
|
1168
|
-
return
|
|
1179
|
+
return React20.createElement(DropdownMenuPrimitive.Item, _object_spread({
|
|
1169
1180
|
disabled: props.disabled,
|
|
1170
1181
|
ref: ref,
|
|
1171
1182
|
className: cn("relative flex cursor-pointer select-none items-center justify-between rounded-sm text-sm outline-none transition-colors focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className)
|
|
1172
|
-
}, props), /* @__PURE__ */
|
|
1183
|
+
}, props), /* @__PURE__ */ React20.createElement("div", {
|
|
1173
1184
|
className: "flex flex-row items-center gap-2 "
|
|
1174
1185
|
}, props.children), props.end && props.end);
|
|
1175
1186
|
});
|
|
1176
1187
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1177
|
-
var DropdownMenuCheckboxItem =
|
|
1188
|
+
var DropdownMenuCheckboxItem = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1178
1189
|
var className = _param.className, children = _param.children, checked = _param.checked, props = _object_without_properties(_param, [
|
|
1179
1190
|
"className",
|
|
1180
1191
|
"children",
|
|
1181
1192
|
"checked"
|
|
1182
1193
|
]);
|
|
1183
|
-
return
|
|
1194
|
+
return React20.createElement(DropdownMenuPrimitive.CheckboxItem, _object_spread({
|
|
1184
1195
|
ref: ref,
|
|
1185
1196
|
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
1186
1197
|
checked: checked
|
|
1187
|
-
}, props), /* @__PURE__ */
|
|
1198
|
+
}, props), /* @__PURE__ */ React20.createElement("span", {
|
|
1188
1199
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
|
|
1189
|
-
}, /* @__PURE__ */
|
|
1200
|
+
}, /* @__PURE__ */ React20.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React20.createElement("svg", {
|
|
1190
1201
|
"aria-label": "Check Mark",
|
|
1191
1202
|
stroke: "currentColor",
|
|
1192
1203
|
fill: "currentColor",
|
|
@@ -1194,22 +1205,22 @@ var DropdownMenuCheckboxItem = React19.forwardRef(function(_param, ref) /* @__PU
|
|
|
1194
1205
|
viewBox: "0 0 512 512",
|
|
1195
1206
|
height: "0.60em",
|
|
1196
1207
|
width: "0.60em"
|
|
1197
|
-
}, /* @__PURE__ */
|
|
1208
|
+
}, /* @__PURE__ */ React20.createElement("path", {
|
|
1198
1209
|
d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
|
|
1199
1210
|
})), " ")), children);
|
|
1200
1211
|
});
|
|
1201
1212
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1202
|
-
var DropdownMenuRadioItem =
|
|
1213
|
+
var DropdownMenuRadioItem = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1203
1214
|
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
1204
1215
|
"className",
|
|
1205
1216
|
"children"
|
|
1206
1217
|
]);
|
|
1207
|
-
return
|
|
1218
|
+
return React20.createElement(DropdownMenuPrimitive.RadioItem, _object_spread({
|
|
1208
1219
|
ref: ref,
|
|
1209
1220
|
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)
|
|
1210
|
-
}, props), /* @__PURE__ */
|
|
1221
|
+
}, props), /* @__PURE__ */ React20.createElement("span", {
|
|
1211
1222
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
|
|
1212
|
-
}, /* @__PURE__ */
|
|
1223
|
+
}, /* @__PURE__ */ React20.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React20.createElement("svg", {
|
|
1213
1224
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1214
1225
|
width: "24",
|
|
1215
1226
|
"aria-label": "Circle",
|
|
@@ -1221,29 +1232,29 @@ var DropdownMenuRadioItem = React19.forwardRef(function(_param, ref) /* @__PURE_
|
|
|
1221
1232
|
strokeLinecap: "round",
|
|
1222
1233
|
strokeLinejoin: "round",
|
|
1223
1234
|
className: "h-2 w-2 fill-current"
|
|
1224
|
-
}, /* @__PURE__ */
|
|
1235
|
+
}, /* @__PURE__ */ React20.createElement("circle", {
|
|
1225
1236
|
cx: "12",
|
|
1226
1237
|
cy: "12",
|
|
1227
1238
|
r: "10"
|
|
1228
1239
|
})))), children);
|
|
1229
1240
|
});
|
|
1230
1241
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1231
|
-
var DropdownMenuLabel =
|
|
1242
|
+
var DropdownMenuLabel = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1232
1243
|
var className = _param.className, inset = _param.inset, props = _object_without_properties(_param, [
|
|
1233
1244
|
"className",
|
|
1234
1245
|
"inset"
|
|
1235
1246
|
]);
|
|
1236
|
-
return
|
|
1247
|
+
return React20.createElement(DropdownMenuPrimitive.Label, _object_spread({
|
|
1237
1248
|
ref: ref,
|
|
1238
1249
|
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)
|
|
1239
1250
|
}, props));
|
|
1240
1251
|
});
|
|
1241
1252
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1242
|
-
var DropdownMenuSeparator =
|
|
1253
|
+
var DropdownMenuSeparator = React20.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
1243
1254
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1244
1255
|
"className"
|
|
1245
1256
|
]);
|
|
1246
|
-
return
|
|
1257
|
+
return React20.createElement(DropdownMenuPrimitive.Separator, _object_spread({
|
|
1247
1258
|
ref: ref,
|
|
1248
1259
|
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
1249
1260
|
}, props));
|
|
@@ -1253,7 +1264,7 @@ var DropdownMenuShortcut = function(_param) {
|
|
|
1253
1264
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1254
1265
|
"className"
|
|
1255
1266
|
]);
|
|
1256
|
-
return /* @__PURE__ */
|
|
1267
|
+
return /* @__PURE__ */ React20.createElement("span", _object_spread({
|
|
1257
1268
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className)
|
|
1258
1269
|
}, props));
|
|
1259
1270
|
};
|
|
@@ -1270,11 +1281,11 @@ var DropdownMenu = function(param) {
|
|
|
1270
1281
|
default: "px-2 py-3 ",
|
|
1271
1282
|
sm: "text-xs px-1.5 py-1.5"
|
|
1272
1283
|
};
|
|
1273
|
-
return /* @__PURE__ */
|
|
1284
|
+
return /* @__PURE__ */ React20.createElement(DropdownMenuRoot, {
|
|
1274
1285
|
dir: direction
|
|
1275
|
-
}, /* @__PURE__ */
|
|
1286
|
+
}, /* @__PURE__ */ React20.createElement(DropdownMenuTrigger, {
|
|
1276
1287
|
className: triggerClassname
|
|
1277
|
-
}, trigger), /* @__PURE__ */
|
|
1288
|
+
}, trigger), /* @__PURE__ */ React20.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React20.createElement(DropdownMenuContent, {
|
|
1278
1289
|
side: side,
|
|
1279
1290
|
sideOffset: sideOffset,
|
|
1280
1291
|
className: cn(className, widthStyles2[width], "flex flex-col gap-2"),
|
|
@@ -1282,17 +1293,17 @@ var DropdownMenu = function(param) {
|
|
|
1282
1293
|
alignOffset: alignOffset
|
|
1283
1294
|
}, items.map(function(item, index) {
|
|
1284
1295
|
if (item.type === "separator") {
|
|
1285
|
-
return /* @__PURE__ */
|
|
1296
|
+
return /* @__PURE__ */ React20.createElement(DropdownMenuSeparator, null);
|
|
1286
1297
|
} else if (item.type === "label") {
|
|
1287
|
-
return /* @__PURE__ */
|
|
1298
|
+
return /* @__PURE__ */ React20.createElement(DropdownMenuLabel, null, item.label);
|
|
1288
1299
|
} else {
|
|
1289
|
-
return item.subitems ? /* @__PURE__ */
|
|
1300
|
+
return item.subitems ? /* @__PURE__ */ React20.createElement(DropdownMenuSub, {
|
|
1290
1301
|
key: index
|
|
1291
|
-
}, /* @__PURE__ */
|
|
1302
|
+
}, /* @__PURE__ */ React20.createElement(DropdownMenuSubTrigger, {
|
|
1292
1303
|
className: cn(sizeStyles2[size]),
|
|
1293
1304
|
dir: direction
|
|
1294
|
-
}, item.icon && item.icon, item.label && item.label), /* @__PURE__ */
|
|
1295
|
-
return /* @__PURE__ */
|
|
1305
|
+
}, item.icon && item.icon, item.label && item.label), /* @__PURE__ */ React20.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React20.createElement(DropdownMenuSubContent, null, item.subitems.map(function(subitem, subIndex) {
|
|
1306
|
+
return /* @__PURE__ */ React20.createElement(DropdownMenuItem, {
|
|
1296
1307
|
className: cn(sizeStyles2[size], !item.icon && !item.label ? "px-0 py-0 focus:bg-transparent" : "focus:bg-accent"),
|
|
1297
1308
|
disabled: subitem.disabled,
|
|
1298
1309
|
onSelect: function() {
|
|
@@ -1303,7 +1314,7 @@ var DropdownMenu = function(param) {
|
|
|
1303
1314
|
},
|
|
1304
1315
|
key: subIndex
|
|
1305
1316
|
}, subitem.icon && subitem.icon, subitem.label && subitem.label);
|
|
1306
|
-
})))) : /* @__PURE__ */
|
|
1317
|
+
})))) : /* @__PURE__ */ React20.createElement(DropdownMenuItem, {
|
|
1307
1318
|
disabled: item.disabled,
|
|
1308
1319
|
key: index,
|
|
1309
1320
|
onSelect: function(e) {
|
|
@@ -1396,7 +1407,10 @@ var HawaTable = function(_param) {
|
|
|
1396
1407
|
]);
|
|
1397
1408
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
1398
1409
|
className: "relative flex flex-col gap-2 "
|
|
1399
|
-
},
|
|
1410
|
+
}, props.isLoading ? // <div>dd</div>
|
|
1411
|
+
/* @__PURE__ */ React6.default.createElement(Skeleton, {
|
|
1412
|
+
className: "h-[105px] w-full"
|
|
1413
|
+
}) : /* @__PURE__ */ React6.default.createElement(React6.default.Fragment, null, /* @__PURE__ */ React6.default.createElement("div", {
|
|
1400
1414
|
className: "overflow-x-auto rounded bg-".concat(headerColor)
|
|
1401
1415
|
}, props.headerTools && /* @__PURE__ */ React6.default.createElement("div", {
|
|
1402
1416
|
className: "flex flex-row items-center justify-between gap-2 border bg-background px-2 py-2"
|
|
@@ -1540,7 +1554,7 @@ var HawaTable = function(_param) {
|
|
|
1540
1554
|
}
|
|
1541
1555
|
]), function() {
|
|
1542
1556
|
return "No Data";
|
|
1543
|
-
}))))))), pagination && /* @__PURE__ */ React6.default.createElement("div", {
|
|
1557
|
+
})))))))), pagination && /* @__PURE__ */ React6.default.createElement("div", {
|
|
1544
1558
|
className: "flex flex-row items-center justify-between "
|
|
1545
1559
|
}, range.length > 1 ? /* @__PURE__ */ React6.default.createElement("div", {
|
|
1546
1560
|
className: "flex w-fit flex-row items-stretch justify-center gap-2 overflow-clip rounded "
|
|
@@ -4010,77 +4024,68 @@ var HawaStepper = function(_param) {
|
|
|
4010
4024
|
};
|
|
4011
4025
|
// src/elements/HawaStats.tsx
|
|
4012
4026
|
// src/elements/Card.tsx
|
|
4013
|
-
var Card =
|
|
4027
|
+
var Card = React30.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
4014
4028
|
var className = _param.className, _param_clickable = _param.clickable, clickable = _param_clickable === void 0 ? false : _param_clickable, props = _object_without_properties(_param, [
|
|
4015
4029
|
"className",
|
|
4016
4030
|
"clickable"
|
|
4017
4031
|
]);
|
|
4018
|
-
return
|
|
4032
|
+
return React30.createElement("div", _object_spread({
|
|
4019
4033
|
ref: ref,
|
|
4020
4034
|
className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", clickable && "cursor-pointer transition-all hover:drop-shadow-md dark:hover:shadow-dark", className)
|
|
4021
4035
|
}, props));
|
|
4022
4036
|
});
|
|
4023
4037
|
Card.displayName = "Card";
|
|
4024
|
-
var CardHeader =
|
|
4038
|
+
var CardHeader = React30.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
4025
4039
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
4026
4040
|
"className"
|
|
4027
4041
|
]);
|
|
4028
|
-
return
|
|
4042
|
+
return React30.createElement("div", _object_spread({
|
|
4029
4043
|
ref: ref,
|
|
4030
4044
|
className: cn("flex flex-col space-y-1.5 p-6", className)
|
|
4031
4045
|
}, props));
|
|
4032
4046
|
});
|
|
4033
4047
|
CardHeader.displayName = "CardHeader";
|
|
4034
|
-
var CardTitle =
|
|
4048
|
+
var CardTitle = React30.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
4035
4049
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
4036
4050
|
"className"
|
|
4037
4051
|
]);
|
|
4038
|
-
return
|
|
4052
|
+
return React30.createElement("h3", _object_spread({
|
|
4039
4053
|
ref: ref,
|
|
4040
4054
|
className: cn("text-2xl font-semibold leading-none tracking-tight", className)
|
|
4041
4055
|
}, props));
|
|
4042
4056
|
});
|
|
4043
4057
|
CardTitle.displayName = "CardTitle";
|
|
4044
|
-
var CardDescription =
|
|
4058
|
+
var CardDescription = React30.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
4045
4059
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
4046
4060
|
"className"
|
|
4047
4061
|
]);
|
|
4048
|
-
return
|
|
4062
|
+
return React30.createElement("p", _object_spread({
|
|
4049
4063
|
ref: ref,
|
|
4050
4064
|
className: cn("text-sm text-muted-foreground", className)
|
|
4051
4065
|
}, props));
|
|
4052
4066
|
});
|
|
4053
4067
|
CardDescription.displayName = "CardDescription";
|
|
4054
|
-
var CardContent =
|
|
4068
|
+
var CardContent = React30.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
4055
4069
|
var headless = _param.headless, className = _param.className, props = _object_without_properties(_param, [
|
|
4056
4070
|
"headless",
|
|
4057
4071
|
"className"
|
|
4058
4072
|
]);
|
|
4059
|
-
return
|
|
4073
|
+
return React30.createElement("div", _object_spread({
|
|
4060
4074
|
ref: ref,
|
|
4061
4075
|
className: cn("p-6", headless ? "pt-6" : "pt-0", className)
|
|
4062
4076
|
}, props));
|
|
4063
4077
|
});
|
|
4064
4078
|
CardContent.displayName = "CardContent";
|
|
4065
|
-
var CardFooter =
|
|
4079
|
+
var CardFooter = React30.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
4066
4080
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
4067
4081
|
"className"
|
|
4068
4082
|
]);
|
|
4069
|
-
return
|
|
4083
|
+
return React30.createElement("div", _object_spread({
|
|
4070
4084
|
ref: ref,
|
|
4071
4085
|
className: cn("flex items-center p-6 pt-0", className)
|
|
4072
4086
|
}, props));
|
|
4073
4087
|
});
|
|
4074
4088
|
CardFooter.displayName = "CardFooter";
|
|
4075
|
-
// src/elements/Skeleton.tsx
|
|
4076
|
-
function Skeleton(_param) {
|
|
4077
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
4078
|
-
"className"
|
|
4079
|
-
]);
|
|
4080
|
-
return /* @__PURE__ */ React6.default.createElement("div", _object_spread({
|
|
4081
|
-
className: cn("animate-pulse rounded-md bg-muted", className)
|
|
4082
|
-
}, props));
|
|
4083
|
-
}
|
|
4084
4089
|
// src/elements/HawaStats.tsx
|
|
4085
4090
|
var HawaStats = function(_param) {
|
|
4086
4091
|
var _param_variant = _param.variant, variant = _param_variant === void 0 ? "default" : _param_variant, props = _object_without_properties(_param, [
|
|
@@ -4154,32 +4159,60 @@ var Tooltip = function(_param) {
|
|
|
4154
4159
|
align: "center"
|
|
4155
4160
|
}, props), content)));
|
|
4156
4161
|
};
|
|
4162
|
+
// src/hooks/useClipboard.ts
|
|
4163
|
+
function useClipboard() {
|
|
4164
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_timeout = _ref.timeout, timeout = _ref_timeout === void 0 ? 2e3 : _ref_timeout;
|
|
4165
|
+
var _react_useState_call = _sliced_to_array(_react.useState.call(void 0, null), 2), error = _react_useState_call[0], setError = _react_useState_call[1];
|
|
4166
|
+
var _react_useState_call1 = _sliced_to_array(_react.useState.call(void 0, false), 2), copied = _react_useState_call1[0], setCopied = _react_useState_call1[1];
|
|
4167
|
+
var _react_useState_call2 = _sliced_to_array(_react.useState.call(void 0, null), 2), copyTimeout = _react_useState_call2[0], setCopyTimeout = _react_useState_call2[1];
|
|
4168
|
+
var handleCopyResult = function(value) {
|
|
4169
|
+
clearTimeout(copyTimeout);
|
|
4170
|
+
setCopyTimeout(setTimeout(function() {
|
|
4171
|
+
return setCopied(false);
|
|
4172
|
+
}, timeout));
|
|
4173
|
+
setCopied(value);
|
|
4174
|
+
};
|
|
4175
|
+
var copy = function(valueToCopy) {
|
|
4176
|
+
if ("clipboard" in navigator) {
|
|
4177
|
+
navigator.clipboard.writeText(valueToCopy).then(function() {
|
|
4178
|
+
return handleCopyResult(true);
|
|
4179
|
+
}).catch(function(err) {
|
|
4180
|
+
return setError(err);
|
|
4181
|
+
});
|
|
4182
|
+
} else {
|
|
4183
|
+
setError(new Error("useClipboard: navigator.clipboard is not supported"));
|
|
4184
|
+
}
|
|
4185
|
+
};
|
|
4186
|
+
var reset = function() {
|
|
4187
|
+
setCopied(false);
|
|
4188
|
+
setError(null);
|
|
4189
|
+
clearTimeout(copyTimeout);
|
|
4190
|
+
};
|
|
4191
|
+
return {
|
|
4192
|
+
copy: copy,
|
|
4193
|
+
reset: reset,
|
|
4194
|
+
error: error,
|
|
4195
|
+
copied: copied
|
|
4196
|
+
};
|
|
4197
|
+
}
|
|
4157
4198
|
// src/elements/HawaCodeBlock.tsx
|
|
4158
4199
|
var HawaCodeBlock = function(param) {
|
|
4159
4200
|
var tabs = param.tabs, code = param.code, fileName = param.fileName, _param_width = param.width, width = _param_width === void 0 ? "full" : _param_width;
|
|
4201
|
+
var clipboard = useClipboard();
|
|
4160
4202
|
var _react_useState_call = _sliced_to_array(_react.useState.call(void 0, 0), 2), selectedTab = _react_useState_call[0], setSelectedTab = _react_useState_call[1];
|
|
4161
|
-
var _react_useState_call1 = _sliced_to_array(_react.useState.call(void 0, false), 2), copyClicked = _react_useState_call1[0], setCopyClicked = _react_useState_call1[1];
|
|
4162
4203
|
var widthStyles2 = {
|
|
4163
4204
|
full: "w-full",
|
|
4164
4205
|
md: "w-full max-w-md",
|
|
4165
4206
|
sm: "w-full max-w-sm",
|
|
4166
4207
|
xs: "w-full max-w-xs"
|
|
4167
4208
|
};
|
|
4168
|
-
var handleCopyClick = function() {
|
|
4169
|
-
if (!copyClicked) {
|
|
4170
|
-
setCopyClicked(true);
|
|
4171
|
-
setTimeout(function() {
|
|
4172
|
-
setCopyClicked(false);
|
|
4173
|
-
}, 2e3);
|
|
4174
|
-
}
|
|
4175
|
-
};
|
|
4176
4209
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
4177
4210
|
className: cn(widthStyles2[width], "w-full flex-col items-center rounded bg-gray-200 text-left text-sm text-white dark:bg-gray-800 sm:text-base")
|
|
4178
|
-
},
|
|
4179
|
-
className: "flex flex-row gap-2 rounded-t bg-gray-100 p-2 pb-0 text-black
|
|
4211
|
+
}, tabs && /* @__PURE__ */ React6.default.createElement("div", {
|
|
4212
|
+
className: "flex flex-row gap-2 rounded-t bg-gray-100 p-2 pb-0 text-black dark:bg-gray-700 dark:text-white"
|
|
4180
4213
|
}, tabs.map(function(tab, i) {
|
|
4181
4214
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
4182
|
-
className: cn(selectedTab === i ? " border-b-2
|
|
4215
|
+
className: cn(selectedTab === i ? " border-b-2 border-primary" : "bg-transparent")
|
|
4183
4216
|
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
4184
4217
|
onClick: function() {
|
|
4185
4218
|
return setSelectedTab(i);
|
|
@@ -4197,14 +4230,13 @@ var HawaCodeBlock = function(param) {
|
|
|
4197
4230
|
}, tabs ? tabs[selectedTab].code : code), /* @__PURE__ */ React6.default.createElement("div", {
|
|
4198
4231
|
className: "flex w-fit flex-row items-center gap-2 p-2"
|
|
4199
4232
|
}, /* @__PURE__ */ React6.default.createElement(Tooltip, {
|
|
4200
|
-
open:
|
|
4233
|
+
open: clipboard.copied,
|
|
4201
4234
|
side: "left",
|
|
4202
4235
|
content: /* @__PURE__ */ React6.default.createElement("div", null, "Copied!")
|
|
4203
4236
|
}, /* @__PURE__ */ React6.default.createElement(Button, {
|
|
4204
4237
|
size: "icon",
|
|
4205
4238
|
onClick: function() {
|
|
4206
|
-
|
|
4207
|
-
navigator.clipboard.writeText(tabs ? tabs[selectedTab].code : code);
|
|
4239
|
+
return clipboard.copy(tabs ? tabs[selectedTab].code : code);
|
|
4208
4240
|
}
|
|
4209
4241
|
}, /* @__PURE__ */ React6.default.createElement("svg", {
|
|
4210
4242
|
"aria-label": "Copy Icon",
|
|
@@ -9811,7 +9843,9 @@ var NewPasswordForm = function(props) {
|
|
|
9811
9843
|
className: "text-center"
|
|
9812
9844
|
}, props.texts.passwordChanged)) : /* @__PURE__ */ React6.default.createElement(_reacthookform.FormProvider, _object_spread({}, methods), /* @__PURE__ */ React6.default.createElement("form", {
|
|
9813
9845
|
onSubmit: handleSubmit(handleSubmission)
|
|
9814
|
-
}, /* @__PURE__ */ React6.default.createElement(CardHeader, null, /* @__PURE__ */ React6.default.createElement(CardTitle, null, "Create Password"), /* @__PURE__ */ React6.default.createElement(CardDescription, null, "Set a new password for your account")), /* @__PURE__ */ React6.default.createElement(CardContent,
|
|
9846
|
+
}, !props.headless && /* @__PURE__ */ React6.default.createElement(CardHeader, null, /* @__PURE__ */ React6.default.createElement(CardTitle, null, "Create Password"), /* @__PURE__ */ React6.default.createElement(CardDescription, null, "Set a new password for your account")), /* @__PURE__ */ React6.default.createElement(CardContent, {
|
|
9847
|
+
headless: props.headless
|
|
9848
|
+
}, /* @__PURE__ */ React6.default.createElement(_reacthookform.Controller, {
|
|
9815
9849
|
control: control,
|
|
9816
9850
|
name: "password",
|
|
9817
9851
|
render: function(param) {
|