@sikka/hawa 0.17.11-next → 0.17.12-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 -21
- package/dist/index.d.ts +15 -21
- package/dist/index.js +43 -66
- package/dist/index.mjs +43 -66
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -185,12 +185,21 @@ type PinInputTypes = {
|
|
|
185
185
|
};
|
|
186
186
|
declare const PinInput: FC<PinInputTypes>;
|
|
187
187
|
|
|
188
|
+
type LabelProps = {
|
|
189
|
+
hint?: React$1.ReactNode;
|
|
190
|
+
hintSide?: PositionType;
|
|
191
|
+
htmlFor?: string;
|
|
192
|
+
required?: boolean;
|
|
193
|
+
};
|
|
194
|
+
declare const Label: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & LabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
195
|
+
|
|
188
196
|
type PhoneInputTypes = {
|
|
189
197
|
preferredCountry?: {
|
|
190
198
|
label: string;
|
|
191
199
|
};
|
|
192
200
|
helperText?: any;
|
|
193
201
|
label?: string;
|
|
202
|
+
labelProps?: LabelProps;
|
|
194
203
|
handleChange?: (value: string) => void;
|
|
195
204
|
};
|
|
196
205
|
declare const PhoneInput: FC<PhoneInputTypes>;
|
|
@@ -205,17 +214,6 @@ type CheckboxProps = CheckBoxTypes & React$1.ComponentProps<typeof CheckboxEleme
|
|
|
205
214
|
declare const Checkbox: React$1.FC<CheckboxProps>;
|
|
206
215
|
declare const CheckboxElement: React$1.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
207
216
|
|
|
208
|
-
type LabelProps = React$1.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
209
|
-
hint?: React$1.ReactNode;
|
|
210
|
-
hintSide?: PositionType;
|
|
211
|
-
required?: boolean;
|
|
212
|
-
};
|
|
213
|
-
declare const Label: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
214
|
-
hint?: React$1.ReactNode;
|
|
215
|
-
hintSide?: PositionType | undefined;
|
|
216
|
-
required?: boolean | undefined;
|
|
217
|
-
} & React$1.RefAttributes<HTMLLabelElement>>;
|
|
218
|
-
|
|
219
217
|
type RadioOptionsTypes = {
|
|
220
218
|
value: any;
|
|
221
219
|
label: any;
|
|
@@ -233,6 +231,7 @@ type RadioTypes = {
|
|
|
233
231
|
direction?: DirectionType;
|
|
234
232
|
helperText?: string;
|
|
235
233
|
labelProps?: LabelProps;
|
|
234
|
+
label?: string;
|
|
236
235
|
};
|
|
237
236
|
declare const Radio: FC<RadioTypes>;
|
|
238
237
|
|
|
@@ -253,9 +252,7 @@ declare const Slider: React$1.ForwardRefExoticComponent<Omit<SliderPrimitive.Sli
|
|
|
253
252
|
type ColorPickerTypes = {
|
|
254
253
|
label?: string;
|
|
255
254
|
id?: string;
|
|
256
|
-
|
|
257
|
-
hintSide?: PositionType;
|
|
258
|
-
isRequired?: boolean;
|
|
255
|
+
labelProps?: LabelProps;
|
|
259
256
|
helperText?: string;
|
|
260
257
|
/** The hex code for the color */
|
|
261
258
|
color?: any;
|
|
@@ -276,13 +273,10 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
|
|
|
276
273
|
width?: "small" | "full" | "normal" | "auto" | undefined;
|
|
277
274
|
/** The label of the input field */
|
|
278
275
|
label?: any;
|
|
279
|
-
|
|
280
|
-
hintSide?: PositionType | undefined;
|
|
281
|
-
/** If true, it will show a red asterisk next to the label*/
|
|
282
|
-
isRequired?: boolean | undefined;
|
|
276
|
+
labelProps?: LabelProps | undefined;
|
|
283
277
|
/** Disable/Enable multiple line text input field */
|
|
284
278
|
multiline?: boolean | undefined;
|
|
285
|
-
/** The small red text under the input field to show validation
|
|
279
|
+
/** The small red text under the input field to show validation. */
|
|
286
280
|
helperText?: any;
|
|
287
281
|
forceHideHelperText?: boolean | undefined;
|
|
288
282
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
@@ -315,8 +309,7 @@ type ComboboxTypes<T> = {
|
|
|
315
309
|
id?: string;
|
|
316
310
|
/** The label of the input field */
|
|
317
311
|
label?: any;
|
|
318
|
-
|
|
319
|
-
hintSide?: PositionType;
|
|
312
|
+
labelProps?: LabelProps;
|
|
320
313
|
/** If true, it will show a red asterisk next to the label*/
|
|
321
314
|
isRequired?: boolean;
|
|
322
315
|
onChange?: (e: any) => void;
|
|
@@ -353,6 +346,7 @@ type SelectTypes = {
|
|
|
353
346
|
hideIndicator?: boolean;
|
|
354
347
|
phoneCode?: boolean;
|
|
355
348
|
isLoading?: any;
|
|
349
|
+
labelProps?: LabelProps;
|
|
356
350
|
texts?: {
|
|
357
351
|
noOptions?: string;
|
|
358
352
|
createLabel?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -185,12 +185,21 @@ type PinInputTypes = {
|
|
|
185
185
|
};
|
|
186
186
|
declare const PinInput: FC<PinInputTypes>;
|
|
187
187
|
|
|
188
|
+
type LabelProps = {
|
|
189
|
+
hint?: React$1.ReactNode;
|
|
190
|
+
hintSide?: PositionType;
|
|
191
|
+
htmlFor?: string;
|
|
192
|
+
required?: boolean;
|
|
193
|
+
};
|
|
194
|
+
declare const Label: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & LabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
195
|
+
|
|
188
196
|
type PhoneInputTypes = {
|
|
189
197
|
preferredCountry?: {
|
|
190
198
|
label: string;
|
|
191
199
|
};
|
|
192
200
|
helperText?: any;
|
|
193
201
|
label?: string;
|
|
202
|
+
labelProps?: LabelProps;
|
|
194
203
|
handleChange?: (value: string) => void;
|
|
195
204
|
};
|
|
196
205
|
declare const PhoneInput: FC<PhoneInputTypes>;
|
|
@@ -205,17 +214,6 @@ type CheckboxProps = CheckBoxTypes & React$1.ComponentProps<typeof CheckboxEleme
|
|
|
205
214
|
declare const Checkbox: React$1.FC<CheckboxProps>;
|
|
206
215
|
declare const CheckboxElement: React$1.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
207
216
|
|
|
208
|
-
type LabelProps = React$1.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
209
|
-
hint?: React$1.ReactNode;
|
|
210
|
-
hintSide?: PositionType;
|
|
211
|
-
required?: boolean;
|
|
212
|
-
};
|
|
213
|
-
declare const Label: React$1.ForwardRefExoticComponent<React$1.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
214
|
-
hint?: React$1.ReactNode;
|
|
215
|
-
hintSide?: PositionType | undefined;
|
|
216
|
-
required?: boolean | undefined;
|
|
217
|
-
} & React$1.RefAttributes<HTMLLabelElement>>;
|
|
218
|
-
|
|
219
217
|
type RadioOptionsTypes = {
|
|
220
218
|
value: any;
|
|
221
219
|
label: any;
|
|
@@ -233,6 +231,7 @@ type RadioTypes = {
|
|
|
233
231
|
direction?: DirectionType;
|
|
234
232
|
helperText?: string;
|
|
235
233
|
labelProps?: LabelProps;
|
|
234
|
+
label?: string;
|
|
236
235
|
};
|
|
237
236
|
declare const Radio: FC<RadioTypes>;
|
|
238
237
|
|
|
@@ -253,9 +252,7 @@ declare const Slider: React$1.ForwardRefExoticComponent<Omit<SliderPrimitive.Sli
|
|
|
253
252
|
type ColorPickerTypes = {
|
|
254
253
|
label?: string;
|
|
255
254
|
id?: string;
|
|
256
|
-
|
|
257
|
-
hintSide?: PositionType;
|
|
258
|
-
isRequired?: boolean;
|
|
255
|
+
labelProps?: LabelProps;
|
|
259
256
|
helperText?: string;
|
|
260
257
|
/** The hex code for the color */
|
|
261
258
|
color?: any;
|
|
@@ -276,13 +273,10 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
|
|
|
276
273
|
width?: "small" | "full" | "normal" | "auto" | undefined;
|
|
277
274
|
/** The label of the input field */
|
|
278
275
|
label?: any;
|
|
279
|
-
|
|
280
|
-
hintSide?: PositionType | undefined;
|
|
281
|
-
/** If true, it will show a red asterisk next to the label*/
|
|
282
|
-
isRequired?: boolean | undefined;
|
|
276
|
+
labelProps?: LabelProps | undefined;
|
|
283
277
|
/** Disable/Enable multiple line text input field */
|
|
284
278
|
multiline?: boolean | undefined;
|
|
285
|
-
/** The small red text under the input field to show validation
|
|
279
|
+
/** The small red text under the input field to show validation. */
|
|
286
280
|
helperText?: any;
|
|
287
281
|
forceHideHelperText?: boolean | undefined;
|
|
288
282
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
@@ -315,8 +309,7 @@ type ComboboxTypes<T> = {
|
|
|
315
309
|
id?: string;
|
|
316
310
|
/** The label of the input field */
|
|
317
311
|
label?: any;
|
|
318
|
-
|
|
319
|
-
hintSide?: PositionType;
|
|
312
|
+
labelProps?: LabelProps;
|
|
320
313
|
/** If true, it will show a red asterisk next to the label*/
|
|
321
314
|
isRequired?: boolean;
|
|
322
315
|
onChange?: (e: any) => void;
|
|
@@ -353,6 +346,7 @@ type SelectTypes = {
|
|
|
353
346
|
hideIndicator?: boolean;
|
|
354
347
|
phoneCode?: boolean;
|
|
355
348
|
isLoading?: any;
|
|
349
|
+
labelProps?: LabelProps;
|
|
356
350
|
texts?: {
|
|
357
351
|
noOptions?: string;
|
|
358
352
|
createLabel?: string;
|
package/dist/index.js
CHANGED
|
@@ -2928,36 +2928,34 @@ var Tooltip = ({
|
|
|
2928
2928
|
};
|
|
2929
2929
|
|
|
2930
2930
|
// components/elements/Label.tsx
|
|
2931
|
-
var Label2 = React14.forwardRef(
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
)))
|
|
2960
|
-
);
|
|
2931
|
+
var Label2 = React14.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React14.createElement("div", { className: "hawa-transition-all hawa-flex hawa-flex-row hawa-gap-1 hawa-items-center" }, /* @__PURE__ */ React14.createElement(
|
|
2932
|
+
"label",
|
|
2933
|
+
{
|
|
2934
|
+
ref,
|
|
2935
|
+
className: cn(
|
|
2936
|
+
"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
|
|
2937
|
+
className
|
|
2938
|
+
),
|
|
2939
|
+
...props
|
|
2940
|
+
},
|
|
2941
|
+
children,
|
|
2942
|
+
required && /* @__PURE__ */ React14.createElement("span", { className: "hawa-text-red-500 hawa-mx-0.5" }, "*")
|
|
2943
|
+
), hint && /* @__PURE__ */ React14.createElement(Tooltip, { content: hint, side: hintSide }, /* @__PURE__ */ React14.createElement(
|
|
2944
|
+
"svg",
|
|
2945
|
+
{
|
|
2946
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2947
|
+
className: "hawa-w-[14px] hawa-h-[14px] hawa-cursor-help",
|
|
2948
|
+
viewBox: "0 0 24 24",
|
|
2949
|
+
fill: "none",
|
|
2950
|
+
stroke: "currentColor",
|
|
2951
|
+
strokeWidth: "2",
|
|
2952
|
+
strokeLinecap: "round",
|
|
2953
|
+
strokeLinejoin: "round"
|
|
2954
|
+
},
|
|
2955
|
+
/* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2956
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
|
2957
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M12 17h.01" })
|
|
2958
|
+
))));
|
|
2961
2959
|
Label2.displayName = "Label";
|
|
2962
2960
|
|
|
2963
2961
|
// components/elements/Skeleton.tsx
|
|
@@ -2988,7 +2986,11 @@ function Skeleton({
|
|
|
2988
2986
|
}
|
|
2989
2987
|
|
|
2990
2988
|
// components/elements/Select.tsx
|
|
2991
|
-
var Select = ({
|
|
2989
|
+
var Select = ({
|
|
2990
|
+
labelProps,
|
|
2991
|
+
labelKey = "label",
|
|
2992
|
+
...props
|
|
2993
|
+
}) => {
|
|
2992
2994
|
const NoOption = () => {
|
|
2993
2995
|
var _a, _b;
|
|
2994
2996
|
return /* @__PURE__ */ import_react11.default.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
|
|
@@ -3050,7 +3052,7 @@ var Select = ({ labelKey = "label", ...props }) => {
|
|
|
3050
3052
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
|
3051
3053
|
)
|
|
3052
3054
|
},
|
|
3053
|
-
props.label && /* @__PURE__ */ import_react11.default.createElement(Label2,
|
|
3055
|
+
props.label && /* @__PURE__ */ import_react11.default.createElement(Label2, { ...labelProps }, props.label),
|
|
3054
3056
|
props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
|
3055
3057
|
// TODO: enable keyboard to go to the next item in the list
|
|
3056
3058
|
/* @__PURE__ */ import_react11.default.createElement(
|
|
@@ -3134,7 +3136,7 @@ var Select = ({ labelKey = "label", ...props }) => {
|
|
|
3134
3136
|
};
|
|
3135
3137
|
|
|
3136
3138
|
// components/elements/PhoneInput.tsx
|
|
3137
|
-
var PhoneInput = (props) => {
|
|
3139
|
+
var PhoneInput = ({ labelProps, ...props }) => {
|
|
3138
3140
|
const [phoneNumber, setPhoneNumber] = (0, import_react12.useState)("");
|
|
3139
3141
|
const [countryCode, setCountryCode] = (0, import_react12.useState)(props.preferredCountry);
|
|
3140
3142
|
const inputRef = (0, import_react12.useRef)(null);
|
|
@@ -3156,7 +3158,7 @@ var PhoneInput = (props) => {
|
|
|
3156
3158
|
console.log("handleChange prop was not provided in <PhoneInput/>");
|
|
3157
3159
|
}
|
|
3158
3160
|
};
|
|
3159
|
-
return /* @__PURE__ */ import_react12.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2 hawa-h-fit" }, props.label && /* @__PURE__ */ import_react12.default.createElement(Label2,
|
|
3161
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2 hawa-h-fit" }, props.label && /* @__PURE__ */ import_react12.default.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ import_react12.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-flex-row hawa-w-full" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
3160
3162
|
Select,
|
|
3161
3163
|
{
|
|
3162
3164
|
width: "fit",
|
|
@@ -3410,7 +3412,7 @@ var Radio = ({
|
|
|
3410
3412
|
/* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
|
|
3411
3413
|
))));
|
|
3412
3414
|
default:
|
|
3413
|
-
return /* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" },
|
|
3415
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react13.default.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ import_react13.default.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ import_react13.default.createElement(
|
|
3414
3416
|
"div",
|
|
3415
3417
|
{
|
|
3416
3418
|
className: cn(
|
|
@@ -3586,6 +3588,7 @@ var ColorPicker = ({
|
|
|
3586
3588
|
containerProps,
|
|
3587
3589
|
colorPickerProps,
|
|
3588
3590
|
textInputProps,
|
|
3591
|
+
labelProps,
|
|
3589
3592
|
...props
|
|
3590
3593
|
}) => {
|
|
3591
3594
|
const [selectedColor, setSelectedColor] = (0, import_react14.useState)(props.color);
|
|
@@ -3611,16 +3614,7 @@ var ColorPicker = ({
|
|
|
3611
3614
|
inputElement.dispatchEvent(event);
|
|
3612
3615
|
}
|
|
3613
3616
|
};
|
|
3614
|
-
return /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, props.label && /* @__PURE__ */ import_react14.default.createElement(
|
|
3615
|
-
Label2,
|
|
3616
|
-
{
|
|
3617
|
-
htmlFor: props.id,
|
|
3618
|
-
hint: props.hint,
|
|
3619
|
-
hintSide: props.hintSide,
|
|
3620
|
-
required: props.isRequired
|
|
3621
|
-
},
|
|
3622
|
-
props.label
|
|
3623
|
-
), /* @__PURE__ */ import_react14.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-flex-row hawa-w-full" }, /* @__PURE__ */ import_react14.default.createElement(
|
|
3617
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, props.label && /* @__PURE__ */ import_react14.default.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ import_react14.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-flex-row hawa-w-full" }, /* @__PURE__ */ import_react14.default.createElement(
|
|
3624
3618
|
"div",
|
|
3625
3619
|
{
|
|
3626
3620
|
style: { height: 40, backgroundColor: selectedColor },
|
|
@@ -3677,6 +3671,7 @@ var Input = (0, import_react15.forwardRef)(
|
|
|
3677
3671
|
width = "full",
|
|
3678
3672
|
preview = false,
|
|
3679
3673
|
forceHideHelperText = false,
|
|
3674
|
+
labelProps,
|
|
3680
3675
|
...props
|
|
3681
3676
|
}, ref) => {
|
|
3682
3677
|
var _a;
|
|
@@ -3704,16 +3699,7 @@ var Input = (0, import_react15.forwardRef)(
|
|
|
3704
3699
|
"hawa-w-full hawa-gap-2"
|
|
3705
3700
|
)
|
|
3706
3701
|
},
|
|
3707
|
-
props.label && /* @__PURE__ */ import_react15.default.createElement(
|
|
3708
|
-
Label2,
|
|
3709
|
-
{
|
|
3710
|
-
htmlFor: props.id,
|
|
3711
|
-
hint: props.hint,
|
|
3712
|
-
hintSide: props.hintSide,
|
|
3713
|
-
required: props.isRequired
|
|
3714
|
-
},
|
|
3715
|
-
props.label
|
|
3716
|
-
),
|
|
3702
|
+
props.label && /* @__PURE__ */ import_react15.default.createElement(Label2, { ...labelProps }, props.label),
|
|
3717
3703
|
props.isLoading ? /* @__PURE__ */ import_react15.default.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ import_react15.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
3718
3704
|
"div",
|
|
3719
3705
|
{
|
|
@@ -4141,6 +4127,7 @@ var Combobox = React28.forwardRef(
|
|
|
4141
4127
|
valueKey = "value",
|
|
4142
4128
|
defaultValue = "",
|
|
4143
4129
|
popoverClassName,
|
|
4130
|
+
labelProps,
|
|
4144
4131
|
data,
|
|
4145
4132
|
...props
|
|
4146
4133
|
}, ref) => {
|
|
@@ -4163,17 +4150,7 @@ var Combobox = React28.forwardRef(
|
|
|
4163
4150
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
|
4164
4151
|
)
|
|
4165
4152
|
},
|
|
4166
|
-
props.label && /* @__PURE__ */ React28.createElement(
|
|
4167
|
-
Label2,
|
|
4168
|
-
{
|
|
4169
|
-
htmlFor: props.id,
|
|
4170
|
-
hint: props.hint,
|
|
4171
|
-
hintSide: props.hintSide,
|
|
4172
|
-
required: props.isRequired
|
|
4173
|
-
},
|
|
4174
|
-
props.label
|
|
4175
|
-
),
|
|
4176
|
-
" ",
|
|
4153
|
+
props.label && /* @__PURE__ */ React28.createElement(Label2, { ...labelProps }, props.label),
|
|
4177
4154
|
/* @__PURE__ */ React28.createElement(PopoverPrimitive2.Root, { open, onOpenChange: handleOpenChange }, /* @__PURE__ */ React28.createElement(PopoverTrigger, { asChild: true }, props.isLoading ? /* @__PURE__ */ React28.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React28.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React28.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2 hawa-items-start " }, /* @__PURE__ */ React28.createElement(
|
|
4178
4155
|
"div",
|
|
4179
4156
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -2706,36 +2706,34 @@ var Tooltip = ({
|
|
|
2706
2706
|
};
|
|
2707
2707
|
|
|
2708
2708
|
// components/elements/Label.tsx
|
|
2709
|
-
var Label2 = React14.forwardRef(
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
)))
|
|
2738
|
-
);
|
|
2709
|
+
var Label2 = React14.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React14.createElement("div", { className: "hawa-transition-all hawa-flex hawa-flex-row hawa-gap-1 hawa-items-center" }, /* @__PURE__ */ React14.createElement(
|
|
2710
|
+
"label",
|
|
2711
|
+
{
|
|
2712
|
+
ref,
|
|
2713
|
+
className: cn(
|
|
2714
|
+
"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
|
|
2715
|
+
className
|
|
2716
|
+
),
|
|
2717
|
+
...props
|
|
2718
|
+
},
|
|
2719
|
+
children,
|
|
2720
|
+
required && /* @__PURE__ */ React14.createElement("span", { className: "hawa-text-red-500 hawa-mx-0.5" }, "*")
|
|
2721
|
+
), hint && /* @__PURE__ */ React14.createElement(Tooltip, { content: hint, side: hintSide }, /* @__PURE__ */ React14.createElement(
|
|
2722
|
+
"svg",
|
|
2723
|
+
{
|
|
2724
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2725
|
+
className: "hawa-w-[14px] hawa-h-[14px] hawa-cursor-help",
|
|
2726
|
+
viewBox: "0 0 24 24",
|
|
2727
|
+
fill: "none",
|
|
2728
|
+
stroke: "currentColor",
|
|
2729
|
+
strokeWidth: "2",
|
|
2730
|
+
strokeLinecap: "round",
|
|
2731
|
+
strokeLinejoin: "round"
|
|
2732
|
+
},
|
|
2733
|
+
/* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2734
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
|
2735
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M12 17h.01" })
|
|
2736
|
+
))));
|
|
2739
2737
|
Label2.displayName = "Label";
|
|
2740
2738
|
|
|
2741
2739
|
// components/elements/Skeleton.tsx
|
|
@@ -2766,7 +2764,11 @@ function Skeleton({
|
|
|
2766
2764
|
}
|
|
2767
2765
|
|
|
2768
2766
|
// components/elements/Select.tsx
|
|
2769
|
-
var Select = ({
|
|
2767
|
+
var Select = ({
|
|
2768
|
+
labelProps,
|
|
2769
|
+
labelKey = "label",
|
|
2770
|
+
...props
|
|
2771
|
+
}) => {
|
|
2770
2772
|
const NoOption = () => {
|
|
2771
2773
|
var _a, _b;
|
|
2772
2774
|
return /* @__PURE__ */ React16.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
|
|
@@ -2828,7 +2830,7 @@ var Select = ({ labelKey = "label", ...props }) => {
|
|
|
2828
2830
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
|
2829
2831
|
)
|
|
2830
2832
|
},
|
|
2831
|
-
props.label && /* @__PURE__ */ React16.createElement(Label2,
|
|
2833
|
+
props.label && /* @__PURE__ */ React16.createElement(Label2, { ...labelProps }, props.label),
|
|
2832
2834
|
props.isLoading ? /* @__PURE__ */ React16.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
|
2833
2835
|
// TODO: enable keyboard to go to the next item in the list
|
|
2834
2836
|
/* @__PURE__ */ React16.createElement(
|
|
@@ -2912,7 +2914,7 @@ var Select = ({ labelKey = "label", ...props }) => {
|
|
|
2912
2914
|
};
|
|
2913
2915
|
|
|
2914
2916
|
// components/elements/PhoneInput.tsx
|
|
2915
|
-
var PhoneInput = (props) => {
|
|
2917
|
+
var PhoneInput = ({ labelProps, ...props }) => {
|
|
2916
2918
|
const [phoneNumber, setPhoneNumber] = useState5("");
|
|
2917
2919
|
const [countryCode, setCountryCode] = useState5(props.preferredCountry);
|
|
2918
2920
|
const inputRef = useRef2(null);
|
|
@@ -2934,7 +2936,7 @@ var PhoneInput = (props) => {
|
|
|
2934
2936
|
console.log("handleChange prop was not provided in <PhoneInput/>");
|
|
2935
2937
|
}
|
|
2936
2938
|
};
|
|
2937
|
-
return /* @__PURE__ */ React17.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2 hawa-h-fit" }, props.label && /* @__PURE__ */ React17.createElement(Label2,
|
|
2939
|
+
return /* @__PURE__ */ React17.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2 hawa-h-fit" }, props.label && /* @__PURE__ */ React17.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ React17.createElement("div", { dir: "ltr", className: "hawa-flex hawa-flex-row hawa-w-full" }, /* @__PURE__ */ React17.createElement(
|
|
2938
2940
|
Select,
|
|
2939
2941
|
{
|
|
2940
2942
|
width: "fit",
|
|
@@ -3188,7 +3190,7 @@ var Radio = ({
|
|
|
3188
3190
|
/* @__PURE__ */ React19.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ React19.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ React19.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
|
|
3189
3191
|
))));
|
|
3190
3192
|
default:
|
|
3191
|
-
return /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" },
|
|
3193
|
+
return /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React19.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ React19.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React19.createElement(
|
|
3192
3194
|
"div",
|
|
3193
3195
|
{
|
|
3194
3196
|
className: cn(
|
|
@@ -3367,6 +3369,7 @@ var ColorPicker = ({
|
|
|
3367
3369
|
containerProps,
|
|
3368
3370
|
colorPickerProps,
|
|
3369
3371
|
textInputProps,
|
|
3372
|
+
labelProps,
|
|
3370
3373
|
...props
|
|
3371
3374
|
}) => {
|
|
3372
3375
|
const [selectedColor, setSelectedColor] = useState8(props.color);
|
|
@@ -3392,16 +3395,7 @@ var ColorPicker = ({
|
|
|
3392
3395
|
inputElement.dispatchEvent(event);
|
|
3393
3396
|
}
|
|
3394
3397
|
};
|
|
3395
|
-
return /* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, props.label && /* @__PURE__ */ React23.createElement(
|
|
3396
|
-
Label2,
|
|
3397
|
-
{
|
|
3398
|
-
htmlFor: props.id,
|
|
3399
|
-
hint: props.hint,
|
|
3400
|
-
hintSide: props.hintSide,
|
|
3401
|
-
required: props.isRequired
|
|
3402
|
-
},
|
|
3403
|
-
props.label
|
|
3404
|
-
), /* @__PURE__ */ React23.createElement("div", { dir: "ltr", className: "hawa-flex hawa-flex-row hawa-w-full" }, /* @__PURE__ */ React23.createElement(
|
|
3398
|
+
return /* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, props.label && /* @__PURE__ */ React23.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ React23.createElement("div", { dir: "ltr", className: "hawa-flex hawa-flex-row hawa-w-full" }, /* @__PURE__ */ React23.createElement(
|
|
3405
3399
|
"div",
|
|
3406
3400
|
{
|
|
3407
3401
|
style: { height: 40, backgroundColor: selectedColor },
|
|
@@ -3458,6 +3452,7 @@ var Input = forwardRef9(
|
|
|
3458
3452
|
width = "full",
|
|
3459
3453
|
preview = false,
|
|
3460
3454
|
forceHideHelperText = false,
|
|
3455
|
+
labelProps,
|
|
3461
3456
|
...props
|
|
3462
3457
|
}, ref) => {
|
|
3463
3458
|
var _a;
|
|
@@ -3485,16 +3480,7 @@ var Input = forwardRef9(
|
|
|
3485
3480
|
"hawa-w-full hawa-gap-2"
|
|
3486
3481
|
)
|
|
3487
3482
|
},
|
|
3488
|
-
props.label && /* @__PURE__ */ React24.createElement(
|
|
3489
|
-
Label2,
|
|
3490
|
-
{
|
|
3491
|
-
htmlFor: props.id,
|
|
3492
|
-
hint: props.hint,
|
|
3493
|
-
hintSide: props.hintSide,
|
|
3494
|
-
required: props.isRequired
|
|
3495
|
-
},
|
|
3496
|
-
props.label
|
|
3497
|
-
),
|
|
3483
|
+
props.label && /* @__PURE__ */ React24.createElement(Label2, { ...labelProps }, props.label),
|
|
3498
3484
|
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(
|
|
3499
3485
|
"div",
|
|
3500
3486
|
{
|
|
@@ -3922,6 +3908,7 @@ var Combobox = React28.forwardRef(
|
|
|
3922
3908
|
valueKey = "value",
|
|
3923
3909
|
defaultValue = "",
|
|
3924
3910
|
popoverClassName,
|
|
3911
|
+
labelProps,
|
|
3925
3912
|
data,
|
|
3926
3913
|
...props
|
|
3927
3914
|
}, ref) => {
|
|
@@ -3944,17 +3931,7 @@ var Combobox = React28.forwardRef(
|
|
|
3944
3931
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
|
3945
3932
|
)
|
|
3946
3933
|
},
|
|
3947
|
-
props.label && /* @__PURE__ */ React28.createElement(
|
|
3948
|
-
Label2,
|
|
3949
|
-
{
|
|
3950
|
-
htmlFor: props.id,
|
|
3951
|
-
hint: props.hint,
|
|
3952
|
-
hintSide: props.hintSide,
|
|
3953
|
-
required: props.isRequired
|
|
3954
|
-
},
|
|
3955
|
-
props.label
|
|
3956
|
-
),
|
|
3957
|
-
" ",
|
|
3934
|
+
props.label && /* @__PURE__ */ React28.createElement(Label2, { ...labelProps }, props.label),
|
|
3958
3935
|
/* @__PURE__ */ React28.createElement(PopoverPrimitive2.Root, { open, onOpenChange: handleOpenChange }, /* @__PURE__ */ React28.createElement(PopoverTrigger, { asChild: true }, props.isLoading ? /* @__PURE__ */ React28.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React28.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React28.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2 hawa-items-start " }, /* @__PURE__ */ React28.createElement(
|
|
3959
3936
|
"div",
|
|
3960
3937
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.12-next",
|
|
4
4
|
"description": "Modern UI Kit made with Tailwind",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Sikka Software",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"build": "next build",
|
|
44
44
|
"start": "next start -p 3032",
|
|
45
45
|
"lint": "next lint",
|
|
46
|
+
"check": "tsc --noEmit",
|
|
46
47
|
"test": "jest",
|
|
47
48
|
"storybook": "storybook dev -p 6006",
|
|
48
49
|
"build-storybook": "storybook build",
|