@dotss/tictoccroc 0.0.5 → 0.0.7

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 (25) hide show
  1. package/dist/shared/components/Scheduler/Scheduler.d.ts +2 -2
  2. package/dist/shared/components/Scheduler/Scheduler.mjs +164 -164
  3. package/dist/shared/components/Scheduler/Scheduler.utils.d.ts +13 -7
  4. package/dist/shared/components/Scheduler/Scheduler.utils.mjs +65 -54
  5. package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.mjs +23 -24
  6. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.d.ts +3 -3
  7. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs +3 -3
  8. package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.d.ts +5 -2
  9. package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.mjs +24 -24
  10. package/dist/teacher/profile/components/CareerSection/CareerSection.mjs +42 -41
  11. package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.d.ts +5 -2
  12. package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs +27 -22
  13. package/dist/teacher/profile/components/CertificationSection/CertificationSection.mjs +41 -37
  14. package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.d.ts +6 -3
  15. package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +38 -30
  16. package/dist/teacher/profile/components/EducationSection/EducationSection.mjs +35 -34
  17. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs +33 -31
  18. package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs +4 -4
  19. package/dist/teacher/profile/utils/index.d.ts +1 -0
  20. package/dist/teacher/profile/utils/index.mjs +5 -0
  21. package/dist/teacher/profile/utils/sortItems/index.d.ts +3 -0
  22. package/dist/teacher/profile/utils/sortItems/index.mjs +6 -0
  23. package/dist/teacher/profile/utils/sortItems/sortItems.d.ts +9 -0
  24. package/dist/teacher/profile/utils/sortItems/sortItems.mjs +29 -0
  25. package/package.json +9 -1
@@ -1,19 +1,20 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { useState as u, Children as p, isValidElement as v } from "react";
3
- import { Flexbox as n, Typography as f, Tooltip as E, Icon as c, Button as j } from "@dotss/ui";
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
+ import { useState as h, Children as w, isValidElement as E } from "react";
3
+ import { Flexbox as n, Typography as p, Tooltip as v, Icon as d, Button as j } from "@dotss/ui";
4
4
  import k from "@dotss/ui/core/useTheme";
5
5
  import D from "./EducationItem/EducationItem.mjs";
6
- function B({
7
- children: s,
8
- action: d,
9
- showTooltip: y = !1,
10
- enableToggle: h = !1,
6
+ import { sortItemElements as O } from "../../utils/sortItems/sortItems.mjs";
7
+ function L({
8
+ children: u,
9
+ action: m,
10
+ showTooltip: f = !1,
11
+ enableToggle: l = !1,
11
12
  ...i
12
13
  }) {
13
- const { spacing: l } = k(), [g, x] = u(!1), [o, S] = u(!1), m = p.toArray(s).filter(v).filter((t) => t.type === D), C = m.length > 0, b = m.length > 3, a = () => x((t) => !t), I = (t) => {
14
- (t.key === "Enter" || t.key === " ") && a();
15
- }, w = () => S((t) => !t);
16
- return /* @__PURE__ */ r(
14
+ const { spacing: a } = k(), [x, y] = h(!1), [o, g] = h(!1), r = w.toArray(u).filter(E).filter((t) => t.type === D), S = r.length > 0, C = r.length > 3, c = () => y((t) => !t), I = (t) => {
15
+ (t.key === "Enter" || t.key === " ") && c();
16
+ }, b = () => g((t) => !t);
17
+ return /* @__PURE__ */ s(
17
18
  n,
18
19
  {
19
20
  tag: "section",
@@ -27,9 +28,9 @@ function B({
27
28
  ...i == null ? void 0 : i.inlineCSS
28
29
  },
29
30
  children: [
30
- /* @__PURE__ */ r(n, { alignItems: "center", justifyContent: "center", gap: 1, children: [
31
+ /* @__PURE__ */ s(n, { alignItems: "center", justifyContent: "center", gap: 1, children: [
31
32
  /* @__PURE__ */ e(
32
- f,
33
+ p,
33
34
  {
34
35
  id: "education-section-title",
35
36
  tag: "h2",
@@ -38,17 +39,17 @@ function B({
38
39
  children: "학력"
39
40
  }
40
41
  ),
41
- y && /* @__PURE__ */ e(
42
- E,
42
+ f && /* @__PURE__ */ e(
43
+ v,
43
44
  {
44
- open: g,
45
- onClose: a,
45
+ open: x,
46
+ onClose: c,
46
47
  color: "secondary",
47
48
  role: "tooltip",
48
49
  "aria-labelledby": "education-section-tooltip",
49
50
  "aria-describedby": "education-section-tooltip-desc",
50
- body: /* @__PURE__ */ r(
51
- f,
51
+ body: /* @__PURE__ */ s(
52
+ p,
52
53
  {
53
54
  id: "education-section-tooltip-desc",
54
55
  tag: "p",
@@ -57,7 +58,7 @@ function B({
57
58
  noWrap: !0,
58
59
  inlineCSS: {
59
60
  display: "flex",
60
- gap: l.content(1),
61
+ gap: a.content(1),
61
62
  "& svg": {
62
63
  width: "20px !important",
63
64
  height: "20px !important",
@@ -66,22 +67,22 @@ function B({
66
67
  },
67
68
  children: [
68
69
  "째깍악어가 확인한 정보는",
69
- /* @__PURE__ */ e(c, { name: "InfoFill", size: "small", color: "tictoccroc-teacher.brand.green" }),
70
+ /* @__PURE__ */ e(d, { name: "InfoFill", size: "small", color: "tictoccroc-teacher.brand.green" }),
70
71
  "인증 마크가 붙어요!"
71
72
  ]
72
73
  }
73
74
  ),
74
75
  inlineCSS: {
75
76
  "&:after": {
76
- transform: `translateX(-${100 + l.content(1)}px)`
77
+ transform: `translateX(-${100 + a.content(1)}px)`
77
78
  }
78
79
  },
79
80
  style: {
80
81
  top: -8,
81
- left: `calc(50% + 100px - ${l.content(0.5)}px)`
82
+ left: `calc(50% + 100px - ${a.content(0.5)}px)`
82
83
  },
83
84
  children: /* @__PURE__ */ e(
84
- c,
85
+ d,
85
86
  {
86
87
  id: "education-section-tooltip",
87
88
  role: "button",
@@ -89,7 +90,7 @@ function B({
89
90
  name: "TooltipFill",
90
91
  size: "small",
91
92
  color: "grey.50",
92
- onClick: a,
93
+ onClick: c,
93
94
  onKeyDown: I,
94
95
  "aria-label": "추가 정보 안내",
95
96
  inlineCSS: {
@@ -100,17 +101,17 @@ function B({
100
101
  }
101
102
  )
102
103
  ] }),
103
- C && /* @__PURE__ */ e(
104
+ S && /* @__PURE__ */ e(
104
105
  n,
105
106
  {
106
107
  id: "education-section-education-items",
107
108
  tag: "ul",
108
109
  flexDirection: "column",
109
110
  inlineCSS: { width: "inherit" },
110
- children: p.toArray(s).slice(0, o ? void 0 : 3)
111
+ children: O(r).slice(0, !l || o ? void 0 : 3)
111
112
  }
112
113
  ),
113
- h && b && /* @__PURE__ */ e(
114
+ l && C && /* @__PURE__ */ e(
114
115
  n,
115
116
  {
116
117
  alignItems: "center",
@@ -123,8 +124,8 @@ function B({
123
124
  fullWidth: !0,
124
125
  variant: "text",
125
126
  color: "secondary",
126
- endAdornment: /* @__PURE__ */ e(c, { name: o ? "ChevronUpLine" : "ChevronDownLine" }),
127
- onClick: w,
127
+ endAdornment: /* @__PURE__ */ e(d, { name: o ? "ChevronUpLine" : "ChevronDownLine" }),
128
+ onClick: b,
128
129
  "aria-controls": "education-section-education-items",
129
130
  "aria-expanded": o,
130
131
  children: o ? "접기" : "더 보기"
@@ -132,7 +133,7 @@ function B({
132
133
  )
133
134
  }
134
135
  ),
135
- !h && d && /* @__PURE__ */ e(
136
+ !l && m && /* @__PURE__ */ e(
136
137
  n,
137
138
  {
138
139
  mt: 4,
@@ -140,7 +141,7 @@ function B({
140
141
  alignItems: "center",
141
142
  justifyContent: "center",
142
143
  inlineCSS: { width: "inherit" },
143
- children: d
144
+ children: m
144
145
  }
145
146
  )
146
147
  ]
@@ -148,5 +149,5 @@ function B({
148
149
  );
149
150
  }
150
151
  export {
151
- B as default
152
+ L as default
152
153
  };
@@ -1,79 +1,81 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { Flexbox as i, Typography as l, Button as s, Icon as h } from "@dotss/ui";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as s } from "react";
3
+ import { Flexbox as t, Typography as o, Button as h, Icon as c } from "@dotss/ui";
4
4
  import p from "@dotss/ui/core/useTheme";
5
- const v = m(
6
- ({ children: c, totalCount: o, onClickViewAll: a, ...e }, g) => {
5
+ const x = s(
6
+ ({ children: g, totalCount: r, onClickViewAll: l, ...i }, d) => {
7
7
  const {
8
- palette: { grey: d },
9
- spacing: r
8
+ palette: { grey: m },
9
+ spacing: a
10
10
  } = p();
11
11
  return /* @__PURE__ */ n(
12
- i,
12
+ t,
13
13
  {
14
- ref: g,
14
+ ref: d,
15
15
  tag: "section",
16
- pl: 4,
17
- pr: 4,
18
16
  gap: 4,
19
17
  flexDirection: "column",
20
18
  "aria-labelledby": "parent-review-section-title",
21
- ...e,
19
+ ...i,
22
20
  inlineCSS: {
23
21
  width: "100%",
24
- ...e == null ? void 0 : e.inlineCSS
22
+ ...i == null ? void 0 : i.inlineCSS
25
23
  },
26
24
  children: [
27
- /* @__PURE__ */ n(i, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
28
- /* @__PURE__ */ t(i, { alignItems: "center", gap: 2, children: /* @__PURE__ */ n(l, { id: "parent-review-section-title", tag: "h2", variant: "h2B", children: [
25
+ /* @__PURE__ */ n(t, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
26
+ /* @__PURE__ */ e(t, { alignItems: "center", gap: 2, children: /* @__PURE__ */ n(o, { id: "parent-review-section-title", tag: "h2", variant: "h2B", children: [
29
27
  "부모님 리뷰",
30
- o > 0 && /* @__PURE__ */ n(
31
- l,
28
+ /* @__PURE__ */ n(
29
+ o,
32
30
  {
33
31
  tag: "span",
34
32
  variant: "h4R",
35
33
  color: "grey.70",
36
- inlineCSS: { marginLeft: r.content(2), verticalAlign: 2 },
34
+ inlineCSS: { marginLeft: a.content(2), verticalAlign: 2 },
37
35
  children: [
38
36
  "(",
39
- o.toLocaleString(),
37
+ r.toLocaleString(),
40
38
  "개)"
41
39
  ]
42
40
  }
43
41
  )
44
42
  ] }) }),
45
- typeof a == "function" && /* @__PURE__ */ t(
46
- s,
43
+ typeof l == "function" && /* @__PURE__ */ e(
44
+ h,
47
45
  {
48
46
  variant: "text",
49
47
  size: "small",
50
48
  color: "secondary",
51
- endAdornment: /* @__PURE__ */ t(h, { name: "ChevronRightLine" }),
52
- onClick: a,
49
+ endAdornment: /* @__PURE__ */ e(c, { name: "ChevronRightLine" }),
50
+ onClick: l,
53
51
  children: "전체보기"
54
52
  }
55
53
  )
56
54
  ] }),
57
- /* @__PURE__ */ t(
58
- i,
55
+ r > 0 && /* @__PURE__ */ e(
56
+ t,
59
57
  {
60
58
  tag: "ul",
61
59
  flexDirection: "column",
62
60
  inlineCSS: {
63
61
  "& > li + li": {
64
- borderTop: `1px solid ${d[10]}`,
65
- marginTop: r.content(5),
66
- paddingTop: r.content(5)
62
+ borderTop: `1px solid ${m[10]}`,
63
+ marginTop: a.content(5),
64
+ paddingTop: a.content(5)
67
65
  }
68
66
  },
69
- children: c
67
+ children: g
70
68
  }
71
- )
69
+ ),
70
+ r <= 0 && /* @__PURE__ */ n(t, { alignItems: "center", justifyContent: "center", gap: 1, pt: 8, pb: 8, children: [
71
+ /* @__PURE__ */ e(c, { name: "OngoingFill", color: "grey.50" }),
72
+ /* @__PURE__ */ e(o, { tag: "p", variant: "b4R", color: "grey.70", children: "아직 작성된 부모님 리뷰가 없어요." })
73
+ ] })
72
74
  ]
73
75
  }
74
76
  );
75
77
  }
76
78
  );
77
79
  export {
78
- v as default
80
+ x as default
79
81
  };
@@ -1,9 +1,9 @@
1
1
  const l = {
2
2
  age1: { label: "~24개월" },
3
- age2: { label: "3~4세" },
4
- age3: { label: "5~7세" },
5
- age4: { label: "8~10세" },
6
- age5: { label: "11~13세" }
3
+ age2: { label: "2~3세" },
4
+ age3: { label: "4~6세" },
5
+ age4: { label: "7~9세" },
6
+ age5: { label: "10~12세" }
7
7
  };
8
8
  function r(a) {
9
9
  return Object.keys(l).filter((e) => a[e] === "Y").map((e) => l[e].label);
@@ -0,0 +1 @@
1
+ export { default as sortItems, sortItemElements } from './sortItems';
@@ -0,0 +1,5 @@
1
+ import { sortItemElements as s, default as m } from "./sortItems/sortItems.mjs";
2
+ export {
3
+ s as sortItemElements,
4
+ m as sortItems
5
+ };
@@ -0,0 +1,3 @@
1
+ import { default as sortItems, sortItemElements } from './sortItems';
2
+ export { sortItemElements };
3
+ export default sortItems;
@@ -0,0 +1,6 @@
1
+ import e from "./sortItems.mjs";
2
+ import { sortItemElements as m } from "./sortItems.mjs";
3
+ export {
4
+ e as default,
5
+ m as sortItemElements
6
+ };
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ type ItemProps = {
3
+ status: 'VERIFIED' | 'PENDING' | 'REJECTED' | 'DELETED';
4
+ regDatetime: string;
5
+ priority: number;
6
+ };
7
+ export default function sortItems<T>(items: T[], get?: (item: T) => ItemProps): T[];
8
+ export declare function sortItemElements<T extends ReactElement<ItemProps>>(items: T[]): T[];
9
+ export {};
@@ -0,0 +1,29 @@
1
+ function c(s, r = (a) => a) {
2
+ const a = s.some((o) => !!r(o).priority), n = s.filter((o) => r(o).status !== "REJECTED"), m = s.filter((o) => r(o).status === "REJECTED");
3
+ if (a)
4
+ return [
5
+ ...n.sort((o, i) => {
6
+ const t = r(o).priority, e = r(i).priority;
7
+ return t === 0 && e === 0 ? r(i).regDatetime.localeCompare(r(o).regDatetime) : t === 0 && e !== 0 ? -1 : t !== 0 && e === 0 ? 1 : e - t;
8
+ }),
9
+ ...m.sort((o, i) => {
10
+ const t = r(o).priority, e = r(i).priority;
11
+ return t === 0 && e === 0 ? r(i).regDatetime.localeCompare(r(o).regDatetime) : t === 0 && e !== 0 ? -1 : t !== 0 && e === 0 ? 1 : e - t;
12
+ })
13
+ ];
14
+ {
15
+ const o = n.filter((t) => r(t).status === "VERIFIED"), i = n.filter((t) => r(t).status !== "VERIFIED");
16
+ return [
17
+ ...o.sort((t, e) => r(e).regDatetime.localeCompare(r(t).regDatetime)),
18
+ ...i.sort((t, e) => r(e).regDatetime.localeCompare(r(t).regDatetime)),
19
+ ...m.sort((t, e) => r(e).regDatetime.localeCompare(r(t).regDatetime))
20
+ ];
21
+ }
22
+ }
23
+ function u(s) {
24
+ return c(s, (r) => r.props);
25
+ }
26
+ export {
27
+ c as default,
28
+ u as sortItemElements
29
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dotss/tictoccroc",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "description": "Tictoccroc shared components, hooks, utils, and APIs for Dotss",
6
6
  "main": "./dist/index.mjs",
7
7
  "module": "./dist/index.mjs",
@@ -35,6 +35,14 @@
35
35
  "import": "./dist/teacher/profile/components/*/index.mjs",
36
36
  "types": "./dist/teacher/profile/components/*/index.d.ts"
37
37
  },
38
+ "./teacher/profile/utils": {
39
+ "import": "./dist/teacher/profile/utils/index.mjs",
40
+ "types": "./dist/teacher/profile/utils/index.d.ts"
41
+ },
42
+ "./teacher/profile/utils/*": {
43
+ "import": "./dist/teacher/profile/utils/*/index.mjs",
44
+ "types": "./dist/teacher/profile/utils/*/index.d.ts"
45
+ },
38
46
  "./shared/components": {
39
47
  "import": "./dist/shared/components/index.mjs",
40
48
  "types": "./dist/shared/components/index.d.ts"