@dotss/tictoccroc 0.0.10 → 0.0.11

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 { jsxs as n, jsx as e, Fragment as C } from "react/jsx-runtime";
2
- import { useState as I, useRef as F, useEffect as J } from "react";
3
- import { Flexbox as r, Typography as t, Icon as s, Label as B, Button as A } from "@dotss/ui";
2
+ import { useState as R, useRef as F, useEffect as J } from "react";
3
+ import { Flexbox as r, Typography as t, Icon as d, Label as B, Button as A } from "@dotss/ui";
4
4
  import G from "@dotss/ui/core/useTheme";
5
5
  import K from "dayjs";
6
6
  import O from "../../../../shared/components/Image/Image.mjs";
@@ -8,34 +8,34 @@ import { getLastActiveText as W } from "./ProfileSummary.utils.mjs";
8
8
  function Y({
9
9
  avatar: i,
10
10
  introduction: l,
11
- name: d,
11
+ name: u,
12
12
  grade: f,
13
13
  activeHours: S = 0,
14
- rating: p = 0,
15
- reviewCount: h = 0,
16
- adronment: R,
14
+ rating: h = 0,
15
+ reviewCount: p = 0,
16
+ adronment: L,
17
17
  lastActiveAt: x,
18
- action: L
18
+ action: v
19
19
  }) {
20
20
  const {
21
21
  palette: { background: y, brand: E, etc: k },
22
22
  spacing: a
23
- } = G(), [g, D] = I(!1), [v, z] = I(!1), b = F(null), T = S >= 0 && h > 0, m = x ? K(x) : null, w = W(m), j = (o) => {
24
- var c, u;
23
+ } = G(), [m, D] = R(!1), [z, T] = R(!1), b = F(null), w = S >= 0 && p > 0, c = x ? K(x) : null, I = c ? W(c) : null, j = (o) => {
24
+ var s, g;
25
25
  switch (o.key) {
26
26
  case "Enter":
27
- o.preventDefault(), (c = i.onClick) == null || c.call(i, o);
27
+ o.preventDefault(), (s = i.onClick) == null || s.call(i, o);
28
28
  break;
29
29
  case " ":
30
- o.preventDefault(), (u = i.onClick) == null || u.call(i, o);
30
+ o.preventDefault(), (g = i.onClick) == null || g.call(i, o);
31
31
  break;
32
32
  }
33
33
  }, M = () => D((o) => !o);
34
34
  return J(() => {
35
35
  const o = () => {
36
36
  if (!b.current) return;
37
- const c = b.current, u = parseInt(window.getComputedStyle(c).lineHeight), $ = c.scrollHeight, H = Math.ceil($ / u);
38
- z(H > 4);
37
+ const s = b.current, g = parseInt(window.getComputedStyle(s).lineHeight), $ = s.scrollHeight, H = Math.ceil($ / g);
38
+ T(H > 4);
39
39
  };
40
40
  return o(), window.addEventListener("resize", o), () => {
41
41
  window.removeEventListener("resize", o);
@@ -81,9 +81,10 @@ function Y({
81
81
  width: 88,
82
82
  height: 88,
83
83
  src: i.src,
84
- alt: `${d} 선생님 프로필 이미지`,
84
+ alt: `${u} 선생님 프로필 이미지`,
85
85
  fit: "cover",
86
86
  borderRadius: 100,
87
+ role: "presentation",
87
88
  style: {
88
89
  objectFit: "cover"
89
90
  }
@@ -131,7 +132,7 @@ function Y({
131
132
  }
132
133
  ),
133
134
  /* @__PURE__ */ e(
134
- s,
135
+ d,
135
136
  {
136
137
  name: "AlertFill",
137
138
  size: "xSmall",
@@ -150,172 +151,152 @@ function Y({
150
151
  ]
151
152
  }
152
153
  ),
153
- (m == null ? void 0 : m.isValid()) && /* @__PURE__ */ e(
154
+ (c == null ? void 0 : c.isValid()) && /* @__PURE__ */ e(
154
155
  t,
155
156
  {
156
157
  tag: "p",
157
158
  variant: "c3M",
158
159
  color: "grey.50",
159
160
  inlineCSS: {
160
- visibility: w ? void 0 : "hidden"
161
+ visibility: I ? void 0 : "hidden"
161
162
  },
162
- children: w || "활동 정보 없음"
163
+ children: I || "활동 정보 없음"
163
164
  }
164
165
  )
165
166
  ] }),
166
- /* @__PURE__ */ n(
167
- r,
168
- {
169
- flexDirection: "column",
170
- justifyContent: "flex-start",
171
- gap: 3,
172
- pt: 0.75,
173
- pb: 0.75,
174
- flexGrow: 1,
175
- children: [
176
- /* @__PURE__ */ n(
177
- r,
178
- {
179
- alignItems: "center",
180
- gap: 2,
181
- flexWrap: "wrap",
182
- inlineCSS: {
183
- maxHeight: 30
184
- },
185
- children: [
186
- f && /* @__PURE__ */ e(
187
- B,
188
- {
189
- variant: "outlined",
190
- size: "small",
191
- color: "blue",
192
- "aria-label": `${d} 선생님의 등급: ${f}`,
193
- children: f
194
- }
195
- ),
196
- /* @__PURE__ */ n(
197
- t,
198
- {
199
- tag: "p",
200
- variant: "h2B",
201
- "aria-label": `${d} 선생님`,
202
- inlineCSS: {
203
- flexGrow: 1,
204
- "& > span": {
205
- marginLeft: a.content(1),
206
- fontWeight: 400
167
+ /* @__PURE__ */ n(r, { flexDirection: "column", justifyContent: "flex-start", gap: 3, flexGrow: 1, children: [
168
+ /* @__PURE__ */ n(r, { alignItems: "center", gap: 2, flexWrap: "wrap", children: [
169
+ f && /* @__PURE__ */ e(B, { variant: "outlined", size: "small", color: "blue", "aria-label": `${f} 등급`, children: f }),
170
+ /* @__PURE__ */ n(
171
+ t,
172
+ {
173
+ tag: "p",
174
+ variant: "h2B",
175
+ "aria-label": `${u} 선생님`,
176
+ inlineCSS: {
177
+ flexGrow: 1,
178
+ "& > span": {
179
+ marginLeft: a.content(1),
180
+ fontWeight: 400
181
+ }
182
+ },
183
+ children: [
184
+ u,
185
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "선생님" })
186
+ ]
187
+ }
188
+ ),
189
+ /* @__PURE__ */ e(
190
+ r,
191
+ {
192
+ alignItems: "center",
193
+ inlineCSS: {
194
+ maxHeight: 30
195
+ },
196
+ children: L
197
+ }
198
+ )
199
+ ] }),
200
+ /* @__PURE__ */ n(
201
+ r,
202
+ {
203
+ pl: 4,
204
+ pr: 4,
205
+ pt: 2,
206
+ pb: 2,
207
+ justifyContent: "space-around",
208
+ alignItems: "center",
209
+ gap: 5,
210
+ "aria-hidden": !w,
211
+ inlineCSS: {
212
+ borderRadius: 8,
213
+ backgroundColor: y.primary,
214
+ visibility: w ? void 0 : "hidden"
215
+ },
216
+ children: [
217
+ /* @__PURE__ */ n(r, { alignItems: "center", role: "group", "aria-label": `누적 수업 ${S}시간`, children: [
218
+ /* @__PURE__ */ e(d, { name: "TimeLine", size: "xSmall", color: "grey.70" }),
219
+ /* @__PURE__ */ e(
220
+ t,
221
+ {
222
+ tag: "p",
223
+ variant: "h4B",
224
+ inlineCSS: {
225
+ marginLeft: a.content(1),
226
+ color: E.primary.text
227
+ },
228
+ children: S.toLocaleString()
229
+ }
230
+ ),
231
+ /* @__PURE__ */ e(
232
+ t,
233
+ {
234
+ tag: "span",
235
+ variant: "b5R",
236
+ color: "grey.70",
237
+ inlineCSS: {
238
+ marginLeft: a.content(0.5)
239
+ },
240
+ children: "시간"
241
+ }
242
+ )
243
+ ] }),
244
+ /* @__PURE__ */ n(
245
+ r,
246
+ {
247
+ alignItems: "center",
248
+ role: "group",
249
+ "aria-label": h > 0 ? `평점 ${h}, 리뷰 ${p}개` : `평점 집계중, 리뷰 ${p}개`,
250
+ children: [
251
+ /* @__PURE__ */ e(d, { name: "ReviewLine", size: "xSmall", color: "grey.70" }),
252
+ h > 0 ? /* @__PURE__ */ n(C, { children: [
253
+ /* @__PURE__ */ e(
254
+ t,
255
+ {
256
+ tag: "p",
257
+ variant: "h4B",
258
+ inlineCSS: {
259
+ marginLeft: a.content(1),
260
+ color: E.primary.text
261
+ },
262
+ children: h.toLocaleString()
207
263
  }
208
- },
209
- children: [
210
- d,
211
- /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "선생님" })
212
- ]
213
- }
214
- ),
215
- R
216
- ]
217
- }
218
- ),
219
- T && /* @__PURE__ */ n(
220
- r,
221
- {
222
- pl: 4,
223
- pr: 4,
224
- pt: 2,
225
- pb: 2,
226
- justifyContent: "space-around",
227
- alignItems: "center",
228
- gap: 5,
229
- inlineCSS: {
230
- borderRadius: 8,
231
- backgroundColor: y.primary
232
- },
233
- children: [
234
- /* @__PURE__ */ n(r, { alignItems: "center", role: "group", "aria-label": `누적 수업 ${S}시간`, children: [
235
- /* @__PURE__ */ e(s, { name: "TimeLine", size: "xSmall", color: "grey.70" }),
236
- /* @__PURE__ */ e(
264
+ ),
265
+ /* @__PURE__ */ n(
266
+ t,
267
+ {
268
+ tag: "span",
269
+ variant: "b5R",
270
+ color: "grey.70",
271
+ inlineCSS: {
272
+ marginLeft: a.content(0.5)
273
+ },
274
+ children: [
275
+ "(",
276
+ p.toLocaleString(),
277
+ ")"
278
+ ]
279
+ }
280
+ )
281
+ ] }) : /* @__PURE__ */ e(
237
282
  t,
238
283
  {
239
284
  tag: "p",
240
- variant: "h4B",
241
- inlineCSS: {
242
- marginLeft: a.content(1),
243
- color: E.primary.text
244
- },
245
- children: S.toLocaleString()
246
- }
247
- ),
248
- /* @__PURE__ */ e(
249
- t,
250
- {
251
- tag: "span",
252
- variant: "b5R",
285
+ variant: "h4R",
253
286
  color: "grey.70",
254
287
  inlineCSS: {
255
- marginLeft: a.content(0.5)
288
+ marginLeft: a.content(1)
256
289
  },
257
- children: "시간"
290
+ children: "집계중"
258
291
  }
259
292
  )
260
- ] }),
261
- /* @__PURE__ */ n(
262
- r,
263
- {
264
- alignItems: "center",
265
- role: "group",
266
- "aria-label": p > 0 ? `평점 ${p}, 리뷰 ${h}개` : `평점 집계중, 리뷰 ${h}개`,
267
- children: [
268
- /* @__PURE__ */ e(s, { name: "ReviewLine", size: "xSmall", color: "grey.70" }),
269
- p > 0 ? /* @__PURE__ */ n(C, { children: [
270
- /* @__PURE__ */ e(
271
- t,
272
- {
273
- tag: "p",
274
- variant: "h4B",
275
- inlineCSS: {
276
- marginLeft: a.content(1),
277
- color: E.primary.text
278
- },
279
- children: p.toLocaleString()
280
- }
281
- ),
282
- /* @__PURE__ */ n(
283
- t,
284
- {
285
- tag: "span",
286
- variant: "b5R",
287
- color: "grey.70",
288
- inlineCSS: {
289
- marginLeft: a.content(0.5)
290
- },
291
- children: [
292
- "(",
293
- h.toLocaleString(),
294
- ")"
295
- ]
296
- }
297
- )
298
- ] }) : /* @__PURE__ */ e(
299
- t,
300
- {
301
- tag: "p",
302
- variant: "h4R",
303
- color: "grey.70",
304
- inlineCSS: {
305
- marginLeft: a.content(1)
306
- },
307
- children: "집계중"
308
- }
309
- )
310
- ]
311
- }
312
- )
313
- ]
314
- }
315
- )
316
- ]
317
- }
318
- )
293
+ ]
294
+ }
295
+ )
296
+ ]
297
+ }
298
+ )
299
+ ] })
319
300
  ] }),
320
301
  /* @__PURE__ */ n(
321
302
  r,
@@ -358,7 +339,7 @@ function Y({
358
339
  },
359
340
  children: [
360
341
  l.status === "REJECTED" && /* @__PURE__ */ e(
361
- s,
342
+ d,
362
343
  {
363
344
  name: "AlertFill",
364
345
  size: "xSmall",
@@ -381,7 +362,7 @@ function Y({
381
362
  tag: "dl",
382
363
  variant: "b4R",
383
364
  color: l.status === "REJECTED" ? "grey.30" : "grey.70",
384
- lineClamp: g ? void 0 : 4,
365
+ lineClamp: m ? void 0 : 4,
385
366
  inlineCSS: {
386
367
  marginTop: a.content(2),
387
368
  whiteSpace: "pre-wrap"
@@ -393,26 +374,26 @@ function Y({
393
374
  }
394
375
  )
395
376
  ] }),
396
- v && /* @__PURE__ */ e(
377
+ z && /* @__PURE__ */ e(
397
378
  A,
398
379
  {
399
380
  variant: "text",
400
381
  size: "xSmall",
401
382
  color: "secondary",
402
- endAdornment: /* @__PURE__ */ e(s, { name: g ? "ChevronUpLine" : "ChevronDownLine" }),
383
+ endAdornment: /* @__PURE__ */ e(d, { name: m ? "ChevronUpLine" : "ChevronDownLine" }),
403
384
  onClick: M,
404
- "aria-expanded": g,
385
+ "aria-expanded": m,
405
386
  "aria-controls": "about-me",
406
387
  inlineCSS: {
407
388
  marginLeft: "auto"
408
389
  },
409
- children: g ? "접기" : "더 보기"
390
+ children: m ? "접기" : "더 보기"
410
391
  }
411
392
  )
412
393
  ]
413
394
  }
414
395
  ),
415
- L
396
+ v
416
397
  ]
417
398
  }
418
399
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dotss/tictoccroc",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "description": "Tictoccroc shared components, hooks, utils, and APIs for Dotss",
6
6
  "main": "./dist/index.mjs",
7
7
  "module": "./dist/index.mjs",