@tipp/ui 1.6.25 → 1.6.27
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.
- package/dist/app/index.cjs +2 -2
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +47 -47
- package/dist/app/platform/coach-question-list.cjs.map +1 -1
- package/dist/app/platform/coach-question-list.js +30 -30
- package/dist/app/platform/contents-card.cjs.map +1 -1
- package/dist/app/platform/contents-card.js +30 -30
- package/dist/app/platform/curriculum-card.js +5 -5
- package/dist/app/platform/edit-coaching-time.cjs +2 -2
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +34 -34
- package/dist/app/platform/edit-service-type.cjs +2 -2
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +34 -34
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +34 -34
- package/dist/app/platform/goal-manage-card-read.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-read.js +30 -30
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +33 -33
- package/dist/app/platform/report-card.cjs.map +1 -1
- package/dist/app/platform/report-card.js +30 -30
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +34 -34
- package/dist/app/platform/session-card.cjs +2 -2
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +36 -36
- package/dist/app/platform/session-review-simple-read.cjs.map +1 -1
- package/dist/app/platform/session-review-simple-read.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/index.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +32 -32
- package/dist/app/platform/userInfos/coaching-customer-info/large.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/medium.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/small.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +29 -29
- package/dist/app/platform/userInfos/session-user-info-detail.cjs.map +1 -1
- package/dist/app/platform/userInfos/session-user-info-detail.js +29 -29
- package/dist/app/platform/userInfos/utils.cjs.map +1 -1
- package/dist/app/platform/userInfos/utils.js +29 -29
- package/dist/atoms/dialog.cjs +2 -2
- package/dist/atoms/dialog.cjs.map +1 -1
- package/dist/atoms/dialog.js +1 -1
- package/dist/atoms/index.cjs +2 -2
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.js +65 -65
- package/dist/atoms/pagination.js +3 -3
- package/dist/charts/index.js +3 -3
- package/dist/chunk-2YJ3EG6A.js +164 -0
- package/dist/chunk-2YJ3EG6A.js.map +1 -0
- package/dist/chunk-3IOLG7AJ.js +145 -0
- package/dist/chunk-3IOLG7AJ.js.map +1 -0
- package/dist/chunk-4DTD3FXF.js +47 -0
- package/dist/chunk-4DTD3FXF.js.map +1 -0
- package/dist/chunk-4Z5NYYOE.js +145 -0
- package/dist/chunk-4Z5NYYOE.js.map +1 -0
- package/dist/chunk-4ZLXDFP3.js +145 -0
- package/dist/chunk-4ZLXDFP3.js.map +1 -0
- package/dist/chunk-5VDTWYNQ.js +357 -0
- package/dist/chunk-5VDTWYNQ.js.map +1 -0
- package/dist/chunk-7KMPLHBV.js +357 -0
- package/dist/chunk-7KMPLHBV.js.map +1 -0
- package/dist/chunk-7QGUMO7V.js +54 -0
- package/dist/chunk-7QGUMO7V.js.map +1 -0
- package/dist/chunk-AFQMLTCH.js +54 -0
- package/dist/chunk-AFQMLTCH.js.map +1 -0
- package/dist/chunk-AQG6J4WX.js +357 -0
- package/dist/chunk-AQG6J4WX.js.map +1 -0
- package/dist/chunk-AW7YHNJD.js +174 -0
- package/dist/chunk-AW7YHNJD.js.map +1 -0
- package/dist/chunk-CIO2WR2Q.js +145 -0
- package/dist/chunk-CIO2WR2Q.js.map +1 -0
- package/dist/chunk-ED3ABG7K.js +54 -0
- package/dist/chunk-ED3ABG7K.js.map +1 -0
- package/dist/chunk-ERDNB5SX.js +30 -0
- package/dist/chunk-ERDNB5SX.js.map +1 -0
- package/dist/chunk-EREBMLDQ.js +58 -0
- package/dist/chunk-EREBMLDQ.js.map +1 -0
- package/dist/chunk-HN2C35F6.js +70 -0
- package/dist/chunk-HN2C35F6.js.map +1 -0
- package/dist/chunk-J5RZURAR.js +106 -0
- package/dist/chunk-J5RZURAR.js.map +1 -0
- package/dist/chunk-JRPA2S7O.js +54 -0
- package/dist/chunk-JRPA2S7O.js.map +1 -0
- package/dist/chunk-KT4BIOJJ.js +54 -0
- package/dist/chunk-KT4BIOJJ.js.map +1 -0
- package/dist/chunk-KWVNYSQW.js +10 -0
- package/dist/chunk-KWVNYSQW.js.map +1 -0
- package/dist/chunk-L75KKLZS.js +106 -0
- package/dist/chunk-L75KKLZS.js.map +1 -0
- package/dist/chunk-OT4OMHJV.js +58 -0
- package/dist/chunk-OT4OMHJV.js.map +1 -0
- package/dist/chunk-OYYJEZVP.js +84 -0
- package/dist/chunk-OYYJEZVP.js.map +1 -0
- package/dist/chunk-P442X52N.js +284 -0
- package/dist/chunk-P442X52N.js.map +1 -0
- package/dist/chunk-RYORYWPY.js +164 -0
- package/dist/chunk-RYORYWPY.js.map +1 -0
- package/dist/chunk-TBEOWECF.js +47 -0
- package/dist/chunk-TBEOWECF.js.map +1 -0
- package/dist/chunk-UAUXUQWQ.js +174 -0
- package/dist/chunk-UAUXUQWQ.js.map +1 -0
- package/dist/chunk-VJ7EA7ZF.js +54 -0
- package/dist/chunk-VJ7EA7ZF.js.map +1 -0
- package/dist/chunk-WKQZJK7O.js +357 -0
- package/dist/chunk-WKQZJK7O.js.map +1 -0
- package/dist/chunk-X5L3SBB7.js +174 -0
- package/dist/chunk-X5L3SBB7.js.map +1 -0
- package/dist/icon.js +9 -9
- package/dist/icons/index.js +9 -9
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +97 -97
- package/dist/molecules/date-picker/date-picker-button.cjs.map +1 -1
- package/dist/molecules/date-picker/date-picker-button.js +29 -29
- package/dist/molecules/date-picker/index.js +3 -3
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.js +30 -30
- package/dist/molecules/expand-table/row.cjs.map +1 -1
- package/dist/molecules/expand-table/row.js +29 -29
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +33 -33
- package/dist/molecules/learning-post.js +2 -2
- package/dist/molecules/navigation.cjs.map +1 -1
- package/dist/molecules/navigation.js +29 -29
- package/dist/molecules/radio-button-card.cjs.map +1 -1
- package/dist/molecules/radio-button-card.js +29 -29
- package/dist/molecules/stepper.js +5 -5
- package/dist/molecules/tag-selector.cjs.map +1 -1
- package/dist/molecules/tag-selector.js +30 -30
- package/dist/molecules/time-select.cjs.map +1 -1
- package/dist/molecules/time-select.js +29 -29
- package/package.json +5 -3
- package/src/atoms/dialog.tsx +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/scroll-area.tsx"],"sourcesContent":["import {\n ScrollArea as ScrollAreaBase,\n type ScrollAreaProps,\n} from '@radix-ui/themes';\n\n/**\n * @deprecated 생성 dom 구조를 제어하기가 어려워 일단 Box 컴포넌트 사용 권장\n */\nconst ScrollArea = ScrollAreaBase;\n\nexport { ScrollArea, type ScrollAreaProps };\n"],"mappings":";AAAA;AAAA,EACE,cAAc;AAAA,OAET;AAKP,IAAM,aAAa;","names":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Heading
|
|
3
|
+
} from "./chunk-HJB3AASV.js";
|
|
4
|
+
import {
|
|
5
|
+
usePortalContainer
|
|
6
|
+
} from "./chunk-TD45ZF7D.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-O3DNDMV3.js";
|
|
10
|
+
import {
|
|
11
|
+
__objRest,
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./chunk-N552FDTV.js";
|
|
15
|
+
|
|
16
|
+
// src/atoms/dialog.tsx
|
|
17
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
18
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
19
|
+
import { Flex, Theme } from "@radix-ui/themes";
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var preventDefault = (e) => {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
};
|
|
24
|
+
function Content2(props) {
|
|
25
|
+
const _a = props, {
|
|
26
|
+
children,
|
|
27
|
+
style = {},
|
|
28
|
+
width,
|
|
29
|
+
maxWidth,
|
|
30
|
+
minWidth,
|
|
31
|
+
maxHeight,
|
|
32
|
+
height,
|
|
33
|
+
minHeight,
|
|
34
|
+
title,
|
|
35
|
+
buttons,
|
|
36
|
+
hideCloseButton,
|
|
37
|
+
className
|
|
38
|
+
} = _a, rest = __objRest(_a, [
|
|
39
|
+
"children",
|
|
40
|
+
"style",
|
|
41
|
+
"width",
|
|
42
|
+
"maxWidth",
|
|
43
|
+
"minWidth",
|
|
44
|
+
"maxHeight",
|
|
45
|
+
"height",
|
|
46
|
+
"minHeight",
|
|
47
|
+
"title",
|
|
48
|
+
"buttons",
|
|
49
|
+
"hideCloseButton",
|
|
50
|
+
"className"
|
|
51
|
+
]);
|
|
52
|
+
const { dialogContainerRef } = usePortalContainer();
|
|
53
|
+
return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: dialogContainerRef.current, children: /* @__PURE__ */ jsx(Theme, { asChild: true, children: /* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "DialogOverlay", children: /* @__PURE__ */ jsxs(
|
|
54
|
+
RadixDialog.Content,
|
|
55
|
+
__spreadProps(__spreadValues({
|
|
56
|
+
className: `DialogContent ${className || ""}`,
|
|
57
|
+
onPointerDownOutside: preventDefault,
|
|
58
|
+
style: __spreadValues({
|
|
59
|
+
width,
|
|
60
|
+
maxWidth,
|
|
61
|
+
minWidth,
|
|
62
|
+
maxHeight,
|
|
63
|
+
height,
|
|
64
|
+
minHeight
|
|
65
|
+
}, style)
|
|
66
|
+
}, rest), {
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "2", justify: "between", width: "100%", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(RadixDialog.Title, { asChild: true, children: typeof title === "string" ? /* @__PURE__ */ jsx(Heading, { align: "center", mb: "2", variant: "heading3", children: title }) : title }),
|
|
70
|
+
!hideCloseButton && /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, className: "DialogClose", children: /* @__PURE__ */ jsx(IconButton, { color: "gray", variant: "ghost", children: /* @__PURE__ */ jsx(Cross1Icon, {}) }) })
|
|
71
|
+
] }),
|
|
72
|
+
children,
|
|
73
|
+
buttons ? /* @__PURE__ */ jsx(Flex, { gap: "3", justify: "end", mt: "3", width: "100%", children: buttons }) : null
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
) }) }) });
|
|
77
|
+
}
|
|
78
|
+
function Close2(_a) {
|
|
79
|
+
var _b = _a, {
|
|
80
|
+
children
|
|
81
|
+
} = _b, rest = __objRest(_b, [
|
|
82
|
+
"children"
|
|
83
|
+
]);
|
|
84
|
+
return /* @__PURE__ */ jsx(RadixDialog.Close, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
85
|
+
}
|
|
86
|
+
function Trigger2(_a) {
|
|
87
|
+
var _b = _a, {
|
|
88
|
+
children
|
|
89
|
+
} = _b, rest = __objRest(_b, [
|
|
90
|
+
"children"
|
|
91
|
+
]);
|
|
92
|
+
return /* @__PURE__ */ jsx(RadixDialog.Trigger, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
93
|
+
}
|
|
94
|
+
var Dialog = {
|
|
95
|
+
Root: RadixDialog.Root,
|
|
96
|
+
Trigger: Trigger2,
|
|
97
|
+
Content: Content2,
|
|
98
|
+
Close: Close2,
|
|
99
|
+
Description: RadixDialog.Description,
|
|
100
|
+
Title: RadixDialog.Title
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
Dialog
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=chunk-L75KKLZS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/dialog.tsx"],"sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { Flex, Theme } from '@radix-ui/themes';\nimport { usePortalContainer } from '@/theme/portal-provider';\nimport { Heading } from './heading';\nimport { IconButton } from './icon-button';\n\ntype ContentProps = RadixDialog.DialogContentProps & {\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n height?: string;\n maxHeight?: string;\n minHeight?: string;\n title?: string;\n hideCloseButton?: boolean;\n buttons?: React.ReactElement;\n};\n\nconst preventDefault: RadixDialog.DialogContentProps['onPointerDownOutside'] = (\n e\n) => {\n e.preventDefault();\n};\n\nfunction Content(props: ContentProps): React.ReactElement {\n const {\n children,\n style = {},\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n title,\n buttons,\n hideCloseButton,\n className,\n ...rest\n } = props;\n const { dialogContainerRef } = usePortalContainer();\n\n return (\n <RadixDialog.Portal container={dialogContainerRef.current}>\n <Theme asChild>\n <RadixDialog.Overlay className=\"DialogOverlay\">\n <RadixDialog.Content\n className={`DialogContent ${className || ''}`}\n onPointerDownOutside={preventDefault}\n style={{\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n ...style,\n }}\n {...rest}\n >\n <Flex gap=\"2\" justify=\"between\" width=\"100%\">\n <RadixDialog.Title asChild>\n {typeof title === 'string' ? (\n <Heading align=\"center\" mb=\"2\" variant=\"heading3\">\n {title}\n </Heading>\n ) : (\n title\n )}\n </RadixDialog.Title>\n {!hideCloseButton && (\n <RadixDialog.Close asChild className=\"DialogClose\">\n <IconButton color=\"gray\" variant=\"ghost\">\n <Cross1Icon />\n </IconButton>\n </RadixDialog.Close>\n )}\n </Flex>\n {children}\n {buttons ? (\n <Flex gap=\"3\" justify=\"end\" mt=\"3\" width=\"100%\">\n {buttons}\n </Flex>\n ) : null}\n </RadixDialog.Content>\n </RadixDialog.Overlay>\n </Theme>\n </RadixDialog.Portal>\n );\n}\n\nfunction Close({\n children,\n ...rest\n}: RadixDialog.DialogCloseProps): React.ReactElement {\n return (\n <RadixDialog.Close asChild {...rest}>\n {children}\n </RadixDialog.Close>\n );\n}\n\nfunction Trigger({\n children,\n ...rest\n}: RadixDialog.DialogTriggerProps): React.ReactElement {\n return (\n <RadixDialog.Trigger asChild {...rest}>\n {children}\n </RadixDialog.Trigger>\n );\n}\n\nexport const Dialog = {\n Root: RadixDialog.Root,\n Trigger,\n Content,\n Close,\n Description: RadixDialog.Description,\n Title: RadixDialog.Title,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,YAAY,iBAAiB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,MAAM,aAAa;AA2DhB,SAGM,KAHN;AA1CZ,IAAM,iBAAyE,CAC7E,MACG;AACH,IAAE,eAAe;AACnB;AAEA,SAASA,SAAQ,OAAyC;AACxD,QAcI,YAbF;AAAA;AAAA,IACA,QAAQ,CAAC;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAtCJ,IAwCM,IADC,iBACD,IADC;AAAA,IAZH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,QAAM,EAAE,mBAAmB,IAAI,mBA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A,EACA,OAAAC;AAAA,EACA,aAAyB;AAAA,EACzB,OAAmB;AACrB;","names":["Content","Close","Trigger"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-VJ7EA7ZF.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-52MVZ6AN.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (ref.current) {
|
|
24
|
+
const typo = ref.current;
|
|
25
|
+
const mouseOver = () => {
|
|
26
|
+
if (typo.clientHeight < typo.scrollHeight) {
|
|
27
|
+
setTooltipDisplay("block");
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const mouseOut = () => {
|
|
31
|
+
setTooltipDisplay("none");
|
|
32
|
+
};
|
|
33
|
+
ref.current.addEventListener("mouseenter", mouseOver);
|
|
34
|
+
ref.current.addEventListener("mouseleave", mouseOut);
|
|
35
|
+
}
|
|
36
|
+
}, [children]);
|
|
37
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
38
|
+
Typo,
|
|
39
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
40
|
+
ref,
|
|
41
|
+
style: __spreadValues({
|
|
42
|
+
width: "100%",
|
|
43
|
+
textOverflow: "ellipsis",
|
|
44
|
+
overflow: "hidden",
|
|
45
|
+
WebkitLineClamp: lineClamp,
|
|
46
|
+
display: "-webkit-box",
|
|
47
|
+
WebkitBoxOrient: "vertical",
|
|
48
|
+
wordBreak: "break-word"
|
|
49
|
+
}, style),
|
|
50
|
+
children
|
|
51
|
+
})
|
|
52
|
+
) });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
EllipsisTooltip
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chunk-OT4OMHJV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n children?: string;\n};\n\nexport function EllipsisTooltip(\n props: EllipsisTooltipProps\n): React.ReactElement {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n\n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n if (ref.current) {\n const typo = ref.current;\n const mouseOver = (): void => {\n if (typo.clientHeight < typo.scrollHeight) {\n setTooltipDisplay('block');\n }\n };\n\n const mouseOut = (): void => {\n setTooltipDisplay('none');\n };\n\n ref.current.addEventListener('mouseenter', mouseOver);\n ref.current.addEventListener('mouseleave', mouseOut);\n }\n }, [children]);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={ref}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n WebkitLineClamp: lineClamp,\n\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n wordBreak: 'break-word',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAuC7C;AA9BC,SAAS,gBACd,OACoB;AACpB,QAAoD,YAA5C,YAAU,OAAO,YAAY,EAZvC,IAYsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AAExC,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AACd,QAAI,IAAI,SAAS;AACf,YAAM,OAAO,IAAI;AACjB,YAAM,YAAY,MAAY;AAC5B,YAAI,KAAK,eAAe,KAAK,cAAc;AACzC,4BAAkB,OAAO;AAAA,QAC3B;AAAA,MACF;AAEA,YAAM,WAAW,MAAY;AAC3B,0BAAkB,MAAM;AAAA,MAC1B;AAEA,UAAI,QAAQ,iBAAiB,cAAc,SAAS;AACpD,UAAI,QAAQ,iBAAiB,cAAc,QAAQ;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,iBAAiB;AAAA,QAEjB,SAAS;AAAA,QACT,iBAAiB;AAAA,QACjB,WAAW;AAAA,SACR;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Separator
|
|
3
|
+
} from "./chunk-HYITAA4J.js";
|
|
4
|
+
import {
|
|
5
|
+
usePortalContainer
|
|
6
|
+
} from "./chunk-TD45ZF7D.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-O3DNDMV3.js";
|
|
10
|
+
import {
|
|
11
|
+
Flex
|
|
12
|
+
} from "./chunk-25HMMI7R.js";
|
|
13
|
+
import {
|
|
14
|
+
ClosePanelArrowIcon
|
|
15
|
+
} from "./chunk-UNTA4JJU.js";
|
|
16
|
+
import {
|
|
17
|
+
__objRest,
|
|
18
|
+
__spreadProps,
|
|
19
|
+
__spreadValues
|
|
20
|
+
} from "./chunk-N552FDTV.js";
|
|
21
|
+
|
|
22
|
+
// src/atoms/drawer.tsx
|
|
23
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
24
|
+
import { Grid, Theme } from "@radix-ui/themes";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
function Root2(props) {
|
|
27
|
+
return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
|
|
28
|
+
}
|
|
29
|
+
var preventDefault = (e) => {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
};
|
|
32
|
+
function Content2(props) {
|
|
33
|
+
const _a = props, { position = "right", className, children } = _a, rest = __objRest(_a, ["position", "className", "children"]);
|
|
34
|
+
const mobileHeaderSize = 48;
|
|
35
|
+
const desktopHeaderSize = 64;
|
|
36
|
+
const separatorSize = 1;
|
|
37
|
+
const { drawerContainerRef } = usePortalContainer();
|
|
38
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, { container: drawerContainerRef.current, children: /* @__PURE__ */ jsxs(Theme, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
Dialog.Content,
|
|
42
|
+
__spreadProps(__spreadValues({
|
|
43
|
+
className: `DrawerContent ${position} ${className || ""}`,
|
|
44
|
+
onPointerDownOutside: preventDefault
|
|
45
|
+
}, rest), {
|
|
46
|
+
children: /* @__PURE__ */ jsxs(
|
|
47
|
+
Grid,
|
|
48
|
+
{
|
|
49
|
+
height: "100%",
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
rows: {
|
|
52
|
+
initial: `${mobileHeaderSize}px ${separatorSize}px calc(100% - ${mobileHeaderSize + separatorSize}px)`,
|
|
53
|
+
sm: `${desktopHeaderSize}px ${separatorSize}px calc(100% - ${desktopHeaderSize + separatorSize}px)`
|
|
54
|
+
},
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Flex, { align: "center", px: { initial: "4", md: "6" }, children: /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { color: "gray", variant: "outline", children: /* @__PURE__ */ jsx(ClosePanelArrowIcon, {}) }) }) }),
|
|
57
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "horizontal", size: "4" }),
|
|
58
|
+
children
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
})
|
|
63
|
+
)
|
|
64
|
+
] }) });
|
|
65
|
+
}
|
|
66
|
+
function Trigger2(props) {
|
|
67
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
|
|
68
|
+
}
|
|
69
|
+
var Drawer = {
|
|
70
|
+
Root: Dialog.Root,
|
|
71
|
+
Trigger: Trigger2,
|
|
72
|
+
Content: Content2,
|
|
73
|
+
Close: Dialog.Close,
|
|
74
|
+
Title: Dialog.Title,
|
|
75
|
+
Description: Dialog.Description
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
Root2 as Root,
|
|
80
|
+
Content2 as Content,
|
|
81
|
+
Trigger2 as Trigger,
|
|
82
|
+
Drawer
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=chunk-OYYJEZVP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React from 'react';\nimport * as Dialog from '@radix-ui/react-dialog';\nimport { Grid, Theme } from '@radix-ui/themes';\nimport { usePortalContainer } from '@/theme/portal-provider';\nimport { ClosePanelArrowIcon } from '../icons/close-panel-arrow';\nimport { Flex } from './flex';\nimport { Separator } from './separator';\nimport { IconButton } from './icon-button';\n\nexport function Root(props: Dialog.DialogProps): React.ReactNode {\n return <Dialog.Root {...props} />;\n}\n\ntype ContentProps = Dialog.DialogContentProps & {\n /** Drawer가 붙는 위치, 기본값 right */\n position?: 'left' | 'right' | 'bottom' | 'top';\n};\n\nconst preventDefault: Dialog.DialogContentProps['onPointerDownOutside'] = (\n e\n) => {\n e.preventDefault();\n};\n\nexport function Content(props: ContentProps): React.ReactElement {\n const { position = 'right', className, children, ...rest } = props;\n\n const mobileHeaderSize = 48;\n const desktopHeaderSize = 64;\n const separatorSize = 1;\n const { drawerContainerRef } = usePortalContainer();\n\n return (\n <Dialog.Portal container={drawerContainerRef.current}>\n <Theme>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n onPointerDownOutside={preventDefault}\n {...rest}\n >\n <Grid\n height=\"100%\"\n overflow=\"hidden\"\n rows={{\n initial: `${mobileHeaderSize}px ${separatorSize}px calc(100% - ${mobileHeaderSize + separatorSize}px)`,\n sm: `${desktopHeaderSize}px ${separatorSize}px calc(100% - ${desktopHeaderSize + separatorSize}px)`,\n }}\n >\n <Flex align=\"center\" px={{ initial: '4', md: '6' }}>\n <Dialog.Close asChild>\n <IconButton color=\"gray\" variant=\"outline\">\n <ClosePanelArrowIcon />\n </IconButton>\n </Dialog.Close>\n </Flex>\n <Separator orientation=\"horizontal\" size=\"4\" />\n {children}\n </Grid>\n </Dialog.Content>\n </Theme>\n </Dialog.Portal>\n );\n}\n\nexport function Trigger(props: Dialog.DialogTriggerProps): React.ReactElement {\n return <Dialog.Trigger asChild {...props} />;\n}\n\nexport const Drawer = {\n Root: Dialog.Root,\n Trigger,\n Content,\n Close: Dialog.Close,\n Title: Dialog.Title,\n Description: Dialog.Description,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,YAAY,YAAY;AACxB,SAAS,MAAM,aAAa;AAQnB,cA+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,IAAM,SAAS;AAAA,EACpB,MAAa;AAAA,EACb,SAAAA;AAAA,EACA,SAAAD;AAAA,EACA,OAAc;AAAA,EACd,OAAc;AAAA,EACd,aAAoB;AACtB;","names":["Root","Content","Trigger"]}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OnOfflineRadioCard
|
|
3
|
+
} from "./chunk-4UV3GA6V.js";
|
|
4
|
+
import {
|
|
5
|
+
DatePickerButton
|
|
6
|
+
} from "./chunk-6ZAP57FO.js";
|
|
7
|
+
import {
|
|
8
|
+
TimeSelect
|
|
9
|
+
} from "./chunk-YPYQISJB.js";
|
|
10
|
+
import {
|
|
11
|
+
getTimeOption,
|
|
12
|
+
parseTimeOption
|
|
13
|
+
} from "./chunk-VGIX3A5R.js";
|
|
14
|
+
import {
|
|
15
|
+
Form
|
|
16
|
+
} from "./chunk-4JBL5FRI.js";
|
|
17
|
+
import {
|
|
18
|
+
toast
|
|
19
|
+
} from "./chunk-CYYWMYE7.js";
|
|
20
|
+
import {
|
|
21
|
+
Inset
|
|
22
|
+
} from "./chunk-XQOL7UBI.js";
|
|
23
|
+
import {
|
|
24
|
+
Grid
|
|
25
|
+
} from "./chunk-EGEQY3KT.js";
|
|
26
|
+
import {
|
|
27
|
+
Heading
|
|
28
|
+
} from "./chunk-HJB3AASV.js";
|
|
29
|
+
import {
|
|
30
|
+
Box
|
|
31
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
32
|
+
import {
|
|
33
|
+
BulletText
|
|
34
|
+
} from "./chunk-NAL2USH5.js";
|
|
35
|
+
import {
|
|
36
|
+
Typo
|
|
37
|
+
} from "./chunk-52MVZ6AN.js";
|
|
38
|
+
import {
|
|
39
|
+
Flex
|
|
40
|
+
} from "./chunk-25HMMI7R.js";
|
|
41
|
+
import {
|
|
42
|
+
Button
|
|
43
|
+
} from "./chunk-Q5AFRGVP.js";
|
|
44
|
+
import {
|
|
45
|
+
Card
|
|
46
|
+
} from "./chunk-2ZQK7NTN.js";
|
|
47
|
+
import {
|
|
48
|
+
ArrowRightIcon,
|
|
49
|
+
Cross1Icon
|
|
50
|
+
} from "./chunk-HLFG5ZTU.js";
|
|
51
|
+
import {
|
|
52
|
+
Badge
|
|
53
|
+
} from "./chunk-EWD4AO5N.js";
|
|
54
|
+
import {
|
|
55
|
+
__spreadProps,
|
|
56
|
+
__spreadValues
|
|
57
|
+
} from "./chunk-N552FDTV.js";
|
|
58
|
+
|
|
59
|
+
// src/app/platform/reservation-card.tsx
|
|
60
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
61
|
+
import { setHours, setMinutes } from "date-fns";
|
|
62
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
63
|
+
function ReservationCard(props) {
|
|
64
|
+
const {
|
|
65
|
+
sessionNumber,
|
|
66
|
+
customerName,
|
|
67
|
+
readonly,
|
|
68
|
+
defaultTime,
|
|
69
|
+
defaultType,
|
|
70
|
+
error,
|
|
71
|
+
minTime,
|
|
72
|
+
maxTime,
|
|
73
|
+
onClickReserve,
|
|
74
|
+
onClickCancel,
|
|
75
|
+
onClickCompleteSession
|
|
76
|
+
} = props;
|
|
77
|
+
const [editValues, setEditValues] = useState({
|
|
78
|
+
date: props.defaultTime,
|
|
79
|
+
type: props.defaultType
|
|
80
|
+
});
|
|
81
|
+
const date = readonly ? defaultTime : editValues.date;
|
|
82
|
+
const type = readonly ? defaultType : editValues.type;
|
|
83
|
+
const time = date && getTimeOption(date);
|
|
84
|
+
const onClickSave = useCallback(() => {
|
|
85
|
+
var _a;
|
|
86
|
+
(_a = props.onClickSave) == null ? void 0 : _a.call(props, editValues);
|
|
87
|
+
}, [editValues, props]);
|
|
88
|
+
const onClickReset = useCallback(() => {
|
|
89
|
+
setEditValues({
|
|
90
|
+
date: defaultTime,
|
|
91
|
+
type: defaultType
|
|
92
|
+
});
|
|
93
|
+
}, [defaultTime, defaultType]);
|
|
94
|
+
const ActionButtons = useMemo(() => {
|
|
95
|
+
if (readonly) {
|
|
96
|
+
return /* @__PURE__ */ jsx(Button, { onClick: onClickReserve, size: "small", variant: "surface", children: defaultTime && defaultType ? "\uC608\uC57D \uC218\uC815\uD558\uAE30" : "\uC608\uC57D\uD558\uAE30" });
|
|
97
|
+
}
|
|
98
|
+
return /* @__PURE__ */ jsx(Button, { color: "gray", onClick: onClickCancel, variant: "transparent", children: /* @__PURE__ */ jsx(Cross1Icon, {}) });
|
|
99
|
+
}, [defaultTime, defaultType, onClickCancel, onClickReserve, readonly]);
|
|
100
|
+
const onChangeDate = useCallback(
|
|
101
|
+
(newDate) => {
|
|
102
|
+
if (!newDate)
|
|
103
|
+
return;
|
|
104
|
+
const { hour = 0, minute = 0 } = time ? parseTimeOption(time) : {};
|
|
105
|
+
setEditValues((prev) => {
|
|
106
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
107
|
+
date: setMinutes(setHours(newDate, hour), minute)
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
[time]
|
|
112
|
+
);
|
|
113
|
+
const onChangeType = useCallback((newType) => {
|
|
114
|
+
setEditValues((prev) => {
|
|
115
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
116
|
+
type: newType
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
}, []);
|
|
120
|
+
const onChangeTime = useCallback(
|
|
121
|
+
(v) => {
|
|
122
|
+
const { hour, minute } = parseTimeOption(v);
|
|
123
|
+
if (typeof v === "undefined") {
|
|
124
|
+
setEditValues((prev) => {
|
|
125
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
126
|
+
date: v
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
setEditValues((prev) => {
|
|
131
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
132
|
+
date: setMinutes(setHours(date || /* @__PURE__ */ new Date(), hour), minute)
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
[date]
|
|
137
|
+
);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (!minTime || !editValues.date || readonly)
|
|
140
|
+
return;
|
|
141
|
+
if (editValues.date < minTime) {
|
|
142
|
+
toast.warn("\uC120\uD0DD \uAC00\uB2A5\uD55C \uC2DC\uAC04\uB300\uB85C \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
143
|
+
setEditValues((prev) => {
|
|
144
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
145
|
+
date: minTime
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}, [editValues, minTime, readonly]);
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (!maxTime || !editValues.date || readonly)
|
|
152
|
+
return;
|
|
153
|
+
if (editValues.date > maxTime) {
|
|
154
|
+
toast.warn("\uC120\uD0DD \uAC00\uB2A5\uD55C \uC2DC\uAC04\uB300\uB85C \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
155
|
+
setEditValues((prev) => {
|
|
156
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
157
|
+
date: maxTime
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}, [editValues, maxTime, readonly]);
|
|
162
|
+
return /* @__PURE__ */ jsxs(
|
|
163
|
+
Card,
|
|
164
|
+
{
|
|
165
|
+
error: Boolean(error),
|
|
166
|
+
size: "3",
|
|
167
|
+
style: { overflow: "visible", contain: "initial" },
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "3", justify: "between", mb: "5", children: [
|
|
170
|
+
/* @__PURE__ */ jsxs(
|
|
171
|
+
Grid,
|
|
172
|
+
{
|
|
173
|
+
align: "center",
|
|
174
|
+
columns: { initial: "1", xs: "auto 1fr" },
|
|
175
|
+
gapY: "2",
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", children: [
|
|
178
|
+
/* @__PURE__ */ jsxs(Heading, { variant: "heading4", children: [
|
|
179
|
+
customerName || "-",
|
|
180
|
+
"\uB2D8 ",
|
|
181
|
+
sessionNumber || "-",
|
|
182
|
+
"\uD68C\uCC28 \uC138\uC158"
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ jsx(Badge, { ml: "2", children: "\uB2E4\uC74C \uC138\uC158" })
|
|
185
|
+
] }),
|
|
186
|
+
error ? /* @__PURE__ */ jsx(BulletText, { color: "red", variant: "caption", children: error }) : null
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ jsx(Flex, { children: ActionButtons })
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
193
|
+
Form.Root,
|
|
194
|
+
{
|
|
195
|
+
onSubmit: (e) => {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
},
|
|
198
|
+
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "5", children: [
|
|
199
|
+
/* @__PURE__ */ jsx(Form.Field, { name: "date", children: /* @__PURE__ */ jsxs(Form.Label, { asChild: true, children: [
|
|
200
|
+
/* @__PURE__ */ jsx(Heading, { mb: "2", variant: "heading5", weight: "regular", children: "\uC138\uC158 \uC77C\uC790\uC640 \uC2DC\uAC01" }),
|
|
201
|
+
/* @__PURE__ */ jsxs(Grid, { columns: "1fr auto", gap: "4", children: [
|
|
202
|
+
/* @__PURE__ */ jsx(
|
|
203
|
+
DatePickerButton,
|
|
204
|
+
{
|
|
205
|
+
disabled: readonly,
|
|
206
|
+
maxDate: maxTime,
|
|
207
|
+
minDate: minTime,
|
|
208
|
+
onChange: onChangeDate,
|
|
209
|
+
placeholder: "\uC77C\uC790\uB97C \uC120\uD0DD\uD574\uC8FC\uC138\uC694",
|
|
210
|
+
selected: date,
|
|
211
|
+
size: "large"
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
TimeSelect,
|
|
216
|
+
{
|
|
217
|
+
disabled: readonly,
|
|
218
|
+
maxTime,
|
|
219
|
+
minTime,
|
|
220
|
+
onValueChange: onChangeTime,
|
|
221
|
+
size: "3",
|
|
222
|
+
time: date,
|
|
223
|
+
value: time
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] })
|
|
227
|
+
] }) }),
|
|
228
|
+
/* @__PURE__ */ jsxs(Form.Field, { name: "type", children: [
|
|
229
|
+
/* @__PURE__ */ jsx(Form.Label, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { mb: "2", variant: "heading5", weight: "regular", children: "\uC628/\uC624\uD504\uB77C\uC778 \uC9C4\uD589 \uC5EC\uBD80" }) }),
|
|
230
|
+
/* @__PURE__ */ jsx(Form.Control, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
231
|
+
OnOfflineRadioCard,
|
|
232
|
+
{
|
|
233
|
+
disabled: readonly,
|
|
234
|
+
onValueChange: onChangeType,
|
|
235
|
+
size: "1",
|
|
236
|
+
value: type
|
|
237
|
+
}
|
|
238
|
+
) })
|
|
239
|
+
] }),
|
|
240
|
+
readonly ? null : /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "3", justify: "end", children: [
|
|
241
|
+
/* @__PURE__ */ jsx(
|
|
242
|
+
Button,
|
|
243
|
+
{
|
|
244
|
+
color: "gray",
|
|
245
|
+
onClick: onClickReset,
|
|
246
|
+
size: "small",
|
|
247
|
+
variant: "transparent",
|
|
248
|
+
children: "\uCD08\uAE30\uD654\uD558\uAE30"
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ jsx(Button, { onClick: onClickSave, size: "small", children: "\uC800\uC7A5\uD558\uAE30" })
|
|
252
|
+
] })
|
|
253
|
+
] })
|
|
254
|
+
}
|
|
255
|
+
) }),
|
|
256
|
+
readonly ? /* @__PURE__ */ jsx(Inset, { clip: "border-box", side: "bottom", children: /* @__PURE__ */ jsx(
|
|
257
|
+
Box,
|
|
258
|
+
{
|
|
259
|
+
mt: "5",
|
|
260
|
+
px: "5",
|
|
261
|
+
py: "4",
|
|
262
|
+
style: { backgroundColor: "var(--accent-a3)" },
|
|
263
|
+
width: "100%",
|
|
264
|
+
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "4", justify: "center", children: [
|
|
265
|
+
/* @__PURE__ */ jsxs(Typo, { children: [
|
|
266
|
+
sessionNumber || "-",
|
|
267
|
+
"\uD68C\uCC28 \uC138\uC158\uC744 \uC644\uB8CC\uD558\uC168\uB098\uC694?"
|
|
268
|
+
] }),
|
|
269
|
+
/* @__PURE__ */ jsxs(Button, { onClick: onClickCompleteSession, size: "small", children: [
|
|
270
|
+
"\uC138\uC158 \uC885\uB8CC\uD558\uAE30",
|
|
271
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, {})
|
|
272
|
+
] })
|
|
273
|
+
] })
|
|
274
|
+
}
|
|
275
|
+
) }) : null
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export {
|
|
282
|
+
ReservationCard
|
|
283
|
+
};
|
|
284
|
+
//# sourceMappingURL=chunk-P442X52N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/reservation-card.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { setHours, setMinutes } from 'date-fns';\nimport {\n Badge,\n Box,\n BulletText,\n Button,\n Card,\n Flex,\n Form,\n Grid,\n Heading,\n Inset,\n toast,\n Typo,\n} from '../../atoms';\nimport { ArrowRightIcon, Cross1Icon } from '../../icon';\nimport { DatePickerButton, TimeSelect } from '../../molecules';\nimport { getTimeOption, parseTimeOption } from '../../utils';\nimport { OnOfflineRadioCard } from './on-offline-radio-card';\n\ntype Type = 'onlineCoaching' | 'offlineCoaching';\n\ninterface Values {\n date?: Date;\n type?: Type;\n}\n\nexport interface ReservationCardProps {\n sessionNumber?: number;\n readonly?: boolean;\n defaultTime?: Date;\n defaultType?: Type;\n customerName?: string;\n error?: string;\n onClickCompleteSession?: () => void;\n onClickReserve?: () => void;\n onClickSave?: (values: Values) => void;\n onClickCancel?: () => void;\n minTime?: Date;\n maxTime?: Date;\n}\n\nexport function ReservationCard(\n props: ReservationCardProps\n): React.ReactElement {\n const {\n sessionNumber,\n customerName,\n readonly,\n defaultTime,\n defaultType,\n error,\n minTime,\n maxTime,\n onClickReserve,\n onClickCancel,\n onClickCompleteSession,\n } = props;\n\n const [editValues, setEditValues] = useState<Values>({\n date: props.defaultTime,\n type: props.defaultType,\n });\n\n const date = readonly ? defaultTime : editValues.date;\n const type = readonly ? defaultType : editValues.type;\n const time = date && getTimeOption(date);\n\n const onClickSave = useCallback(() => {\n props.onClickSave?.(editValues);\n }, [editValues, props]);\n\n const onClickReset = useCallback(() => {\n setEditValues({\n date: defaultTime,\n type: defaultType,\n });\n }, [defaultTime, defaultType]);\n\n const ActionButtons = useMemo(() => {\n if (readonly) {\n return (\n <Button onClick={onClickReserve} size=\"small\" variant=\"surface\">\n {defaultTime && defaultType ? '예약 수정하기' : '예약하기'}\n </Button>\n );\n }\n return (\n <Button color=\"gray\" onClick={onClickCancel} variant=\"transparent\">\n <Cross1Icon />\n </Button>\n );\n }, [defaultTime, defaultType, onClickCancel, onClickReserve, readonly]);\n\n const onChangeDate = useCallback(\n (newDate: Date | null) => {\n if (!newDate) return;\n const { hour = 0, minute = 0 } = time ? parseTimeOption(time) : {};\n setEditValues((prev) => {\n return {\n ...prev,\n date: setMinutes(setHours(newDate, hour), minute),\n };\n });\n },\n [time]\n );\n\n const onChangeType = useCallback((newType: string) => {\n setEditValues((prev) => {\n return {\n ...prev,\n type: newType as Type,\n };\n });\n }, []);\n\n const onChangeTime = useCallback(\n (v?: string) => {\n const { hour, minute } = parseTimeOption(v);\n if (typeof v === 'undefined') {\n setEditValues((prev) => {\n return {\n ...prev,\n date: v,\n };\n });\n }\n setEditValues((prev) => {\n return {\n ...prev,\n date: setMinutes(setHours(date || new Date(), hour), minute),\n };\n });\n },\n [date]\n );\n\n useEffect(() => {\n if (!minTime || !editValues.date || readonly) return;\n if (editValues.date < minTime) {\n toast.warn('선택 가능한 시간대로 변경되었습니다.');\n setEditValues((prev) => {\n return {\n ...prev,\n date: minTime,\n };\n });\n }\n }, [editValues, minTime, readonly]);\n\n useEffect(() => {\n if (!maxTime || !editValues.date || readonly) return;\n if (editValues.date > maxTime) {\n toast.warn('선택 가능한 시간대로 변경되었습니다.');\n setEditValues((prev) => {\n return {\n ...prev,\n date: maxTime,\n };\n });\n }\n }, [editValues, maxTime, readonly]);\n\n return (\n <Card\n error={Boolean(error)}\n size=\"3\"\n style={{ overflow: 'visible', contain: 'initial' }}\n >\n <Flex gap=\"3\" justify=\"between\" mb=\"5\">\n <Grid\n align=\"center\"\n columns={{ initial: '1', xs: 'auto 1fr' }}\n gapY=\"2\"\n >\n <Flex align=\"center\">\n <Heading variant=\"heading4\">\n {customerName || '-'}님 {sessionNumber || '-'}회차 세션\n </Heading>\n <Badge ml=\"2\">다음 세션</Badge>\n </Flex>\n {error ? (\n <BulletText color=\"red\" variant=\"caption\">\n {error}\n </BulletText>\n ) : null}\n </Grid>\n <Flex>{ActionButtons}</Flex>\n </Flex>\n\n <Box>\n <Form.Root\n onSubmit={(e) => {\n e.preventDefault();\n }}\n >\n <Flex direction=\"column\" gap=\"5\">\n <Form.Field name=\"date\">\n <Form.Label asChild>\n <Heading mb=\"2\" variant=\"heading5\" weight=\"regular\">\n 세션 일자와 시각\n </Heading>\n <Grid columns=\"1fr auto\" gap=\"4\">\n <DatePickerButton\n disabled={readonly}\n maxDate={maxTime}\n minDate={minTime}\n onChange={onChangeDate}\n placeholder=\"일자를 선택해주세요\"\n selected={date}\n size=\"large\"\n />\n <TimeSelect\n disabled={readonly}\n maxTime={maxTime}\n minTime={minTime}\n onValueChange={onChangeTime}\n size=\"3\"\n time={date}\n value={time}\n />\n </Grid>\n </Form.Label>\n </Form.Field>\n\n <Form.Field name=\"type\">\n <Form.Label asChild>\n <Heading mb=\"2\" variant=\"heading5\" weight=\"regular\">\n 온/오프라인 진행 여부\n </Heading>\n </Form.Label>\n <Form.Control asChild>\n <OnOfflineRadioCard\n disabled={readonly}\n onValueChange={onChangeType}\n size=\"1\"\n value={type}\n />\n </Form.Control>\n </Form.Field>\n\n {readonly ? null : (\n <Flex align=\"center\" gap=\"3\" justify=\"end\">\n <Button\n color=\"gray\"\n onClick={onClickReset}\n size=\"small\"\n variant=\"transparent\"\n >\n 초기화하기\n </Button>\n <Button onClick={onClickSave} size=\"small\">\n 저장하기\n </Button>\n </Flex>\n )}\n </Flex>\n </Form.Root>\n </Box>\n\n {readonly ? (\n <Inset clip=\"border-box\" side=\"bottom\">\n <Box\n mt=\"5\"\n px=\"5\"\n py=\"4\"\n style={{ backgroundColor: 'var(--accent-a3)' }}\n width=\"100%\"\n >\n <Flex align=\"center\" gap=\"4\" justify=\"center\">\n <Typo>{sessionNumber || '-'}회차 세션을 완료하셨나요?</Typo>\n <Button onClick={onClickCompleteSession} size=\"small\">\n 세션 종료하기\n <ArrowRightIcon />\n </Button>\n </Flex>\n </Box>\n </Inset>\n ) : null}\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,WAAW,SAAS,gBAAgB;AACjE,SAAS,UAAU,kBAAkB;AAkF7B,cA+FI,YA/FJ;AAxCD,SAAS,gBACd,OACoB;AACpB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,YAAY,aAAa,IAAI,SAAiB;AAAA,IACnD,MAAM,MAAM;AAAA,IACZ,MAAM,MAAM;AAAA,EACd,CAAC;AAED,QAAM,O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