@wishket/design-system 2.1.3 → 2.1.5
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/Components/Feedbacks/DialogBox/DialogBox.js +4 -4
- package/dist/Components/Inputs/Calendar/Calendar.d.ts +10 -1
- package/dist/Components/Inputs/Calendar/Calendar.js +18 -9
- package/dist/Components/Inputs/Calendar/Calendar.types.d.ts +2 -0
- package/dist/Components/Utils/ModalContainer/ModalContainer.js +1 -1
- package/dist/cjs/Components/Feedbacks/DialogBox/DialogBox.js +3 -3
- package/dist/cjs/Components/Inputs/Calendar/Calendar.js +7 -7
- package/dist/cjs/Components/Utils/ModalContainer/ModalContainer.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{twJoin as o}from"tailwind-merge";import{Typography as a}from"../../Base/Typography/Typography.js";import{Box as
|
|
2
|
-
return e(
|
|
3
|
-
/*#__PURE__*/e(
|
|
1
|
+
"use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{twJoin as o}from"tailwind-merge";import{Typography as a}from"../../Base/Typography/Typography.js";import{Box as l}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";import{Button as t}from"../../Inputs/Button/Button.js";const i=({title:i,description:s,variant:n="primary",onClose:c,onConfirm:m,confirm:d,close:g="닫기",testId:p})=>{const u="caution"===n;/*#__PURE__*/
|
|
2
|
+
return e(l,{className:"bg-w-white shadow-modal tablet:w-[400px] flex h-fit max-w-[calc(100vw-40px)] flex-col items-center gap-8 rounded-3xl p-8 font-normal not-italic","data-testid":p||"design-system--dialog-box",children:[
|
|
3
|
+
/*#__PURE__*/e(l,{className:"flex w-full flex-col gap-6",children:[
|
|
4
4
|
/*#__PURE__*/r(a,{variant:"subTitle18",className:"text-w-gray-900 font-medium",children:i}),
|
|
5
5
|
/*#__PURE__*/r(a,{variant:"body16",className:"text-w-gray-800 whitespace-break-spaces",children:s})]}),
|
|
6
|
-
/*#__PURE__*/e(
|
|
6
|
+
/*#__PURE__*/e(l,{className:"flex w-full items-center justify-end gap-4",children:[g&&/*#__PURE__*/r(t,{role:"close",onClick:c,variant:"solid",className:"border-w-bluegray-200 bg-w-bluegray-200 hover:border-w-bluegray-300 hover:bg-w-bluegray-300",children:g}),d&&/*#__PURE__*/r(t,{role:"confirm",onClick:m,variant:"solid",className:o(u&&"border-w-orange-500 bg-w-orange-500 hover:border-w-orange-600 hover:bg-w-orange-600"),children:d})]})]})};export{i as DialogBox};
|
|
@@ -12,6 +12,8 @@ import { CalendarProps } from './Calendar.types';
|
|
|
12
12
|
* @param {boolean} [props.disabled] - 캘린더 비활성화 여부
|
|
13
13
|
* @param {string} [props.placeholder] - 날짜가 선택되지 않았을 때 표시될 텍스트
|
|
14
14
|
* @param {boolean} [props.isError] - 에러 상태 표시 여부
|
|
15
|
+
* @param {string} [props.className] - 컨테이너에 머지될 클래스 (예: 부모 너비에 맞추기 위한 `w-full`)
|
|
16
|
+
* @param {string} [props.triggerClassName] - 트리거(TextFieldContainer)에 머지될 클래스
|
|
15
17
|
*
|
|
16
18
|
* @example
|
|
17
19
|
* ```tsx
|
|
@@ -33,7 +35,14 @@ import { CalendarProps } from './Calendar.types';
|
|
|
33
35
|
* isError={true}
|
|
34
36
|
* selected="2024-03-21"
|
|
35
37
|
* />
|
|
38
|
+
*
|
|
39
|
+
* // 부모 너비에 맞추기 (popover/dialog 안에 풀-너비 배치)
|
|
40
|
+
* <Calendar
|
|
41
|
+
* className="w-full"
|
|
42
|
+
* triggerClassName="w-full"
|
|
43
|
+
* selected="2024-03-21"
|
|
44
|
+
* />
|
|
36
45
|
* ```
|
|
37
46
|
*/
|
|
38
|
-
declare const Calendar: ({ defaultDate, selected, onChange, disabled, placeholder, isError, }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare const Calendar: ({ defaultDate, selected, onChange, disabled, placeholder, isError, className, triggerClassName, }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
48
|
export { Calendar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as
|
|
1
|
+
"use client";import{jsxs as e,jsx as a}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{twMerge as s}from"tailwind-merge";import"../../DataDisplays/Avatar/Avatar.js";import{Typography as o}from"../../Base/Typography/Typography.js";import{Box as n}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";import{SystemIcon as i}from"../../DataDisplays/SystemIcon/SystemIcon.js";import"../../DataDisplays/SystemIcon/SystemIcon.constants.js";import"../../DataDisplays/Accordion/Accordion.js";import{TextFieldContainer as l}from"../TextFieldContainer/TextFieldContainer.js";import{SelectHeader as d,WeekHeader as c,DateBox as m}from"./Calendar.parts.js";import{generateDate as p,today as y,getKoreanTimeString as g,getMonthDate as h,isSameDate as x}from"./Calendar.utils.js";
|
|
2
2
|
/**
|
|
3
3
|
* 날짜를 선택할 수 있는 캘린더 컴포넌트입니다.
|
|
4
4
|
*
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* @param {boolean} [props.disabled] - 캘린더 비활성화 여부
|
|
13
13
|
* @param {string} [props.placeholder] - 날짜가 선택되지 않았을 때 표시될 텍스트
|
|
14
14
|
* @param {boolean} [props.isError] - 에러 상태 표시 여부
|
|
15
|
+
* @param {string} [props.className] - 컨테이너에 머지될 클래스 (예: 부모 너비에 맞추기 위한 `w-full`)
|
|
16
|
+
* @param {string} [props.triggerClassName] - 트리거(TextFieldContainer)에 머지될 클래스
|
|
15
17
|
*
|
|
16
18
|
* @example
|
|
17
19
|
* ```tsx
|
|
@@ -33,13 +35,20 @@
|
|
|
33
35
|
* isError={true}
|
|
34
36
|
* selected="2024-03-21"
|
|
35
37
|
* />
|
|
38
|
+
*
|
|
39
|
+
* // 부모 너비에 맞추기 (popover/dialog 안에 풀-너비 배치)
|
|
40
|
+
* <Calendar
|
|
41
|
+
* className="w-full"
|
|
42
|
+
* triggerClassName="w-full"
|
|
43
|
+
* selected="2024-03-21"
|
|
44
|
+
* />
|
|
36
45
|
* ```
|
|
37
|
-
*/const u=({defaultDate:u,selected:f,onChange:w,disabled:j,placeholder:D,isError:b})=>{const[
|
|
46
|
+
*/const u=({defaultDate:u,selected:f,onChange:w,disabled:j,placeholder:D,isError:b,className:C,triggerClassName:N})=>{const[$,B]=t(!1),v=()=>{j||B((e=>!e))},A=u?p(u):y,[F,I]=t(f?p(f):A),S=f?p(f):A,{year:T,month:L,date:k}=g(S),{dateList:z}=h(F.year,F.month),E=[...Array.from({length:z[0].day},(()=>null)),...z],_=e=>{if(f&&x(e,S))return;const a=`${e.year}-${e.month}-${e.date}`;null==w||w(a),B(!1)};return r((()=>{!$&&f&&I(p(f));
|
|
38
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
-
}),[
|
|
40
|
-
/*#__PURE__*/
|
|
41
|
-
/*#__PURE__*/
|
|
42
|
-
/*#__PURE__*/
|
|
43
|
-
/*#__PURE__*/
|
|
44
|
-
/*#__PURE__*/
|
|
45
|
-
/*#__PURE__*/
|
|
48
|
+
}),[$]),/*#__PURE__*/e(n,{className:s("relative h-fit w-fit select-none",C),"data-testid":"design-system-calendar--container",children:[
|
|
49
|
+
/*#__PURE__*/a(n,{className:"cursor-pointer",children:/*#__PURE__*/e(l,{isFocused:$,isError:b,isDisabled:j,testId:"design-system-calendar--trigger",onClick:v,className:N,children:[
|
|
50
|
+
/*#__PURE__*/a(i,{name:"medium_calendar",className:j||!f?"text-w-gray-300":"text-w-gray-400"}),
|
|
51
|
+
/*#__PURE__*/a(o,{variant:"body16",className:s("text-w-gray-600 min-w-[178px]",!f&&"text-w-gray-300",j&&"text-w-gray-300"),"data-testid":"design-system-calendar--selected-date",children:f?`${T} ${L} ${k}`:D})]})}),$&&/*#__PURE__*/a("div",{className:"fixed top-0 left-0 z-10 h-screen w-screen bg-transparent",onClick:v}),$&&/*#__PURE__*/e(n,{"data-testid":"design-system-calendar--content",className:"border-w-gray-200 bg-w-white shadow-graymedium absolute top-[54px] z-30 flex w-[350px] flex-col gap-4 rounded-xl border px-[15px] py-[23px]",children:[
|
|
52
|
+
/*#__PURE__*/a(d,{visibleDate:F,onChange:e=>{I(e)}}),
|
|
53
|
+
/*#__PURE__*/a(c,{}),
|
|
54
|
+
/*#__PURE__*/a(n,{className:"grid w-full grid-cols-7 place-content-center place-items-center gap-1",children:E.map(((e,t)=>{const r=!(!e||!f)&&x(e,S);return e?/*#__PURE__*/a(m,{date:e,selected:r,onChange:_},`${e.year}-${e.month}-${e.date}`):/*#__PURE__*/a(m,{disabled:!0},t)}))})]})]})};export{u as Calendar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{twJoin as o}from"tailwind-merge";import{Box as l}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";const t=({size:t="md",overflow:r="auto",children:s})=>/*#__PURE__*/e(l,{"data-testid":"design-system--modal-container",className:o("bg-w-white shadow-modal h-fit rounded-3xl",// 아직 정해지지 않은 내부 레이아웃
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{twJoin as o}from"tailwind-merge";import{Box as l}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";const t=({size:t="md",overflow:r="auto",children:s})=>/*#__PURE__*/e(l,{"data-testid":"design-system--modal-container",className:o("bg-w-white shadow-modal h-fit max-w-[calc(100vw-40px)] rounded-3xl",// 아직 정해지지 않은 내부 레이아웃
|
|
2
2
|
"flex items-center justify-center",{xs:"w-[320px]",sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[1000px]",full:"w-full"}[t],{auto:"overflow-auto",visible:"overflow-visible",hidden:"overflow-hidden",scroll:"overflow-scroll"}[r]),children:s});export{t as ModalContainer};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("tailwind-merge"),a=require("../../Base/Typography/Typography.js"),o=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");var s=require("../../Inputs/Button/Button.js");exports.DialogBox=({title:l,description:t,variant:i="primary",onClose:n,onConfirm:c,confirm:u,close:d="닫기",testId:
|
|
2
|
-
return e.jsxs(o.Box,{className:"bg-w-white shadow-modal tablet:w-[400px] flex h-fit flex-col items-center gap-8 rounded-3xl p-8 font-normal not-italic","data-testid":
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("tailwind-merge"),a=require("../../Base/Typography/Typography.js"),o=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");var s=require("../../Inputs/Button/Button.js");exports.DialogBox=({title:l,description:t,variant:i="primary",onClose:n,onConfirm:c,confirm:u,close:d="닫기",testId:x})=>{const g="caution"===i;/*#__PURE__*/
|
|
2
|
+
return e.jsxs(o.Box,{className:"bg-w-white shadow-modal tablet:w-[400px] flex h-fit max-w-[calc(100vw-40px)] flex-col items-center gap-8 rounded-3xl p-8 font-normal not-italic","data-testid":x||"design-system--dialog-box",children:[
|
|
3
3
|
/*#__PURE__*/e.jsxs(o.Box,{className:"flex w-full flex-col gap-6",children:[
|
|
4
4
|
/*#__PURE__*/e.jsx(a.Typography,{variant:"subTitle18",className:"text-w-gray-900 font-medium",children:l}),
|
|
5
5
|
/*#__PURE__*/e.jsx(a.Typography,{variant:"body16",className:"text-w-gray-800 whitespace-break-spaces",children:t})]}),
|
|
6
|
-
/*#__PURE__*/e.jsxs(o.Box,{className:"flex w-full items-center justify-end gap-4",children:[d&&/*#__PURE__*/e.jsx(s.Button,{role:"close",onClick:n,variant:"solid",className:"border-w-bluegray-200 bg-w-bluegray-200 hover:border-w-bluegray-300 hover:bg-w-bluegray-300",children:d}),u&&/*#__PURE__*/e.jsx(s.Button,{role:"confirm",onClick:c,variant:"solid",className:r.twJoin(
|
|
6
|
+
/*#__PURE__*/e.jsxs(o.Box,{className:"flex w-full items-center justify-end gap-4",children:[d&&/*#__PURE__*/e.jsx(s.Button,{role:"close",onClick:n,variant:"solid",className:"border-w-bluegray-200 bg-w-bluegray-200 hover:border-w-bluegray-300 hover:bg-w-bluegray-300",children:d}),u&&/*#__PURE__*/e.jsx(s.Button,{role:"confirm",onClick:c,variant:"solid",className:r.twJoin(g&&"border-w-orange-500 bg-w-orange-500 hover:border-w-orange-600 hover:bg-w-orange-600"),children:u})]})]})};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),a=require("react"),t=require("tailwind-merge");require("../../DataDisplays/Avatar/Avatar.js");var r=require("../../Base/Typography/Typography.js"),s=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");var n=require("../../DataDisplays/SystemIcon/SystemIcon.js");require("../../DataDisplays/SystemIcon/SystemIcon.constants.js"),require("../../DataDisplays/Accordion/Accordion.js");var i=require("../TextFieldContainer/TextFieldContainer.js"),l=require("./Calendar.parts.js"),d=require("./Calendar.utils.js");exports.Calendar=({defaultDate:o,selected:c,onChange:x,disabled:
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),a=require("react"),t=require("tailwind-merge");require("../../DataDisplays/Avatar/Avatar.js");var r=require("../../Base/Typography/Typography.js"),s=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");var n=require("../../DataDisplays/SystemIcon/SystemIcon.js");require("../../DataDisplays/SystemIcon/SystemIcon.constants.js"),require("../../DataDisplays/Accordion/Accordion.js");var i=require("../TextFieldContainer/TextFieldContainer.js"),l=require("./Calendar.parts.js"),d=require("./Calendar.utils.js");exports.Calendar=({defaultDate:o,selected:c,onChange:x,disabled:g,placeholder:m,isError:u,className:y,triggerClassName:p})=>{const[h,j]=a.useState(!1),D=()=>{g||j((e=>!e))},w=o?d.generateDate(o):d.today,[q,B]=a.useState(c?d.generateDate(c):w),f=c?d.generateDate(c):w,{year:C,month:S,date:b}=d.getKoreanTimeString(f),{dateList:v}=d.getMonthDate(q.year,q.month),N=[...Array.from({length:v[0].day},(()=>null)),...v],$=e=>{if(c&&d.isSameDate(e,f))return;const a=`${e.year}-${e.month}-${e.date}`;null==x||x(a),j(!1)};return a.useEffect((()=>{!h&&c&&B(d.generateDate(c));
|
|
2
2
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3
|
-
}),[
|
|
4
|
-
/*#__PURE__*/e.jsx(s.Box,{className:"cursor-pointer",children:/*#__PURE__*/e.jsxs(i.TextFieldContainer,{isFocused:
|
|
5
|
-
/*#__PURE__*/e.jsx(n.SystemIcon,{name:"medium_calendar",className:
|
|
6
|
-
/*#__PURE__*/e.jsx(r.Typography,{variant:"body16",className:t.twMerge("text-w-gray-600 min-w-[178px]",!c&&"text-w-gray-300",
|
|
7
|
-
/*#__PURE__*/e.jsx(l.SelectHeader,{visibleDate:
|
|
3
|
+
}),[h]),/*#__PURE__*/e.jsxs(s.Box,{className:t.twMerge("relative h-fit w-fit select-none",y),"data-testid":"design-system-calendar--container",children:[
|
|
4
|
+
/*#__PURE__*/e.jsx(s.Box,{className:"cursor-pointer",children:/*#__PURE__*/e.jsxs(i.TextFieldContainer,{isFocused:h,isError:u,isDisabled:g,testId:"design-system-calendar--trigger",onClick:D,className:p,children:[
|
|
5
|
+
/*#__PURE__*/e.jsx(n.SystemIcon,{name:"medium_calendar",className:g||!c?"text-w-gray-300":"text-w-gray-400"}),
|
|
6
|
+
/*#__PURE__*/e.jsx(r.Typography,{variant:"body16",className:t.twMerge("text-w-gray-600 min-w-[178px]",!c&&"text-w-gray-300",g&&"text-w-gray-300"),"data-testid":"design-system-calendar--selected-date",children:c?`${C} ${S} ${b}`:m})]})}),h&&/*#__PURE__*/e.jsx("div",{className:"fixed top-0 left-0 z-10 h-screen w-screen bg-transparent",onClick:D}),h&&/*#__PURE__*/e.jsxs(s.Box,{"data-testid":"design-system-calendar--content",className:"border-w-gray-200 bg-w-white shadow-graymedium absolute top-[54px] z-30 flex w-[350px] flex-col gap-4 rounded-xl border px-[15px] py-[23px]",children:[
|
|
7
|
+
/*#__PURE__*/e.jsx(l.SelectHeader,{visibleDate:q,onChange:e=>{B(e)}}),
|
|
8
8
|
/*#__PURE__*/e.jsx(l.WeekHeader,{}),
|
|
9
|
-
/*#__PURE__*/e.jsx(s.Box,{className:"grid w-full grid-cols-7 place-content-center place-items-center gap-1",children:
|
|
9
|
+
/*#__PURE__*/e.jsx(s.Box,{className:"grid w-full grid-cols-7 place-content-center place-items-center gap-1",children:N.map(((a,t)=>{const r=!(!a||!c)&&d.isSameDate(a,f);return a?/*#__PURE__*/e.jsx(l.DateBox,{date:a,selected:r,onChange:$},`${a.year}-${a.month}-${a.date}`):/*#__PURE__*/e.jsx(l.DateBox,{disabled:!0},t)}))})]})]})};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),l=require("tailwind-merge"),o=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");exports.ModalContainer=({size:r="md",overflow:s="auto",children:i})=>/*#__PURE__*/e.jsx(o.Box,{"data-testid":"design-system--modal-container",className:l.twJoin("bg-w-white shadow-modal h-fit rounded-3xl",// 아직 정해지지 않은 내부 레이아웃
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("tailwind-merge"),o=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");exports.ModalContainer=({size:r="md",overflow:s="auto",children:i})=>/*#__PURE__*/e.jsx(o.Box,{"data-testid":"design-system--modal-container",className:l.twJoin("bg-w-white shadow-modal h-fit max-w-[calc(100vw-40px)] rounded-3xl",// 아직 정해지지 않은 내부 레이아웃
|
|
2
2
|
"flex items-center justify-center",{xs:"w-[320px]",sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[1000px]",full:"w-full"}[r],{auto:"overflow-auto",visible:"overflow-visible",hidden:"overflow-hidden",scroll:"overflow-scroll"}[s]),children:i});
|