UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

52 lines (51 loc) 1.91 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var useTabs_exports = {}; __export(useTabs_exports, { useTabs: () => useTabs }); module.exports = __toCommonJS(useTabs_exports); var import_react = require("react"); var import_react_native_reanimated = require("react-native-reanimated"); var import_core = require("@crossed/core"); const useTabs = (state) => { const [value, setValue] = (0, import_core.useUncontrolled)(state); const listTabRef = (0, import_react.useRef)(); const left = (0, import_react_native_reanimated.useSharedValue)(0); const width = (0, import_react_native_reanimated.useSharedValue)(0); const scroll = (0, import_react_native_reanimated.useSharedValue)(0); const widthLayout = (0, import_react_native_reanimated.useSharedValue)(0); const id = (0, import_react.useId)(); const [shouldShow, setShow] = (0, import_react.useState)(false); return { listTabRef, value, setValue, indicator: { left, width }, scroll, widthLayout, id, shouldShow, setShow }; }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { useTabs }); //# sourceMappingURL=useTabs.js.map