@obosbbl/grunnmuren-react 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -603,7 +603,7 @@ const Checkbox = forwardRef((props, ref) => {
603
603
  } = useFormControlValidity(ownRef, !disableValidation);
604
604
  const id = useFallbackId(idProp);
605
605
  const errorMsgId = id + "err";
606
- const errorMsg = error != null ? error : validationMessage;
606
+ const errorMsg = error || validationMessage;
607
607
  return /* @__PURE__ */ jsxs("div", {
608
608
  className: "grid gap-2",
609
609
  children: [/* @__PURE__ */ jsxs("label", {
@@ -617,12 +617,10 @@ const Checkbox = forwardRef((props, ref) => {
617
617
  ref,
618
618
  type: "checkbox"
619
619
  }, rest), {
620
- "aria-describedby": cx({
621
- [errorMsgId]: !!error
622
- }),
620
+ "aria-describedby": errorMsg ? errorMsgId : void 0,
623
621
  "aria-invalid": !!error || validity === "invalid"
624
622
  })), children]
625
- }), !!errorMsg && /* @__PURE__ */ jsx(FormErrorMessage, {
623
+ }), errorMsg && /* @__PURE__ */ jsx(FormErrorMessage, {
626
624
  id: errorMsgId,
627
625
  children: errorMsg
628
626
  })]
@@ -1352,7 +1350,7 @@ const TextArea = forwardRef((props, ref) => {
1352
1350
  const id = useFallbackId(idProp);
1353
1351
  const helpTextId = id + "help";
1354
1352
  const errorMsgId = id + "err";
1355
- const errorMsg = error != null ? error : validationMessage;
1353
+ const errorMsg = error || validationMessage;
1356
1354
  return /* @__PURE__ */ jsxs("div", {
1357
1355
  className: "grid gap-2",
1358
1356
  children: [/* @__PURE__ */ jsx(FormLabel, {
@@ -1370,9 +1368,9 @@ const TextArea = forwardRef((props, ref) => {
1370
1368
  }, rest), {
1371
1369
  isInvalid: !!error || validity === "invalid",
1372
1370
  "aria-describedby": cx({
1373
- [errorMsgId]: !!error,
1371
+ [errorMsgId]: errorMsg,
1374
1372
  [helpTextId]: description
1375
- })
1373
+ }) || void 0
1376
1374
  })), errorMsg && /* @__PURE__ */ jsx(FormErrorMessage, {
1377
1375
  id: errorMsgId,
1378
1376
  children: errorMsg
@@ -1403,7 +1401,7 @@ const TextField = forwardRef((props, ref) => {
1403
1401
  const id = useFallbackId(idProp);
1404
1402
  const helpTextId = id + "help";
1405
1403
  const errorMsgId = id + "err";
1406
- const errorMsg = error != null ? error : validationMessage;
1404
+ const errorMsg = error || validationMessage;
1407
1405
  return /* @__PURE__ */ jsxs("div", {
1408
1406
  className: "grid gap-2",
1409
1407
  children: [/* @__PURE__ */ jsx(FormLabel, {
@@ -1421,9 +1419,9 @@ const TextField = forwardRef((props, ref) => {
1421
1419
  }, rest), {
1422
1420
  isInvalid: !!error || validity === "invalid",
1423
1421
  "aria-describedby": cx({
1424
- [errorMsgId]: !!error,
1422
+ [errorMsgId]: errorMsg,
1425
1423
  [helpTextId]: description
1426
- })
1424
+ }) || void 0
1427
1425
  })), errorMsg && /* @__PURE__ */ jsx(FormErrorMessage, {
1428
1426
  id: errorMsgId,
1429
1427
  children: errorMsg
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "OBOS Grunnmuren design system React components",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "types": "./dist/index.d.ts",
19
19
  "devDependencies": {
20
- "@babel/core": "7.19.3",
20
+ "@babel/core": "7.19.6",
21
21
  "@obosbbl/grunnmuren-tailwind": "0.7.3",
22
22
  "@storybook/addon-controls": "6.5.12",
23
23
  "@storybook/addon-docs": "6.5.12",