@elmethis/qwik 0.0.22 → 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$, useId, useOnDocument, useVisibleTask$, useContextProvider, createContextId, useContext, Fragment as Fragment$1 } from "@builder.io/qwik";
3
- import { mdiCodeTags, mdiClipboardCheckMultipleOutline, mdiClipboardMultipleOutline, mdiChevronRight, mdiPlus, mdiMagnify, mdiLinkVariant, mdiArchive, mdiTag, mdiEarth, mdiKey, mdiLock, mdiAccount, mdiEmail, mdiPen, mdiText, mdiEyeOutline, mdiEyeOffOutline, mdiBackspaceOutline, mdiMessageImageOutline, mdiFile, mdiDownload, 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$u = {
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$t = {
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$t.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", {
@@ -525,12 +525,12 @@ const C = component$(({ size = 24, ...props }) => {
525
525
  });
526
526
  });
527
527
  const icon$4 = "_icon_1gvln_1";
528
- const styles$s = {
528
+ const styles$x = {
529
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$s.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$r = {
642
+ const styles$w = {
643
643
  text: text$3,
644
644
  code: code$1,
645
645
  kbd,
@@ -650,16 +650,16 @@ const textStyles = {
650
650
  text: text$2
651
651
  };
652
652
  const icon$3 = "_icon_19g82_1";
653
- const styles$q = {
653
+ const styles$v = {
654
654
  icon: icon$3
655
655
  };
656
656
  const ElmInlineIcon = component$(({ src, alt }) => {
657
657
  return /* @__PURE__ */ jsx("span", {
658
- class: styles$q.icon,
658
+ class: styles$v.icon,
659
659
  children: /* @__PURE__ */ jsx("img", {
660
660
  src,
661
661
  alt,
662
- class: styles$q.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$r.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$r.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$r.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$r.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$r.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$p = {
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$p.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$u["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$u["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$u.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$u["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$u.divider
822
+ class: styles$z.divider
823
823
  }),
824
824
  /* @__PURE__ */ jsx("div", {
825
- class: styles$u.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$o = {
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$o["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$o.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$n = {
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$n.toggle,
902
+ styles$s.toggle,
903
903
  {
904
- [styles$n["toggle-open"]]: isOpen.value,
905
- [styles$n["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$n.summary,
911
+ styles$s.summary,
912
912
  {
913
- [styles$n["summary-open"]]: isOpen.value,
914
- [styles$n["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$n["chevron-icon"],
921
+ styles$s["chevron-icon"],
922
922
  {
923
- [styles$n["chevron-icon-open"]]: isOpen.value,
924
- [styles$n["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$n["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$n["plus-icon"],
939
+ styles$s["plus-icon"],
940
940
  {
941
- [styles$n["plus-icon-open"]]: isOpen.value,
942
- [styles$n["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$n.content,
955
+ styles$s.content,
956
956
  {
957
- [styles$n["content-open"]]: isOpen.value,
958
- [styles$n["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$n.footer,
964
+ class: styles$s.footer,
965
965
  onClick$: toggle2,
966
966
  children: [
967
967
  /* @__PURE__ */ jsx("span", {
968
- class: styles$n["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$n["footer-line"]
975
+ class: styles$s["footer-line"]
976
976
  }),
977
977
  /* @__PURE__ */ jsx("span", {
978
- class: styles$n["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$n["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$n["footer-line"]
995
+ class: styles$s["footer-line"]
996
996
  }),
997
997
  /* @__PURE__ */ jsx("span", {
998
- class: styles$n["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$m = {
1009
+ const styles$r = {
1010
1010
  "block-fallback": "_block-fallback_rt986_1"
1011
1011
  };
1012
- const wrapper$2 = "_wrapper_1yktj_12";
1012
+ const wrapper$3 = "_wrapper_1yktj_12";
1013
1013
  const dot = "_dot_1yktj_22";
1014
- const styles$l = {
1015
- wrapper: wrapper$2,
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$l.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$l.dot,
1027
+ class: styles$q.dot,
1028
1028
  "aria-hidden": "true"
1029
1029
  }),
1030
1030
  /* @__PURE__ */ jsx("div", {
1031
- class: styles$l.dot,
1031
+ class: styles$q.dot,
1032
1032
  "aria-hidden": "true"
1033
1033
  }),
1034
1034
  /* @__PURE__ */ jsx("div", {
1035
- class: styles$l.dot,
1035
+ class: styles$q.dot,
1036
1036
  "aria-hidden": "true"
1037
1037
  })
1038
1038
  ]
1039
1039
  });
1040
1040
  });
1041
- const styles$k = {
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$k["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$m["block-fallback"],
1052
+ class: styles$r["block-fallback"],
1053
1053
  style: {
1054
1054
  "--height": height
1055
1055
  },
@@ -1059,6 +1059,440 @@ 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
+ });
1062
1496
  const loading = "_loading_1yj0v_19";
1063
1497
  const wrapper$1 = "_wrapper_1yj0v_33";
1064
1498
  const active = "_active_1yj0v_55";
@@ -1069,7 +1503,7 @@ const body$1 = "_body_1yj0v_88";
1069
1503
  const input = "_input_1yj0v_109";
1070
1504
  const icon$2 = "_icon_1yj0v_136";
1071
1505
  const suffix = "_suffix_1yj0v_153";
1072
- const styles$j = {
1506
+ const styles$k = {
1073
1507
  loading,
1074
1508
  wrapper: wrapper$1,
1075
1509
  active,
@@ -1113,8 +1547,8 @@ const ElmTextField = component$((props) => {
1113
1547
  };
1114
1548
  return /* @__PURE__ */ jsxs("div", {
1115
1549
  class: [
1116
- styles$j.wrapper,
1117
- isFocused.value && styles$j.active
1550
+ styles$k.wrapper,
1551
+ isFocused.value && styles$k.active
1118
1552
  ],
1119
1553
  style: {
1120
1554
  backgroundColor: props.disabled || props.loading ? "rgba(0,0,0,0.15)" : void 0,
@@ -1122,17 +1556,17 @@ const ElmTextField = component$((props) => {
1122
1556
  },
1123
1557
  children: [
1124
1558
  /* @__PURE__ */ jsxs("div", {
1125
- class: styles$j.header,
1559
+ class: styles$k.header,
1126
1560
  children: [
1127
1561
  /* @__PURE__ */ jsxs("label", {
1128
1562
  for: id,
1129
- class: styles$j.label,
1563
+ class: styles$k.label,
1130
1564
  children: [
1131
1565
  /* @__PURE__ */ jsx("span", {
1132
1566
  children: props.label
1133
1567
  }),
1134
1568
  props.required && /* @__PURE__ */ jsx("span", {
1135
- class: styles$j.requierd,
1569
+ class: styles$k.requierd,
1136
1570
  children: "*"
1137
1571
  })
1138
1572
  ]
@@ -1145,7 +1579,7 @@ const ElmTextField = component$((props) => {
1145
1579
  ]
1146
1580
  }),
1147
1581
  /* @__PURE__ */ jsxs("div", {
1148
- class: styles$j.body,
1582
+ class: styles$k.body,
1149
1583
  children: [
1150
1584
  props.icon && /* @__PURE__ */ jsx(ElmMdiIcon, {
1151
1585
  d: iconMap[props.icon],
@@ -1156,7 +1590,7 @@ const ElmTextField = component$((props) => {
1156
1590
  id,
1157
1591
  "bind:value": input2,
1158
1592
  type: inputType.value,
1159
- class: styles$j.input,
1593
+ class: styles$k.input,
1160
1594
  placeholder: props.placeholder,
1161
1595
  onFocus$: () => isFocused.value = true,
1162
1596
  onBlur$: () => isFocused.value = false,
@@ -1167,16 +1601,16 @@ const ElmTextField = component$((props) => {
1167
1601
  "aria-required": props.required
1168
1602
  }),
1169
1603
  /* @__PURE__ */ jsxs("div", {
1170
- class: styles$j["icon-box"],
1604
+ class: styles$k["icon-box"],
1171
1605
  children: [
1172
1606
  /* @__PURE__ */ jsx("span", {
1173
- class: styles$j.suffix,
1607
+ class: styles$k.suffix,
1174
1608
  children: props.suffix != null && /* @__PURE__ */ jsx(ElmInlineText, {
1175
1609
  text: props.suffix
1176
1610
  })
1177
1611
  }),
1178
1612
  /* @__PURE__ */ jsx("div", {
1179
- class: styles$j.icon,
1613
+ class: styles$k.icon,
1180
1614
  onClick$: handleVisibleSwitch,
1181
1615
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
1182
1616
  d: inputType.value === "text" ? mdiEyeOutline : mdiEyeOffOutline,
@@ -1185,7 +1619,7 @@ const ElmTextField = component$((props) => {
1185
1619
  })
1186
1620
  }),
1187
1621
  /* @__PURE__ */ jsx("div", {
1188
- class: styles$j.icon,
1622
+ class: styles$k.icon,
1189
1623
  onClick$: handleDelete,
1190
1624
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
1191
1625
  d: mdiBackspaceOutline,
@@ -1198,7 +1632,7 @@ const ElmTextField = component$((props) => {
1198
1632
  ]
1199
1633
  }),
1200
1634
  /* @__PURE__ */ jsx("div", {
1201
- class: styles$j.loading,
1635
+ class: styles$k.loading,
1202
1636
  style: {
1203
1637
  opacity: props.loading ? 0.2 : 0
1204
1638
  }
@@ -1206,6 +1640,28 @@ const ElmTextField = component$((props) => {
1206
1640
  ]
1207
1641
  });
1208
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
+ });
1209
1665
  const LOCAL_STORAGE_KEY = "elmethis-theme";
1210
1666
  function useElmethisTheme() {
1211
1667
  const isDarkTheme = useSignal(false);
@@ -2760,7 +3216,9 @@ export {
2760
3216
  ElmBlockQuote,
2761
3217
  ElmBookmark,
2762
3218
  ElmBreadcrumb,
3219
+ ElmButton,
2763
3220
  ElmCallout,
3221
+ ElmCheckbox,
2764
3222
  ElmCodeBlock,
2765
3223
  ElmDivider,
2766
3224
  ElmDotLoadingIcon,
@@ -2779,7 +3237,9 @@ export {
2779
3237
  ElmParagraph,
2780
3238
  ElmParallax,
2781
3239
  ElmRectangleWave,
3240
+ ElmSelect,
2782
3241
  ElmShikiHighlighter,
3242
+ ElmSwitch,
2783
3243
  ElmTable,
2784
3244
  ElmTableBody,
2785
3245
  ElmTableCell,
@@ -2787,5 +3247,6 @@ export {
2787
3247
  ElmTableRow,
2788
3248
  ElmTextField,
2789
3249
  ElmToggle,
2790
- ElmToggleTheme
3250
+ ElmToggleTheme,
3251
+ ElmValidation
2791
3252
  };