@sikka/hawa 0.10.12-next → 0.10.13-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.css +3 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -14
- package/dist/index.mjs +37 -11
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -659,9 +659,9 @@ type ComboboxTypes<T> = {
|
|
|
659
659
|
placeholder?: string;
|
|
660
660
|
searchPlaceholder?: string;
|
|
661
661
|
popoverClassName?: string;
|
|
662
|
-
buttonClassName?: string;
|
|
663
662
|
/** This the same value as the one with the key valueKey */
|
|
664
663
|
defaultValue?: string;
|
|
664
|
+
preview?: boolean;
|
|
665
665
|
onChange?: (e: any) => void;
|
|
666
666
|
};
|
|
667
667
|
declare const Combobox: React$1.FC<ComboboxTypes<any>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -659,9 +659,9 @@ type ComboboxTypes<T> = {
|
|
|
659
659
|
placeholder?: string;
|
|
660
660
|
searchPlaceholder?: string;
|
|
661
661
|
popoverClassName?: string;
|
|
662
|
-
buttonClassName?: string;
|
|
663
662
|
/** This the same value as the one with the key valueKey */
|
|
664
663
|
defaultValue?: string;
|
|
664
|
+
preview?: boolean;
|
|
665
665
|
onChange?: (e: any) => void;
|
|
666
666
|
};
|
|
667
667
|
declare const Combobox: React$1.FC<ComboboxTypes<any>>;
|
package/dist/index.js
CHANGED
|
@@ -4991,8 +4991,8 @@ var Input = function(_param) {
|
|
|
4991
4991
|
}
|
|
4992
4992
|
})), props.iconInside && /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
4993
4993
|
className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2"
|
|
4994
|
-
}, props.iconInside),
|
|
4995
|
-
className: "hawa-my-0 hawa-text-xs hawa-text-helper-color"
|
|
4994
|
+
}, props.iconInside), /* @__PURE__ */ import_react24.default.createElement("p", {
|
|
4995
|
+
className: cn("hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all", props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0")
|
|
4996
4996
|
}, props.helperText))));
|
|
4997
4997
|
};
|
|
4998
4998
|
// components/elements/DataTable.tsx
|
|
@@ -6023,34 +6023,33 @@ var Combobox = function(_param) {
|
|
|
6023
6023
|
var getProperty = function getProperty(obj, key) {
|
|
6024
6024
|
return obj[key];
|
|
6025
6025
|
};
|
|
6026
|
-
var _param_labelKey = _param.labelKey, labelKey = _param_labelKey === void 0 ? "label" : _param_labelKey, _param_valueKey = _param.valueKey, valueKey = _param_valueKey === void 0 ? "value" : _param_valueKey, _param_defaultValue = _param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, popoverClassName = _param.popoverClassName,
|
|
6026
|
+
var _param_labelKey = _param.labelKey, labelKey = _param_labelKey === void 0 ? "label" : _param_labelKey, _param_valueKey = _param.valueKey, valueKey = _param_valueKey === void 0 ? "value" : _param_valueKey, _param_defaultValue = _param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, popoverClassName = _param.popoverClassName, data = _param.data, props = _object_without_properties(_param, [
|
|
6027
6027
|
"labelKey",
|
|
6028
6028
|
"valueKey",
|
|
6029
6029
|
"defaultValue",
|
|
6030
6030
|
"popoverClassName",
|
|
6031
|
-
"buttonClassName",
|
|
6032
6031
|
"data"
|
|
6033
6032
|
]);
|
|
6034
6033
|
var _React47_useState = _sliced_to_array(React47.useState(false), 2), open = _React47_useState[0], setOpen = _React47_useState[1];
|
|
6035
6034
|
var _React47_useState1 = _sliced_to_array(React47.useState(defaultValue), 2), value = _React47_useState1[0], setValue = _React47_useState1[1];
|
|
6036
6035
|
return /* @__PURE__ */ React47.createElement("div", {
|
|
6037
|
-
className: cn("hawa-flex hawa-flex-col hawa-gap-2", props.width === "fit" ? "hawa-w-fit" : "hawa-w-full")
|
|
6036
|
+
className: cn("hawa-flex hawa-flex-col hawa-gap-2 hawa-relative", props.width === "fit" ? "hawa-w-fit" : "hawa-w-full")
|
|
6038
6037
|
}, props.label && /* @__PURE__ */ React47.createElement(Label2, null, props.label), /* @__PURE__ */ React47.createElement(PopoverPrimitive2.Root, {
|
|
6039
6038
|
open: open,
|
|
6040
6039
|
onOpenChange: setOpen
|
|
6041
6040
|
}, /* @__PURE__ */ React47.createElement(PopoverTrigger, {
|
|
6042
|
-
disabled: props.isLoading
|
|
6043
|
-
asChild: true
|
|
6041
|
+
disabled: props.isLoading || props.preview
|
|
6044
6042
|
}, props.isLoading ? /* @__PURE__ */ React47.createElement(Skeleton, {
|
|
6045
6043
|
className: "hawa-h-[40px] hawa-w-full"
|
|
6046
|
-
}) : /* @__PURE__ */ React47.createElement(
|
|
6047
|
-
|
|
6044
|
+
}) : /* @__PURE__ */ React47.createElement("div", null, /* @__PURE__ */ React47.createElement("div", {
|
|
6045
|
+
className: cn("hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800", props.preview ? "hawa-opacity-100" : "hawa-opacity-0")
|
|
6046
|
+
}), /* @__PURE__ */ React47.createElement("button", {
|
|
6048
6047
|
role: "combobox",
|
|
6049
6048
|
"aria-expanded": open,
|
|
6050
|
-
className: cn("hawa-justify-between hawa-
|
|
6049
|
+
className: cn("hawa-bg-none hawa-inline-flex hawa-items-center hawa-transition-all hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50", "hawa-text-primary hawa-border hawa-h-10 hawa-py-2", "hawa-justify-between hawa-w-full hawa-font-normal", props.preview ? "hawa-px-0 hawa-rounded-none hawa-border-transparent hawa-cursor-default" : "hawa-px-4")
|
|
6051
6050
|
}, value ? getProperty(data.find(function(item) {
|
|
6052
6051
|
return item[valueKey] === value;
|
|
6053
|
-
}) || {}, labelKey) : props.placeholder || "...", /* @__PURE__ */ React47.createElement("svg", {
|
|
6052
|
+
}) || {}, labelKey) : props.placeholder || "...", !props.preview && /* @__PURE__ */ React47.createElement("svg", {
|
|
6054
6053
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6055
6054
|
className: "hawa-w-4 hawa-h-4",
|
|
6056
6055
|
viewBox: "0 0 24 24",
|
|
@@ -6061,7 +6060,7 @@ var Combobox = function(_param) {
|
|
|
6061
6060
|
strokeLinejoin: "round"
|
|
6062
6061
|
}, /* @__PURE__ */ React47.createElement("path", {
|
|
6063
6062
|
d: "m6 9 6 6 6-6"
|
|
6064
|
-
})))), /* @__PURE__ */ React47.createElement(PopoverContent, {
|
|
6063
|
+
}))))), /* @__PURE__ */ React47.createElement(PopoverContent, {
|
|
6065
6064
|
className: cn("popover-w-parent")
|
|
6066
6065
|
}, /* @__PURE__ */ React47.createElement(Command, null, /* @__PURE__ */ React47.createElement(CommandInput, {
|
|
6067
6066
|
placeholder: props.searchPlaceholder
|
|
@@ -6092,8 +6091,8 @@ var Combobox = function(_param) {
|
|
|
6092
6091
|
}, /* @__PURE__ */ React47.createElement("polyline", {
|
|
6093
6092
|
points: "20 6 9 17 4 12"
|
|
6094
6093
|
})), getProperty(item, labelKey));
|
|
6095
|
-
}))))),
|
|
6096
|
-
className: "hawa-text-xs hawa-text-helper-color"
|
|
6094
|
+
}))))), /* @__PURE__ */ React47.createElement("p", {
|
|
6095
|
+
className: cn("hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all", props.helperText && !props.isLoading ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0")
|
|
6097
6096
|
}, props.helperText));
|
|
6098
6097
|
};
|
|
6099
6098
|
// components/elements/Count.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -4615,7 +4615,16 @@ var Input = ({
|
|
|
4615
4615
|
disabled: preview,
|
|
4616
4616
|
style: { height: 40 }
|
|
4617
4617
|
}
|
|
4618
|
-
)), props.iconInside && /* @__PURE__ */ React36.createElement("div", { className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2" }, props.iconInside),
|
|
4618
|
+
)), props.iconInside && /* @__PURE__ */ React36.createElement("div", { className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2" }, props.iconInside), /* @__PURE__ */ React36.createElement(
|
|
4619
|
+
"p",
|
|
4620
|
+
{
|
|
4621
|
+
className: cn(
|
|
4622
|
+
"hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
|
4623
|
+
props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0"
|
|
4624
|
+
)
|
|
4625
|
+
},
|
|
4626
|
+
props.helperText
|
|
4627
|
+
)))
|
|
4619
4628
|
);
|
|
4620
4629
|
};
|
|
4621
4630
|
|
|
@@ -5688,7 +5697,6 @@ var Combobox = ({
|
|
|
5688
5697
|
valueKey = "value",
|
|
5689
5698
|
defaultValue = "",
|
|
5690
5699
|
popoverClassName,
|
|
5691
|
-
buttonClassName,
|
|
5692
5700
|
data,
|
|
5693
5701
|
...props
|
|
5694
5702
|
}) => {
|
|
@@ -5701,27 +5709,36 @@ var Combobox = ({
|
|
|
5701
5709
|
"div",
|
|
5702
5710
|
{
|
|
5703
5711
|
className: cn(
|
|
5704
|
-
"hawa-flex hawa-flex-col hawa-gap-2",
|
|
5712
|
+
"hawa-flex hawa-flex-col hawa-gap-2 hawa-relative",
|
|
5705
5713
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
|
5706
5714
|
)
|
|
5707
5715
|
},
|
|
5708
5716
|
props.label && /* @__PURE__ */ React47.createElement(Label2, null, props.label),
|
|
5709
|
-
/* @__PURE__ */ React47.createElement(PopoverPrimitive2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React47.createElement(PopoverTrigger, { disabled: props.isLoading
|
|
5710
|
-
|
|
5717
|
+
/* @__PURE__ */ React47.createElement(PopoverPrimitive2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React47.createElement(PopoverTrigger, { disabled: props.isLoading || props.preview }, props.isLoading ? /* @__PURE__ */ React47.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : /* @__PURE__ */ React47.createElement("div", null, /* @__PURE__ */ React47.createElement(
|
|
5718
|
+
"div",
|
|
5719
|
+
{
|
|
5720
|
+
className: cn(
|
|
5721
|
+
"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
|
|
5722
|
+
props.preview ? "hawa-opacity-100" : "hawa-opacity-0"
|
|
5723
|
+
)
|
|
5724
|
+
}
|
|
5725
|
+
), /* @__PURE__ */ React47.createElement(
|
|
5726
|
+
"button",
|
|
5711
5727
|
{
|
|
5712
|
-
variant: "combobox",
|
|
5713
5728
|
role: "combobox",
|
|
5714
5729
|
"aria-expanded": open,
|
|
5715
5730
|
className: cn(
|
|
5716
|
-
"hawa-
|
|
5717
|
-
|
|
5731
|
+
"hawa-bg-none hawa-inline-flex hawa-items-center hawa-transition-all hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
|
|
5732
|
+
"hawa-text-primary hawa-border hawa-h-10 hawa-py-2",
|
|
5733
|
+
"hawa-justify-between hawa-w-full hawa-font-normal",
|
|
5734
|
+
props.preview ? "hawa-px-0 hawa-rounded-none hawa-border-transparent hawa-cursor-default" : "hawa-px-4"
|
|
5718
5735
|
)
|
|
5719
5736
|
},
|
|
5720
5737
|
value ? getProperty(
|
|
5721
5738
|
data.find((item) => item[valueKey] === value) || {},
|
|
5722
5739
|
labelKey
|
|
5723
5740
|
) : props.placeholder || "...",
|
|
5724
|
-
/* @__PURE__ */ React47.createElement(
|
|
5741
|
+
!props.preview && /* @__PURE__ */ React47.createElement(
|
|
5725
5742
|
"svg",
|
|
5726
5743
|
{
|
|
5727
5744
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5735,7 +5752,7 @@ var Combobox = ({
|
|
|
5735
5752
|
},
|
|
5736
5753
|
/* @__PURE__ */ React47.createElement("path", { d: "m6 9 6 6 6-6" })
|
|
5737
5754
|
)
|
|
5738
|
-
)), /* @__PURE__ */ React47.createElement(PopoverContent, { className: cn("popover-w-parent") }, /* @__PURE__ */ React47.createElement(Command, null, /* @__PURE__ */ React47.createElement(CommandInput, { placeholder: props.searchPlaceholder }), /* @__PURE__ */ React47.createElement(CommandEmpty, null, "No framework found."), /* @__PURE__ */ React47.createElement(CommandGroup, { className: " hawa-max-h-[200px] hawa-overflow-y-auto" }, data.map((item) => /* @__PURE__ */ React47.createElement(
|
|
5755
|
+
))), /* @__PURE__ */ React47.createElement(PopoverContent, { className: cn("popover-w-parent") }, /* @__PURE__ */ React47.createElement(Command, null, /* @__PURE__ */ React47.createElement(CommandInput, { placeholder: props.searchPlaceholder }), /* @__PURE__ */ React47.createElement(CommandEmpty, null, "No framework found."), /* @__PURE__ */ React47.createElement(CommandGroup, { className: " hawa-max-h-[200px] hawa-overflow-y-auto" }, data.map((item) => /* @__PURE__ */ React47.createElement(
|
|
5739
5756
|
CommandItem,
|
|
5740
5757
|
{
|
|
5741
5758
|
key: getProperty(item, valueKey),
|
|
@@ -5771,7 +5788,16 @@ var Combobox = ({
|
|
|
5771
5788
|
),
|
|
5772
5789
|
getProperty(item, labelKey)
|
|
5773
5790
|
)))))),
|
|
5774
|
-
|
|
5791
|
+
/* @__PURE__ */ React47.createElement(
|
|
5792
|
+
"p",
|
|
5793
|
+
{
|
|
5794
|
+
className: cn(
|
|
5795
|
+
"hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
|
5796
|
+
props.helperText && !props.isLoading ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0"
|
|
5797
|
+
)
|
|
5798
|
+
},
|
|
5799
|
+
props.helperText
|
|
5800
|
+
)
|
|
5775
5801
|
);
|
|
5776
5802
|
};
|
|
5777
5803
|
|