@entur/a11y 0.2.41 → 0.2.44
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/CHANGELOG.md +12 -0
- package/dist/a11y.cjs.development.js +27 -6
- package/dist/a11y.cjs.development.js.map +1 -1
- package/dist/a11y.cjs.production.min.js +1 -1
- package/dist/a11y.cjs.production.min.js.map +1 -1
- package/dist/a11y.esm.js +21 -2
- package/dist/a11y.esm.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.2.44](https://bitbucket.org/enturas/design-system/compare/@entur/a11y@0.2.43...@entur/a11y@0.2.44) (2022-05-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @entur/a11y
|
|
9
|
+
|
|
10
|
+
## [0.2.43](https://bitbucket.org/enturas/design-system/compare/@entur/a11y@0.2.42...@entur/a11y@0.2.43) (2022-04-27)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @entur/a11y
|
|
13
|
+
|
|
14
|
+
## [0.2.42](https://bitbucket.org/enturas/design-system/compare/@entur/a11y@0.2.41...@entur/a11y@0.2.42) (2022-02-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @entur/a11y
|
|
17
|
+
|
|
6
18
|
## [0.2.41](https://bitbucket.org/enturas/design-system/compare/@entur/a11y@0.2.40...@entur/a11y@0.2.41) (2021-11-17)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @entur/a11y
|
|
@@ -2,21 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
-
|
|
7
5
|
var utils = require('@entur/utils');
|
|
8
|
-
var React =
|
|
6
|
+
var React = require('react');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
11
|
|
|
10
12
|
var SkipToContent = function SkipToContent(_ref) {
|
|
11
13
|
var children = _ref.children,
|
|
12
14
|
_ref$mainId = _ref.mainId,
|
|
13
15
|
mainId = _ref$mainId === void 0 ? 'main-content' : _ref$mainId;
|
|
14
|
-
return
|
|
16
|
+
return React__default["default"].createElement("a", {
|
|
15
17
|
className: "eds-skip-to-content",
|
|
16
18
|
href: "#" + mainId
|
|
17
19
|
}, children);
|
|
18
20
|
};
|
|
19
21
|
|
|
22
|
+
function _extends() {
|
|
23
|
+
_extends = Object.assign || function (target) {
|
|
24
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
25
|
+
var source = arguments[i];
|
|
26
|
+
|
|
27
|
+
for (var key in source) {
|
|
28
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
29
|
+
target[key] = source[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return _extends.apply(this, arguments);
|
|
38
|
+
}
|
|
39
|
+
|
|
20
40
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
21
41
|
if (source == null) return {};
|
|
22
42
|
var target = {};
|
|
@@ -32,13 +52,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
32
52
|
return target;
|
|
33
53
|
}
|
|
34
54
|
|
|
55
|
+
var _excluded = ["as", "children"];
|
|
35
56
|
var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
36
57
|
var _ref$as = _ref.as,
|
|
37
58
|
Element = _ref$as === void 0 ? 'span' : _ref$as,
|
|
38
59
|
children = _ref.children,
|
|
39
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
60
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
40
61
|
|
|
41
|
-
return
|
|
62
|
+
return React__default["default"].createElement(Element, _extends({
|
|
42
63
|
className: "eds-visually-hidden"
|
|
43
64
|
}, rest), children);
|
|
44
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.cjs.development.js","sources":["../src/SkipToContent.tsx","../src/VisuallyHidden.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport './SkipToContent.scss';\n\nexport type SkipToContentProps = {\n /** Lenketeksten */\n children: React.ReactNode;\n /** IDen til hovedinnholdsområdet\n * @default \"main-content\"\n */\n mainId?: string;\n};\n\nexport const SkipToContent: React.FC<SkipToContentProps> = ({\n children,\n mainId = 'main-content',\n}) => (\n <a className=\"eds-skip-to-content\" href={`#${mainId}`}>\n {children}\n </a>\n);\n","import React from 'react';\nimport './VisuallyHidden.scss';\n\nexport type VisuallyHiddenProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default \"span\"\n */\n as?: string | React.ElementType;\n /** Innhold for skjermlesere */\n children: React.ReactNode;\n [key: string]: any;\n};\n\nexport const VisuallyHidden: React.FC<VisuallyHiddenProps> = ({\n as: Element = 'span',\n children,\n ...rest\n}) => (\n <Element className=\"eds-visually-hidden\" {...rest}>\n {children}\n </Element>\n);\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('a11y', 'typography');\n\nexport * from './SkipToContent';\nexport * from './VisuallyHidden';\n"],"names":["SkipToContent","children","mainId","React","className","href","VisuallyHidden","as","Element","rest","warnAboutMissingStyles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"a11y.cjs.development.js","sources":["../src/SkipToContent.tsx","../src/VisuallyHidden.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport './SkipToContent.scss';\n\nexport type SkipToContentProps = {\n /** Lenketeksten */\n children: React.ReactNode;\n /** IDen til hovedinnholdsområdet\n * @default \"main-content\"\n */\n mainId?: string;\n};\n\nexport const SkipToContent: React.FC<SkipToContentProps> = ({\n children,\n mainId = 'main-content',\n}) => (\n <a className=\"eds-skip-to-content\" href={`#${mainId}`}>\n {children}\n </a>\n);\n","import React from 'react';\nimport './VisuallyHidden.scss';\n\nexport type VisuallyHiddenProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default \"span\"\n */\n as?: string | React.ElementType;\n /** Innhold for skjermlesere */\n children: React.ReactNode;\n [key: string]: any;\n};\n\nexport const VisuallyHidden: React.FC<VisuallyHiddenProps> = ({\n as: Element = 'span',\n children,\n ...rest\n}) => (\n <Element className=\"eds-visually-hidden\" {...rest}>\n {children}\n </Element>\n);\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('a11y', 'typography');\n\nexport * from './SkipToContent';\nexport * from './VisuallyHidden';\n"],"names":["SkipToContent","children","mainId","React","className","href","VisuallyHidden","as","Element","rest","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;IAYaA,aAAa,GAAiC,SAA9CA,aAA8C;AAAA,MACzDC,QADyD,QACzDA,QADyD;AAAA,yBAEzDC,MAFyD;AAAA,MAEzDA,MAFyD,4BAEhD,cAFgD;AAAA,SAIzDC,uCAAA,IAAA;AAAGC,IAAAA,SAAS,EAAC;AAAsBC,IAAAA,IAAI,QAAMH;GAA7C,EACGD,QADH,CAJyD;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICC9CK,cAAc,GAAkC,SAAhDA,cAAgD;AAAA,qBAC3DC,EAD2D;AAAA,MACvDC,OADuD,wBAC7C,MAD6C;AAAA,MAE3DP,QAF2D,QAE3DA,QAF2D;AAAA,MAGxDQ,IAHwD;;AAAA,SAK3DN,uCAAA,CAACK,OAAD;AAASJ,IAAAA,SAAS,EAAC;AAAnB,KAA6CK,IAA7C,GACGR,QADH,CAL2D;AAAA;;ACV7DS,4BAAsB,CAAC,MAAD,EAAS,YAAT,CAAtB;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));function n(){return n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var a=["as","children"];e.warnAboutMissingStyles("a11y","typography"),exports.SkipToContent=function(e){var t=e.mainId;return r.default.createElement("a",{className:"eds-skip-to-content",href:"#"+(void 0===t?"main-content":t)},e.children)},exports.VisuallyHidden=function(e){var t=e.as,i=void 0===t?"span":t,o=e.children,u=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}(e,a);return r.default.createElement(i,n({className:"eds-visually-hidden"},u),o)};
|
|
2
2
|
//# sourceMappingURL=a11y.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.cjs.production.min.js","sources":["../src/index.tsx","../src/SkipToContent.tsx","../src/VisuallyHidden.tsx"],"sourcesContent":["import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('a11y', 'typography');\n\nexport * from './SkipToContent';\nexport * from './VisuallyHidden';\n","import React from 'react';\nimport './SkipToContent.scss';\n\nexport type SkipToContentProps = {\n /** Lenketeksten */\n children: React.ReactNode;\n /** IDen til hovedinnholdsområdet\n * @default \"main-content\"\n */\n mainId?: string;\n};\n\nexport const SkipToContent: React.FC<SkipToContentProps> = ({\n children,\n mainId = 'main-content',\n}) => (\n <a className=\"eds-skip-to-content\" href={`#${mainId}`}>\n {children}\n </a>\n);\n","import React from 'react';\nimport './VisuallyHidden.scss';\n\nexport type VisuallyHiddenProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default \"span\"\n */\n as?: string | React.ElementType;\n /** Innhold for skjermlesere */\n children: React.ReactNode;\n [key: string]: any;\n};\n\nexport const VisuallyHidden: React.FC<VisuallyHiddenProps> = ({\n as: Element = 'span',\n children,\n ...rest\n}) => (\n <Element className=\"eds-visually-hidden\" {...rest}>\n {children}\n </Element>\n);\n"],"names":["warnAboutMissingStyles","mainId","React","className","href","children","as","Element","rest"],"mappings":"
|
|
1
|
+
{"version":3,"file":"a11y.cjs.production.min.js","sources":["../src/index.tsx","../src/SkipToContent.tsx","../src/VisuallyHidden.tsx"],"sourcesContent":["import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('a11y', 'typography');\n\nexport * from './SkipToContent';\nexport * from './VisuallyHidden';\n","import React from 'react';\nimport './SkipToContent.scss';\n\nexport type SkipToContentProps = {\n /** Lenketeksten */\n children: React.ReactNode;\n /** IDen til hovedinnholdsområdet\n * @default \"main-content\"\n */\n mainId?: string;\n};\n\nexport const SkipToContent: React.FC<SkipToContentProps> = ({\n children,\n mainId = 'main-content',\n}) => (\n <a className=\"eds-skip-to-content\" href={`#${mainId}`}>\n {children}\n </a>\n);\n","import React from 'react';\nimport './VisuallyHidden.scss';\n\nexport type VisuallyHiddenProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default \"span\"\n */\n as?: string | React.ElementType;\n /** Innhold for skjermlesere */\n children: React.ReactNode;\n [key: string]: any;\n};\n\nexport const VisuallyHidden: React.FC<VisuallyHiddenProps> = ({\n as: Element = 'span',\n children,\n ...rest\n}) => (\n <Element className=\"eds-visually-hidden\" {...rest}>\n {children}\n </Element>\n);\n"],"names":["warnAboutMissingStyles","mainId","React","className","href","children","as","Element","rest"],"mappings":"4aAGAA,yBAAuB,OAAQ,oCCS4B,oBAEzDC,cAEAC,6BAAGC,UAAU,sBAAsBC,qBAF1B,qBADTC,kCCA2D,oBAC3DC,GAAIC,aAAU,SACdF,IAAAA,SACGG,iJAEHN,wBAACK,KAAQJ,UAAU,uBAA0BK,GAC1CH"}
|
package/dist/a11y.esm.js
CHANGED
|
@@ -11,6 +11,24 @@ var SkipToContent = function SkipToContent(_ref) {
|
|
|
11
11
|
}, children);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
function _extends() {
|
|
15
|
+
_extends = Object.assign || function (target) {
|
|
16
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17
|
+
var source = arguments[i];
|
|
18
|
+
|
|
19
|
+
for (var key in source) {
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
+
target[key] = source[key];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return target;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return _extends.apply(this, arguments);
|
|
30
|
+
}
|
|
31
|
+
|
|
14
32
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
15
33
|
if (source == null) return {};
|
|
16
34
|
var target = {};
|
|
@@ -26,13 +44,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
26
44
|
return target;
|
|
27
45
|
}
|
|
28
46
|
|
|
47
|
+
var _excluded = ["as", "children"];
|
|
29
48
|
var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
30
49
|
var _ref$as = _ref.as,
|
|
31
50
|
Element = _ref$as === void 0 ? 'span' : _ref$as,
|
|
32
51
|
children = _ref.children,
|
|
33
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
52
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
53
|
|
|
35
|
-
return React.createElement(Element,
|
|
54
|
+
return React.createElement(Element, _extends({
|
|
36
55
|
className: "eds-visually-hidden"
|
|
37
56
|
}, rest), children);
|
|
38
57
|
};
|
package/dist/a11y.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.esm.js","sources":["../src/SkipToContent.tsx","../src/VisuallyHidden.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport './SkipToContent.scss';\n\nexport type SkipToContentProps = {\n /** Lenketeksten */\n children: React.ReactNode;\n /** IDen til hovedinnholdsområdet\n * @default \"main-content\"\n */\n mainId?: string;\n};\n\nexport const SkipToContent: React.FC<SkipToContentProps> = ({\n children,\n mainId = 'main-content',\n}) => (\n <a className=\"eds-skip-to-content\" href={`#${mainId}`}>\n {children}\n </a>\n);\n","import React from 'react';\nimport './VisuallyHidden.scss';\n\nexport type VisuallyHiddenProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default \"span\"\n */\n as?: string | React.ElementType;\n /** Innhold for skjermlesere */\n children: React.ReactNode;\n [key: string]: any;\n};\n\nexport const VisuallyHidden: React.FC<VisuallyHiddenProps> = ({\n as: Element = 'span',\n children,\n ...rest\n}) => (\n <Element className=\"eds-visually-hidden\" {...rest}>\n {children}\n </Element>\n);\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('a11y', 'typography');\n\nexport * from './SkipToContent';\nexport * from './VisuallyHidden';\n"],"names":["SkipToContent","children","mainId","React","className","href","VisuallyHidden","as","Element","rest","warnAboutMissingStyles"],"mappings":";;;IAYaA,aAAa,GAAiC,SAA9CA,aAA8C;AAAA,MACzDC,QADyD,QACzDA,QADyD;AAAA,yBAEzDC,MAFyD;AAAA,MAEzDA,MAFyD,4BAEhD,cAFgD;AAAA,SAIzDC,mBAAA,IAAA;AAAGC,IAAAA,SAAS,EAAC;AAAsBC,IAAAA,IAAI,QAAMH;GAA7C,EACGD,QADH,CAJyD;AAAA
|
|
1
|
+
{"version":3,"file":"a11y.esm.js","sources":["../src/SkipToContent.tsx","../src/VisuallyHidden.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport './SkipToContent.scss';\n\nexport type SkipToContentProps = {\n /** Lenketeksten */\n children: React.ReactNode;\n /** IDen til hovedinnholdsområdet\n * @default \"main-content\"\n */\n mainId?: string;\n};\n\nexport const SkipToContent: React.FC<SkipToContentProps> = ({\n children,\n mainId = 'main-content',\n}) => (\n <a className=\"eds-skip-to-content\" href={`#${mainId}`}>\n {children}\n </a>\n);\n","import React from 'react';\nimport './VisuallyHidden.scss';\n\nexport type VisuallyHiddenProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default \"span\"\n */\n as?: string | React.ElementType;\n /** Innhold for skjermlesere */\n children: React.ReactNode;\n [key: string]: any;\n};\n\nexport const VisuallyHidden: React.FC<VisuallyHiddenProps> = ({\n as: Element = 'span',\n children,\n ...rest\n}) => (\n <Element className=\"eds-visually-hidden\" {...rest}>\n {children}\n </Element>\n);\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('a11y', 'typography');\n\nexport * from './SkipToContent';\nexport * from './VisuallyHidden';\n"],"names":["SkipToContent","children","mainId","React","className","href","VisuallyHidden","as","Element","rest","warnAboutMissingStyles"],"mappings":";;;IAYaA,aAAa,GAAiC,SAA9CA,aAA8C;AAAA,MACzDC,QADyD,QACzDA,QADyD;AAAA,yBAEzDC,MAFyD;AAAA,MAEzDA,MAFyD,4BAEhD,cAFgD;AAAA,SAIzDC,mBAAA,IAAA;AAAGC,IAAAA,SAAS,EAAC;AAAsBC,IAAAA,IAAI,QAAMH;GAA7C,EACGD,QADH,CAJyD;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICC9CK,cAAc,GAAkC,SAAhDA,cAAgD;AAAA,qBAC3DC,EAD2D;AAAA,MACvDC,OADuD,wBAC7C,MAD6C;AAAA,MAE3DP,QAF2D,QAE3DA,QAF2D;AAAA,MAGxDQ,IAHwD;;AAAA,SAK3DN,mBAAA,CAACK,OAAD;AAASJ,IAAAA,SAAS,EAAC;AAAnB,KAA6CK,IAA7C,GACGR,QADH,CAL2D;AAAA;;ACV7DS,sBAAsB,CAAC,MAAD,EAAS,YAAT,CAAtB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/a11y",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.44",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/a11y.esm.js",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"start": "
|
|
21
|
-
"build": "
|
|
22
|
-
"lint": "
|
|
20
|
+
"start": "dts watch --noClean",
|
|
21
|
+
"build": "dts build",
|
|
22
|
+
"lint": "dts lint"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=16.8.0",
|
|
26
26
|
"react-dom": ">=16.8.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@entur/tokens": "^3.3.
|
|
30
|
-
"@entur/typography": "^1.6.
|
|
31
|
-
"@entur/utils": "^0.4.
|
|
29
|
+
"@entur/tokens": "^3.3.2",
|
|
30
|
+
"@entur/typography": "^1.6.13",
|
|
31
|
+
"@entur/utils": "^0.4.3"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "9e25b2a4a4ab659dc368f51ad0e0b74bee26e1d0"
|
|
34
34
|
}
|