@page-speed/forms 0.7.1 → 0.7.3

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.
Files changed (41) hide show
  1. package/dist/{FormContext-DsNPeCv0.d.ts → FormContext-CRP1KNiH.d.ts} +1 -1
  2. package/dist/{FormContext-6c1ttFt2.d.cts → FormContext-DmdEAIQ7.d.cts} +1 -1
  3. package/dist/{chunk-ER3C5JAE.cjs → chunk-4K6J2DOK.cjs} +30 -16
  4. package/dist/chunk-4K6J2DOK.cjs.map +1 -0
  5. package/dist/{chunk-DKLPYENR.cjs → chunk-7OZ5SKVC.cjs} +6 -5
  6. package/dist/chunk-7OZ5SKVC.cjs.map +1 -0
  7. package/dist/{chunk-BW752X33.js → chunk-QXC7B4QC.js} +6 -5
  8. package/dist/chunk-QXC7B4QC.js.map +1 -0
  9. package/dist/{chunk-5BAN5ICD.js → chunk-ZH6XDBWH.js} +30 -16
  10. package/dist/chunk-ZH6XDBWH.js.map +1 -0
  11. package/dist/core.cjs +8 -8
  12. package/dist/core.d.cts +3 -3
  13. package/dist/core.d.ts +3 -3
  14. package/dist/core.js +1 -1
  15. package/dist/index.cjs +7 -7
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +1 -1
  19. package/dist/inputs.cjs +12 -12
  20. package/dist/inputs.d.cts +1 -1
  21. package/dist/inputs.d.ts +1 -1
  22. package/dist/inputs.js +1 -1
  23. package/dist/integration.cjs +15 -15
  24. package/dist/integration.d.cts +2 -2
  25. package/dist/integration.d.ts +2 -2
  26. package/dist/integration.js +2 -2
  27. package/dist/{types-CrWhdYGP.d.cts → types-BfZYTL89.d.cts} +5 -1
  28. package/dist/{types-CrWhdYGP.d.ts → types-BfZYTL89.d.ts} +5 -1
  29. package/dist/validation-rules.d.cts +1 -1
  30. package/dist/validation-rules.d.ts +1 -1
  31. package/dist/validation-utils.d.cts +1 -1
  32. package/dist/validation-utils.d.ts +1 -1
  33. package/dist/validation-valibot.d.cts +1 -1
  34. package/dist/validation-valibot.d.ts +1 -1
  35. package/dist/validation.d.cts +1 -1
  36. package/dist/validation.d.ts +1 -1
  37. package/package.json +3 -3
  38. package/dist/chunk-5BAN5ICD.js.map +0 -1
  39. package/dist/chunk-BW752X33.js.map +0 -1
  40. package/dist/chunk-DKLPYENR.cjs.map +0 -1
  41. package/dist/chunk-ER3C5JAE.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { b as FormValues, U as UseFormOptions, m as UseFormReturn, p as UseFieldOptions, q as UseFieldReturn, r as FormProps, s as FieldProps } from './types-CrWhdYGP.js';
1
+ import { b as FormValues, U as UseFormOptions, m as UseFormReturn, p as UseFieldOptions, q as UseFieldReturn, r as FormProps, s as FieldProps } from './types-BfZYTL89.js';
2
2
  import * as React from 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { b as FormValues, U as UseFormOptions, m as UseFormReturn, p as UseFieldOptions, q as UseFieldReturn, r as FormProps, s as FieldProps } from './types-CrWhdYGP.cjs';
1
+ import { b as FormValues, U as UseFormOptions, m as UseFormReturn, p as UseFieldOptions, q as UseFieldReturn, r as FormProps, s as FieldProps } from './types-BfZYTL89.cjs';
2
2
  import * as React from 'react';
3
3
 
4
4
  /**
@@ -2338,7 +2338,7 @@ function FileUploadDropzone(props) {
2338
2338
  tabIndex: context.disabled ? -1 : 0,
2339
2339
  ...dropzoneProps,
2340
2340
  className: chunkWQ4HD5UD_cjs.cn(
2341
- "relative flex select-none flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-6 outline-none transition-colors hover:bg-accent/30 focus-visible:border-ring/50 data-disabled:pointer-events-none data-dragging:border-primary/30 data-dragging:bg-accent/30 data-invalid:ring-destructive/20",
2341
+ "relative flex select-none flex-col items-center justify-center gap-2 rounded-lg border border-dashed p-6 outline-none transition-colors hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/20 data-disabled:pointer-events-none data-disabled:opacity-50 data-dragging:border-ring data-dragging:bg-accent/50 data-invalid:border-destructive data-invalid:ring-destructive/20",
2342
2342
  className
2343
2343
  ),
2344
2344
  onClick,
@@ -2680,7 +2680,9 @@ function FileInput({
2680
2680
  (incomingFiles) => {
2681
2681
  const nextFiles = multiple ? incomingFiles : incomingFiles.slice(-1);
2682
2682
  if (onFileRemove && nextFiles.length < normalizedValue.length) {
2683
- const nextFileIds = new Set(nextFiles.map((file) => fileIdentity(file)));
2683
+ const nextFileIds = new Set(
2684
+ nextFiles.map((file) => fileIdentity(file))
2685
+ );
2684
2686
  normalizedValue.forEach((file, index) => {
2685
2687
  if (!nextFileIds.has(fileIdentity(file))) {
2686
2688
  onFileRemove(file, index);
@@ -2820,9 +2822,12 @@ function FileInput({
2820
2822
  setImageToCrop({ file, url: previewUrl });
2821
2823
  setCropperOpen(true);
2822
2824
  }, []);
2823
- const onCropChange = React19__namespace.useCallback((nextCrop) => {
2824
- setCrop(nextCrop);
2825
- }, []);
2825
+ const onCropChange = React19__namespace.useCallback(
2826
+ (nextCrop) => {
2827
+ setCrop(nextCrop);
2828
+ },
2829
+ []
2830
+ );
2826
2831
  const onZoomChange = React19__namespace.useCallback((nextZoom) => {
2827
2832
  setZoom(nextZoom);
2828
2833
  }, []);
@@ -2880,29 +2885,30 @@ function FileInput({
2880
2885
  "aria-label": placeholder,
2881
2886
  className: chunkWQ4HD5UD_cjs.cn(
2882
2887
  "flex min-h-32 w-full cursor-pointer items-center justify-center border-input bg-transparent p-6 transition-colors",
2883
- "hover:bg-accent/50 hover:border-ring",
2884
- "data-[dragging]:bg-accent data-[dragging]:border-ring",
2888
+ "hover:bg-accent/50",
2889
+ "data-[dragging]:bg-accent/50",
2885
2890
  disabled && "cursor-not-allowed opacity-50",
2886
2891
  error && "border-destructive"
2887
2892
  )
2888
2893
  },
2889
- /* @__PURE__ */ React19__namespace.createElement("div", { className: "flex flex-col items-center gap-2 text-center" }, /* @__PURE__ */ React19__namespace.createElement(
2894
+ /* @__PURE__ */ React19__namespace.createElement("div", { className: "flex flex-col items-center gap-1 text-center" }, /* @__PURE__ */ React19__namespace.createElement("div", { className: "flex items-center justify-center rounded-full border p-2.5" }, /* @__PURE__ */ React19__namespace.createElement(
2890
2895
  "svg",
2891
2896
  {
2892
- width: "48",
2893
- height: "48",
2897
+ width: "24",
2898
+ height: "24",
2894
2899
  viewBox: "0 0 24 24",
2895
2900
  fill: "none",
2896
2901
  stroke: "currentColor",
2897
2902
  strokeWidth: "2",
2898
2903
  strokeLinecap: "round",
2899
2904
  strokeLinejoin: "round",
2905
+ className: "text-muted-foreground",
2900
2906
  "aria-hidden": "true"
2901
2907
  },
2902
2908
  /* @__PURE__ */ React19__namespace.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2903
2909
  /* @__PURE__ */ React19__namespace.createElement("polyline", { points: "17 8 12 3 7 8" }),
2904
2910
  /* @__PURE__ */ React19__namespace.createElement("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
2905
- ), /* @__PURE__ */ React19__namespace.createElement("p", { className: "text-sm font-medium" }, fileCountLabel), accept && /* @__PURE__ */ React19__namespace.createElement("p", { className: "text-xs" }, "Accepted: ", accept), /* @__PURE__ */ React19__namespace.createElement("p", { className: "text-xs" }, "Max size: ", formatFileSize(maxSize)))
2911
+ )), /* @__PURE__ */ React19__namespace.createElement("p", { className: "text-sm font-medium" }, fileCountLabel), accept && /* @__PURE__ */ React19__namespace.createElement("p", { className: "text-muted-foreground text-xs" }, "Accepted: ", accept), /* @__PURE__ */ React19__namespace.createElement("p", { className: "text-muted-foreground text-xs" }, "Max size: ", formatFileSize(maxSize)))
2906
2912
  ),
2907
2913
  /* @__PURE__ */ React19__namespace.createElement(FileUploadList, { className: "mt-4" }, normalizedValue.map((file, index) => {
2908
2914
  const progressValue = uploadProgress[file.name];
@@ -2912,10 +2918,10 @@ function FileInput({
2912
2918
  {
2913
2919
  key: `${file.name}-${index}`,
2914
2920
  value: file,
2915
- className: "flex items-center gap-3 border-border bg-card text-card-foreground hover:bg-primary/50 transition-colors"
2921
+ className: "flex items-center gap-3 border-border bg-card text-card-foreground hover:bg-accent/50 transition-colors"
2916
2922
  },
2917
2923
  showPreview ? /* @__PURE__ */ React19__namespace.createElement(FileUploadItemPreview, { className: "h-12 w-12 rounded [&>img]:h-full [&>img]:w-full [&>img]:object-cover [&>svg]:size-6" }) : null,
2918
- /* @__PURE__ */ React19__namespace.createElement("div", { className: "flex min-w-0 flex-1 flex-col" }, /* @__PURE__ */ React19__namespace.createElement(FileUploadItemMetadata, { className: "min-w-0" }), /* @__PURE__ */ React19__namespace.createElement("span", { className: "text-xs" }, formatFileSize(file.size)), hasProgress ? /* @__PURE__ */ React19__namespace.createElement("div", { className: "mt-1 flex items-center gap-2" }, /* @__PURE__ */ React19__namespace.createElement(
2924
+ /* @__PURE__ */ React19__namespace.createElement("div", { className: "flex min-w-0 flex-1 flex-col" }, /* @__PURE__ */ React19__namespace.createElement(FileUploadItemMetadata, { className: "min-w-0" }), hasProgress && progressValue < 100 ? /* @__PURE__ */ React19__namespace.createElement("div", { className: "mt-1 flex items-center gap-2" }, /* @__PURE__ */ React19__namespace.createElement(
2919
2925
  "div",
2920
2926
  {
2921
2927
  className: "h-1.5 flex-1 overflow-hidden rounded-full bg-accent/40",
@@ -3127,7 +3133,15 @@ function FileInput({
3127
3133
  "aria-label": "Zoom level"
3128
3134
  }
3129
3135
  ))),
3130
- /* @__PURE__ */ React19__namespace.createElement("div", { className: "flex items-center justify-end gap-2 border-t border-border p-4" }, /* @__PURE__ */ React19__namespace.createElement(chunkWQ4HD5UD_cjs.Button, { type: "button", variant: "outline", onClick: handleCropCancel }, "Cancel"), /* @__PURE__ */ React19__namespace.createElement(chunkWQ4HD5UD_cjs.Button, { type: "button", onClick: handleCropSave }, "Save"))
3136
+ /* @__PURE__ */ React19__namespace.createElement("div", { className: "flex items-center justify-end gap-2 border-t border-border p-4" }, /* @__PURE__ */ React19__namespace.createElement(
3137
+ chunkWQ4HD5UD_cjs.Button,
3138
+ {
3139
+ type: "button",
3140
+ variant: "outline",
3141
+ onClick: handleCropCancel
3142
+ },
3143
+ "Cancel"
3144
+ ), /* @__PURE__ */ React19__namespace.createElement(chunkWQ4HD5UD_cjs.Button, { type: "button", onClick: handleCropSave }, "Save"))
3131
3145
  ) : null
3132
3146
  ));
3133
3147
  }
@@ -4076,5 +4090,5 @@ exports.Select = Select2;
4076
4090
  exports.Switch = Switch2;
4077
4091
  exports.TextArea = TextArea;
4078
4092
  exports.TimePicker = TimePicker;
4079
- //# sourceMappingURL=chunk-ER3C5JAE.cjs.map
4080
- //# sourceMappingURL=chunk-ER3C5JAE.cjs.map
4093
+ //# sourceMappingURL=chunk-4K6J2DOK.cjs.map
4094
+ //# sourceMappingURL=chunk-4K6J2DOK.cjs.map