@entur/a11y 0.2.50-beta.3 → 0.2.51

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.
@@ -11,8 +11,8 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
12
  var SkipToContent = function SkipToContent(_ref) {
13
13
  var children = _ref.children,
14
- _ref$mainId = _ref.mainId,
15
- mainId = _ref$mainId === void 0 ? 'main-content' : _ref$mainId;
14
+ _ref$mainId = _ref.mainId,
15
+ mainId = _ref$mainId === void 0 ? 'main-content' : _ref$mainId;
16
16
  return React__default["default"].createElement("a", {
17
17
  className: "eds-skip-to-content",
18
18
  href: "#" + mainId
@@ -23,42 +23,35 @@ function _extends() {
23
23
  _extends = Object.assign || function (target) {
24
24
  for (var i = 1; i < arguments.length; i++) {
25
25
  var source = arguments[i];
26
-
27
26
  for (var key in source) {
28
27
  if (Object.prototype.hasOwnProperty.call(source, key)) {
29
28
  target[key] = source[key];
30
29
  }
31
30
  }
32
31
  }
33
-
34
32
  return target;
35
33
  };
36
-
37
34
  return _extends.apply(this, arguments);
38
35
  }
39
-
40
36
  function _objectWithoutPropertiesLoose(source, excluded) {
41
37
  if (source == null) return {};
42
38
  var target = {};
43
39
  var sourceKeys = Object.keys(source);
44
40
  var key, i;
45
-
46
41
  for (i = 0; i < sourceKeys.length; i++) {
47
42
  key = sourceKeys[i];
48
43
  if (excluded.indexOf(key) >= 0) continue;
49
44
  target[key] = source[key];
50
45
  }
51
-
52
46
  return target;
53
47
  }
54
48
 
55
49
  var _excluded = ["as", "children"];
56
50
  var VisuallyHidden = function VisuallyHidden(_ref) {
57
51
  var _ref$as = _ref.as,
58
- Element = _ref$as === void 0 ? 'span' : _ref$as,
59
- children = _ref.children,
60
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
61
-
52
+ Element = _ref$as === void 0 ? 'span' : _ref$as,
53
+ children = _ref.children,
54
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
62
55
  return React__default["default"].createElement(Element, _extends({
63
56
  className: "eds-visually-hidden"
64
57
  }, rest), children);
@@ -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":";;;;;;;;;;;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
+ {"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,aAAa;EAAA,IACxBC,QAAQ,QAARA,QAAQ;IAAA,mBACRC,MAAM;IAANA,MAAM,4BAAG,cAAc;EAAA,OAEvBC;IAAGC,SAAS,EAAC,qBAAqB;IAACC,IAAI,QAAMH;KAC1CD,QAAQ,CACP;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICLOK,cAAc,GAAkC,SAAhDA,cAAc;EAAA,mBACzBC,EAAE;IAAEC,OAAO,wBAAG,MAAM;IACpBP,QAAQ,QAARA,QAAQ;IACLQ,IAAI;EAAA,OAEPN,wCAACK,OAAO;IAACJ,SAAS,EAAC;KAA0BK,IAAI,GAC9CR,QAAQ,CACD;AAAA;;ACjBZS,4BAAsB,CAAC,MAAM,EAAE,YAAY,CAAC;;;;;"}
@@ -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":"4aAGAA,yBAAuB,OAAQ,oCCS4B,oBAEzDC,cAEAC,6BAAGC,UAAU,sBAAsBC,qBAF1B,qBADTC,kCCA2D,oBAC3DC,GAAIC,aAAU,SACdF,IAAAA,SACGG,iJAEHN,wBAACK,KAAQJ,UAAU,uBAA0BK,GAC1CH"}
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","_ref$mainId","mainId","React","className","href","children","as","Element","rest"],"mappings":"4aAGAA,yBAAuB,OAAQ,oCCS4B,YAAjC,IAChBC,IACRC,OAAuB,OAEvBC,6BAAGC,UAAU,sBAAsBC,qBAF1B,qBADTC,kCCA2D,YAAlC,QACzBC,GAAIC,aAAU,SACdF,IAAAA,SACGG,0IAAI,OAEPN,wBAACK,KAAQJ,UAAU,uBAA0BK,GAC1CH"}
package/dist/a11y.esm.js CHANGED
@@ -3,8 +3,8 @@ import React from 'react';
3
3
 
4
4
  var SkipToContent = function SkipToContent(_ref) {
5
5
  var children = _ref.children,
6
- _ref$mainId = _ref.mainId,
7
- mainId = _ref$mainId === void 0 ? 'main-content' : _ref$mainId;
6
+ _ref$mainId = _ref.mainId,
7
+ mainId = _ref$mainId === void 0 ? 'main-content' : _ref$mainId;
8
8
  return React.createElement("a", {
9
9
  className: "eds-skip-to-content",
10
10
  href: "#" + mainId
@@ -15,42 +15,35 @@ function _extends() {
15
15
  _extends = Object.assign || function (target) {
16
16
  for (var i = 1; i < arguments.length; i++) {
17
17
  var source = arguments[i];
18
-
19
18
  for (var key in source) {
20
19
  if (Object.prototype.hasOwnProperty.call(source, key)) {
21
20
  target[key] = source[key];
22
21
  }
23
22
  }
24
23
  }
25
-
26
24
  return target;
27
25
  };
28
-
29
26
  return _extends.apply(this, arguments);
30
27
  }
31
-
32
28
  function _objectWithoutPropertiesLoose(source, excluded) {
33
29
  if (source == null) return {};
34
30
  var target = {};
35
31
  var sourceKeys = Object.keys(source);
36
32
  var key, i;
37
-
38
33
  for (i = 0; i < sourceKeys.length; i++) {
39
34
  key = sourceKeys[i];
40
35
  if (excluded.indexOf(key) >= 0) continue;
41
36
  target[key] = source[key];
42
37
  }
43
-
44
38
  return target;
45
39
  }
46
40
 
47
41
  var _excluded = ["as", "children"];
48
42
  var VisuallyHidden = function VisuallyHidden(_ref) {
49
43
  var _ref$as = _ref.as,
50
- Element = _ref$as === void 0 ? 'span' : _ref$as,
51
- children = _ref.children,
52
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
53
-
44
+ Element = _ref$as === void 0 ? 'span' : _ref$as,
45
+ children = _ref.children,
46
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
54
47
  return React.createElement(Element, _extends({
55
48
  className: "eds-visually-hidden"
56
49
  }, rest), children);
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;"}
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,aAAa;EAAA,IACxBC,QAAQ,QAARA,QAAQ;IAAA,mBACRC,MAAM;IAANA,MAAM,4BAAG,cAAc;EAAA,OAEvBC;IAAGC,SAAS,EAAC,qBAAqB;IAACC,IAAI,QAAMH;KAC1CD,QAAQ,CACP;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICLOK,cAAc,GAAkC,SAAhDA,cAAc;EAAA,mBACzBC,EAAE;IAAEC,OAAO,wBAAG,MAAM;IACpBP,QAAQ,QAARA,QAAQ;IACLQ,IAAI;EAAA,OAEPN,oBAACK,OAAO;IAACJ,SAAS,EAAC;KAA0BK,IAAI,GAC9CR,QAAQ,CACD;AAAA;;ACjBZS,sBAAsB,CAAC,MAAM,EAAE,YAAY,CAAC;;;;"}
package/dist/styles.css CHANGED
@@ -1,15 +1,5 @@
1
1
  :root {
2
2
  --eds-a11y: 1;
3
- }.eds-visually-hidden {
4
- display: block;
5
- border: 0;
6
- clip: rect(0 0 0 0);
7
- height: 1px;
8
- width: 1px;
9
- margin: -1px;
10
- padding: 0;
11
- overflow: hidden;
12
- position: absolute;
13
3
  }/* DO NOT CHANGE!*/
14
4
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
15
5
  .eds-skip-to-content {
@@ -35,4 +25,14 @@
35
25
  outline: none;
36
26
  box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #181c56;
37
27
  outline-offset: 0.125rem;
28
+ }.eds-visually-hidden {
29
+ display: block;
30
+ border: 0;
31
+ clip: rect(0 0 0 0);
32
+ height: 1px;
33
+ width: 1px;
34
+ margin: -1px;
35
+ padding: 0;
36
+ overflow: hidden;
37
+ position: absolute;
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/a11y",
3
- "version": "0.2.50-beta.3",
3
+ "version": "0.2.51",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/a11y.esm.js",
@@ -26,12 +26,12 @@
26
26
  "react-dom": ">=16.8.0"
27
27
  },
28
28
  "dependencies": {
29
- "@entur/tokens": "^3.4.2-beta.2",
30
- "@entur/typography": "^1.7.1-beta.3",
31
- "@entur/utils": "^0.4.6-beta.2"
29
+ "@entur/tokens": "^3.4.2",
30
+ "@entur/typography": "^1.7.2",
31
+ "@entur/utils": "^0.4.7"
32
32
  },
33
33
  "devDependencies": {
34
34
  "dts-cli": "^1.1.6"
35
35
  },
36
- "gitHead": "89c8eee86c247794134c34484a205e0f7f65d0a5"
36
+ "gitHead": "8915b1630bd936740ba9a4a88883f3432948a80e"
37
37
  }