@radix-ui/react-direction 1.1.4-rc.1784910896438 → 1.1.4
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 +3 -6
- package/dist/index.d.ts +3 -6
- package/dist/index.js +3 -6
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +3 -6
- package/dist/index.mjs.map +2 -2
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
readonly LTR: "ltr";
|
|
5
|
-
readonly RTL: "rtl";
|
|
6
|
-
};
|
|
7
|
-
type Direction = (typeof Direction)[keyof typeof Direction];
|
|
3
|
+
type Direction = 'ltr' | 'rtl';
|
|
8
4
|
interface DirectionProviderProps {
|
|
9
5
|
children?: React.ReactNode;
|
|
10
6
|
dir: Direction;
|
|
11
7
|
}
|
|
12
8
|
declare const DirectionProvider: React.FC<DirectionProviderProps>;
|
|
13
9
|
declare function useDirection(localDir?: Direction): Direction;
|
|
10
|
+
declare const Provider: React.FC<DirectionProviderProps>;
|
|
14
11
|
|
|
15
|
-
export { DirectionProvider,
|
|
12
|
+
export { DirectionProvider, Provider, useDirection };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
readonly LTR: "ltr";
|
|
5
|
-
readonly RTL: "rtl";
|
|
6
|
-
};
|
|
7
|
-
type Direction = (typeof Direction)[keyof typeof Direction];
|
|
3
|
+
type Direction = 'ltr' | 'rtl';
|
|
8
4
|
interface DirectionProviderProps {
|
|
9
5
|
children?: React.ReactNode;
|
|
10
6
|
dir: Direction;
|
|
11
7
|
}
|
|
12
8
|
declare const DirectionProvider: React.FC<DirectionProviderProps>;
|
|
13
9
|
declare function useDirection(localDir?: Direction): Direction;
|
|
10
|
+
declare const Provider: React.FC<DirectionProviderProps>;
|
|
14
11
|
|
|
15
|
-
export { DirectionProvider,
|
|
12
|
+
export { DirectionProvider, Provider, useDirection };
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
var index_exports = {};
|
|
34
34
|
__export(index_exports, {
|
|
35
35
|
DirectionProvider: () => DirectionProvider,
|
|
36
|
-
Provider: () =>
|
|
36
|
+
Provider: () => Provider,
|
|
37
37
|
useDirection: () => useDirection
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -41,10 +41,6 @@ module.exports = __toCommonJS(index_exports);
|
|
|
41
41
|
// src/direction.tsx
|
|
42
42
|
var React = __toESM(require("react"));
|
|
43
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
var Direction = {
|
|
45
|
-
LTR: "ltr",
|
|
46
|
-
RTL: "rtl"
|
|
47
|
-
};
|
|
48
44
|
var DirectionContext = React.createContext(void 0);
|
|
49
45
|
var DirectionProvider = /* @__PURE__ */ __name((props) => {
|
|
50
46
|
const { dir, children } = props;
|
|
@@ -52,7 +48,8 @@ var DirectionProvider = /* @__PURE__ */ __name((props) => {
|
|
|
52
48
|
}, "DirectionProvider");
|
|
53
49
|
function useDirection(localDir) {
|
|
54
50
|
const globalDir = React.useContext(DirectionContext);
|
|
55
|
-
return localDir || globalDir ||
|
|
51
|
+
return localDir || globalDir || "ltr";
|
|
56
52
|
}
|
|
57
53
|
__name(useDirection, "useDirection");
|
|
54
|
+
var Provider = DirectionProvider;
|
|
58
55
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/direction.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n} from './direction';\n", "import * as React from 'react';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["'use client';\nexport {\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAed;AAZT,IAAM,mBAAyB,oBAAqC,MAAS;AAU7E,IAAM,oBAAsD,wBAAC,UAAU;AACrE,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SAAO,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAC1D,GAH4D;AAO5D,SAAS,aAAa,UAAsB;AAC1C,QAAM,YAAkB,iBAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAHS;AAKT,IAAM,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -5,10 +5,6 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
5
5
|
// src/direction.tsx
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
var Direction = {
|
|
9
|
-
LTR: "ltr",
|
|
10
|
-
RTL: "rtl"
|
|
11
|
-
};
|
|
12
8
|
var DirectionContext = React.createContext(void 0);
|
|
13
9
|
var DirectionProvider = /* @__PURE__ */ __name((props) => {
|
|
14
10
|
const { dir, children } = props;
|
|
@@ -16,12 +12,13 @@ var DirectionProvider = /* @__PURE__ */ __name((props) => {
|
|
|
16
12
|
}, "DirectionProvider");
|
|
17
13
|
function useDirection(localDir) {
|
|
18
14
|
const globalDir = React.useContext(DirectionContext);
|
|
19
|
-
return localDir || globalDir ||
|
|
15
|
+
return localDir || globalDir || "ltr";
|
|
20
16
|
}
|
|
21
17
|
__name(useDirection, "useDirection");
|
|
18
|
+
var Provider = DirectionProvider;
|
|
22
19
|
export {
|
|
23
20
|
DirectionProvider,
|
|
24
|
-
|
|
21
|
+
Provider,
|
|
25
22
|
useDirection
|
|
26
23
|
};
|
|
27
24
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/direction.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\n\
|
|
5
|
-
"mappings": ";;;;;AAAA,YAAY,WAAW;
|
|
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,wBAAC,UAAU;AACrE,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAC1D,GAH4D;AAO5D,SAAS,aAAa,UAAsB;AAC1C,QAAM,YAAkB,iBAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAHS;AAKT,IAAM,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-direction",
|
|
3
|
-
"version": "1.1.4
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@types/react": "^19.2.
|
|
15
|
-
"@types/react-dom": "^19.2.
|
|
16
|
-
"react": "^19.2.
|
|
17
|
-
"react-dom": "^19.2.
|
|
14
|
+
"@types/react": "^19.2.2",
|
|
15
|
+
"@types/react-dom": "^19.2.2",
|
|
16
|
+
"react": "^19.2.0",
|
|
17
|
+
"react-dom": "^19.2.0",
|
|
18
18
|
"typescript": "^5.9.3",
|
|
19
19
|
"@repo/builder": "0.0.0",
|
|
20
20
|
"@repo/typescript-config": "0.0.0"
|