@elmethis/qwik 0.0.21 → 0.0.23

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.
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, Slot, useSignal, useTask$, $, useComputed$, useOnDocument, useVisibleTask$, useContextProvider, createContextId, useContext, Fragment as Fragment$1 } from "@builder.io/qwik";
3
- import { mdiCodeTags, mdiClipboardCheckMultipleOutline, mdiClipboardMultipleOutline, mdiChevronRight, mdiPlus, mdiMessageImageOutline, mdiFile, mdiDownload, mdiLinkVariant, mdiHome, mdiApplicationOutline, mdiFolderOpen, mdiFormatQuoteOpen, mdiFormatQuoteClose, mdiAlertOctagram, mdiAlert, mdiShieldAlert, mdiLightbulbOn, mdiInformation } from "@mdi/js";
2
+ import { component$, Slot, useSignal, useTask$, $, useComputed$, useOnDocument, useId, useVisibleTask$, useContextProvider, createContextId, useContext, Fragment as Fragment$1 } from "@builder.io/qwik";
3
+ import { mdiCodeTags, mdiClipboardCheckMultipleOutline, mdiClipboardMultipleOutline, mdiChevronRight, mdiPlus, mdiArrowDownDropCircleOutline, mdiMenuDown, mdiMagnify, mdiLinkVariant, mdiArchive, mdiTag, mdiEarth, mdiKey, mdiLock, mdiAccount, mdiEmail, mdiPen, mdiText, mdiEyeOutline, mdiEyeOffOutline, mdiBackspaceOutline, mdiCheckCircle, mdiCheckCircleOutline, mdiMessageImageOutline, mdiFile, mdiDownload, mdiHome, mdiApplicationOutline, mdiFolderOpen, mdiFormatQuoteOpen, mdiFormatQuoteClose, mdiAlertOctagram, mdiAlert, mdiShieldAlert, mdiLightbulbOn, mdiInformation } from "@mdi/js";
4
4
  import { codeToHtml } from "shiki";
5
5
  import { renderToString } from "katex";
6
6
  import { kebabCase } from "lodash-es";
@@ -8,7 +8,7 @@ import { marked } from "marked";
8
8
  const caption$1 = "_caption_1j0ec_27";
9
9
  const divider = "_divider_1j0ec_50";
10
10
  const code$2 = "_code_1j0ec_1";
11
- const styles$t = {
11
+ const styles$z = {
12
12
  "code-block": "_code-block_1j0ec_1",
13
13
  "language-icon": "_language-icon_1j0ec_22",
14
14
  caption: caption$1,
@@ -68,7 +68,7 @@ const Typescript = component$(({ size = 24, ...props }) => {
68
68
  });
69
69
  });
70
70
  const path = "_path_1ccs2_1";
71
- const styles$s = {
71
+ const styles$y = {
72
72
  path
73
73
  };
74
74
  const Bash = component$(({ size = 24, ...props }) => {
@@ -84,7 +84,7 @@ const Bash = component$(({ size = 24, ...props }) => {
84
84
  d: "M4.24 4.24h119.53v119.53H4.24z"
85
85
  }),
86
86
  /* @__PURE__ */ jsx("path", {
87
- class: styles$s.path,
87
+ class: styles$y.path,
88
88
  d: "M109.01 28.64L71.28 6.24c-2.25-1.33-4.77-2-7.28-2s-5.03.67-7.28 2.01l-37.74 22.4c-4.5 2.67-7.28 7.61-7.28 12.96v44.8c0 5.35 2.77 10.29 7.28 12.96l37.73 22.4c2.25 1.34 4.76 2 7.28 2c2.51 0 5.03-.67 7.28-2l37.74-22.4c4.5-2.67 7.28-7.62 7.28-12.96V41.6c0-5.34-2.77-10.29-7.28-12.96M79.79 98.59l.06 3.22c0 .39-.25.83-.55.99l-1.91 1.1c-.3.15-.56-.03-.56-.42l-.03-3.17c-1.63.68-3.29.84-4.34.42c-.2-.08-.29-.37-.21-.71l.69-2.91c.06-.23.18-.46.34-.6c.06-.06.12-.1.18-.13c.11-.06.22-.07.31-.03c1.14.38 2.59.2 3.99-.5c1.78-.9 2.97-2.72 2.95-4.52c-.02-1.64-.9-2.31-3.05-2.33c-2.74.01-5.3-.53-5.34-4.57c-.03-3.32 1.69-6.78 4.43-8.96l-.03-3.25c0-.4.24-.84.55-1l1.85-1.18c.3-.15.56.04.56.43l.03 3.25c1.36-.54 2.54-.69 3.61-.44c.23.06.34.38.24.75l-.72 2.88c-.06.22-.18.44-.33.58a.8.8 0 0 1-.19.14c-.1.05-.19.06-.28.05c-.49-.11-1.65-.36-3.48.56c-1.92.97-2.59 2.64-2.58 3.88c.02 1.48.77 1.93 3.39 1.97c3.49.06 4.99 1.58 5.03 5.09c.05 3.44-1.79 7.15-4.61 9.41m26.34-60.5l-35.7 22.05c-4.45 2.6-7.73 5.52-7.74 10.89v43.99c0 3.21 1.3 5.29 3.29 5.9c-.65.11-1.32.19-1.98.19c-2.09 0-4.15-.57-5.96-1.64l-37.73-22.4c-3.69-2.19-5.98-6.28-5.98-10.67V41.6c0-4.39 2.29-8.48 5.98-10.67l37.74-22.4c1.81-1.07 3.87-1.64 5.96-1.64s4.15.57 5.96 1.64l37.74 22.4c3.11 1.85 5.21 5.04 5.8 8.63c-1.27-2.67-4.09-3.39-7.38-1.47"
89
89
  }),
90
90
  /* @__PURE__ */ jsx("path", {
@@ -524,13 +524,13 @@ const C = component$(({ size = 24, ...props }) => {
524
524
  ]
525
525
  });
526
526
  });
527
- const icon$3 = "_icon_1gvln_1";
528
- const styles$r = {
529
- icon: icon$3
527
+ const icon$4 = "_icon_1gvln_1";
528
+ const styles$x = {
529
+ icon: icon$4
530
530
  };
531
531
  const ElmMdiIcon = component$(({ d, size = "1em", color, lightColor, darkColor }) => {
532
532
  return /* @__PURE__ */ jsx("svg", {
533
- class: styles$r.icon,
533
+ class: styles$x.icon,
534
534
  style: {
535
535
  "--color": lightColor ?? color,
536
536
  "--dark-color": darkColor ?? color
@@ -639,7 +639,7 @@ const text$3 = "_text_1gswr_1";
639
639
  const code$1 = "_code_1gswr_12";
640
640
  const kbd = "_kbd_1gswr_21";
641
641
  const link$1 = "_link_1gswr_47";
642
- const styles$q = {
642
+ const styles$w = {
643
643
  text: text$3,
644
644
  code: code$1,
645
645
  kbd,
@@ -649,17 +649,17 @@ const text$2 = "_text_zryur_1";
649
649
  const textStyles = {
650
650
  text: text$2
651
651
  };
652
- const icon$2 = "_icon_19g82_1";
653
- const styles$p = {
654
- icon: icon$2
652
+ const icon$3 = "_icon_19g82_1";
653
+ const styles$v = {
654
+ icon: icon$3
655
655
  };
656
656
  const ElmInlineIcon = component$(({ src, alt }) => {
657
657
  return /* @__PURE__ */ jsx("span", {
658
- class: styles$p.icon,
658
+ class: styles$v.icon,
659
659
  children: /* @__PURE__ */ jsx("img", {
660
660
  src,
661
661
  alt,
662
- class: styles$p.icon
662
+ class: styles$v.icon
663
663
  })
664
664
  });
665
665
  });
@@ -670,7 +670,7 @@ const ElmInlineText = component$((props) => {
670
670
  }) : /* @__PURE__ */ jsx(Slot, {});
671
671
  if (props.kbd) {
672
672
  vnode = /* @__PURE__ */ jsx("kbd", {
673
- class: styles$q.kbd,
673
+ class: styles$w.kbd,
674
674
  children: vnode
675
675
  });
676
676
  }
@@ -696,13 +696,13 @@ const ElmInlineText = component$((props) => {
696
696
  }
697
697
  if (code2) {
698
698
  vnode = /* @__PURE__ */ jsx("code", {
699
- class: styles$q.code,
699
+ class: styles$w.code,
700
700
  children: vnode
701
701
  });
702
702
  }
703
703
  if (props.ruby) {
704
704
  vnode = /* @__PURE__ */ jsxs("ruby", {
705
- class: styles$q.text,
705
+ class: styles$w.text,
706
706
  children: [
707
707
  /* @__PURE__ */ jsx("span", {
708
708
  children: vnode
@@ -715,7 +715,7 @@ const ElmInlineText = component$((props) => {
715
715
  }
716
716
  const wrappedVnode = /* @__PURE__ */ jsx("span", {
717
717
  class: [
718
- styles$q.text,
718
+ styles$w.text,
719
719
  textStyles.text
720
720
  ],
721
721
  style: {
@@ -727,7 +727,7 @@ const ElmInlineText = component$((props) => {
727
727
  });
728
728
  if (props.href) {
729
729
  return /* @__PURE__ */ jsxs("a", {
730
- class: styles$q.link,
730
+ class: styles$w.link,
731
731
  href: props.href,
732
732
  style: {
733
733
  "--font-size": size
@@ -745,7 +745,7 @@ const ElmInlineText = component$((props) => {
745
745
  return wrappedVnode;
746
746
  });
747
747
  const code = "_code_1sw1e_1";
748
- const styles$o = {
748
+ const styles$u = {
749
749
  code
750
750
  };
751
751
  const ElmShikiHighlighter = component$(({ code: code2, language = "txt" }) => {
@@ -770,7 +770,7 @@ const ElmShikiHighlighter = component$(({ code: code2, language = "txt" }) => {
770
770
  }
771
771
  });
772
772
  return /* @__PURE__ */ jsx("pre", {
773
- class: styles$o.code,
773
+ class: styles$u.code,
774
774
  dangerouslySetInnerHTML: rawHtml.value
775
775
  });
776
776
  });
@@ -789,19 +789,19 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
789
789
  }
790
790
  });
791
791
  return /* @__PURE__ */ jsxs("figure", {
792
- class: styles$t["code-block"],
792
+ class: styles$z["code-block"],
793
793
  style: {
794
794
  margin
795
795
  },
796
796
  children: [
797
797
  /* @__PURE__ */ jsx("span", {
798
- class: styles$t["language-icon"],
798
+ class: styles$z["language-icon"],
799
799
  children: /* @__PURE__ */ jsx(ElmLanguageIcon, {
800
800
  language
801
801
  })
802
802
  }),
803
803
  /* @__PURE__ */ jsx("span", {
804
- class: styles$t.caption,
804
+ class: styles$z.caption,
805
805
  children: /* @__PURE__ */ jsxs(ElmInlineText, {
806
806
  children: [
807
807
  caption2 || language,
@@ -810,7 +810,7 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
810
810
  })
811
811
  }),
812
812
  /* @__PURE__ */ jsx("div", {
813
- class: styles$t["copy-icon"],
813
+ class: styles$z["copy-icon"],
814
814
  onClick$: copyToClipboard,
815
815
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
816
816
  size: "1.25rem",
@@ -819,10 +819,10 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
819
819
  })
820
820
  }),
821
821
  /* @__PURE__ */ jsx("hr", {
822
- class: styles$t.divider
822
+ class: styles$z.divider
823
823
  }),
824
824
  /* @__PURE__ */ jsx("div", {
825
- class: styles$t.code,
825
+ class: styles$z.code,
826
826
  children: /* @__PURE__ */ jsx(ElmShikiHighlighter, {
827
827
  code: code2,
828
828
  language
@@ -842,7 +842,7 @@ const ElmKatex = component$(({ expression, block = false }) => {
842
842
  });
843
843
  });
844
844
  const parallax = "_parallax_1kb0k_1";
845
- const styles$n = {
845
+ const styles$t = {
846
846
  "parallax-watcher": "_parallax-watcher_1kb0k_1",
847
847
  parallax
848
848
  };
@@ -851,13 +851,13 @@ const ElmParallax = component$(({ images }) => {
851
851
  return /* @__PURE__ */ jsxs(Fragment, {
852
852
  children: [
853
853
  /* @__PURE__ */ jsx("div", {
854
- class: styles$n["parallax-watcher"],
854
+ class: styles$t["parallax-watcher"],
855
855
  "window:onScroll$": () => {
856
856
  y.value = window.scrollY;
857
857
  }
858
858
  }),
859
859
  images.map((image2, index) => /* @__PURE__ */ jsx("div", {
860
- class: styles$n.parallax,
860
+ class: styles$t.parallax,
861
861
  style: {
862
862
  backgroundImage: `url(${image2})`,
863
863
  transform: `scale(1.2) translateY(${y.value / (1e3 * (index + 1))}%)`,
@@ -871,7 +871,7 @@ const toggle = "_toggle_1nxqa_1";
871
871
  const summary = "_summary_1nxqa_14";
872
872
  const content$2 = "_content_1nxqa_60";
873
873
  const footer = "_footer_1nxqa_80";
874
- const styles$m = {
874
+ const styles$s = {
875
875
  toggle,
876
876
  "toggle-closed": "_toggle-closed_1nxqa_7",
877
877
  "toggle-open": "_toggle-open_1nxqa_10",
@@ -899,29 +899,29 @@ const ElmToggle = component$(({ summary: summary2 }) => {
899
899
  });
900
900
  return /* @__PURE__ */ jsxs("div", {
901
901
  class: [
902
- styles$m.toggle,
902
+ styles$s.toggle,
903
903
  {
904
- [styles$m["toggle-open"]]: isOpen.value,
905
- [styles$m["toggle-closed"]]: !isOpen.value
904
+ [styles$s["toggle-open"]]: isOpen.value,
905
+ [styles$s["toggle-closed"]]: !isOpen.value
906
906
  }
907
907
  ],
908
908
  children: [
909
909
  /* @__PURE__ */ jsxs("div", {
910
910
  class: [
911
- styles$m.summary,
911
+ styles$s.summary,
912
912
  {
913
- [styles$m["summary-open"]]: isOpen.value,
914
- [styles$m["summary-closed"]]: !isOpen.value
913
+ [styles$s["summary-open"]]: isOpen.value,
914
+ [styles$s["summary-closed"]]: !isOpen.value
915
915
  }
916
916
  ],
917
917
  onClick$: toggle2,
918
918
  children: [
919
919
  /* @__PURE__ */ jsx("span", {
920
920
  class: [
921
- styles$m["chevron-icon"],
921
+ styles$s["chevron-icon"],
922
922
  {
923
- [styles$m["chevron-icon-open"]]: isOpen.value,
924
- [styles$m["chevron-icon-closed"]]: !isOpen.value
923
+ [styles$s["chevron-icon-open"]]: isOpen.value,
924
+ [styles$s["chevron-icon-closed"]]: !isOpen.value
925
925
  }
926
926
  ],
927
927
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
@@ -929,17 +929,17 @@ const ElmToggle = component$(({ summary: summary2 }) => {
929
929
  })
930
930
  }),
931
931
  /* @__PURE__ */ jsx("span", {
932
- class: styles$m["summary-text"],
932
+ class: styles$s["summary-text"],
933
933
  children: summary2 ? summary2 : /* @__PURE__ */ jsx(Slot, {
934
934
  name: "summary"
935
935
  })
936
936
  }),
937
937
  /* @__PURE__ */ jsx("span", {
938
938
  class: [
939
- styles$m["plus-icon"],
939
+ styles$s["plus-icon"],
940
940
  {
941
- [styles$m["plus-icon-open"]]: isOpen.value,
942
- [styles$m["plus-icon-closed"]]: !isOpen.value
941
+ [styles$s["plus-icon-open"]]: isOpen.value,
942
+ [styles$s["plus-icon-closed"]]: !isOpen.value
943
943
  }
944
944
  ],
945
945
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
@@ -952,30 +952,30 @@ const ElmToggle = component$(({ summary: summary2 }) => {
952
952
  }),
953
953
  /* @__PURE__ */ jsx("div", {
954
954
  class: [
955
- styles$m.content,
955
+ styles$s.content,
956
956
  {
957
- [styles$m["content-open"]]: isOpen.value,
958
- [styles$m["content-closed"]]: !isOpen.value
957
+ [styles$s["content-open"]]: isOpen.value,
958
+ [styles$s["content-closed"]]: !isOpen.value
959
959
  }
960
960
  ],
961
961
  children: /* @__PURE__ */ jsx(Slot, {})
962
962
  }),
963
963
  /* @__PURE__ */ jsxs("div", {
964
- class: styles$m.footer,
964
+ class: styles$s.footer,
965
965
  onClick$: toggle2,
966
966
  children: [
967
967
  /* @__PURE__ */ jsx("span", {
968
- class: styles$m["footer-chevron-icon"],
968
+ class: styles$s["footer-chevron-icon"],
969
969
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
970
970
  d: mdiChevronRight,
971
971
  color: "gray"
972
972
  })
973
973
  }),
974
974
  /* @__PURE__ */ jsx("hr", {
975
- class: styles$m["footer-line"]
975
+ class: styles$s["footer-line"]
976
976
  }),
977
977
  /* @__PURE__ */ jsx("span", {
978
- class: styles$m["footer-cross-icon"],
978
+ class: styles$s["footer-cross-icon"],
979
979
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
980
980
  d: mdiPlus,
981
981
  color: "#c56565"
@@ -985,17 +985,17 @@ const ElmToggle = component$(({ summary: summary2 }) => {
985
985
  children: "CLOSE"
986
986
  }),
987
987
  /* @__PURE__ */ jsx("span", {
988
- class: styles$m["footer-cross-icon"],
988
+ class: styles$s["footer-cross-icon"],
989
989
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
990
990
  d: mdiPlus,
991
991
  color: "#c56565"
992
992
  })
993
993
  }),
994
994
  /* @__PURE__ */ jsx("hr", {
995
- class: styles$m["footer-line"]
995
+ class: styles$s["footer-line"]
996
996
  }),
997
997
  /* @__PURE__ */ jsx("span", {
998
- class: styles$m["footer-chevron-icon"],
998
+ class: styles$s["footer-chevron-icon"],
999
999
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
1000
1000
  d: mdiChevronRight,
1001
1001
  color: "gray"
@@ -1006,50 +1006,50 @@ const ElmToggle = component$(({ summary: summary2 }) => {
1006
1006
  ]
1007
1007
  });
1008
1008
  });
1009
- const styles$l = {
1009
+ const styles$r = {
1010
1010
  "block-fallback": "_block-fallback_rt986_1"
1011
1011
  };
1012
- const wrapper$1 = "_wrapper_1yktj_12";
1012
+ const wrapper$3 = "_wrapper_1yktj_12";
1013
1013
  const dot = "_dot_1yktj_22";
1014
- const styles$k = {
1015
- wrapper: wrapper$1,
1014
+ const styles$q = {
1015
+ wrapper: wrapper$3,
1016
1016
  dot
1017
1017
  };
1018
1018
  const ElmDotLoadingIcon = component$(({ size = "4em", color = "#606875" }) => {
1019
1019
  return /* @__PURE__ */ jsxs("div", {
1020
- class: styles$k.wrapper,
1020
+ class: styles$q.wrapper,
1021
1021
  style: {
1022
1022
  "--size": size,
1023
1023
  "--color": color
1024
1024
  },
1025
1025
  children: [
1026
1026
  /* @__PURE__ */ jsx("div", {
1027
- class: styles$k.dot,
1027
+ class: styles$q.dot,
1028
1028
  "aria-hidden": "true"
1029
1029
  }),
1030
1030
  /* @__PURE__ */ jsx("div", {
1031
- class: styles$k.dot,
1031
+ class: styles$q.dot,
1032
1032
  "aria-hidden": "true"
1033
1033
  }),
1034
1034
  /* @__PURE__ */ jsx("div", {
1035
- class: styles$k.dot,
1035
+ class: styles$q.dot,
1036
1036
  "aria-hidden": "true"
1037
1037
  })
1038
1038
  ]
1039
1039
  });
1040
1040
  });
1041
- const styles$j = {
1041
+ const styles$p = {
1042
1042
  "rectangle-wave": "_rectangle-wave_hej9g_17"
1043
1043
  };
1044
1044
  const ElmRectangleWave = component$(() => {
1045
1045
  return /* @__PURE__ */ jsx("div", {
1046
1046
  "aria-hidden": "true",
1047
- class: styles$j["rectangle-wave"]
1047
+ class: styles$p["rectangle-wave"]
1048
1048
  });
1049
1049
  });
1050
1050
  const ElmBlockFallback = component$(({ height = "16rem" }) => {
1051
1051
  return /* @__PURE__ */ jsxs("div", {
1052
- class: styles$l["block-fallback"],
1052
+ class: styles$r["block-fallback"],
1053
1053
  style: {
1054
1054
  "--height": height
1055
1055
  },
@@ -1059,6 +1059,609 @@ const ElmBlockFallback = component$(({ height = "16rem" }) => {
1059
1059
  ]
1060
1060
  });
1061
1061
  });
1062
+ const button = "_button_1ykfy_1";
1063
+ const normal = "_normal_1ykfy_32";
1064
+ const primary = "_primary_1ykfy_41";
1065
+ const colored = "_colored_1ykfy_50";
1066
+ const enable = "_enable_1ykfy_54";
1067
+ const flex = "_flex_1ykfy_76";
1068
+ const ripple = "_ripple_1ykfy_97";
1069
+ const styles$o = {
1070
+ button,
1071
+ "button-ornament": "_button-ornament_1ykfy_21",
1072
+ normal,
1073
+ primary,
1074
+ colored,
1075
+ enable,
1076
+ flex,
1077
+ ripple
1078
+ };
1079
+ const ElmButton = component$((props) => {
1080
+ const clicked = useSignal(false);
1081
+ const handleClick = $(async () => {
1082
+ if (!props.loading && !props.disabled) {
1083
+ if (props.onClick$) {
1084
+ clicked.value = true;
1085
+ setTimeout(() => clicked.value = false, 300);
1086
+ await props.onClick$();
1087
+ }
1088
+ }
1089
+ });
1090
+ return /* @__PURE__ */ jsxs("button", {
1091
+ onClick$: handleClick,
1092
+ class: [
1093
+ styles$o.button,
1094
+ !props.loading && !props.disabled && styles$o.enable,
1095
+ props.color && styles$o.colored,
1096
+ !props.color && !props.primary && styles$o.normal,
1097
+ !props.color && props.primary && styles$o.primary
1098
+ ],
1099
+ style: {
1100
+ display: props.block ? "flex" : "inline-flex",
1101
+ width: props.block ? "100%" : "auto",
1102
+ cursor: props.disabled ? "not-allowed" : props.loading ? "progress" : "pointer",
1103
+ "--opacity": props.disabled || props.loading ? 0.6 : void 0,
1104
+ "--color": props.color
1105
+ },
1106
+ children: [
1107
+ clicked.value && /* @__PURE__ */ jsx("div", {
1108
+ class: styles$o.ripple
1109
+ }),
1110
+ props.loading ? /* @__PURE__ */ jsx(ElmDotLoadingIcon, {
1111
+ size: "1.5rem"
1112
+ }) : /* @__PURE__ */ jsx("span", {
1113
+ class: styles$o.flex,
1114
+ children: /* @__PURE__ */ jsx(Slot, {})
1115
+ }),
1116
+ /* @__PURE__ */ jsx("div", {
1117
+ class: styles$o["button-ornament"]
1118
+ })
1119
+ ]
1120
+ });
1121
+ });
1122
+ const container$2 = "_container_101ok_1";
1123
+ const checkbox = "_checkbox_101ok_19";
1124
+ const rect = "_rect_101ok_27";
1125
+ const loading$1 = "_loading_101ok_40";
1126
+ const styles$n = {
1127
+ container: container$2,
1128
+ "container--disable": "_container--disable_101ok_11",
1129
+ checkbox,
1130
+ rect,
1131
+ "rect--loading": "_rect--loading_101ok_30",
1132
+ "rect--checked": "_rect--checked_101ok_33",
1133
+ loading: loading$1,
1134
+ "check-line": "_check-line_101ok_56"
1135
+ };
1136
+ const ElmCheckbox = component$((props) => {
1137
+ const internalChecked = useSignal(false);
1138
+ const isChecked = props.checked ?? internalChecked;
1139
+ const toggleCheck = $(() => {
1140
+ if (!props.loading && !props.disable) {
1141
+ isChecked.value = !isChecked.value;
1142
+ }
1143
+ });
1144
+ return /* @__PURE__ */ jsx("div", {
1145
+ class: [
1146
+ styles$n.container,
1147
+ props.disable && styles$n["container--disable"]
1148
+ ],
1149
+ onClick$: toggleCheck,
1150
+ children: /* @__PURE__ */ jsxs("div", {
1151
+ style: {
1152
+ display: "flex",
1153
+ alignItems: "center",
1154
+ gap: "0.5rem"
1155
+ },
1156
+ children: [
1157
+ /* @__PURE__ */ jsxs("svg", {
1158
+ width: "24",
1159
+ height: "24",
1160
+ class: styles$n.checkbox,
1161
+ children: [
1162
+ /* @__PURE__ */ jsxs("circle", {
1163
+ cx: "0",
1164
+ cy: "0",
1165
+ r: "2",
1166
+ class: styles$n.loading,
1167
+ style: {
1168
+ opacity: props.loading ? 1 : 0
1169
+ },
1170
+ children: [
1171
+ /* @__PURE__ */ jsx("animate", {
1172
+ attributeName: "cx",
1173
+ values: "4; 20; 20; 4; 4",
1174
+ dur: "1.2s",
1175
+ repeatCount: "indefinite",
1176
+ keySplines: "0.25 0.1 0.25 1; 0.42 0 0.58 1; 0.25 0.1 0.25 1; 0.42 0 0.58 1",
1177
+ calcMode: "spline"
1178
+ }),
1179
+ /* @__PURE__ */ jsx("animate", {
1180
+ attributeName: "cy",
1181
+ values: "4; 4; 20; 20; 4",
1182
+ dur: "1.2s",
1183
+ repeatCount: "indefinite",
1184
+ keySplines: "0.25 0.1 0.25 1; 0.42 0 0.58 1; 0.25 0.1 0.25 1; 0.42 0 0.58 1",
1185
+ calcMode: "spline"
1186
+ })
1187
+ ]
1188
+ }),
1189
+ /* @__PURE__ */ jsxs("circle", {
1190
+ cx: "20",
1191
+ cy: "20",
1192
+ r: "2",
1193
+ class: styles$n.loading,
1194
+ style: {
1195
+ opacity: props.loading ? 1 : 0
1196
+ },
1197
+ children: [
1198
+ /* @__PURE__ */ jsx("animate", {
1199
+ attributeName: "cx",
1200
+ values: "20; 4; 4; 20; 20",
1201
+ dur: "1.2s",
1202
+ repeatCount: "indefinite",
1203
+ keySplines: "0.25 0.1 0.25 1; 0.42 0 0.58 1; 0.25 0.1 0.25 1; 0.42 0 0.58 1",
1204
+ calcMode: "spline"
1205
+ }),
1206
+ /* @__PURE__ */ jsx("animate", {
1207
+ attributeName: "cy",
1208
+ values: "20; 20; 4; 4; 20",
1209
+ dur: "1.2s",
1210
+ repeatCount: "indefinite",
1211
+ keySplines: "0.25 0.1 0.25 1; 0.42 0 0.58 1; 0.25 0.1 0.25 1; 0.42 0 0.58 1",
1212
+ calcMode: "spline"
1213
+ })
1214
+ ]
1215
+ }),
1216
+ /* @__PURE__ */ jsx("rect", {
1217
+ x: "4",
1218
+ y: "4",
1219
+ width: "16",
1220
+ height: "16",
1221
+ class: [
1222
+ styles$n.rect,
1223
+ isChecked.value && styles$n["rect--checked"],
1224
+ props.loading && styles$n["rect--loading"]
1225
+ ],
1226
+ "stroke-width": "0.8"
1227
+ }),
1228
+ isChecked.value && /* @__PURE__ */ jsx("polyline", {
1229
+ class: styles$n["check-line"],
1230
+ points: "5,12 10,17 19,8",
1231
+ "stroke-width": "1.5",
1232
+ fill: "transparent"
1233
+ }),
1234
+ /* @__PURE__ */ jsx("line", {
1235
+ x1: "0",
1236
+ y1: "1",
1237
+ x2: "4",
1238
+ y2: "1",
1239
+ "stroke-width": "2",
1240
+ fill: "transparent"
1241
+ }),
1242
+ /* @__PURE__ */ jsx("line", {
1243
+ x1: "4",
1244
+ y1: "0",
1245
+ x2: "24",
1246
+ y2: "0",
1247
+ "stroke-width": "1",
1248
+ fill: "transparent"
1249
+ }),
1250
+ /* @__PURE__ */ jsx("line", {
1251
+ x1: "0",
1252
+ y1: "4",
1253
+ x2: "0",
1254
+ y2: "16",
1255
+ "stroke-width": "1",
1256
+ fill: "transparent"
1257
+ }),
1258
+ /* @__PURE__ */ jsx("line", {
1259
+ x1: "0",
1260
+ y1: "18",
1261
+ x2: "0",
1262
+ y2: "20",
1263
+ "stroke-width": "1",
1264
+ fill: "transparent"
1265
+ }),
1266
+ /* @__PURE__ */ jsx("line", {
1267
+ x1: "0",
1268
+ y1: "24",
1269
+ x2: "20",
1270
+ y2: "24",
1271
+ "stroke-width": "1",
1272
+ fill: "transparent"
1273
+ }),
1274
+ /* @__PURE__ */ jsx("line", {
1275
+ x1: "20",
1276
+ y1: "23",
1277
+ x2: "24",
1278
+ y2: "23",
1279
+ "stroke-width": "1.5",
1280
+ fill: "transparent"
1281
+ }),
1282
+ /* @__PURE__ */ jsx("line", {
1283
+ x1: "24",
1284
+ y1: "4",
1285
+ x2: "24",
1286
+ y2: "20",
1287
+ style: {
1288
+ strokeWidth: "1px"
1289
+ },
1290
+ fill: "transparent"
1291
+ })
1292
+ ]
1293
+ }),
1294
+ /* @__PURE__ */ jsx(ElmInlineText, {
1295
+ text: props.label
1296
+ })
1297
+ ]
1298
+ })
1299
+ });
1300
+ });
1301
+ const wrapper$2 = "_wrapper_1o5x2_1";
1302
+ const active$1 = "_active_1o5x2_23";
1303
+ const header$2 = "_header_1o5x2_27";
1304
+ const label$1 = "_label_1o5x2_35";
1305
+ const body$2 = "_body_1o5x2_48";
1306
+ const select = "_select_1o5x2_57";
1307
+ const selected = "_selected_1o5x2_66";
1308
+ const fallback$1 = "_fallback_1o5x2_71";
1309
+ const pulldown = "_pulldown_1o5x2_79";
1310
+ const option = "_option_1o5x2_96";
1311
+ const description$1 = "_description_1o5x2_116";
1312
+ const styles$m = {
1313
+ wrapper: wrapper$2,
1314
+ active: active$1,
1315
+ header: header$2,
1316
+ label: label$1,
1317
+ body: body$2,
1318
+ select,
1319
+ selected,
1320
+ fallback: fallback$1,
1321
+ pulldown,
1322
+ option,
1323
+ description: description$1
1324
+ };
1325
+ const ElmSelect = component$((props) => {
1326
+ const internalSelected = useSignal(null);
1327
+ const selectedOption = props.selectedOption ?? internalSelected;
1328
+ const isActive = useSignal(false);
1329
+ const containerRef = useSignal();
1330
+ const handleToggle = $(() => {
1331
+ if (!props.disabled && !props.loading) {
1332
+ isActive.value = !isActive.value;
1333
+ }
1334
+ });
1335
+ const handleSelect = $((id) => {
1336
+ if (props.options) {
1337
+ const selected2 = props.options.find((option2) => option2.id === id);
1338
+ if (selected2) {
1339
+ selectedOption.value = selected2;
1340
+ }
1341
+ }
1342
+ });
1343
+ useOnDocument("click", $((event) => {
1344
+ if (isActive.value && containerRef.value) {
1345
+ const target = event.target;
1346
+ if (!containerRef.value.contains(target)) {
1347
+ isActive.value = false;
1348
+ }
1349
+ }
1350
+ }));
1351
+ return /* @__PURE__ */ jsxs("div", {
1352
+ ref: containerRef,
1353
+ class: [
1354
+ styles$m.wrapper,
1355
+ isActive.value && styles$m.active
1356
+ ],
1357
+ style: {
1358
+ backgroundColor: props.disabled || props.loading ? "rgba(0,0,0,0.15)" : void 0,
1359
+ "--highlight-color": isActive.value ? "#bfa056" : void 0
1360
+ },
1361
+ onClick$: handleToggle,
1362
+ children: [
1363
+ /* @__PURE__ */ jsx("div", {
1364
+ class: styles$m.header,
1365
+ children: /* @__PURE__ */ jsx("span", {
1366
+ class: [
1367
+ styles$m.label,
1368
+ textStyles.text
1369
+ ],
1370
+ children: props.label
1371
+ })
1372
+ }),
1373
+ /* @__PURE__ */ jsx("div", {
1374
+ class: styles$m.body,
1375
+ children: /* @__PURE__ */ jsxs("div", {
1376
+ class: styles$m.select,
1377
+ children: [
1378
+ /* @__PURE__ */ jsx("div", {
1379
+ class: [
1380
+ styles$m.selected,
1381
+ textStyles.text
1382
+ ],
1383
+ children: selectedOption.value ? /* @__PURE__ */ jsxs("div", {
1384
+ children: [
1385
+ /* @__PURE__ */ jsx("span", {
1386
+ children: selectedOption.value.label
1387
+ }),
1388
+ selectedOption.value.description && /* @__PURE__ */ jsx("span", {
1389
+ class: styles$m.description,
1390
+ children: selectedOption.value.description
1391
+ })
1392
+ ]
1393
+ }, selectedOption.value.id) : /* @__PURE__ */ jsxs("div", {
1394
+ class: styles$m.fallback,
1395
+ children: [
1396
+ /* @__PURE__ */ jsx(ElmMdiIcon, {
1397
+ d: mdiArrowDownDropCircleOutline
1398
+ }),
1399
+ /* @__PURE__ */ jsx("span", {
1400
+ children: props.placeholder ?? "Select an option"
1401
+ })
1402
+ ]
1403
+ })
1404
+ }),
1405
+ /* @__PURE__ */ jsx(ElmMdiIcon, {
1406
+ d: mdiMenuDown,
1407
+ size: "1.5rem"
1408
+ }),
1409
+ isActive.value && /* @__PURE__ */ jsx("div", {
1410
+ class: styles$m.pulldown,
1411
+ children: props.options.map((option2) => /* @__PURE__ */ jsxs("div", {
1412
+ class: [
1413
+ styles$m.option,
1414
+ textStyles.text
1415
+ ],
1416
+ onClick$: (e) => {
1417
+ e.stopPropagation();
1418
+ handleSelect(option2.id);
1419
+ isActive.value = false;
1420
+ },
1421
+ children: [
1422
+ /* @__PURE__ */ jsx(ElmMdiIcon, {
1423
+ d: mdiChevronRight,
1424
+ color: "#868e9c",
1425
+ size: "0.75em"
1426
+ }),
1427
+ /* @__PURE__ */ jsx("span", {
1428
+ children: option2.label
1429
+ }),
1430
+ option2.description && /* @__PURE__ */ jsx("span", {
1431
+ class: styles$m.description,
1432
+ children: option2.description
1433
+ })
1434
+ ]
1435
+ }, option2.id))
1436
+ })
1437
+ ]
1438
+ })
1439
+ })
1440
+ ]
1441
+ });
1442
+ });
1443
+ const bar = "_bar_gpty5_5";
1444
+ const circle = "_circle_gpty5_25";
1445
+ const styles$l = {
1446
+ "switch": "_switch_gpty5_1",
1447
+ bar,
1448
+ "bar--checked": "_bar--checked_gpty5_17",
1449
+ "bar--disabled": "_bar--disabled_gpty5_21",
1450
+ circle,
1451
+ "circle--checked": "_circle--checked_gpty5_36",
1452
+ "circle--disabled": "_circle--disabled_gpty5_39"
1453
+ };
1454
+ const ElmSwitch = component$((props) => {
1455
+ const color = props.color ?? "#bfa056";
1456
+ const size = props.size ?? "18px";
1457
+ const internalChecked = useSignal(false);
1458
+ const checked = props.checked ?? internalChecked;
1459
+ const handleClick = $(() => {
1460
+ if (!props.disabled) {
1461
+ checked.value = !checked.value;
1462
+ }
1463
+ });
1464
+ return /* @__PURE__ */ jsxs("div", {
1465
+ onClick$: handleClick,
1466
+ style: {
1467
+ "--color": color,
1468
+ "--padding": "2px",
1469
+ "--size": size,
1470
+ "--width": "calc(var(--size) * 2 + var(--padding) * 2)"
1471
+ },
1472
+ children: [
1473
+ /* @__PURE__ */ jsx("input", {
1474
+ class: styles$l.switch,
1475
+ type: "checkbox",
1476
+ checked: checked.value,
1477
+ disabled: props.disabled
1478
+ }),
1479
+ /* @__PURE__ */ jsx("div", {
1480
+ class: [
1481
+ styles$l.bar,
1482
+ checked.value && styles$l["bar--checked"],
1483
+ props.disabled && styles$l["bar--disabled"]
1484
+ ],
1485
+ children: /* @__PURE__ */ jsx("div", {
1486
+ class: [
1487
+ styles$l.circle,
1488
+ checked.value && styles$l["circle--checked"],
1489
+ props.disabled && styles$l["circle--disabled"]
1490
+ ]
1491
+ })
1492
+ })
1493
+ ]
1494
+ });
1495
+ });
1496
+ const loading = "_loading_1yj0v_19";
1497
+ const wrapper$1 = "_wrapper_1yj0v_33";
1498
+ const active = "_active_1yj0v_55";
1499
+ const header$1 = "_header_1yj0v_59";
1500
+ const label = "_label_1yj0v_67";
1501
+ const requierd = "_requierd_1yj0v_82";
1502
+ const body$1 = "_body_1yj0v_88";
1503
+ const input = "_input_1yj0v_109";
1504
+ const icon$2 = "_icon_1yj0v_136";
1505
+ const suffix = "_suffix_1yj0v_153";
1506
+ const styles$k = {
1507
+ loading,
1508
+ wrapper: wrapper$1,
1509
+ active,
1510
+ header: header$1,
1511
+ label,
1512
+ requierd,
1513
+ body: body$1,
1514
+ input,
1515
+ "icon-box": "_icon-box_1yj0v_136",
1516
+ icon: icon$2,
1517
+ suffix
1518
+ };
1519
+ const ElmTextField = component$((props) => {
1520
+ const id = useId();
1521
+ const isFocused = useSignal(false);
1522
+ const inputType = useSignal(props.isPassword ? "password" : "text");
1523
+ const internalValue = useSignal("");
1524
+ const input2 = props.value ?? internalValue;
1525
+ const handleDelete = $(() => {
1526
+ if (!props.loading && !props.disabled) {
1527
+ input2.value = "";
1528
+ }
1529
+ });
1530
+ const handleVisibleSwitch = $(() => {
1531
+ if (!props.loading && !props.disabled) {
1532
+ inputType.value = inputType.value === "text" ? "password" : "text";
1533
+ }
1534
+ });
1535
+ const iconMap = {
1536
+ text: mdiText,
1537
+ pen: mdiPen,
1538
+ email: mdiEmail,
1539
+ user: mdiAccount,
1540
+ lock: mdiLock,
1541
+ key: mdiKey,
1542
+ earth: mdiEarth,
1543
+ tag: mdiTag,
1544
+ archive: mdiArchive,
1545
+ link: mdiLinkVariant,
1546
+ search: mdiMagnify
1547
+ };
1548
+ return /* @__PURE__ */ jsxs("div", {
1549
+ class: [
1550
+ styles$k.wrapper,
1551
+ isFocused.value && styles$k.active
1552
+ ],
1553
+ style: {
1554
+ backgroundColor: props.disabled || props.loading ? "rgba(0,0,0,0.15)" : void 0,
1555
+ "--highlight-color": isFocused.value ? "#bfa056" : void 0
1556
+ },
1557
+ children: [
1558
+ /* @__PURE__ */ jsxs("div", {
1559
+ class: styles$k.header,
1560
+ children: [
1561
+ /* @__PURE__ */ jsxs("label", {
1562
+ for: id,
1563
+ class: styles$k.label,
1564
+ children: [
1565
+ /* @__PURE__ */ jsx("span", {
1566
+ children: props.label
1567
+ }),
1568
+ props.required && /* @__PURE__ */ jsx("span", {
1569
+ class: styles$k.requierd,
1570
+ children: "*"
1571
+ })
1572
+ ]
1573
+ }),
1574
+ props.maxLength != null && /* @__PURE__ */ jsx(ElmInlineText, {
1575
+ text: `${input2.value.length} / ${props.maxLength}`,
1576
+ color: input2.value.length > props.maxLength ? "#c56565" : "gray",
1577
+ size: "0.75rem"
1578
+ })
1579
+ ]
1580
+ }),
1581
+ /* @__PURE__ */ jsxs("div", {
1582
+ class: styles$k.body,
1583
+ children: [
1584
+ props.icon && /* @__PURE__ */ jsx(ElmMdiIcon, {
1585
+ d: iconMap[props.icon],
1586
+ size: "1.5rem",
1587
+ color: "gray"
1588
+ }),
1589
+ /* @__PURE__ */ jsx("input", {
1590
+ id,
1591
+ "bind:value": input2,
1592
+ type: inputType.value,
1593
+ class: styles$k.input,
1594
+ placeholder: props.placeholder,
1595
+ onFocus$: () => isFocused.value = true,
1596
+ onBlur$: () => isFocused.value = false,
1597
+ disabled: props.disabled || props.loading,
1598
+ style: {
1599
+ cursor: props.disabled ? "not-allowed" : props.loading ? "progress" : "auto"
1600
+ },
1601
+ "aria-required": props.required
1602
+ }),
1603
+ /* @__PURE__ */ jsxs("div", {
1604
+ class: styles$k["icon-box"],
1605
+ children: [
1606
+ /* @__PURE__ */ jsx("span", {
1607
+ class: styles$k.suffix,
1608
+ children: props.suffix != null && /* @__PURE__ */ jsx(ElmInlineText, {
1609
+ text: props.suffix
1610
+ })
1611
+ }),
1612
+ /* @__PURE__ */ jsx("div", {
1613
+ class: styles$k.icon,
1614
+ onClick$: handleVisibleSwitch,
1615
+ children: /* @__PURE__ */ jsx(ElmMdiIcon, {
1616
+ d: inputType.value === "text" ? mdiEyeOutline : mdiEyeOffOutline,
1617
+ size: "1.75em",
1618
+ color: "gray"
1619
+ })
1620
+ }),
1621
+ /* @__PURE__ */ jsx("div", {
1622
+ class: styles$k.icon,
1623
+ onClick$: handleDelete,
1624
+ children: /* @__PURE__ */ jsx(ElmMdiIcon, {
1625
+ d: mdiBackspaceOutline,
1626
+ size: "1.75em",
1627
+ color: "gray"
1628
+ })
1629
+ })
1630
+ ]
1631
+ })
1632
+ ]
1633
+ }),
1634
+ /* @__PURE__ */ jsx("div", {
1635
+ class: styles$k.loading,
1636
+ style: {
1637
+ opacity: props.loading ? 0.2 : 0
1638
+ }
1639
+ })
1640
+ ]
1641
+ });
1642
+ });
1643
+ const validation = "_validation_r3xix_1";
1644
+ const styles$j = {
1645
+ validation
1646
+ };
1647
+ const ElmValidation = component$(({ text: text2, validColor = "#449763", isValid }) => {
1648
+ return /* @__PURE__ */ jsxs("div", {
1649
+ class: styles$j.validation,
1650
+ style: {
1651
+ "--opacity": isValid ? 1 : 0.5
1652
+ },
1653
+ children: [
1654
+ /* @__PURE__ */ jsx(ElmMdiIcon, {
1655
+ d: isValid ? mdiCheckCircle : mdiCheckCircleOutline,
1656
+ color: isValid ? validColor : void 0
1657
+ }),
1658
+ /* @__PURE__ */ jsx(ElmInlineText, {
1659
+ text: text2,
1660
+ color: isValid ? validColor : void 0
1661
+ })
1662
+ ]
1663
+ });
1664
+ });
1062
1665
  const LOCAL_STORAGE_KEY = "elmethis-theme";
1063
1666
  function useElmethisTheme() {
1064
1667
  const isDarkTheme = useSignal(false);
@@ -2613,7 +3216,9 @@ export {
2613
3216
  ElmBlockQuote,
2614
3217
  ElmBookmark,
2615
3218
  ElmBreadcrumb,
3219
+ ElmButton,
2616
3220
  ElmCallout,
3221
+ ElmCheckbox,
2617
3222
  ElmCodeBlock,
2618
3223
  ElmDivider,
2619
3224
  ElmDotLoadingIcon,
@@ -2632,12 +3237,16 @@ export {
2632
3237
  ElmParagraph,
2633
3238
  ElmParallax,
2634
3239
  ElmRectangleWave,
3240
+ ElmSelect,
2635
3241
  ElmShikiHighlighter,
3242
+ ElmSwitch,
2636
3243
  ElmTable,
2637
3244
  ElmTableBody,
2638
3245
  ElmTableCell,
2639
3246
  ElmTableHeader,
2640
3247
  ElmTableRow,
3248
+ ElmTextField,
2641
3249
  ElmToggle,
2642
- ElmToggleTheme
3250
+ ElmToggleTheme,
3251
+ ElmValidation
2643
3252
  };