@radix-ui/react-arrow 0.0.0-20250116175529

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/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # `react-arrow`
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ $ yarn add @radix-ui/react-arrow
7
+ # or
8
+ $ npm install @radix-ui/react-arrow
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ This is an internal utility, not intended for public usage.
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { Primitive } from '@radix-ui/react-primitive';
3
+
4
+ type PrimitiveSvgProps = React.ComponentPropsWithoutRef<typeof Primitive.svg>;
5
+ interface ArrowProps extends PrimitiveSvgProps {
6
+ }
7
+ declare const Arrow: React.ForwardRefExoticComponent<ArrowProps & React.RefAttributes<SVGSVGElement>>;
8
+ declare const Root: React.ForwardRefExoticComponent<ArrowProps & React.RefAttributes<SVGSVGElement>>;
9
+
10
+ export { Arrow, type ArrowProps, Root };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { Primitive } from '@radix-ui/react-primitive';
3
+
4
+ type PrimitiveSvgProps = React.ComponentPropsWithoutRef<typeof Primitive.svg>;
5
+ interface ArrowProps extends PrimitiveSvgProps {
6
+ }
7
+ declare const Arrow: React.ForwardRefExoticComponent<ArrowProps & React.RefAttributes<SVGSVGElement>>;
8
+ declare const Root: React.ForwardRefExoticComponent<ArrowProps & React.RefAttributes<SVGSVGElement>>;
9
+
10
+ export { Arrow, type ArrowProps, Root };
package/dist/index.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/react/arrow/src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ Arrow: () => Arrow,
34
+ Root: () => Root
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+
38
+ // packages/react/arrow/src/Arrow.tsx
39
+ var React = __toESM(require("react"));
40
+ var import_react_primitive = require("@radix-ui/react-primitive");
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ var NAME = "Arrow";
43
+ var Arrow = React.forwardRef((props, forwardedRef) => {
44
+ const { children, width = 10, height = 5, ...arrowProps } = props;
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
+ import_react_primitive.Primitive.svg,
47
+ {
48
+ ...arrowProps,
49
+ ref: forwardedRef,
50
+ width,
51
+ height,
52
+ viewBox: "0 0 30 10",
53
+ preserveAspectRatio: "none",
54
+ children: props.asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polygon", { points: "0,0 30,0 15,10" })
55
+ }
56
+ );
57
+ });
58
+ Arrow.displayName = NAME;
59
+ var Root = Arrow;
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts", "../src/Arrow.tsx"],
4
+ "sourcesContent": ["export {\n Arrow,\n //\n Root,\n} from './Arrow';\nexport type { ArrowProps } from './Arrow';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Arrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Arrow';\n\ntype ArrowElement = React.ElementRef<typeof Primitive.svg>;\ntype PrimitiveSvgProps = React.ComponentPropsWithoutRef<typeof Primitive.svg>;\ninterface ArrowProps extends PrimitiveSvgProps {}\n\nconst Arrow = React.forwardRef<ArrowElement, ArrowProps>((props, forwardedRef) => {\n const { children, width = 10, height = 5, ...arrowProps } = props;\n return (\n <Primitive.svg\n {...arrowProps}\n ref={forwardedRef}\n width={width}\n height={height}\n viewBox=\"0 0 30 10\"\n preserveAspectRatio=\"none\"\n >\n {/* We use their children if they're slotting to replace the whole svg */}\n {props.asChild ? children : <polygon points=\"0,0 30,0 15,10\" />}\n </Primitive.svg>\n );\n});\n\nArrow.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Arrow;\n\nexport {\n Arrow,\n //\n Root,\n};\nexport type { ArrowProps };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AAwBQ;AAlBlC,IAAM,OAAO;AAMb,IAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,QAAM,EAAE,UAAU,QAAQ,IAAI,SAAS,GAAG,GAAG,WAAW,IAAI;AAC5D,SACE;AAAA,IAAC,iCAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAQ;AAAA,MACR,qBAAoB;AAAA,MAGnB,gBAAM,UAAU,WAAW,4CAAC,aAAQ,QAAO,kBAAiB;AAAA;AAAA,EAC/D;AAEJ,CAAC;AAED,MAAM,cAAc;AAIpB,IAAM,OAAO;",
6
+ "names": []
7
+ }
package/dist/index.mjs ADDED
@@ -0,0 +1,27 @@
1
+ // packages/react/arrow/src/Arrow.tsx
2
+ import * as React from "react";
3
+ import { Primitive } from "@radix-ui/react-primitive";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var NAME = "Arrow";
6
+ var Arrow = React.forwardRef((props, forwardedRef) => {
7
+ const { children, width = 10, height = 5, ...arrowProps } = props;
8
+ return /* @__PURE__ */ jsx(
9
+ Primitive.svg,
10
+ {
11
+ ...arrowProps,
12
+ ref: forwardedRef,
13
+ width,
14
+ height,
15
+ viewBox: "0 0 30 10",
16
+ preserveAspectRatio: "none",
17
+ children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
18
+ }
19
+ );
20
+ });
21
+ Arrow.displayName = NAME;
22
+ var Root = Arrow;
23
+ export {
24
+ Arrow,
25
+ Root
26
+ };
27
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Arrow.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Arrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Arrow';\n\ntype ArrowElement = React.ElementRef<typeof Primitive.svg>;\ntype PrimitiveSvgProps = React.ComponentPropsWithoutRef<typeof Primitive.svg>;\ninterface ArrowProps extends PrimitiveSvgProps {}\n\nconst Arrow = React.forwardRef<ArrowElement, ArrowProps>((props, forwardedRef) => {\n const { children, width = 10, height = 5, ...arrowProps } = props;\n return (\n <Primitive.svg\n {...arrowProps}\n ref={forwardedRef}\n width={width}\n height={height}\n viewBox=\"0 0 30 10\"\n preserveAspectRatio=\"none\"\n >\n {/* We use their children if they're slotting to replace the whole svg */}\n {props.asChild ? children : <polygon points=\"0,0 30,0 15,10\" />}\n </Primitive.svg>\n );\n});\n\nArrow.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Arrow;\n\nexport {\n Arrow,\n //\n Root,\n};\nexport type { ArrowProps };\n"],
5
+ "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAwBQ;AAlBlC,IAAM,OAAO;AAMb,IAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,QAAM,EAAE,UAAU,QAAQ,IAAI,SAAS,GAAG,GAAG,WAAW,IAAI;AAC5D,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAQ;AAAA,MACR,qBAAoB;AAAA,MAGnB,gBAAM,UAAU,WAAW,oBAAC,aAAQ,QAAO,kBAAiB;AAAA;AAAA,EAC/D;AAEJ,CAAC;AAED,MAAM,cAAc;AAIpB,IAAM,OAAO;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@radix-ui/react-arrow",
3
+ "version": "0.0.0-20250116175529",
4
+ "license": "MIT",
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",
21
+ "files": [
22
+ "dist",
23
+ "README.md"
24
+ ],
25
+ "sideEffects": false,
26
+ "scripts": {
27
+ "clean": "rm -rf dist"
28
+ },
29
+ "dependencies": {
30
+ "@radix-ui/react-primitive": "workspace:*"
31
+ },
32
+ "peerDependencies": {
33
+ "@types/react": "*",
34
+ "@types/react-dom": "*",
35
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
36
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "@types/react": {
40
+ "optional": true
41
+ },
42
+ "@types/react-dom": {
43
+ "optional": true
44
+ }
45
+ },
46
+ "homepage": "https://radix-ui.com/primitives",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/radix-ui/primitives.git"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/radix-ui/primitives/issues"
53
+ }
54
+ }