@navikt/ds-react 0.19.17 → 0.19.20

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.
@@ -40,6 +40,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
40
40
  const classnames_1 = __importDefault(require("classnames"));
41
41
  const react_1 = __importStar(require("react"));
42
42
  const react_collapse_1 = require("react-collapse");
43
+ const typography_1 = require("../typography");
43
44
  const AccordionItem_1 = require("./AccordionItem");
44
45
  const AccordionContent = (0, react_1.forwardRef)((_a, ref) => {
45
46
  var { children, className, id } = _a, rest = __rest(_a, ["children", "className", "id"]);
@@ -53,6 +54,6 @@ const AccordionContent = (0, react_1.forwardRef)((_a, ref) => {
53
54
  : react_collapse_1.UnmountClosed;
54
55
  return (react_1.default.createElement("div", Object.assign({ ref: ref, "aria-labelledby": context.buttonId }, rest),
55
56
  react_1.default.createElement(CollapseComponent, { isOpened: context.open },
56
- react_1.default.createElement("div", { className: (0, classnames_1.default)("navds-accordion__content", className) }, children))));
57
+ react_1.default.createElement(typography_1.BodyLong, { as: "div", className: (0, classnames_1.default)("navds-accordion__content", className) }, children))));
57
58
  });
58
59
  exports.default = AccordionContent;
@@ -58,13 +58,9 @@ const AccordionHeader = (0, react_1.forwardRef)((_a, ref) => {
58
58
  context.toggleOpen();
59
59
  onClick && onClick(e);
60
60
  };
61
- return (react_1.default.createElement("button", Object.assign({}, rest, { ref: ref, id: context.buttonId, className: (0, classnames_1.default)("navds-accordion__header", className, "navds-heading", "navds-heading--small"), onClick: handleClick, "aria-expanded": context.open }),
62
- children,
63
- react_1.default.createElement(ds_icons_1.Expand, { "aria-hidden": true, className: (0, classnames_1.default)("navds-accordion__expand-icon", {
64
- "navds-accordion__expand-icon--flip": context.open,
65
- }) }),
66
- react_1.default.createElement(ds_icons_1.ExpandFilled, { "aria-hidden": true, className: (0, classnames_1.default)("navds-accordion__expand-icon", "navds-accordion__expand-icon--filled", {
67
- "navds-accordion__expand-icon--flip": context.open,
68
- }) })));
61
+ return (react_1.default.createElement("button", Object.assign({}, rest, { ref: ref, id: context.buttonId, className: (0, classnames_1.default)("navds-accordion__header", className, "navds-heading", "navds-heading--small"), type: "button", onClick: handleClick, "aria-expanded": context.open }),
62
+ react_1.default.createElement("span", { className: "navds-accordion__header-content" }, children),
63
+ react_1.default.createElement(ds_icons_1.Expand, { "aria-hidden": true, className: "navds-accordion__expand-icon" }),
64
+ react_1.default.createElement(ds_icons_1.ExpandFilled, { "aria-hidden": true, className: "navds-accordion__expand-icon navds-accordion__expand-icon--filled" })));
69
65
  });
70
66
  exports.default = AccordionHeader;
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import cl from "classnames";
13
13
  import React, { forwardRef, useContext } from "react";
14
14
  import { Collapse, UnmountClosed } from "react-collapse";
15
+ import { BodyLong } from "../typography";
15
16
  import { AccordionItemContext } from "./AccordionItem";
16
17
  const AccordionContent = forwardRef((_a, ref) => {
17
18
  var { children, className, id } = _a, rest = __rest(_a, ["children", "className", "id"]);
@@ -25,7 +26,7 @@ const AccordionContent = forwardRef((_a, ref) => {
25
26
  : UnmountClosed;
26
27
  return (React.createElement("div", Object.assign({ ref: ref, "aria-labelledby": context.buttonId }, rest),
27
28
  React.createElement(CollapseComponent, { isOpened: context.open },
28
- React.createElement("div", { className: cl("navds-accordion__content", className) }, children))));
29
+ React.createElement(BodyLong, { as: "div", className: cl("navds-accordion__content", className) }, children))));
29
30
  });
30
31
  export default AccordionContent;
31
32
  //# sourceMappingURL=AccordionContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionContent.js","sourceRoot":"","sources":["../../src/accordion/AccordionContent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBA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AE,EAAE;QAA7C,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAW,EAAN,IAAI,cAAlC,+BAAoC,CAAF;IACjC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAEjD,IAAI,OAAO,KAAK,IAAI,EAAE;QACpB,OAAO,CAAC,KAAK,CACX,+DAA+D,CAChE,CAAC;QACF,OAAO,IAAI,CAAC;KACb;IAED,MAAM,iBAAiB,GAAG,OAAO,CAAC,uBAAuB;QACvD,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,aAAa,CAAC;IAElB,OAAO,CACL,2CAAK,GAAG,EAAE,GAAG,qBAAmB,OAAO,CAAC,QAAQ,IAAM,IAAI;QACxD,oBAAC,iBAAiB,IAAC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACvC,oBAAC,QAAQ,IACP,EAAE,EAAC,KAAK,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,IAEnD,QAAQ,CACA,CACO,CAChB,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -30,14 +30,10 @@ const AccordionHeader = forwardRef((_a, ref) => {
30
30
  context.toggleOpen();
31
31
  onClick && onClick(e);
32
32
  };
33
- return (React.createElement("button", Object.assign({}, rest, { ref: ref, id: context.buttonId, className: cl("navds-accordion__header", className, "navds-heading", "navds-heading--small"), onClick: handleClick, "aria-expanded": context.open }),
34
- children,
35
- React.createElement(Expand, { "aria-hidden": true, className: cl("navds-accordion__expand-icon", {
36
- "navds-accordion__expand-icon--flip": context.open,
37
- }) }),
38
- React.createElement(ExpandFilled, { "aria-hidden": true, className: cl("navds-accordion__expand-icon", "navds-accordion__expand-icon--filled", {
39
- "navds-accordion__expand-icon--flip": context.open,
40
- }) })));
33
+ return (React.createElement("button", Object.assign({}, rest, { ref: ref, id: context.buttonId, className: cl("navds-accordion__header", className, "navds-heading", "navds-heading--small"), type: "button", onClick: handleClick, "aria-expanded": context.open }),
34
+ React.createElement("span", { className: "navds-accordion__header-content" }, children),
35
+ React.createElement(Expand, { "aria-hidden": true, className: "navds-accordion__expand-icon" }),
36
+ React.createElement(ExpandFilled, { "aria-hidden": true, className: "navds-accordion__expand-icon navds-accordion__expand-icon--filled" })));
41
37
  });
42
38
  export default AccordionHeader;
43
39
  //# sourceMappingURL=AccordionHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionHeader.js","sourceRoot":"","sources":["../../src/accordion/AccordionHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAclD,MAAM,eAAe,GAAwB,UAAU,CACrD,CAAC,EAA6C,EAAE,GAAG,EAAE,EAAE;QAAtD,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,OAAW,EAAN,IAAI,cAA3C,0CAA6C,CAAF;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IAExB,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC;IAEnD,qBAAqB,CAAC,GAAG,EAAE;QACzB,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAoB,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzB,IAAI,OAAO,KAAK,IAAI,EAAE;QACpB,OAAO,CAAC,KAAK,CACX,8DAA8D,CAC/D,CAAC;QACF,OAAO,IAAI,CAAC;KACb;IAED,MAAM,WAAW,GAAG,CAClB,CAAkD,EAClD,EAAE;QACF,OAAO,CAAC,UAAU,EAAE,CAAC;QACrB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACL,gDACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,OAAO,CAAC,QAAQ,EACpB,SAAS,EAAE,EAAE,CACX,yBAAyB,EACzB,SAAS,EACT,eAAe,EACf,sBAAsB,CACvB,EACD,OAAO,EAAE,WAAW,mBACL,OAAO,CAAC,IAAI;QAE1B,QAAQ;QACT,oBAAC,MAAM,yBAEL,SAAS,EAAE,EAAE,CAAC,8BAA8B,EAAE;gBAC5C,oCAAoC,EAAE,OAAO,CAAC,IAAI;aACnD,CAAC,GACF;QACF,oBAAC,YAAY,yBAEX,SAAS,EAAE,EAAE,CACX,8BAA8B,EAC9B,sCAAsC,EACtC;gBACE,oCAAoC,EAAE,OAAO,CAAC,IAAI;aACnD,CACF,GACD,CACK,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"AccordionHeader.js","sourceRoot":"","sources":["../../src/accordion/AccordionHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAclD,MAAM,eAAe,GAAwB,UAAU,CACrD,CAAC,EAA6C,EAAE,GAAG,EAAE,EAAE;QAAtD,E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
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "0.19.17",
3
+ "version": "0.19.20",
4
4
  "description": "NAV designsystem react components",
5
5
  "author": "NAV Designsystem team",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@floating-ui/react-dom": "0.6.0",
39
39
  "@material-ui/core": "^4.12.3",
40
- "@navikt/ds-icons": "^0.8.17",
40
+ "@navikt/ds-icons": "^0.8.18",
41
41
  "@popperjs/core": "^2.10.1",
42
42
  "@radix-ui/react-tabs": "0.1.5",
43
43
  "@radix-ui/react-toggle-group": "0.1.5",
@@ -76,5 +76,5 @@
76
76
  "@types/react": "^17.0.30 || ^18.0.0",
77
77
  "react": "^17.0.0 || ^18.0.0"
78
78
  },
79
- "gitHead": "c47048cc2d6af3c5f04a22420790c38ac2884040"
79
+ "gitHead": "88e8a7141208115305f039e827673931a83ecbee"
80
80
  }
@@ -1,6 +1,7 @@
1
1
  import cl from "classnames";
2
2
  import React, { forwardRef, useContext } from "react";
3
3
  import { Collapse, UnmountClosed } from "react-collapse";
4
+ import { BodyLong } from "../typography";
4
5
  import { AccordionItemContext } from "./AccordionItem";
5
6
 
6
7
  export interface AccordionContentProps
@@ -35,9 +36,12 @@ const AccordionContent: AccordionContentType = forwardRef(
35
36
  return (
36
37
  <div ref={ref} aria-labelledby={context.buttonId} {...rest}>
37
38
  <CollapseComponent isOpened={context.open}>
38
- <div className={cl("navds-accordion__content", className)}>
39
+ <BodyLong
40
+ as="div"
41
+ className={cl("navds-accordion__content", className)}
42
+ >
39
43
  {children}
40
- </div>
44
+ </BodyLong>
41
45
  </CollapseComponent>
42
46
  </div>
43
47
  );
@@ -52,25 +52,15 @@ const AccordionHeader: AccordionHeaderType = forwardRef(
52
52
  "navds-heading",
53
53
  "navds-heading--small"
54
54
  )}
55
+ type="button"
55
56
  onClick={handleClick}
56
57
  aria-expanded={context.open}
57
58
  >
58
- {children}
59
- <Expand
60
- aria-hidden
61
- className={cl("navds-accordion__expand-icon", {
62
- "navds-accordion__expand-icon--flip": context.open,
63
- })}
64
- />
59
+ <span className="navds-accordion__header-content">{children}</span>
60
+ <Expand aria-hidden className="navds-accordion__expand-icon" />
65
61
  <ExpandFilled
66
62
  aria-hidden
67
- className={cl(
68
- "navds-accordion__expand-icon",
69
- "navds-accordion__expand-icon--filled",
70
- {
71
- "navds-accordion__expand-icon--flip": context.open,
72
- }
73
- )}
63
+ className="navds-accordion__expand-icon navds-accordion__expand-icon--filled"
74
64
  />
75
65
  </button>
76
66
  );
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { ReadMore } from ".";
3
+ import { BodyShort } from "..";
3
4
 
4
5
  export default {
5
6
  title: "ds-react/ReadMore",
@@ -24,8 +25,14 @@ export const Default = (props) => {
24
25
  header="Grunnen til at vi spør om dette og i tillegg ber om vedlegg"
25
26
  {...props}
26
27
  >
27
- Command station, this is ST 321. Code Clearance Blue. We're starting our
28
- approach. Deactivate the security shield.
28
+ <BodyShort>
29
+ Command station, this is ST 321. Code Clearance Blue. We're starting our
30
+ approach. Deactivate the security shield.
31
+ </BodyShort>
32
+ <BodyShort>
33
+ Command station, this is ST 321. Code Clearance Blue. We're starting our
34
+ approach. Deactivate the security shield.
35
+ </BodyShort>
29
36
  </ReadMore>
30
37
  );
31
38
  };