@rachelallyson/hero-hook-form 2.1.0 → 2.1.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.1.1] - 2025-01-28
6
+
7
+ ### Fixed
8
+
9
+ - **ServerActionForm imports**: Use `#ui` alias for HeroUI imports to support both `@heroui/react` and individual package imports
10
+ - Ensures compatibility across different HeroUI installation patterns
11
+
5
12
  ## [2.1.0] - 2025-01-28
6
13
 
7
14
  ### Added
package/dist/index.d.ts CHANGED
@@ -12,9 +12,9 @@ import { Input, Textarea } from '@heroui/input';
12
12
  import { RadioGroup } from '@heroui/radio';
13
13
  import { Select } from '@heroui/select';
14
14
  import { Switch } from '@heroui/switch';
15
+ import { Button as Button$1 } from '@heroui/button';
15
16
  import { DateInput } from '@heroui/date-input';
16
17
  import { Slider } from '@heroui/slider';
17
- import { Button as Button$1 } from '@heroui/button';
18
18
 
19
19
  interface FieldBaseProps<TFieldValues extends FieldValues, TValue> {
20
20
  name: Path<TFieldValues>;
@@ -271,7 +271,7 @@ interface ServerActionFormProps<T extends FieldValues> {
271
271
  resetButtonText?: string;
272
272
  showResetButton?: boolean;
273
273
  spacing?: "2" | "4" | "6" | "8" | "lg";
274
- submitButtonProps?: Partial<React$1.ComponentProps<typeof Button>>;
274
+ submitButtonProps?: Partial<React$1.ComponentProps<typeof Button$1>>;
275
275
  submitButtonText?: string;
276
276
  subtitle?: string;
277
277
  title?: string;
package/dist/index.js CHANGED
@@ -1238,14 +1238,6 @@ function ConfigurableForm({
1238
1238
 
1239
1239
  // src/components/ServerActionForm.tsx
1240
1240
  import React17 from "react";
1241
- import {
1242
- Button as Button4,
1243
- Checkbox as Checkbox2,
1244
- Input as Input2,
1245
- Select as Select2,
1246
- SelectItem as SelectItem2,
1247
- Textarea as Textarea2
1248
- } from "@heroui/react";
1249
1241
  import { useActionState } from "react";
1250
1242
  function ServerActionForm({
1251
1243
  action,
@@ -1393,7 +1385,7 @@ function ServerActionForm({
1393
1385
  ),
1394
1386
  renderFields(),
1395
1387
  /* @__PURE__ */ React17.createElement("div", { className: "mt-6 flex gap-3 justify-end" }, /* @__PURE__ */ React17.createElement(
1396
- Button4,
1388
+ Button,
1397
1389
  {
1398
1390
  color: "primary",
1399
1391
  isDisabled: pending,
@@ -1403,7 +1395,7 @@ function ServerActionForm({
1403
1395
  },
1404
1396
  submitButtonText
1405
1397
  ), showResetButton && /* @__PURE__ */ React17.createElement(
1406
- Button4,
1398
+ Button,
1407
1399
  {
1408
1400
  isDisabled: pending,
1409
1401
  type: "button",
@@ -1478,7 +1470,7 @@ function ServerActionField({
1478
1470
  case "input": {
1479
1471
  const inputType = field2.inputProps?.type || "text";
1480
1472
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1481
- Input2,
1473
+ Input,
1482
1474
  {
1483
1475
  ...field2.inputProps,
1484
1476
  "data-field-name": fieldName,
@@ -1495,7 +1487,7 @@ function ServerActionField({
1495
1487
  }
1496
1488
  case "textarea": {
1497
1489
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1498
- Textarea2,
1490
+ Textarea,
1499
1491
  {
1500
1492
  ...field2.textareaProps,
1501
1493
  "data-field-name": fieldName,
@@ -1511,7 +1503,7 @@ function ServerActionField({
1511
1503
  }
1512
1504
  case "checkbox": {
1513
1505
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value: checked ? "on" : "" }), /* @__PURE__ */ React17.createElement(
1514
- Checkbox2,
1506
+ Checkbox,
1515
1507
  {
1516
1508
  ...field2.checkboxProps,
1517
1509
  "data-field-name": fieldName,
@@ -1527,7 +1519,7 @@ function ServerActionField({
1527
1519
  case "select": {
1528
1520
  const options = field2.options || [];
1529
1521
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1530
- Select2,
1522
+ Select,
1531
1523
  {
1532
1524
  ...field2.selectProps,
1533
1525
  "data-field-name": fieldName,
@@ -1543,13 +1535,13 @@ function ServerActionField({
1543
1535
  }
1544
1536
  },
1545
1537
  options.map(
1546
- (option) => /* @__PURE__ */ React17.createElement(SelectItem2, { key: String(option.value) }, option.label)
1538
+ (option) => /* @__PURE__ */ React17.createElement(SelectItem, { key: String(option.value) }, option.label)
1547
1539
  )
1548
1540
  ));
1549
1541
  }
1550
1542
  default:
1551
1543
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1552
- Input2,
1544
+ Input,
1553
1545
  {
1554
1546
  "data-field-name": fieldName,
1555
1547
  label: field2.label,
@@ -1862,7 +1854,7 @@ import { useFormContext as useFormContext5 } from "react-hook-form";
1862
1854
 
1863
1855
  // src/components/ZodForm.tsx
1864
1856
  import React21 from "react";
1865
- import { Button as Button6 } from "@heroui/react";
1857
+ import { Button as Button5 } from "@heroui/react";
1866
1858
 
1867
1859
  // src/zod-integration.ts
1868
1860
  import { useForm as useForm2 } from "react-hook-form";
@@ -1982,7 +1974,7 @@ function useEnhancedFormState(form, options = {}) {
1982
1974
 
1983
1975
  // src/components/FormStatus.tsx
1984
1976
  import React20 from "react";
1985
- import { Button as Button5 } from "@heroui/react";
1977
+ import { Button as Button4 } from "@heroui/react";
1986
1978
  function FormStatus({
1987
1979
  className = "",
1988
1980
  onDismiss,
@@ -2013,7 +2005,7 @@ function FormStatus({
2013
2005
  /* @__PURE__ */ React20.createElement("span", { className: "text-green-600" }, "\u2705"),
2014
2006
  /* @__PURE__ */ React20.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React20.createElement("p", { className: "text-sm font-medium text-green-900" }, "Form submitted successfully!"), showDetails && submittedData && /* @__PURE__ */ React20.createElement("p", { className: "text-xs text-green-700" }, "Your data has been saved. Thank you for your submission.")),
2015
2007
  onDismiss && /* @__PURE__ */ React20.createElement(
2016
- Button5,
2008
+ Button4,
2017
2009
  {
2018
2010
  size: "sm",
2019
2011
  variant: "light",
@@ -2035,7 +2027,7 @@ function FormStatus({
2035
2027
  /* @__PURE__ */ React20.createElement("span", { className: "text-red-600" }, "\u26A0\uFE0F"),
2036
2028
  /* @__PURE__ */ React20.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React20.createElement("p", { className: "text-sm font-medium text-red-900" }, "Error submitting form"), /* @__PURE__ */ React20.createElement("p", { className: "text-xs text-red-700" }, error)),
2037
2029
  onDismiss && /* @__PURE__ */ React20.createElement(
2038
- Button5,
2030
+ Button4,
2039
2031
  {
2040
2032
  size: "sm",
2041
2033
  variant: "light",
@@ -2207,7 +2199,7 @@ function ZodForm({
2207
2199
  showDetails: true
2208
2200
  }
2209
2201
  ), renderFields(), /* @__PURE__ */ React21.createElement("div", { className: "mt-6 flex gap-3 justify-end" }, /* @__PURE__ */ React21.createElement(
2210
- Button6,
2202
+ Button5,
2211
2203
  {
2212
2204
  color: "primary",
2213
2205
  isDisabled: enhancedState.isSubmitting,
@@ -2217,7 +2209,7 @@ function ZodForm({
2217
2209
  },
2218
2210
  enhancedState.isSuccess ? "Success!" : submitButtonText
2219
2211
  ), showResetButton && /* @__PURE__ */ React21.createElement(
2220
- Button6,
2212
+ Button5,
2221
2213
  {
2222
2214
  isDisabled: enhancedState.isSubmitting,
2223
2215
  type: "button",
@@ -1243,14 +1243,6 @@ function ConfigurableForm({
1243
1243
 
1244
1244
  // src/components/ServerActionForm.tsx
1245
1245
  import React17 from "react";
1246
- import {
1247
- Button as Button4,
1248
- Checkbox as Checkbox2,
1249
- Input as Input2,
1250
- Select as Select2,
1251
- SelectItem as SelectItem2,
1252
- Textarea as Textarea2
1253
- } from "@heroui/react";
1254
1246
  import { useActionState } from "react";
1255
1247
  function ServerActionForm({
1256
1248
  action,
@@ -1398,7 +1390,7 @@ function ServerActionForm({
1398
1390
  ),
1399
1391
  renderFields(),
1400
1392
  /* @__PURE__ */ React17.createElement("div", { className: "mt-6 flex gap-3 justify-end" }, /* @__PURE__ */ React17.createElement(
1401
- Button4,
1393
+ Button,
1402
1394
  {
1403
1395
  color: "primary",
1404
1396
  isDisabled: pending,
@@ -1408,7 +1400,7 @@ function ServerActionForm({
1408
1400
  },
1409
1401
  submitButtonText
1410
1402
  ), showResetButton && /* @__PURE__ */ React17.createElement(
1411
- Button4,
1403
+ Button,
1412
1404
  {
1413
1405
  isDisabled: pending,
1414
1406
  type: "button",
@@ -1483,7 +1475,7 @@ function ServerActionField({
1483
1475
  case "input": {
1484
1476
  const inputType = field2.inputProps?.type || "text";
1485
1477
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1486
- Input2,
1478
+ Input,
1487
1479
  {
1488
1480
  ...field2.inputProps,
1489
1481
  "data-field-name": fieldName,
@@ -1500,7 +1492,7 @@ function ServerActionField({
1500
1492
  }
1501
1493
  case "textarea": {
1502
1494
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1503
- Textarea2,
1495
+ Textarea,
1504
1496
  {
1505
1497
  ...field2.textareaProps,
1506
1498
  "data-field-name": fieldName,
@@ -1516,7 +1508,7 @@ function ServerActionField({
1516
1508
  }
1517
1509
  case "checkbox": {
1518
1510
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value: checked ? "on" : "" }), /* @__PURE__ */ React17.createElement(
1519
- Checkbox2,
1511
+ Checkbox,
1520
1512
  {
1521
1513
  ...field2.checkboxProps,
1522
1514
  "data-field-name": fieldName,
@@ -1532,7 +1524,7 @@ function ServerActionField({
1532
1524
  case "select": {
1533
1525
  const options = field2.options || [];
1534
1526
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1535
- Select2,
1527
+ Select,
1536
1528
  {
1537
1529
  ...field2.selectProps,
1538
1530
  "data-field-name": fieldName,
@@ -1548,13 +1540,13 @@ function ServerActionField({
1548
1540
  }
1549
1541
  },
1550
1542
  options.map(
1551
- (option) => /* @__PURE__ */ React17.createElement(SelectItem2, { key: String(option.value) }, option.label)
1543
+ (option) => /* @__PURE__ */ React17.createElement(SelectItem, { key: String(option.value) }, option.label)
1552
1544
  )
1553
1545
  ));
1554
1546
  }
1555
1547
  default:
1556
1548
  return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: fieldName, value }), /* @__PURE__ */ React17.createElement(
1557
- Input2,
1549
+ Input,
1558
1550
  {
1559
1551
  "data-field-name": fieldName,
1560
1552
  label: field2.label,
@@ -1867,7 +1859,7 @@ import { useFormContext as useFormContext5 } from "react-hook-form";
1867
1859
 
1868
1860
  // src/components/ZodForm.tsx
1869
1861
  import React21 from "react";
1870
- import { Button as Button6 } from "@heroui/react";
1862
+ import { Button as Button5 } from "@heroui/react";
1871
1863
 
1872
1864
  // src/zod-integration.ts
1873
1865
  import { useForm as useForm2 } from "react-hook-form";
@@ -1987,7 +1979,7 @@ function useEnhancedFormState(form, options = {}) {
1987
1979
 
1988
1980
  // src/components/FormStatus.tsx
1989
1981
  import React20 from "react";
1990
- import { Button as Button5 } from "@heroui/react";
1982
+ import { Button as Button4 } from "@heroui/react";
1991
1983
  function FormStatus({
1992
1984
  className = "",
1993
1985
  onDismiss,
@@ -2018,7 +2010,7 @@ function FormStatus({
2018
2010
  /* @__PURE__ */ React20.createElement("span", { className: "text-green-600" }, "\u2705"),
2019
2011
  /* @__PURE__ */ React20.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React20.createElement("p", { className: "text-sm font-medium text-green-900" }, "Form submitted successfully!"), showDetails && submittedData && /* @__PURE__ */ React20.createElement("p", { className: "text-xs text-green-700" }, "Your data has been saved. Thank you for your submission.")),
2020
2012
  onDismiss && /* @__PURE__ */ React20.createElement(
2021
- Button5,
2013
+ Button4,
2022
2014
  {
2023
2015
  size: "sm",
2024
2016
  variant: "light",
@@ -2040,7 +2032,7 @@ function FormStatus({
2040
2032
  /* @__PURE__ */ React20.createElement("span", { className: "text-red-600" }, "\u26A0\uFE0F"),
2041
2033
  /* @__PURE__ */ React20.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React20.createElement("p", { className: "text-sm font-medium text-red-900" }, "Error submitting form"), /* @__PURE__ */ React20.createElement("p", { className: "text-xs text-red-700" }, error)),
2042
2034
  onDismiss && /* @__PURE__ */ React20.createElement(
2043
- Button5,
2035
+ Button4,
2044
2036
  {
2045
2037
  size: "sm",
2046
2038
  variant: "light",
@@ -2212,7 +2204,7 @@ function ZodForm({
2212
2204
  showDetails: true
2213
2205
  }
2214
2206
  ), renderFields(), /* @__PURE__ */ React21.createElement("div", { className: "mt-6 flex gap-3 justify-end" }, /* @__PURE__ */ React21.createElement(
2215
- Button6,
2207
+ Button5,
2216
2208
  {
2217
2209
  color: "primary",
2218
2210
  isDisabled: enhancedState.isSubmitting,
@@ -2222,7 +2214,7 @@ function ZodForm({
2222
2214
  },
2223
2215
  enhancedState.isSuccess ? "Success!" : submitButtonText
2224
2216
  ), showResetButton && /* @__PURE__ */ React21.createElement(
2225
- Button6,
2217
+ Button5,
2226
2218
  {
2227
2219
  isDisabled: enhancedState.isSubmitting,
2228
2220
  type: "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rachelallyson/hero-hook-form",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Typed form helpers that combine React Hook Form and HeroUI components.",
5
5
  "author": "Rachel Higley",
6
6
  "homepage": "https://rachelallyson.github.io/hero-hook-form/",