@obosbbl/grunnmuren-react 2.0.2 → 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.
- package/dist/index.mjs +9 -9
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -154,7 +154,7 @@ function AccordionItem(props) {
|
|
|
154
154
|
className: // Uses pseudo element for vertical padding, since that doesn't affect the height when the accordion is closed
|
|
155
155
|
'text-sm font-light leading-6 px-3.5 relative overflow-hidden border-mint border-l-[3px] before:relative before:block before:h-1.5 after:relative after:block after:h-1.5',
|
|
156
156
|
role: 'region',
|
|
157
|
-
inert: isOpen,
|
|
157
|
+
inert: !isOpen,
|
|
158
158
|
'aria-labelledby': buttonId,
|
|
159
159
|
_outerWrapper: (children)=>/*#__PURE__*/ jsx("div", {
|
|
160
160
|
className: cx('grid transition-all duration-300 after:relative after:block after:h-0 after:transition-all after:duration-300 motion-reduce:transition-none', isOpen ? 'grid-rows-[1fr] after:h-3.5' : 'grid-rows-[0fr]'),
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
+
"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.
|
|
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",
|