@radix-ui/react-separator 0.1.5-rc.8 → 1.0.0

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.
@@ -1 +1 @@
1
- {"mappings":";;;AAWA,QAAA,MAAM,iDAAkD,CAAC;AAEzD,mBAAmB,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAE/C,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,UAAU,GAAG,CAAC,CAAC;AAC9E,+BAAyB,SAAQ,iBAAiB;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,OAAA,MAAM,gGAiBJ,CAAC;AA8BH,OAAA,MAAM,2FAAgB,CAAC","sources":["packages/react/separator/src/packages/react/separator/src/Separator.tsx","packages/react/separator/src/packages/react/separator/src/index.ts","packages/react/separator/src/index.ts"],"sourcesContent":[null,null,"export * from './Separator';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
1
+ {"mappings":";;;AAWA,QAAA,MAAM,iDAAkD,CAAC;AAEzD,mBAAmB,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAE/C,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,UAAU,GAAG,CAAC,CAAC;AAC9E,+BAAyB,SAAQ,iBAAiB;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,OAAA,MAAM,gGAiBJ,CAAC;AA8BH,OAAA,MAAM,2FAAgB,CAAC","sources":["packages/react/separator/src/packages/react/separator/src/Separator.tsx","packages/react/separator/src/packages/react/separator/src/index.ts","packages/react/separator/src/index.ts"],"sourcesContent":[null,null,"export {\n Separator,\n //\n Root,\n} from './Separator';\nexport type { SeparatorProps } from './Separator';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -2,32 +2,15 @@ var $3sOcx$babelruntimehelpersextends = require("@babel/runtime/helpers/extends"
2
2
  var $3sOcx$react = require("react");
3
3
  var $3sOcx$radixuireactprimitive = require("@radix-ui/react-primitive");
4
4
 
5
- function $parcel$exportWildcard(dest, source) {
6
- Object.keys(source).forEach(function(key) {
7
- if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
8
- return;
9
- }
10
-
11
- Object.defineProperty(dest, key, {
12
- enumerable: true,
13
- get: function get() {
14
- return source[key];
15
- }
16
- });
17
- });
18
-
19
- return dest;
5
+ function $parcel$export(e, n, v, s) {
6
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
20
7
  }
21
8
  function $parcel$interopDefault(a) {
22
9
  return a && a.__esModule ? a.default : a;
23
10
  }
24
- function $parcel$export(e, n, v, s) {
25
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
26
- }
27
- var $1d2e81bd6a105992$exports = {};
28
11
 
29
- $parcel$export($1d2e81bd6a105992$exports, "Separator", () => $1d2e81bd6a105992$export$1ff3c3f08ae963c0);
30
- $parcel$export($1d2e81bd6a105992$exports, "Root", () => $1d2e81bd6a105992$export$be92b6f5f03c0fe9);
12
+ $parcel$export(module.exports, "Separator", () => $1d2e81bd6a105992$export$1ff3c3f08ae963c0);
13
+ $parcel$export(module.exports, "Root", () => $1d2e81bd6a105992$export$be92b6f5f03c0fe9);
31
14
 
32
15
 
33
16
 
@@ -80,7 +63,6 @@ function $1d2e81bd6a105992$var$isValidOrientation(orientation) {
80
63
  const $1d2e81bd6a105992$export$be92b6f5f03c0fe9 = $1d2e81bd6a105992$export$1ff3c3f08ae963c0;
81
64
 
82
65
 
83
- $parcel$exportWildcard(module.exports, $1d2e81bd6a105992$exports);
84
66
 
85
67
 
86
68
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;ACKA;;oGAEA,CA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AAI,CAACR,wCAAkB,CAACQ,SAAD,CAApC,EACE,OAAO,IAAIG,KAAJ,CAAUC,gDAA0B,CAACH,MAAD,EAASF,aAAT,CAApC,CAAP,CAAA;QAEF,OAAO,IAAP,CAAA;KACD;CARH,CAAsB;AAWtB,oGAAA,CAEA,+DAAA;AACA,SAASK,gDAAT,CAAoCC,KAApC,EAAmDN,aAAnD,EAA0E;IACxE,OAAQ,CAAA,wCAAA,EAA0CM,KAAM,CAAA,iBAAA,EAAmBN,aAAc,CAAzF;;;;gBAIF,EAAkBjB,yCAAoB,CAAA,GAAA,CAJpC,CAIF;CACC;AAED,SAASU,wCAAT,CAA4BH,WAA5B,EAA0E;IACxE,OAAON,kCAAY,CAACuB,QAAb,CAAsBjB,WAAtB,CAAP,CAAA;CACD;AAED,MAAMkB,yCAAI,GAAGvB,yCAAb,AAAA;;AD3EA","sources":["packages/react/separator/src/index.ts","packages/react/separator/src/Separator.tsx"],"sourcesContent":["export * from './Separator';\n","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"],"names":["React","Primitive","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","forwardRef","props","forwardedRef","decorative","orientation","orientationProp","domProps","isValidOrientation","ariaOrientation","undefined","semanticProps","role","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidOrientationError","value","includes","Root"],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;A;;;ACKA;;oGAEA,CAEA,MAAMI,0BAAI,GAAG,WAAb,AAAA;AACA,MAAMC,yCAAmB,GAAG,YAA5B,AAAA;AACA,MAAMC,kCAAY,GAAG;IAAC,YAAD;IAAe,UAAf;CAArB,AAAA;AAiBA,MAAMN,yCAAS,GAAA,aAAGE,CAAAA,uBAAA,CAAmD,CA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A,SAASK,gDAAT,CAAoCC,KAApC,EAAmDN,aAAnD,EAA0E;IACxE,OAAQ,CAAA,wCAAA,EAA0CM,KAAM,CAAA,iBAAA,EAAmBN,aAAc,CAAzF;;;;gBAIF,EAAkBhB,yCAAoB,CAAA,GAAA,CAJpC,CAIF;CACC;AAED,SAASS,wCAAT,CAA4BH,WAA5B,EAA0E;IACxE,OAAOL,kCAAY,CAACsB,QAAb,CAAsBjB,WAAtB,CAAP,CAAA;CACD;AAED,MAAMV,yCAAI,GAAGD,yCAAb,AAAA;;AD3EA","sources":["packages/react/separator/src/index.ts","packages/react/separator/src/Separator.tsx"],"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\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"],"names":["Separator","Root","React","Primitive","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","forwardRef","props","forwardedRef","decorative","orientation","orientationProp","domProps","isValidOrientation","ariaOrientation","undefined","semanticProps","role","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidOrientationError","value","includes"],"version":3,"file":"index.js.map"}
@@ -2,13 +2,6 @@ import $5WXm8$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/ext
2
2
  import {forwardRef as $5WXm8$forwardRef, createElement as $5WXm8$createElement} from "react";
3
3
  import {Primitive as $5WXm8$Primitive} from "@radix-ui/react-primitive";
4
4
 
5
- function $parcel$export(e, n, v, s) {
6
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
- }
8
- var $89eedd556c436f6a$exports = {};
9
-
10
- $parcel$export($89eedd556c436f6a$exports, "Separator", () => $89eedd556c436f6a$export$1ff3c3f08ae963c0);
11
- $parcel$export($89eedd556c436f6a$exports, "Root",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SAAS,GAAGd,KAAK,CAACY,QAAD,CAAvB,AAAA;QACA,MAAMG,MAAM,GAAGC,MAAM,CAACF,SAAD,CAArB,AAAA;QACA,IAAIA,SAAS,IAAI,CAACR,wCAAkB,CAACQ,SAAD,CAApC,EACE,OAAO,IAAIG,KAAJ,CAAUC,gDAA0B,CAACH,MAAD,EAASF,aAAT,CAApC,CAAP,CAAA;QAEF,OAAO,IAAP,CAAA;KACD;CARH,CAAsB;AAWtB,oGAAA,CAEA,+DAAA;AACA,SAASK,gDAAT,CAAoCC,KAApC,EAAmDN,aAAnD,EAA0E;IACxE,OAAQ,CAAA,wCAAA,EAA0CM,KAAM,CAAA,iBAAA,EAAmBN,aAAc,CAAzF;;;;gBAIF,EAAkBjB,yCAAoB,CAAA,GAAA,CAJpC,CAIF;CACC;AAED,SAASU,wCAAT,CAA4BH,WAA5B,EAA0E;IACxE,OAAON,kCAAY,CAACuB,QAAb,CAAsBjB,WAAtB,CAAP,CAAA;CACD;AAED,MAAMkB,yCAAI,GAAGvB,yCAAb,AAAA;;AD3EA","sources":["packages/react/separator/src/index.ts","packages/react/separator/src/Separator.tsx"],"sourcesContent":["export * from './Separator';\n","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"],"names":["React","Primitive","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","forwardRef","props","forwardedRef","decorative","orientation","orientationProp","domProps","isValidOrientation","ariaOrientation","undefined","semanticProps","role","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidOrientationError","value","includes","Root"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;;A;;;ACKA;;oGAEA,CAEA,MAAMI,0BAAI,GAAG,WAAb,AAAA;AACA,MAAMC,yCAAmB,GAAG,YAA5B,AAAA;AACA,MAAM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ACH,MAAD,EAASF,aAAT,CAApC,CAAP,CAAA;QAEF,OAAO,IAAP,CAAA;KACD;CARH,CAAsB;AAWtB,oGAAA,CAEA,+DAAA;AACA,SAASK,gDAAT,CAAoCC,KAApC,EAAmDN,aAAnD,EAA0E;IACxE,OAAQ,CAAA,wCAAA,EAA0CM,KAAM,CAAA,iBAAA,EAAmBN,aAAc,CAAzF;;;;gBAIF,EAAkBhB,yCAAoB,CAAA,GAAA,CAJpC,CAIF;CACC;AAED,SAASS,wCAAT,CAA4BH,WAA5B,EAA0E;IACxE,OAAOL,kCAAY,CAACsB,QAAb,CAAsBjB,WAAtB,CAAP,CAAA;CACD;AAED,MAAMV,yCAAI,GAAGD,yCAAb,AAAA;;AD3EA","sources":["packages/react/separator/src/index.ts","packages/react/separator/src/Separator.tsx"],"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\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"],"names":["Separator","Root","React","Primitive","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","forwardRef","props","forwardedRef","decorative","orientation","orientationProp","domProps","isValidOrientation","ariaOrientation","undefined","semanticProps","role","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidOrientationError","value","includes"],"version":3,"file":"index.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-separator",
3
- "version": "0.1.5-rc.8",
3
+ "version": "1.0.0",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -17,10 +17,11 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@babel/runtime": "^7.13.10",
20
- "@radix-ui/react-primitive": "0.1.5-rc.8"
20
+ "@radix-ui/react-primitive": "1.0.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "react": "^16.8 || ^17.0 || ^18.0"
23
+ "react": "^16.8 || ^17.0 || ^18.0",
24
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
24
25
  },
25
26
  "homepage": "https://radix-ui.com/primitives",
26
27
  "repository": {
@@ -29,6 +30,5 @@
29
30
  },
30
31
  "bugs": {
31
32
  "url": "https://github.com/radix-ui/primitives/issues"
32
- },
33
- "stableVersion": "0.1.4"
33
+ }
34
34
  }