@navikt/ds-react 0.12.2 → 0.13.2

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 (44) hide show
  1. package/cjs/form/Fieldset/Fieldset.js +1 -1
  2. package/cjs/form/Select.js +1 -1
  3. package/cjs/form/TextField.js +1 -1
  4. package/cjs/form/Textarea.js +1 -1
  5. package/cjs/form/checkbox/Checkbox.js +1 -1
  6. package/cjs/form/radio/Radio.js +1 -1
  7. package/cjs/form/radio/useRadio.js +6 -5
  8. package/cjs/form/search-field/SearchField.js +1 -1
  9. package/esm/form/Fieldset/Fieldset.js +1 -1
  10. package/esm/form/Fieldset/Fieldset.js.map +1 -1
  11. package/esm/form/Select.js +1 -1
  12. package/esm/form/Select.js.map +1 -1
  13. package/esm/form/TextField.js +1 -1
  14. package/esm/form/TextField.js.map +1 -1
  15. package/esm/form/Textarea.js +1 -1
  16. package/esm/form/Textarea.js.map +1 -1
  17. package/esm/form/checkbox/Checkbox.js +1 -1
  18. package/esm/form/checkbox/Checkbox.js.map +1 -1
  19. package/esm/form/radio/Radio.js +1 -1
  20. package/esm/form/radio/Radio.js.map +1 -1
  21. package/esm/form/radio/useRadio.d.ts +1 -0
  22. package/esm/form/radio/useRadio.js +6 -5
  23. package/esm/form/radio/useRadio.js.map +1 -1
  24. package/esm/form/search-field/SearchField.js +1 -1
  25. package/esm/form/search-field/SearchField.js.map +1 -1
  26. package/esm/loader/Loader.d.ts +1 -1
  27. package/package.json +3 -3
  28. package/src/form/Fieldset/Fieldset.tsx +1 -0
  29. package/src/form/Select.tsx +1 -0
  30. package/src/form/TextField.tsx +1 -0
  31. package/src/form/Textarea.tsx +1 -0
  32. package/src/form/checkbox/Checkbox.test.tsx +7 -5
  33. package/src/form/checkbox/Checkbox.tsx +1 -0
  34. package/src/form/checkbox/stories/checkbox.stories.tsx +1 -1
  35. package/src/form/radio/Radio.test.tsx +63 -0
  36. package/src/form/radio/Radio.tsx +1 -0
  37. package/src/form/radio/stories/radio.stories.tsx +5 -2
  38. package/src/form/radio/useRadio.ts +7 -3
  39. package/src/form/search-field/SearchField.tsx +1 -0
  40. package/src/form/search-field/stories/search-field.stories.tsx +1 -1
  41. package/src/form/stories/fieldset.stories.tsx +6 -2
  42. package/src/form/stories/select.stories.tsx +1 -1
  43. package/src/form/stories/text-field.stories.tsx +4 -1
  44. package/src/form/stories/textarea.stories.tsx +1 -1
@@ -58,7 +58,7 @@ const Fieldset = (0, react_1.forwardRef)((props, ref) => {
58
58
  react_1.default.createElement(__1.Label, { size: size, as: "legend", className: (0, classnames_1.default)("navds-fieldset__legend", {
59
59
  "sr-only": !!hideLegend,
60
60
  }) }, legend),
61
- !!description && (react_1.default.createElement(__1.BodyShort, { className: (0, classnames_1.default)("navds-fieldset__description", {
61
+ !!description && (react_1.default.createElement(__1.BodyShort, { as: "div", className: (0, classnames_1.default)("navds-fieldset__description", {
62
62
  "sr-only": !!hideLegend,
63
63
  }), id: inputDescriptionId, size: size }, description)),
64
64
  children,
@@ -46,7 +46,7 @@ const Select = (0, react_1.forwardRef)((props, ref) => {
46
46
  react_1.default.createElement(__1.Label, { htmlFor: inputProps.id, size: size, as: "label", className: (0, classnames_1.default)("navds-select__label", {
47
47
  "sr-only": hideLabel,
48
48
  }) }, label),
49
- !!description && (react_1.default.createElement(__1.BodyShort, { className: (0, classnames_1.default)("navds-select__description", {
49
+ !!description && (react_1.default.createElement(__1.BodyShort, { as: "div", className: (0, classnames_1.default)("navds-select__description", {
50
50
  "sr-only": hideLabel,
51
51
  }), id: inputDescriptionId, size: size }, description)),
52
52
  react_1.default.createElement("div", { className: "navds-select__container" },
@@ -43,7 +43,7 @@ const TextField = (0, react_1.forwardRef)((props, ref) => {
43
43
  const { label, className, description, htmlSize, hideLabel = false, type = "text" } = props, rest = __rest(props, ["label", "className", "description", "htmlSize", "hideLabel", "type"]);
44
44
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)(className, "navds-form-field", `navds-form-field--${size}`, { "navds-text-field--error": hasError }) },
45
45
  react_1.default.createElement(__1.Label, { htmlFor: inputProps.id, size: size, as: "label", className: (0, classnames_1.default)("navds-text-field__label", { "sr-only": hideLabel }) }, label),
46
- !!description && (react_1.default.createElement(__1.BodyShort, { className: (0, classnames_1.default)("navds-text-field__description", {
46
+ !!description && (react_1.default.createElement(__1.BodyShort, { as: "div", className: (0, classnames_1.default)("navds-text-field__description", {
47
47
  "sr-only": hideLabel,
48
48
  }), id: inputDescriptionId, size: size }, description)),
49
49
  react_1.default.createElement("input", Object.assign({}, (0, __1.omit)(rest, ["error", "errorId", "size"]), inputProps, { ref: ref, type: type, className: (0, classnames_1.default)("navds-text-field__input", "navds-body-short", `navds-body-${size !== null && size !== void 0 ? size : "medium"}`), size: htmlSize })),
@@ -50,7 +50,7 @@ const Textarea = (0, react_1.forwardRef)((props, ref) => {
50
50
  react_1.default.createElement(__1.Label, { htmlFor: inputProps.id, size: size, as: "label", className: (0, classnames_1.default)("navds-textarea__label", {
51
51
  "sr-only": hideLabel,
52
52
  }) }, label),
53
- !!description && (react_1.default.createElement(__1.BodyShort, { className: (0, classnames_1.default)("navds-textarea__description", {
53
+ !!description && (react_1.default.createElement(__1.BodyShort, { as: "div", className: (0, classnames_1.default)("navds-textarea__description", {
54
54
  "sr-only": hideLabel,
55
55
  }), id: inputDescriptionId, size: size }, description)),
56
56
  react_1.default.createElement("div", { className: "navds-textarea__wrapper" },
@@ -43,7 +43,7 @@ const Checkbox = (0, react_1.forwardRef)((props, ref) => {
43
43
  "hideLabel",
44
44
  ]), inputProps, { className: "navds-checkbox__input", ref: ref })),
45
45
  react_1.default.createElement(__1.BodyShort, { as: "label", htmlFor: inputProps.id, size: size, className: "navds-checkbox__label" }, props.hideLabel ? (react_1.default.createElement("span", { className: "sr-only" }, props.children)) : (props.children)),
46
- props.description && (react_1.default.createElement(__1.BodyShort, { size: size, id: inputDescriptionId, className: "navds-checkbox__description" }, props.description)),
46
+ props.description && (react_1.default.createElement(__1.BodyShort, { as: "div", size: size, id: inputDescriptionId, className: "navds-checkbox__description" }, props.description)),
47
47
  react_1.default.createElement("div", { id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && react_1.default.createElement(ErrorMessage_1.default, { size: size }, props.error))));
48
48
  });
49
49
  exports.default = Checkbox;
@@ -42,7 +42,7 @@ const Radio = (0, react_1.forwardRef)((props, ref) => {
42
42
  "description",
43
43
  ]), inputProps, { className: "navds-radio__input", ref: ref })),
44
44
  react_1.default.createElement(__1.BodyShort, { as: "label", htmlFor: inputProps.id, size: size, className: "navds-radio__label" }, props.children),
45
- props.description && (react_1.default.createElement(__1.BodyShort, { size: size, id: inputDescriptionId, className: "navds-radio__description" }, props.description)),
45
+ props.description && (react_1.default.createElement(__1.BodyShort, { as: "div", size: size, id: inputDescriptionId, className: "navds-radio__description" }, props.description)),
46
46
  react_1.default.createElement("div", { id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && react_1.default.createElement(ErrorMessage_1.default, { size: size }, props.error))));
47
47
  });
48
48
  exports.default = Radio;
@@ -19,18 +19,19 @@ const RadioGroup_1 = require("./RadioGroup");
19
19
  * Handles props for Radios in context with Fieldset and RadioGroup
20
20
  */
21
21
  const useRadio = (props) => {
22
- var _a;
23
22
  const radioGroup = (0, react_1.useContext)(RadioGroup_1.RadioGroupContext);
24
- const _b = (0, useFormField_1.useFormField)(props, "radio"), { inputProps } = _b, rest = __rest(_b, ["inputProps"]);
23
+ const _a = (0, useFormField_1.useFormField)(props, "radio"), { inputProps } = _a, rest = __rest(_a, ["inputProps"]);
25
24
  if (!radioGroup) {
26
25
  console.warn("<Radio> must be used inside <RadioGroup>.");
27
26
  }
28
27
  if ((props === null || props === void 0 ? void 0 : props.required) !== undefined) {
29
28
  console.warn("required is only supported on <RadioGroup>.");
30
29
  }
31
- return Object.assign(Object.assign({}, rest), { inputProps: Object.assign(Object.assign({}, inputProps), { name: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.name, checked: ((_a = radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) !== null && _a !== void 0 ? _a : radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === props.value
32
- ? true
33
- : undefined, onChange: (e) => {
30
+ return Object.assign(Object.assign({}, rest), { inputProps: Object.assign(Object.assign({}, inputProps), { name: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.name, defaultChecked: (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === undefined
31
+ ? undefined
32
+ : (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === props.value, checked: (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) === undefined
33
+ ? undefined
34
+ : (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) === props.value, onChange: (e) => {
34
35
  props.onChange && props.onChange(e);
35
36
  (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.onChange) && radioGroup.onChange(props.value);
36
37
  }, required: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.required, type: "radio" }) });
@@ -50,7 +50,7 @@ const SearchField = (0, react_1.forwardRef)((props, ref) => {
50
50
  react_1.default.createElement(__1.Label, { htmlFor: inputProps.id, size: size, as: "label", className: (0, classnames_1.default)("navds-text-field__label", {
51
51
  "sr-only": hideLabel,
52
52
  }) }, label),
53
- !!description && (react_1.default.createElement(__1.BodyShort, { className: (0, classnames_1.default)("navds-text-field__description", {
53
+ !!description && (react_1.default.createElement(__1.BodyShort, { as: "div", className: (0, classnames_1.default)("navds-text-field__description", {
54
54
  "sr-only": hideLabel,
55
55
  }), id: inputDescriptionId, size: size }, description)),
56
56
  react_1.default.createElement("div", { className: "navds-search-field__input-wrapper" },
@@ -33,7 +33,7 @@ const Fieldset = forwardRef((props, ref) => {
33
33
  React.createElement(Label, { size: size, as: "legend", className: cl("navds-fieldset__legend", {
34
34
  "sr-only": !!hideLegend,
35
35
  }) }, legend),
36
- !!description && (React.createElement(BodyShort, { className: cl("navds-fieldset__description", {
36
+ !!description && (React.createElement(BodyShort, { as: "div", className: cl("navds-fieldset__description", {
37
37
  "sr-only": !!hideLegend,
38
38
  }), id: inputDescriptionId, size: size }, description)),
39
39
  children,
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.js","sourceRoot":"","sources":["../../../src/form/Fieldset/Fieldset.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAA0B,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkB5C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAChD,IAAI,CACL,CAAC;AAuBF,MAAM,QAAQ,GAAG,UAAU,CACzB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;;IACb,MAAM,EACJ,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,kBAAkB,GACnB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAEvB,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAE7C,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,gBAAgB,GAAG,IAAI,EACvB,MAAM,EACN,WAAW,EACX,UAAU,KAER,KAAK,EADJ,IAAI,UACL,KAAK,EARH,oFAQL,CAAQ,CAAC;IAEV,OAAO,CACL,oBAAC,eAAe,CAAC,QAAQ,IACvB,KAAK,EAAE;YACL,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,KAAK,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC,CAAC,CAAC,SAAS;YACpE,O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QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAA;aAC7C,CAAC;YACF,IAAI;YACJ,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,KAAK;SAClC;QAED,kDACM,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,EACxC,UAAU,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,SAAS,EACT,gBAAgB,EAChB,mBAAmB,IAAI,EAAE,EACzB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,CACtC;YAED,oBAAC,KAAK,IACJ,IAAI,EAAE,IAAI,EACV,EAAE,EAAC,QAAQ,EACX,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE;oBACtC,SAAS,EAAE,CAAC,CAAC,UAAU;iBACxB,CAAC,IAED,MAAM,CACD;YACP,CAAC,CAAC,WAAW,IAAI,CAChB,oBAAC,SAAS,IACR,EAAE,EAAC,KAAK,EACR,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE;oBAC3C,SAAS,EAAE,CAAC,CAAC,UAAU;iBACxB,CAAC,EACF,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,IAAI,IAET,WAAW,CACF,CACb;YACA,QAAQ;YACT,6BACE,EAAE,EAAE,OAAO,mBACG,oBAAoB,eACxB,QAAQ,EAClB,SAAS,EAAC,uBAAuB,IAEhC,YAAY,IAAI,CACf,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAC,KAAK,CAAgB,CACvD,CACG,CACG,CACc,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -22,7 +22,7 @@ const Select = forwardRef((props, ref) => {
22
22
  React.createElement(Label, { htmlFor: inputProps.id, size: size, as: "label", className: cl("navds-select__label", {
23
23
  "sr-only": hideLabel,
24
24
  }) }, label),
25
- !!description && (React.createElement(BodyShort, { className: cl("navds-select__description", {
25
+ !!description && (React.createElement(BodyShort, { as: "div", className: cl("navds-select__description", {
26
26
  "sr-only": hideLabel,
27
27
  }), id: inputDescriptionId, size: size }, description)),
28
28
  React.createElement("div", { className: "navds-select__container" },
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/form/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAwB,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAuB9D,MAAM,MAAM,GAAG,UAAU,CAAiC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACvE,MAAM,EACJ,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,kBAAkB,GACnB,GAAG,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAErC,MAAM,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,GAAG,KAAK,KAEf,KAAK,EADJ,IAAI,UACL,KAAK,EARH,0EAQL,CAAQ,CAAC;IAEV,OAAO,CACL,6BACE,SAAS,EAAE,EAAE,CACX,SAAS,EACT,kBAAkB,EAClB,qBAAqB,IAAI,EAAE,EAC3B,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CACpC;QAED,oBAAC,KAAK,IACJ,OAAO,EAAE,UAAU,CAAC,EAAE,EACtB,IAAI,EAAE,IAAI,EACV,EAAE,EAAC,OAAO,EACV,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE;gBACnC,SAAS,EAAE,SAAS;aACrB,CAAC,IAED,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oBAAC,MAAM,IAAC,SAAS,EAAC,uBAAuB,GAAG,CACxC;QACN,6BAAK,EAAE,EAAE,OAAO,mBAAgB,oBAAoB,eAAW,QAAQ,IACpE,YAAY,IAAI,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAC,KAAK,CAAgB,CACnE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -19,7 +19,7 @@ const TextField = forwardRef((props, ref) => {
19
19
  const { label, className, description, htmlSize, hideLabel = false, type = "text" } = props, rest = __rest(props, ["label", "className", "description", "htmlSize", "hideLabel", "type"]);
20
20
  return (React.createElement("div", { className: cl(className, "navds-form-field", `navds-form-field--${size}`, { "navds-text-field--error": hasError }) },
21
21
  React.createElement(Label, { htmlFor: inputProps.id, size: size, as: "label", className: cl("navds-text-field__label", { "sr-only": hideLabel }) }, label),
22
- !!description && (React.createElement(BodyShort, { className: cl("navds-text-field__description", {
22
+ !!description && (React.createElement(BodyShort, { as: "div", className: cl("navds-text-field__description", {
23
23
  "sr-only": hideLabel,
24
24
  }), id: inputDescriptionId, size: size }, description)),
25
25
  React.createElement("input", Object.assign({}, omit(rest, ["error", "errorId", "size"]), inputProps, { ref: ref, type: type, className: cl("navds-text-field__input", "navds-body-short", `navds-body-${size !== null && size !== void 0 ? size : "medium"}`), size: htmlSize })),
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../src/form/TextField.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwB9D,MAAM,S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,KAAK,CACA;QAEP,CAAC,CAAC,WAAW,IAAI,CAChB,oBAAC,SAAS,IACR,EAAE,EAAC,KAAK,EACR,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE;gBAC7C,SAAS,EAAE,SAAS;aACrB,CAAC,EACF,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,IAAI,IAET,WAAW,CACF,CACb;QACD,+CACM,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,EACxC,UAAU,IACd,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,yBAAyB,EACzB,kBAAkB,EAClB,cAAc,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,QAAQ,EAAE,CACjC,EACD,IAAI,EAAE,QAAQ,IACd;QACF,6BAAK,EAAE,EAAE,OAAO,mBAAgB,oBAAoB,eAAW,QAAQ,IACpE,YAAY,IAAI,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAC,KAAK,CAAgB,CACnE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -25,7 +25,7 @@ const Textarea = forwardRef((props, ref) => {
25
25
  React.createElement(Label, { htmlFor: inputProps.id, size: size, as: "label", className: cl("navds-textarea__label", {
26
26
  "sr-only": hideLabel,
27
27
  }) }, label),
28
- !!description && (React.createElement(BodyShort, { className: cl("navds-textarea__description", {
28
+ !!description && (React.createElement(BodyShort, { as: "div", className: cl("navds-textarea__description", {
29
29
  "sr-only": hideLabel,
30
30
  }), id: inputDescriptionId, size: size }, description)),
31
31
  React.createElement("div", { className: "navds-textarea__wrapper" },
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../src/form/Textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAA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,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,UAAU,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe;QAC/C,CAAC,CAAC,UAAU,UAAU,aAAa,CAC3B,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -19,7 +19,7 @@ const Checkbox = forwardRef((props, ref) => {
19
19
  "hideLabel",
20
20
  ]), inputProps, { className: "navds-checkbox__input", ref: ref })),
21
21
  React.createElement(BodyShort, { as: "label", htmlFor: inputProps.id, size: size, className: "navds-checkbox__label" }, props.hideLabel ? (React.createElement("span", { className: "sr-only" }, props.children)) : (props.children)),
22
- props.description && (React.createElement(BodyShort, { size: size, id: inputDescriptionId, className: "navds-checkbox__description" }, props.description)),
22
+ props.description && (React.createElement(BodyShort, { as: "div", size: size, id: inputDescriptionId, className: "navds-checkbox__description" }, props.description)),
23
23
  React.createElement("div", { id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && React.createElement(ErrorMessage, { size: size }, props.error))));
24
24
  });
25
25
  export default Checkbox;
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/form/checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAmBxC,MAAM,QAAQ,GAAG,UAAU,CAAkC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1E,MAAM,EACJ,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,kBAAkB,GACnB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAEvB,OAAO,CACL,6BACE,SAAS,EAAE,EAAE,CACX,KAAK,CAAC,SAAS,EACf,gBAAgB,EAChB,mBAAmB,IAAI,EAAE,EACzB;YACE,uBAAuB,EAAE,QAAQ;YACjC,oCAAoC,EAAE,YAAY;YAClD,kCAAkC,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW;SACxD,CACF;QAED,+CACM,IAAI,CAAC,KAAK,EAAE;YACd,UAAU;YACV,MAAM;YACN,OAAO;YACP,SAAS;YACT,aAAa;YACb,WAAW;SACZ,CAAC,EACE,UAAU,IACd,SAAS,EAAC,uBAAuB,EACjC,GAAG,EAAE,GAAG,IACR;QACF,oBAAC,SAAS,IACR,EAAE,EAAC,OAAO,EACV,OAAO,EAAE,UAAU,CAAC,EAAE,EACtB,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,uBAAuB,IAEhC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CACjB,8BAAM,SAAS,EAAC,SAAS,IAAE,KAAK,CAAC,QAAQ,CAAQ,CAClD,CAAC,CAAC,CAAC,CACF,KAAK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,aAAa;YACb,WAAW;SACZ,CAAC,EACE,UAAU,IACd,SAAS,EAAC,uBAAuB,EACjC,GAAG,EAAE,GAAG,IACR;QACF,oBAAC,SAAS,IACR,EAAE,EAAC,OAAO,EACV,OAAO,EAAE,UAAU,CAAC,EAAE,EACtB,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,uBAAuB,IAEhC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CACjB,8BAAM,SAAS,EAAC,SAAS,IAAE,KAAK,CAAC,QAAQ,CAAQ,CAClD,CAAC,CAAC,CAAC,CACF,KAAK,CAAC,QAAQ,CACf,CACS;QACX,KAAK,CAAC,WAAW,IAAI,CACpB,oBAAC,SAAS,IACR,EAAE,EAAC,KAAK,EACR,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAC,6BAA6B,IAEtC,KAAK,CAAC,WAAW,CACR,CACb;QACD,6BAAK,EAAE,EAAE,OAAO,mBAAgB,oBAAoB,eAAW,QAAQ,IACpE,YAAY,IAAI,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAC,KAAK,CAAgB,CACnE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -18,7 +18,7 @@ const Radio = forwardRef((props, ref) => {
18
18
  "description",
19
19
  ]), inputProps, { className: "navds-radio__input", ref: ref })),
20
20
  React.createElement(BodyShort, { as: "label", htmlFor: inputProps.id, size: size, className: "navds-radio__label" }, props.children),
21
- props.description && (React.createElement(BodyShort, { size: size, id: inputDescriptionId, className: "navds-radio__description" }, props.description)),
21
+ props.description && (React.createElement(BodyShort, { as: "div", size: size, id: inputDescriptionId, className: "navds-radio__description" }, props.description)),
22
22
  React.createElement("div", { id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && React.createElement(ErrorMessage, { size: size }, props.error))));
23
23
  });
24
24
  export default Radio;
@@ -1 +1 @@
1
- {"version":3,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AAI,EACV,SAAS,EAAC,oBAAoB,IAE7B,KAAK,CAAC,QAAQ,CACL;QACX,KAAK,CAAC,WAAW,IAAI,CACpB,oBAAC,SAAS,IACR,EAAE,EAAC,KAAK,EACR,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAC,0BAA0B,IAEnC,KAAK,CAAC,WAAW,CACR,CACb;QACD,6BAAK,EAAE,EAAE,OAAO,mBAAgB,oBAAoB,eAAW,QAAQ,IACpE,YAAY,IAAI,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAC,KAAK,CAAgB,CACnE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
@@ -5,6 +5,7 @@ import { RadioProps } from "./Radio";
5
5
  export declare const useRadio: (props: RadioProps) => {
6
6
  inputProps: {
7
7
  name: string | undefined;
8
+ defaultChecked: boolean | undefined;
8
9
  checked: boolean | undefined;
9
10
  onChange: (e: any) => void;
10
11
  required: boolean | undefined;
@@ -16,18 +16,19 @@ import { RadioGroupContext } from "./RadioGroup";
16
16
  * Handles props for Radios in context with Fieldset and RadioGroup
17
17
  */
18
18
  export const useRadio = (props) => {
19
- var _a;
20
19
  const radioGroup = useContext(RadioGroupContext);
21
- const _b = useFormField(props, "radio"), { inputProps } = _b, rest = __rest(_b, ["inputProps"]);
20
+ const _a = useFormField(props, "radio"), { inputProps } = _a, rest = __rest(_a, ["inputProps"]);
22
21
  if (!radioGroup) {
23
22
  console.warn("<Radio> must be used inside <RadioGroup>.");
24
23
  }
25
24
  if ((props === null || props === void 0 ? void 0 : props.required) !== undefined) {
26
25
  console.warn("required is only supported on <RadioGroup>.");
27
26
  }
28
- return Object.assign(Object.assign({}, rest), { inputProps: Object.assign(Object.assign({}, inputProps), { name: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.name, checked: ((_a = radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) !== null && _a !== void 0 ? _a : radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === props.value
29
- ? true
30
- : undefined, onChange: (e) => {
27
+ return Object.assign(Object.assign({}, rest), { inputProps: Object.assign(Object.assign({}, inputProps), { name: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.name, defaultChecked: (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === undefined
28
+ ? undefined
29
+ : (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === props.value, checked: (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) === undefined
30
+ ? undefined
31
+ : (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) === props.value, onChange: (e) => {
31
32
  props.onChange && props.onChange(e);
32
33
  (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.onChange) && radioGroup.onChange(props.value);
33
34
  }, required: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.required, type: "radio" }) });
@@ -1 +1 @@
1
- {"version":3,"file":"useRadio.js","sourceRoot":"","sources":["../../../src/form/radio/useRadio.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAiB,EAAE,EAAE;;IAC5C,MAAM,UAAU,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAEjD,MAAM,KAA0B,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,EAAtD,EAAE,UAAU,OAA0C,EAArC,IAAI,cAArB,cAAuB,CAA+B,CAAC;IAE7D,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;KAC3D;IAED,IAAI,CAAA,KAAK,aAAL,KAAK,u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AI,cAArB,cAAuB,CAA+B,CAAC;IAE7D,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;KAC3D;IAED,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,MAAK,SAAS,EAAE;QACjC,OAAO,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;KAC7D;IAED,uCACK,IAAI,KACP,UAAU,kCACL,UAAU,KACb,IAAI,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,EACtB,cAAc,EACZ,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,YAAY,MAAK,SAAS;gBACpC,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,YAAY,MAAK,KAAK,CAAC,KAAK,EAC9C,OAAO,EACL,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,MAAK,SAAS;gBAC7B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,MAAK,KAAK,CAAC,KAAK,EACvC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACpC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,KAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3D,CAAC,EACD,QAAQ,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,EAC9B,IAAI,EAAE,OAAO,OAEf;AACJ,CAAC,CAAC"}
@@ -25,7 +25,7 @@ const SearchField = forwardRef((props, ref) => {
25
25
  React.createElement(Label, { htmlFor: inputProps.id, size: size, as: "label", className: cl("navds-text-field__label", {
26
26
  "sr-only": hideLabel,
27
27
  }) }, label),
28
- !!description && (React.createElement(BodyShort, { className: cl("navds-text-field__description", {
28
+ !!description && (React.createElement(BodyShort, { as: "div", className: cl("navds-text-field__description", {
29
29
  "sr-only": hideLabel,
30
30
  }), id: inputDescriptionId, size: size }, description)),
31
31
  React.createElement("div", { className: "navds-search-field__input-wrapper" },
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.js","sourceRoot":"","sources":["../../../src/form/search-field/SearchField.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAkB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,iBAA4C,MAAM,qBAAqB,CAAC;AAC/E,OAAO,sBAEN,MAAM,0BAA0B,CAAC;AAClC,OAAO,gBAA0C,MAAM,oBAAoB,CAAC;AAY5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CACnD,IAAI,CACL,CAAC;AA4BF,MAAM,WAAW,GAAG,UAAU,CAC5B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EACJ,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,kBAAkB,GACnB,GAAG,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAEvC,MAAM,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,KAEH,KAAK,EADJ,IAAI,UACL,KAAK,EARH,uEAQL,CAAQ,CAAC;IAEV,OAAO,CACL,2CACE,GAAG,EAAE,GAAG,IACJ,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,IAC9D,SAAS,EAAE,EAAE,CACX,SAAS,EACT,kBAAkB,EAClB,qBAAqB,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,QAAQ,EAAE,EACvC,oBAAoB,EACpB,EAAE,2BAA2B,EAAE,QAAQ,EAAE,CAC1C;QAED,oBAAC,KAAK,IACJ,OAAO,EAAE,UAAU,CAAC,EAAE,EACtB,IAAI,EAAE,IAAI,EACV,EAAE,EAAC,OAAO,EACV,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE;gBACvC,SAAS,EAAE,SAAS;aACrB,CAAC,IAED,KAAK,CACA;QACP,CAAC,CAAC,WAAW,IAAI,CAChB,oBAAC,SAAS,IACR,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE;gBAC7C,SAAS,EAAE,SAAS;aACrB,CAAC,EACF,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,IAAI,IAET,WAAW,CACF,CACb;QACD,6BAAK,SAAS,EAAC,mCAAmC;YAChD,oBAAC,kBAAkB,CAAC,QAAQ,IAC1B,KAAK,EAAE;oBACL,UAAU;oBACV,IAAI;iBACL,IAEA,QAAQ,CACmB,CAC1B;QACN,6BAAK,EAAE,EAAE,OAAO,mBAAgB,oBAAoB,eAAW,QAAQ,IACpE,YAAY,IAAI,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAgB,CAC7D,CACF,CACP,CAAC;AACJ,CAAC,CACsB,CAAC;AAE1B,WAAW,CAAC,MAAM,GAAG,iBAAiB,CAAC;AACvC,WAAW,CAAC,KAAK,GAAG,sBAAsB,CAAC;AAC3C,WAAW,CAAC,KAAK,GAAG,gBAAgB,CAAC;AAErC,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"SearchField.js","sourceRoot":"","sources":["../../../src/form/search-field/SearchField.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,YAAY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AE,CAAC,yBAAyB,EAAE;gBACvC,SAAS,EAAE,SAAS;aACrB,CAAC,IAED,KAAK,CACA;QACP,CAAC,CAAC,WAAW,IAAI,CAChB,oBAAC,SAAS,IACR,EAAE,EAAC,KAAK,EACR,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE;gBAC7C,SAAS,EAAE,SAAS;aACrB,CAAC,EACF,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,IAAI,IAET,WAAW,CACF,CACb;QACD,6BAAK,SAAS,EAAC,mCAAmC;YAChD,oBAAC,kBAAkB,CAAC,QAAQ,IAC1B,KAAK,EAAE;oBACL,UAAU;oBACV,IAAI;iBACL,IAEA,QAAQ,CACmB,CAC1B;QACN,6BAAK,EAAE,EAAE,OAAO,mBAAgB,oBAAoB,eAAW,QAAQ,IACpE,YAAY,IAAI,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,IAAG,KAAK,CAAgB,CAC7D,CACF,CACP,CAAC;AACJ,CAAC,CACsB,CAAC;AAE1B,WAAW,CAAC,MAAM,GAAG,iBAAiB,CAAC;AACvC,WAAW,CAAC,KAAK,GAAG,sBAAsB,CAAC;AAC3C,WAAW,CAAC,KAAK,GAAG,gBAAgB,CAAC;AAErC,eAAe,WAAW,CAAC"}
@@ -18,5 +18,5 @@ export interface LoaderProps extends SVGProps<SVGSVGElement> {
18
18
  */
19
19
  variant?: "neutral" | "interaction" | "inverted";
20
20
  }
21
- declare const Loader: React.ForwardRefExoticComponent<Pick<LoaderProps, "string" | "filter" | "values" | "fill" | "max" | "type" | "transparent" | "accumulate" | "offset" | "key" | "id" | "media" | "origin" | "height" | "width" | "end" | "name" | "alignmentBaseline" | "baselineShift" | "clip" | "clipPath" | "clipRule" | "color" | "colorInterpolation" | "colorInterpolationFilters" | "cursor" | "direction" | "display" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "opacity" | "order" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textDecoration" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "alphabetic" | "hanging" | "ideographic" | "style" | "title" | "path" | "method" | "target" | "lang" | "className" | "children" | "tabIndex" | "size" | "orientation" | "local" | "x" | "y" | "mathematical" | "azimuth" | "colorRendering" | "glyphOrientationVertical" | "vectorEffect" | "additive" | "crossOrigin" | "href" | "min" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accentHeight" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "variant"> & React.RefAttributes<SVGSVGElement>>;
21
+ declare const Loader: React.ForwardRefExoticComponent<Pick<LoaderProps, "string" | "filter" | "values" | "fill" | "max" | "type" | "transparent" | "accumulate" | "offset" | "key" | "id" | "media" | "origin" | "height" | "width" | "end" | "name" | "alignmentBaseline" | "baselineShift" | "clip" | "clipPath" | "clipRule" | "color" | "colorInterpolation" | "colorInterpolationFilters" | "cursor" | "direction" | "display" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "opacity" | "order" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textDecoration" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "alphabetic" | "hanging" | "ideographic" | "style" | "title" | "path" | "method" | "target" | "lang" | "className" | "children" | "tabIndex" | "size" | "orientation" | "local" | "x" | "y" | "mathematical" | "azimuth" | "colorRendering" | "glyphOrientationVertical" | "vectorEffect" | "additive" | "crossOrigin" | "href" | "min" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accentHeight" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "variant"> & React.RefAttributes<SVGSVGElement>>;
22
22
  export default Loader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "0.12.2",
3
+ "version": "0.13.2",
4
4
  "private": false,
5
5
  "description": "NAV designsystem react components",
6
6
  "author": "NAV Designsystem team",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@material-ui/core": "^4.12.3",
38
- "@navikt/ds-icons": "^0.6.2",
38
+ "@navikt/ds-icons": "^0.6.3",
39
39
  "@popperjs/core": "^2.10.1",
40
40
  "classnames": "^2.2.6",
41
41
  "react-collapse": "^5.1.0",
@@ -63,5 +63,5 @@
63
63
  "peerDependencies": {
64
64
  "react": "^16.8.0 || ^17.0.0"
65
65
  },
66
- "gitHead": "8c4c73cc2e3a9c7c544f058dfc9ac165ecaa860d"
66
+ "gitHead": "2ad9183b0990bd4bc39fb2fd53525fefc276f0d3"
67
67
  }
@@ -103,6 +103,7 @@ const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(
103
103
  </Label>
104
104
  {!!description && (
105
105
  <BodyShort
106
+ as="div"
106
107
  className={cl("navds-fieldset__description", {
107
108
  "sr-only": !!hideLegend,
108
109
  })}
@@ -67,6 +67,7 @@ const Select = forwardRef<HTMLSelectElement, SelectProps>((props, ref) => {
67
67
  </Label>
68
68
  {!!description && (
69
69
  <BodyShort
70
+ as="div"
70
71
  className={cl("navds-select__description", {
71
72
  "sr-only": hideLabel,
72
73
  })}
@@ -66,6 +66,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>((props, ref) => {
66
66
 
67
67
  {!!description && (
68
68
  <BodyShort
69
+ as="div"
69
70
  className={cl("navds-text-field__description", {
70
71
  "sr-only": hideLabel,
71
72
  })}
@@ -81,6 +81,7 @@ const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
81
81
  </Label>
82
82
  {!!description && (
83
83
  <BodyShort
84
+ as="div"
84
85
  className={cl("navds-textarea__description", {
85
86
  "sr-only": hideLabel,
86
87
  })}
@@ -29,10 +29,7 @@ test("checkbox group chains onChange calls", () => {
29
29
  });
30
30
 
31
31
  describe("Checkbox handles controlled-state correctly", () => {
32
- const CheckboxComponent = ({
33
- onChange = () => null,
34
- value,
35
- }) => (
32
+ const CheckboxComponent = ({ onChange = () => null, value }) => (
36
33
  <CheckboxGroup legend="legend" onChange={onChange} value={value}>
37
34
  <Checkbox value={"value1"}>label1</Checkbox>
38
35
  <Checkbox value={"value2"}>label2</Checkbox>
@@ -55,7 +52,12 @@ describe("Checkbox handles controlled-state correctly", () => {
55
52
  test("onChange called with expected values", () => {
56
53
  const onGroupChange = jest.fn();
57
54
 
58
- render(<CheckboxComponent onChange={onGroupChange} value={["value1", "value2"]} />);
55
+ render(
56
+ <CheckboxComponent
57
+ onChange={onGroupChange}
58
+ value={["value1", "value2"]}
59
+ />
60
+ );
59
61
 
60
62
  userEvent.click(screen.getByLabelText("label1"));
61
63
 
@@ -72,6 +72,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
72
72
  </BodyShort>
73
73
  {props.description && (
74
74
  <BodyShort
75
+ as="div"
75
76
  size={size}
76
77
  id={inputDescriptionId}
77
78
  className="navds-checkbox__description"
@@ -21,7 +21,7 @@ export const All = () => {
21
21
  description="Exercitation do labore"
22
22
  >
23
23
  <Checkbox value="Apple">Apple</Checkbox>
24
- <Checkbox value="Orange" description="Laborum ad">
24
+ <Checkbox value="Orange" description={<div>Laborum ad</div>}>
25
25
  Orange
26
26
  </Checkbox>
27
27
  <Checkbox value="Melon">Melon</Checkbox>
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import { render, screen } from "@testing-library/react";
3
+ import userEvent from "@testing-library/user-event";
4
+ import faker from "faker";
5
+ import { Radio, RadioGroup } from ".";
6
+
7
+ const value1 = faker.datatype.string();
8
+ const label1 = faker.datatype.string();
9
+ const value2 = faker.datatype.string();
10
+ const label2 = faker.datatype.string();
11
+
12
+ const Group = (props) => (
13
+ <RadioGroup {...props} legend="legend">
14
+ <Radio value={value1}>{label1}</Radio>
15
+ <Radio value={value2}>{label2}</Radio>
16
+ </RadioGroup>
17
+ );
18
+
19
+ describe("Controlled RadioGroup", () => {
20
+ const originalError = console.error;
21
+ const mockError = jest.fn();
22
+ beforeEach(() => (console.error = mockError));
23
+ afterEach(() => (console.error = originalError));
24
+
25
+ test("doesnt console.error", () => {
26
+ const { rerender } = render(<Group value={value1} />);
27
+ rerender(<Group value={value2} />);
28
+
29
+ expect(mockError).toHaveBeenCalledTimes(0);
30
+ });
31
+ });
32
+
33
+ describe("Uncontrolled RadioGroup", () => {
34
+ test("handles state correctly", () => {
35
+ render(<Group />);
36
+
37
+ const input1 = screen.getByLabelText(label1) as HTMLInputElement;
38
+ const input2 = screen.getByLabelText(label2) as HTMLInputElement;
39
+
40
+ expect(input1.checked).toBe(false);
41
+ expect(input2.checked).toBe(false);
42
+
43
+ userEvent.click(screen.getByLabelText(label2));
44
+
45
+ expect(input1.checked).toBe(false);
46
+ expect(input2.checked).toBe(true);
47
+ });
48
+
49
+ test("handles defaultValue correctly", () => {
50
+ render(<Group defaultValue={value1} />);
51
+
52
+ const input1 = screen.getByLabelText(label1) as HTMLInputElement;
53
+ const input2 = screen.getByLabelText(label2) as HTMLInputElement;
54
+
55
+ expect(input1.checked).toBe(true);
56
+ expect(input2.checked).toBe(false);
57
+
58
+ userEvent.click(screen.getByLabelText(label2));
59
+
60
+ expect(input1.checked).toBe(false);
61
+ expect(input2.checked).toBe(true);
62
+ });
63
+ });
@@ -55,6 +55,7 @@ const Radio = forwardRef<HTMLInputElement, RadioProps>((props, ref) => {
55
55
  </BodyShort>
56
56
  {props.description && (
57
57
  <BodyShort
58
+ as="div"
58
59
  size={size}
59
60
  id={inputDescriptionId}
60
61
  className="navds-radio__description"
@@ -16,9 +16,12 @@ export const All = () => {
16
16
  <Radio value="Melon">Melon</Radio>
17
17
  </RadioGroup>
18
18
  <h2>description</h2>
19
- <RadioGroup legend="Mollit eiusmod" description="Exercitation do labore">
19
+ <RadioGroup
20
+ legend="Mollit eiusmod"
21
+ description={<div>Exercitation do labore</div>}
22
+ >
20
23
  <Radio value="Apple">Apple</Radio>
21
- <Radio value="Orange" description="Laborum ad">
24
+ <Radio value="Orange" description={<div>Laborum ad</div>}>
22
25
  Orange
23
26
  </Radio>
24
27
  <Radio value="Melon">Melon</Radio>
@@ -24,10 +24,14 @@ export const useRadio = (props: RadioProps) => {
24
24
  inputProps: {
25
25
  ...inputProps,
26
26
  name: radioGroup?.name,
27
+ defaultChecked:
28
+ radioGroup?.defaultValue === undefined
29
+ ? undefined
30
+ : radioGroup?.defaultValue === props.value,
27
31
  checked:
28
- (radioGroup?.value ?? radioGroup?.defaultValue) === props.value
29
- ? true
30
- : undefined,
32
+ radioGroup?.value === undefined
33
+ ? undefined
34
+ : radioGroup?.value === props.value,
31
35
  onChange: (e) => {
32
36
  props.onChange && props.onChange(e);
33
37
  radioGroup?.onChange && radioGroup.onChange(props.value);
@@ -94,6 +94,7 @@ const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(
94
94
  </Label>
95
95
  {!!description && (
96
96
  <BodyShort
97
+ as="div"
97
98
  className={cl("navds-text-field__description", {
98
99
  "sr-only": hideLabel,
99
100
  })}
@@ -15,7 +15,7 @@ export const All = () => {
15
15
  <h1>SearchField</h1>
16
16
  <SearchField
17
17
  label="Mollit eiusmod"
18
- description="Ea cupidatat eu sunt commodo"
18
+ description={<div>Ea cupidatat eu sunt commodo</div>}
19
19
  >
20
20
  <SearchField.Input />
21
21
  <SearchField.Button>
@@ -21,9 +21,13 @@ export const All = () => {
21
21
 
22
22
  <Fieldset
23
23
  legend="Mollit eiusmod"
24
- description="Quis reprehenderit esse cillum"
24
+ description={<div>Quis reprehenderit esse cillum</div>}
25
25
  >
26
- <TextField label="Textfield label" hideLabel />
26
+ <TextField
27
+ label="Textfield label"
28
+ hideLabel
29
+ description={<div>Quis reprehenderit esse cillum</div>}
30
+ />
27
31
  <TextField label="Textfield label" hideLabel />
28
32
  </Fieldset>
29
33
 
@@ -19,7 +19,7 @@ export const All = () => {
19
19
 
20
20
  <h2>Description</h2>
21
21
 
22
- <Select label="Ipsum enim quis culpa" description="Aute enim">
22
+ <Select label="Ipsum enim quis culpa" description={<div>Aute enim</div>}>
23
23
  <option value="">Velg land</option>
24
24
  <option value="norge">Norge</option>
25
25
  <option value="sverige">Sverige</option>
@@ -15,7 +15,10 @@ export const All = () => {
15
15
 
16
16
  <h2>Description</h2>
17
17
 
18
- <TextField label="Laborum excepteur" description="Cillum mollit" />
18
+ <TextField
19
+ label="Laborum excepteur"
20
+ description={<div>Cillum mollit</div>}
21
+ />
19
22
 
20
23
  <h2>Passord-type</h2>
21
24
  <TextField label="Passord" type="password" />
@@ -23,7 +23,7 @@ export const All = () => {
23
23
 
24
24
  <Textarea
25
25
  label="In anim elit"
26
- description="Reprehenderit esse proident"
26
+ description={<div>Reprehenderit esse proident</div>}
27
27
  value={value}
28
28
  onChange={handleChange}
29
29
  />