@radix-ui/react-direction 1.0.0-rc.1 → 1.0.1-rc.1
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
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type Direction = 'ltr' | 'rtl';
|
|
3
|
+
interface DirectionProviderProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
dir: Direction;
|
|
6
|
+
}
|
|
7
|
+
export const DirectionProvider: React.FC<DirectionProviderProps>;
|
|
8
|
+
export function useDirection(localDir?: Direction): Direction;
|
|
9
|
+
export const Provider: React.FC<DirectionProviderProps>;
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -20,4 +20,4 @@ const $f631663db3294ace$export$2881499e37b75b9a = $f631663db3294ace$export$c760c
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
export {$f631663db3294ace$export$b39126d51d94e6f3 as useDirection, $f631663db3294ace$export$2881499e37b75b9a as Provider, $f631663db3294ace$export$c760c09fdd558351 as DirectionProvider};
|
|
23
|
-
//# sourceMappingURL=index.
|
|
23
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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.
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-direction",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"import": {
|
|
8
|
+
"types": "./dist/index.d.mts",
|
|
9
|
+
"default": "./dist/index.mjs"
|
|
10
|
+
},
|
|
11
|
+
"require": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"source": "./src/index.ts",
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"module": "./dist/index.mjs",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
9
21
|
"files": [
|
|
10
22
|
"dist",
|
|
11
23
|
"README.md"
|
|
@@ -29,5 +41,5 @@
|
|
|
29
41
|
"dependencies": {
|
|
30
42
|
"@babel/runtime": "^7.13.10"
|
|
31
43
|
},
|
|
32
|
-
"stableVersion": "
|
|
44
|
+
"stableVersion": "1.0.0"
|
|
33
45
|
}
|