@sakura-ui/forms 0.1.4 → 0.1.5

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 (38) hide show
  1. package/dist/components/Checkbox.d.ts +1 -1
  2. package/dist/components/Checkbox.d.ts.map +1 -1
  3. package/dist/components/Checkbox.js.map +1 -1
  4. package/dist/components/FieldsetControl.d.ts +1 -1
  5. package/dist/components/FieldsetControl.d.ts.map +1 -1
  6. package/dist/components/FieldsetControl.js.map +1 -1
  7. package/dist/components/Input.d.ts +1 -1
  8. package/dist/components/Input.d.ts.map +1 -1
  9. package/dist/components/Input.js.map +1 -1
  10. package/dist/components/LabelControl.d.ts +1 -1
  11. package/dist/components/LabelControl.d.ts.map +1 -1
  12. package/dist/components/LabelControl.js.map +1 -1
  13. package/dist/components/Radio.d.ts +1 -1
  14. package/dist/components/Radio.d.ts.map +1 -1
  15. package/dist/components/Radio.js.map +1 -1
  16. package/dist/components/Select.d.ts +1 -1
  17. package/dist/components/Select.d.ts.map +1 -1
  18. package/dist/components/Select.js.map +1 -1
  19. package/dist/components/Textarea.d.ts +1 -1
  20. package/dist/components/Textarea.d.ts.map +1 -1
  21. package/dist/components/Textarea.js.map +1 -1
  22. package/dist/components/controlled/CheckboxGroup.d.ts +1 -1
  23. package/dist/components/controlled/CheckboxGroup.d.ts.map +1 -1
  24. package/dist/components/controlled/CheckboxGroup.js.map +1 -1
  25. package/dist/components/controlled/RadioGroup.d.ts +1 -1
  26. package/dist/components/controlled/RadioGroup.d.ts.map +1 -1
  27. package/dist/components/controlled/RadioGroup.js.map +1 -1
  28. package/dist/components/controlled/SelectControl.d.ts +1 -1
  29. package/dist/components/controlled/SelectControl.d.ts.map +1 -1
  30. package/dist/components/controlled/SelectControl.js.map +1 -1
  31. package/dist/components/controlled/TextareaControl.d.ts +1 -1
  32. package/dist/components/controlled/TextareaControl.d.ts.map +1 -1
  33. package/dist/components/controlled/TextareaControl.js.map +1 -1
  34. package/dist/index.cjs.js.map +1 -1
  35. package/dist/index.es.js +121 -128
  36. package/dist/index.es.js.map +1 -1
  37. package/package.json +9 -9
  38. package/LICENSE +0 -21
package/dist/index.es.js CHANGED
@@ -631,10 +631,11 @@ const P = (...p) => p.filter(Boolean).join(" "), F = y.createContext({
631
631
  errorMessageId: "",
632
632
  isInvalid: !1,
633
633
  isRequired: !1
634
- }), Ie = y.forwardRef((p, b) => {
635
- const { className: m, children: f, ...i } = p, a = y.useContext(F);
636
- a.isRequired && (i.required = !0), a.groupName && (i.name = a.groupName);
637
- const v = `
634
+ }), Ie = y.forwardRef(
635
+ (p, b) => {
636
+ const { className: m, children: f, ...i } = p, a = y.useContext(F);
637
+ a.isRequired && (i.required = !0), a.groupName && (i.name = a.groupName);
638
+ const v = `
638
639
  inline-block
639
640
  text-base
640
641
  cursor-pointer
@@ -658,28 +659,30 @@ const P = (...p) => p.filter(Boolean).join(" "), F = y.createContext({
658
659
  peer-checked:border-none
659
660
  peer-disabled:border-sumi-500
660
661
  `;
661
- return /* @__PURE__ */ s.jsx("label", { htmlFor: i.id, className: P(v, m), children: /* @__PURE__ */ s.jsxs("span", { className: "flex items-center", children: [
662
- /* @__PURE__ */ s.jsx(
663
- "input",
664
- {
665
- className: c,
666
- type: "checkbox",
667
- "aria-describedby": a.helperTextId,
668
- "aria-errormessage": a.errorMessageId,
669
- "aria-invalid": a.isInvalid ?? !1,
670
- ...i,
671
- ref: b
672
- }
673
- ),
674
- /* @__PURE__ */ s.jsx("span", { className: o, children: /* @__PURE__ */ s.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", children: /* @__PURE__ */ s.jsx("path", { d: "m9.55 17.65-5.325-5.325 1.05-1.075 4.275 4.275 9.175-9.175 1.05 1.075Z" }) }) }),
675
- /* @__PURE__ */ s.jsx("span", { className: "peer-disabled:text-sumi-500", children: f })
676
- ] }) });
677
- });
662
+ return /* @__PURE__ */ s.jsx("label", { htmlFor: i.id, className: P(v, m), children: /* @__PURE__ */ s.jsxs("span", { className: "flex items-center", children: [
663
+ /* @__PURE__ */ s.jsx(
664
+ "input",
665
+ {
666
+ className: c,
667
+ type: "checkbox",
668
+ "aria-describedby": a.helperTextId,
669
+ "aria-errormessage": a.errorMessageId,
670
+ "aria-invalid": a.isInvalid ?? !1,
671
+ ...i,
672
+ ref: b
673
+ }
674
+ ),
675
+ /* @__PURE__ */ s.jsx("span", { className: o, children: /* @__PURE__ */ s.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", children: /* @__PURE__ */ s.jsx("path", { d: "m9.55 17.65-5.325-5.325 1.05-1.075 4.275 4.275 9.175-9.175 1.05 1.075Z" }) }) }),
676
+ /* @__PURE__ */ s.jsx("span", { className: "peer-disabled:text-sumi-500", children: f })
677
+ ] }) });
678
+ }
679
+ );
678
680
  Ie.displayName = "Checkbox";
679
- const Se = y.forwardRef((p, b) => {
680
- const { className: m, children: f, ...i } = p, a = y.useContext(F);
681
- a.isRequired && (i.required = !0), a.groupName && (i.name = a.groupName);
682
- const v = `
681
+ const Se = y.forwardRef(
682
+ (p, b) => {
683
+ const { className: m, children: f, ...i } = p, a = y.useContext(F);
684
+ a.isRequired && (i.required = !0), a.groupName && (i.name = a.groupName);
685
+ const v = `
683
686
  inline-block
684
687
  text-base
685
688
  cursor-pointer
@@ -703,28 +706,30 @@ const Se = y.forwardRef((p, b) => {
703
706
  peer-checked:border-sea-600
704
707
  peer-disabled:border-sumi-500
705
708
  `;
706
- return /* @__PURE__ */ s.jsx("label", { htmlFor: i.id, className: P(v, m), children: /* @__PURE__ */ s.jsxs("span", { className: "flex items-center", children: [
707
- /* @__PURE__ */ s.jsx(
708
- "input",
709
- {
710
- className: c,
711
- type: "radio",
712
- "aria-describedby": a.helperTextId,
713
- "aria-errormessage": a.errorMessageId,
714
- "aria-invalid": a.isInvalid ?? !1,
715
- ...i,
716
- ref: b
717
- }
718
- ),
719
- /* @__PURE__ */ s.jsx("span", { className: o }),
720
- /* @__PURE__ */ s.jsx("span", { className: "peer-disabled:text-sumi-500", children: f })
721
- ] }) });
722
- });
709
+ return /* @__PURE__ */ s.jsx("label", { htmlFor: i.id, className: P(v, m), children: /* @__PURE__ */ s.jsxs("span", { className: "flex items-center", children: [
710
+ /* @__PURE__ */ s.jsx(
711
+ "input",
712
+ {
713
+ className: c,
714
+ type: "radio",
715
+ "aria-describedby": a.helperTextId,
716
+ "aria-errormessage": a.errorMessageId,
717
+ "aria-invalid": a.isInvalid ?? !1,
718
+ ...i,
719
+ ref: b
720
+ }
721
+ ),
722
+ /* @__PURE__ */ s.jsx("span", { className: o }),
723
+ /* @__PURE__ */ s.jsx("span", { className: "peer-disabled:text-sumi-500", children: f })
724
+ ] }) });
725
+ }
726
+ );
723
727
  Se.displayName = "Radio";
724
- const hr = y.forwardRef((p, b) => {
725
- const { className: m, children: f, ...i } = p, a = y.useContext(F);
726
- a.isRequired && (i.required = !0);
727
- const v = a.isInvalid ? "border-sun-800" : "border-sumi-900", c = `
728
+ const hr = y.forwardRef(
729
+ (p, b) => {
730
+ const { className: m, children: f, ...i } = p, a = y.useContext(F);
731
+ a.isRequired && (i.required = !0);
732
+ const v = a.isInvalid ? "border-sun-800" : "border-sumi-900", c = `
728
733
  peer
729
734
  cursor-pointer
730
735
  appearance-none
@@ -748,26 +753,28 @@ const hr = y.forwardRef((p, b) => {
748
753
  pointer-events-none
749
754
  peer-disabled:fill-sumi-500
750
755
  `;
751
- return /* @__PURE__ */ s.jsxs("label", { className: "inline-block relative", children: [
752
- /* @__PURE__ */ s.jsx(
753
- "select",
754
- {
755
- id: i.id ?? a.id,
756
- className: P(c, v, p.className),
757
- "aria-describedby": a.helperTextId,
758
- "aria-errormessage": a.errorMessageId,
759
- "aria-invalid": a.isInvalid ?? !1,
760
- ...i,
761
- ref: b,
762
- children: f
763
- }
764
- ),
765
- /* @__PURE__ */ s.jsx("span", { className: o, children: /* @__PURE__ */ s.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", width: "24", children: /* @__PURE__ */ s.jsx("path", { d: "M12 15.05 6.35 9.4 7.4 8.35l4.6 4.6 4.6-4.6 1.05 1.05Z" }) }) })
766
- ] });
767
- }), br = y.forwardRef((p, b) => {
768
- const { className: m, ...f } = p, i = y.useContext(F);
769
- i.isRequired && (f.required = !0);
770
- const a = i.isInvalid ? "border-sun-800" : "border-sumi-900", v = `
756
+ return /* @__PURE__ */ s.jsxs("label", { className: "inline-block relative", children: [
757
+ /* @__PURE__ */ s.jsx(
758
+ "select",
759
+ {
760
+ id: i.id ?? a.id,
761
+ className: P(c, v, p.className),
762
+ "aria-describedby": a.helperTextId,
763
+ "aria-errormessage": a.errorMessageId,
764
+ "aria-invalid": a.isInvalid ?? !1,
765
+ ...i,
766
+ ref: b,
767
+ children: f
768
+ }
769
+ ),
770
+ /* @__PURE__ */ s.jsx("span", { className: o, children: /* @__PURE__ */ s.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", width: "24", children: /* @__PURE__ */ s.jsx("path", { d: "M12 15.05 6.35 9.4 7.4 8.35l4.6 4.6 4.6-4.6 1.05 1.05Z" }) }) })
771
+ ] });
772
+ }
773
+ ), br = y.forwardRef(
774
+ (p, b) => {
775
+ const { className: m, ...f } = p, i = y.useContext(F);
776
+ i.isRequired && (f.required = !0);
777
+ const a = i.isInvalid ? "border-sun-800" : "border-sumi-900", v = `
771
778
  p-4
772
779
  rounded-lg
773
780
  border
@@ -779,27 +786,29 @@ const hr = y.forwardRef((p, b) => {
779
786
  disabled:text-sumi-500
780
787
  disabled:border-sumi-500
781
788
  `;
782
- return /* @__PURE__ */ s.jsx(
783
- "input",
784
- {
785
- type: "text",
786
- id: f.id ?? i.id,
787
- className: P(v, a, m),
788
- "aria-describedby": i.helperTextId,
789
- "aria-errormessage": i.errorMessageId,
790
- "aria-invalid": i.isInvalid ?? !1,
791
- ref: b,
792
- ...f
793
- }
794
- );
795
- });
789
+ return /* @__PURE__ */ s.jsx(
790
+ "input",
791
+ {
792
+ type: "text",
793
+ id: f.id ?? i.id,
794
+ className: P(v, a, m),
795
+ "aria-describedby": i.helperTextId,
796
+ "aria-errormessage": i.errorMessageId,
797
+ "aria-invalid": i.isInvalid ?? !1,
798
+ ref: b,
799
+ ...f
800
+ }
801
+ );
802
+ }
803
+ );
796
804
  br.displayName = "Input";
797
- const Oe = y.forwardRef((p, b) => {
798
- const { className: m, children: f, onChange: i, maxLength: a, ...v } = p, [c, o] = y.useState(0), _ = (I) => {
799
- i && i(I), o(I.target.value.length);
800
- }, h = y.useContext(F);
801
- h.isRequired && (v.required = !0);
802
- const g = h.isInvalid ? "border-sun-800" : "border-sumi-900", C = c > (a || 0) ? "text-sun-800" : "text-sumi-700", T = `
805
+ const Oe = y.forwardRef(
806
+ (p, b) => {
807
+ const { className: m, children: f, onChange: i, maxLength: a, ...v } = p, [c, o] = y.useState(0), _ = (I) => {
808
+ i && i(I), o(I.target.value.length);
809
+ }, h = y.useContext(F);
810
+ h.isRequired && (v.required = !0);
811
+ const g = h.isInvalid ? "border-sun-800" : "border-sumi-900", C = c > (a || 0) ? "text-sun-800" : "text-sumi-700", T = `
803
812
  p-4
804
813
  rounded-lg
805
814
  border
@@ -811,28 +820,29 @@ const Oe = y.forwardRef((p, b) => {
811
820
  disabled:text-sumi-500
812
821
  disabled:border-sumi-500
813
822
  `;
814
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
815
- /* @__PURE__ */ s.jsx(
816
- "textarea",
817
- {
818
- id: v.id ?? h.id,
819
- className: P(T, g, m),
820
- "aria-describedby": h.helperTextId,
821
- "aria-errormessage": h.errorMessageId,
822
- "aria-invalid": h.isInvalid ?? !1,
823
- onChange: _,
824
- ...v,
825
- ref: b,
826
- children: f
827
- }
828
- ),
829
- a ? /* @__PURE__ */ s.jsxs("p", { className: "text-sup text-sumi-700", children: [
830
- /* @__PURE__ */ s.jsx("span", { className: C, children: c }),
831
- "/",
832
- /* @__PURE__ */ s.jsx("span", { children: a })
833
- ] }) : ""
834
- ] });
835
- });
823
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
824
+ /* @__PURE__ */ s.jsx(
825
+ "textarea",
826
+ {
827
+ id: v.id ?? h.id,
828
+ className: P(T, g, m),
829
+ "aria-describedby": h.helperTextId,
830
+ "aria-errormessage": h.errorMessageId,
831
+ "aria-invalid": h.isInvalid ?? !1,
832
+ onChange: _,
833
+ ...v,
834
+ ref: b,
835
+ children: f
836
+ }
837
+ ),
838
+ a ? /* @__PURE__ */ s.jsxs("p", { className: "text-sup text-sumi-700", children: [
839
+ /* @__PURE__ */ s.jsx("span", { className: C, children: c }),
840
+ "/",
841
+ /* @__PURE__ */ s.jsx("span", { children: a })
842
+ ] }) : ""
843
+ ] });
844
+ }
845
+ );
836
846
  Oe.displayName = "Textarea";
837
847
  const te = y.forwardRef((p, b) => {
838
848
  const m = y.useId(), {
@@ -865,14 +875,7 @@ const te = y.forwardRef((p, b) => {
865
875
  ]
866
876
  }
867
877
  ),
868
- a && /* @__PURE__ */ s.jsx(
869
- "p",
870
- {
871
- id: g.helperTextId,
872
- className: "text-sup text-sumi-700 mb-2",
873
- children: a
874
- }
875
- ),
878
+ a && /* @__PURE__ */ s.jsx("p", { id: g.helperTextId, className: "text-sup text-sumi-700 mb-2", children: a }),
876
879
  _,
877
880
  c && /* @__PURE__ */ s.jsx(
878
881
  "p",
@@ -910,10 +913,7 @@ const ae = y.forwardRef((p, b) => {
910
913
  /* @__PURE__ */ s.jsx("legend", { children: /* @__PURE__ */ s.jsxs(
911
914
  "p",
912
915
  {
913
- className: P(
914
- "block mb-2 text-label",
915
- c && "text-sun-800"
916
- ),
916
+ className: P("block mb-2 text-label", c && "text-sun-800"),
917
917
  children: [
918
918
  f,
919
919
  o && /* @__PURE__ */ s.jsx("span", { className: "text-sun-800", children: " *" })
@@ -921,14 +921,7 @@ const ae = y.forwardRef((p, b) => {
921
921
  }
922
922
  ) }),
923
923
  /* @__PURE__ */ s.jsx("div", { className: P("inline-flex", I), children: h }),
924
- a && /* @__PURE__ */ s.jsx(
925
- "p",
926
- {
927
- id: T.helperTextId,
928
- className: "text-sup text-sumi-700 mt-2",
929
- children: a
930
- }
931
- ),
924
+ a && /* @__PURE__ */ s.jsx("p", { id: T.helperTextId, className: "text-sup text-sumi-700 mt-2", children: a }),
932
925
  c && /* @__PURE__ */ s.jsx(
933
926
  "p",
934
927
  {