@radix-ui/react-direction 0.1.0-rc.3 → 0.1.0-rc.6
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.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -1
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +30 -1
- package/dist/index.module.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
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 * from './Direction';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,47 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $9g4ps$react = require("react");
|
|
2
|
+
|
|
3
|
+
function $parcel$exportWildcard(dest, source) {
|
|
4
|
+
Object.keys(source).forEach(function(key) {
|
|
5
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(dest, key, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function get() {
|
|
12
|
+
return source[key];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return dest;
|
|
18
|
+
}
|
|
19
|
+
function $parcel$export(e, n, v, s) {
|
|
20
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
21
|
+
}
|
|
22
|
+
var $cc45c1b701a63adc$exports = {};
|
|
23
|
+
|
|
24
|
+
$parcel$export($cc45c1b701a63adc$exports, "DirectionProvider", () => $cc45c1b701a63adc$export$c760c09fdd558351);
|
|
25
|
+
$parcel$export($cc45c1b701a63adc$exports, "useDirection", () => $cc45c1b701a63adc$export$b39126d51d94e6f3);
|
|
26
|
+
$parcel$export($cc45c1b701a63adc$exports, "Provider", () => $cc45c1b701a63adc$export$2881499e37b75b9a);
|
|
27
|
+
|
|
28
|
+
const $cc45c1b701a63adc$var$DirectionContext = /*#__PURE__*/ $9g4ps$react.createContext(undefined);
|
|
29
|
+
/* -------------------------------------------------------------------------------------------------
|
|
30
|
+
* Direction
|
|
31
|
+
* -----------------------------------------------------------------------------------------------*/ const $cc45c1b701a63adc$export$c760c09fdd558351 = (props)=>{
|
|
32
|
+
const { dir: dir , children: children } = props;
|
|
33
|
+
return /*#__PURE__*/ $9g4ps$react.createElement($cc45c1b701a63adc$var$DirectionContext.Provider, {
|
|
34
|
+
value: dir
|
|
35
|
+
}, children);
|
|
36
|
+
};
|
|
37
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cc45c1b701a63adc$export$b39126d51d94e6f3(localDir) {
|
|
38
|
+
const globalDir = $9g4ps$react.useContext($cc45c1b701a63adc$var$DirectionContext);
|
|
39
|
+
return localDir || globalDir || 'ltr';
|
|
40
|
+
}
|
|
41
|
+
const $cc45c1b701a63adc$export$2881499e37b75b9a = $cc45c1b701a63adc$export$c760c09fdd558351;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
$parcel$exportWildcard(module.exports, $cc45c1b701a63adc$exports);
|
|
45
|
+
|
|
46
|
+
|
|
2
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AAGA,MAAMC,sCAAgB,GAAA,aAAGD,CAAAA,0BAAA,CAA2CG,SAA3C,CAAzB,AAAA;AAEA;;oGAEA,CAMA,MAAMC,yCAAmD,GAAIC,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,SAASC,yCAAT,CAAsBC,QAAtB,EAA4C;IAC1C,MAAMC,SAAS,GAAGV,uBAAA,CAAiBC,sCAAjB,CAAlB,AAAA;IACA,OAAOQ,QAAQ,IAAIC,SAAZ,IAAyB,KAAhC,CAAA;CACD;AAED,MAAME,yCAAQ,GAAGR,yCAAjB,AAAA;;ADzBA","sources":["packages/react/direction/src/index.ts","packages/react/direction/src/Direction.tsx"],"sourcesContent":["export * 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":["React","DirectionContext","createContext","undefined","DirectionProvider","props","dir","children","useDirection","localDir","globalDir","useContext","Provider"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {createContext as $7Gjcd$createContext, createElement as $7Gjcd$createElement, useContext as $7Gjcd$useContext} from "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
|
+
var $f631663db3294ace$exports = {};
|
|
7
|
+
|
|
8
|
+
$parcel$export($f631663db3294ace$exports, "DirectionProvider", () => $f631663db3294ace$export$c760c09fdd558351);
|
|
9
|
+
$parcel$export($f631663db3294ace$exports, "useDirection", () => $f631663db3294ace$export$b39126d51d94e6f3);
|
|
10
|
+
$parcel$export($f631663db3294ace$exports, "Provider", () => $f631663db3294ace$export$2881499e37b75b9a);
|
|
11
|
+
|
|
12
|
+
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ $7Gjcd$createContext(undefined);
|
|
13
|
+
/* -------------------------------------------------------------------------------------------------
|
|
14
|
+
* Direction
|
|
15
|
+
* -----------------------------------------------------------------------------------------------*/ const $f631663db3294ace$export$c760c09fdd558351 = (props)=>{
|
|
16
|
+
const { dir: dir , children: children } = props;
|
|
17
|
+
return /*#__PURE__*/ $7Gjcd$createElement($f631663db3294ace$var$DirectionContext.Provider, {
|
|
18
|
+
value: dir
|
|
19
|
+
}, children);
|
|
20
|
+
};
|
|
21
|
+
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
22
|
+
const globalDir = $7Gjcd$useContext($f631663db3294ace$var$DirectionContext);
|
|
23
|
+
return localDir || globalDir || 'ltr';
|
|
24
|
+
}
|
|
25
|
+
const $f631663db3294ace$export$2881499e37b75b9a = $f631663db3294ace$export$c760c09fdd558351;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export {$f631663db3294ace$export$c760c09fdd558351 as DirectionProvider, $f631663db3294ace$export$b39126d51d94e6f3 as useDirection, $f631663db3294ace$export$2881499e37b75b9a as Provider};
|
|
2
31
|
//# sourceMappingURL=index.module.js.map
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;ACAA;AAGA,MAAMC,sCAAgB,GAAA,aAAGD,CAAAA,oBAAA,CAA2CG,SAA3C,CAAzB,AAAA;AAEA;;oGAEA,CAMA,MAAMC,yCAAmD,GAAIC,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,SAASC,yCAAT,CAAsBC,QAAtB,EAA4C;IAC1C,MAAMC,SAAS,GAAGV,iBAAA,CAAiBC,sCAAjB,CAAlB,AAAA;IACA,OAAOQ,QAAQ,IAAIC,SAAZ,IAAyB,KAAhC,CAAA;CACD;AAED,MAAME,yCAAQ,GAAGR,yCAAjB,AAAA;;ADzBA","sources":["packages/react/direction/src/index.ts","packages/react/direction/src/Direction.tsx"],"sourcesContent":["export * 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":["React","DirectionContext","createContext","undefined","DirectionProvider","props","dir","children","useDirection","localDir","globalDir","useContext","Provider"],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-direction",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"version": "yarn version"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"react": "^16.8 || ^17.0"
|
|
19
|
+
"react": "^16.8 || ^17.0 || ^18.0"
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://radix-ui.com/primitives",
|
|
22
22
|
"repository": {
|