@obosbbl/grunnmuren-react 2.0.3 → 2.0.4

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 (2) hide show
  1. package/dist/index.mjs +8 -8
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -449,7 +449,7 @@ function Checkbox(props) {
449
449
  const id = useId();
450
450
  const descriptionId = `desc${id}`;
451
451
  const errorMessageId = `error${id}`;
452
- const isInvalid = errorMessage != null || _isInvalid;
452
+ const isInvalid = !!errorMessage || _isInvalid;
453
453
  return /*#__PURE__*/ jsx("div", {
454
454
  children: /*#__PURE__*/ jsxs(CheckboxContext.Provider, {
455
455
  value: {
@@ -516,7 +516,7 @@ function CheckboxGroup(props) {
516
516
  const { children, className, description, errorMessage, label, isRequired, isInvalid: _isInvalid, ...restProps } = props;
517
517
  // the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
518
518
  // which will override any built in validation
519
- const isInvalid = errorMessage != null || _isInvalid;
519
+ const isInvalid = !!errorMessage || _isInvalid;
520
520
  return /*#__PURE__*/ jsxs(CheckboxGroup$1, {
521
521
  ...restProps,
522
522
  className: cx(className, 'flex flex-col gap-2'),
@@ -589,7 +589,7 @@ function Combobox(props) {
589
589
  const isPending = _isPending || isLoading;
590
590
  // the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
591
591
  // which will override any built in validation
592
- const isInvalid = errorMessage != null || _isInvalid;
592
+ const isInvalid = !!errorMessage || _isInvalid;
593
593
  return /*#__PURE__*/ jsxs(ComboBox, {
594
594
  ...restProps,
595
595
  className: cx(className, formField),
@@ -642,7 +642,7 @@ function RadioGroup(props) {
642
642
  const { children, className, description, errorMessage, label, isRequired, isInvalid: _isInvalid, ...restProps } = props;
643
643
  // the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
644
644
  // which will override any built in validation
645
- const isInvalid = errorMessage != null || _isInvalid;
645
+ const isInvalid = !!errorMessage || _isInvalid;
646
646
  return /*#__PURE__*/ jsxs(RadioGroup$1, {
647
647
  ...restProps,
648
648
  className: cx(className, 'flex flex-col gap-2'),
@@ -703,7 +703,7 @@ function Select(props) {
703
703
  const { className, children, description, errorMessage, label, isInvalid: _isInvalid, ref, ...restProps } = props;
704
704
  // the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
705
705
  // which will override any built in validation
706
- const isInvalid = errorMessage != null || _isInvalid;
706
+ const isInvalid = !!errorMessage || _isInvalid;
707
707
  return /*#__PURE__*/ jsxs(Select$1, {
708
708
  ...restProps,
709
709
  className: cx(className, formField),
@@ -747,7 +747,7 @@ function Select(props) {
747
747
 
748
748
  function TextArea(props) {
749
749
  const { className, description, errorMessage, label, isInvalid: _isInvalid, rows, ref, ...restProps } = props;
750
- const isInvalid = errorMessage != null || _isInvalid;
750
+ const isInvalid = !!errorMessage || _isInvalid;
751
751
  return /*#__PURE__*/ jsxs(TextField$1, {
752
752
  ...restProps,
753
753
  className: cx(className, formField),
@@ -788,7 +788,7 @@ function TextField(props) {
788
788
  const { className, description, errorMessage, label, leftAddon, isInvalid: _isInvalid, textAlign, rightAddon, withAddonDivider, size, ref, ...restProps } = props;
789
789
  // the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
790
790
  // which will override any built in validation
791
- const isInvalid = errorMessage != null || _isInvalid;
791
+ const isInvalid = !!errorMessage || _isInvalid;
792
792
  return /*#__PURE__*/ jsxs(TextField$1, {
793
793
  ...restProps,
794
794
  className: cx(className, formField),
@@ -852,7 +852,7 @@ function NumberField(props) {
852
852
  const { className, description, errorMessage, label, leftAddon, isInvalid: _isInvalid, textAlign, rightAddon, withAddonDivider, size, ref, ...restProps } = props;
853
853
  // the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
854
854
  // which will override any built in validation
855
- const isInvalid = errorMessage != null || _isInvalid;
855
+ const isInvalid = !!errorMessage || _isInvalid;
856
856
  return /*#__PURE__*/ jsxs(NumberField$1, {
857
857
  ...restProps,
858
858
  className: cx(className, formField),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Grunnmuren components in React",
5
5
  "repository": {
6
6
  "url": "https://github.com/code-obos/grunnmuren"
@@ -18,7 +18,7 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@obosbbl/grunnmuren-icons-react": "^2.0.0",
21
+ "@obosbbl/grunnmuren-icons-react": "^2.1.0",
22
22
  "@react-aria/form": "^3.0.14",
23
23
  "@react-aria/interactions": "^3.24.1",
24
24
  "@react-aria/utils": "^3.28.1",