@radix-ui/react-separator 1.1.0-rc.2 → 1.1.0-rc.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 CHANGED
@@ -1,10 +1,9 @@
1
1
  import * as React from 'react';
2
- import * as Radix from '@radix-ui/react-primitive';
3
2
  import { Primitive } from '@radix-ui/react-primitive';
4
3
 
5
4
  declare const ORIENTATIONS: readonly ["horizontal", "vertical"];
6
- declare type Orientation = typeof ORIENTATIONS[number];
7
- declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
5
+ type Orientation = (typeof ORIENTATIONS)[number];
6
+ type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
8
7
  interface SeparatorProps extends PrimitiveDivProps {
9
8
  /**
10
9
  * Either `vertical` or `horizontal`. Defaults to `horizontal`.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import * as React from 'react';
2
- import * as Radix from '@radix-ui/react-primitive';
3
2
  import { Primitive } from '@radix-ui/react-primitive';
4
3
 
5
4
  declare const ORIENTATIONS: readonly ["horizontal", "vertical"];
6
- declare type Orientation = typeof ORIENTATIONS[number];
7
- declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
5
+ type Orientation = (typeof ORIENTATIONS)[number];
6
+ type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
8
7
  interface SeparatorProps extends PrimitiveDivProps {
9
8
  /**
10
9
  * Either `vertical` or `horizontal`. Defaults to `horizontal`.
package/dist/index.js CHANGED
@@ -1,77 +1,65 @@
1
1
  "use strict";
2
- (() => {
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
- }) : x)(function(x) {
12
- if (typeof require !== "undefined") return require.apply(this, arguments);
13
- throw Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
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);
31
29
 
32
- // packages/react/separator/src/Separator.tsx
33
- var React = __toESM(__require("react"));
34
- var import_react_primitive = __require("@radix-ui/react-primitive");
35
- var import_jsx_runtime = __require("react/jsx-runtime");
36
- var NAME = "Separator";
37
- var DEFAULT_ORIENTATION = "horizontal";
38
- var ORIENTATIONS = ["horizontal", "vertical"];
39
- var Separator = React.forwardRef((props, forwardedRef) => {
40
- const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
41
- const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
42
- const ariaOrientation = orientation === "vertical" ? orientation : void 0;
43
- const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
44
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
- import_react_primitive.Primitive.div,
46
- {
47
- "data-orientation": orientation,
48
- ...semanticProps,
49
- ...domProps,
50
- ref: forwardedRef
51
- }
52
- );
53
- });
54
- Separator.displayName = NAME;
55
- Separator.propTypes = {
56
- orientation(props, propName, componentName) {
57
- const propValue = props[propName];
58
- const strVal = String(propValue);
59
- if (propValue && !isValidOrientation(propValue)) {
60
- return new Error(getInvalidOrientationError(strVal, componentName));
61
- }
62
- return null;
63
- }
64
- };
65
- function getInvalidOrientationError(value, componentName) {
66
- return `Invalid prop \`orientation\` of value \`${value}\` supplied to \`${componentName}\`, expected one of:
67
- - horizontal
68
- - vertical
30
+ // packages/react/separator/src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ Root: () => Root,
34
+ Separator: () => Separator
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
69
37
 
70
- Defaulting to \`${DEFAULT_ORIENTATION}\`.`;
71
- }
72
- function isValidOrientation(orientation) {
73
- return ORIENTATIONS.includes(orientation);
74
- }
75
- var Root = Separator;
76
- })();
38
+ // packages/react/separator/src/Separator.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 = "Separator";
43
+ var DEFAULT_ORIENTATION = "horizontal";
44
+ var ORIENTATIONS = ["horizontal", "vertical"];
45
+ var Separator = React.forwardRef((props, forwardedRef) => {
46
+ const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
47
+ const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
48
+ const ariaOrientation = orientation === "vertical" ? orientation : void 0;
49
+ const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ import_react_primitive.Primitive.div,
52
+ {
53
+ "data-orientation": orientation,
54
+ ...semanticProps,
55
+ ...domProps,
56
+ ref: forwardedRef
57
+ }
58
+ );
59
+ });
60
+ Separator.displayName = NAME;
61
+ function isValidOrientation(orientation) {
62
+ return ORIENTATIONS.includes(orientation);
63
+ }
64
+ var Root = Separator;
77
65
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/Separator.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Separator';\nconst DEFAULT_ORIENTATION = 'horizontal';\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\ntype Orientation = typeof ORIENTATIONS[number];\ntype SeparatorElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.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 = React.forwardRef<SeparatorElement, SeparatorProps>((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 === '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\nSeparator.displayName = NAME;\n\nSeparator.propTypes = {\n orientation(props, propName, componentName) {\n const propValue = props[propName];\n const strVal = String(propValue);\n if (propValue && !isValidOrientation(propValue)) {\n return new Error(getInvalidOrientationError(strVal, componentName));\n }\n return null;\n },\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidOrientationError(value: string, componentName: string) {\n return `Invalid prop \\`orientation\\` of value \\`${value}\\` supplied to \\`${componentName}\\`, expected one of:\n - horizontal\n - vertical\n\nDefaulting to \\`${DEFAULT_ORIENTATION}\\`.`;\n}\n\nfunction isValidOrientation(orientation: any): orientation is Orientation {\n return ORIENTATIONS.includes(orientation);\n}\n\nconst Root = Separator;\n\nexport {\n Separator,\n //\n Root,\n};\nexport type { SeparatorProps };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAuB;AACvB,+BAA0B;AAqCtB;AA7BJ,MAAM,OAAO;AACb,MAAM,sBAAsB;AAC5B,MAAM,eAAe,CAAC,cAAc,UAAU;AAiB9C,MAAM,YAAkB,iBAA6C,CAAC,OAAO,iBAAiB;AAC5F,UAAM,EAAE,YAAY,aAAa,kBAAkB,qBAAqB,GAAG,SAAS,IAAI;AACxF,UAAM,cAAc,mBAAmB,eAAe,IAAI,kBAAkB;AAE5E,UAAM,kBAAkB,gBAAgB,aAAa,cAAc;AACnE,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,CAAC;AAED,YAAU,cAAc;AAExB,YAAU,YAAY;AAAA,IACpB,YAAY,OAAO,UAAU,eAAe;AAC1C,YAAM,YAAY,MAAM,QAAQ;AAChC,YAAM,SAAS,OAAO,SAAS;AAC/B,UAAI,aAAa,CAAC,mBAAmB,SAAS,GAAG;AAC/C,eAAO,IAAI,MAAM,2BAA2B,QAAQ,aAAa,CAAC;AAAA,MACpE;AACA,aAAO;AAAA,IACT;AAAA,EACF;AAKA,WAAS,2BAA2B,OAAe,eAAuB;AACxE,WAAO,2CAA2C,KAAK,oBAAoB,aAAa;AAAA;AAAA;AAAA;AAAA,kBAIxE,mBAAmB;AAAA,EACrC;AAEA,WAAS,mBAAmB,aAA8C;AACxE,WAAO,aAAa,SAAS,WAAW;AAAA,EAC1C;AAEA,MAAM,OAAO;",
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 * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Separator';\nconst DEFAULT_ORIENTATION = 'horizontal';\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\ntype Orientation = (typeof ORIENTATIONS)[number];\ntype SeparatorElement = React.ElementRef<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 = React.forwardRef<SeparatorElement, SeparatorProps>((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 === '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\nSeparator.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isValidOrientation(orientation: any): orientation is Orientation {\n return ORIENTATIONS.includes(orientation);\n}\n\nconst Root = Separator;\n\nexport {\n Separator,\n //\n Root,\n};\nexport type { SeparatorProps };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AAmCtB;AA7BJ,IAAM,OAAO;AACb,IAAM,sBAAsB;AAC5B,IAAM,eAAe,CAAC,cAAc,UAAU;AAiB9C,IAAM,YAAkB,iBAA6C,CAAC,OAAO,iBAAiB;AAC5F,QAAM,EAAE,YAAY,aAAa,kBAAkB,qBAAqB,GAAG,SAAS,IAAI;AACxF,QAAM,cAAc,mBAAmB,eAAe,IAAI,kBAAkB;AAE5E,QAAM,kBAAkB,gBAAgB,aAAa,cAAc;AACnE,QAAM,gBAAgB,aAClB,EAAE,MAAM,OAAO,IACf,EAAE,oBAAoB,iBAAiB,MAAM,YAAY;AAE7D,SACE;AAAA,IAAC,iCAAU;AAAA,IAAV;AAAA,MACC,oBAAkB;AAAA,MACjB,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,KAAK;AAAA;AAAA,EACP;AAEJ,CAAC;AAED,UAAU,cAAc;AAIxB,SAAS,mBAAmB,aAA8C;AACxE,SAAO,aAAa,SAAS,WAAW;AAC1C;AAEA,IAAM,OAAO;",
6
6
  "names": []
7
7
  }
package/dist/index.mjs CHANGED
@@ -21,23 +21,6 @@ var Separator = React.forwardRef((props, forwardedRef) => {
21
21
  );
22
22
  });
23
23
  Separator.displayName = NAME;
24
- Separator.propTypes = {
25
- orientation(props, propName, componentName) {
26
- const propValue = props[propName];
27
- const strVal = String(propValue);
28
- if (propValue && !isValidOrientation(propValue)) {
29
- return new Error(getInvalidOrientationError(strVal, componentName));
30
- }
31
- return null;
32
- }
33
- };
34
- function getInvalidOrientationError(value, componentName) {
35
- return `Invalid prop \`orientation\` of value \`${value}\` supplied to \`${componentName}\`, expected one of:
36
- - horizontal
37
- - vertical
38
-
39
- Defaulting to \`${DEFAULT_ORIENTATION}\`.`;
40
- }
41
24
  function isValidOrientation(orientation) {
42
25
  return ORIENTATIONS.includes(orientation);
43
26
  }
@@ -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\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Separator';\nconst DEFAULT_ORIENTATION = 'horizontal';\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\ntype Orientation = typeof ORIENTATIONS[number];\ntype SeparatorElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.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 = React.forwardRef<SeparatorElement, SeparatorProps>((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 === '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\nSeparator.displayName = NAME;\n\nSeparator.propTypes = {\n orientation(props, propName, componentName) {\n const propValue = props[propName];\n const strVal = String(propValue);\n if (propValue && !isValidOrientation(propValue)) {\n return new Error(getInvalidOrientationError(strVal, componentName));\n }\n return null;\n },\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidOrientationError(value: string, componentName: string) {\n return `Invalid prop \\`orientation\\` of value \\`${value}\\` supplied to \\`${componentName}\\`, expected one of:\n - horizontal\n - vertical\n\nDefaulting to \\`${DEFAULT_ORIENTATION}\\`.`;\n}\n\nfunction isValidOrientation(orientation: any): orientation is Orientation {\n return ORIENTATIONS.includes(orientation);\n}\n\nconst Root = Separator;\n\nexport {\n Separator,\n //\n Root,\n};\nexport type { SeparatorProps };\n"],
5
- "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAqCtB;AA7BJ,IAAM,OAAO;AACb,IAAM,sBAAsB;AAC5B,IAAM,eAAe,CAAC,cAAc,UAAU;AAiB9C,IAAM,YAAkB,iBAA6C,CAAC,OAAO,iBAAiB;AAC5F,QAAM,EAAE,YAAY,aAAa,kBAAkB,qBAAqB,GAAG,SAAS,IAAI;AACxF,QAAM,cAAc,mBAAmB,eAAe,IAAI,kBAAkB;AAE5E,QAAM,kBAAkB,gBAAgB,aAAa,cAAc;AACnE,QAAM,gBAAgB,aAClB,EAAE,MAAM,OAAO,IACf,EAAE,oBAAoB,iBAAiB,MAAM,YAAY;AAE7D,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACC,oBAAkB;AAAA,MACjB,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,KAAK;AAAA;AAAA,EACP;AAEJ,CAAC;AAED,UAAU,cAAc;AAExB,UAAU,YAAY;AAAA,EACpB,YAAY,OAAO,UAAU,eAAe;AAC1C,UAAM,YAAY,MAAM,QAAQ;AAChC,UAAM,SAAS,OAAO,SAAS;AAC/B,QAAI,aAAa,CAAC,mBAAmB,SAAS,GAAG;AAC/C,aAAO,IAAI,MAAM,2BAA2B,QAAQ,aAAa,CAAC;AAAA,IACpE;AACA,WAAO;AAAA,EACT;AACF;AAKA,SAAS,2BAA2B,OAAe,eAAuB;AACxE,SAAO,2CAA2C,KAAK,oBAAoB,aAAa;AAAA;AAAA;AAAA;AAAA,kBAIxE,mBAAmB;AACrC;AAEA,SAAS,mBAAmB,aAA8C;AACxE,SAAO,aAAa,SAAS,WAAW;AAC1C;AAEA,IAAM,OAAO;",
4
+ "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Separator';\nconst DEFAULT_ORIENTATION = 'horizontal';\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\ntype Orientation = (typeof ORIENTATIONS)[number];\ntype SeparatorElement = React.ElementRef<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 = React.forwardRef<SeparatorElement, SeparatorProps>((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 === '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\nSeparator.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isValidOrientation(orientation: any): orientation is Orientation {\n return ORIENTATIONS.includes(orientation);\n}\n\nconst Root = Separator;\n\nexport {\n Separator,\n //\n Root,\n};\nexport type { SeparatorProps };\n"],
5
+ "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAmCtB;AA7BJ,IAAM,OAAO;AACb,IAAM,sBAAsB;AAC5B,IAAM,eAAe,CAAC,cAAc,UAAU;AAiB9C,IAAM,YAAkB,iBAA6C,CAAC,OAAO,iBAAiB;AAC5F,QAAM,EAAE,YAAY,aAAa,kBAAkB,qBAAqB,GAAG,SAAS,IAAI;AACxF,QAAM,cAAc,mBAAmB,eAAe,IAAI,kBAAkB;AAE5E,QAAM,kBAAkB,gBAAgB,aAAa,cAAc;AACnE,QAAM,gBAAgB,aAClB,EAAE,MAAM,OAAO,IACf,EAAE,oBAAoB,iBAAiB,MAAM,YAAY;AAE7D,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACC,oBAAkB;AAAA,MACjB,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,KAAK;AAAA;AAAA,EACP;AAEJ,CAAC;AAED,UAAU,cAAc;AAIxB,SAAS,mBAAmB,aAA8C;AACxE,SAAO,aAAa,SAAS,WAAW;AAC1C;AAEA,IAAM,OAAO;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-separator",
3
- "version": "1.1.0-rc.2",
3
+ "version": "1.1.0-rc.4",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -28,13 +28,13 @@
28
28
  "version": "yarn version"
29
29
  },
30
30
  "dependencies": {
31
- "@radix-ui/react-primitive": "1.1.0-rc.2"
31
+ "@radix-ui/react-primitive": "2.0.0-rc.1"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@types/react": "*",
35
35
  "@types/react-dom": "*",
36
- "react": "^16.8 || ^17.0 || ^18.0",
37
- "react-dom": "^16.8 || ^17.0 || ^18.0"
36
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0",
37
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@types/react": {