@dotss/tictoccroc 0.12.0 → 0.13.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.
@@ -0,0 +1,128 @@
1
+ import { formatTimeLabel as e, getEndTimeColumn as t, getStartTimeColumn as n, isNextDayTime as r, shouldResetEndTime as i } from "./shared/components/TimePicker/TimePicker.utils.mjs";
2
+ import { forwardRef as a, useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
3
+ import { ChainPicker as u, Flexbox as d, Label as f, Typography as p } from "@dotss/ui";
4
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
5
+ import g from "@emotion/styled";
6
+ //#region shared/components/TimePicker/TimePicker.styles.ts
7
+ var _ = g.div`
8
+ position: relative;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ gap: ${({ theme: { spacing: e } }) => e.content(7)}px;
13
+ width: 100%;
14
+ padding: ${({ theme: { spacing: e } }) => e.content(2)}px 0;
15
+ `, v = g.div`
16
+ position: absolute;
17
+ width: 100%;
18
+ height: 54px;
19
+ background: ${({ theme: e }) => e.palette.background.primary};
20
+ border-radius: 12px;
21
+ `;
22
+ //#endregion
23
+ //#region shared/components/TimePicker/TimePicker.tsx
24
+ function y(t, n, i) {
25
+ let a = i && r(t.value), { period: o, time: s, ariaText: c } = e(t.label, a);
26
+ return /* @__PURE__ */ h(d, {
27
+ gap: 1,
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ "aria-label": c,
31
+ inlineCSS: i ? { width: "117px" } : { width: "82px" },
32
+ children: [
33
+ a && /* @__PURE__ */ m(f, {
34
+ size: "xSmall",
35
+ variant: n ? "solid" : "outlined",
36
+ color: "yellow",
37
+ "aria-hidden": !0,
38
+ children: "다음 날"
39
+ }),
40
+ /* @__PURE__ */ m(p, {
41
+ tag: "span",
42
+ variant: n ? "h5M" : "b5M",
43
+ children: o
44
+ }),
45
+ /* @__PURE__ */ m(p, {
46
+ tag: "span",
47
+ variant: n ? "h2M" : "h4M",
48
+ children: s
49
+ })
50
+ ]
51
+ });
52
+ }
53
+ var b = a(function({ onChange: e, onChangeStartTime: r, onChangeEndTime: a, startTime: d = 9, endTime: f = 12, range: g = [0, 24], step: b = 1, maxDuration: x, startTimeChainPickerProps: S, endTimeChainPickerProps: C, timePickerHighlightProps: w, renderStartTimeLabel: T, renderEndTimeLabel: E, inlineCSS: D, ...O }, k) {
54
+ let [A, j] = l(d), [M, N] = l(f), P = c(n(g, b, x)), F = c(t(d, g, b, x)), I = o((e, t) => y(e, t, !1), []), L = o((e, t) => y(e, t, x !== void 0), [x]), R = (e) => {
55
+ j(e), F.current = t(e, g, b, x), i(e, f, b, x) && N(F.current[0].value);
56
+ }, z = (e) => {
57
+ N(e);
58
+ };
59
+ return s(() => {
60
+ F.current = t(d, g, b, x);
61
+ }, [
62
+ d,
63
+ f,
64
+ g,
65
+ b,
66
+ x
67
+ ]), s(() => {
68
+ j(d);
69
+ }, [d]), s(() => {
70
+ i(d, f, b, x) ? N(F.current[0].value) : N(f);
71
+ }, [
72
+ d,
73
+ f,
74
+ b,
75
+ x
76
+ ]), s(() => {
77
+ e(A, M);
78
+ }, [A, M]), s(() => {
79
+ r?.(A);
80
+ }, [A]), s(() => {
81
+ a?.(M);
82
+ }, [M]), /* @__PURE__ */ h(_, {
83
+ ref: k,
84
+ css: D,
85
+ role: "group",
86
+ "aria-label": "시간 선택",
87
+ ...O,
88
+ children: [
89
+ /* @__PURE__ */ m(v, {
90
+ ...w,
91
+ "aria-hidden": !0
92
+ }),
93
+ /* @__PURE__ */ m(u, {
94
+ column: P.current,
95
+ value: d,
96
+ onChange: R,
97
+ renderLabel: T || I,
98
+ "aria-label": "시작 시간 선택",
99
+ inlineCSS: {
100
+ "& > li": { padding: 0 },
101
+ ...S?.inlineCSS
102
+ },
103
+ ...S
104
+ }),
105
+ /* @__PURE__ */ m(p, {
106
+ variant: "h5M",
107
+ color: "grey.50",
108
+ "aria-hidden": !0,
109
+ inlineCSS: { zIndex: 1 },
110
+ children: "부터"
111
+ }),
112
+ /* @__PURE__ */ m(u, {
113
+ column: F.current,
114
+ value: f,
115
+ onChange: z,
116
+ renderLabel: E || L,
117
+ "aria-label": "종료 시간 선택",
118
+ inlineCSS: {
119
+ "& > li": { padding: 0 },
120
+ ...C?.inlineCSS
121
+ },
122
+ ...C
123
+ })
124
+ ]
125
+ });
126
+ });
127
+ //#endregion
128
+ export { b as t };
package/dist/index.mjs CHANGED
@@ -42,72 +42,73 @@ import B from "./teacher/profile/components/CareNoteSection/index.mjs";
42
42
  import { getChildLabel as V } from "./teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.mjs";
43
43
  import H from "./teacher/profile/components/ParentReviewSection/ParentReviewCard/index.mjs";
44
44
  import U from "./teacher/profile/components/ParentReviewSection/index.mjs";
45
- import { getBadgeLabel as W, getCareActivityLabel as G, getChargeLabel as K, getNote as q, getPictureLabel as J, getStrengthLabel as Y } from "./teacher/profile/components/KokTeacherCard/KokTeacherCard.utils.mjs";
46
- import X from "./teacher/profile/components/KokTeacherCard/index.mjs";
45
+ import W from "./shared/components/LoadingAnnouncer/index.mjs";
46
+ import G from "./teacher/profile/components/KokTeacherCard/KokTeacherCard.fallback.mjs";
47
+ import { getBadgeLabel as K, getCareActivityLabel as q, getChargeLabel as J, getNote as Y, getPictureLabel as X, getStrengthLabel as Z } from "./teacher/profile/components/KokTeacherCard/KokTeacherCard.utils.mjs";
48
+ import Q from "./teacher/profile/components/KokTeacherCard/index.mjs";
47
49
  import "./teacher/profile/components/index.mjs";
48
- import Z from "./shared/components/LoadingAnnouncer/index.mjs";
49
- import Q from "./teacher/home/components/TextAccount/TextAccount.fallback.mjs";
50
- import $ from "./teacher/home/components/TextAccount/index.mjs";
51
- import ee from "./shared/components/Carousel/CarouselSlide/index.mjs";
52
- import te from "./shared/components/Carousel/index.mjs";
53
- import ne from "./teacher/home/components/Carousel1Account/Carousel1Account.fallback.mjs";
54
- import re from "./teacher/home/components/Carousel1Account/index.mjs";
55
- import ie from "./teacher/home/components/Carousel2Account/Carousel2Account.fallback.mjs";
56
- import ae from "./teacher/home/components/Carousel2Account/index.mjs";
57
- import oe from "./shared/components/Swiper/SwiperBlock/index.mjs";
58
- import se from "./shared/components/MediaDialog/MediaBlock/index.mjs";
59
- import ce from "./shared/components/Swiper/index.mjs";
60
- import le from "./teacher/home/components/BannerAccount/BannerAccount.fallback.mjs";
61
- import ue from "./teacher/home/components/BannerAccount/index.mjs";
62
- import de from "./teacher/home/components/SingleAccount/SingleAccount.fallback.mjs";
63
- import fe from "./teacher/home/components/SingleAccount/index.mjs";
50
+ import $ from "./teacher/home/components/TextAccount/TextAccount.fallback.mjs";
51
+ import ee from "./teacher/home/components/TextAccount/index.mjs";
52
+ import te from "./shared/components/Carousel/CarouselSlide/index.mjs";
53
+ import ne from "./shared/components/Carousel/index.mjs";
54
+ import re from "./teacher/home/components/Carousel1Account/Carousel1Account.fallback.mjs";
55
+ import ie from "./teacher/home/components/Carousel1Account/index.mjs";
56
+ import ae from "./teacher/home/components/Carousel2Account/Carousel2Account.fallback.mjs";
57
+ import oe from "./teacher/home/components/Carousel2Account/index.mjs";
58
+ import se from "./shared/components/Swiper/SwiperBlock/index.mjs";
59
+ import ce from "./shared/components/MediaDialog/MediaBlock/index.mjs";
60
+ import le from "./shared/components/Swiper/index.mjs";
61
+ import ue from "./teacher/home/components/BannerAccount/BannerAccount.fallback.mjs";
62
+ import de from "./teacher/home/components/BannerAccount/index.mjs";
63
+ import fe from "./teacher/home/components/SingleAccount/SingleAccount.fallback.mjs";
64
+ import pe from "./teacher/home/components/SingleAccount/index.mjs";
64
65
  import "./teacher/home/components/index.mjs";
65
- import pe from "./parent/notification/utils/sanitize/sanitize.mjs";
66
+ import me from "./parent/notification/utils/sanitize/sanitize.mjs";
66
67
  import "./parent/notification/utils/index.mjs";
67
- import me from "./parent/notification/components/NotificationCard/index.mjs";
68
+ import he from "./parent/notification/components/NotificationCard/index.mjs";
68
69
  import "./parent/notification/components/index.mjs";
69
- import { t as he } from "./convertMdToHtml-Bmk0brLK.js";
70
+ import { t as ge } from "./convertMdToHtml-Bmk0brLK.js";
70
71
  import "./parent/b2b/utils/index.mjs";
71
- import ge from "./parent/b2b/components/ActionButtons/index.mjs";
72
- import _e from "./parent/b2b/components/BottomNotes/index.mjs";
73
- import ve from "./shared/components/TextField/index.mjs";
74
- import ye from "./parent/b2b/components/EmployeeNumberField/index.mjs";
75
- import be from "./parent/b2b/components/NameField/index.mjs";
76
- import { isSuccess as xe, isValid as Se } from "./parent/b2b/components/PhoneNumberField/PhoneNumberField.utils.mjs";
77
- import Ce from "./parent/b2b/components/PhoneNumberField/index.mjs";
78
- import we from "./parent/b2b/components/Title/index.mjs";
79
- import Te from "./shared/components/MediaDialog/MediaDialogContent/index.mjs";
80
- import Ee from "./shared/components/MediaDialog/MediaDialogFooter/index.mjs";
81
- import De from "./shared/components/MediaDialog/MediaDialogToolbar/index.mjs";
82
- import Oe from "./shared/components/MediaDialog/index.mjs";
83
- import ke from "./shared/components/TimePicker/index.mjs";
84
- import Ae from "./shared/components/Calendar/index.mjs";
85
- import je from "./shared/components/ChatKit/Message/Message.fallback.mjs";
86
- import { getMessageLabel as Me, markMessageGroupBoundaries as Ne } from "./shared/components/ChatKit/Message/Message.utils.mjs";
87
- import Pe from "./shared/components/ChatKit/Message/index.mjs";
88
- import { getImageMessageLabel as Fe, getPhotoAssetMessage as Ie } from "./shared/components/ChatKit/ImageMessage/ImageMessage.utils.mjs";
89
- import Le from "./shared/components/ChatKit/ImageMessage/index.mjs";
90
- import Re from "./shared/components/ChatKit/SystemMessage/(Actions)/DirectTrageRiskInfoBottomSheet/DirectTrageRiskInfoBottomSheet.mjs";
91
- import { getSystemMessageLabel as ze } from "./shared/components/ChatKit/SystemMessage/SystemMessage.utils.mjs";
92
- import Be from "./shared/components/ChatKit/SystemMessage/index.mjs";
93
- import { getBotMessageLabel as Ve, getCtaButtonText as He } from "./shared/components/ChatKit/BotMessage/BotMessage.utils.mjs";
94
- import Ue from "./shared/components/ChatKit/BotMessage/index.mjs";
95
- import We from "./shared/components/ChatKit/InputBar/InputBar.fallback.mjs";
96
- import Ge from "./shared/components/ChatKit/InputBar/index.mjs";
97
- import Ke from "./shared/components/ChatKit/Seperator/index.mjs";
98
- import qe from "./shared/components/ChatKit/UnreadMessagePill/index.mjs";
99
- import Je from "./parent/b2b/components/TopLogo/index.mjs";
72
+ import _e from "./parent/b2b/components/ActionButtons/index.mjs";
73
+ import ve from "./parent/b2b/components/BottomNotes/index.mjs";
74
+ import ye from "./shared/components/TextField/index.mjs";
75
+ import be from "./parent/b2b/components/EmployeeNumberField/index.mjs";
76
+ import xe from "./parent/b2b/components/NameField/index.mjs";
77
+ import { isSuccess as Se, isValid as Ce } from "./parent/b2b/components/PhoneNumberField/PhoneNumberField.utils.mjs";
78
+ import we from "./parent/b2b/components/PhoneNumberField/index.mjs";
79
+ import Te from "./parent/b2b/components/Title/index.mjs";
80
+ import Ee from "./shared/components/MediaDialog/MediaDialogContent/index.mjs";
81
+ import De from "./shared/components/MediaDialog/MediaDialogFooter/index.mjs";
82
+ import Oe from "./shared/components/MediaDialog/MediaDialogToolbar/index.mjs";
83
+ import ke from "./shared/components/MediaDialog/index.mjs";
84
+ import Ae from "./shared/components/TimePicker/index.mjs";
85
+ import je from "./shared/components/Calendar/index.mjs";
86
+ import Me from "./shared/components/ChatKit/Message/Message.fallback.mjs";
87
+ import { getMessageLabel as Ne, markMessageGroupBoundaries as Pe } from "./shared/components/ChatKit/Message/Message.utils.mjs";
88
+ import Fe from "./shared/components/ChatKit/Message/index.mjs";
89
+ import { getImageMessageLabel as Ie, getPhotoAssetMessage as Le } from "./shared/components/ChatKit/ImageMessage/ImageMessage.utils.mjs";
90
+ import Re from "./shared/components/ChatKit/ImageMessage/index.mjs";
91
+ import ze from "./shared/components/ChatKit/SystemMessage/(Actions)/DirectTrageRiskInfoBottomSheet/DirectTrageRiskInfoBottomSheet.mjs";
92
+ import { getSystemMessageLabel as Be } from "./shared/components/ChatKit/SystemMessage/SystemMessage.utils.mjs";
93
+ import Ve from "./shared/components/ChatKit/SystemMessage/index.mjs";
94
+ import { getBotMessageLabel as He, getCtaButtonText as Ue } from "./shared/components/ChatKit/BotMessage/BotMessage.utils.mjs";
95
+ import We from "./shared/components/ChatKit/BotMessage/index.mjs";
96
+ import Ge from "./shared/components/ChatKit/InputBar/InputBar.fallback.mjs";
97
+ import Ke from "./shared/components/ChatKit/InputBar/index.mjs";
98
+ import qe from "./shared/components/ChatKit/Seperator/index.mjs";
99
+ import Je from "./shared/components/ChatKit/UnreadMessagePill/index.mjs";
100
+ import Ye from "./parent/b2b/components/TopLogo/index.mjs";
100
101
  import "./parent/b2b/components/index.mjs";
101
- import Ye from "./shared/utils/isAndroid/index.mjs";
102
- import Xe from "./shared/utils/isIos/index.mjs";
103
- import Ze from "./shared/utils/isApp/index.mjs";
104
- import Qe from "./shared/utils/isDesktop/index.mjs";
105
- import $e from "./shared/utils/ageToBirthDate/index.mjs";
106
- import et from "./shared/utils/objectToQueryString/index.mjs";
107
- import tt from "./shared/utils/getVimeoId/index.mjs";
108
- import nt from "./shared/utils/parseQueryString/index.mjs";
109
- import rt from "./shared/utils/share/index.mjs";
110
- import it from "./shared/utils/getCareTypeLabel/index.mjs";
111
- import at from "./shared/utils/getHoverChildrenScaleStyle/index.mjs";
102
+ import Xe from "./shared/utils/isAndroid/index.mjs";
103
+ import Ze from "./shared/utils/isIos/index.mjs";
104
+ import Qe from "./shared/utils/isApp/index.mjs";
105
+ import $e from "./shared/utils/isDesktop/index.mjs";
106
+ import et from "./shared/utils/ageToBirthDate/index.mjs";
107
+ import tt from "./shared/utils/objectToQueryString/index.mjs";
108
+ import nt from "./shared/utils/getVimeoId/index.mjs";
109
+ import rt from "./shared/utils/parseQueryString/index.mjs";
110
+ import it from "./shared/utils/share/index.mjs";
111
+ import at from "./shared/utils/getCareTypeLabel/index.mjs";
112
+ import ot from "./shared/utils/getHoverChildrenScaleStyle/index.mjs";
112
113
  import "./shared/utils/index.mjs";
113
- export { E as AbilityBadge, D as AbilityCollection, ge as ActionButtons, h as ActivityGallery, p as ActivityGalleryItem, F as AvailableScheduleSection, ue as BannerAccount, le as BannerAccountFallback, Ue as BotMessage, _e as BottomNotes, Ae as Calendar, R as CareNote, B as CareNoteSection, v as CareerItem, y as CareerSection, te as Carousel, re as Carousel1Account, ne as Carousel1AccountFallback, ae as Carousel2Account, ie as Carousel2AccountFallback, ee as CarouselSlide, g as CertificateItem, _ as CertificateSection, Re as DirectTradeRiskInfoBottomSheet, b as EducationItem, x as EducationSection, ye as EmployeeNumberField, a as Image, i as ImageError, Le as ImageMessage, Ge as InputBar, We as InputBarFallback, X as KokTeacherCard, Z as LoadingAnnouncer, m as Masonry, u as MasonryBlock, se as MediaBlock, Oe as MediaDialog, Te as MediaDialogContent, Ee as MediaDialogFooter, De as MediaDialogToolbar, Pe as Message, je as MessageFallback, be as NameField, me as NotificationCard, H as ParentReviewCard, U as ParentReviewSection, Ce as PhoneNumberField, S as PreferredActivityKeywordGroup, w as PreferredAgeGroup, s as ProfileSummary, z as Roller, I as RollerBlock, N as ScheduleBlock, O as ScheduleEvent, P as Scheduler, Ke as Seperator, fe as SingleAccount, de as SingleAccountFallback, c as StatBadge, l as StatBadgeCollection, ce as Swiper, oe as SwiperBlock, Be as SystemMessage, $ as TextAccount, Q as TextAccountFallback, ve as TextField, ke as TimePicker, we as Title, Je as TopLogo, qe as UnreadMessagePill, $e as ageToBirthDate, L as birthDateToAge, d as combineRef, he as convertMdToHtml, k as dayFlagToDay, T as getAbilityCollection, M as getAvailableDateRange, W as getBadgeLabel, Ve as getBotMessageLabel, G as getCareActivityLabel, it as getCareTypeLabel, K as getChargeLabel, V as getChildLabel, He as getCtaButtonText, A as getDateRange, at as getHoverChildrenScaleStyle, Fe as getImageMessageLabel, r as getImageUrl, o as getLastActiveText, Me as getMessageLabel, q as getNote, Ie as getPhotoAssetMessage, J as getPictureLabel, C as getPreferredAgeKeywords, Y as getStrengthLabel, ze as getSystemMessageLabel, j as getTimeRange, tt as getVimeoId, Ye as isAndroid, Ze as isApp, Qe as isDesktop, Xe as isIos, t as isServer, xe as isSuccess, Se as isValid, Ne as markMessageGroupBoundaries, et as objectToQueryString, nt as parseQueryString, pe as sanitize, rt as share, f as useCombineRef, e as useInView, n as useIsomorphicLayoutEffect };
114
+ export { E as AbilityBadge, D as AbilityCollection, _e as ActionButtons, h as ActivityGallery, p as ActivityGalleryItem, F as AvailableScheduleSection, de as BannerAccount, ue as BannerAccountFallback, We as BotMessage, ve as BottomNotes, je as Calendar, R as CareNote, B as CareNoteSection, v as CareerItem, y as CareerSection, ne as Carousel, ie as Carousel1Account, re as Carousel1AccountFallback, oe as Carousel2Account, ae as Carousel2AccountFallback, te as CarouselSlide, g as CertificateItem, _ as CertificateSection, ze as DirectTradeRiskInfoBottomSheet, b as EducationItem, x as EducationSection, be as EmployeeNumberField, a as Image, i as ImageError, Re as ImageMessage, Ke as InputBar, Ge as InputBarFallback, Q as KokTeacherCard, G as KokTeacherCardFallback, W as LoadingAnnouncer, m as Masonry, u as MasonryBlock, ce as MediaBlock, ke as MediaDialog, Ee as MediaDialogContent, De as MediaDialogFooter, Oe as MediaDialogToolbar, Fe as Message, Me as MessageFallback, xe as NameField, he as NotificationCard, H as ParentReviewCard, U as ParentReviewSection, we as PhoneNumberField, S as PreferredActivityKeywordGroup, w as PreferredAgeGroup, s as ProfileSummary, z as Roller, I as RollerBlock, N as ScheduleBlock, O as ScheduleEvent, P as Scheduler, qe as Seperator, pe as SingleAccount, fe as SingleAccountFallback, c as StatBadge, l as StatBadgeCollection, le as Swiper, se as SwiperBlock, Ve as SystemMessage, ee as TextAccount, $ as TextAccountFallback, ye as TextField, Ae as TimePicker, Te as Title, Ye as TopLogo, Je as UnreadMessagePill, et as ageToBirthDate, L as birthDateToAge, d as combineRef, ge as convertMdToHtml, k as dayFlagToDay, T as getAbilityCollection, M as getAvailableDateRange, K as getBadgeLabel, He as getBotMessageLabel, q as getCareActivityLabel, at as getCareTypeLabel, J as getChargeLabel, V as getChildLabel, Ue as getCtaButtonText, A as getDateRange, ot as getHoverChildrenScaleStyle, Ie as getImageMessageLabel, r as getImageUrl, o as getLastActiveText, Ne as getMessageLabel, Y as getNote, Le as getPhotoAssetMessage, X as getPictureLabel, C as getPreferredAgeKeywords, Z as getStrengthLabel, Be as getSystemMessageLabel, j as getTimeRange, nt as getVimeoId, Xe as isAndroid, Qe as isApp, $e as isDesktop, Ze as isIos, t as isServer, Se as isSuccess, Ce as isValid, Pe as markMessageGroupBoundaries, tt as objectToQueryString, rt as parseQueryString, me as sanitize, it as share, f as useCombineRef, e as useInView, n as useIsomorphicLayoutEffect };
@@ -1,10 +1,7 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
- import { ChainPicker } from '@dotss/ui';
2
+ import { ChainPickerItem, ChainPicker } from '@dotss/ui';
3
3
  import { FlexboxProps } from 'node_modules/@dotss/ui/Flexbox/Flexbox';
4
- export interface TimePickerItem {
5
- label: string;
6
- value: number;
7
- }
4
+ export type TimePickerItem = ChainPickerItem;
8
5
  export interface TimePickerProps extends Omit<FlexboxProps, 'onChange'> {
9
6
  onChange: (startTime: number, endTime: number) => void;
10
7
  onChangeStartTime?: (startTime: number) => void;
@@ -13,6 +10,22 @@ export interface TimePickerProps extends Omit<FlexboxProps, 'onChange'> {
13
10
  endTime?: number;
14
11
  step?: number;
15
12
  range?: [number, number];
13
+ /**
14
+ * 시작부터 종료까지 고를 수 있는 최대 시간(시간 단위)이다.
15
+ * 이 값을 지정하면 종료가 자정을 넘을 수 있다.
16
+ * 종료 열은 `start + step`부터 `start + maxDuration`까지이고 `range[1]`은 쓰지 않는다.
17
+ * 시작 열은 `range[1] - 0.5`까지다.
18
+ *
19
+ * 24 이상인 종료 값은 다음 날 시각이고(28은 다음 날 04:00), `onChange`와
20
+ * `onChangeEndTime`에도 그대로 넘어간다.
21
+ *
22
+ * `step` 이상 24 이하여야 한다. `step`보다 작으면 종료 열이 비어 오류가 나고,
23
+ * 24보다 크면 같은 시각이 두 번 나올 수 있다.
24
+ *
25
+ * 시작 열은 마운트할 때 한 번만 만든다. 마운트 뒤 `maxDuration`, `range`, `step`이
26
+ * 바뀔 수 있으면 `key`로 다시 마운트한다.
27
+ */
28
+ maxDuration?: number;
16
29
  startTimeChainPickerProps?: Omit<Parameters<typeof ChainPicker>[0], 'column' | 'value' | 'onChange' | 'renderLabel'>;
17
30
  endTimeChainPickerProps?: Omit<Parameters<typeof ChainPicker>[0], 'column' | 'value' | 'onChange' | 'renderLabel'>;
18
31
  timePickerHighlightProps?: HTMLAttributes<HTMLDivElement>;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../../TimePicker-BwACyeBR.js";
1
+ import { t as e } from "../../../TimePicker-eObMuz3A.js";
2
2
  export { e as default };
@@ -0,0 +1,11 @@
1
+ import { ChainPickerItem } from '@dotss/ui';
2
+ export declare const NEXT_DAY_LABEL = "\uB2E4\uC74C \uB0A0";
3
+ export declare function getStartTimeColumn(range: [number, number], step: number, maxDuration?: number): ChainPickerItem[];
4
+ export declare function getEndTimeColumn(startTime: number, range: [number, number], step: number, maxDuration?: number): ChainPickerItem[];
5
+ export declare function shouldResetEndTime(startTime: number, endTime: number, step: number, maxDuration?: number): boolean;
6
+ export declare function isNextDayTime(value: number): boolean;
7
+ export declare function formatTimeLabel(label: string, isNextDay: boolean): {
8
+ period: string;
9
+ time: string;
10
+ ariaText: string;
11
+ };
@@ -0,0 +1,38 @@
1
+ import e from "../../utils/getTimeRange/index.mjs";
2
+ //#region shared/components/TimePicker/TimePicker.utils.ts
3
+ var t = .5, n = 24, r = "다음 날";
4
+ function i(r, i, a) {
5
+ let o = a === void 0 ? r[1] - i : r[1] - t;
6
+ return e(0, n, {
7
+ minTime: r[0],
8
+ maxTime: o
9
+ });
10
+ }
11
+ function a(t, r, i, a) {
12
+ return a === void 0 ? e(0, n, {
13
+ minTime: t + i > r[1] ? r[1] : t + i,
14
+ maxTime: r[1]
15
+ }) : e(0, n * 2, {
16
+ minTime: t + i,
17
+ maxTime: t + a
18
+ }).map((e) => ({
19
+ ...e,
20
+ ariaValueText: c(e.label, s(e.value)).ariaText
21
+ }));
22
+ }
23
+ function o(e, n, r, i) {
24
+ return i === void 0 ? e >= n - t : n < e + r || n > e + i;
25
+ }
26
+ function s(e) {
27
+ return e >= n;
28
+ }
29
+ function c(e, t) {
30
+ let [n, i] = e.split(":").map(Number), a = n >= 12 ? "오후" : "오전", o = n % 12 || 12;
31
+ return {
32
+ period: a,
33
+ time: `${o}:${i.toString().padStart(2, "0")}`,
34
+ ariaText: `${t ? `${r} ` : ""}${a} ${o}시 ${i}분`
35
+ };
36
+ }
37
+ //#endregion
38
+ export { r as NEXT_DAY_LABEL, c as formatTimeLabel, a as getEndTimeColumn, i as getStartTimeColumn, s as isNextDayTime, o as shouldResetEndTime };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../../TimePicker-BwACyeBR.js";
1
+ import { t as e } from "../../../TimePicker-eObMuz3A.js";
2
2
  //#region shared/components/TimePicker/index.ts
3
3
  var t = e;
4
4
  //#endregion
@@ -0,0 +1,2 @@
1
+ declare function KokTeacherCardFallback(): import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export default KokTeacherCardFallback;
@@ -0,0 +1,128 @@
1
+ import e from "../../../../shared/components/LoadingAnnouncer/index.mjs";
2
+ import t from "@dotss/ui/core/useTheme";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ import a from "@dotss/ui/Box";
5
+ import o from "@dotss/ui/Card";
6
+ import s from "@dotss/ui/Flexbox";
7
+ import c from "@dotss/ui/Skeleton";
8
+ //#region teacher/profile/components/KokTeacherCard/KokTeacherCard.fallback.tsx
9
+ function l() {
10
+ let { spacing: l, palette: u } = t();
11
+ return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(e, {}), /* @__PURE__ */ i(o, {
12
+ variant: "outlined",
13
+ "aria-busy": !0,
14
+ wrapperProps: { inlineCSS: {
15
+ width: "100%",
16
+ alignSelf: "stretch"
17
+ } },
18
+ inlineCSS: {
19
+ width: "100%",
20
+ gap: "unset",
21
+ borderWidth: 1,
22
+ padding: l.content(4) - 1,
23
+ cursor: "wait",
24
+ "&:hover, &:active": { backgroundColor: u.grey.white }
25
+ },
26
+ children: [
27
+ /* @__PURE__ */ i(s, {
28
+ justifyContent: "space-between",
29
+ gap: 3,
30
+ children: [/* @__PURE__ */ i(s, {
31
+ flexDirection: "column",
32
+ gap: 2,
33
+ alignItems: "center",
34
+ children: [/* @__PURE__ */ r(c, {
35
+ width: 74,
36
+ height: 74,
37
+ borderRadius: 200
38
+ }), /* @__PURE__ */ r(c, {
39
+ width: 72,
40
+ textHeight: "c3M"
41
+ })]
42
+ }), /* @__PURE__ */ i(s, {
43
+ flexDirection: "column",
44
+ flexGrow: 1,
45
+ gap: 2,
46
+ inlineCSS: { minWidth: 0 },
47
+ children: [
48
+ /* @__PURE__ */ i(s, {
49
+ gap: 2,
50
+ alignItems: "center",
51
+ inlineCSS: { minWidth: 0 },
52
+ children: [/* @__PURE__ */ i(s, {
53
+ flexGrow: 1,
54
+ gap: 2,
55
+ alignItems: "center",
56
+ children: [/* @__PURE__ */ r(c, {
57
+ width: 48,
58
+ height: 24,
59
+ borderRadius: 6
60
+ }), /* @__PURE__ */ r(c, {
61
+ width: 64,
62
+ textHeight: "h4B"
63
+ })]
64
+ }), /* @__PURE__ */ r(c, {
65
+ width: 24,
66
+ height: 24,
67
+ borderRadius: 4
68
+ })]
69
+ }),
70
+ /* @__PURE__ */ i(s, {
71
+ flexDirection: "column",
72
+ gap: 1,
73
+ children: [/* @__PURE__ */ r(c, {
74
+ textHeight: "b4M",
75
+ inlineCSS: { width: "100%" }
76
+ }), /* @__PURE__ */ r(c, {
77
+ textHeight: "b4M",
78
+ inlineCSS: { width: "72%" }
79
+ })]
80
+ }),
81
+ /* @__PURE__ */ i(s, {
82
+ flexDirection: "column",
83
+ gap: 1,
84
+ children: [/* @__PURE__ */ r(c, {
85
+ textHeight: "b5R",
86
+ inlineCSS: { width: "68%" }
87
+ }), /* @__PURE__ */ r(c, {
88
+ textHeight: "b5R",
89
+ inlineCSS: { width: "84%" }
90
+ })]
91
+ })
92
+ ]
93
+ })]
94
+ }),
95
+ /* @__PURE__ */ r(a, {
96
+ tag: "hr",
97
+ mt: 2,
98
+ mb: 2,
99
+ inlineCSS: {
100
+ border: "unset",
101
+ height: 1,
102
+ background: u.grey[20]
103
+ }
104
+ }),
105
+ /* @__PURE__ */ i(s, {
106
+ alignItems: "center",
107
+ justifyContent: "space-between",
108
+ children: [/* @__PURE__ */ r(c, {
109
+ width: 148,
110
+ textHeight: "h5B"
111
+ }), /* @__PURE__ */ r(c, {
112
+ width: 88,
113
+ height: 24,
114
+ borderRadius: 6
115
+ })]
116
+ }),
117
+ /* @__PURE__ */ r(s, {
118
+ mt: 1,
119
+ children: /* @__PURE__ */ r(c, {
120
+ textHeight: "c4R",
121
+ inlineCSS: { width: "78%" }
122
+ })
123
+ })
124
+ ]
125
+ })] });
126
+ }
127
+ //#endregion
128
+ export { l as default };
@@ -1,4 +1,6 @@
1
1
  import { KokTeacherCardProps, default as KokTeacherCard } from './KokTeacherCard';
2
+ import { default as KokTeacherCardFallback } from './KokTeacherCard.fallback';
2
3
  export * from './KokTeacherCard.utils';
4
+ export { KokTeacherCardFallback };
3
5
  export type { KokTeacherCardProps };
4
6
  export default KokTeacherCard;
@@ -1,6 +1,7 @@
1
1
  import e from "./KokTeacherCard.mjs";
2
- import { getBadgeLabel as t, getCareActivityLabel as n, getChargeLabel as r, getNote as i, getPictureLabel as a, getStrengthLabel as o } from "./KokTeacherCard.utils.mjs";
2
+ import t from "./KokTeacherCard.fallback.mjs";
3
+ import { getBadgeLabel as n, getCareActivityLabel as r, getChargeLabel as i, getNote as a, getPictureLabel as o, getStrengthLabel as s } from "./KokTeacherCard.utils.mjs";
3
4
  //#region teacher/profile/components/KokTeacherCard/index.ts
4
- var s = e;
5
+ var c = e;
5
6
  //#endregion
6
- export { s as default, t as getBadgeLabel, n as getCareActivityLabel, r as getChargeLabel, i as getNote, a as getPictureLabel, o as getStrengthLabel };
7
+ export { t as KokTeacherCardFallback, c as default, n as getBadgeLabel, r as getCareActivityLabel, i as getChargeLabel, a as getNote, o as getPictureLabel, s as getStrengthLabel };
@@ -22,6 +22,7 @@ import b from "./CareNoteSection/index.mjs";
22
22
  import { getChildLabel as x } from "./ParentReviewSection/ParentReviewSection.utils.mjs";
23
23
  import S from "./ParentReviewSection/ParentReviewCard/index.mjs";
24
24
  import C from "./ParentReviewSection/index.mjs";
25
- import { getBadgeLabel as w, getCareActivityLabel as T, getChargeLabel as E, getNote as D, getPictureLabel as O, getStrengthLabel as k } from "./KokTeacherCard/KokTeacherCard.utils.mjs";
26
- import A from "./KokTeacherCard/index.mjs";
27
- export { g as AbilityBadge, _ as AbilityCollection, a as ActivityGallery, i as ActivityGalleryItem, v as AvailableScheduleSection, y as CareNote, b as CareNoteSection, c as CareerItem, l as CareerSection, o as CertificateItem, s as CertificateSection, u as EducationItem, d as EducationSection, A as KokTeacherCard, S as ParentReviewCard, C as ParentReviewSection, f as PreferredActivityKeywordGroup, m as PreferredAgeGroup, t as ProfileSummary, n as StatBadge, r as StatBadgeCollection, h as getAbilityCollection, w as getBadgeLabel, T as getCareActivityLabel, E as getChargeLabel, x as getChildLabel, e as getLastActiveText, D as getNote, O as getPictureLabel, p as getPreferredAgeKeywords, k as getStrengthLabel };
25
+ import w from "./KokTeacherCard/KokTeacherCard.fallback.mjs";
26
+ import { getBadgeLabel as T, getCareActivityLabel as E, getChargeLabel as D, getNote as O, getPictureLabel as k, getStrengthLabel as A } from "./KokTeacherCard/KokTeacherCard.utils.mjs";
27
+ import j from "./KokTeacherCard/index.mjs";
28
+ export { g as AbilityBadge, _ as AbilityCollection, a as ActivityGallery, i as ActivityGalleryItem, v as AvailableScheduleSection, y as CareNote, b as CareNoteSection, c as CareerItem, l as CareerSection, o as CertificateItem, s as CertificateSection, u as EducationItem, d as EducationSection, j as KokTeacherCard, w as KokTeacherCardFallback, S as ParentReviewCard, C as ParentReviewSection, f as PreferredActivityKeywordGroup, m as PreferredAgeGroup, t as ProfileSummary, n as StatBadge, r as StatBadgeCollection, h as getAbilityCollection, T as getBadgeLabel, E as getCareActivityLabel, D as getChargeLabel, x as getChildLabel, e as getLastActiveText, O as getNote, k as getPictureLabel, p as getPreferredAgeKeywords, A as getStrengthLabel };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dotss/tictoccroc",
3
3
  "type": "module",
4
- "version": "0.12.0",
4
+ "version": "0.13.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",
@@ -1,120 +0,0 @@
1
- import e from "./shared/utils/getTimeRange/index.mjs";
2
- import { forwardRef as t, useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
3
- import { ChainPicker as o, Flexbox as s, Typography as c } from "@dotss/ui";
4
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
- import d from "@emotion/styled";
6
- //#region shared/components/TimePicker/TimePicker.styles.ts
7
- var f = d.div`
8
- position: relative;
9
- display: flex;
10
- align-items: center;
11
- justify-content: center;
12
- gap: ${({ theme: { spacing: e } }) => e.content(7)}px;
13
- width: 100%;
14
- padding: ${({ theme: { spacing: e } }) => e.content(2)}px 0;
15
- `, p = d.div`
16
- position: absolute;
17
- width: 100%;
18
- height: 54px;
19
- background: ${({ theme: e }) => e.palette.background.primary};
20
- border-radius: 12px;
21
- `, m = t(function({ onChange: t, onChangeStartTime: d, onChangeEndTime: m, startTime: h = 9, endTime: g = 12, range: _ = [0, 24], step: v = 1, startTimeChainPickerProps: y, endTimeChainPickerProps: b, timePickerHighlightProps: x, renderStartTimeLabel: S, renderEndTimeLabel: C, inlineCSS: w, ...T }, E) {
22
- let [D, O] = a(h), [k, A] = a(g), j = i(e(0, 24, {
23
- minTime: _[0],
24
- maxTime: _[1] - v
25
- })), M = i(e(0, 24, {
26
- minTime: h + v,
27
- maxTime: _[1]
28
- })), N = n((e, t) => {
29
- let [n, r] = e.label.split(":").map(Number), i = n >= 12, a = n % 12 || 12, o = i ? "오후" : "오전";
30
- return /* @__PURE__ */ u(s, {
31
- gap: 1,
32
- alignItems: "center",
33
- justifyContent: "center",
34
- "aria-label": `${o} ${a}시 ${r}분`,
35
- inlineCSS: { width: "82px" },
36
- children: [/* @__PURE__ */ l(c, {
37
- tag: "span",
38
- variant: t ? "h5M" : "b5M",
39
- children: o
40
- }), /* @__PURE__ */ l(c, {
41
- tag: "span",
42
- variant: t ? "h2M" : "h4M",
43
- children: `${a}:${r.toString().padStart(2, "0")}`
44
- })]
45
- });
46
- }, []), P = (t) => {
47
- O(t), M.current = e(0, 24, {
48
- minTime: t + v > _[1] ? _[1] : t + v,
49
- maxTime: _[1]
50
- }), t >= g - .5 && A(M.current[0].value);
51
- }, F = (e) => {
52
- A(e);
53
- };
54
- return r(() => {
55
- M.current = e(0, 24, {
56
- minTime: h + v > _[1] ? _[1] : h + v,
57
- maxTime: _[1]
58
- });
59
- }, [
60
- h,
61
- g,
62
- _,
63
- v
64
- ]), r(() => {
65
- O(h);
66
- }, [h]), r(() => {
67
- h >= g - .5 ? A(M.current[0].value) : A(g);
68
- }, [h, g]), r(() => {
69
- t(D, k);
70
- }, [D, k]), r(() => {
71
- d?.(D);
72
- }, [D]), r(() => {
73
- m?.(k);
74
- }, [k]), /* @__PURE__ */ u(f, {
75
- ref: E,
76
- css: w,
77
- role: "group",
78
- "aria-label": "시간 선택",
79
- ...T,
80
- children: [
81
- /* @__PURE__ */ l(p, {
82
- ...x,
83
- "aria-hidden": !0
84
- }),
85
- /* @__PURE__ */ l(o, {
86
- column: j.current,
87
- value: h,
88
- onChange: P,
89
- renderLabel: S || N,
90
- "aria-label": "시작 시간 선택",
91
- inlineCSS: {
92
- "& > li": { padding: 0 },
93
- ...y?.inlineCSS
94
- },
95
- ...y
96
- }),
97
- /* @__PURE__ */ l(c, {
98
- variant: "h5M",
99
- color: "grey.50",
100
- "aria-hidden": !0,
101
- inlineCSS: { zIndex: 1 },
102
- children: "부터"
103
- }),
104
- /* @__PURE__ */ l(o, {
105
- column: M.current,
106
- value: g,
107
- onChange: F,
108
- renderLabel: C || N,
109
- "aria-label": "종료 시간 선택",
110
- inlineCSS: {
111
- "& > li": { padding: 0 },
112
- ...b?.inlineCSS
113
- },
114
- ...b
115
- })
116
- ]
117
- });
118
- });
119
- //#endregion
120
- export { m as t };