@elmethis/qwik 0.0.31 → 0.0.33

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.
@@ -2200,24 +2200,30 @@ const ElmSquareLoadingIcon = qwik.component$(({ size = "3rem", dimensions = 4 })
2200
2200
  }, `${rowIndex}-${columnIndex}`)))
2201
2201
  });
2202
2202
  });
2203
- const image$1 = "_image_sf1wj_12";
2204
- const fallback = "_fallback_sf1wj_34";
2203
+ const image$1 = "_image_slok6_12";
2204
+ const fallback = "_fallback_slok6_37";
2205
2205
  const styles$h = {
2206
- "block-image": "_block-image_sf1wj_1",
2207
- "image-container": "_image-container_sf1wj_12",
2206
+ "block-image": "_block-image_slok6_1",
2207
+ "image-container": "_image-container_slok6_12",
2208
2208
  image: image$1,
2209
2209
  fallback,
2210
- "caption-box": "_caption-box_sf1wj_44",
2211
- "modal-container": "_modal-container_sf1wj_56"
2210
+ "caption-box": "_caption-box_slok6_45",
2211
+ "modal-container": "_modal-container_slok6_57"
2212
2212
  };
2213
2213
  const ElmBlockImage = qwik.component$(({ src, alt, caption: caption2, width, height, enableModal = true, srcset, sizes, style }) => {
2214
2214
  const isLoading = qwik.useSignal(true);
2215
2215
  const isShowModal = qwik.useSignal(false);
2216
+ const modalRef = qwik.useSignal();
2216
2217
  const handleImageLoad = qwik.$(() => {
2217
2218
  isLoading.value = false;
2218
2219
  });
2219
2220
  const handleToggleModal = qwik.$(() => {
2220
2221
  if (enableModal && !isLoading.value) {
2222
+ if (isShowModal.value) {
2223
+ modalRef.value?.hidePopover();
2224
+ } else {
2225
+ modalRef.value?.showPopover();
2226
+ }
2221
2227
  isShowModal.value = !isShowModal.value;
2222
2228
  }
2223
2229
  });
@@ -2237,12 +2243,10 @@ const ElmBlockImage = qwik.component$(({ src, alt, caption: caption2, width, hei
2237
2243
  }
2238
2244
  });
2239
2245
  const Modal = /* @__PURE__ */ jsxRuntime.jsx("div", {
2246
+ ref: modalRef,
2240
2247
  class: styles$h["modal-container"],
2241
- style: {
2242
- pointerEvents: isShowModal.value ? "auto" : "none",
2243
- "--opacity": isShowModal.value ? 1 : 0
2244
- },
2245
2248
  onClick$: handleToggleModal,
2249
+ popover: "manual",
2246
2250
  children: ImageComponent
2247
2251
  });
2248
2252
  return /* @__PURE__ */ jsxRuntime.jsxs("figure", {
@@ -2198,24 +2198,30 @@ const ElmSquareLoadingIcon = component$(({ size = "3rem", dimensions = 4 }) => {
2198
2198
  }, `${rowIndex}-${columnIndex}`)))
2199
2199
  });
2200
2200
  });
2201
- const image$1 = "_image_sf1wj_12";
2202
- const fallback = "_fallback_sf1wj_34";
2201
+ const image$1 = "_image_slok6_12";
2202
+ const fallback = "_fallback_slok6_37";
2203
2203
  const styles$h = {
2204
- "block-image": "_block-image_sf1wj_1",
2205
- "image-container": "_image-container_sf1wj_12",
2204
+ "block-image": "_block-image_slok6_1",
2205
+ "image-container": "_image-container_slok6_12",
2206
2206
  image: image$1,
2207
2207
  fallback,
2208
- "caption-box": "_caption-box_sf1wj_44",
2209
- "modal-container": "_modal-container_sf1wj_56"
2208
+ "caption-box": "_caption-box_slok6_45",
2209
+ "modal-container": "_modal-container_slok6_57"
2210
2210
  };
2211
2211
  const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height, enableModal = true, srcset, sizes, style }) => {
2212
2212
  const isLoading = useSignal(true);
2213
2213
  const isShowModal = useSignal(false);
2214
+ const modalRef = useSignal();
2214
2215
  const handleImageLoad = $(() => {
2215
2216
  isLoading.value = false;
2216
2217
  });
2217
2218
  const handleToggleModal = $(() => {
2218
2219
  if (enableModal && !isLoading.value) {
2220
+ if (isShowModal.value) {
2221
+ modalRef.value?.hidePopover();
2222
+ } else {
2223
+ modalRef.value?.showPopover();
2224
+ }
2219
2225
  isShowModal.value = !isShowModal.value;
2220
2226
  }
2221
2227
  });
@@ -2235,12 +2241,10 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
2235
2241
  }
2236
2242
  });
2237
2243
  const Modal = /* @__PURE__ */ jsx("div", {
2244
+ ref: modalRef,
2238
2245
  class: styles$h["modal-container"],
2239
- style: {
2240
- pointerEvents: isShowModal.value ? "auto" : "none",
2241
- "--opacity": isShowModal.value ? 1 : 0
2242
- },
2243
2246
  onClick$: handleToggleModal,
2247
+ popover: "manual",
2244
2248
  children: ImageComponent
2245
2249
  });
2246
2250
  return /* @__PURE__ */ jsxs("figure", {
package/lib/style.css CHANGED
@@ -995,7 +995,7 @@
995
995
  }
996
996
  [data-theme=dark] ._square_13xd3_24 {
997
997
  background-color: #b0b5be;
998
- }._block-image_sf1wj_1 {
998
+ }._block-image_slok6_1 {
999
999
  margin-block: var(--margin-block, 0);
1000
1000
  margin-inline: 0;
1001
1001
  display: flex;
@@ -1006,31 +1006,32 @@
1006
1006
  width: 100%;
1007
1007
  }
1008
1008
 
1009
- ._image-container_sf1wj_12 {
1009
+ ._image-container_slok6_12 {
1010
1010
  width: 100%;
1011
1011
  height: 100%;
1012
1012
  position: relative;
1013
+
1013
1014
  display: flex;
1014
1015
  justify-content: center;
1015
1016
  align-items: center;
1016
1017
  }
1017
1018
 
1018
- ._image_sf1wj_12 {
1019
+ ._image_slok6_12 {
1020
+ box-sizing: border-box;
1019
1021
  max-width: 100%;
1020
1022
  max-height: min(100%, 100vh);
1021
1023
  height: auto;
1022
1024
  border-radius: 0.25rem;
1023
- box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.1);
1025
+ box-shadow: 0 0 0.125rem oklch(from black l c h / 0.1);
1024
1026
  transition: opacity 400ms;
1025
1027
  opacity: var(--opacity, 1);
1026
1028
  user-select: none;
1027
1029
  aspect-ratio: var(--aspect-ratio, auto);
1030
+
1028
1031
  cursor: var(--cursor);
1029
1032
  }
1030
1033
 
1031
- ._fallback_sf1wj_34 {
1032
- width: 100%;
1033
- height: 100%;
1034
+ ._fallback_slok6_37 {
1034
1035
  inset: 0 0 auto auto;
1035
1036
  position: absolute;
1036
1037
  transition: opacity 400ms;
@@ -1038,7 +1039,7 @@
1038
1039
  pointer-events: none;
1039
1040
  }
1040
1041
 
1041
- ._caption-box_sf1wj_44 {
1042
+ ._caption-box_slok6_45 {
1042
1043
  box-sizing: border-box;
1043
1044
  padding: 0rem 1rem;
1044
1045
  display: flex;
@@ -1050,20 +1051,59 @@
1050
1051
  transition: opacity 400ms;
1051
1052
  }
1052
1053
 
1053
- ._modal-container_sf1wj_56 {
1054
- width: 100vw;
1054
+ ._modal-container_slok6_57 {
1055
+ width: 100%;
1055
1056
  height: 100vh;
1056
1057
  display: flex;
1057
1058
  justify-content: center;
1058
1059
  align-items: center;
1059
- position: fixed;
1060
- inset: 0 0 auto auto;
1061
- z-index: 100;
1062
- background-color: rgba(35, 38, 42, 0.8);
1063
- cursor: zoom-out;
1064
- opacity: var(--opacity, 1);
1065
- transition: opacity 200ms;
1066
- }._file_eqa3m_1 {
1060
+ overflow: hidden;
1061
+ opacity: 0;
1062
+ transform: scale(0.95);
1063
+ background-color: transparent;
1064
+ border: none;
1065
+ padding: 0;
1066
+ margin: auto;
1067
+ pointer-events: none;
1068
+ transition:
1069
+ opacity 200ms,
1070
+ transform 200ms,
1071
+ display 200ms allow-discrete,
1072
+ overlay 200ms allow-discrete;
1073
+
1074
+ &::backdrop {
1075
+ background-color: oklch(from #23262a l c h / 0.8);
1076
+ opacity: 0;
1077
+
1078
+ transition:
1079
+ background-color 200ms,
1080
+ opacity 200ms,
1081
+ display 200ms allow-discrete,
1082
+ overlay 200ms allow-discrete;
1083
+ }
1084
+
1085
+ &:popover-open {
1086
+ opacity: 1;
1087
+ transform: scale(1);
1088
+ pointer-events: auto;
1089
+
1090
+ &::backdrop {
1091
+ opacity: 1;
1092
+ }
1093
+ }
1094
+ }
1095
+
1096
+ @starting-style {
1097
+ ._modal-container_slok6_57:popover-open {
1098
+ opacity: 0;
1099
+ transform: scale(0.95);
1100
+
1101
+ &::backdrop {
1102
+ opacity: 0;
1103
+ }
1104
+ }
1105
+ }
1106
+ ._file_eqa3m_1 {
1067
1107
  margin-block: var(--margin-block, 0);
1068
1108
  padding: 1rem;
1069
1109
  display: grid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/qwik",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },