diff --git a/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx b/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx
index 06f25131db..97d0ef2bf1 100644
--- a/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx
+++ b/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx
@@ -2,7 +2,7 @@ import getClassNameFactory from "../../../../lib/get-class-name-factory";
import inputStyles from "../../styles.module.css";
import styles from "./styles.module.css";
import { List, Plus, Trash } from "react-feather";
-import { InputOrGroup, type InputProps } from "../..";
+import { FieldLabelInternal, InputOrGroup, type InputProps } from "../..";
import { IconButton } from "../../../IconButton";
import { reorder, replace } from "../../../../lib";
import DroppableStrictMode from "../../../DroppableStrictMode";
@@ -69,13 +69,12 @@ export const ArrayField = ({
}
return (
-
-
-
-
-
-
- {field.label || name}
-
+
}
+ label={field.label || name}
+ readOnly={readOnly}
+ el="div"
+ >
+
+ {field.options.map((option) => (
+
+ ))}
-
+
);
};
diff --git a/packages/core/components/InputOrGroup/fields/SelectField/index.tsx b/packages/core/components/InputOrGroup/fields/SelectField/index.tsx
index d4a0c52c4f..6010453121 100644
--- a/packages/core/components/InputOrGroup/fields/SelectField/index.tsx
+++ b/packages/core/components/InputOrGroup/fields/SelectField/index.tsx
@@ -1,7 +1,7 @@
import getClassNameFactory from "../../../../lib/get-class-name-factory";
import styles from "../../styles.module.css";
import { ChevronDown } from "react-feather";
-import type { InputProps } from "../..";
+import { FieldLabelInternal, type InputProps } from "../..";
const getClassName = getClassNameFactory("Input", styles);
@@ -18,13 +18,11 @@ export const SelectField = ({
}
return (
-
-
-
-
-
- {label || name}
-
+ }
+ readOnly={readOnly}
+ >
))}
-
+
);
};
diff --git a/packages/core/components/InputOrGroup/fields/TextareaField/index.tsx b/packages/core/components/InputOrGroup/fields/TextareaField/index.tsx
index 8fae006c7d..94d2193b30 100644
--- a/packages/core/components/InputOrGroup/fields/TextareaField/index.tsx
+++ b/packages/core/components/InputOrGroup/fields/TextareaField/index.tsx
@@ -1,7 +1,7 @@
import getClassNameFactory from "../../../../lib/get-class-name-factory";
import styles from "../../styles.module.css";
import { Type } from "react-feather";
-import type { InputProps } from "../..";
+import { FieldLabelInternal, type InputProps } from "../..";
const getClassName = getClassNameFactory("Input", styles);
@@ -13,13 +13,11 @@ export const TextareaField = ({
label,
}: InputProps) => {
return (
-
-
-
-
-
- {label || name}
-
+ }
+ readOnly={readOnly}
+ >
-
+
);
};
diff --git a/packages/core/components/InputOrGroup/index.tsx b/packages/core/components/InputOrGroup/index.tsx
index 2ec4ec16ed..b267ee137a 100644
--- a/packages/core/components/InputOrGroup/index.tsx
+++ b/packages/core/components/InputOrGroup/index.tsx
@@ -18,19 +18,53 @@ export const FieldLabel = ({
children,
icon,
label,
+ el = "label",
+ readOnly,
+ className,
}: {
children?: ReactNode;
icon?: ReactNode;
label: string;
+ el?: "label" | "div";
+ readOnly?: boolean;
+ className?: string;
}) => {
+ const El = el;
return (
-
+
{icon ?
{icon}
: <>>}
{label}
{children}
-
+
+ );
+};
+
+export const FieldLabelInternal = ({
+ children,
+ icon,
+ label,
+ el = "label",
+ readOnly,
+}: {
+ children?: ReactNode;
+ icon?: ReactNode;
+ label: string;
+ el?: "label" | "div";
+ readOnly?: boolean;
+}) => {
+ const El = el;
+ return (
+
+ {children}
+
);
};
diff --git a/packages/core/components/InputOrGroup/styles.module.css b/packages/core/components/InputOrGroup/styles.module.css
index 5a073894e4..93e3faab22 100644
--- a/packages/core/components/InputOrGroup/styles.module.css
+++ b/packages/core/components/InputOrGroup/styles.module.css
@@ -57,8 +57,8 @@
background-color: white;
}
-.Input--readOnly .Input-input,
-.Input--readOnly select.Input-input {
+.Input--readOnly > .Input-input,
+.Input--readOnly > select.Input-input {
background-color: var(--puck-color-grey-11);
border-color: var(--puck-color-grey-8);
color: var(--puck-color-grey-5);