@navikt/ds-react 0.19.15 → 0.19.18

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 (45) hide show
  1. package/_docs.json +69 -10
  2. package/cjs/form/search/Search.js +6 -4
  3. package/cjs/stepper/Step.js +8 -8
  4. package/cjs/stepper/Stepper.js +10 -5
  5. package/cjs/tooltip/Tooltip.js +1 -4
  6. package/esm/accordion/AccordionItem.js.map +1 -1
  7. package/esm/button/Button.js.map +1 -1
  8. package/esm/form/radio/RadioGroup.js.map +1 -1
  9. package/esm/form/search/Search.d.ts +1 -1
  10. package/esm/form/search/Search.js +7 -5
  11. package/esm/form/search/Search.js.map +1 -1
  12. package/esm/link/Link.js.map +1 -1
  13. package/esm/stepper/Step.d.ts +2 -2
  14. package/esm/stepper/Step.js +8 -8
  15. package/esm/stepper/Step.js.map +1 -1
  16. package/esm/stepper/Stepper.d.ts +8 -4
  17. package/esm/stepper/Stepper.js +10 -5
  18. package/esm/stepper/Stepper.js.map +1 -1
  19. package/esm/tooltip/Tooltip.js +1 -4
  20. package/esm/tooltip/Tooltip.js.map +1 -1
  21. package/esm/typography/Heading.js.map +1 -1
  22. package/esm/typography/Ingress.js.map +1 -1
  23. package/esm/typography/Label.js.map +1 -1
  24. package/package.json +3 -3
  25. package/src/accordion/AccordionItem.tsx +2 -3
  26. package/src/button/Button.tsx +62 -62
  27. package/src/form/radio/RadioGroup.tsx +2 -3
  28. package/src/form/search/Search.tsx +19 -6
  29. package/src/form/search/search.stories.tsx +21 -0
  30. package/src/link/Link.tsx +4 -6
  31. package/src/stepper/Step.tsx +16 -13
  32. package/src/stepper/Stepper.tsx +34 -8
  33. package/src/stepper/stepper.stories.tsx +133 -0
  34. package/src/tooltip/Tooltip.tsx +4 -4
  35. package/src/typography/Heading.tsx +15 -17
  36. package/src/typography/Ingress.tsx +10 -12
  37. package/src/typography/Label.tsx +16 -18
  38. package/cjs/form/search/useSearch.js +0 -31
  39. package/esm/form/search/useSearch.d.ts +0 -10
  40. package/esm/form/search/useSearch.js +0 -25
  41. package/esm/form/search/useSearch.js.map +0 -1
  42. package/src/form/search/useSearch.ts +0 -31
  43. package/src/stepper/stories/Example.tsx +0 -28
  44. package/src/stepper/stories/stepper.stories.mdx +0 -61
  45. package/src/stepper/stories/stepper.stories.tsx +0 -54
@@ -32,70 +32,70 @@ export interface ButtonProps
32
32
  loading?: boolean;
33
33
  }
34
34
 
35
- export const Button: OverridableComponent<
36
- ButtonProps,
37
- HTMLButtonElement
38
- > = forwardRef(
39
- (
40
- {
41
- as: Component = "button",
42
- variant = "primary",
43
- className,
44
- children,
45
- size = "medium",
46
- loading = false,
47
- disabled,
48
- style,
49
- ...rest
50
- },
51
- ref
52
- ) => {
53
- const buttonRef = useRef<HTMLButtonElement | null>(null);
54
- const mergedRef = mergeRefs([buttonRef, ref]);
55
- const [widthOverride, setWidthOverride] = useState<number>();
35
+ export const Button: OverridableComponent<ButtonProps, HTMLButtonElement> =
36
+ forwardRef(
37
+ (
38
+ {
39
+ as: Component = "button",
40
+ variant = "primary",
41
+ className,
42
+ children,
43
+ size = "medium",
44
+ loading = false,
45
+ disabled,
46
+ style,
47
+ ...rest
48
+ },
49
+ ref
50
+ ) => {
51
+ const buttonRef = useRef<HTMLButtonElement | null>(null);
52
+ const mergedRef = mergeRefs([buttonRef, ref]);
53
+ const [widthOverride, setWidthOverride] = useState<number>();
56
54
 
57
- useClientLayoutEffect(() => {
58
- if (loading) {
59
- const requestID = window.requestAnimationFrame(() => {
60
- setWidthOverride(buttonRef?.current?.getBoundingClientRect()?.width);
61
- });
62
- return () => {
63
- setWidthOverride(undefined);
64
- cancelAnimationFrame(requestID);
65
- };
66
- }
67
- }, [loading, children]);
55
+ useClientLayoutEffect(() => {
56
+ if (loading) {
57
+ const requestID = window.requestAnimationFrame(() => {
58
+ setWidthOverride(
59
+ buttonRef?.current?.getBoundingClientRect()?.width
60
+ );
61
+ });
62
+ return () => {
63
+ setWidthOverride(undefined);
64
+ cancelAnimationFrame(requestID);
65
+ };
66
+ }
67
+ }, [loading, children]);
68
68
 
69
- return (
70
- <Component
71
- {...rest}
72
- ref={mergedRef}
73
- className={cl(
74
- className,
75
- "navds-button",
76
- `navds-button--${variant}`,
77
- `navds-button--${size}`,
78
- {
79
- "navds-button--loading": widthOverride,
80
- }
81
- )}
82
- style={{
83
- ...style,
84
- width: widthOverride,
85
- }}
86
- disabled={disabled ?? widthOverride ? true : undefined}
87
- >
88
- <BodyShort
89
- as="span"
90
- className="navds-button__inner"
91
- size={size === "medium" ? "medium" : "small"}
92
- aria-live="polite"
69
+ return (
70
+ <Component
71
+ {...rest}
72
+ ref={mergedRef}
73
+ className={cl(
74
+ className,
75
+ "navds-button",
76
+ `navds-button--${variant}`,
77
+ `navds-button--${size}`,
78
+ {
79
+ "navds-button--loading": widthOverride,
80
+ }
81
+ )}
82
+ style={{
83
+ ...style,
84
+ width: widthOverride,
85
+ }}
86
+ disabled={disabled ?? widthOverride ? true : undefined}
93
87
  >
94
- {widthOverride ? <Loader size={size} /> : children}
95
- </BodyShort>
96
- </Component>
97
- );
98
- }
99
- );
88
+ <BodyShort
89
+ as="span"
90
+ className="navds-button__inner"
91
+ size={size === "medium" ? "medium" : "small"}
92
+ aria-live="polite"
93
+ >
94
+ {widthOverride ? <Loader size={size} /> : children}
95
+ </BodyShort>
96
+ </Component>
97
+ );
98
+ }
99
+ );
100
100
 
101
101
  export default Button;
@@ -11,9 +11,8 @@ export interface RadioGroupContextProps {
11
11
  required?: boolean;
12
12
  }
13
13
 
14
- export const RadioGroupContext = React.createContext<RadioGroupContextProps | null>(
15
- null
16
- );
14
+ export const RadioGroupContext =
15
+ React.createContext<RadioGroupContextProps | null>(null);
17
16
 
18
17
  export interface RadioGroupProps
19
18
  extends Omit<
@@ -8,10 +8,9 @@ import React, {
8
8
  useState,
9
9
  } from "react";
10
10
  import mergeRefs from "react-merge-refs";
11
- import { BodyShort, Label, omit, useEventListener } from "../..";
12
- import { FormFieldProps } from "../useFormField";
11
+ import { BodyShort, ErrorMessage, Label, omit, useEventListener } from "../..";
12
+ import { FormFieldProps, useFormField } from "../useFormField";
13
13
  import SearchButton, { SearchButtonType } from "./SearchButton";
14
- import { useSearch } from "./useSearch";
15
14
 
16
15
  export type SearchClearEvent =
17
16
  | {
@@ -21,7 +20,7 @@ export type SearchClearEvent =
21
20
  | { trigger: "Escape"; event: React.KeyboardEvent<HTMLDivElement> };
22
21
 
23
22
  export interface SearchProps
24
- extends Omit<FormFieldProps, "error" | "errorId">,
23
+ extends FormFieldProps,
25
24
  Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> {
26
25
  children?: React.ReactNode;
27
26
  /**
@@ -82,7 +81,10 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
82
81
  inputProps,
83
82
  size = "medium",
84
83
  inputDescriptionId,
85
- } = useSearch(props, "searchfield");
84
+ errorId,
85
+ showErrorMsg,
86
+ hasError,
87
+ } = useFormField(props, "searchfield");
86
88
 
87
89
  const {
88
90
  className,
@@ -146,6 +148,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
146
148
  `navds-form-field--${size}`,
147
149
  "navds-search",
148
150
  {
151
+ "navds-search--error": hasError,
149
152
  "navds-search--disabled": !!inputProps.disabled,
150
153
  }
151
154
  )}
@@ -179,7 +182,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
179
182
  )}
180
183
  <input
181
184
  ref={mergedRef}
182
- {...omit(rest, ["size"])}
185
+ {...omit(rest, ["error", "errorId", "size"])}
183
186
  {...inputProps}
184
187
  value={value ?? internalValue}
185
188
  onChange={(e) => handleChange(e.target.value)}
@@ -217,6 +220,16 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
217
220
  {children ? children : variant !== "simple" && <SearchButton />}
218
221
  </SearchContext.Provider>
219
222
  </div>
223
+ <div
224
+ className="navds-form-field__error"
225
+ id={errorId}
226
+ aria-relevant="additions removals"
227
+ aria-live="polite"
228
+ >
229
+ {showErrorMsg && (
230
+ <ErrorMessage size={size}>{props.error}</ErrorMessage>
231
+ )}
232
+ </div>
220
233
  </div>
221
234
  );
222
235
  }
@@ -23,6 +23,11 @@ export default {
23
23
  options: ["primary", "secondary", "simple"],
24
24
  },
25
25
  },
26
+ error: {
27
+ control: {
28
+ type: "text",
29
+ },
30
+ },
26
31
  },
27
32
  } as Meta;
28
33
 
@@ -38,6 +43,7 @@ export const Default = (props) => {
38
43
  clearButton={props.clearButton}
39
44
  variant={props.variant}
40
45
  hideLabel={props.hideLabel}
46
+ error={props.error}
41
47
  />
42
48
  </div>
43
49
  );
@@ -79,6 +85,21 @@ export const Variants = () => (
79
85
  </div>
80
86
  );
81
87
 
88
+ export const ErrorVariants = () => (
89
+ <div className="rowgap">
90
+ <div className="colgap">
91
+ <Search error="errormsg" label="Søk" />
92
+ <Search error="errormsg" label="Søk" variant="secondary" />
93
+ <Search error="errormsg" label="Søk" variant="simple" />
94
+ </div>
95
+ <div className="colgap" data-theme="dark">
96
+ <Search error="errormsg" label="Søk" />
97
+ <Search error="errormsg" label="Søk" variant="secondary" />
98
+ <Search error="errormsg" label="Søk" variant="simple" />
99
+ </div>
100
+ </div>
101
+ );
102
+
82
103
  export const Placeholder = () => (
83
104
  <div className="rowgap">
84
105
  <div className="colgap">
package/src/link/Link.tsx CHANGED
@@ -10,11 +10,9 @@ export interface LinkProps
10
10
  children: React.ReactNode;
11
11
  }
12
12
 
13
- export const Link: OverridableComponent<
14
- LinkProps,
15
- HTMLAnchorElement
16
- > = forwardRef(({ as: Component = "a", className, ...rest }, ref) => (
17
- <Component {...rest} ref={ref} className={cl("navds-link", className)} />
18
- ));
13
+ export const Link: OverridableComponent<LinkProps, HTMLAnchorElement> =
14
+ forwardRef(({ as: Component = "a", className, ...rest }, ref) => (
15
+ <Component {...rest} ref={ref} className={cl("navds-link", className)} />
16
+ ));
19
17
 
20
18
  export default Link;
@@ -10,10 +10,10 @@ export interface StepperStepProps
10
10
  */
11
11
  children: string;
12
12
  /**
13
- * Handled by Stepper
13
+ * Handled by Stepper, overwriting may break component logic
14
14
  * @private
15
15
  */
16
- index?: number;
16
+ unsafe_index?: number;
17
17
  }
18
18
 
19
19
  export interface StepperStepType
@@ -23,33 +23,36 @@ export const StepComponent: OverridableComponent<
23
23
  StepperStepProps,
24
24
  HTMLAnchorElement
25
25
  > = forwardRef(
26
- ({ className, children, as: Component = "a", index = 0, ...rest }, ref) => {
26
+ (
27
+ { className, children, as: Component = "a", unsafe_index = 0, ...rest },
28
+ ref
29
+ ) => {
27
30
  const context = useContext(StepperContext);
28
31
  if (context === null) {
29
- console.error(
30
- "<StepIndicator.Step> has to be used within an <StepIndicator>"
31
- );
32
+ console.error("<Stepper.Step> has to be used within <Stepper>");
32
33
  return null;
33
34
  }
34
- const activeStep = context.activeStep === index;
35
+ const { activeStep } = context;
35
36
 
36
37
  return (
37
38
  <Component
38
39
  {...rest}
39
- aria-current={Boolean(activeStep)}
40
+ aria-current={activeStep === unsafe_index}
40
41
  ref={ref}
41
42
  className={cl("navds-stepper__step", className, {
42
- "navds-stepper__step--active": activeStep,
43
+ "navds-stepper__step--active": activeStep === unsafe_index,
43
44
  })}
44
45
  onClick={(e) => {
45
- context.onStepChange(index);
46
+ context.onStepChange(unsafe_index + 1);
46
47
  rest?.onClick?.(e);
47
48
  }}
48
49
  >
49
- <Label className="navds-stepper__step-number" as="span">
50
- {activeStep ? `${index + 1}` : index + 1}
50
+ <Label className="navds-stepper__circle" as="span" aria-hidden="true">
51
+ {unsafe_index + 1}
52
+ </Label>
53
+ <Label as="span" className="navds-stepper__content">
54
+ {children}
51
55
  </Label>
52
- <Label className="navds-stepper__step-label">{children}</Label>
53
56
  </Component>
54
57
  );
55
58
  }
@@ -8,15 +8,18 @@ export interface StepperProps extends React.HTMLAttributes<HTMLOListElement> {
8
8
  */
9
9
  children: React.ReactNode;
10
10
  /**
11
- * Adds classname to wrapper
11
+ * The direction the component grows.
12
+ * @default "vertical"
12
13
  */
13
- className?: string;
14
+ orientation?: "horizontal" | "vertical";
14
15
  /**
15
- * Current active step index
16
+ * Current active step.
17
+ * @note Stepper index starts at 1, not 0
16
18
  */
17
19
  activeStep: number;
18
20
  /**
19
- * Callback for clicked step index
21
+ * Callback for next activeStep
22
+ * @note Stepper index starts at 1, not 0
20
23
  */
21
24
  onStepChange?: (step: number) => void;
22
25
  }
@@ -32,6 +35,7 @@ interface StepperContextProps {
32
35
  activeStep: number;
33
36
  onStepChange: (step: number) => void;
34
37
  lastIndex: number;
38
+ orientation: "horizontal" | "vertical";
35
39
  }
36
40
 
37
41
  export const StepperContext = createContext<StepperContextProps | null>(null);
@@ -41,27 +45,49 @@ export const Stepper: StepperComponent = forwardRef<
41
45
  StepperProps
42
46
  >(
43
47
  (
44
- { children, className, activeStep, onStepChange = () => {}, ...rest },
48
+ {
49
+ children,
50
+ className,
51
+ activeStep,
52
+ orientation = "vertical",
53
+ onStepChange = () => {},
54
+ ...rest
55
+ },
45
56
  ref
46
57
  ) => {
58
+ activeStep = activeStep - 1;
47
59
  return (
48
- <ol {...rest} ref={ref} className={cl("navds-stepper", className)}>
60
+ <ol
61
+ {...rest}
62
+ ref={ref}
63
+ className={cl(
64
+ "navds-stepper",
65
+ orientation === "horizontal" ? "navds-stepper--horizontal" : "",
66
+ className
67
+ )}
68
+ >
49
69
  <StepperContext.Provider
50
70
  value={{
51
71
  activeStep,
52
72
  onStepChange,
53
73
  lastIndex: React.Children.count(children),
74
+ orientation,
54
75
  }}
55
76
  >
56
77
  {React.Children.map(children, (step, index) => {
57
78
  return (
58
79
  <li
59
- className={cl("navds-stepper__step-wrapper")}
80
+ className={cl("navds-stepper__item")}
60
81
  key={index + (children?.toString?.() ?? "")}
61
82
  >
83
+ <span className="navds-stepper__line navds-stepper__line--1" />
62
84
  {React.isValidElement<StepperStepProps>(step)
63
- ? React.cloneElement(step, { ...step.props, index })
85
+ ? React.cloneElement(step, {
86
+ ...step.props,
87
+ unsafe_index: index,
88
+ })
64
89
  : step}
90
+ <span className="navds-stepper__line navds-stepper__line--2" />
65
91
  </li>
66
92
  );
67
93
  })}
@@ -0,0 +1,133 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import React, { useState } from "react";
3
+ import Stepper from "./Stepper";
4
+ import { BodyLong } from "..";
5
+
6
+ export default {
7
+ title: "ds-react/Stepper",
8
+ component: Stepper,
9
+ argTypes: {
10
+ orientation: {
11
+ control: {
12
+ type: "radio",
13
+ options: ["horizontal", "vertical"],
14
+ },
15
+ },
16
+ },
17
+ } as Meta;
18
+
19
+ const storyTexts = [
20
+ "Minimize backwards overflow agile. Horsehead offer commitment to the cause nor copy and paste from stack overflow problem territories, innovation is hot right now for can you slack it to me?. High touch client table the discussion , and get buy-in so manage expectations loop back, please advise soonest. We need a paradigm shift dogpile that, and i need to pee and then go to another meeting for let's prioritize the low-hanging fruit.",
21
+ "Customer centric sorry i didn't get your email proceduralize, and first-order optimal strategies. I dont care if you got some copy, why you dont use officeipsumcom or something like that ? wheelhouse. Viral engagement new economy, this proposal is a win-win situation which will cause a stellar paradigm shift, and produce a multi-fold increase in deliverables Bob called an all-hands this afternoon. Fire up your browser touch base innovation is hot right now so this medium needs to be more dynamic.",
22
+ "Touch base define the underlying principles that drive decisions and strategy for your design language. I have zero cycles for this. Cadence social currency, for low engagement execute . Deliverables rehydrate the team or let's circle back to that those options are already baked in with this model teams were able to drive adoption and awareness we need to start advertising on social media circle back. Through the lens of face time.",
23
+ "Take five, punch the tree, and come back in here with a clear head those options are already baked in with this model ultimate measure of success and we need to crystallize a plan yet open door policy who's responsible for the ask for this request? what do you feel you would bring to the table if you were hired for this position. Wiggle room guerrilla marketing shelfware. Code feature creep can we parallel path lose client to 10:00 meeting hire the best manage expectations root-and-branch review.",
24
+ "Curate downselect tread it daily cc me on that due diligence, or close the loop. All hands on deck my supervisor didn't like the latest revision you gave me can you switch back to the first revision? ping me or game-plan, yet make it a priority, on this journey win-win. Our competitors are jumping the shark we need to build it so that it scales post launch future-proof can we align on lunch orders. Deliverables message the initiative.",
25
+ "Out of scope poop, so pre launch. I just wanted to give you a heads-up wiggle room cc me on that I have been doing some research this morning and we need to better, nor dog and pony show prioritize these line items so UX. Big data upstream selling circle back, in an ideal world. Get all your ducks in a row land it in region so code so one-sheet. Action item we need to think big start small and scale fast to energize our clients. Cta due diligence, for this vendor is incompetent nor forcing function and circle back and low engagement.",
26
+ "Move the needle a loss a day will keep you focus yet can you put it into a banner that is not alarming, but eye catching and not too giant or strategic fit, nor it is all exactly as i said, but i don't like it or streamline. We've bootstrapped the model. This proposal is a win-win situation which will cause a stellar paradigm shift, and produce a multi-fold increase in deliverables the horse is out of the barn usabiltiy, for going forward but going forward.",
27
+ ];
28
+
29
+ export const Default = ({ asButton, ...props }) => {
30
+ const [activeStep, setActiveStep] = useState(1);
31
+
32
+ const newProps = {
33
+ onClick: (e) => e.preventDefault(),
34
+ ...(asButton ? { as: "button" } : { href: "#" }),
35
+ };
36
+
37
+ return (
38
+ <div style={{ display: "flex", gap: "10rem", flexDirection: "column" }}>
39
+ <Stepper
40
+ aria-labelledby="stepper-heading"
41
+ activeStep={activeStep}
42
+ onStepChange={setActiveStep}
43
+ orientation="horizontal"
44
+ {...props}
45
+ >
46
+ <Stepper.Step {...newProps}>Start søknad</Stepper.Step>
47
+ <Stepper.Step {...newProps}>Personopplysninger</Stepper.Step>
48
+ <Stepper.Step {...newProps}>Saksopplysninger</Stepper.Step>
49
+ <Stepper.Step {...newProps}>
50
+ Søknadstekst for en veldig spesifikk prosess i NAV som må beskrives og
51
+ forklares i sitt fulle i denne labelen
52
+ </Stepper.Step>
53
+ <Stepper.Step {...newProps}>Vedlegg</Stepper.Step>
54
+ <Stepper.Step {...newProps}>Oppsummering</Stepper.Step>
55
+ <Stepper.Step {...newProps}>Innsending</Stepper.Step>
56
+ </Stepper>
57
+ <BodyLong style={{ marginTop: "5rem" }}>
58
+ {storyTexts[activeStep]}
59
+ </BodyLong>
60
+ </div>
61
+ );
62
+ };
63
+
64
+ Default.args = {
65
+ asButton: false,
66
+ };
67
+
68
+ export const Horizontal = () => {
69
+ const [activeStep, setActiveStep] = useState(2);
70
+ const props = { onClick: (e) => e.preventDefault(), href: "#" };
71
+ return (
72
+ <Stepper
73
+ aria-labelledby="stepper-heading"
74
+ activeStep={activeStep}
75
+ onStepChange={setActiveStep}
76
+ orientation="horizontal"
77
+ >
78
+ <Stepper.Step {...props}>Start søknad</Stepper.Step>
79
+ <Stepper.Step {...props}>Personopplysninger</Stepper.Step>
80
+ <Stepper.Step {...props}>Saksopplysninger</Stepper.Step>
81
+ <Stepper.Step {...props}>
82
+ Søknadstekst for en veldig spesifikk prosess i NAV som har lang tekst
83
+ </Stepper.Step>
84
+ <Stepper.Step {...props}>Vedlegg</Stepper.Step>
85
+ <Stepper.Step {...props}>Oppsummering</Stepper.Step>
86
+ <Stepper.Step {...props}>Innsending</Stepper.Step>
87
+ </Stepper>
88
+ );
89
+ };
90
+
91
+ export const Vertical = () => {
92
+ const [activeStep, setActiveStep] = useState(2);
93
+ const props = { onClick: (e) => e.preventDefault(), href: "#" };
94
+ return (
95
+ <Stepper
96
+ aria-labelledby="stepper-heading"
97
+ activeStep={activeStep}
98
+ onStepChange={setActiveStep}
99
+ orientation="vertical"
100
+ >
101
+ <Stepper.Step {...props}>Start søknad</Stepper.Step>
102
+ <Stepper.Step {...props}>Personopplysninger</Stepper.Step>
103
+ <Stepper.Step {...props}>Saksopplysninger</Stepper.Step>
104
+ <Stepper.Step {...props}>
105
+ Søknadstekst for en veldig spesifikk prosess i NAV som har lang tekst
106
+ </Stepper.Step>
107
+ <Stepper.Step {...props}>Vedlegg</Stepper.Step>
108
+ <Stepper.Step {...props}>Oppsummering</Stepper.Step>
109
+ <Stepper.Step {...props}>Innsending</Stepper.Step>
110
+ </Stepper>
111
+ );
112
+ };
113
+
114
+ export const DisplayOnly = () => {
115
+ const props = { as: "div" };
116
+ return (
117
+ <Stepper
118
+ aria-labelledby="stepper-heading"
119
+ activeStep={2}
120
+ orientation="vertical"
121
+ >
122
+ <Stepper.Step {...props}>Start søknad</Stepper.Step>
123
+ <Stepper.Step {...props}>Personopplysninger</Stepper.Step>
124
+ <Stepper.Step {...props}>Saksopplysninger</Stepper.Step>
125
+ <Stepper.Step {...props}>
126
+ Søknadstekst for en veldig spesifikk prosess i NAV som har lang tekst
127
+ </Stepper.Step>
128
+ <Stepper.Step {...props}>Vedlegg</Stepper.Step>
129
+ <Stepper.Step {...props}>Oppsummering</Stepper.Step>
130
+ <Stepper.Step {...props}>Innsending</Stepper.Step>
131
+ </Stepper>
132
+ );
133
+ };
@@ -171,10 +171,10 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
171
171
  );
172
172
 
173
173
  /* https://floating-ui.com/docs/react-dom#stable-ref-prop */
174
- const stableRef = useMemo(() => mergeRefs([ref, refs.floating]), [
175
- ref,
176
- refs.floating,
177
- ]);
174
+ const stableRef = useMemo(
175
+ () => mergeRefs([ref, refs.floating]),
176
+ [ref, refs.floating]
177
+ );
178
178
 
179
179
  if (
180
180
  !children ||
@@ -23,23 +23,21 @@ export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
23
23
  spacing?: boolean;
24
24
  }
25
25
 
26
- export const Heading: OverridableComponent<
27
- HeadingProps,
28
- HTMLHeadingElement
29
- > = forwardRef(
30
- ({ level = "1", size, spacing = false, className, as, ...rest }, ref) => {
31
- let HeadingTag = as ?? (`h${level}` as React.ElementType);
26
+ export const Heading: OverridableComponent<HeadingProps, HTMLHeadingElement> =
27
+ forwardRef(
28
+ ({ level = "1", size, spacing = false, className, as, ...rest }, ref) => {
29
+ let HeadingTag = as ?? (`h${level}` as React.ElementType);
32
30
 
33
- return (
34
- <HeadingTag
35
- {...rest}
36
- ref={ref}
37
- className={cl(className, "navds-heading", `navds-heading--${size}`, {
38
- "navds-typo--spacing": spacing,
39
- })}
40
- />
41
- );
42
- }
43
- );
31
+ return (
32
+ <HeadingTag
33
+ {...rest}
34
+ ref={ref}
35
+ className={cl(className, "navds-heading", `navds-heading--${size}`, {
36
+ "navds-typo--spacing": spacing,
37
+ })}
38
+ />
39
+ );
40
+ }
41
+ );
44
42
 
45
43
  export default Heading;
@@ -14,17 +14,15 @@ export interface IngressProps
14
14
  spacing?: boolean;
15
15
  }
16
16
 
17
- export const Ingress: OverridableComponent<
18
- IngressProps,
19
- HTMLParagraphElement
20
- > = forwardRef(({ className, spacing, as: Component = "p", ...rest }, ref) => (
21
- <Component
22
- {...rest}
23
- ref={ref}
24
- className={cl(className, "navds-ingress", {
25
- "navds-typo--spacing": !!spacing,
26
- })}
27
- />
28
- ));
17
+ export const Ingress: OverridableComponent<IngressProps, HTMLParagraphElement> =
18
+ forwardRef(({ className, spacing, as: Component = "p", ...rest }, ref) => (
19
+ <Component
20
+ {...rest}
21
+ ref={ref}
22
+ className={cl(className, "navds-ingress", {
23
+ "navds-typo--spacing": !!spacing,
24
+ })}
25
+ />
26
+ ));
29
27
 
30
28
  export default Ingress;