@sikka/hawa 0.16.9-next → 0.16.11-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.
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +4 -4
- package/dist/index.mjs +83 -81
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -96,6 +96,7 @@ type SubItem$1 = {
|
|
|
96
96
|
value?: any;
|
|
97
97
|
icon?: any;
|
|
98
98
|
action?: () => void;
|
|
99
|
+
onMiddleClick?: (e: any) => void;
|
|
99
100
|
highlighted?: boolean;
|
|
100
101
|
disabled?: boolean;
|
|
101
102
|
};
|
|
@@ -113,7 +114,7 @@ type MenuItemType = {
|
|
|
113
114
|
highlighted?: boolean;
|
|
114
115
|
subitems?: SubItem$1[];
|
|
115
116
|
disabled?: boolean;
|
|
116
|
-
onMiddleClick?: any;
|
|
117
|
+
onMiddleClick?: (e: any) => void;
|
|
117
118
|
onClick?: any;
|
|
118
119
|
};
|
|
119
120
|
interface DropdownMenuProps {
|
|
@@ -268,32 +269,31 @@ type ColorPickerTypes = {
|
|
|
268
269
|
};
|
|
269
270
|
declare const ColorPicker: FC<ColorPickerTypes>;
|
|
270
271
|
|
|
271
|
-
|
|
272
|
-
isLoading?: boolean;
|
|
273
|
-
containerClassName?: string;
|
|
274
|
-
margin?: "none" | "normal" | "large";
|
|
275
|
-
width?: "small" | "
|
|
272
|
+
declare const Input: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & {
|
|
273
|
+
isLoading?: boolean | undefined;
|
|
274
|
+
containerClassName?: string | undefined;
|
|
275
|
+
margin?: "none" | "normal" | "large" | undefined;
|
|
276
|
+
width?: "small" | "full" | "normal" | "auto" | undefined;
|
|
276
277
|
/** The label of the input field */
|
|
277
278
|
label?: any;
|
|
278
|
-
hint?: string;
|
|
279
|
-
hintSide?: PositionType;
|
|
279
|
+
hint?: string | undefined;
|
|
280
|
+
hintSide?: PositionType | undefined;
|
|
280
281
|
/** If true, it will show a red asterisk next to the label*/
|
|
281
|
-
isRequired?: boolean;
|
|
282
|
+
isRequired?: boolean | undefined;
|
|
282
283
|
/** Disable/Enable multiple line text input field */
|
|
283
|
-
multiline?: boolean;
|
|
284
|
+
multiline?: boolean | undefined;
|
|
284
285
|
/** The small red text under the input field to show validation or a hint. */
|
|
285
286
|
helperText?: any;
|
|
286
|
-
forceHideHelperText?: boolean;
|
|
287
|
-
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement
|
|
287
|
+
forceHideHelperText?: boolean | undefined;
|
|
288
|
+
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
288
289
|
/** The icon inside the input field */
|
|
289
290
|
icon?: any;
|
|
290
291
|
/** Boolean to enable/disable editing the input field and using it as a text field */
|
|
291
|
-
preview?: boolean;
|
|
292
|
+
preview?: boolean | undefined;
|
|
292
293
|
iconInside?: React__default.ReactNode;
|
|
293
294
|
endIcon?: React__default.ReactNode;
|
|
294
295
|
startIcon?: React__default.ReactNode;
|
|
295
|
-
}
|
|
296
|
-
declare const Input: FC<TextFieldTypes>;
|
|
296
|
+
} & React__default.RefAttributes<HTMLInputElement>>;
|
|
297
297
|
|
|
298
298
|
type ComboboxTypes<T> = {
|
|
299
299
|
labelKey?: keyof T;
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ type SubItem$1 = {
|
|
|
96
96
|
value?: any;
|
|
97
97
|
icon?: any;
|
|
98
98
|
action?: () => void;
|
|
99
|
+
onMiddleClick?: (e: any) => void;
|
|
99
100
|
highlighted?: boolean;
|
|
100
101
|
disabled?: boolean;
|
|
101
102
|
};
|
|
@@ -113,7 +114,7 @@ type MenuItemType = {
|
|
|
113
114
|
highlighted?: boolean;
|
|
114
115
|
subitems?: SubItem$1[];
|
|
115
116
|
disabled?: boolean;
|
|
116
|
-
onMiddleClick?: any;
|
|
117
|
+
onMiddleClick?: (e: any) => void;
|
|
117
118
|
onClick?: any;
|
|
118
119
|
};
|
|
119
120
|
interface DropdownMenuProps {
|
|
@@ -268,32 +269,31 @@ type ColorPickerTypes = {
|
|
|
268
269
|
};
|
|
269
270
|
declare const ColorPicker: FC<ColorPickerTypes>;
|
|
270
271
|
|
|
271
|
-
|
|
272
|
-
isLoading?: boolean;
|
|
273
|
-
containerClassName?: string;
|
|
274
|
-
margin?: "none" | "normal" | "large";
|
|
275
|
-
width?: "small" | "
|
|
272
|
+
declare const Input: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & {
|
|
273
|
+
isLoading?: boolean | undefined;
|
|
274
|
+
containerClassName?: string | undefined;
|
|
275
|
+
margin?: "none" | "normal" | "large" | undefined;
|
|
276
|
+
width?: "small" | "full" | "normal" | "auto" | undefined;
|
|
276
277
|
/** The label of the input field */
|
|
277
278
|
label?: any;
|
|
278
|
-
hint?: string;
|
|
279
|
-
hintSide?: PositionType;
|
|
279
|
+
hint?: string | undefined;
|
|
280
|
+
hintSide?: PositionType | undefined;
|
|
280
281
|
/** If true, it will show a red asterisk next to the label*/
|
|
281
|
-
isRequired?: boolean;
|
|
282
|
+
isRequired?: boolean | undefined;
|
|
282
283
|
/** Disable/Enable multiple line text input field */
|
|
283
|
-
multiline?: boolean;
|
|
284
|
+
multiline?: boolean | undefined;
|
|
284
285
|
/** The small red text under the input field to show validation or a hint. */
|
|
285
286
|
helperText?: any;
|
|
286
|
-
forceHideHelperText?: boolean;
|
|
287
|
-
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement
|
|
287
|
+
forceHideHelperText?: boolean | undefined;
|
|
288
|
+
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
288
289
|
/** The icon inside the input field */
|
|
289
290
|
icon?: any;
|
|
290
291
|
/** Boolean to enable/disable editing the input field and using it as a text field */
|
|
291
|
-
preview?: boolean;
|
|
292
|
+
preview?: boolean | undefined;
|
|
292
293
|
iconInside?: React__default.ReactNode;
|
|
293
294
|
endIcon?: React__default.ReactNode;
|
|
294
295
|
startIcon?: React__default.ReactNode;
|
|
295
|
-
}
|
|
296
|
-
declare const Input: FC<TextFieldTypes>;
|
|
296
|
+
} & React__default.RefAttributes<HTMLInputElement>>;
|
|
297
297
|
|
|
298
298
|
type ComboboxTypes<T> = {
|
|
299
299
|
labelKey?: keyof T;
|
package/dist/index.js
CHANGED
|
@@ -1482,8 +1482,8 @@ var DropdownMenu = function(param) {
|
|
|
1482
1482
|
onMouseDown: function(event) {
|
|
1483
1483
|
if (event.button === 1 || event.button === 0 && event.ctrlKey) {
|
|
1484
1484
|
event.preventDefault();
|
|
1485
|
-
if (
|
|
1486
|
-
|
|
1485
|
+
if (subitem.onMiddleClick) {
|
|
1486
|
+
subitem.onMiddleClick(item.value);
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
1489
|
},
|
|
@@ -4066,7 +4066,7 @@ var ColorPicker = function(_param) {
|
|
|
4066
4066
|
};
|
|
4067
4067
|
// components/elements/Input.tsx
|
|
4068
4068
|
var import_react15 = __toESM(require("react"));
|
|
4069
|
-
var Input = function(_param) {
|
|
4069
|
+
var Input = (0, import_react15.forwardRef)(function(_param, ref) {
|
|
4070
4070
|
var _param_margin = _param.margin, margin = _param_margin === void 0 ? "none" : _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, _param_forceHideHelperText = _param.forceHideHelperText, forceHideHelperText = _param_forceHideHelperText === void 0 ? false : _param_forceHideHelperText, props = _object_without_properties(_param, [
|
|
4071
4071
|
"margin",
|
|
4072
4072
|
"width",
|
|
@@ -4123,7 +4123,7 @@ var Input = function(_param) {
|
|
|
4123
4123
|
})), !forceHideHelperText && /* @__PURE__ */ import_react15.default.createElement("p", {
|
|
4124
4124
|
className: cn("hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start", props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0")
|
|
4125
4125
|
}, props.helperText))));
|
|
4126
|
-
};
|
|
4126
|
+
});
|
|
4127
4127
|
// components/elements/Combobox.tsx
|
|
4128
4128
|
var React28 = __toESM(require("react"));
|
|
4129
4129
|
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
|
package/dist/index.mjs
CHANGED
|
@@ -677,8 +677,8 @@ var DropdownMenu = ({
|
|
|
677
677
|
onMouseDown: (event) => {
|
|
678
678
|
if (event.button === 1 || event.button === 0 && event.ctrlKey) {
|
|
679
679
|
event.preventDefault();
|
|
680
|
-
if (
|
|
681
|
-
|
|
680
|
+
if (subitem.onMiddleClick) {
|
|
681
|
+
subitem.onMiddleClick(item.value);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
},
|
|
@@ -3442,90 +3442,92 @@ var ColorPicker = ({
|
|
|
3442
3442
|
};
|
|
3443
3443
|
|
|
3444
3444
|
// components/elements/Input.tsx
|
|
3445
|
-
import React24 from "react";
|
|
3446
|
-
var Input = (
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
{
|
|
3469
|
-
className: cn(
|
|
3470
|
-
defaultStyle,
|
|
3471
|
-
marginStyles[margin],
|
|
3472
|
-
widthStyles[width],
|
|
3473
|
-
props.containerClassName,
|
|
3474
|
-
"hawa-w-full hawa-gap-2"
|
|
3475
|
-
)
|
|
3476
|
-
},
|
|
3477
|
-
props.label && /* @__PURE__ */ React24.createElement(
|
|
3478
|
-
Label2,
|
|
3479
|
-
{
|
|
3480
|
-
htmlFor: props.id,
|
|
3481
|
-
hint: props.hint,
|
|
3482
|
-
hintSide: props.hintSide,
|
|
3483
|
-
required: props.isRequired
|
|
3484
|
-
},
|
|
3485
|
-
props.label
|
|
3486
|
-
),
|
|
3487
|
-
props.isLoading ? /* @__PURE__ */ React24.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React24.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
3445
|
+
import React24, { forwardRef as forwardRef9 } from "react";
|
|
3446
|
+
var Input = forwardRef9(
|
|
3447
|
+
({
|
|
3448
|
+
margin = "none",
|
|
3449
|
+
width = "full",
|
|
3450
|
+
preview = false,
|
|
3451
|
+
forceHideHelperText = false,
|
|
3452
|
+
...props
|
|
3453
|
+
}, ref) => {
|
|
3454
|
+
let marginStyles = {
|
|
3455
|
+
none: "hawa-mb-0",
|
|
3456
|
+
normal: "hawa-mb-3",
|
|
3457
|
+
large: "hawa-mb-5"
|
|
3458
|
+
};
|
|
3459
|
+
let widthStyles = {
|
|
3460
|
+
small: "hawa-w-full hawa-max-w-2xs",
|
|
3461
|
+
normal: "hawa-w-1/2",
|
|
3462
|
+
full: "hawa-w-full",
|
|
3463
|
+
auto: ""
|
|
3464
|
+
};
|
|
3465
|
+
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
|
3466
|
+
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
|
3467
|
+
return /* @__PURE__ */ React24.createElement(
|
|
3488
3468
|
"div",
|
|
3489
3469
|
{
|
|
3490
3470
|
className: cn(
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
"input",
|
|
3497
|
-
{
|
|
3498
|
-
required: true,
|
|
3499
|
-
dir: props.dir,
|
|
3500
|
-
type: props.type,
|
|
3501
|
-
value: props.value,
|
|
3502
|
-
onChange: props.onChange,
|
|
3503
|
-
autoComplete: props.autoComplete,
|
|
3504
|
-
defaultValue: props.defaultValue,
|
|
3505
|
-
placeholder: props.placeholder,
|
|
3506
|
-
disabled: preview,
|
|
3507
|
-
style: { height: 40 },
|
|
3508
|
-
className: cn(
|
|
3509
|
-
defaultInputStyle,
|
|
3510
|
-
" dark:hawa-text-white focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0",
|
|
3511
|
-
props.endIcon && "hawa-pe-9",
|
|
3512
|
-
props.startIcon && "hawa-ps-9",
|
|
3513
|
-
preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0",
|
|
3514
|
-
props.inputProps?.className
|
|
3515
|
-
)
|
|
3516
|
-
}
|
|
3517
|
-
)), !forceHideHelperText && /* @__PURE__ */ React24.createElement(
|
|
3518
|
-
"p",
|
|
3519
|
-
{
|
|
3520
|
-
className: cn(
|
|
3521
|
-
"hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start",
|
|
3522
|
-
props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0"
|
|
3471
|
+
defaultStyle,
|
|
3472
|
+
marginStyles[margin],
|
|
3473
|
+
widthStyles[width],
|
|
3474
|
+
props.containerClassName,
|
|
3475
|
+
"hawa-w-full hawa-gap-2"
|
|
3523
3476
|
)
|
|
3524
3477
|
},
|
|
3525
|
-
props.
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3478
|
+
props.label && /* @__PURE__ */ React24.createElement(
|
|
3479
|
+
Label2,
|
|
3480
|
+
{
|
|
3481
|
+
htmlFor: props.id,
|
|
3482
|
+
hint: props.hint,
|
|
3483
|
+
hintSide: props.hintSide,
|
|
3484
|
+
required: props.isRequired
|
|
3485
|
+
},
|
|
3486
|
+
props.label
|
|
3487
|
+
),
|
|
3488
|
+
props.isLoading ? /* @__PURE__ */ React24.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React24.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
3489
|
+
"div",
|
|
3490
|
+
{
|
|
3491
|
+
className: cn(
|
|
3492
|
+
"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
|
|
3493
|
+
preview ? "hawa-opacity-100" : "hawa-opacity-0"
|
|
3494
|
+
)
|
|
3495
|
+
}
|
|
3496
|
+
), /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", { className: cn("hawa-relative") }, props.startIcon && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.endIcon), /* @__PURE__ */ React24.createElement(
|
|
3497
|
+
"input",
|
|
3498
|
+
{
|
|
3499
|
+
required: true,
|
|
3500
|
+
dir: props.dir,
|
|
3501
|
+
type: props.type,
|
|
3502
|
+
value: props.value,
|
|
3503
|
+
onChange: props.onChange,
|
|
3504
|
+
autoComplete: props.autoComplete,
|
|
3505
|
+
defaultValue: props.defaultValue,
|
|
3506
|
+
placeholder: props.placeholder,
|
|
3507
|
+
disabled: preview,
|
|
3508
|
+
style: { height: 40 },
|
|
3509
|
+
className: cn(
|
|
3510
|
+
defaultInputStyle,
|
|
3511
|
+
" dark:hawa-text-white focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0",
|
|
3512
|
+
props.endIcon && "hawa-pe-9",
|
|
3513
|
+
props.startIcon && "hawa-ps-9",
|
|
3514
|
+
preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0",
|
|
3515
|
+
props.inputProps?.className
|
|
3516
|
+
)
|
|
3517
|
+
}
|
|
3518
|
+
)), !forceHideHelperText && /* @__PURE__ */ React24.createElement(
|
|
3519
|
+
"p",
|
|
3520
|
+
{
|
|
3521
|
+
className: cn(
|
|
3522
|
+
"hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start",
|
|
3523
|
+
props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0"
|
|
3524
|
+
)
|
|
3525
|
+
},
|
|
3526
|
+
props.helperText
|
|
3527
|
+
)))
|
|
3528
|
+
);
|
|
3529
|
+
}
|
|
3530
|
+
);
|
|
3529
3531
|
|
|
3530
3532
|
// components/elements/Combobox.tsx
|
|
3531
3533
|
import * as React28 from "react";
|