@radix-ui/react-accessible-icon 1.0.3 → 1.1.0-rc.2
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 +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +50 -27
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +22 -22
- package/dist/index.mjs.map +7 -1
- package/package.json +4 -4
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface AccessibleIconProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
/**
|
|
5
6
|
* The accessible label for the icon. This label will be visually hidden but announced to screen
|
|
@@ -7,7 +8,7 @@ export interface AccessibleIconProps {
|
|
|
7
8
|
*/
|
|
8
9
|
label: string;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
declare const AccessibleIcon: React.FC<AccessibleIconProps>;
|
|
12
|
+
declare const Root: React.FC<AccessibleIconProps>;
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
export { AccessibleIcon, type AccessibleIconProps, Root };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface AccessibleIconProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
/**
|
|
5
6
|
* The accessible label for the icon. This label will be visually hidden but announced to screen
|
|
@@ -7,7 +8,7 @@ export interface AccessibleIconProps {
|
|
|
7
8
|
*/
|
|
8
9
|
label: string;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
declare const AccessibleIcon: React.FC<AccessibleIconProps>;
|
|
12
|
+
declare const Root: React.FC<AccessibleIconProps>;
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
export { AccessibleIcon, type AccessibleIconProps, Root };
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
+
));
|
|
31
|
+
|
|
32
|
+
// packages/react/accessible-icon/src/AccessibleIcon.tsx
|
|
33
|
+
var React = __toESM(__require("react"));
|
|
34
|
+
var VisuallyHiddenPrimitive = __toESM(__require("@radix-ui/react-visually-hidden"));
|
|
35
|
+
var import_jsx_runtime = __require("react/jsx-runtime");
|
|
36
|
+
var NAME = "AccessibleIcon";
|
|
37
|
+
var AccessibleIcon = ({ children, label }) => {
|
|
38
|
+
const child = React.Children.only(children);
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
40
|
+
React.cloneElement(child, {
|
|
16
41
|
// accessibility
|
|
17
|
-
|
|
18
|
-
focusable:
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
focusable: "false"
|
|
44
|
+
// See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenPrimitive.Root, { children: label })
|
|
47
|
+
] });
|
|
48
|
+
};
|
|
49
|
+
AccessibleIcon.displayName = NAME;
|
|
50
|
+
var Root2 = AccessibleIcon;
|
|
51
|
+
})();
|
|
29
52
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/AccessibleIcon.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nconst NAME = 'AccessibleIcon';\n\ninterface AccessibleIconProps {\n children?: React.ReactNode;\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label: string;\n}\n\nconst AccessibleIcon: React.FC<AccessibleIconProps> = ({ children, label }) => {\n const child = React.Children.only(children);\n return (\n <>\n {React.cloneElement(child as React.ReactElement, {\n // accessibility\n 'aria-hidden': 'true',\n focusable: 'false', // See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable\n })}\n <VisuallyHiddenPrimitive.Root>{label}</VisuallyHiddenPrimitive.Root>\n </>\n );\n};\n\nAccessibleIcon.displayName = NAME;\n\nconst Root = AccessibleIcon;\n\nexport {\n AccessibleIcon,\n //\n Root,\n};\nexport type { AccessibleIconProps };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAuB;AACvB,gCAAyC;AAgBrC;AAdJ,MAAM,OAAO;AAWb,MAAM,iBAAgD,CAAC,EAAE,UAAU,MAAM,MAAM;AAC7E,UAAM,QAAc,eAAS,KAAK,QAAQ;AAC1C,WACE,4EACG;AAAA,MAAM,mBAAa,OAA6B;AAAA;AAAA,QAE/C,eAAe;AAAA,QACf,WAAW;AAAA;AAAA,MACb,CAAC;AAAA,MACD,4CAAyB,8BAAxB,EAA8B,iBAAM;AAAA,OACvC;AAAA,EAEJ;AAEA,iBAAe,cAAc;AAE7B,MAAMA,QAAO;",
|
|
6
|
+
"names": ["Root"]
|
|
7
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
// packages/react/accessible-icon/src/AccessibleIcon.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as VisuallyHiddenPrimitive from "@radix-ui/react-visually-hidden";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var NAME = "AccessibleIcon";
|
|
6
|
+
var AccessibleIcon = ({ children, label }) => {
|
|
7
|
+
const child = React.Children.only(children);
|
|
8
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9
|
+
React.cloneElement(child, {
|
|
10
|
+
// accessibility
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
focusable: "false"
|
|
13
|
+
// See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ jsx(VisuallyHiddenPrimitive.Root, { children: label })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
AccessibleIcon.displayName = NAME;
|
|
19
|
+
var Root2 = AccessibleIcon;
|
|
20
|
+
export {
|
|
21
|
+
AccessibleIcon,
|
|
22
|
+
Root2 as Root
|
|
14
23
|
};
|
|
15
|
-
/*#__PURE__*/ Object.assign($08b6689415b2f49a$export$5aec92af04ace2d2, {
|
|
16
|
-
displayName: $08b6689415b2f49a$var$NAME
|
|
17
|
-
});
|
|
18
|
-
const $08b6689415b2f49a$export$be92b6f5f03c0fe9 = $08b6689415b2f49a$export$5aec92af04ace2d2;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export {$08b6689415b2f49a$export$5aec92af04ace2d2 as AccessibleIcon, $08b6689415b2f49a$export$be92b6f5f03c0fe9 as Root};
|
|
24
24
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/AccessibleIcon.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nconst NAME = 'AccessibleIcon';\n\ninterface AccessibleIconProps {\n children?: React.ReactNode;\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label: string;\n}\n\nconst AccessibleIcon: React.FC<AccessibleIconProps> = ({ children, label }) => {\n const child = React.Children.only(children);\n return (\n <>\n {React.cloneElement(child as React.ReactElement, {\n // accessibility\n 'aria-hidden': 'true',\n focusable: 'false', // See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable\n })}\n <VisuallyHiddenPrimitive.Root>{label}</VisuallyHiddenPrimitive.Root>\n </>\n );\n};\n\nAccessibleIcon.displayName = NAME;\n\nconst Root = AccessibleIcon;\n\nexport {\n AccessibleIcon,\n //\n Root,\n};\nexport type { AccessibleIconProps };\n"],
|
|
5
|
+
"mappings": ";AAAA,YAAY,WAAW;AACvB,YAAY,6BAA6B;AAgBrC,mBAME,KANF;AAdJ,IAAM,OAAO;AAWb,IAAM,iBAAgD,CAAC,EAAE,UAAU,MAAM,MAAM;AAC7E,QAAM,QAAc,eAAS,KAAK,QAAQ;AAC1C,SACE,iCACG;AAAA,IAAM,mBAAa,OAA6B;AAAA;AAAA,MAE/C,eAAe;AAAA,MACf,WAAW;AAAA;AAAA,IACb,CAAC;AAAA,IACD,oBAAyB,8BAAxB,EAA8B,iBAAM;AAAA,KACvC;AAEJ;AAEA,eAAe,cAAc;AAE7B,IAAMA,QAAO;",
|
|
6
|
+
"names": ["Root"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-accessible-icon",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"version": "yarn version"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@radix-ui/react-visually-hidden": "1.0.3"
|
|
31
|
+
"@radix-ui/react-visually-hidden": "1.1.0-rc.2"
|
|
33
32
|
},
|
|
34
33
|
"peerDependencies": {
|
|
35
34
|
"@types/react": "*",
|
|
@@ -52,5 +51,6 @@
|
|
|
52
51
|
},
|
|
53
52
|
"bugs": {
|
|
54
53
|
"url": "https://github.com/radix-ui/primitives/issues"
|
|
55
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"stableVersion": "1.0.3"
|
|
56
56
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAKA;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,OAAA,MAAM,gBAAgB,MAAM,EAAE,CAAC,mBAAmB,CAYjD,CAAC;AAIF,OAAA,MAAM,mCAAqB,CAAC","sources":["packages/react/accessible-icon/src/packages/react/accessible-icon/src/AccessibleIcon.tsx","packages/react/accessible-icon/src/packages/react/accessible-icon/src/index.ts","packages/react/accessible-icon/src/index.ts"],"sourcesContent":[null,null,"export {\n AccessibleIcon,\n //\n Root,\n} from './AccessibleIcon';\nexport type { AccessibleIconProps } from './AccessibleIcon';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|