Socket
Socket
Sign inDemoInstall

@radix-ui/react-direction

Package Overview
Dependencies
Maintainers
6
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-direction - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0-rc.1

13

dist/index.d.ts

@@ -1,3 +0,4 @@

import * as React from "react";
type Direction = 'ltr' | 'rtl';
import * as React from 'react';
declare type Direction = 'ltr' | 'rtl';
interface DirectionProviderProps {

@@ -7,6 +8,6 @@ children?: React.ReactNode;

}
export const DirectionProvider: React.FC<DirectionProviderProps>;
export function useDirection(localDir?: Direction): Direction;
export const Provider: React.FC<DirectionProviderProps>;
declare const DirectionProvider: React.FC<DirectionProviderProps>;
declare function useDirection(localDir?: Direction): Direction;
declare const Provider: React.FC<DirectionProviderProps>;
//# sourceMappingURL=index.d.ts.map
export { DirectionProvider, Provider, useDirection };

@@ -1,29 +0,46 @@

var $9g4ps$react = require("react");
"use strict";
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useDirection", () => $cc45c1b701a63adc$export$b39126d51d94e6f3);
$parcel$export(module.exports, "Provider", () => $cc45c1b701a63adc$export$2881499e37b75b9a);
$parcel$export(module.exports, "DirectionProvider", () => $cc45c1b701a63adc$export$c760c09fdd558351);
const $cc45c1b701a63adc$var$DirectionContext = /*#__PURE__*/ $9g4ps$react.createContext(undefined);
/* -------------------------------------------------------------------------------------------------
* Direction
* -----------------------------------------------------------------------------------------------*/ const $cc45c1b701a63adc$export$c760c09fdd558351 = (props)=>{
const { dir: dir , children: children } = props;
return /*#__PURE__*/ $9g4ps$react.createElement($cc45c1b701a63adc$var$DirectionContext.Provider, {
value: dir
}, children);
};
/* -----------------------------------------------------------------------------------------------*/ function $cc45c1b701a63adc$export$b39126d51d94e6f3(localDir) {
const globalDir = $9g4ps$react.useContext($cc45c1b701a63adc$var$DirectionContext);
return localDir || globalDir || 'ltr';
}
const $cc45c1b701a63adc$export$2881499e37b75b9a = $cc45c1b701a63adc$export$c760c09fdd558351;
// packages/react/direction/src/Direction.tsx
var React = __toESM(__require("react"));
var import_jsx_runtime = __require("react/jsx-runtime");
var DirectionContext = React.createContext(void 0);
var DirectionProvider = (props) => {
const { dir, children } = props;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionContext.Provider, { value: dir, children });
};
function useDirection(localDir) {
const globalDir = React.useContext(DirectionContext);
return localDir || globalDir || "ltr";
}
var Provider = DirectionProvider;
})();
//# sourceMappingURL=index.js.map
{
"name": "@radix-ui/react-direction",
"version": "1.0.1",
"version": "1.1.0-rc.1",
"license": "MIT",

@@ -47,5 +47,3 @@ "exports": {

},
"dependencies": {
"@babel/runtime": "^7.13.10"
}
"stableVersion": "1.0.1"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc