@telepix-lab/telepix-ui 0.3.3 → 0.3.4
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/esm/client.js +6 -6
- package/package.json +1 -1
package/dist/esm/client.js
CHANGED
|
@@ -12325,14 +12325,14 @@ const HORIZONTAL_TAB_SIZES = {
|
|
|
12325
12325
|
SMALL: "small",
|
|
12326
12326
|
};
|
|
12327
12327
|
|
|
12328
|
-
const HorizontalTabContext =
|
|
12328
|
+
const HorizontalTabContext = createContext({
|
|
12329
12329
|
value: "",
|
|
12330
12330
|
disabled: false,
|
|
12331
12331
|
setSelectedTab: () => { },
|
|
12332
12332
|
});
|
|
12333
|
-
const HorizontalTabs =
|
|
12334
|
-
const [selectedTab, setSelectedTab] =
|
|
12335
|
-
|
|
12333
|
+
const HorizontalTabs = forwardRef(({ disabled, value, onValueChange, className, ...rest }, ref) => {
|
|
12334
|
+
const [selectedTab, setSelectedTab] = useState(value || "");
|
|
12335
|
+
useEffect(() => {
|
|
12336
12336
|
if (!onValueChange)
|
|
12337
12337
|
return;
|
|
12338
12338
|
onValueChange(selectedTab);
|
|
@@ -12343,8 +12343,8 @@ const HorizontalTabs = React__default.forwardRef(({ disabled, value, onValueChan
|
|
|
12343
12343
|
setSelectedTab,
|
|
12344
12344
|
}, children: jsx("div", { ref: ref, className: cn("flex items-center justify-start w-full", className), ...rest, children: rest.children }) }));
|
|
12345
12345
|
});
|
|
12346
|
-
const HorizontalTab =
|
|
12347
|
-
const { value: selectedTab, setSelectedTab, disabled, } =
|
|
12346
|
+
const HorizontalTab = forwardRef(({ value, label, className, icon, size = "regular", ...rest }, ref) => {
|
|
12347
|
+
const { value: selectedTab, setSelectedTab, disabled, } = useContext(HorizontalTabContext);
|
|
12348
12348
|
const isSelected = selectedTab === value;
|
|
12349
12349
|
const isDisabled = disabled || rest.disabled;
|
|
12350
12350
|
const handleClick = () => {
|