@dotss/tictoccroc 0.11.1 → 0.12.0

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 (32) hide show
  1. package/dist/index.mjs +100 -96
  2. package/dist/parent/b2b/components/ActionButtons/ActionButtons.mjs +5 -5
  3. package/dist/shared/components/Carousel/Carousel.mjs +104 -98
  4. package/dist/shared/components/Carousel/Carousel.utils.d.ts +8 -0
  5. package/dist/shared/components/Carousel/Carousel.utils.mjs +12 -0
  6. package/dist/shared/components/Carousel/Carousel.utils.test.d.ts +1 -0
  7. package/dist/shared/components/Image/Image.d.ts +1 -0
  8. package/dist/shared/components/Image/Image.mjs +102 -97
  9. package/dist/shared/components/Swiper/Swiper.mjs +137 -136
  10. package/dist/shared/components/Swiper/Swiper.utils.d.ts +10 -0
  11. package/dist/shared/components/Swiper/Swiper.utils.mjs +13 -2
  12. package/dist/shared/components/Swiper/Swiper.utils.test.d.ts +1 -0
  13. package/dist/shared/utils/getHoverChildrenScaleStyle/getHoverChildrenScaleStyle.d.ts +18 -0
  14. package/dist/shared/utils/getHoverChildrenScaleStyle/getHoverChildrenScaleStyle.mjs +9 -0
  15. package/dist/shared/utils/getHoverChildrenScaleStyle/getHoverChildrenScaleStyle.test.d.ts +1 -0
  16. package/dist/shared/utils/getHoverChildrenScaleStyle/index.d.ts +2 -0
  17. package/dist/shared/utils/getHoverChildrenScaleStyle/index.mjs +5 -0
  18. package/dist/shared/utils/index.d.ts +1 -0
  19. package/dist/shared/utils/index.mjs +2 -1
  20. package/dist/teacher/home/components/Carousel1Account/Carousel1Account.mjs +12 -12
  21. package/dist/teacher/home/components/Carousel2Account/Carousel2Account.mjs +14 -14
  22. package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.d.ts +21 -0
  23. package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.mjs +202 -0
  24. package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.utils.d.ts +15 -0
  25. package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.utils.mjs +175 -0
  26. package/dist/teacher/profile/components/KokTeacherCard/index.d.ts +4 -0
  27. package/dist/teacher/profile/components/KokTeacherCard/index.mjs +6 -0
  28. package/dist/teacher/profile/components/ProfileSummary/index.d.ts +1 -0
  29. package/dist/teacher/profile/components/ProfileSummary/index.mjs +4 -3
  30. package/dist/teacher/profile/components/index.d.ts +2 -0
  31. package/dist/teacher/profile/components/index.mjs +27 -24
  32. package/package.json +1 -1
@@ -2,53 +2,54 @@ import e from "../../hooks/useInView/index.mjs";
2
2
  import t from "../../hooks/useIsomorphicLayoutEffect/index.mjs";
3
3
  import n from "../../utils/getImageUrl/index.mjs";
4
4
  import r from "./Image.error.mjs";
5
- import { convertHeicToPng as ee, isHeicSource as i } from "./Image.utils.mjs";
6
- import { forwardRef as a, useEffect as o, useImperativeHandle as s, useRef as c, useState as l } from "react";
7
- import { Flexbox as u, Skeleton as d } from "@dotss/ui";
8
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { convertHeicToPng as ee, isHeicSource as te } from "./Image.utils.mjs";
6
+ import { forwardRef as i, useEffect as a, useImperativeHandle as ne, useRef as o, useState as s } from "react";
7
+ import { Flexbox as c, Skeleton as l } from "@dotss/ui";
8
+ import u from "@dotss/ui/hooks/useCheckHoverPossible/useCheckHoverPossible";
9
+ import { Fragment as re, jsx as d, jsxs as f } from "react/jsx-runtime";
9
10
  //#region shared/components/Image/Image.tsx
10
- var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "center", alt: y, scale: b = 2, onLoad: x, onLazyLoad: S, lazy: C = !1, borderRadius: w, disabledResizing: T = !1, withIntrinsicRatio: E = !1, enableBlurPlaceholder: D = !1, enableFallback: O = !1, enableErrorFallback: k = !0, renderErrorFallback: A, wrapperProps: j = {}, inViewOptions: te = {}, onError: M, ...N }, P) => {
11
- let F = c(null), I = c(!1), L = c(null), R = c(M);
12
- R.current = M, s(P, () => L.current);
11
+ var p = i(({ src: i, width: p, height: m, fit: h = "cover", position: g = "center", alt: _, scale: v = 2, onLoad: y, onLazyLoad: b, lazy: x = !1, borderRadius: S, disabledResizing: C = !1, withIntrinsicRatio: w = !1, enableBlurPlaceholder: T = !1, enableFallback: E = !1, enableErrorFallback: D = !0, renderErrorFallback: O, enableHoverScale: k = !1, wrapperProps: A = {}, inViewOptions: j = {}, onError: M, ...N }, P) => {
12
+ let F = o(null), I = o(!1), L = o(null), R = o(M);
13
+ R.current = M, ne(P, () => L.current);
13
14
  let { isInView: z } = e(F, {
14
15
  threshold: .4,
15
- ...te
16
- }), [B, V] = l(!1), [H, U] = l(!1), [W, G] = l(!1), [K, ne] = l(!1), [q, J] = l(n({
16
+ ...j
17
+ }), { isHoverPossible: B } = u(), [V, ie] = s(!1), [H, U] = s(!1), [W, G] = s(!1), [K, ae] = s(!1), [q, J] = s(n({
17
18
  mode: "original",
18
- src: a,
19
- width: h,
20
- height: g,
21
- fit: _,
22
- position: v,
23
- scale: b,
24
- disabledResizing: T
25
- })), Y = i(a), X = D ? n({
19
+ src: i,
20
+ width: p,
21
+ height: m,
22
+ fit: h,
23
+ position: g,
24
+ scale: v,
25
+ disabledResizing: C
26
+ })), Y = te(i), X = T ? n({
26
27
  mode: "blur",
27
- src: a,
28
- width: h,
29
- fit: _,
30
- position: v,
28
+ src: i,
29
+ width: p,
30
+ fit: h,
31
+ position: g,
31
32
  scale: 1 / 3,
32
- disabledResizing: T
33
+ disabledResizing: C
33
34
  }) : null, Z = (e) => {
34
- U(!0), G(!1), typeof x == "function" && x(e);
35
+ U(!0), G(!1), typeof y == "function" && y(e);
35
36
  }, Q = (e) => {
36
37
  Y && !q.startsWith("blob:") || (typeof M == "function" && M(e.nativeEvent), G(!0), U(!1));
37
- }, $ = () => ne(!0);
38
- return o(() => {
39
- if (C && F.current) {
38
+ }, $ = () => ae(!0);
39
+ return a(() => {
40
+ if (x && F.current) {
40
41
  let e = () => {
41
- z && V(!0);
42
+ z && ie(!0);
42
43
  };
43
44
  return e(), window.appScreenContent?.addEventListener("scroll", e), window.addEventListener("resize", e), window.addEventListener("orientationchange", e), () => {
44
45
  window.appScreenContent?.removeEventListener("scroll", e), window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e);
45
46
  };
46
47
  }
47
- }), o(() => {
48
- typeof S == "function" && B && !I.current && (I.current = !0, S());
49
- }, [S, B]), t(() => {
48
+ }), a(() => {
49
+ typeof b == "function" && V && !I.current && (I.current = !0, b());
50
+ }, [b, V]), t(() => {
50
51
  let e = L.current, t = !1, n = (e) => {
51
- ee(a).then((n) => {
52
+ ee(i).then((n) => {
52
53
  t || (J(URL.createObjectURL(n)), e.onload = () => {
53
54
  e.style.opacity = "1", U(!0), G(!1), e.onload = null, e.onerror = null;
54
55
  }, e.onerror = () => {
@@ -61,77 +62,79 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
61
62
  })));
62
63
  });
63
64
  };
64
- return e?.complete ? Y ? e.src.startsWith("blob:") || (e.style.transition = "opacity 0.3s", e.style.opacity = "0", n(e)) : e.naturalWidth > 0 ? (e.style.transition = "none", e.style.opacity = "1", U(!0)) : (e.style.opacity = "0", G(!0)) : e && (e.style.transition = "opacity 0.3s", e.style.opacity = "0", e.onload = () => {
65
+ return e?.complete ? Y ? e.src.startsWith("blob:") || (e.style.transition = "opacity 0.3s, transform 0.3s", e.style.opacity = "0", n(e)) : e.naturalWidth > 0 ? (e.style.transition = "transform 0.3s", e.style.opacity = "1", U(!0)) : (e.style.opacity = "0", G(!0)) : e && (e.style.transition = "opacity 0.3s, transform 0.3s", e.style.opacity = "0", e.onload = () => {
65
66
  e.style.opacity = "1", U(!0), e.onload = null;
66
67
  }, e.onerror = () => {
67
68
  if (!Y) {
68
69
  G(!0), e.onerror = null;
69
70
  return;
70
71
  }
71
- G(!1), e.style.transition = "opacity 0.3s", e.style.opacity = "0", n(e);
72
+ G(!1), e.style.transition = "opacity 0.3s, transform 0.3s", e.style.opacity = "0", n(e);
72
73
  }), () => {
73
74
  t = !0, e && (e.onload = null, e.onerror = null);
74
75
  };
75
76
  }, [
76
- B,
77
- a,
77
+ V,
78
+ i,
78
79
  Y
79
- ]), o(() => {
80
+ ]), a(() => {
80
81
  J(n({
81
82
  mode: "original",
82
- src: a,
83
- width: h,
84
- height: g,
85
- fit: _,
86
- position: v,
87
- scale: b,
88
- disabledResizing: T
83
+ src: i,
84
+ width: p,
85
+ height: m,
86
+ fit: h,
87
+ position: g,
88
+ scale: v,
89
+ disabledResizing: C
89
90
  }));
90
91
  }, [
91
- a,
92
+ i,
93
+ p,
94
+ m,
92
95
  h,
93
96
  g,
94
- _,
95
97
  v,
96
- b,
97
- T
98
- ]), C ? /* @__PURE__ */ m(u, {
99
- ...j,
98
+ C
99
+ ]), x ? /* @__PURE__ */ f(c, {
100
+ ...A,
100
101
  ref: F,
101
- inlineCSS: E ? {
102
+ inlineCSS: w ? {
102
103
  position: "relative",
103
- paddingTop: `calc(100% / ${h} * ${g})`,
104
+ paddingTop: `calc(100% / ${p} * ${m})`,
104
105
  minWidth: "100%",
105
- borderRadius: w,
106
+ borderRadius: S,
106
107
  overflow: "hidden",
107
- ...j?.inlineCSS
108
+ ...k && B && { "&:hover img": { transform: "scale(1.03)" } },
109
+ ...A?.inlineCSS
108
110
  } : {
109
111
  position: "relative",
110
- width: h,
111
- minWidth: h,
112
- height: g,
113
- borderRadius: w,
112
+ width: p,
113
+ minWidth: p,
114
+ height: m,
115
+ borderRadius: S,
114
116
  overflow: "hidden",
115
- ...j?.inlineCSS
117
+ ...k && B && { "&:hover img": { transform: "scale(1.03)" } },
118
+ ...A?.inlineCSS
116
119
  },
117
120
  children: [
118
- O && /* @__PURE__ */ p(d, {
121
+ E && /* @__PURE__ */ d(l, {
119
122
  width: "100%",
120
123
  height: "100%",
121
- borderRadius: w || 0,
124
+ borderRadius: S || 0,
122
125
  inlineCSS: {
123
126
  position: "absolute",
124
127
  top: 0,
125
128
  left: 0,
126
- opacity: H || D && K ? 0 : 1,
129
+ opacity: H || T && K ? 0 : 1,
127
130
  transition: "opacity 0.3s"
128
131
  }
129
132
  }),
130
- D && X && B && /* @__PURE__ */ p("img", {
133
+ T && X && V && /* @__PURE__ */ d("img", {
131
134
  src: X,
132
135
  alt: "",
133
- width: h,
134
- height: g,
136
+ width: p,
137
+ height: m,
135
138
  onLoad: $,
136
139
  draggable: !1,
137
140
  style: {
@@ -142,17 +145,17 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
142
145
  height: "100%",
143
146
  filter: "blur(5px)",
144
147
  opacity: K && !H ? 1 : 0,
145
- transition: "opacity 0.3s",
146
- objectFit: _,
147
- objectPosition: v
148
+ transition: "opacity 0.3s, transform 0.3s",
149
+ objectFit: h,
150
+ objectPosition: g
148
151
  }
149
152
  }),
150
- B && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("img", {
153
+ V && /* @__PURE__ */ f(re, { children: [/* @__PURE__ */ d("img", {
151
154
  ref: L,
152
155
  src: q,
153
- alt: y,
154
- width: h,
155
- height: g,
156
+ alt: _,
157
+ width: p,
158
+ height: m,
156
159
  onLoad: Z,
157
160
  onError: Q,
158
161
  "aria-hidden": W,
@@ -164,49 +167,51 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
164
167
  left: 0,
165
168
  width: "100%",
166
169
  height: "100%",
167
- transition: "opacity 0.3s",
170
+ transition: "opacity 0.3s, transform 0.3s",
168
171
  ...N.style
169
172
  }
170
- }), k && W && (A?.() || /* @__PURE__ */ p(r, {}))] })
173
+ }), D && W && (O?.() || /* @__PURE__ */ d(r, {}))] })
171
174
  ]
172
- }) : /* @__PURE__ */ m(u, {
173
- ...j,
175
+ }) : /* @__PURE__ */ f(c, {
176
+ ...A,
174
177
  ref: F,
175
- inlineCSS: E ? {
178
+ inlineCSS: w ? {
176
179
  position: "relative",
177
- paddingTop: `calc(100% / ${h} * ${g})`,
180
+ paddingTop: `calc(100% / ${p} * ${m})`,
178
181
  minWidth: "100%",
179
182
  transition: "padding-top 0.2s",
180
- borderRadius: w,
183
+ borderRadius: S,
181
184
  overflow: "hidden",
182
- ...j?.inlineCSS
185
+ ...k && B && { "&:hover img": { transform: "scale(1.03)" } },
186
+ ...A?.inlineCSS
183
187
  } : {
184
188
  position: "relative",
185
- width: h,
186
- minWidth: h,
187
- height: g,
188
- borderRadius: w,
189
+ width: p,
190
+ minWidth: p,
191
+ height: m,
192
+ borderRadius: S,
189
193
  overflow: "hidden",
190
- ...j?.inlineCSS
194
+ ...k && B && { "&:hover img": { transform: "scale(1.03)" } },
195
+ ...A?.inlineCSS
191
196
  },
192
197
  children: [
193
- O && /* @__PURE__ */ p(d, {
198
+ E && /* @__PURE__ */ d(l, {
194
199
  width: "100%",
195
200
  height: "100%",
196
- borderRadius: w || 0,
201
+ borderRadius: S || 0,
197
202
  inlineCSS: {
198
203
  position: "absolute",
199
204
  top: 0,
200
205
  left: 0,
201
- opacity: H || D && K ? 0 : 1,
206
+ opacity: H || T && K ? 0 : 1,
202
207
  transition: "opacity 0.3s"
203
208
  }
204
209
  }),
205
- D && X && /* @__PURE__ */ p("img", {
210
+ T && X && /* @__PURE__ */ d("img", {
206
211
  src: X,
207
212
  alt: "",
208
- width: h,
209
- height: g,
213
+ width: p,
214
+ height: m,
210
215
  onLoad: $,
211
216
  draggable: !1,
212
217
  style: {
@@ -220,12 +225,12 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
220
225
  transition: "opacity 0.3s"
221
226
  }
222
227
  }),
223
- /* @__PURE__ */ p("img", {
228
+ /* @__PURE__ */ d("img", {
224
229
  ref: L,
225
230
  src: q,
226
- alt: y,
227
- width: h,
228
- height: g,
231
+ alt: _,
232
+ width: p,
233
+ height: m,
229
234
  onLoad: Z,
230
235
  onError: Q,
231
236
  "aria-hidden": W,
@@ -237,13 +242,13 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
237
242
  left: 0,
238
243
  width: "100%",
239
244
  height: "100%",
240
- transition: "opacity 0.3s",
245
+ transition: "opacity 0.3s, transform 0.3s",
241
246
  ...N.style
242
247
  }
243
248
  }),
244
- k && W && (A?.() || /* @__PURE__ */ p(r, {}))
249
+ D && W && (O?.() || /* @__PURE__ */ d(r, {}))
245
250
  ]
246
251
  });
247
252
  });
248
253
  //#endregion
249
- export { h as default };
254
+ export { p as default };