@radix-ui/react-separator 1.1.13 → 1.1.14-rc.1784910896438
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 +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +7 -3
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const Orientation: {
|
|
5
|
+
readonly Horizontal: "horizontal";
|
|
6
|
+
readonly Vertical: "vertical";
|
|
7
|
+
};
|
|
8
|
+
type Orientation = (typeof Orientation)[keyof typeof Orientation];
|
|
6
9
|
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
7
10
|
interface SeparatorProps extends PrimitiveDivProps {
|
|
8
11
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const Orientation: {
|
|
5
|
+
readonly Horizontal: "horizontal";
|
|
6
|
+
readonly Vertical: "vertical";
|
|
7
|
+
};
|
|
8
|
+
type Orientation = (typeof Orientation)[keyof typeof Orientation];
|
|
6
9
|
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
7
10
|
interface SeparatorProps extends PrimitiveDivProps {
|
|
8
11
|
/**
|
package/dist/index.js
CHANGED
|
@@ -40,13 +40,17 @@ module.exports = __toCommonJS(index_exports);
|
|
|
40
40
|
var React = __toESM(require("react"));
|
|
41
41
|
var import_react_primitive = require("@radix-ui/react-primitive");
|
|
42
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
var
|
|
44
|
-
|
|
43
|
+
var Orientation = {
|
|
44
|
+
Horizontal: "horizontal",
|
|
45
|
+
Vertical: "vertical"
|
|
46
|
+
};
|
|
47
|
+
var DEFAULT_ORIENTATION = Orientation.Horizontal;
|
|
48
|
+
var ORIENTATIONS = Object.values(Orientation);
|
|
45
49
|
var Separator = /* @__PURE__ */ React.forwardRef(
|
|
46
50
|
/* @__PURE__ */ __name(function Separator2(props, forwardedRef) {
|
|
47
51
|
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
|
|
48
52
|
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
49
|
-
const ariaOrientation = orientation ===
|
|
53
|
+
const ariaOrientation = orientation === Orientation.Vertical ? orientation : void 0;
|
|
50
54
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
51
55
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
56
|
import_react_primitive.Primitive.div,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/separator.tsx"],
|
|
4
|
-
"sourcesContent": ["export {\n Separator,\n //\n Root,\n} from './separator';\nexport type { SeparatorProps } from './separator';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\nconst
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;
|
|
4
|
+
"sourcesContent": ["export {\n Separator,\n //\n Root,\n} from './separator';\nexport type { SeparatorProps } from './separator';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\nconst Orientation = {\n Horizontal: 'horizontal',\n Vertical: 'vertical',\n} as const;\n\nconst DEFAULT_ORIENTATION = Orientation.Horizontal;\nconst ORIENTATIONS = Object.values(Orientation);\n\ntype Orientation = (typeof Orientation)[keyof typeof Orientation];\n\ntype SeparatorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface SeparatorProps extends PrimitiveDivProps {\n /**\n * Either `vertical` or `horizontal`. Defaults to `horizontal`.\n */\n orientation?: Orientation;\n /**\n * Whether or not the component is purely decorative. When true, accessibility-related attributes\n * are updated so that that the rendered element is removed from the accessibility tree.\n */\n decorative?: boolean;\n}\n\nconst Separator = /* @__PURE__ */ React.forwardRef<SeparatorElement, SeparatorProps>(\n function Separator(props, forwardedRef) {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n // `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n const ariaOrientation = orientation === Orientation.Vertical ? orientation : undefined;\n const semanticProps = decorative\n ? { role: 'none' }\n : { 'aria-orientation': ariaOrientation, role: 'separator' };\n\n return (\n <Primitive.div\n data-orientation={orientation}\n {...semanticProps}\n {...domProps}\n ref={forwardedRef}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isValidOrientation(orientation: any): orientation is Orientation {\n return ORIENTATIONS.includes(orientation);\n}\n\nexport {\n Separator,\n //\n Separator as Root,\n};\nexport type { SeparatorProps };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AAwCpB;AAnCN,IAAM,cAAc;AAAA,EAClB,YAAY;AAAA,EACZ,UAAU;AACZ;AAEA,IAAM,sBAAsB,YAAY;AACxC,IAAM,eAAe,OAAO,OAAO,WAAW;AAkB9C,IAAM,YAA4B,gBAAM;AAAA,EACtC,gCAASA,WAAU,OAAO,cAAc;AACtC,UAAM,EAAE,YAAY,aAAa,kBAAkB,qBAAqB,GAAG,SAAS,IAAI;AACxF,UAAM,cAAc,mBAAmB,eAAe,IAAI,kBAAkB;AAE5E,UAAM,kBAAkB,gBAAgB,YAAY,WAAW,cAAc;AAC7E,UAAM,gBAAgB,aAClB,EAAE,MAAM,OAAO,IACf,EAAE,oBAAoB,iBAAiB,MAAM,YAAY;AAE7D,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACC,oBAAkB;AAAA,QACjB,GAAG;AAAA,QACH,GAAG;AAAA,QACJ,KAAK;AAAA;AAAA,IACP;AAAA,EAEJ,GAjBA;AAkBF;AAIA,SAAS,mBAAmB,aAA8C;AACxE,SAAO,aAAa,SAAS,WAAW;AAC1C;AAFS;",
|
|
6
6
|
"names": ["Separator"]
|
|
7
7
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -5,13 +5,17 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
-
|
|
8
|
+
var Orientation = {
|
|
9
|
+
Horizontal: "horizontal",
|
|
10
|
+
Vertical: "vertical"
|
|
11
|
+
};
|
|
12
|
+
var DEFAULT_ORIENTATION = Orientation.Horizontal;
|
|
13
|
+
var ORIENTATIONS = Object.values(Orientation);
|
|
10
14
|
var Separator = /* @__PURE__ */ React.forwardRef(
|
|
11
15
|
/* @__PURE__ */ __name(function Separator2(props, forwardedRef) {
|
|
12
16
|
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
|
|
13
17
|
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
14
|
-
const ariaOrientation = orientation ===
|
|
18
|
+
const ariaOrientation = orientation === Orientation.Vertical ? orientation : void 0;
|
|
15
19
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
16
20
|
return /* @__PURE__ */ jsx(
|
|
17
21
|
Primitive.div,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/separator.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\nconst
|
|
5
|
-
"mappings": ";;;;AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\nconst Orientation = {\n Horizontal: 'horizontal',\n Vertical: 'vertical',\n} as const;\n\nconst DEFAULT_ORIENTATION = Orientation.Horizontal;\nconst ORIENTATIONS = Object.values(Orientation);\n\ntype Orientation = (typeof Orientation)[keyof typeof Orientation];\n\ntype SeparatorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface SeparatorProps extends PrimitiveDivProps {\n /**\n * Either `vertical` or `horizontal`. Defaults to `horizontal`.\n */\n orientation?: Orientation;\n /**\n * Whether or not the component is purely decorative. When true, accessibility-related attributes\n * are updated so that that the rendered element is removed from the accessibility tree.\n */\n decorative?: boolean;\n}\n\nconst Separator = /* @__PURE__ */ React.forwardRef<SeparatorElement, SeparatorProps>(\n function Separator(props, forwardedRef) {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n // `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n const ariaOrientation = orientation === Orientation.Vertical ? orientation : undefined;\n const semanticProps = decorative\n ? { role: 'none' }\n : { 'aria-orientation': ariaOrientation, role: 'separator' };\n\n return (\n <Primitive.div\n data-orientation={orientation}\n {...semanticProps}\n {...domProps}\n ref={forwardedRef}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isValidOrientation(orientation: any): orientation is Orientation {\n return ORIENTATIONS.includes(orientation);\n}\n\nexport {\n Separator,\n //\n Separator as Root,\n};\nexport type { SeparatorProps };\n"],
|
|
5
|
+
"mappings": ";;;;AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAwCpB;AAnCN,IAAM,cAAc;AAAA,EAClB,YAAY;AAAA,EACZ,UAAU;AACZ;AAEA,IAAM,sBAAsB,YAAY;AACxC,IAAM,eAAe,OAAO,OAAO,WAAW;AAkB9C,IAAM,YAA4B,gBAAM;AAAA,EACtC,gCAASA,WAAU,OAAO,cAAc;AACtC,UAAM,EAAE,YAAY,aAAa,kBAAkB,qBAAqB,GAAG,SAAS,IAAI;AACxF,UAAM,cAAc,mBAAmB,eAAe,IAAI,kBAAkB;AAE5E,UAAM,kBAAkB,gBAAgB,YAAY,WAAW,cAAc;AAC7E,UAAM,gBAAgB,aAClB,EAAE,MAAM,OAAO,IACf,EAAE,oBAAoB,iBAAiB,MAAM,YAAY;AAE7D,WACE;AAAA,MAAC,UAAU;AAAA,MAAV;AAAA,QACC,oBAAkB;AAAA,QACjB,GAAG;AAAA,QACH,GAAG;AAAA,QACJ,KAAK;AAAA;AAAA,IACP;AAAA,EAEJ,GAjBA;AAkBF;AAIA,SAAS,mBAAmB,aAA8C;AACxE,SAAO,aAAa,SAAS,WAAW;AAC1C;AAFS;",
|
|
6
6
|
"names": ["Separator"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-separator",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14-rc.1784910896438",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@radix-ui/react-primitive": "2.1.
|
|
14
|
+
"@radix-ui/react-primitive": "2.1.9-rc.1784910896438"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/react": "^19.2.17",
|