@dotss/tictoccroc 0.0.35 → 0.1.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.
@@ -1,6 +1,6 @@
1
1
  import { FlexboxProps } from 'node_modules/@dotss/ui/Flexbox/Flexbox';
2
2
  export type BotMessageType = 'MATCHING_SUCCEEDED' | 'TEACHER_INQUIRED' | 'PARENT_CHANGED_OFFER_SCHEDULE' | 'PARENT_CHANGED_MATCHING_SCHEDULE' | 'TEACHER_APPLIED' | 'PARENT_SENT_OFFER' | 'KOK_MATCHING_SUCCEEDED' | 'APPLICATION_MATCHING_SUCCEEDED' | 'ASSIGNMENT_MATCHING_SUCCEEDED' | 'PARENT_REJECTED_APPLICATION' | 'TEACHER_REFUSED_OFFER' | 'PARENT_CANCELED_MATCHING' | 'TEACHER_CANCELED_MATCHING' | 'TEACHER_COMPLETED_CARE' | 'ADMIN_CANCELED_MATCHING';
3
- export type BotMessageCtaType = 'MY_CLASS_CHECK' | 'OFFER_CHECK' | 'CHANGE_INFO_CHECK' | 'MY_APPLICATION_INFO_VIEW' | 'CARE_NOTE_CHECK' | 'TEACHER_SELECTION';
3
+ export type BotMessageCtaType = 'MY_CLASS_CHECK' | 'OFFER_CHECK' | 'CHANGE_INFO_CHECK' | 'MY_APPLICATION_INFO_VIEW' | 'CARE_NOTE_CHECK' | 'TEACHER_SELECTION' | 'PLAY_CONTENT_EXPLORE';
4
4
  export type BotMessageCtaTargetTable = 'OFFER' | 'MATCHING';
5
5
  export type BotMessageSubCtaTargetTable = 'OFFER' | 'MATCHING';
6
6
  export interface BotMessageOffer {
@@ -2,11 +2,11 @@ import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
2
  import { useRef as F, useEffect as L } from "react";
3
3
  import { Flexbox as n, Typography as e, Button as $ } from "@dotss/ui";
4
4
  import q from "@dotss/ui/core/useTheme";
5
- import z from "dayjs";
6
- import { getClassInfo as G, getCtaButtonText as J } from "./BotMessage.utils.mjs";
7
- import K from "../../Image/Image.mjs";
8
- import N from "../../../hooks/useInView/useInView.mjs";
5
+ import { getClassInfo as z, getCtaButtonText as G } from "./BotMessage.utils.mjs";
6
+ import J from "../../Image/Image.mjs";
7
+ import K from "../../../hooks/useInView/useInView.mjs";
9
8
  import S from "../../../utils/getCareTypeLabel/getCareTypeLabel.mjs";
9
+ import N from "dayjs";
10
10
  function V({
11
11
  id: P,
12
12
  botMessageType: y,
@@ -30,10 +30,10 @@ function V({
30
30
  const {
31
31
  palette: { brand: D, grey: m, background: k },
32
32
  spacing: d
33
- } = q(), f = F(null), { isInView: u } = N(f), x = J(s), i = w, H = [
33
+ } = q(), f = F(null), { isInView: u } = K(f), x = G(s), i = w, H = [
34
34
  S(i == null ? void 0 : i.firstCareType),
35
35
  S(i == null ? void 0 : i.secondCareType)
36
- ].filter(Boolean).filter((E) => E !== "-").join("+"), c = G(i), M = () => o == null ? void 0 : o({
36
+ ].filter(Boolean).filter((E) => E !== "-").join("+"), c = z(i), M = () => o == null ? void 0 : o({
37
37
  botMessageType: y,
38
38
  ctaType: s,
39
39
  ctaTargetId: C,
@@ -91,7 +91,7 @@ function V({
91
91
  inlineCSS: {
92
92
  whiteSpace: "nowrap"
93
93
  },
94
- children: z(I).format("A h:mm")
94
+ children: N(I).format("A h:mm")
95
95
  }
96
96
  )
97
97
  ]
@@ -112,7 +112,7 @@ function V({
112
112
  },
113
113
  children: [
114
114
  g && /* @__PURE__ */ r(
115
- K,
115
+ J,
116
116
  {
117
117
  src: g,
118
118
  width: 32,
@@ -1,5 +1,5 @@
1
1
  import { BotMessageCtaType, BotMessageProps } from '.';
2
- export declare function getCtaButtonText(ctaType?: BotMessageCtaType | null): "" | "내 수업 확인하기" | "공고 확인하기" | "변경내용 확인하기" | "나의 지원 내역 보러가기" | "돌봄노트 확인하기" | "선생님 선택하러 가기";
2
+ export declare function getCtaButtonText(ctaType?: BotMessageCtaType | null): "" | "내 수업 확인하기" | "공고 확인하기" | "변경내용 확인하기" | "나의 지원 내역 보러가기" | "돌봄노트 확인하기" | "선생님 선택하러 가기" | "놀이콘텐츠 둘러보기";
3
3
  export declare function getClassInfo(offer: object): {
4
4
  dateRangeText: string;
5
5
  timeRangeText: string;
@@ -1,5 +1,5 @@
1
+ import o from "../../../utils/getCareTypeLabel/getCareTypeLabel.mjs";
1
2
  import n from "dayjs";
2
- import c from "../../../utils/getCareTypeLabel/getCareTypeLabel.mjs";
3
3
  function u(r) {
4
4
  switch (r) {
5
5
  case "MY_CLASS_CHECK":
@@ -14,6 +14,8 @@ function u(r) {
14
14
  return "돌봄노트 확인하기";
15
15
  case "TEACHER_SELECTION":
16
16
  return "선생님 선택하러 가기";
17
+ case "PLAY_CONTENT_EXPLORE":
18
+ return "놀이콘텐츠 둘러보기";
17
19
  default:
18
20
  return "";
19
21
  }
@@ -24,28 +26,28 @@ function C(r) {
24
26
  return null;
25
27
  let a;
26
28
  e.totalCareCount > 1 ? a = `${n(e.careStartDate).format("M월 D일(ddd)")}부터 / 총 ${e.totalCareCount}회` : a = n(e.careStartDate).format("M월 D일(ddd)");
27
- const o = n(`${e.careStartDate} ${e.careStartTime}`).format(
29
+ const c = n(`${e.careStartDate} ${e.careStartTime}`).format(
28
30
  "A h:mm"
29
31
  ), t = n(`${e.careStartDate} ${e.careEndTime}`).format(
30
32
  "A h:mm"
31
33
  );
32
34
  return {
33
35
  dateRangeText: a,
34
- timeRangeText: `${o} ~ ${t}`,
35
- careType: c(e.firstCareType)
36
+ timeRangeText: `${c} ~ ${t}`,
37
+ careType: o(e.firstCareType)
36
38
  };
37
39
  }
38
- function f({
40
+ function T({
39
41
  title: r,
40
42
  content: e,
41
43
  offer: a,
42
- regDatetime: o
44
+ regDatetime: c
43
45
  }) {
44
46
  const t = C(a);
45
- return `안내, ${r}, ${e ? `${e}, ` : ""}${t ? `${t.dateRangeText}, ${t.timeRangeText}, ${t.careType}, ` : ""}${n(o).format("YYYY년 MM월 DD일 A h:mm")}`;
47
+ return `안내, ${r}, ${e ? `${e}, ` : ""}${t ? `${t.dateRangeText}, ${t.timeRangeText}, ${t.careType}, ` : ""}${n(c).format("YYYY년 MM월 DD일 A h:mm")}`;
46
48
  }
47
49
  export {
48
- f as getBotMessageLabel,
50
+ T as getBotMessageLabel,
49
51
  C as getClassInfo,
50
52
  u as getCtaButtonText
51
53
  };
@@ -515,7 +515,7 @@ function je({
515
515
  }),
516
516
  $.map(
517
517
  ({ children: c, startDate: a, endDate: t, totalColumns: r, columnIndex: l }) => {
518
- const u = be(a), f = be(t), H = Math.floor((u - 7 * 60) / 30), Ae = (u - 7 * 60) / 30 * (Number(X) || E), Fe = (f - u) / 30 * (Number(X) || E), pe = 100 / r, xe = l * pe, te = c;
518
+ const u = be(a), f = be(t), H = Math.floor((u - 420) / 30), Ae = (u - 420) / 30 * (Number(X) || E), Fe = (f - u) / 30 * (Number(X) || E), pe = 100 / r, xe = l * pe, te = c;
519
519
  return /* @__PURE__ */ h(
520
520
  m,
521
521
  {
@@ -20,6 +20,9 @@ export interface SwiperProps extends FlexboxProps {
20
20
  loop?: boolean;
21
21
  disableSwipe?: boolean;
22
22
  renderPagination?: (props: SwiperPaginationProps) => ReactNode;
23
+ autoSwipe?: boolean;
24
+ autoSwipeInterval?: number;
25
+ autoSwipeDuration?: number;
23
26
  }
24
- declare function Swiper({ children, initialPage, onSwipe, onSwiping, loop, disableSwipe, renderPagination, inlineCSS, ...props }: SwiperProps): import("@emotion/react/jsx-runtime").JSX.Element;
27
+ declare function Swiper({ children, initialPage, onSwipe, onSwiping, loop, disableSwipe, renderPagination, inlineCSS, autoSwipe, autoSwipeInterval, autoSwipeDuration, ...props }: SwiperProps): import("@emotion/react/jsx-runtime").JSX.Element;
25
28
  export default Swiper;
@@ -1,123 +1,136 @@
1
- import { jsxs as Z } from "react/jsx-runtime";
2
- import { useState as _, useRef as f, Children as x, isValidElement as G, useEffect as k, cloneElement as ar } from "react";
3
- import { Flexbox as K } from "@dotss/ui";
4
- import I from "../MediaDialog/MediaBlock/MediaBlock.mjs";
5
- import { createSwipeEvent as b } from "./Swiper.utils.mjs";
6
- import U from "./SwiperBlock/SwiperBlock.mjs";
7
- function vr({
8
- children: j,
9
- initialPage: E = 0,
10
- onSwipe: u,
11
- onSwiping: T,
12
- loop: y = !1,
13
- disableSwipe: O = !1,
14
- renderPagination: B,
15
- inlineCSS: S,
16
- ...w
1
+ import { jsxs as S } from "react/jsx-runtime";
2
+ import { useState as w, useRef as d, Children as W, isValidElement as G, useCallback as mr, useEffect as M, cloneElement as vr } from "react";
3
+ import { Flexbox as rr } from "@dotss/ui";
4
+ import U from "../MediaDialog/MediaBlock/MediaBlock.mjs";
5
+ import { createSwipeEvent as R } from "./Swiper.utils.mjs";
6
+ import j from "./SwiperBlock/SwiperBlock.mjs";
7
+ function Pr({
8
+ children: B,
9
+ initialPage: T = 0,
10
+ onSwipe: s,
11
+ onSwiping: x,
12
+ loop: v = !1,
13
+ disableSwipe: tr = !1,
14
+ renderPagination: q,
15
+ inlineCSS: er,
16
+ autoSwipe: H = !1,
17
+ autoSwipeInterval: J = 3e3,
18
+ autoSwipeDuration: Q = 1e3,
19
+ ...nr
17
20
  }) {
18
- const [P, R] = _(E), [s, rr] = _(1), t = f(null), X = f(0), W = f(0), q = f(0), Y = f(0), o = f(!1), d = f(!0), N = f(""), n = f(E), H = f(!1), l = f(null), p = x.count(j), m = x.toArray(j).filter(G).filter((r) => r.type === U || r.type === I), D = p > 1 && !O, tr = x.toArray(m == null ? void 0 : m[0]).filter(G).filter((r) => r.type === U || r.type === I), er = x.toArray(m == null ? void 0 : m[(m == null ? void 0 : m.length) - 1]).filter(G).filter((r) => r.type === U || r.type === I), J = (r, e, i) => {
19
- !t.current || !D || (N.current = t.current.style.transform, W.current = r, X.current = r + t.current.offsetWidth * (i + 1), q.current = e);
20
- }, C = (r, e, i) => {
21
- if (!t.current || !D || !o.current || !d.current)
22
- return;
23
- d.current = !1, t.current.style.transition = "transform 0.2s", t.current.style.cursor = "grab", l.current && (t.current.removeEventListener("transitionend", l.current), l.current = null);
24
- const a = e || P, c = i || X.current - t.current.offsetWidth * (a + 1) - r, g = t.current.offsetWidth * 0.1;
25
- if (Math.abs(c) < g && !e) {
26
- t.current.style.transform = N.current, o.current = !1, d.current = !0, u == null || u(
27
- b({
21
+ const [C, $] = w(T), [c, cr] = w(1), t = d(null), X = d(0), Y = d(0), V = d(0), N = d(0), u = d(!1), f = d(!0), F = d(""), n = d(T), Z = d(!1), l = d(null), k = W.count(B), m = W.toArray(B).filter(G).filter((r) => r.type === j || r.type === U), A = k > 1 && !tr, sr = W.toArray(m == null ? void 0 : m[0]).filter(G).filter((r) => r.type === j || r.type === U), ur = W.toArray(m == null ? void 0 : m[(m == null ? void 0 : m.length) - 1]).filter(G).filter((r) => r.type === j || r.type === U), _ = (r, e, i) => {
22
+ !t.current || !A || (F.current = t.current.style.transform, Y.current = r, X.current = r + t.current.offsetWidth * (i + 1), V.current = e);
23
+ }, L = mr(
24
+ (r, e, i, {
25
+ isAutoSwiped: P = !1,
26
+ shouldFocus: a = !1
27
+ } = {}) => {
28
+ if (!t.current || !A || !u.current || !f.current)
29
+ return;
30
+ f.current = !1, t.current.style.transition = P ? `transform ${Q}ms` : "transform 0.2s", t.current.style.cursor = "grab", l.current && (t.current.removeEventListener("transitionend", l.current), l.current = null);
31
+ const o = e || C, h = i || X.current - t.current.offsetWidth * (o + 1) - r, y = t.current.offsetWidth * 0.1;
32
+ if (Math.abs(h) < y && !e) {
33
+ t.current.style.transform = F.current, u.current = !1, f.current = !0, s == null || s(
34
+ R({
35
+ realPage: n.current,
36
+ totalPages: c,
37
+ lastPage: n.current,
38
+ isLoop: !1
39
+ })
40
+ );
41
+ return;
42
+ }
43
+ const I = h <= -y && o - 1 < 0, z = h >= y && o + 1 === c, fr = h >= y && o + 1 < c, dr = h <= -y && o - 1 >= 0;
44
+ if (I) {
45
+ n.current = c - 1, s == null || s(
46
+ R({ realPage: n.current, totalPages: c, lastPage: 0, isLoop: !0 })
47
+ ), t.current.style.transform = "translate3d(0, 0, 0)", l.current = (D) => {
48
+ var g, b, E, p;
49
+ if (D.propertyName === "transform") {
50
+ if (!t.current) return;
51
+ t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${c}), 0, 0)`, $(c - 1), u.current = !1, f.current = !0, a ? (E = (b = (g = t.current) == null ? void 0 : g.children) == null ? void 0 : b[c]) == null || E.focus() : (p = document.activeElement) == null || p.blur();
52
+ }
53
+ }, t.current.addEventListener("transitionend", l.current);
54
+ return;
55
+ } else if (z) {
56
+ n.current = 0, s == null || s(
57
+ R({
58
+ realPage: n.current,
59
+ totalPages: c,
60
+ lastPage: c - 1,
61
+ isLoop: !0
62
+ })
63
+ ), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`, l.current = (D) => {
64
+ var g, b, E, p;
65
+ if (D.propertyName === "transform") {
66
+ if (!t.current) return;
67
+ t.current.style.transition = "none", t.current.style.transform = "translate3d(-100%, 0, 0)", $(0), u.current = !1, f.current = !0, a ? (E = (b = (g = t.current) == null ? void 0 : g.children) == null ? void 0 : b[1]) == null || E.focus() : (p = document.activeElement) == null || p.blur();
68
+ }
69
+ }, t.current.addEventListener("transitionend", l.current);
70
+ return;
71
+ }
72
+ fr ? (n.current = o + 1, s == null || s(
73
+ R({
28
74
  realPage: n.current,
29
- totalPages: s,
30
- lastPage: n.current,
75
+ totalPages: c,
76
+ lastPage: o,
77
+ isLoop: !0
78
+ })
79
+ ), $(n.current), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`) : dr ? (n.current = o - 1, s == null || s(
80
+ R({
81
+ realPage: n.current,
82
+ totalPages: c,
83
+ lastPage: o,
31
84
  isLoop: !1
32
85
  })
33
- );
34
- return;
35
- }
36
- const $ = c <= -g && a - 1 < 0, A = c >= g && a + 1 === s, F = c >= g && a + 1 < s, z = c <= -g && a - 1 >= 0;
37
- if ($) {
38
- n.current = s - 1, u == null || u(
39
- b({ realPage: n.current, totalPages: s, lastPage: 0, isLoop: !0 })
40
- ), t.current.style.transform = "translate3d(0, 0, 0)", l.current = (M) => {
41
- var v, h, L;
42
- if (M.propertyName === "transform") {
43
- if (!t.current) return;
44
- t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${s}), 0, 0)`, R(s - 1), o.current = !1, d.current = !0, (L = (h = (v = t.current) == null ? void 0 : v.children) == null ? void 0 : h[s]) == null || L.focus();
45
- }
46
- }, t.current.addEventListener("transitionend", l.current);
47
- return;
48
- } else if (A) {
49
- n.current = 0, u == null || u(
50
- b({
86
+ ), $(n.current), t.current.style.transform = `translate3d(calc(-100% * ${o}), 0, 0)`) : (s == null || s(
87
+ R({
51
88
  realPage: n.current,
52
- totalPages: s,
53
- lastPage: s - 1,
54
- isLoop: !0
89
+ totalPages: c,
90
+ lastPage: n.current,
91
+ isLoop: !1
55
92
  })
56
- ), t.current.style.transform = `translate3d(calc(-100% * ${a + 2}), 0, 0)`, l.current = (M) => {
57
- var v, h, L;
58
- if (M.propertyName === "transform") {
59
- if (!t.current) return;
60
- t.current.style.transition = "none", t.current.style.transform = "translate3d(-100%, 0, 0)", R(0), o.current = !1, d.current = !0, (L = (h = (v = t.current) == null ? void 0 : v.children) == null ? void 0 : h[1]) == null || L.focus();
93
+ ), t.current.style.transform = F.current), l.current = (D) => {
94
+ var g, b;
95
+ if (D.propertyName === "transform") {
96
+ u.current = !1, f.current = !0;
97
+ const E = Array.from(((g = t.current) == null ? void 0 : g.children) ?? []).find(
98
+ (p) => p.getAttribute("aria-current") === "page"
99
+ );
100
+ a && E ? E.focus() : (b = document.activeElement) == null || b.blur();
61
101
  }
62
102
  }, t.current.addEventListener("transitionend", l.current);
63
- return;
64
- }
65
- F ? (n.current = a + 1, u == null || u(
66
- b({
67
- realPage: n.current,
68
- totalPages: s,
69
- lastPage: a,
70
- isLoop: !0
71
- })
72
- ), R(n.current), t.current.style.transform = `translate3d(calc(-100% * ${a + 2}), 0, 0)`) : z ? (n.current = a - 1, u == null || u(
73
- b({
74
- realPage: n.current,
75
- totalPages: s,
76
- lastPage: a,
77
- isLoop: !1
78
- })
79
- ), R(n.current), t.current.style.transform = `translate3d(calc(-100% * ${a}), 0, 0)`) : (u == null || u(
80
- b({
81
- realPage: n.current,
82
- totalPages: s,
83
- lastPage: n.current,
84
- isLoop: !1
85
- })
86
- ), t.current.style.transform = N.current), l.current = (M) => {
87
- var v;
88
- if (M.propertyName === "transform") {
89
- o.current = !1, d.current = !0;
90
- const h = Array.from(((v = t.current) == null ? void 0 : v.children) ?? []).find(
91
- (L) => L.getAttribute("aria-current") === "page"
92
- );
93
- h && h.focus();
94
- }
95
- }, t.current.addEventListener("transitionend", l.current);
96
- }, nr = (r) => {
97
- o.current = !0, J(r.clientX, r.clientY, n.current);
98
- }, Q = (r) => C(r.clientX), cr = (r) => {
99
- J(r.touches[0].clientX, r.touches[0].clientY, n.current);
100
- }, V = (r) => C(r.changedTouches[0].clientX), sr = (r) => {
101
- o.current = !0;
103
+ },
104
+ [C, c, s, A, Q]
105
+ ), ar = (r) => {
106
+ u.current = !0, _(r.clientX, r.clientY, n.current);
107
+ }, K = (r) => L(r.clientX), or = (r) => {
108
+ _(r.touches[0].clientX, r.touches[0].clientY, n.current);
109
+ }, O = (r) => L(r.changedTouches[0].clientX), lr = (r) => {
110
+ u.current = !0;
102
111
  const e = r - 1;
103
- R(e <= 0 ? 0 : e), C(0, r);
104
- }, ur = (r) => (e) => {
105
- var i, a;
112
+ $(e <= 0 ? 0 : e), L(0, r);
113
+ }, ir = (r) => (e) => {
114
+ var i, P;
106
115
  switch (e.key) {
107
116
  case "ArrowRight": {
108
- if (e.preventDefault(), o.current || !d.current) return;
109
- const c = n.current === s - 1;
110
- if (!y && c)
117
+ if (e.preventDefault(), u.current || !f.current) return;
118
+ const a = n.current === c - 1;
119
+ if (!v && a)
111
120
  return;
112
- o.current = !0, C(0, n.current, (((i = t.current) == null ? void 0 : i.offsetWidth) ?? 0) * 0.1);
121
+ u.current = !0, L(0, n.current, (((i = t.current) == null ? void 0 : i.offsetWidth) ?? 0) * 0.1, {
122
+ shouldFocus: !0
123
+ });
113
124
  break;
114
125
  }
115
126
  case "ArrowLeft": {
116
- if (e.preventDefault(), o.current || !d.current) return;
117
- const c = n.current === 0;
118
- if (!y && c)
127
+ if (e.preventDefault(), u.current || !f.current) return;
128
+ const a = n.current === 0;
129
+ if (!v && a)
119
130
  return;
120
- o.current = !0, C(0, n.current, -((((a = t.current) == null ? void 0 : a.offsetWidth) ?? 0) * 0.1));
131
+ u.current = !0, L(0, n.current, -((((P = t.current) == null ? void 0 : P.offsetWidth) ?? 0) * 0.1), {
132
+ shouldFocus: !0
133
+ });
121
134
  break;
122
135
  }
123
136
  case "Enter": {
@@ -131,83 +144,94 @@ function vr({
131
144
  }
132
145
  r == null || r(e);
133
146
  };
134
- return k(() => {
135
- const r = t.current, e = (c, g, $) => {
136
- if (!t.current || !D || !d.current) return;
137
- Y.current = c - X.current;
138
- const A = 5;
139
- if (o.current = o.current || Math.abs(Y.current) > A && Math.abs(g - q.current) < A, o.current) {
140
- const F = W.current < c, z = W.current > c;
141
- if (!y && F && n.current === 0) {
142
- o.current = !1;
147
+ return M(() => {
148
+ const r = t.current, e = (a, o, h) => {
149
+ if (!t.current || !A || !f.current) return;
150
+ N.current = a - X.current;
151
+ const y = 5;
152
+ if (u.current = u.current || Math.abs(N.current) > y && Math.abs(o - V.current) < y, u.current) {
153
+ const I = Y.current < a, z = Y.current > a;
154
+ if (!v && I && n.current === 0) {
155
+ u.current = !1;
143
156
  return;
144
157
  }
145
- if (!y && z && n.current === s - 1) {
146
- o.current = !1;
158
+ if (!v && z && n.current === c - 1) {
159
+ u.current = !1;
147
160
  return;
148
161
  }
149
- $.cancelable && $.preventDefault(), T == null || T(
150
- b({
162
+ h.cancelable && h.preventDefault(), x == null || x(
163
+ R({
151
164
  realPage: n.current,
152
- totalPages: s,
165
+ totalPages: c,
153
166
  lastPage: n.current,
154
167
  isLoop: !1
155
168
  })
156
- ), t.current.style.transition = "none", t.current.style.cursor = "grabbing", t.current.style.transform = `translate3d(${Y.current}px, 0, 0)`;
169
+ ), t.current.style.transition = "none", t.current.style.cursor = "grabbing", t.current.style.transform = `translate3d(${N.current}px, 0, 0)`;
157
170
  }
158
- }, i = (c) => {
159
- o.current && e(c.clientX, c.clientY, c);
160
- }, a = (c) => e(c.touches[0].clientX, c.touches[0].clientY, c);
161
- return r && (r.addEventListener("mousemove", i), r.addEventListener("touchmove", a)), () => {
162
- r && (r.removeEventListener("mousemove", i), r.removeEventListener("touchmove", a));
171
+ }, i = (a) => {
172
+ u.current && e(a.clientX, a.clientY, a);
173
+ }, P = (a) => e(a.touches[0].clientX, a.touches[0].clientY, a);
174
+ return r && (r.addEventListener("mousemove", i), r.addEventListener("touchmove", P)), () => {
175
+ r && (r.removeEventListener("mousemove", i), r.removeEventListener("touchmove", P));
163
176
  };
164
- }, [D, T, y, s]), k(() => {
177
+ }, [A, x, v, c]), M(() => {
165
178
  const r = t.current, e = (i) => {
166
- d.current || (i.stopPropagation(), i.preventDefault());
179
+ f.current || (i.stopPropagation(), i.preventDefault());
167
180
  };
168
181
  return r == null || r.addEventListener("click", e), () => {
169
182
  r == null || r.removeEventListener("click", e);
170
183
  };
171
- }, []), k(() => {
184
+ }, []), M(() => {
172
185
  const r = t.current;
173
186
  return () => {
174
187
  l.current && r && (r.removeEventListener("transitionend", l.current), l.current = null);
175
188
  };
176
- }, []), k(() => {
177
- rr(p);
178
- }, [p]), k(() => {
179
- t.current && !H.current && (H.current = !0, t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${p < E + 1 ? p : E + 1}), 0, 0)`);
180
- }, [E, p]), /* @__PURE__ */ Z(
181
- K,
189
+ }, []), M(() => {
190
+ cr(k);
191
+ }, [k]), M(() => {
192
+ t.current && !Z.current && (Z.current = !0, t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${k < T + 1 ? k : T + 1}), 0, 0)`);
193
+ }, [T, k]), M(() => {
194
+ if (H) {
195
+ const r = setInterval(() => {
196
+ u.current || !f.current || t.current && (!v && n.current === c - 1 || document.activeElement && t.current && t.current.contains(document.activeElement) || (u.current = !0, L(0, n.current, (t.current.offsetWidth ?? 0) * 0.1, {
197
+ isAutoSwiped: !0
198
+ })));
199
+ }, J);
200
+ return () => {
201
+ clearInterval(r);
202
+ };
203
+ }
204
+ }, [H, J, v, c, L]), /* @__PURE__ */ S(
205
+ rr,
182
206
  {
183
207
  flexGrow: 1,
184
208
  role: "list",
185
209
  "aria-roledescription": "carousel",
186
210
  "aria-label": "슬라이더",
187
- ...w,
211
+ ...nr,
188
212
  inlineCSS: {
189
213
  width: "100%",
190
214
  position: "relative",
191
- ...S
215
+ ...er
192
216
  },
193
217
  children: [
194
- /* @__PURE__ */ Z(
195
- K,
218
+ /* @__PURE__ */ S(
219
+ rr,
196
220
  {
197
221
  ref: t,
198
222
  flexGrow: 1,
199
- onMouseDown: nr,
200
- onMouseUp: Q,
201
- onMouseLeave: Q,
202
- onTouchStart: cr,
203
- onTouchEnd: V,
204
- onTouchCancel: V,
223
+ onMouseDown: ar,
224
+ onMouseUp: K,
225
+ onMouseLeave: K,
226
+ onTouchStart: or,
227
+ onTouchEnd: O,
228
+ onTouchCancel: O,
205
229
  inlineCSS: {
206
230
  "& > div:first-of-type": {
207
- visibility: y ? "visible" : "hidden"
231
+ visibility: v ? "visible" : "hidden"
208
232
  },
209
233
  "& > div:last-of-type": {
210
- visibility: y ? "visible" : "hidden"
234
+ visibility: v ? "visible" : "hidden"
211
235
  }
212
236
  },
213
237
  style: {
@@ -216,30 +240,30 @@ function vr({
216
240
  cursor: "grab"
217
241
  },
218
242
  children: [
219
- er,
243
+ ur,
220
244
  m.map(
221
- (r, e) => ar(r, {
245
+ (r, e) => vr(r, {
222
246
  role: "listitem",
223
- tabIndex: e === P ? 0 : -1,
224
- onKeyDown: ur(r.props.onKeyDown),
247
+ tabIndex: e === C ? 0 : -1,
248
+ onKeyDown: ir(r.props.onKeyDown),
225
249
  "aria-roledescription": "slide",
226
- "aria-hidden": e !== P,
227
- "aria-current": e === P ? "page" : void 0,
228
- "aria-label": `${s}개 중 ${e + 1}번째 슬라이드`,
250
+ "aria-hidden": e !== C,
251
+ "aria-current": e === C ? "page" : void 0,
252
+ "aria-label": `${c}개 중 ${e + 1}번째 슬라이드`,
229
253
  "aria-posinset": e + 1,
230
- "aria-setsize": s,
254
+ "aria-setsize": c,
231
255
  ...r.props
232
256
  })
233
257
  ),
234
- tr
258
+ sr
235
259
  ]
236
260
  }
237
261
  ),
238
- typeof B == "function" && B({ page: P, totalPages: s, onChange: sr })
262
+ typeof q == "function" && q({ page: C, totalPages: c, onChange: lr })
239
263
  ]
240
264
  }
241
265
  );
242
266
  }
243
267
  export {
244
- vr as default
268
+ Pr as default
245
269
  };
@@ -1,6 +1,7 @@
1
1
  import { SyntheticEvent } from 'react';
2
- import { ImageProps } from '../../../../shared/components/Image';
3
2
  import { FlexboxProps } from 'node_modules/@dotss/ui/Flexbox/Flexbox';
3
+ import { ImageProps } from '../../../../shared/components/Image';
4
+ import { SwiperProps } from '../../../../shared/components/Swiper';
4
5
  import { BannerProps } from '..';
5
6
  export interface BannerAccountProps extends Omit<FlexboxProps, 'title' | 'id'> {
6
7
  id: number;
@@ -9,6 +10,7 @@ export interface BannerAccountProps extends Omit<FlexboxProps, 'title' | 'id'> {
9
10
  }>;
10
11
  onClickBanner?: (url: string, bannerId: number, e: SyntheticEvent) => void;
11
12
  imageProps?: Partial<ImageProps>;
13
+ swiperProps?: Partial<SwiperProps>;
12
14
  }
13
- declare function BannerAccount({ id, banners, onClickBanner, imageProps, ...props }: BannerAccountProps): import("@emotion/react/jsx-runtime").JSX.Element;
15
+ declare function BannerAccount({ id, banners, onClickBanner, imageProps, swiperProps, ...props }: BannerAccountProps): import("@emotion/react/jsx-runtime").JSX.Element;
14
16
  export default BannerAccount;
@@ -1,16 +1,23 @@
1
1
  import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
2
  import n from "@dotss/ui/Flexbox";
3
- import b from "@dotss/ui/Typography";
4
- import { useTheme as f } from "@emotion/react";
5
- import g from "../../../../shared/components/Image/Image.mjs";
3
+ import f from "@dotss/ui/Typography";
4
+ import { useTheme as g } from "@emotion/react";
5
+ import S from "../../../../shared/components/Image/Image.mjs";
6
6
  import "@dotss/ui";
7
7
  import "@dotss/ui/core/useTheme";
8
- import S from "../../../../shared/components/Swiper/Swiper.mjs";
9
- import w from "../../../../shared/components/Swiper/SwiperBlock/SwiperBlock.mjs";
10
- function I({ id: a, banners: l, onClickBanner: o, imageProps: d, ...p }) {
11
- const { palette: h } = f(), m = (e, r) => (t) => {
8
+ import w from "../../../../shared/components/Swiper/Swiper.mjs";
9
+ import y from "../../../../shared/components/Swiper/SwiperBlock/SwiperBlock.mjs";
10
+ function H({
11
+ id: a,
12
+ banners: l,
13
+ onClickBanner: o,
14
+ imageProps: d,
15
+ swiperProps: p,
16
+ ...h
17
+ }) {
18
+ const { palette: m } = g(), s = (e, r) => (t) => {
12
19
  o && typeof o == "function" && (t.stopPropagation(), t.preventDefault(), o(e, r, t));
13
- }, s = ({ page: e, totalPages: r }) => r <= 1 ? null : /* @__PURE__ */ i(
20
+ }, u = ({ page: e, totalPages: r }) => r <= 1 ? null : /* @__PURE__ */ i(
14
21
  n,
15
22
  {
16
23
  alignItems: "center",
@@ -26,10 +33,10 @@ function I({ id: a, banners: l, onClickBanner: o, imageProps: d, ...p }) {
26
33
  minWidth: 36,
27
34
  minHeight: 20,
28
35
  borderRadius: 24,
29
- backgroundColor: h.etc.dimmed02
36
+ backgroundColor: m.etc.dimmed02
30
37
  },
31
38
  children: /* @__PURE__ */ c(
32
- b,
39
+ f,
33
40
  {
34
41
  tag: "p",
35
42
  variant: "c5R",
@@ -49,28 +56,29 @@ function I({ id: a, banners: l, onClickBanner: o, imageProps: d, ...p }) {
49
56
  )
50
57
  }
51
58
  );
52
- return /* @__PURE__ */ c(n, { inlineCSS: { width: "100%" }, ...p, children: [
59
+ return /* @__PURE__ */ c(n, { inlineCSS: { width: "100%" }, ...h, children: [
53
60
  /* @__PURE__ */ i(n, { id: `tictoccroc-banner-${a}`, visuallyHidden: !0, children: "배너" }),
54
61
  /* @__PURE__ */ i(
55
- S,
62
+ w,
56
63
  {
57
- renderPagination: s,
64
+ renderPagination: u,
58
65
  loop: !0,
59
66
  inlineCSS: { borderRadius: 12, overflow: "hidden" },
60
67
  "aria-describedby": `tictoccroc-banner-${a}`,
61
- children: l.map(({ id: e, url: r, image: t }, u) => /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(
68
+ ...p,
69
+ children: l.map(({ id: e, url: r, image: t }, b) => /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(
62
70
  n,
63
71
  {
64
72
  tag: "a",
65
73
  href: r,
66
74
  draggable: !1,
67
- onClick: m(r, e),
75
+ onClick: s(r, e),
68
76
  inlineCSS: { width: "100%" },
69
77
  children: /* @__PURE__ */ i(
70
- g,
78
+ S,
71
79
  {
72
80
  src: t || "",
73
- alt: `배너 ${u + 1}`,
81
+ alt: `배너 ${b + 1}`,
74
82
  width: 328,
75
83
  height: 100,
76
84
  draggable: !1,
@@ -89,5 +97,5 @@ function I({ id: a, banners: l, onClickBanner: o, imageProps: d, ...p }) {
89
97
  ] });
90
98
  }
91
99
  export {
92
- I as default
100
+ H as default
93
101
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dotss/tictoccroc",
3
3
  "type": "module",
4
- "version": "0.0.35",
4
+ "version": "0.1.0",
5
5
  "description": "Tictoccroc shared components, hooks, utils, and APIs for Dotss",
6
6
  "main": "./dist/index.mjs",
7
7
  "module": "./dist/index.mjs",
@@ -90,13 +90,9 @@
90
90
  "@storybook/addon-onboarding": "^9.0.4",
91
91
  "@storybook/react-vite": "^9.0.4",
92
92
  "@types/node": "^22.15.29",
93
- "@types/react": "^19.1.6",
94
- "@types/react-dom": "^19.1.5",
95
93
  "@vitejs/plugin-react-swc": "^3.10.0",
96
94
  "eslint-plugin-storybook": "^9.0.4",
97
95
  "glob": "^10.4.2",
98
- "react": "^19.0.0",
99
- "react-dom": "^19.0.0",
100
96
  "storybook": "^9.0.4",
101
97
  "vite-plugin-dts": "^4.5.4",
102
98
  "vitest": "^1.6.0"