@navikt/ds-react 5.2.1 → 5.3.1

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.
Files changed (88) hide show
  1. package/_docs.json +336 -140
  2. package/cjs/date/DateInput.js +1 -1
  3. package/cjs/date/monthpicker/MonthButton.js +5 -5
  4. package/cjs/form/Textarea.js +1 -4
  5. package/cjs/guide-panel/GuidePanel.js +7 -5
  6. package/cjs/guide-panel/Illustration.js +12 -16
  7. package/cjs/typography/BodyLong.js +14 -7
  8. package/cjs/typography/BodyShort.js +13 -8
  9. package/cjs/typography/Detail.js +14 -7
  10. package/cjs/typography/ErrorMessage.js +6 -4
  11. package/cjs/typography/Heading.js +10 -6
  12. package/cjs/typography/Ingress.js +4 -2
  13. package/cjs/typography/Label.js +10 -6
  14. package/cjs/typography/types.js +2 -0
  15. package/cjs/typography/util.js +19 -0
  16. package/esm/date/DateInput.js +1 -1
  17. package/esm/date/DateInput.js.map +1 -1
  18. package/esm/date/monthpicker/MonthButton.js +5 -5
  19. package/esm/date/monthpicker/MonthButton.js.map +1 -1
  20. package/esm/form/Textarea.js +1 -4
  21. package/esm/form/Textarea.js.map +1 -1
  22. package/esm/guide-panel/GuidePanel.d.ts +3 -3
  23. package/esm/guide-panel/GuidePanel.js +7 -5
  24. package/esm/guide-panel/GuidePanel.js.map +1 -1
  25. package/esm/guide-panel/Illustration.js +12 -16
  26. package/esm/guide-panel/Illustration.js.map +1 -1
  27. package/esm/guide-panel/index.d.ts +0 -1
  28. package/esm/guide-panel/index.js.map +1 -1
  29. package/esm/typography/BodyLong.d.ts +9 -10
  30. package/esm/typography/BodyLong.js +14 -7
  31. package/esm/typography/BodyLong.js.map +1 -1
  32. package/esm/typography/BodyShort.d.ts +6 -9
  33. package/esm/typography/BodyShort.js +13 -8
  34. package/esm/typography/BodyShort.js.map +1 -1
  35. package/esm/typography/Detail.d.ts +4 -7
  36. package/esm/typography/Detail.js +14 -7
  37. package/esm/typography/Detail.js.map +1 -1
  38. package/esm/typography/ErrorMessage.d.ts +4 -7
  39. package/esm/typography/ErrorMessage.js +6 -4
  40. package/esm/typography/ErrorMessage.js.map +1 -1
  41. package/esm/typography/Heading.d.ts +3 -7
  42. package/esm/typography/Heading.js +10 -6
  43. package/esm/typography/Heading.js.map +1 -1
  44. package/esm/typography/Ingress.d.ts +4 -2
  45. package/esm/typography/Ingress.js +4 -2
  46. package/esm/typography/Ingress.js.map +1 -1
  47. package/esm/typography/Label.d.ts +4 -7
  48. package/esm/typography/Label.js +10 -6
  49. package/esm/typography/Label.js.map +1 -1
  50. package/esm/typography/types.d.ts +26 -0
  51. package/esm/typography/types.js +2 -0
  52. package/esm/typography/types.js.map +1 -0
  53. package/esm/typography/util.d.ts +4 -0
  54. package/esm/typography/util.js +13 -0
  55. package/esm/typography/util.js.map +1 -0
  56. package/package.json +2 -2
  57. package/src/date/DateInput.tsx +1 -1
  58. package/src/date/datepicker/datepicker.stories.tsx +23 -19
  59. package/src/date/monthpicker/MonthButton.tsx +5 -7
  60. package/src/date/monthpicker/monthpicker.stories.tsx +30 -32
  61. package/src/form/Textarea.tsx +1 -1
  62. package/src/guide-panel/GuidePanel.tsx +11 -10
  63. package/src/guide-panel/Illustration.tsx +23 -47
  64. package/src/guide-panel/guidepanel.stories.tsx +39 -14
  65. package/src/guide-panel/index.ts +0 -1
  66. package/src/typography/BodyLong.tsx +36 -15
  67. package/src/typography/BodyShort.tsx +34 -15
  68. package/src/typography/Detail.tsx +28 -13
  69. package/src/typography/ErrorMessage.tsx +17 -11
  70. package/src/typography/Heading.tsx +32 -12
  71. package/src/typography/Ingress.tsx +4 -2
  72. package/src/typography/Label.tsx +28 -13
  73. package/src/typography/stories/bodylong.stories.tsx +165 -0
  74. package/src/typography/stories/bodyshort.stories.tsx +164 -0
  75. package/src/typography/stories/detail.stories.tsx +88 -0
  76. package/src/typography/stories/error-message.stories.tsx +93 -0
  77. package/src/typography/stories/heading.stories.tsx +143 -0
  78. package/src/typography/stories/ingress.stories.tsx +51 -0
  79. package/src/typography/stories/label.stories.tsx +98 -0
  80. package/src/typography/types.ts +26 -0
  81. package/src/typography/util.ts +14 -0
  82. package/cjs/guide-panel/Guide.js +0 -48
  83. package/esm/guide-panel/Guide.d.ts +0 -14
  84. package/esm/guide-panel/Guide.js +0 -21
  85. package/esm/guide-panel/Guide.js.map +0 -1
  86. package/src/guide-panel/Guide.tsx +0 -34
  87. package/src/typography/heading.stories.tsx +0 -77
  88. package/src/typography/typography.stories.tsx +0 -166
@@ -9,8 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import React, { forwardRef } from "react";
13
12
  import cl from "clsx";
13
+ import React, { forwardRef } from "react";
14
+ import { typoClassNames } from "./util";
14
15
  /**
15
16
  * Part of a set of components for displaying text with consistent typography.
16
17
  *
@@ -20,16 +21,19 @@ import cl from "clsx";
20
21
  *
21
22
  * @example
22
23
  * ```jsx
23
- * <Label level="1" size="xlarge">
24
- * Pengestøtte når du er syk
24
+ * <Label>
25
+ * Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
25
26
  * </Label>
26
27
  * ```
27
28
  */
28
29
  export const Label = forwardRef((_a, ref) => {
29
- var { className, size = "medium", spacing, as: Component = "label" } = _a, rest = __rest(_a, ["className", "size", "spacing", "as"]);
30
- return (React.createElement(Component, Object.assign({}, rest, { ref: ref, className: cl(className, "navds-label", {
30
+ var { className, size = "medium", as: Component = "label", spacing, visuallyHidden, textColor } = _a, rest = __rest(_a, ["className", "size", "as", "spacing", "visuallyHidden", "textColor"]);
31
+ return (React.createElement(Component, Object.assign({}, rest, { ref: ref, className: cl(className, "navds-label", typoClassNames({
32
+ spacing,
33
+ visuallyHidden,
34
+ textColor,
35
+ }), {
31
36
  "navds-label--small": size === "small",
32
- "navds-typo--spacing": !!spacing,
33
37
  }) })));
34
38
  });
35
39
  export default Label;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../src/typography/Label.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,MAAM,CAAC;AAoBtB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,KAAK,GAChB,UAAU,CACR,CACE,EAAyE,EACzE,GAAG,EACH,EAAE;QAFF,EAAE,SAAS,EAAE,IAAI,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,OAAW,EAAN,IAAI,cAAvE,sCAAyE,CAAF;IAEpE,OAAA,CACH,oBAAC,SAAS,oBACJ,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE;YACtC,oBAAoB,EAAE,IAAI,KAAK,OAAO;YACtC,qBAAqB,EAAE,CAAC,CAAC,OAAO;SACjC,CAAC,IACF,CACH,CAAA;CAAA,CACF,CAAC;AAEJ,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../src/typography/Label.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAgBxC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,KAAK,GAChB,UAAU,CACR,CACE,EAQC,EACD,GAAG,EACH,EAAE;QAVF,EACE,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,EAAE,EAAE,SAAS,GAAG,OAAO,EACvB,OAAO,EACP,cAAc,EACd,SAAS,OAEV,EADI,IAAI,cAPT,qEAQC,CADQ;IAGN,OAAA,CACH,oBAAC,SAAS,oBACJ,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,SAAS,EACT,aAAa,EACb,cAAc,CAAC;YACb,OAAO;YACP,cAAc;YACd,SAAS;SACV,CAAC,EACF;YACE,oBAAoB,EAAE,IAAI,KAAK,OAAO;SACvC,CACF,IACD,CACH,CAAA;CAAA,CACF,CAAC;AAEJ,eAAe,KAAK,CAAC"}
@@ -0,0 +1,26 @@
1
+ export type TypoProps = {
2
+ /**
3
+ * Truncate text overflow with ellipsis.
4
+ */
5
+ truncate?: boolean;
6
+ /**
7
+ * Adjusts font-weight.
8
+ */
9
+ weight?: "regular" | "semibold";
10
+ /**
11
+ * Adjust text-align.
12
+ */
13
+ align?: "start" | "center" | "end";
14
+ /**
15
+ * Visually hide text. Text will still be accessible for screenreaders
16
+ */
17
+ visuallyHidden?: boolean;
18
+ /**
19
+ * Adds spacing below text
20
+ */
21
+ spacing?: boolean;
22
+ /**
23
+ * Adjusts color
24
+ */
25
+ textColor?: "default" | "subtle";
26
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/typography/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { TypoProps } from "./types";
2
+ export declare const typoClassNames: (props: TypoProps & {
3
+ uppercase?: boolean;
4
+ }) => string;
@@ -0,0 +1,13 @@
1
+ import cl from "clsx";
2
+ export const typoClassNames = (props) => {
3
+ return cl({
4
+ "navds-typo--spacing": props.spacing,
5
+ "navds-typo--truncate": props.truncate,
6
+ "navds-typo--semibold": props.weight === "semibold",
7
+ [`navds-typo--align-${props.align}`]: props.align,
8
+ [`navds-typo--color-${props.textColor}`]: props.textColor,
9
+ "navds-typo--visually-hidden": props.visuallyHidden,
10
+ "navds-typo--uppercase": props.uppercase,
11
+ });
12
+ };
13
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/typography/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AAGtB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0C,EAAE,EAAE;IAC3E,OAAO,EAAE,CAAC;QACR,qBAAqB,EAAE,KAAK,CAAC,OAAO;QACpC,sBAAsB,EAAE,KAAK,CAAC,QAAQ;QACtC,sBAAsB,EAAE,KAAK,CAAC,MAAM,KAAK,UAAU;QACnD,CAAC,qBAAqB,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK;QACjD,CAAC,qBAAqB,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS;QACzD,6BAA6B,EAAE,KAAK,CAAC,cAAc;QACnD,uBAAuB,EAAE,KAAK,CAAC,SAAS;KACzC,CAAC,CAAC;AACL,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "5.2.1",
3
+ "version": "5.3.1",
4
4
  "description": "Aksel react-components for NAV designsystem",
5
5
  "author": "Aksel | NAV designsystem team",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@floating-ui/react": "0.24.1",
41
- "@navikt/aksel-icons": "^5.2.1",
41
+ "@navikt/aksel-icons": "^5.3.1",
42
42
  "@radix-ui/react-tabs": "1.0.0",
43
43
  "@radix-ui/react-toggle-group": "1.0.0",
44
44
  "clsx": "^1.2.1",
@@ -113,7 +113,7 @@ const DateInput = forwardRef<HTMLInputElement, DateInputProps>((props, ref) => {
113
113
  "navds-date__field-input",
114
114
  "navds-text-field__input",
115
115
  "navds-body-short",
116
- `navds-body-${size}`
116
+ `navds-body-short--${size}`
117
117
  )}
118
118
  size={14}
119
119
  />
@@ -1,8 +1,9 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
+ import { Meta, StoryObj } from "@storybook/react";
2
3
  import React, { useId, useState } from "react";
3
4
  import { useDatepicker, useRangeDatepicker } from "..";
4
5
  import { Button } from "../..";
5
- import DatePicker from "./DatePicker";
6
+ import DatePicker, { DatePickerProps } from "./DatePicker";
6
7
 
7
8
  const disabledDays = [
8
9
  new Date("Oct 10 2022"),
@@ -12,20 +13,29 @@ const disabledDays = [
12
13
  export default {
13
14
  title: "ds-react/Datepicker",
14
15
  component: DatePicker,
16
+ } satisfies Meta<typeof DatePicker>;
17
+
18
+ type DefaultStoryProps = DatePickerProps & {
19
+ size: "medium" | "small";
20
+ openOnFocus: boolean;
21
+ inputfield: boolean;
22
+ standalone: boolean;
15
23
  };
16
24
 
17
- export const Default = {
25
+ export const Default: StoryObj<DefaultStoryProps> = {
18
26
  render: (props) => {
19
27
  const [open, setOpen] = useState(false);
20
28
 
21
29
  const rangeCtx = useRangeDatepicker({
22
30
  fromDate: new Date("Aug 23 2020"),
23
31
  toDate: new Date("Aug 23 2023"),
32
+ openOnFocus: props.openOnFocus,
24
33
  });
25
34
 
26
35
  const singleCtx = useDatepicker({
27
36
  fromDate: new Date("Aug 23 2020"),
28
37
  toDate: new Date("Aug 23 2023"),
38
+ openOnFocus: props.openOnFocus,
29
39
  });
30
40
 
31
41
  const newProps = {
@@ -44,9 +54,7 @@ export const Default = {
44
54
  return (
45
55
  <div>
46
56
  <Comp
47
- locale={props?.locale}
48
- dropdownCaption={props?.dropdownCaption}
49
- disableWeekends={props?.disableWeekends}
57
+ dropdownCaption={props.dropdownCaption}
50
58
  showWeekNumber={props.showWeekNumber}
51
59
  mode={props.mode}
52
60
  {...(props.mode === "single"
@@ -55,6 +63,8 @@ export const Default = {
55
63
  ? rangeCtx.datepickerProps
56
64
  : {})}
57
65
  {...newProps}
66
+ locale={props.locale}
67
+ disableWeekends={props.disableWeekends}
58
68
  >
59
69
  {!props.standalone && (
60
70
  <>
@@ -99,29 +109,23 @@ export const Default = {
99
109
  dropdownCaption: false,
100
110
  disableWeekends: false,
101
111
  showWeekNumber: false,
112
+ mode: "single",
113
+ openOnFocus: true,
102
114
  inputfield: true,
103
115
  standalone: false,
104
- openOnFocus: true,
105
- mode: "single",
106
116
  },
107
117
  argTypes: {
108
118
  size: {
109
- control: {
110
- type: "radio",
111
- options: ["medium", "small"],
112
- },
119
+ options: ["medium", "small"],
120
+ control: { type: "radio" },
113
121
  },
114
122
  locale: {
115
- control: {
116
- type: "radio",
117
- options: ["nb", "nn", "en"],
118
- },
123
+ options: ["nb", "nn", "en"],
124
+ control: { type: "radio" },
119
125
  },
120
126
  mode: {
121
- control: {
122
- type: "radio",
123
- options: ["single", "multiple", "range"],
124
- },
127
+ options: ["single", "multiple", "range"],
128
+ control: { type: "radio" },
125
129
  },
126
130
  },
127
131
  };
@@ -1,8 +1,7 @@
1
1
  import cl from "clsx";
2
- import compareAsc from "date-fns/compareAsc";
3
- import compareDesc from "date-fns/compareDesc";
4
2
  import format from "date-fns/format";
5
3
  import isSameMonth from "date-fns/isSameMonth";
4
+ import isSameYear from "date-fns/isSameYear";
6
5
  import setYear from "date-fns/setYear";
7
6
  import React, { useEffect, useRef } from "react";
8
7
  import { useDayPicker } from "react-day-picker";
@@ -20,13 +19,12 @@ interface MonthType {
20
19
 
21
20
  const disableMonth = (month: Date, fromDate?: Date, toDate?: Date) => {
22
21
  if (fromDate && toDate) {
23
- return (
24
- compareAsc(month, fromDate) === -1 || compareDesc(month, toDate) === -1
25
- );
22
+ return (isSameMonth(month, fromDate) && isSameYear(month, fromDate))
23
+ || (isSameMonth(month, toDate) && isSameYear(month, toDate))
26
24
  } else if (fromDate) {
27
- return compareAsc(month, fromDate) === -1;
25
+ return isSameMonth(month, fromDate) && isSameYear(month, fromDate)
28
26
  } else if (toDate) {
29
- return compareDesc(month, toDate) === -1;
27
+ return isSameMonth(month, toDate) && isSameYear(month, toDate)
30
28
  }
31
29
  return false;
32
30
  };
@@ -1,30 +1,21 @@
1
+ import { Meta, StoryFn } from "@storybook/react";
1
2
  import React, { useId, useState } from "react";
2
- import { Button } from "../..";
3
+ import { Button, DateInputProps } from "../..";
3
4
  import { useMonthpicker } from "../hooks";
4
- import MonthPicker from "./MonthPicker";
5
+ import MonthPicker, { MonthPickerProps } from "./MonthPicker";
5
6
 
6
7
  export default {
7
8
  title: "ds-react/Monthpicker",
8
9
  component: MonthPicker,
9
- argTypes: {
10
- size: {
11
- control: {
12
- type: "radio",
13
- options: ["medium", "small"],
14
- },
15
- },
16
- locale: {
17
- control: {
18
- type: "radio",
19
- options: ["nb", "nn", "en"],
20
- },
21
- },
22
- },
23
- };
10
+ } satisfies Meta<typeof MonthPicker>;
24
11
 
25
- export const Default = () => {
12
+ export const Default: StoryFn<{
13
+ size: DateInputProps["size"];
14
+ locale: MonthPickerProps["locale"];
15
+ }> = (props) => {
26
16
  const { inputProps, monthpickerProps } = useMonthpicker({
27
17
  disabled: [new Date("Apr 1 2022")],
18
+ locale: props.locale,
28
19
  });
29
20
 
30
21
  return (
@@ -33,12 +24,23 @@ export const Default = () => {
33
24
  <MonthPicker.Input
34
25
  label="Velg måned"
35
26
  variant="monthpicker"
27
+ size={props.size}
36
28
  {...inputProps}
37
29
  />
38
30
  </MonthPicker>
39
31
  </div>
40
32
  );
41
33
  };
34
+ Default.argTypes = {
35
+ size: {
36
+ options: ["medium", "small"],
37
+ control: { type: "radio" },
38
+ },
39
+ locale: {
40
+ options: ["nb", "nn", "en"],
41
+ control: { type: "radio" },
42
+ },
43
+ };
42
44
 
43
45
  export const dropdownCaption = () => {
44
46
  return (
@@ -54,20 +56,16 @@ export const NB = () => <MonthPicker.Standalone locale="nb" />;
54
56
  export const NN = () => <MonthPicker.Standalone locale="nn" />;
55
57
  export const EN = () => <MonthPicker.Standalone locale="en" />;
56
58
 
57
- export const DisabledMonths = {
58
- render: (props) => {
59
- return (
60
- <MonthPicker.Standalone
61
- disabled={[
62
- { from: new Date("Jan 1 2022"), to: new Date("Jul 6 2022") },
63
- { from: new Date("Apr 2 2023"), to: new Date("Dec 4 2023") },
64
- new Date("Sep 5 2022"),
65
- new Date("Jan 5 2023"),
66
- ]}
67
- />
68
- );
69
- },
70
- };
59
+ export const DisabledMonths = () => (
60
+ <MonthPicker.Standalone
61
+ disabled={[
62
+ { from: new Date("Jan 1 2022"), to: new Date("Jul 6 2022") },
63
+ { from: new Date("Apr 2 2023"), to: new Date("Dec 4 2023") },
64
+ new Date("Sep 5 2022"),
65
+ new Date("Jan 5 2023"),
66
+ ]}
67
+ />
68
+ );
71
69
 
72
70
  export const Standalone = () => {
73
71
  return <MonthPicker.Standalone />;
@@ -171,7 +171,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
171
171
  {hasMaxLength && (
172
172
  <>
173
173
  <span id={maxLengthId} className="navds-sr-only">
174
- Tekstområde med plass til {maxLength} tegn.
174
+ {`Tekstområde med plass til ${maxLength} tegn.`}
175
175
  </span>
176
176
  <Counter
177
177
  maxLength={maxLength}
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef, HTMLAttributes } from "react";
2
- import Guide from "./Guide";
3
2
  import cl from "clsx";
3
+ import { DefaultIllustration } from "./Illustration";
4
4
 
5
5
  export interface GuidePanelProps extends HTMLAttributes<HTMLDivElement> {
6
6
  /**
@@ -12,14 +12,14 @@ export interface GuidePanelProps extends HTMLAttributes<HTMLDivElement> {
12
12
  */
13
13
  illustration?: React.ReactNode;
14
14
  /**
15
- * Poster positions guide-illustation above content
16
- * @default false, renders illustation left of content
15
+ * Render illustation above content
16
+ * @default true on mobile (<480px)
17
17
  */
18
18
  poster?: boolean;
19
19
  }
20
20
 
21
21
  /**
22
- * A component that displays a guide panel.
22
+ * A component for guiding users on the website
23
23
  *
24
24
  * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/guidepanel)
25
25
  * @see 🏷️ {@link GuidePanelProps}
@@ -34,18 +34,19 @@ export interface GuidePanelProps extends HTMLAttributes<HTMLDivElement> {
34
34
  * ```
35
35
  */
36
36
  export const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
37
- (
38
- { children, className, illustration, poster = false, color, ...rest },
39
- ref
40
- ) => (
37
+ ({ children, className, illustration, poster, ...rest }, ref) => (
41
38
  <div
42
39
  {...rest}
43
40
  ref={ref}
44
41
  className={cl("navds-guide-panel", className, {
45
- "navds-guide-panel--poster": poster,
42
+ "navds-guide-panel--poster": poster === true,
43
+ "navds-guide-panel--not-poster": poster === false,
44
+ "navds-guide-panel--responsive-poster": poster === undefined,
46
45
  })}
47
46
  >
48
- <Guide size={poster ? "medium" : "small"} illustration={illustration} />
47
+ <div className="navds-guide">
48
+ {illustration ?? <DefaultIllustration />}
49
+ </div>
49
50
  <div className="navds-guide-panel__content">{children}</div>
50
51
  </div>
51
52
  )
@@ -20,9 +20,9 @@ export const DefaultIllustration: DefaultIllustrationType = ({
20
20
 
21
21
  return (
22
22
  <svg
23
- width="42"
24
- height="64"
25
- viewBox="0 0 42 64"
23
+ width="56"
24
+ height="85"
25
+ viewBox="0 0 56 85"
26
26
  fill="none"
27
27
  xmlns="http://www.w3.org/2000/svg"
28
28
  aria-label="NAV veileder illustrasjon"
@@ -35,89 +35,65 @@ export const DefaultIllustration: DefaultIllustrationType = ({
35
35
  <path
36
36
  fillRule="evenodd"
37
37
  clipRule="evenodd"
38
- d="M32.8313 30.4421C31.7718 33.868 29.6975 36.7117 27.0391 38.452L27.1752 39.9777L27.1745 40.0397L25.7375 52.6154H16.6236L16.5857 52.3512L14.8238 40.0181L14.8891 38.4756C12.2173 36.7398 10.1312 33.8914 9.06565 30.4564C9.02952 30.4598 8.99291 30.4616 8.95588 30.4616C8.26662 30.4616 7.72058 29.8614 7.72058 29.1343V25.0202C7.72058 24.5328 7.96592 24.1022 8.33526 23.8712C8.9115 16.1905 14.3251 10.1539 20.946 10.1539C27.5491 10.1539 32.9517 16.1579 33.5525 23.8089C33.9838 24.0179 34.2794 24.4845 34.2794 25.0202V29.1343C34.2794 29.8618 33.7341 30.4616 33.0441 30.4616C32.9714 30.4616 32.9003 30.4549 32.8313 30.4421Z"
39
- fill="#F1F1F1"
38
+ d="M43.1888 40.4308C41.795 44.9808 39.0663 48.7576 35.5693 51.069L35.7484 53.0952L35.7474 53.1777L33.857 69.8797H21.8679L21.8181 69.5289L19.5004 53.1489L19.5862 51.1002C16.0715 48.795 13.3274 45.0119 11.9257 40.4499C11.8781 40.4544 11.83 40.4566 11.7812 40.4566C10.8745 40.4566 10.1562 39.6595 10.1562 38.6939V33.2298C10.1562 32.5825 10.479 32.0106 10.9648 31.7039C11.7229 21.5028 18.8443 13.4855 27.554 13.4855C36.2401 13.4855 43.3472 21.4596 44.1376 31.6211C44.7049 31.8986 45.0937 32.5184 45.0937 33.2298V38.6939C45.0937 39.66 44.3765 40.4566 43.4687 40.4566C43.3731 40.4566 43.2796 40.4478 43.1888 40.4308Z"
39
+ fill="#F7F7F7"
40
40
  />
41
41
  <path
42
42
  fillRule="evenodd"
43
43
  clipRule="evenodd"
44
- d="M26.7182 38.8777C26.6663 41.624 24.1261 44.4415 21 44.4415C17.8604 44.4415 15.3116 41.5994 15.2813 38.8419C13.6546 39.2527 11.1714 40.4917 9.12177 42.5623C7.13699 44.5674 5.55884 47.5814 5.55884 49.9194V64H36.4412V49.9194C36.4412 47.5766 34.829 44.5575 32.8075 42.5501C30.7861 40.5427 28.3553 39.3204 26.7182 38.8777Z"
45
- fill="#0056B4"
44
+ d="M35.1471 51.6345C35.0789 55.2819 31.7373 59.0239 27.625 59.0239C23.4949 59.0239 20.142 55.2493 20.1022 51.5869C17.9622 52.1325 14.6956 53.7781 11.9995 56.5281C9.38852 59.1912 7.3125 63.1941 7.3125 66.2993V85.0001H47.9375V66.2993C47.9375 63.1878 45.8167 59.178 43.1575 56.5119C40.4983 53.8458 37.3007 52.2225 35.1471 51.6345Z"
45
+ fill="#005B82"
46
46
  />
47
47
  <path
48
48
  fillRule="evenodd"
49
49
  clipRule="evenodd"
50
- d="M15.1786 38.9372C13.6802 39.4793 11.1664 40.6641 9.2647 42.4632C3.70588 41.2308 1.23529 38.3022 1.23529 38.3022C1.23529 38.3022 6.35673 33.325 6.35982 24.6197V24.6105C6.35982 14.4173 11.8831 7.38464 20.9827 7.38464C30.0836 7.38464 35.6068 14.4173 35.6068 24.6105H35.6396C35.6396 33.3219 40.7647 38.3022 40.7647 38.3022C40.7647 38.3022 38.2941 41.2308 32.7353 42.4616L32.7269 42.4632C30.8901 40.7984 28.2262 39.5144 26.7769 38.9715L26.7785 38.971L26.7209 38.3257L26.7521 38.2722C29.4867 36.5294 31.6086 33.5933 32.6316 30.0454C32.7569 30.1148 32.8983 30.1539 33.048 30.1539C33.5601 30.1539 33.9746 29.6984 33.9746 29.1343V25.0202C33.9746 24.5375 33.6712 24.134 33.2628 24.0275C33.2624 24.0219 33.262 24.0164 33.2616 24.0108C20.3323 25.4483 15.6749 16.616 15.2926 16.6154C15.2926 16.6154 10.9987 19.6923 8.94657 23.3506C8.94657 23.3506 8.6338 24.0412 8.63228 24.0644C8.28095 24.2092 8.03035 24.5821 8.03035 25.0202V29.1343C8.03035 29.6984 8.44586 30.1539 8.95693 30.1539C9.07019 30.1539 9.17868 30.1316 9.27895 30.0908C10.3132 33.6404 12.4486 36.5733 15.1961 38.3046L15.2063 38.3257L15.1804 38.9372H15.1786Z"
51
- fill="#D05C4A"
50
+ d="M19.9671 51.7134C17.9959 52.4333 14.6891 54.0068 12.1875 56.3964C4.875 54.7595 1.625 50.87 1.625 50.87C1.625 50.87 8.36213 44.2596 8.3662 32.698V32.6857C8.3662 19.1478 15.6319 9.80762 27.6022 9.80762C39.5742 9.80762 46.8399 19.1478 46.8399 32.6857H46.883C46.883 44.2555 53.625 50.87 53.625 50.87C53.625 50.87 50.375 54.7595 43.0625 56.3942L43.0515 56.3964C40.6353 54.1853 37.1309 52.4799 35.2243 51.7589L35.2265 51.7582L35.1508 50.9012L35.1917 50.8302C38.7891 48.5155 41.5804 44.6159 42.9262 39.904C43.0909 39.9961 43.277 40.048 43.4739 40.048C44.1476 40.048 44.6928 39.4431 44.6928 38.6939V33.2298C44.6928 32.5887 44.2936 32.0528 43.7564 31.9114C43.7559 31.904 43.7554 31.8966 43.7549 31.8892C26.7466 33.7984 20.6199 22.068 20.117 22.0672C20.117 22.0672 14.4686 26.1538 11.769 31.0124C11.769 31.0124 11.3576 31.9296 11.3556 31.9605C10.8934 32.1527 10.5637 32.648 10.5637 33.2298V38.6939C10.5637 39.4431 11.1103 40.048 11.7826 40.048C11.9316 40.048 12.0743 40.0184 12.2062 39.9642C13.5668 44.6785 16.3759 48.5738 19.9901 50.8732L20.0035 50.9012L19.9695 51.7134H19.9671Z"
51
+ fill="#F25C5C"
52
52
  />
53
53
  <path
54
54
  fillRule="evenodd"
55
55
  clipRule="evenodd"
56
- d="M16.584 26.9976C15.7859 27.062 15.5625 25.8029 15.803 24.9807C15.8482 24.8249 16.1124 24.1154 16.5802 24.1154C17.0473 24.1154 17.2536 24.5032 17.2823 24.5699C17.6259 25.3715 17.4571 26.9268 16.584 26.9976"
57
- fill="#23262a"
56
+ d="M21.8159 35.8563C20.766 35.9417 20.4722 34.2696 20.7885 33.1776C20.848 32.9706 21.1956 32.0283 21.8109 32.0283C22.4254 32.0283 22.6968 32.5434 22.7345 32.632C23.1865 33.6965 22.9645 35.7622 21.8159 35.8563"
57
+ fill="#262626"
58
58
  />
59
59
  <path
60
60
  fillRule="evenodd"
61
61
  clipRule="evenodd"
62
- d="M25.8405 26.9976C26.6386 27.062 26.862 25.8029 26.6215 24.9807C26.5763 24.8249 26.3121 24.1154 25.8444 24.1154C25.3772 24.1154 25.171 24.5032 25.1423 24.5699C24.7987 25.3715 24.9674 26.9268 25.8405 26.9976"
63
- fill="#23262a"
62
+ d="M33.9927 35.8563C35.0425 35.9417 35.3364 34.2696 35.0201 33.1776C34.9606 32.9706 34.613 32.0283 33.9977 32.0283C33.3832 32.0283 33.1118 32.5434 33.0741 32.632C32.6221 33.6965 32.8441 35.7622 33.9927 35.8563"
63
+ fill="#262626"
64
64
  />
65
65
  <path
66
- d="M21.5081 28.2384C21.9854 28.157 22.3113 28.2081 22.428 28.3669C22.8687 28.9672 22.7277 29.6023 21.9718 30.1237C21.5744 30.3977 21.0273 30.4942 20.7377 30.3521C20.596 30.2826 20.4304 30.3536 20.3677 30.5106C20.3051 30.6676 20.3691 30.8512 20.5107 30.9207C20.9894 31.1555 21.7255 31.0257 22.268 30.6517C23.2953 29.9431 23.5304 28.8837 22.863 27.9743C22.5805 27.59 22.0806 27.5116 21.4228 27.6239C21.2697 27.65 21.1647 27.8088 21.1883 27.9784C21.2118 28.1481 21.355 28.2645 21.5081 28.2384Z"
67
- fill="#23262a"
66
+ d="M28.2935 37.5041C28.9213 37.396 29.3501 37.4638 29.5036 37.6748C30.0833 38.4721 29.8979 39.3156 28.9035 40.0081C28.3806 40.372 27.661 40.5001 27.28 40.3114C27.0937 40.2191 26.8758 40.3133 26.7934 40.5218C26.7109 40.7304 26.7951 40.9742 26.9814 41.0665C27.6111 41.3784 28.5794 41.206 29.2931 40.7092C30.6445 39.7682 30.9537 38.3611 30.0758 37.1534C29.7042 36.643 29.0465 36.5389 28.1812 36.688C27.9799 36.7227 27.8418 36.9335 27.8728 37.1589C27.9038 37.3842 28.0921 37.5388 28.2935 37.5041Z"
67
+ fill="#262626"
68
68
  />
69
69
  <path
70
- d="M24.9595 32.3642C24.9315 32.4234 24.8672 32.5367 24.7639 32.686C24.589 32.9386 24.3694 33.1919 24.1027 33.4281C23.3079 34.1319 22.2735 34.5389 20.9568 34.5017C19.673 34.4654 18.6432 34.0647 17.8358 33.4185C17.5393 33.1813 17.2946 32.9272 17.0989 32.6739C16.9836 32.5246 16.9115 32.4114 16.88 32.3523C16.8043 32.2104 16.618 32.152 16.464 32.2218C16.31 32.2917 16.2466 32.4634 16.3224 32.6053C16.3681 32.6908 16.4569 32.8304 16.5927 33.0062C16.8156 33.2948 17.0928 33.5826 17.4283 33.8511C18.3398 34.5805 19.5046 35.0338 20.9378 35.0743C22.4302 35.1165 23.6233 34.6471 24.5333 33.8412C24.8376 33.5717 25.0877 33.2832 25.2878 32.9941C25.4095 32.8183 25.4887 32.6787 25.5291 32.5934C25.5977 32.4485 25.5259 32.2796 25.3686 32.2163C25.2113 32.153 25.0282 32.2192 24.9595 32.3642Z"
71
- fill="#23262a"
70
+ d="M32.8337 42.9837C32.7968 43.0623 32.7122 43.2128 32.5763 43.411C32.3463 43.7465 32.0574 44.0829 31.7066 44.3966C30.6611 45.3314 29.3002 45.872 27.5683 45.8225C25.8795 45.7743 24.5247 45.2421 23.4626 44.3839C23.0726 44.0688 22.7506 43.7314 22.4933 43.395C22.3415 43.1967 22.2468 43.0463 22.2053 42.9679C22.1056 42.7794 21.8606 42.7018 21.6581 42.7946C21.4555 42.8873 21.3721 43.1153 21.4718 43.3039C21.5318 43.4174 21.6487 43.6029 21.8273 43.8363C22.1206 44.2196 22.4852 44.6018 22.9266 44.9584C24.1256 45.9272 25.6579 46.5292 27.5432 46.583C29.5064 46.6391 31.0759 46.0156 32.273 44.9453C32.6733 44.5874 33.0023 44.2042 33.2656 43.8202C33.4257 43.5867 33.5298 43.4014 33.5829 43.2881C33.6733 43.0955 33.5788 42.8713 33.3719 42.7872C33.165 42.7032 32.924 42.7911 32.8337 42.9837Z"
71
+ fill="#262626"
72
72
  />
73
73
  <path
74
74
  fillRule="evenodd"
75
75
  clipRule="evenodd"
76
- d="M32.1651 58H21.8343C21.3733 58 21 57.621 21 57.153V51.5143C21 51.0462 21.3733 50.6667 21.8343 50.6667H32.1651C32.6261 50.6667 33 51.0462 33 51.5143V57.153C33 57.621 32.6261 58 32.1651 58"
76
+ d="M41.8629 70.5H30.8865C30.3966 70.5 30 70.0974 30 69.6001V63.609C30 63.1117 30.3966 62.7084 30.8865 62.7084H41.8629C42.3527 62.7084 42.75 63.1117 42.75 63.609V69.6001C42.75 70.0974 42.3527 70.5 41.8629 70.5"
77
77
  fill="white"
78
78
  />
79
79
  <path
80
80
  fillRule="evenodd"
81
81
  clipRule="evenodd"
82
- d="M27.6207 51.8307H26.5502C26.4709 51.8307 26.407 51.7671 26.407 51.6882V51.5086C26.407 51.4303 26.4709 51.3661 26.5502 51.3661H27.6207C27.7 51.3661 27.764 51.4303 27.764 51.5086V51.6882C27.764 51.7671 27.7 51.8307 27.6207 51.8307"
83
- fill="#23262a"
82
+ d="M37.0345 63.9451H35.8971C35.8128 63.9451 35.7449 63.8775 35.7449 63.7937V63.6029C35.7449 63.5197 35.8128 63.4515 35.8971 63.4515H37.0345C37.1188 63.4515 37.1867 63.5197 37.1867 63.6029V63.7937C37.1867 63.8775 37.1188 63.9451 37.0345 63.9451"
83
+ fill="#262626"
84
84
  />
85
85
  <path
86
86
  fillRule="evenodd"
87
87
  clipRule="evenodd"
88
- d="M26.7756 51.6667H27.3958V50H26.7756V51.6667Z"
89
- fill="#6A6A6A"
88
+ d="M36.1365 63.7708H36.7955V62H36.1365V63.7708Z"
89
+ fill="#8F8F8F"
90
90
  />
91
91
  <path
92
92
  fillRule="evenodd"
93
93
  clipRule="evenodd"
94
- d="M27.1269 56.6651C25.839 56.6651 24.7947 55.6208 24.7947 54.3327C24.7947 53.0444 25.839 52 27.1269 52C28.4153 52 29.4597 53.0444 29.4597 54.3327C29.4597 55.6208 28.4153 56.6651 27.1269 56.6651Z"
94
+ d="M40.5417 65.5H39.6457C39.6457 65.5 39.5839 65.5 39.5621 65.5545L39.0662 67.0725L38.5708 65.5545C38.5489 65.5 38.4868 65.5 38.4868 65.5H36.764C36.7267 65.5 36.6954 65.5311 36.6954 65.5682V66.0837C36.6954 65.6748 36.2603 65.5 36.0055 65.5C35.4349 65.5 35.053 65.8758 34.934 66.4472C34.9276 66.0681 34.8961 65.9323 34.794 65.7932C34.7471 65.7251 34.6793 65.6678 34.6055 65.6204C34.4535 65.5314 34.317 65.5 34.0237 65.5H33.6794C33.6794 65.5 33.6171 65.5 33.5952 65.5545L33.2818 66.331V65.5682C33.2818 65.5311 33.2508 65.5 33.2136 65.5H32.4167C32.4167 65.5 32.3552 65.5 32.3328 65.5545L32.0071 66.362C32.0071 66.362 31.9746 66.4427 32.0489 66.4427H32.3552V67.9813C32.3552 68.0195 32.3853 68.0497 32.4236 68.0497H33.2136C33.2508 68.0497 33.2818 68.0195 33.2818 67.9813V66.4427H33.5898C33.7664 66.4427 33.8039 66.4475 33.8726 66.4796C33.914 66.4952 33.9513 66.5268 33.9716 66.5633C34.0133 66.6417 34.0237 66.7359 34.0237 67.0135V67.9813C34.0237 68.0195 34.0544 68.0497 34.0923 68.0497H34.8494C34.8494 68.0497 34.935 68.0497 34.9688 67.9652L35.1366 67.5505C35.3597 67.863 35.7269 68.0497 36.1833 68.0497H36.283C36.283 68.0497 36.3691 68.0497 36.4032 67.9652L36.6954 67.2415V67.9813C36.6954 68.0195 36.7267 68.0497 36.764 68.0497H37.5368C37.5368 68.0497 37.6221 68.0497 37.6564 67.9652C37.6564 67.9652 37.9655 67.1978 37.9667 67.192H37.9671C37.979 67.1281 37.8983 67.1281 37.8983 67.1281H37.6225V65.8113L38.4904 67.9652C38.5243 68.0497 38.6097 68.0497 38.6097 68.0497H39.5228C39.5228 68.0497 39.6087 68.0497 39.6426 67.9652L40.6048 65.5826C40.6381 65.5 40.5417 65.5 40.5417 65.5V65.5ZM36.6954 67.128H36.1763C35.9696 67.128 35.8015 66.9607 35.8015 66.7538C35.8015 66.5473 35.9696 66.3789 36.1763 66.3789H36.3215C36.5276 66.3789 36.6954 66.5473 36.6954 66.7538V67.128Z"
95
95
  fill="#C30000"
96
96
  />
97
- <path
98
- fillRule="evenodd"
99
- clipRule="evenodd"
100
- d="M23.6667 55.3511L24.1434 54.1712H24.6015L24.1254 55.3511H23.6667Z"
101
- fill="#C30000"
102
- />
103
- <path
104
- fillRule="evenodd"
105
- clipRule="evenodd"
106
- d="M29.5496 55.3511L30.0202 54.1712H30.2699L29.7993 55.3511H29.5496Z"
107
- fill="#C30000"
108
- />
109
- <path
110
- fillRule="evenodd"
111
- clipRule="evenodd"
112
- d="M30.4752 55.3511L30.9457 54.1712H31.0783L30.6077 55.3511H30.4752Z"
113
- fill="#C30000"
114
- />
115
- <path
116
- fillRule="evenodd"
117
- clipRule="evenodd"
118
- d="M29.1165 54.1712H28.7019C28.7019 54.1712 28.6733 54.1712 28.6632 54.1964L28.4337 54.8989L28.2044 54.1964C28.1943 54.1712 28.1656 54.1712 28.1656 54.1712H27.3683C27.3511 54.1712 27.3366 54.1856 27.3366 54.2028V54.4413C27.3366 54.2521 27.1352 54.1712 27.0173 54.1712C26.7533 54.1712 26.5765 54.3451 26.5215 54.6095C26.5185 54.4341 26.5039 54.3713 26.4567 54.3069C26.435 54.2754 26.4036 54.2489 26.3695 54.2269C26.2991 54.1857 26.236 54.1712 26.1003 54.1712H25.9409C25.9409 54.1712 25.9121 54.1712 25.9019 54.1964L25.7569 54.5558V54.2028C25.7569 54.1856 25.7426 54.1712 25.7253 54.1712H25.3566C25.3566 54.1712 25.3281 54.1712 25.3178 54.1964L25.167 54.5701C25.167 54.5701 25.152 54.6074 25.1864 54.6074H25.3281V55.3194C25.3281 55.3371 25.342 55.3511 25.3598 55.3511H25.7253C25.7426 55.3511 25.7569 55.3371 25.7569 55.3194V54.6074H25.8994C25.9812 54.6074 25.9985 54.6097 26.0303 54.6245C26.0495 54.6317 26.0667 54.6464 26.0762 54.6632C26.0954 54.6995 26.1003 54.7431 26.1003 54.8716V55.3194C26.1003 55.3371 26.1145 55.3511 26.132 55.3511H26.4823C26.4823 55.3511 26.5219 55.3511 26.5376 55.312L26.6152 55.1201C26.7185 55.2647 26.8884 55.3511 27.0996 55.3511H27.1458C27.1458 55.3511 27.1856 55.3511 27.2014 55.312L27.3366 54.9771V55.3194C27.3366 55.3371 27.3511 55.3511 27.3683 55.3511H27.726C27.726 55.3511 27.7654 55.3511 27.7813 55.312C27.7813 55.312 27.9243 54.9569 27.9249 54.9542H27.9251C27.9306 54.9246 27.8933 54.9246 27.8933 54.9246H27.7656V54.3153L28.1672 55.312C28.1829 55.3511 28.2225 55.3511 28.2225 55.3511H28.645C28.645 55.3511 28.6847 55.3511 28.7004 55.312L29.1457 54.2094C29.1611 54.1712 29.1165 54.1712 29.1165 54.1712V54.1712ZM27.3366 54.9246H27.0964C27.0007 54.9246 26.9229 54.8472 26.9229 54.7515C26.9229 54.6559 27.0007 54.578 27.0964 54.578H27.1635C27.2589 54.578 27.3366 54.6559 27.3366 54.7515V54.9246Z"
119
- fill="white"
120
- />
121
97
  </svg>
122
98
  );
123
99
  };