@saas-ui/forms 2.6.3 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -513,6 +513,7 @@ var useBaseField = (props) => {
513
513
  const [fieldProps] = splitProps(props, ["name", "label", "help", "hideLabel"]);
514
514
  const [controlProps] = splitProps(props, [
515
515
  "id",
516
+ "direction",
516
517
  "isDisabled",
517
518
  "isInvalid",
518
519
  "isReadOnly",
@@ -531,14 +532,23 @@ var useBaseField = (props) => {
531
532
  var BaseField = (props) => {
532
533
  const { controlProps, label, help, hideLabel, error } = useBaseField(props);
533
534
  const isInvalid = !!error || controlProps.isInvalid;
534
- return /* @__PURE__ */ jsxs5(FormControl2, { ...controlProps, isInvalid, children: [
535
- label && !hideLabel ? /* @__PURE__ */ jsx10(FormLabel2, { children: label }) : null,
536
- /* @__PURE__ */ jsxs5(Box, { children: [
537
- props.children,
538
- help && !(error == null ? void 0 : error.message) ? /* @__PURE__ */ jsx10(FormHelperText, { children: help }) : null,
539
- (error == null ? void 0 : error.message) && /* @__PURE__ */ jsx10(FormErrorMessage, { children: error == null ? void 0 : error.message })
540
- ] })
541
- ] });
535
+ const { direction, ...rest } = controlProps;
536
+ return /* @__PURE__ */ jsxs5(
537
+ FormControl2,
538
+ {
539
+ ...rest,
540
+ isInvalid,
541
+ variant: direction === "row" ? "horizontal" : void 0,
542
+ children: [
543
+ label && !hideLabel ? /* @__PURE__ */ jsx10(FormLabel2, { children: label }) : null,
544
+ /* @__PURE__ */ jsxs5(Box, { children: [
545
+ props.children,
546
+ help && !(error == null ? void 0 : error.message) ? /* @__PURE__ */ jsx10(FormHelperText, { children: help }) : null,
547
+ (error == null ? void 0 : error.message) && /* @__PURE__ */ jsx10(FormErrorMessage, { children: error == null ? void 0 : error.message })
548
+ ] })
549
+ ]
550
+ }
551
+ );
542
552
  };
543
553
  BaseField.displayName = "BaseField";
544
554