@radix-ui/react-direction 1.1.2 → 1.1.3-rc.1784603841447
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 +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +10 -5
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +11 -5
- package/dist/index.mjs.map +2 -2
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
declare const Direction: {
|
|
4
|
+
readonly LTR: "ltr";
|
|
5
|
+
readonly RTL: "rtl";
|
|
6
|
+
};
|
|
7
|
+
type Direction = (typeof Direction)[keyof typeof Direction];
|
|
4
8
|
interface DirectionProviderProps {
|
|
5
9
|
children?: React.ReactNode;
|
|
6
10
|
dir: Direction;
|
|
7
11
|
}
|
|
8
12
|
declare const DirectionProvider: React.FC<DirectionProviderProps>;
|
|
9
13
|
declare function useDirection(localDir?: Direction): Direction;
|
|
10
|
-
declare const Provider: React.FC<DirectionProviderProps>;
|
|
11
14
|
|
|
12
|
-
export { DirectionProvider, Provider, useDirection };
|
|
15
|
+
export { DirectionProvider, DirectionProvider as Provider, useDirection };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
declare const Direction: {
|
|
4
|
+
readonly LTR: "ltr";
|
|
5
|
+
readonly RTL: "rtl";
|
|
6
|
+
};
|
|
7
|
+
type Direction = (typeof Direction)[keyof typeof Direction];
|
|
4
8
|
interface DirectionProviderProps {
|
|
5
9
|
children?: React.ReactNode;
|
|
6
10
|
dir: Direction;
|
|
7
11
|
}
|
|
8
12
|
declare const DirectionProvider: React.FC<DirectionProviderProps>;
|
|
9
13
|
declare function useDirection(localDir?: Direction): Direction;
|
|
10
|
-
declare const Provider: React.FC<DirectionProviderProps>;
|
|
11
14
|
|
|
12
|
-
export { DirectionProvider, Provider, useDirection };
|
|
15
|
+
export { DirectionProvider, DirectionProvider as Provider, useDirection };
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
10
|
var __export = (target, all) => {
|
|
10
11
|
for (var name in all)
|
|
11
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -32,7 +33,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
33
|
var index_exports = {};
|
|
33
34
|
__export(index_exports, {
|
|
34
35
|
DirectionProvider: () => DirectionProvider,
|
|
35
|
-
Provider: () =>
|
|
36
|
+
Provider: () => DirectionProvider,
|
|
36
37
|
useDirection: () => useDirection
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -40,14 +41,18 @@ module.exports = __toCommonJS(index_exports);
|
|
|
40
41
|
// src/direction.tsx
|
|
41
42
|
var React = __toESM(require("react"));
|
|
42
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
var Direction = {
|
|
45
|
+
LTR: "ltr",
|
|
46
|
+
RTL: "rtl"
|
|
47
|
+
};
|
|
43
48
|
var DirectionContext = React.createContext(void 0);
|
|
44
|
-
var DirectionProvider = (props) => {
|
|
49
|
+
var DirectionProvider = /* @__PURE__ */ __name((props) => {
|
|
45
50
|
const { dir, children } = props;
|
|
46
51
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionContext.Provider, { value: dir, children });
|
|
47
|
-
};
|
|
52
|
+
}, "DirectionProvider");
|
|
48
53
|
function useDirection(localDir) {
|
|
49
54
|
const globalDir = React.useContext(DirectionContext);
|
|
50
|
-
return localDir || globalDir ||
|
|
55
|
+
return localDir || globalDir || Direction.LTR;
|
|
51
56
|
}
|
|
52
|
-
|
|
57
|
+
__name(useDirection, "useDirection");
|
|
53
58
|
//# 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": "
|
|
4
|
+
"sourcesContent": ["'use client';\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n} from './direction';\n", "import * as React from 'react';\n\nconst Direction = {\n LTR: 'ltr',\n RTL: 'rtl',\n} as const;\n\ntype Direction = (typeof Direction)[keyof typeof Direction];\n\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 || Direction.LTR;\n}\n\nexport {\n useDirection,\n //\n DirectionProvider as Provider,\n //\n DirectionProvider,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAqBd;AAnBT,IAAM,YAAY;AAAA,EAChB,KAAK;AAAA,EACL,KAAK;AACP;AAIA,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,UAAU;AAC5C;AAHS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
2
4
|
|
|
3
5
|
// src/direction.tsx
|
|
4
6
|
import * as React from "react";
|
|
5
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var Direction = {
|
|
9
|
+
LTR: "ltr",
|
|
10
|
+
RTL: "rtl"
|
|
11
|
+
};
|
|
6
12
|
var DirectionContext = React.createContext(void 0);
|
|
7
|
-
var DirectionProvider = (props) => {
|
|
13
|
+
var DirectionProvider = /* @__PURE__ */ __name((props) => {
|
|
8
14
|
const { dir, children } = props;
|
|
9
15
|
return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });
|
|
10
|
-
};
|
|
16
|
+
}, "DirectionProvider");
|
|
11
17
|
function useDirection(localDir) {
|
|
12
18
|
const globalDir = React.useContext(DirectionContext);
|
|
13
|
-
return localDir || globalDir ||
|
|
19
|
+
return localDir || globalDir || Direction.LTR;
|
|
14
20
|
}
|
|
15
|
-
|
|
21
|
+
__name(useDirection, "useDirection");
|
|
16
22
|
export {
|
|
17
23
|
DirectionProvider,
|
|
18
|
-
Provider,
|
|
24
|
+
DirectionProvider as Provider,
|
|
19
25
|
useDirection
|
|
20
26
|
};
|
|
21
27
|
//# 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": "
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\n\nconst Direction = {\n LTR: 'ltr',\n RTL: 'rtl',\n} as const;\n\ntype Direction = (typeof Direction)[keyof typeof Direction];\n\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 || Direction.LTR;\n}\n\nexport {\n useDirection,\n //\n DirectionProvider as Provider,\n //\n DirectionProvider,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA,YAAY,WAAW;AAqBd;AAnBT,IAAM,YAAY;AAAA,EAChB,KAAK;AAAA,EACL,KAAK;AACP;AAIA,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,UAAU;AAC5C;AAHS;",
|
|
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.
|
|
3
|
+
"version": "1.1.3-rc.1784603841447",
|
|
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.17",
|
|
15
|
+
"@types/react-dom": "^19.2.3",
|
|
16
|
+
"react": "^19.2.7",
|
|
17
|
+
"react-dom": "^19.2.7",
|
|
18
18
|
"typescript": "^5.9.3",
|
|
19
19
|
"@repo/builder": "0.0.0",
|
|
20
20
|
"@repo/typescript-config": "0.0.0"
|