@tamagui/use-direction 1.14.1 → 1.14.2

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/cjs/index.js CHANGED
@@ -1,2 +1,19 @@
1
- "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("./useDirection"),module.exports);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var src_exports = {};
17
+ module.exports = __toCommonJS(src_exports);
18
+ __reExport(src_exports, require("./useDirection"), module.exports);
2
19
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './useDirection'\n"],
5
- "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,0BAAd",
6
- "names": ["src_exports", "__toCommonJS", "__reExport"]
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,2BAAd;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,54 @@
1
- "use strict";var l=Object.create;var o=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var x=(e,r)=>{for(var t in r)o(e,t,{get:r[t],enumerable:!0})},c=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of p(r))!v.call(e,i)&&i!==t&&o(e,i,{get:()=>r[i],enumerable:!(n=P(r,i))||n.enumerable});return e};var f=(e,r,t)=>(t=e!=null?l(u(e)):{},c(r||!e||!e.__esModule?o(t,"default",{value:e,enumerable:!0}):t,e)),C=e=>c(o({},"__esModule",{value:!0}),e);var b={};x(b,{DirectionProvider:()=>s,Provider:()=>h,useDirection:()=>R});module.exports=C(b);var a=require("react/jsx-runtime"),d=f(require("react"));const D=d.createContext(void 0),s=e=>{const{dir:r,children:t}=e;return(0,a.jsx)(D.Provider,{value:r,children:t})};function R(e){const r=d.useContext(D);return e||r||"ltr"}const h=s;0&&(module.exports={DirectionProvider,Provider,useDirection});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useDirection_exports = {};
30
+ __export(useDirection_exports, {
31
+ DirectionProvider: () => DirectionProvider,
32
+ Provider: () => Provider,
33
+ useDirection: () => useDirection
34
+ });
35
+ module.exports = __toCommonJS(useDirection_exports);
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var React = __toESM(require("react"));
38
+ const DirectionContext = React.createContext(void 0);
39
+ const DirectionProvider = (props) => {
40
+ const { dir, children } = props;
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionContext.Provider, { value: dir, children });
42
+ };
43
+ function useDirection(localDir) {
44
+ const globalDir = React.useContext(DirectionContext);
45
+ return localDir || globalDir || "ltr";
46
+ }
47
+ const Provider = DirectionProvider;
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ DirectionProvider,
51
+ Provider,
52
+ useDirection
53
+ });
2
54
  //# sourceMappingURL=useDirection.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useDirection.tsx"],
4
4
  "sourcesContent": ["// forked from https://github.com/radix-ui/primitives/blob/main/packages/react/direction/src/Direction.tsx\n\nimport * as React from 'react'\n\ntype Direction = 'ltr' | 'rtl'\nconst DirectionContext = React.createContext<Direction | undefined>(undefined)\n\ninterface DirectionProviderProps {\n children?: React.ReactNode\n dir: Direction\n}\n\nexport const DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props\n return (\n <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>\n )\n}\n\nexport function useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext)\n return localDir || globalDir || 'ltr'\n}\n\nexport const Provider = DirectionProvider\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,aAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAL,GAeI,IAAAM,EAAA,6BAbJC,EAAuB,oBAGvB,MAAMC,EAAmBD,EAAM,cAAqC,MAAS,EAOhEL,EAAuDO,GAAU,CAC5E,KAAM,CAAE,IAAAC,EAAK,SAAAC,CAAS,EAAIF,EAC1B,SACE,OAACD,EAAiB,SAAjB,CAA0B,MAAOE,EAAM,SAAAC,EAAS,CAErD,EAEO,SAASP,EAAaQ,EAAsB,CACjD,MAAMC,EAAYN,EAAM,WAAWC,CAAgB,EACnD,OAAOI,GAAYC,GAAa,KAClC,CAEO,MAAMV,EAAWD",
6
- "names": ["useDirection_exports", "__export", "DirectionProvider", "Provider", "useDirection", "__toCommonJS", "import_jsx_runtime", "React", "DirectionContext", "props", "dir", "children", "localDir", "globalDir"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeI;AAbJ,YAAuB;AAGvB,MAAM,mBAAmB,MAAM,cAAqC,MAAS;AAOtE,MAAM,oBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SACE,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAErD;AAEO,SAAS,aAAa,UAAsB;AACjD,QAAM,YAAY,MAAM,WAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEO,MAAM,WAAW;",
6
+ "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export*from"./useDirection";
1
+ export * from "./useDirection";
2
2
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './useDirection'\n"],
5
- "mappings": "AAAA,WAAc",
5
+ "mappings": "AAAA,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- export*from"./useDirection";
1
+ export * from "./useDirection";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './useDirection'\n"],
5
- "mappings": "AAAA,WAAc",
5
+ "mappings": "AAAA,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,18 @@
1
- import{jsx as c}from"react/jsx-runtime";import*as t from"react";const i=t.createContext(void 0),n=e=>{const{dir:r,children:o}=e;return c(i.Provider,{value:r,children:o})};function d(e){const r=t.useContext(i);return e||r||"ltr"}const D=n;export{n as DirectionProvider,D as Provider,d as useDirection};
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ const DirectionContext = React.createContext(void 0);
4
+ const DirectionProvider = (props) => {
5
+ const { dir, children } = props;
6
+ return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });
7
+ };
8
+ function useDirection(localDir) {
9
+ const globalDir = React.useContext(DirectionContext);
10
+ return localDir || globalDir || "ltr";
11
+ }
12
+ const Provider = DirectionProvider;
13
+ export {
14
+ DirectionProvider,
15
+ Provider,
16
+ useDirection
17
+ };
2
18
  //# sourceMappingURL=useDirection.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useDirection.tsx"],
4
4
  "sourcesContent": ["// forked from https://github.com/radix-ui/primitives/blob/main/packages/react/direction/src/Direction.tsx\n\nimport * as React from 'react'\n\ntype Direction = 'ltr' | 'rtl'\nconst DirectionContext = React.createContext<Direction | undefined>(undefined)\n\ninterface DirectionProviderProps {\n children?: React.ReactNode\n dir: Direction\n}\n\nexport const DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props\n return (\n <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>\n )\n}\n\nexport function useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext)\n return localDir || globalDir || 'ltr'\n}\n\nexport const Provider = DirectionProvider\n"],
5
- "mappings": "AAeI,cAAAA,MAAA,oBAbJ,UAAYC,MAAW,QAGvB,MAAMC,EAAmBD,EAAM,cAAqC,MAAS,EAOhEE,EAAuDC,GAAU,CAC5E,KAAM,CAAE,IAAAC,EAAK,SAAAC,CAAS,EAAIF,EAC1B,OACEJ,EAACE,EAAiB,SAAjB,CAA0B,MAAOG,EAAM,SAAAC,EAAS,CAErD,EAEO,SAASC,EAAaC,EAAsB,CACjD,MAAMC,EAAYR,EAAM,WAAWC,CAAgB,EACnD,OAAOM,GAAYC,GAAa,KAClC,CAEO,MAAMC,EAAWP",
6
- "names": ["jsx", "React", "DirectionContext", "DirectionProvider", "props", "dir", "children", "useDirection", "localDir", "globalDir", "Provider"]
5
+ "mappings": "AAeI;AAbJ,YAAY,WAAW;AAGvB,MAAM,mBAAmB,MAAM,cAAqC,MAAS;AAOtE,MAAM,oBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAErD;AAEO,SAAS,aAAa,UAAsB;AACjD,QAAM,YAAY,MAAM,WAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEO,MAAM,WAAW;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,18 @@
1
- import{jsx as c}from"react/jsx-runtime";import*as t from"react";const i=t.createContext(void 0),n=e=>{const{dir:r,children:o}=e;return c(i.Provider,{value:r,children:o})};function d(e){const r=t.useContext(i);return e||r||"ltr"}const D=n;export{n as DirectionProvider,D as Provider,d as useDirection};
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ const DirectionContext = React.createContext(void 0);
4
+ const DirectionProvider = (props) => {
5
+ const { dir, children } = props;
6
+ return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });
7
+ };
8
+ function useDirection(localDir) {
9
+ const globalDir = React.useContext(DirectionContext);
10
+ return localDir || globalDir || "ltr";
11
+ }
12
+ const Provider = DirectionProvider;
13
+ export {
14
+ DirectionProvider,
15
+ Provider,
16
+ useDirection
17
+ };
2
18
  //# sourceMappingURL=useDirection.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useDirection.tsx"],
4
4
  "sourcesContent": ["// forked from https://github.com/radix-ui/primitives/blob/main/packages/react/direction/src/Direction.tsx\n\nimport * as React from 'react'\n\ntype Direction = 'ltr' | 'rtl'\nconst DirectionContext = React.createContext<Direction | undefined>(undefined)\n\ninterface DirectionProviderProps {\n children?: React.ReactNode\n dir: Direction\n}\n\nexport const DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props\n return (\n <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>\n )\n}\n\nexport function useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext)\n return localDir || globalDir || 'ltr'\n}\n\nexport const Provider = DirectionProvider\n"],
5
- "mappings": "AAeI,cAAAA,MAAA,oBAbJ,UAAYC,MAAW,QAGvB,MAAMC,EAAmBD,EAAM,cAAqC,MAAS,EAOhEE,EAAuDC,GAAU,CAC5E,KAAM,CAAE,IAAAC,EAAK,SAAAC,CAAS,EAAIF,EAC1B,OACEJ,EAACE,EAAiB,SAAjB,CAA0B,MAAOG,EAAM,SAAAC,EAAS,CAErD,EAEO,SAASC,EAAaC,EAAsB,CACjD,MAAMC,EAAYR,EAAM,WAAWC,CAAgB,EACnD,OAAOM,GAAYC,GAAa,KAClC,CAEO,MAAMC,EAAWP",
6
- "names": ["jsx", "React", "DirectionContext", "DirectionProvider", "props", "dir", "children", "useDirection", "localDir", "globalDir", "Provider"]
5
+ "mappings": "AAeI;AAbJ,YAAY,WAAW;AAGvB,MAAM,mBAAmB,MAAM,cAAqC,MAAS;AAOtE,MAAM,oBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAErD;AAEO,SAAS,aAAa,UAAsB;AACjD,QAAM,YAAY,MAAM,WAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEO,MAAM,WAAW;",
6
+ "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-direction",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "devDependencies": {
29
- "@tamagui/build": "1.14.1",
29
+ "@tamagui/build": "1.14.2",
30
30
  "react": "^18.2.0"
31
31
  },
32
32
  "peerDependencies": {