@apteva/apteva-kit 0.1.60 → 0.1.62

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.js CHANGED
@@ -940,14 +940,7 @@ function Form({ widget, onAction }) {
940
940
  }
941
941
  };
942
942
  const renderField = (field) => {
943
- const baseInputClass = cn(
944
- "w-full px-3 py-2 rounded-lg border transition-colors",
945
- "border-neutral-300 dark:border-neutral-600",
946
- "bg-white dark:bg-neutral-800",
947
- "text-neutral-900 dark:text-neutral-100",
948
- "placeholder-neutral-400 dark:placeholder-neutral-500",
949
- "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
950
- );
943
+ const baseInputClass = "w-full px-3 py-2 rounded-lg border transition-colors border-neutral-200 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-800 !text-neutral-900 dark:!text-neutral-100 placeholder-neutral-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
951
944
  switch (field.type) {
952
945
  case "text":
953
946
  case "password":
@@ -1005,27 +998,29 @@ function Form({ widget, onAction }) {
1005
998
  className: "w-4 h-4 rounded border-neutral-300 dark:border-neutral-600 text-blue-500 focus:ring-blue-500"
1006
999
  }
1007
1000
  ),
1008
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-neutral-700 dark:text-neutral-300", children: field.label })
1001
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "!text-neutral-700 dark:!text-neutral-300", children: field.label })
1009
1002
  ] });
1010
1003
  default:
1011
1004
  return null;
1012
1005
  }
1013
1006
  };
1014
1007
  const submitAction = _optionalChain([widget, 'access', _23 => _23.actions, 'optionalAccess', _24 => _24.find, 'call', _25 => _25((a) => a.type === "submit")]) || _optionalChain([widget, 'access', _26 => _26.actions, 'optionalAccess', _27 => _27[0]]);
1015
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "apteva-form rounded-lg border border-neutral-200 dark:border-neutral-700 p-4 bg-white dark:bg-neutral-800", children: [
1016
- title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-base font-semibold text-neutral-900 dark:text-neutral-100 mb-4", children: title }),
1017
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: fields.map((field) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: field.type === "checkbox" ? "" : "space-y-1", children: [
1018
- field.type !== "checkbox" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "block text-sm font-medium text-neutral-700 dark:text-neutral-300", children: [
1019
- field.label,
1020
- field.required && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-red-500 ml-1", children: "*" })
1021
- ] }),
1022
- renderField(field)
1023
- ] }, field.name)) }),
1024
- submitAction && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1008
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "border border-neutral-200 dark:border-neutral-700 rounded-xl bg-white dark:bg-neutral-900 overflow-hidden", children: [
1009
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-4", children: [
1010
+ title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "!text-lg font-semibold !text-neutral-900 dark:!text-white mb-4", children: title }),
1011
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-3", children: fields.map((field) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: field.type === "checkbox" ? "" : "space-y-1", children: [
1012
+ field.type !== "checkbox" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "block !text-sm font-medium !text-neutral-600 dark:!text-neutral-400", children: [
1013
+ field.label,
1014
+ field.required && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-red-500 ml-1", children: "*" })
1015
+ ] }),
1016
+ renderField(field)
1017
+ ] }, field.name)) })
1018
+ ] }),
1019
+ submitAction && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-4 pb-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1025
1020
  "button",
1026
1021
  {
1027
1022
  type: "submit",
1028
- className: "px-4 py-2 rounded-lg font-medium transition-colors bg-blue-500 text-white hover:bg-blue-600",
1023
+ className: "px-3 py-1.5 !text-sm rounded-lg font-medium transition-colors bg-blue-500 !text-white hover:bg-blue-600",
1029
1024
  children: submitAction.label || "Submit"
1030
1025
  }
1031
1026
  ) })