@radix-ui/react-direction 1.0.1 → 1.1.0-rc.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/index.d.mts CHANGED
@@ -1,11 +1,12 @@
1
- import * as React from "react";
2
- type Direction = 'ltr' | 'rtl';
1
+ import * as React from 'react';
2
+
3
+ declare type Direction = 'ltr' | 'rtl';
3
4
  interface DirectionProviderProps {
4
5
  children?: React.ReactNode;
5
6
  dir: Direction;
6
7
  }
7
- export const DirectionProvider: React.FC<DirectionProviderProps>;
8
- export function useDirection(localDir?: Direction): Direction;
9
- export const Provider: React.FC<DirectionProviderProps>;
8
+ declare const DirectionProvider: React.FC<DirectionProviderProps>;
9
+ declare function useDirection(localDir?: Direction): Direction;
10
+ declare const Provider: React.FC<DirectionProviderProps>;
10
11
 
11
- //# sourceMappingURL=index.d.ts.map
12
+ export { DirectionProvider, Provider, useDirection };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import * as React from "react";
2
- type Direction = 'ltr' | 'rtl';
1
+ import * as React from 'react';
2
+
3
+ declare type Direction = 'ltr' | 'rtl';
3
4
  interface DirectionProviderProps {
4
5
  children?: React.ReactNode;
5
6
  dir: Direction;
6
7
  }
7
- export const DirectionProvider: React.FC<DirectionProviderProps>;
8
- export function useDirection(localDir?: Direction): Direction;
9
- export const Provider: React.FC<DirectionProviderProps>;
8
+ declare const DirectionProvider: React.FC<DirectionProviderProps>;
9
+ declare function useDirection(localDir?: Direction): Direction;
10
+ declare const Provider: React.FC<DirectionProviderProps>;
10
11
 
11
- //# sourceMappingURL=index.d.ts.map
12
+ export { DirectionProvider, Provider, useDirection };
package/dist/index.js CHANGED
@@ -1,29 +1,46 @@
1
- var $9g4ps$react = require("react");
2
-
3
- function $parcel$export(e, n, v, s) {
4
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
5
- }
6
-
7
- $parcel$export(module.exports, "useDirection", () => $cc45c1b701a63adc$export$b39126d51d94e6f3);
8
- $parcel$export(module.exports, "Provider", () => $cc45c1b701a63adc$export$2881499e37b75b9a);
9
- $parcel$export(module.exports, "DirectionProvider", () => $cc45c1b701a63adc$export$c760c09fdd558351);
10
-
11
- const $cc45c1b701a63adc$var$DirectionContext = /*#__PURE__*/ $9g4ps$react.createContext(undefined);
12
- /* -------------------------------------------------------------------------------------------------
13
- * Direction
14
- * -----------------------------------------------------------------------------------------------*/ const $cc45c1b701a63adc$export$c760c09fdd558351 = (props)=>{
15
- const { dir: dir , children: children } = props;
16
- return /*#__PURE__*/ $9g4ps$react.createElement($cc45c1b701a63adc$var$DirectionContext.Provider, {
17
- value: dir
18
- }, children);
19
- };
20
- /* -----------------------------------------------------------------------------------------------*/ function $cc45c1b701a63adc$export$b39126d51d94e6f3(localDir) {
21
- const globalDir = $9g4ps$react.useContext($cc45c1b701a63adc$var$DirectionContext);
22
- return localDir || globalDir || 'ltr';
23
- }
24
- const $cc45c1b701a63adc$export$2881499e37b75b9a = $cc45c1b701a63adc$export$c760c09fdd558351;
25
-
26
-
27
-
1
+ "use strict";
2
+ (() => {
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
28
31
 
32
+ // packages/react/direction/src/Direction.tsx
33
+ var React = __toESM(__require("react"));
34
+ var import_jsx_runtime = __require("react/jsx-runtime");
35
+ var DirectionContext = React.createContext(void 0);
36
+ var DirectionProvider = (props) => {
37
+ const { dir, children } = props;
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionContext.Provider, { value: dir, children });
39
+ };
40
+ function useDirection(localDir) {
41
+ const globalDir = React.useContext(DirectionContext);
42
+ return localDir || globalDir || "ltr";
43
+ }
44
+ var Provider = DirectionProvider;
45
+ })();
29
46
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"mappings":";;;;;;;;;ACAA;AAGA,MAAMI,sCAAgB,GAAA,aAAGD,CAAAA,0BAAA,CAA2CG,SAA3C,CAAzB,AAAA;AAEA;;oGAEA,CAMA,MAAMJ,yCAAmD,GAAIK,CAAAA,KAAD,GAAW;IACrE,MAAM,EAdR,KAcUC,GAAF,CAAA,EAdR,UAceC,QAAAA,CAAAA,EAAP,GAAoBF,KAA1B,AAAM;IACN,OAAA,aAAO,CAAA,0BAAA,CAAC,sCAAD,CAAkB,QAAlB,EAAP;QAAkC,KAAK,EAAEC,GAAP;KAA3B,EAAwCC,QAAxC,CAAP,CAAO;CAFT,AAGC;AAED,oGAAA,CAEA,SAAST,yCAAT,CAAsBU,QAAtB,EAA4C;IAC1C,MAAMC,SAAS,GAAGR,uBAAA,CAAiBC,sCAAjB,CAAlB,AAAA;IACA,OAAOM,QAAQ,IAAIC,SAAZ,IAAyB,KAAhC,CAAA;CACD;AAED,MAAMV,yCAAQ,GAAGC,yCAAjB,AAAA;;ADzBA","sources":["packages/react/direction/src/index.ts","packages/react/direction/src/Direction.tsx"],"sourcesContent":["export {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n} from './Direction';\n","import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"],"names":["useDirection","Provider","DirectionProvider","React","DirectionContext","createContext","undefined","props","dir","children","localDir","globalDir","useContext"],"version":3,"file":"index.js.map"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Direction.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAuB;AAed;AAZT,MAAM,mBAAyB,oBAAqC,MAAS;AAU7E,MAAM,oBAAsD,CAAC,UAAU;AACrE,UAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,WAAO,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAAA,EAC1D;AAIA,WAAS,aAAa,UAAsB;AAC1C,UAAM,YAAkB,iBAAW,gBAAgB;AACnD,WAAO,YAAY,aAAa;AAAA,EAClC;AAEA,MAAM,WAAW;",
6
+ "names": []
7
+ }
package/dist/index.mjs CHANGED
@@ -1,23 +1,19 @@
1
- import {createContext as $7Gjcd$createContext, createElement as $7Gjcd$createElement, useContext as $7Gjcd$useContext} from "react";
2
-
3
-
4
- const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ $7Gjcd$createContext(undefined);
5
- /* -------------------------------------------------------------------------------------------------
6
- * Direction
7
- * -----------------------------------------------------------------------------------------------*/ const $f631663db3294ace$export$c760c09fdd558351 = (props)=>{
8
- const { dir: dir , children: children } = props;
9
- return /*#__PURE__*/ $7Gjcd$createElement($f631663db3294ace$var$DirectionContext.Provider, {
10
- value: dir
11
- }, children);
1
+ // packages/react/direction/src/Direction.tsx
2
+ import * as React from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var DirectionContext = React.createContext(void 0);
5
+ var DirectionProvider = (props) => {
6
+ const { dir, children } = props;
7
+ return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });
12
8
  };
13
- /* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
14
- const globalDir = $7Gjcd$useContext($f631663db3294ace$var$DirectionContext);
15
- return localDir || globalDir || 'ltr';
9
+ function useDirection(localDir) {
10
+ const globalDir = React.useContext(DirectionContext);
11
+ return localDir || globalDir || "ltr";
16
12
  }
17
- const $f631663db3294ace$export$2881499e37b75b9a = $f631663db3294ace$export$c760c09fdd558351;
18
-
19
-
20
-
21
-
22
- export {$f631663db3294ace$export$b39126d51d94e6f3 as useDirection, $f631663db3294ace$export$2881499e37b75b9a as Provider, $f631663db3294ace$export$c760c09fdd558351 as DirectionProvider};
13
+ var Provider = DirectionProvider;
14
+ export {
15
+ DirectionProvider,
16
+ Provider,
17
+ useDirection
18
+ };
23
19
  //# sourceMappingURL=index.mjs.map
@@ -1 +1,7 @@
1
- {"mappings":";;ACAA;AAGA,MAAMI,sCAAgB,GAAA,aAAGD,CAAAA,oBAAA,CAA2CG,SAA3C,CAAzB,AAAA;AAEA;;oGAEA,CAMA,MAAMJ,yCAAmD,GAAIK,CAAAA,KAAD,GAAW;IACrE,MAAM,EAdR,KAcUC,GAAF,CAAA,EAdR,UAceC,QAAAA,CAAAA,EAAP,GAAoBF,KAA1B,AAAM;IACN,OAAA,aAAO,CAAA,oBAAA,CAAC,sCAAD,CAAkB,QAAlB,EAAP;QAAkC,KAAK,EAAEC,GAAP;KAA3B,EAAwCC,QAAxC,CAAP,CAAO;CAFT,AAGC;AAED,oGAAA,CAEA,SAAST,yCAAT,CAAsBU,QAAtB,EAA4C;IAC1C,MAAMC,SAAS,GAAGR,iBAAA,CAAiBC,sCAAjB,CAAlB,AAAA;IACA,OAAOM,QAAQ,IAAIC,SAAZ,IAAyB,KAAhC,CAAA;CACD;AAED,MAAMV,yCAAQ,GAAGC,yCAAjB,AAAA;;ADzBA","sources":["packages/react/direction/src/index.ts","packages/react/direction/src/Direction.tsx"],"sourcesContent":["export {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n} from './Direction';\n","import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"],"names":["useDirection","Provider","DirectionProvider","React","DirectionContext","createContext","undefined","props","dir","children","localDir","globalDir","useContext"],"version":3,"file":"index.mjs.map"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Direction.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"],
5
+ "mappings": ";AAAA,YAAY,WAAW;AAed;AAZT,IAAM,mBAAyB,oBAAqC,MAAS;AAU7E,IAAM,oBAAsD,CAAC,UAAU;AACrE,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAC1D;AAIA,SAAS,aAAa,UAAsB;AAC1C,QAAM,YAAkB,iBAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEA,IAAM,WAAW;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-direction",
3
- "version": "1.0.1",
3
+ "version": "1.1.0-rc.2",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -44,7 +44,5 @@
44
44
  "bugs": {
45
45
  "url": "https://github.com/radix-ui/primitives/issues"
46
46
  },
47
- "dependencies": {
48
- "@babel/runtime": "^7.13.10"
49
- }
47
+ "stableVersion": "1.0.1"
50
48
  }
@@ -1 +0,0 @@
1
- {"mappings":";AAEA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAO/B;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,GAAG,EAAE,SAAS,CAAC;CAChB;AACD,OAAA,MAAM,mBAAmB,MAAM,EAAE,CAAC,sBAAsB,CAGvD,CAAC;AAIF,6BAAsB,QAAQ,CAAC,EAAE,SAAS,aAGzC;AAED,OAAA,MAAM,0CAA4B,CAAC","sources":["packages/react/direction/src/packages/react/direction/src/Direction.tsx","packages/react/direction/src/packages/react/direction/src/index.ts","packages/react/direction/src/index.ts"],"sourcesContent":[null,null,"export {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n} from './Direction';\n"],"names":[],"version":3,"file":"index.d.ts.map"}