native-variants 0.1.54 → 0.1.56

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.
@@ -2,6 +2,6 @@ import { PropsWithChildren } from "react";
2
2
  export declare const createCTX: <T>() => {
3
3
  CTXProvider: ({ children, props, }: PropsWithChildren & {
4
4
  props: T;
5
- }) => import("react").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
6
  useCTX: () => T | undefined;
7
7
  };
@@ -1 +1,25 @@
1
- import{createContext,useContext,useMemo}from"react";export const createCTX=()=>{const Context=createContext(undefined);const CTXProvider=({children,props})=>{const value=useMemo(()=>({props}),[props]);return React.createElement(Context.Provider,{value:value},children)};const useCTX=()=>{const context=useContext(Context);if(!context){return undefined}return context.props};return{CTXProvider,useCTX}};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCTX = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const createCTX = () => {
7
+ const Context = (0, react_1.createContext)(undefined);
8
+ const CTXProvider = ({ children, props, }) => {
9
+ const value = (0, react_1.useMemo)(() => ({ props }), [props]);
10
+ return (0, jsx_runtime_1.jsx)(Context.Provider, { value: value, children: children });
11
+ };
12
+ const useCTX = () => {
13
+ const context = (0, react_1.useContext)(Context);
14
+ if (!context) {
15
+ return undefined;
16
+ }
17
+ return context.props;
18
+ };
19
+ return {
20
+ CTXProvider,
21
+ useCTX,
22
+ };
23
+ };
24
+ exports.createCTX = createCTX;
25
+ //# sourceMappingURL=create-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src/provider/create-provider.tsx"],"names":[],"mappings":";;;;AAAA,iCAA8E;AAMvE,MAAM,SAAS,GAAG,GAAO,EAAE;IAChC,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAgC,SAAS,CAAC,CAAC;IAExE,MAAM,WAAW,GAAG,CAAC,EACnB,QAAQ,EACR,KAAK,GAGN,EAAE,EAAE;QACH,MAAM,KAAK,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAElD,OAAO,uBAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAoB,CAAC;IACvE,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,GAAkB,EAAE;QACjC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,OAAO,CAAC,KAAU,CAAC;IAC5B,CAAC,CAAC;IAEF,OAAO;QACL,WAAW;QACX,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,SAAS,aA4BpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-variants",
3
- "version": "0.1.54",
3
+ "version": "0.1.56",
4
4
  "description": "A library for handling variants in React Native components with theme support.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,8 +41,8 @@
41
41
  "typescript-eslint": "^8.18.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": "19.0.0",
45
- "react-native": "0.80.2"
44
+ "react": "^18",
45
+ "react-native": "^0.78"
46
46
  },
47
47
  "packageManager": "yarn@1.22.22"
48
48
  }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCTX = void 0;
4
- const react_1 = require("react");
5
- const createCTX = () => {
6
- const Context = (0, react_1.createContext)(undefined);
7
- const CTXProvider = ({ children, props, }) => {
8
- const value = (0, react_1.useMemo)(() => ({ props }), [props]);
9
- return <Context.Provider value={value}>{children}</Context.Provider>;
10
- };
11
- const useCTX = () => {
12
- const context = (0, react_1.useContext)(Context);
13
- if (!context) {
14
- return undefined;
15
- }
16
- return context.props;
17
- };
18
- return {
19
- CTXProvider,
20
- useCTX,
21
- };
22
- };
23
- exports.createCTX = createCTX;
24
- //# sourceMappingURL=create-provider.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-provider.jsx","sourceRoot":"","sources":["../../src/provider/create-provider.tsx"],"names":[],"mappings":";;;AAAA,iCAA8E;AAMvE,MAAM,SAAS,GAAG,GAAO,EAAE;IAChC,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAgC,SAAS,CAAC,CAAC;IAExE,MAAM,WAAW,GAAG,CAAC,EACnB,QAAQ,EACR,KAAK,GAGN,EAAE,EAAE;QACH,MAAM,KAAK,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAElD,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,GAAkB,EAAE;QACjC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,OAAO,CAAC,KAAU,CAAC;IAC5B,CAAC,CAAC;IAEF,OAAO;QACL,WAAW;QACX,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,SAAS,aA4BpB"}