@navikt/ds-react 0.19.7 → 0.19.10

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 (46) hide show
  1. package/_docs.json +20 -1
  2. package/cjs/form/Textarea.js +12 -4
  3. package/cjs/loader/Loader.js +2 -2
  4. package/esm/form/Textarea.d.ts +4 -0
  5. package/esm/form/Textarea.js +12 -4
  6. package/esm/form/Textarea.js.map +1 -1
  7. package/esm/loader/Loader.d.ts +1 -1
  8. package/esm/loader/Loader.js +2 -2
  9. package/esm/loader/Loader.js.map +1 -1
  10. package/package.json +3 -3
  11. package/src/alert/alert.stories.tsx +9 -1
  12. package/src/button/button.stories.tsx +22 -19
  13. package/src/form/Textarea.tsx +17 -2
  14. package/src/form/stories/textarea.stories.tsx +10 -0
  15. package/src/guide-panel/guidepanel.stories.tsx +51 -0
  16. package/src/help-text/help-text.stories.tsx +53 -18
  17. package/src/link/link.stories.tsx +77 -0
  18. package/src/link-panel/link-panel.stories.tsx +57 -0
  19. package/src/loader/Loader.tsx +8 -4
  20. package/src/loader/loader.stories.tsx +79 -0
  21. package/src/modal/modal.stories.tsx +71 -38
  22. package/src/panel/{stories/panel.stories.tsx → panel.stories.tsx} +27 -5
  23. package/src/popover/popover.stories.tsx +126 -0
  24. package/src/table/stories/table-async.stories.tsx +1 -1
  25. package/src/table/stories/table-expandable.stories.tsx +89 -62
  26. package/src/table/stories/table.stories.tsx +73 -83
  27. package/src/tag/tag.stories.tsx +45 -0
  28. package/src/typography/heading.stories.tsx +75 -0
  29. package/src/typography/typography.stories.tsx +184 -111
  30. package/src/guide-panel/stories/example.css +0 -13
  31. package/src/guide-panel/stories/guidepanel.stories.mdx +0 -81
  32. package/src/guide-panel/stories/guidepanel.stories.tsx +0 -68
  33. package/src/link/stories/link.stories.mdx +0 -26
  34. package/src/link/stories/link.stories.tsx +0 -53
  35. package/src/link-panel/stories/illustration.tsx +0 -125
  36. package/src/link-panel/stories/link-panel.stories.mdx +0 -110
  37. package/src/link-panel/stories/link-panel.stories.tsx +0 -51
  38. package/src/loader/stories/loader.stories.mdx +0 -65
  39. package/src/loader/stories/loader.stories.tsx +0 -69
  40. package/src/panel/stories/panel.stories.mdx +0 -42
  41. package/src/popover/stories/popover.stories.mdx +0 -23
  42. package/src/popover/stories/popover.stories.tsx +0 -56
  43. package/src/table/stories/table-hot.stories.tsx +0 -376
  44. package/src/table/stories/table.stories.mdx +0 -112
  45. package/src/tag/stories/tag.stories.mdx +0 -56
  46. package/src/tag/stories/tag.stories.tsx +0 -32
package/_docs.json CHANGED
@@ -1723,6 +1723,25 @@
1723
1723
  "name": "boolean"
1724
1724
  }
1725
1725
  },
1726
+ "resize": {
1727
+ "defaultValue": null,
1728
+ "description": "Enables resizing of field",
1729
+ "name": "resize",
1730
+ "parent": {
1731
+ "fileName": "src/form/Textarea.tsx",
1732
+ "name": "TextareaProps"
1733
+ },
1734
+ "declarations": [
1735
+ {
1736
+ "fileName": "src/form/Textarea.tsx",
1737
+ "name": "TextareaProps"
1738
+ }
1739
+ ],
1740
+ "required": false,
1741
+ "type": {
1742
+ "name": "boolean"
1743
+ }
1744
+ },
1726
1745
  "error": {
1727
1746
  "defaultValue": null,
1728
1747
  "description": "Error message for element",
@@ -2764,7 +2783,7 @@
2764
2783
  ],
2765
2784
  "required": false,
2766
2785
  "type": {
2767
- "name": "\"2xlarge\" | \"xlarge\" | \"large\" | \"medium\" | \"small\" | \"xsmall\""
2786
+ "name": "\"3xlarge\" | \"2xlarge\" | \"xlarge\" | \"large\" | \"medium\" | \"small\" | \"xsmall\""
2768
2787
  }
2769
2788
  },
2770
2789
  "title": {
@@ -47,13 +47,21 @@ const __2 = require("..");
47
47
  exports.Textarea = (0, react_1.forwardRef)((props, ref) => {
48
48
  var _a, _b, _c;
49
49
  const { inputProps, errorId, showErrorMsg, hasError, size, inputDescriptionId, } = (0, useFormField_1.useFormField)(props, "textarea");
50
- const { label, className, description, maxLength, hideLabel = false } = props, rest = __rest(props, ["label", "className", "description", "maxLength", "hideLabel"]);
50
+ const { label, className, description, maxLength, hideLabel = false, resize } = props, rest = __rest(props, ["label", "className", "description", "maxLength", "hideLabel", "resize"]);
51
51
  const maxLengthId = `TextareaMaxLength-${(0, __2.useId)()}`;
52
52
  const hasMaxLength = maxLength !== undefined && maxLength > 0;
53
53
  const [controlledValue, setControlledValue] = (0, react_1.useState)((_a = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _a !== void 0 ? _a : "");
54
+ const getMinRows = () => {
55
+ let rows = (rest === null || rest === void 0 ? void 0 : rest.minRows) && (rest === null || rest === void 0 ? void 0 : rest.minRows) >= 3 ? rest === null || rest === void 0 ? void 0 : rest.minRows : 3;
56
+ if (size === "small") {
57
+ rows = (rest === null || rest === void 0 ? void 0 : rest.minRows) && (rest === null || rest === void 0 ? void 0 : rest.minRows) >= 2 ? rest === null || rest === void 0 ? void 0 : rest.minRows : 2;
58
+ }
59
+ return rows;
60
+ };
54
61
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)(className, "navds-form-field", `navds-form-field--${size}`, {
55
62
  "navds-textarea--error": hasError,
56
63
  "navds-textarea--disabled": !!inputProps.disabled,
64
+ "navds-textarea--resize": resize,
57
65
  }) },
58
66
  react_1.default.createElement(__1.Label, { htmlFor: inputProps.id, size: size, as: "label", className: (0, classnames_1.default)("navds-textarea__label", {
59
67
  "navds-sr-only": hideLabel,
@@ -64,7 +72,7 @@ exports.Textarea = (0, react_1.forwardRef)((props, ref) => {
64
72
  react_1.default.createElement("div", { className: "navds-textarea__wrapper" },
65
73
  react_1.default.createElement(TextareaAutosize_1.default, Object.assign({}, (0, __1.omit)(rest, ["error", "errorId", "size"]), inputProps, { onChange: (e) => props.onChange
66
74
  ? props.onChange(e)
67
- : setControlledValue(e.target.value), ref: ref, className: (0, classnames_1.default)("navds-textarea__input", "navds-body-short", `navds-body-${size !== null && size !== void 0 ? size : "medium"}`, {
75
+ : setControlledValue(e.target.value), minRows: getMinRows(), ref: ref, className: (0, classnames_1.default)("navds-textarea__input", "navds-body-short", `navds-body-${size !== null && size !== void 0 ? size : "medium"}`, {
68
76
  "navds-textarea--counter": hasMaxLength,
69
77
  }), "aria-describedby": (0, classnames_1.default)(inputProps["aria-describedby"], {
70
78
  [maxLengthId]: hasMaxLength,
@@ -85,8 +93,8 @@ const Counter = ({ maxLength, currentLength, size }) => {
85
93
  return (react_1.default.createElement(__1.BodyShort, { className: (0, classnames_1.default)("navds-textarea__counter", {
86
94
  "navds-textarea__counter--error": difference < 0,
87
95
  }), "aria-live": difference < 20 ? "polite" : "off", size: size }, difference < 0
88
- ? `Du har ${Math.abs(difference)} tegn for mye`
89
- : `Du har ${difference} tegn igjen`));
96
+ ? `Antall tegn for mye ${Math.abs(difference)}`
97
+ : `Antall tegn igjen ${difference}`));
90
98
  };
91
99
  exports.Counter = Counter;
92
100
  exports.default = exports.Textarea;
@@ -48,7 +48,7 @@ exports.Loader = (0, react_1.forwardRef)((_a, ref) => {
48
48
  "navds-loader--transparent": transparent,
49
49
  }), focusable: "false", viewBox: "0 0 50 50", preserveAspectRatio: "xMidYMid" }, rest),
50
50
  react_1.default.createElement("title", { id: id !== null && id !== void 0 ? id : `loader-${internalId}` }, title),
51
- react_1.default.createElement("circle", { className: "navds-loader__background", xmlns: "http://www.w3.org/2000/svg", cx: "25", cy: "25", r: "20", fill: "none", strokeWidth: "5" }),
52
- react_1.default.createElement("circle", { className: "navds-loader__foreground", cx: "25", cy: "25", r: "20", stroke: "var(--navds-global-color-gray-400)", fill: "none", strokeWidth: "5", strokeDasharray: "50 155", strokeLinecap: "round" })));
51
+ react_1.default.createElement("circle", { className: "navds-loader__background", xmlns: "http://www.w3.org/2000/svg", cx: "25", cy: "25", r: "20", fill: "none" }),
52
+ react_1.default.createElement("circle", { className: "navds-loader__foreground", cx: "25", cy: "25", r: "20", stroke: "var(--navds-global-color-gray-400)", fill: "none", strokeDasharray: "50 155" })));
53
53
  });
54
54
  exports.default = exports.Loader;
@@ -34,6 +34,10 @@ export interface TextareaProps extends FormFieldProps, React.TextareaHTMLAttribu
34
34
  * If enabled shows the label and description for screenreaders only
35
35
  */
36
36
  hideLabel?: boolean;
37
+ /**
38
+ * Enables resizing of field
39
+ */
40
+ resize?: boolean;
37
41
  }
38
42
  export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
39
43
  export declare const Counter: ({ maxLength, currentLength, size }: {
@@ -18,13 +18,21 @@ import { useId } from "..";
18
18
  export const Textarea = forwardRef((props, ref) => {
19
19
  var _a, _b, _c;
20
20
  const { inputProps, errorId, showErrorMsg, hasError, size, inputDescriptionId, } = useFormField(props, "textarea");
21
- const { label, className, description, maxLength, hideLabel = false } = props, rest = __rest(props, ["label", "className", "description", "maxLength", "hideLabel"]);
21
+ const { label, className, description, maxLength, hideLabel = false, resize } = props, rest = __rest(props, ["label", "className", "description", "maxLength", "hideLabel", "resize"]);
22
22
  const maxLengthId = `TextareaMaxLength-${useId()}`;
23
23
  const hasMaxLength = maxLength !== undefined && maxLength > 0;
24
24
  const [controlledValue, setControlledValue] = useState((_a = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _a !== void 0 ? _a : "");
25
+ const getMinRows = () => {
26
+ let rows = (rest === null || rest === void 0 ? void 0 : rest.minRows) && (rest === null || rest === void 0 ? void 0 : rest.minRows) >= 3 ? rest === null || rest === void 0 ? void 0 : rest.minRows : 3;
27
+ if (size === "small") {
28
+ rows = (rest === null || rest === void 0 ? void 0 : rest.minRows) && (rest === null || rest === void 0 ? void 0 : rest.minRows) >= 2 ? rest === null || rest === void 0 ? void 0 : rest.minRows : 2;
29
+ }
30
+ return rows;
31
+ };
25
32
  return (React.createElement("div", { className: cl(className, "navds-form-field", `navds-form-field--${size}`, {
26
33
  "navds-textarea--error": hasError,
27
34
  "navds-textarea--disabled": !!inputProps.disabled,
35
+ "navds-textarea--resize": resize,
28
36
  }) },
29
37
  React.createElement(Label, { htmlFor: inputProps.id, size: size, as: "label", className: cl("navds-textarea__label", {
30
38
  "navds-sr-only": hideLabel,
@@ -35,7 +43,7 @@ export const Textarea = forwardRef((props, ref) => {
35
43
  React.createElement("div", { className: "navds-textarea__wrapper" },
36
44
  React.createElement(TextareaAutosize, Object.assign({}, omit(rest, ["error", "errorId", "size"]), inputProps, { onChange: (e) => props.onChange
37
45
  ? props.onChange(e)
38
- : setControlledValue(e.target.value), ref: ref, className: cl("navds-textarea__input", "navds-body-short", `navds-body-${size !== null && size !== void 0 ? size : "medium"}`, {
46
+ : setControlledValue(e.target.value), minRows: getMinRows(), ref: ref, className: cl("navds-textarea__input", "navds-body-short", `navds-body-${size !== null && size !== void 0 ? size : "medium"}`, {
39
47
  "navds-textarea--counter": hasMaxLength,
40
48
  }), "aria-describedby": cl(inputProps["aria-describedby"], {
41
49
  [maxLengthId]: hasMaxLength,
@@ -56,8 +64,8 @@ export const Counter = ({ maxLength, currentLength, size }) => {
56
64
  return (React.createElement(BodyShort, { className: cl("navds-textarea__counter", {
57
65
  "navds-textarea__counter--error": difference < 0,
58
66
  }), "aria-live": difference < 20 ? "polite" : "off", size: size }, difference < 0
59
- ? `Du har ${Math.abs(difference)} tegn for mye`
60
- : `Du har ${difference} tegn igjen`));
67
+ ? `Antall tegn for mye ${Math.abs(difference)}`
68
+ : `Antall tegn igjen ${difference}`));
61
69
  };
62
70
  export default Textarea;
63
71
  //# sourceMappingURL=Textarea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../src/form/Textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,gBAAgB,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,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AS,EAAE,SAAS,EACpB,aAAa,EAAE,MAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,MAAM,mCAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAC7D,IAAI,EAAE,IAAI,GACV,CACD,CACJ,CACG;QACN,6BAAK,EAAE,EAAE,OAAO,mBAAgB,oBAAoB,eAAW,QAAQ,IACpE,YAAY,IAAI,CACf,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAC,KAAK,CAAgB,CACvD,CACG,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,EAAE;IAC5D,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;IAE7C,OAAO,CACL,oBAAC,SAAS,IACR,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE;YACvC,gCAAgC,EAAE,UAAU,GAAG,CAAC;SACjD,CAAC,eACS,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAC7C,IAAI,EAAE,IAAI,IAET,UAAU,GAAG,CAAC;QACb,CAAC,CAAC,uBAAuB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC/C,CAAC,CAAC,qBAAqB,UAAU,EAAE,CAC3B,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -5,7 +5,7 @@ export interface LoaderProps extends SVGProps<SVGSVGElement> {
5
5
  * 64px | 40px | 32px | 24px | 20px | 16px
6
6
  * @default "medium"
7
7
  */
8
- size?: "2xlarge" | "xlarge" | "large" | "medium" | "small" | "xsmall";
8
+ size?: "3xlarge" | "2xlarge" | "xlarge" | "large" | "medium" | "small" | "xsmall";
9
9
  /**
10
10
  * Title prop on svg
11
11
  * @default "venter..."
@@ -19,8 +19,8 @@ export const Loader = forwardRef((_a, ref) => {
19
19
  "navds-loader--transparent": transparent,
20
20
  }), focusable: "false", viewBox: "0 0 50 50", preserveAspectRatio: "xMidYMid" }, rest),
21
21
  React.createElement("title", { id: id !== null && id !== void 0 ? id : `loader-${internalId}` }, title),
22
- React.createElement("circle", { className: "navds-loader__background", xmlns: "http://www.w3.org/2000/svg", cx: "25", cy: "25", r: "20", fill: "none", strokeWidth: "5" }),
23
- React.createElement("circle", { className: "navds-loader__foreground", cx: "25", cy: "25", r: "20", stroke: "var(--navds-global-color-gray-400)", fill: "none", strokeWidth: "5", strokeDasharray: "50 155", strokeLinecap: "round" })));
22
+ React.createElement("circle", { className: "navds-loader__background", xmlns: "http://www.w3.org/2000/svg", cx: "25", cy: "25", r: "20", fill: "none" }),
23
+ React.createElement("circle", { className: "navds-loader__foreground", cx: "25", cy: "25", r: "20", stroke: "var(--navds-global-color-gray-400)", fill: "none", strokeDasharray: "50 155" })));
24
24
  });
25
25
  export default Loader;
26
26
  //# sourceMappingURL=Loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../src/loader/Loader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAY,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AA0B3B,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,WAAW,EACnB,WAAW,GAAG,KAAK,EACnB,OAAO,GAAG,SAAS,EACnB,EAAE,OAEH,EADI,IAAI,cART,0EASC,CADQ;IAIT,MAAM,UAAU,GAAG,KAAK,EAAE,CAAC;IAE3B,OAAO,CACL,8DACmB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,UAAU,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,GAAG,KAAK,EACnB,OAAO,GAAG,SAAS,EACnB,EAAE,OAEH,EADI,IAAI,cART,0EASC,CADQ;IAIT,MAAM,UAAU,GAAG,KAAK,EAAE,CAAC;IAE3B,OAAO,CACL,8DACmB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,UAAU,UAAU,EAAE,EAC7C,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,cAAc,EACd,SAAS,EACT,iBAAiB,IAAI,EAAE,EACvB,iBAAiB,OAAO,EAAE,EAC1B;YACE,2BAA2B,EAAE,WAAW;SACzC,CACF,EACD,SAAS,EAAC,OAAO,EACjB,OAAO,EAAC,WAAW,EACnB,mBAAmB,EAAC,UAAU,IAC1B,IAAI;QAER,+BAAO,EAAE,EAAE,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,UAAU,UAAU,EAAE,IAAG,KAAK,CAAS;QACxD,gCACE,SAAS,EAAC,0BAA0B,EACpC,KAAK,EAAC,4BAA4B,EAClC,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,EACN,IAAI,EAAC,MAAM,GACX;QACF,gCACE,SAAS,EAAC,0BAA0B,EACpC,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,EACN,MAAM,EAAE,oCAAoC,EAC5C,IAAI,EAAC,MAAM,EACX,eAAe,EAAC,QAAQ,GACxB,CACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "0.19.7",
3
+ "version": "0.19.10",
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.16",
40
+ "@navikt/ds-icons": "^0.8.17",
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": "731cae82c31336ff94121121f723cd0235a38af0"
79
+ "gitHead": "3e0e9ad15c93d9a3cd82d6d9a353cb0c4da0d8b6"
80
80
  }
@@ -5,6 +5,15 @@ import { BodyLong, Heading as DsHeading } from "..";
5
5
  export default {
6
6
  title: "ds-react/Alert",
7
7
  component: Alert,
8
+ argTypes: {
9
+ variant: {
10
+ defaultValue: "info",
11
+ control: {
12
+ type: "radio",
13
+ options: ["error", "warning", "info", "success"],
14
+ },
15
+ },
16
+ },
8
17
  };
9
18
 
10
19
  const variants: Array<"error" | "warning" | "info" | "success"> = [
@@ -26,7 +35,6 @@ export const Default = (props) => (
26
35
  );
27
36
 
28
37
  Default.args = {
29
- variant: "info",
30
38
  children: "Id elit esse enim reprehenderit enim nisi veniam nostrud.",
31
39
  };
32
40
 
@@ -74,6 +74,16 @@ export const XSmall = () => (
74
74
  </div>
75
75
  );
76
76
 
77
+ export const Link = () => (
78
+ <div className="rowgap">
79
+ {variants.map((variant) => (
80
+ <Button key={variant} variant={variant} as="a" href="#thecakeisalie">
81
+ {varSwitch[variant]}
82
+ </Button>
83
+ ))}
84
+ </div>
85
+ );
86
+
77
87
  export const Loading = () => (
78
88
  <div className="colgap">
79
89
  <div className="rowgap">
@@ -105,21 +115,24 @@ export const Icon = () => (
105
115
  <div className="rowgap">
106
116
  {variants.map((variant) => (
107
117
  <Button key={variant} variant={variant}>
108
- <Star />
118
+ <Star aria-hidden />
119
+ <span className="navds-sr-only">Stjerne</span>
109
120
  </Button>
110
121
  ))}
111
122
  </div>
112
123
  <div className="rowgap">
113
124
  {variants.map((variant) => (
114
125
  <Button key={variant} variant={variant} size="small">
115
- <Star />
126
+ <Star aria-hidden />
127
+ <span className="navds-sr-only">Stjerne</span>
116
128
  </Button>
117
129
  ))}
118
130
  </div>
119
131
  <div className="rowgap">
120
132
  {variants.map((variant) => (
121
133
  <Button key={variant} variant={variant} size="xsmall">
122
- <Star />
134
+ <Star aria-hidden />
135
+ <span className="navds-sr-only">Stjerne</span>
123
136
  </Button>
124
137
  ))}
125
138
  </div>
@@ -131,39 +144,29 @@ export const IconWText = () => (
131
144
  <div className="rowgap">
132
145
  {variants.map((variant) => (
133
146
  <Button key={variant} variant={variant}>
134
- <Star />
147
+ <Star aria-hidden />
135
148
  {varSwitch[variant]}
136
- <Star />
149
+ <Star aria-hidden />
137
150
  </Button>
138
151
  ))}
139
152
  </div>
140
153
  <div className="rowgap">
141
154
  {variants.map((variant) => (
142
155
  <Button key={variant} variant={variant} size="small">
143
- <Star />
156
+ <Star aria-hidden />
144
157
  {varSwitch[variant]}
145
- <Star />
158
+ <Star aria-hidden />
146
159
  </Button>
147
160
  ))}
148
161
  </div>
149
162
  <div className="rowgap">
150
163
  {variants.map((variant) => (
151
164
  <Button key={variant} variant={variant} size="xsmall">
152
- <Star />
165
+ <Star aria-hidden />
153
166
  {varSwitch[variant]}
154
- <Star />
167
+ <Star aria-hidden />
155
168
  </Button>
156
169
  ))}
157
170
  </div>
158
171
  </div>
159
172
  );
160
-
161
- export const Link = () => (
162
- <div className="rowgap">
163
- {variants.map((variant) => (
164
- <Button key={variant} variant={variant} as="a" href="#thecakeisalie">
165
- {varSwitch[variant]}
166
- </Button>
167
- ))}
168
- </div>
169
- );
@@ -41,6 +41,10 @@ export interface TextareaProps
41
41
  * If enabled shows the label and description for screenreaders only
42
42
  */
43
43
  hideLabel?: boolean;
44
+ /**
45
+ * Enables resizing of field
46
+ */
47
+ resize?: boolean;
44
48
  }
45
49
 
46
50
  export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
@@ -60,6 +64,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
60
64
  description,
61
65
  maxLength,
62
66
  hideLabel = false,
67
+ resize,
63
68
  ...rest
64
69
  } = props;
65
70
 
@@ -70,6 +75,14 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
70
75
  props?.defaultValue ?? ""
71
76
  );
72
77
 
78
+ const getMinRows = () => {
79
+ let rows = rest?.minRows && rest?.minRows >= 3 ? rest?.minRows : 3;
80
+ if (size === "small") {
81
+ rows = rest?.minRows && rest?.minRows >= 2 ? rest?.minRows : 2;
82
+ }
83
+ return rows;
84
+ };
85
+
73
86
  return (
74
87
  <div
75
88
  className={cl(
@@ -79,6 +92,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
79
92
  {
80
93
  "navds-textarea--error": hasError,
81
94
  "navds-textarea--disabled": !!inputProps.disabled,
95
+ "navds-textarea--resize": resize,
82
96
  }
83
97
  )}
84
98
  >
@@ -113,6 +127,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
113
127
  ? props.onChange(e)
114
128
  : setControlledValue(e.target.value)
115
129
  }
130
+ minRows={getMinRows()}
116
131
  ref={ref}
117
132
  className={cl(
118
133
  "navds-textarea__input",
@@ -162,8 +177,8 @@ export const Counter = ({ maxLength, currentLength, size }) => {
162
177
  size={size}
163
178
  >
164
179
  {difference < 0
165
- ? `Du har ${Math.abs(difference)} tegn for mye`
166
- : `Du har ${difference} tegn igjen`}
180
+ ? `Antall tegn for mye ${Math.abs(difference)}`
181
+ : `Antall tegn igjen ${difference}`}
167
182
  </BodyShort>
168
183
  );
169
184
  };
@@ -23,6 +23,12 @@ export default {
23
23
  disabled: {
24
24
  type: "boolean",
25
25
  },
26
+ maxRows: {
27
+ type: "number",
28
+ },
29
+ minRows: {
30
+ type: "number",
31
+ },
26
32
  },
27
33
  } as Meta;
28
34
 
@@ -109,3 +115,7 @@ export const MaxRows = () => {
109
115
  />
110
116
  );
111
117
  };
118
+
119
+ export const Resize = () => {
120
+ return <Textarea resize label="Ipsum enim quis culpa" />;
121
+ };
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import { GuidePanel } from "../index";
3
+ import { Meta } from "@storybook/react/types-6-0";
4
+ export default {
5
+ title: "ds-react/GuidePanel",
6
+ component: GuidePanel,
7
+ } as Meta;
8
+
9
+ const panelText = `Sit sint eu dolore reprehenderit exercitation labore aute anim sit
10
+ adipisicing proident. Tempor ipsum ea cupidatat qui esse do veniam
11
+ cupidatat. Excepteur irure reprehenderit esse tempor nisi duis qui ea
12
+ enim id.`;
13
+
14
+ export const Default = (props) => {
15
+ const newProps = props?.colorOverride
16
+ ? {
17
+ style: {
18
+ ["--navds-guide-panel-color-illustration-background" as any]:
19
+ "var(--navds-global-color-purple-200)",
20
+ ["--navds-guide-panel-color-border" as any]:
21
+ "var(--navds-global-color-purple-400)",
22
+ },
23
+ }
24
+ : {};
25
+
26
+ return (
27
+ <GuidePanel {...newProps} poster={props?.poster}>
28
+ {panelText}
29
+ </GuidePanel>
30
+ );
31
+ };
32
+
33
+ Default.args = {
34
+ poster: false,
35
+ colorOverride: false,
36
+ };
37
+
38
+ export const Poster = () => <GuidePanel poster>{panelText}</GuidePanel>;
39
+
40
+ export const ColorOverride = () => (
41
+ <GuidePanel
42
+ style={{
43
+ ["--navds-guide-panel-color-illustration-background" as any]:
44
+ "var(--navds-global-color-purple-200)",
45
+ ["--navds-guide-panel-color-border" as any]:
46
+ "var(--navds-global-color-purple-400)",
47
+ }}
48
+ >
49
+ {panelText}
50
+ </GuidePanel>
51
+ );
@@ -2,27 +2,62 @@ import React from "react";
2
2
  import { TextField, HelpText } from "..";
3
3
 
4
4
  export default {
5
- title: "ds-react/help-text",
5
+ title: "ds-react/HelpText",
6
6
  component: HelpText,
7
+ argTypes: {
8
+ placement: {
9
+ control: {
10
+ type: "radio",
11
+ options: [
12
+ "bottom",
13
+ "right",
14
+ "left",
15
+ "top-start",
16
+ "top-end",
17
+ "bottom-start",
18
+ "bottom-end",
19
+ "right-start",
20
+ "right-end",
21
+ "left-start",
22
+ "left-end",
23
+ "auto",
24
+ "auto-start",
25
+ "auto-end",
26
+ ],
27
+ },
28
+ },
29
+ strategy: {
30
+ control: {
31
+ type: "radio",
32
+ options: ["fixed", "absolute"],
33
+ },
34
+ },
35
+ },
7
36
  };
8
37
 
9
- export const All = () => {
38
+ export const Default = (props: any) => {
10
39
  return (
11
- <>
12
- <h1>HelpText</h1>
13
- <HelpText title="show tooltip">
14
- Id ullamco excepteur elit fugiat labore.
15
- </HelpText>
16
- <TextField
17
- label={
18
- <div style={{ display: "flex", gap: 8 }}>
19
- Text field label
20
- <HelpText title="show tooltip">
21
- Id ullamco excepteur elit fugiat labore.
22
- </HelpText>
23
- </div>
24
- }
25
- ></TextField>
26
- </>
40
+ <HelpText title="show tooltip" strategy="fixed" {...props}>
41
+ Id ullamco excepteur elit fugiat labore.
42
+ </HelpText>
43
+ );
44
+ };
45
+
46
+ Default.args = {
47
+ title: "show tooltip",
48
+ };
49
+
50
+ export const Inline = () => {
51
+ return (
52
+ <TextField
53
+ label={
54
+ <div style={{ display: "flex", gap: 8 }}>
55
+ Text field label
56
+ <HelpText title="show tooltip">
57
+ Id ullamco excepteur elit fugiat labore.
58
+ </HelpText>
59
+ </div>
60
+ }
61
+ />
27
62
  );
28
63
  };
@@ -0,0 +1,77 @@
1
+ import { Add } from "@navikt/ds-icons";
2
+ import React from "react";
3
+ import { ConfirmationPanel as DsConfirmationPanel, Link } from "..";
4
+ import { Alert as DsAlert, BodyLong } from "../..";
5
+ export default {
6
+ title: "ds-react/Link",
7
+ component: Link,
8
+ };
9
+
10
+ export const Default = (props) => {
11
+ const LinkD = () => (
12
+ <Link href="#">
13
+ {props.icon && <Add />}Ex aliqua incididunt {props.icon && <Add />}
14
+ </Link>
15
+ );
16
+
17
+ if (props.inline) {
18
+ return (
19
+ <BodyLong>
20
+ Incididunt laborum nisi nisi Lorem <LinkD /> in. Laborum aute fugiat
21
+ officia adipisicing non veniam dolor nulla non ex consectetur fugiat
22
+ eiusmod aute. Culpa sit aute est duis minim in in voluptate velit
23
+ fugiat. Laboris est id deserunt ut ea Lorem eu. Esse elit laboris aute
24
+ commodo sint laborum fugiat aliqua.
25
+ </BodyLong>
26
+ );
27
+ }
28
+ return <LinkD />;
29
+ };
30
+
31
+ Default.args = {
32
+ icon: false,
33
+ inline: false,
34
+ };
35
+
36
+ const DemoLink = () => (
37
+ <Link href="#">
38
+ <Add aria-hidden /> Ex aliqua incididunt <Add aria-hidden />
39
+ </Link>
40
+ );
41
+
42
+ export const Icon = () => <DemoLink />;
43
+
44
+ export const Alert = () => {
45
+ return (
46
+ <div className="colgap">
47
+ <DsAlert variant="info">
48
+ <DemoLink />
49
+ </DsAlert>
50
+ <DsAlert variant="success">
51
+ <DemoLink />
52
+ </DsAlert>
53
+ <DsAlert variant="warning">
54
+ <DemoLink />
55
+ </DsAlert>
56
+ <DsAlert variant="error">
57
+ <DemoLink />
58
+ </DsAlert>
59
+ </div>
60
+ );
61
+ };
62
+
63
+ export const ConfirmationPanel = () => {
64
+ return (
65
+ <div className="colgap">
66
+ <DsConfirmationPanel label="demo">
67
+ <DemoLink />
68
+ </DsConfirmationPanel>
69
+ <DsConfirmationPanel checked label="demo">
70
+ <DemoLink />
71
+ </DsConfirmationPanel>
72
+ <DsConfirmationPanel error="demo" label="demo">
73
+ <DemoLink />
74
+ </DsConfirmationPanel>
75
+ </div>
76
+ );
77
+ };