@wishket/design-system 1.13.17 → 1.14.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.
- package/dist/Components/Base/Layouts/Box/Box.d.ts +1 -1
- package/dist/Components/Base/Layouts/Column/Column.d.ts +3 -0
- package/dist/Components/Base/Layouts/FullBleed/FullBleed.d.ts +1 -1
- package/dist/Components/DataDisplays/Li/Li.d.ts +34 -0
- package/dist/Components/DataDisplays/ServiceLogo/ServiceLogo.d.ts +1 -1
- package/dist/Components/Inputs/Checkbox/Checkbox.js +5 -5
- package/dist/Components/Inputs/Radio/Radio.js +9 -9
- package/dist/Components/Inputs/SupportTextContainer/SupportTextContainer.js +2 -2
- package/dist/Components/Inputs/Textarea/Textarea.d.ts +10 -2
- package/dist/Components/Inputs/Textarea/Textarea.js +14 -6
- package/dist/cjs/Components/Inputs/Checkbox/Checkbox.js +5 -5
- package/dist/cjs/Components/Inputs/Radio/Radio.js +7 -7
- package/dist/cjs/Components/Inputs/SupportTextContainer/SupportTextContainer.js +3 -3
- package/dist/cjs/Components/Inputs/Textarea/Textarea.js +14 -6
- package/package.json +10 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ElementType, PropsWithChildren } from 'react';
|
|
2
|
-
interface BoxProps extends PropsWithChildren<ComponentPropsWithoutRef<'div'>> {
|
|
2
|
+
export interface BoxProps extends PropsWithChildren<ComponentPropsWithoutRef<'div'>> {
|
|
3
3
|
as?: ElementType;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
@@ -3,6 +3,9 @@ type ColumnSize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
|
|
|
3
3
|
export interface ColumnProps extends PropsWithChildren {
|
|
4
4
|
container?: boolean;
|
|
5
5
|
size?: ColumnSize;
|
|
6
|
+
leftColumnSize?: ColumnSize;
|
|
7
|
+
centerColumnSize?: ColumnSize;
|
|
8
|
+
rightColumnSize?: ColumnSize;
|
|
6
9
|
className?: string;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface LiProps {
|
|
2
|
+
text: string;
|
|
3
|
+
bulletClassName?: string;
|
|
4
|
+
gap?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 리스트 아이템 컴포넌트입니다.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} props - 컴포넌트 프로퍼티
|
|
11
|
+
* @param {string} props.text - 리스트 아이템 텍스트
|
|
12
|
+
* @param {string} [props.bulletClassName] - 리스트 아이템 불릿 클래스명
|
|
13
|
+
* @param {number} [props.gap] - 리스트 아이템 간격
|
|
14
|
+
* @param {string} [props.className] - 컴포넌트에 적용할 추가 CSS 클래스명
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // 기본 사용법
|
|
18
|
+
* <Li text="Li" />
|
|
19
|
+
*
|
|
20
|
+
* * // 간격 조절
|
|
21
|
+
* <Li text="Li" gap={1} />
|
|
22
|
+
*
|
|
23
|
+
* // 불릿 색상 조절
|
|
24
|
+
* <Li text="Li" bulletClassName="text-w-red-800" />
|
|
25
|
+
*
|
|
26
|
+
* // 커스텀 클래스와 함께 사용
|
|
27
|
+
* <Li text="Li" className="text-w-red-800" />
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
declare const Li: ({ text, gap, bulletClassName, className, }: LiProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export default Li;
|
|
32
|
+
export declare const BulletIcon: ({ className }: {
|
|
33
|
+
className?: string;
|
|
34
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{forwardRef as t,useState as
|
|
1
|
+
"use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{forwardRef as t,useState as o,useEffect as n,useCallback as c}from"react";import"tailwind-merge";import{Box as a}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";import{CheckboxButton as s}from"./Checkbox.parts.js";function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){i(e,r,t[r])}))}return e}function u(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},c=Object.keys(e);for(o=0;o<c.length;o++)t=c[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}
|
|
2
2
|
/**
|
|
3
3
|
* @component
|
|
4
4
|
* @param {Object} props - 체크박스 컴포넌트 프로퍼티
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* console.log('체크박스 상태:', e.target.checked);
|
|
28
28
|
* };
|
|
29
29
|
* <Checkbox onChange={handleChange} />
|
|
30
|
-
*/(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(
|
|
31
|
-
return e(
|
|
32
|
-
/*#__PURE__*/r("input",
|
|
33
|
-
/*#__PURE__*/r(
|
|
30
|
+
*/(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)t=c[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}const b=/*#__PURE__*/t(((t,i)=>{var{checked:b=!1,onChange:p,disabled:f=!1,isError:d=!1,type:m="box",className:y}=t,h=u(t,["checked","onChange","disabled","isError","type","className"]);const[g,O]=o(b),[j,k]=o(!1);n((()=>{O(b)}),[b]);const x=c((e=>{f||p&&(p(e),O(e.target.checked),e.target.checked||k(!1))}),[p,f]);/*#__PURE__*/
|
|
31
|
+
return e(a,{"data-testid":"design-system-checkbox",className:"group flex size-fit",children:[
|
|
32
|
+
/*#__PURE__*/r("input",l({ref:i,className:"absolute h-0 w-0 opacity-0",type:"checkbox",checked:g,onChange:x,onFocus:()=>{k(!0)},onBlur:()=>{k(!1)},disabled:f},h)),
|
|
33
|
+
/*#__PURE__*/r(s,{checked:g,disabled:f,isError:d,isFocused:j,type:m,className:y})]})}));b.displayName="Checkbox";export{b as Checkbox};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{twMerge as t}from"tailwind-merge";import{forwardRef as
|
|
1
|
+
"use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{twMerge as t}from"tailwind-merge";import{forwardRef as o}from"react";import{Box as i}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){a(e,r,t[r])}))}return e}function n(e,r){if(null==e)return{};var t,o,i=function(e,r){if(null==e)return{};var t,o,i={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}const s=({isDisabled:e,isSelected:o=!1,isError:i,className:a})=>/*#__PURE__*/r("div",{className:t("relative box-border flex h-[18px] w-[18px] items-center justify-center rounded-full border p-[4px]",
|
|
2
2
|
// 체크되었고 비활성화 상태의 경우
|
|
3
|
-
|
|
3
|
+
o&&e?"bg-w-white border-primary-100 cursor-not-allowed":
|
|
4
4
|
// 비활성화 상태의 경우
|
|
5
5
|
e?"bg-w-gray-50 border-w-gray-200 cursor-not-allowed":
|
|
6
6
|
// 활성화 상태에서 체크되었고 오류가 없는 경우
|
|
7
|
-
i
|
|
7
|
+
o&&!i?"bg-w-white border-primary-500":
|
|
8
8
|
// 활성화 상태에서 체크되었고 오류가 있는 경우
|
|
9
|
-
i
|
|
9
|
+
o&&i?"bg-w-white border-w-red-500":
|
|
10
10
|
// 활성화 상태에서 체크되지 않았고 오류가 있는 경우
|
|
11
|
-
!i
|
|
12
|
-
return e(
|
|
13
|
-
/*#__PURE__*/r("input",
|
|
14
|
-
/*#__PURE__*/r(
|
|
11
|
+
!o&&i?"border-w-red-500":"bg-white border-w-gray-200 group-hover:border-primary-500 cursor-pointer",a),role:"radio-button",children:/*#__PURE__*/r("div",{className:t("size-2 rounded-full bg-primary transition-all duration-100 ease-in-out",!o&&"h-0 w-0",i&&"bg-w-red-500",e&&"bg-w-gray-200",o&&e&&"bg-primary-100")})}),d=/*#__PURE__*/o(((t,o)=>{var{value:a="",isSelected:d=!1,isDisabled:c=!1,isError:u=!1,className:b}=t,m=n(t,["value","isSelected","isDisabled","isError","className"]);/*#__PURE__*/
|
|
12
|
+
return e(i,{"data-testid":"design-system-radio",className:"group cursor-pointer",children:[
|
|
13
|
+
/*#__PURE__*/r("input",l({ref:o,type:"radio",className:"hidden",value:a,checked:d,disabled:c},m)),
|
|
14
|
+
/*#__PURE__*/r(s,{isSelected:d,isError:u,isDisabled:c,className:b})]})}));
|
|
15
15
|
/**
|
|
16
16
|
* 사용자가 여러 옵션 중 하나를 선택할 수 있는 라디오 버튼 컴포넌트입니다.
|
|
17
17
|
*
|
|
@@ -38,4 +38,4 @@ return e("label",{"data-testid":"design-system-radio",className:"group cursor-po
|
|
|
38
38
|
*
|
|
39
39
|
* // 커스텀 스타일
|
|
40
40
|
* <Radio value="option5" className="custom-radio" />
|
|
41
|
-
*/
|
|
41
|
+
*/d.displayName="Radio";export{d as Radio};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Typography as a}from"../../Base/Typography/Typography.js";import{Box as r}from"../../Base/Layouts/Box/Box.js";import"tailwind-merge";import"../../Base/Layouts/FullBleed/FullBleed.js";const s=({errorMessage:s,supportMessage:o,currentLength:
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Typography as a}from"../../Base/Typography/Typography.js";import{Box as r}from"../../Base/Layouts/Box/Box.js";import"tailwind-merge";import"../../Base/Layouts/FullBleed/FullBleed.js";const s=({errorMessage:s,supportMessage:o,currentLength:l,maxLength:i,isMaxLengthVisible:n})=>{const p=o||n;/*#__PURE__*/
|
|
2
2
|
return e(r,{className:"flex flex-col gap-2 px-[17px]","data-testid":"design-system--support-text-container",children:[s&&/*#__PURE__*/t(a,{variant:"body2",className:"text-w-red-500",children:s}),p&&/*#__PURE__*/e(r,{className:"flex gap-6",children:[
|
|
3
|
-
/*#__PURE__*/t(a,{variant:"body2",className:"flex-1 text-w-gray-400",children:o}),n&&/*#__PURE__*/e(a,{variant:"body2",className:"w-[72px] text-right text-w-gray-400",children:[
|
|
3
|
+
/*#__PURE__*/t(a,{variant:"body2",className:"flex-1 text-w-gray-400",children:o}),n&&/*#__PURE__*/e(a,{variant:"body2",className:"w-[72px] text-right text-w-gray-400",children:[null==l?void 0:l.toLocaleString(),"/",null==i?void 0:i.toLocaleString()]})]})]})};export{s as SupportTextContainer};
|
|
@@ -4,7 +4,7 @@ import { ComponentProps } from 'react';
|
|
|
4
4
|
*/
|
|
5
5
|
export interface TextareaProps extends ComponentProps<'textarea'> {
|
|
6
6
|
isError?: boolean;
|
|
7
|
-
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
size?: 'sm' | 'md' | 'lg' | 'full';
|
|
8
8
|
resize?: boolean;
|
|
9
9
|
supportText?: string;
|
|
10
10
|
errorText?: string;
|
|
@@ -15,7 +15,7 @@ export interface TextareaProps extends ComponentProps<'textarea'> {
|
|
|
15
15
|
*
|
|
16
16
|
* @param {Object} props
|
|
17
17
|
* @param {boolean} [props.isError] - 에러 상태를 표시합니다
|
|
18
|
-
* @param {('sm'|'md'|'lg')} [props.size='md'] - textarea의 크기를 지정합니다
|
|
18
|
+
* @param {('sm'|'md'|'lg'|'full')} [props.size='md'] - textarea의 크기를 지정합니다
|
|
19
19
|
* @param {boolean} [props.resize=false] - 크기 조절 가능 여부를 설정합니다
|
|
20
20
|
* @param {string} [props.supportText] - 도움말 텍스트를 표시합니다
|
|
21
21
|
* @param {string} [props.errorText] - 에러 메시지를 표시합니다
|
|
@@ -43,6 +43,14 @@ export interface TextareaProps extends ComponentProps<'textarea'> {
|
|
|
43
43
|
* isLengthVisible={true}
|
|
44
44
|
* supportText="최대 1000자까지 입력 가능합니다"
|
|
45
45
|
* />
|
|
46
|
+
*
|
|
47
|
+
* // 외부 컨테이너 높이에 맞게 최대로 확장
|
|
48
|
+
* <div className="h-96">
|
|
49
|
+
* <Textarea
|
|
50
|
+
* size="full"
|
|
51
|
+
* placeholder="컨테이너 높이에 맞게 확장됩니다"
|
|
52
|
+
* />
|
|
53
|
+
* </div>
|
|
46
54
|
* ```
|
|
47
55
|
*/
|
|
48
56
|
declare const Textarea: ({ isError, size, resize, isLengthVisible, supportText, errorText, maxLength, value, disabled, name, onChange, onBlur, ...rest }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as r}from"react";import{twMerge as n}from"tailwind-merge";import{Box as
|
|
1
|
+
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as r}from"react";import{twMerge as n,twJoin as o}from"tailwind-merge";import{Box as l}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";import{SystemIcon as a}from"../../DataDisplays/SystemIcon/SystemIcon.js";import"../../DataDisplays/SystemIcon/SystemIcon.constants.js";import{TextFieldContainer as i}from"../TextFieldContainer/TextFieldContainer.js";import{SupportTextContainer as s}from"../SupportTextContainer/SupportTextContainer.js";function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){u(e,t,r[t])}))}return e}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}
|
|
2
2
|
/**
|
|
3
3
|
* 사용자가 여러 줄의 텍스트를 입력할 수 있는 textarea 컴포넌트입니다.
|
|
4
4
|
*
|
|
5
5
|
* @param {Object} props
|
|
6
6
|
* @param {boolean} [props.isError] - 에러 상태를 표시합니다
|
|
7
|
-
* @param {('sm'|'md'|'lg')} [props.size='md'] - textarea의 크기를 지정합니다
|
|
7
|
+
* @param {('sm'|'md'|'lg'|'full')} [props.size='md'] - textarea의 크기를 지정합니다
|
|
8
8
|
* @param {boolean} [props.resize=false] - 크기 조절 가능 여부를 설정합니다
|
|
9
9
|
* @param {string} [props.supportText] - 도움말 텍스트를 표시합니다
|
|
10
10
|
* @param {string} [props.errorText] - 에러 메시지를 표시합니다
|
|
@@ -32,8 +32,16 @@
|
|
|
32
32
|
* isLengthVisible={true}
|
|
33
33
|
* supportText="최대 1000자까지 입력 가능합니다"
|
|
34
34
|
* />
|
|
35
|
+
*
|
|
36
|
+
* // 외부 컨테이너 높이에 맞게 최대로 확장
|
|
37
|
+
* <div className="h-96">
|
|
38
|
+
* <Textarea
|
|
39
|
+
* size="full"
|
|
40
|
+
* placeholder="컨테이너 높이에 맞게 확장됩니다"
|
|
41
|
+
* />
|
|
42
|
+
* </div>
|
|
35
43
|
* ```
|
|
36
|
-
*/(e,t);if(Object.getOwnPropertySymbols){var
|
|
37
|
-
return e(
|
|
38
|
-
/*#__PURE__*/e(i,{isDisabled:
|
|
39
|
-
/*#__PURE__*/t("textarea",m({"data-testid":"design-system-textarea--textarea",className:n("w-full overflow-y-scroll py-[11px] pl-4 font-[inherit] font-normal tracking-default text-w-gray-600 outline-none scrollbar-list placeholder:font-[inherit] placeholder:tracking-default placeholder:text-w-gray-300","sm"===
|
|
44
|
+
*/(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}const p=u=>{var{isError:p=!1,size:f="md",resize:g=!1,isLengthVisible:x=!1,supportText:d,errorText:y,maxLength:h,value:b,disabled:j,name:O,onChange:v,onBlur:w}=u,S=c(u,["isError","size","resize","isLengthVisible","supportText","errorText","maxLength","value","disabled","name","onChange","onBlur"]);const[L,z]=r(!1),B=p||d||x;/*#__PURE__*/
|
|
45
|
+
return e(l,{"data-testid":"design-system-textarea",className:n("flex w-full flex-col gap-2","full"===f?"h-full":"h-fit"),children:[
|
|
46
|
+
/*#__PURE__*/e(i,{isDisabled:j,isError:p,isFocused:L,isTextarea:!0,className:o("full"===f&&"h-full"),children:[
|
|
47
|
+
/*#__PURE__*/t("textarea",m({"data-testid":"design-system-textarea--textarea",className:n("w-full overflow-y-scroll py-[11px] pl-4 font-[inherit] font-normal tracking-default text-w-gray-600 outline-none scrollbar-list placeholder:font-[inherit] placeholder:tracking-default placeholder:text-w-gray-300","sm"===f?"min-h-[118px]":"md"===f?"min-h-[238px]":"lg"===f?"min-h-[358px]":"full"===f?"min-h-full":void 0,g?"resize-y":"resize-none",j&&"resize-none"),name:O,value:b,disabled:j,onChange:v,maxLength:h,onFocus:e=>{z(!0)},onBlur:e=>{z(!1),w&&w(e)}},S)),g&&/*#__PURE__*/t(a,{name:"small_resizer",className:"absolute bottom-[5px] right-[5px] text-w-gray-400",testId:"design-system-textarea--resize-icon"})]}),B&&/*#__PURE__*/t(s,{errorMessage:y,supportMessage:d,currentLength:(null==b?void 0:b.toString().length)||0,maxLength:h,isMaxLengthVisible:x})]})};export{p as Textarea};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("react");require("tailwind-merge");var t=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");var c=require("./Checkbox.parts.js");function n(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},c=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(c=c.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),c.forEach((function(r){n(e,r,t[r])}))}return e}function s(e,r){if(null==e)return{};var t,c,n=function(e,r){if(null==e)return{};var t,c,n={},o=Object.keys(e);for(c=0;c<o.length;c++)t=o[c],r.indexOf(t)>=0||(n[t]=e[t]);return n}
|
|
2
2
|
/**
|
|
3
3
|
* @component
|
|
4
4
|
* @param {Object} props - 체크박스 컴포넌트 프로퍼티
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* console.log('체크박스 상태:', e.target.checked);
|
|
28
28
|
* };
|
|
29
29
|
* <Checkbox onChange={handleChange} />
|
|
30
|
-
*/(e,
|
|
31
|
-
return e.jsxs(
|
|
32
|
-
/*#__PURE__*/e.jsx("input",
|
|
33
|
-
/*#__PURE__*/e.jsx(
|
|
30
|
+
*/(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(c=0;c<o.length;c++)t=o[c],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}const a=/*#__PURE__*/r.forwardRef(((n,a)=>{var{checked:u=!1,onChange:l,disabled:i=!1,isError:b=!1,type:d="box",className:f}=n,y=s(n,["checked","onChange","disabled","isError","type","className"]);const[p,h]=r.useState(u),[x,g]=r.useState(!1);r.useEffect((()=>{h(u)}),[u]);const j=r.useCallback((e=>{i||l&&(l(e),h(e.target.checked),e.target.checked||g(!1))}),[l,i]);/*#__PURE__*/
|
|
31
|
+
return e.jsxs(t.Box,{"data-testid":"design-system-checkbox",className:"group flex size-fit",children:[
|
|
32
|
+
/*#__PURE__*/e.jsx("input",o({ref:a,className:"absolute h-0 w-0 opacity-0",type:"checkbox",checked:p,onChange:j,onFocus:()=>{g(!0)},onBlur:()=>{g(!1)},disabled:i},y)),
|
|
33
|
+
/*#__PURE__*/e.jsx(c.CheckboxButton,{checked:p,disabled:i,isError:b,isFocused:x,type:d,className:f})]})}));a.displayName="Checkbox",exports.Checkbox=a;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("tailwind-merge"),t=require("react");function
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("tailwind-merge"),t=require("react"),i=require("../../Base/Layouts/Box/Box.js");function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},i=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),i.forEach((function(r){o(e,r,t[r])}))}return e}function s(e,r){if(null==e)return{};var t,i,o=function(e,r){if(null==e)return{};var t,i,o={},a=Object.keys(e);for(i=0;i<a.length;i++)t=a[i],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)t=a[i],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}require("../../Base/Layouts/FullBleed/FullBleed.js");const l=({isDisabled:t,isSelected:i=!1,isError:o,className:a})=>/*#__PURE__*/e.jsx("div",{className:r.twMerge("relative box-border flex h-[18px] w-[18px] items-center justify-center rounded-full border p-[4px]",
|
|
2
2
|
// 체크되었고 비활성화 상태의 경우
|
|
3
3
|
i&&t?"bg-w-white border-primary-100 cursor-not-allowed":
|
|
4
4
|
// 비활성화 상태의 경우
|
|
5
5
|
t?"bg-w-gray-50 border-w-gray-200 cursor-not-allowed":
|
|
6
6
|
// 활성화 상태에서 체크되었고 오류가 없는 경우
|
|
7
|
-
i&&!
|
|
7
|
+
i&&!o?"bg-w-white border-primary-500":
|
|
8
8
|
// 활성화 상태에서 체크되었고 오류가 있는 경우
|
|
9
|
-
i&&
|
|
9
|
+
i&&o?"bg-w-white border-w-red-500":
|
|
10
10
|
// 활성화 상태에서 체크되지 않았고 오류가 있는 경우
|
|
11
|
-
!i&&
|
|
12
|
-
return e.jsxs(
|
|
13
|
-
/*#__PURE__*/e.jsx("input",a({ref:t,type:"radio",className:"hidden",value:
|
|
14
|
-
/*#__PURE__*/e.jsx(
|
|
11
|
+
!i&&o?"border-w-red-500":"bg-white border-w-gray-200 group-hover:border-primary-500 cursor-pointer",a),role:"radio-button",children:/*#__PURE__*/e.jsx("div",{className:r.twMerge("size-2 rounded-full bg-primary transition-all duration-100 ease-in-out",!i&&"h-0 w-0",o&&"bg-w-red-500",t&&"bg-w-gray-200",i&&t&&"bg-primary-100")})}),n=/*#__PURE__*/t.forwardRef(((r,t)=>{var{value:o="",isSelected:n=!1,isDisabled:u=!1,isError:d=!1,className:c}=r,b=s(r,["value","isSelected","isDisabled","isError","className"]);/*#__PURE__*/
|
|
12
|
+
return e.jsxs(i.Box,{"data-testid":"design-system-radio",className:"group cursor-pointer",children:[
|
|
13
|
+
/*#__PURE__*/e.jsx("input",a({ref:t,type:"radio",className:"hidden",value:o,checked:n,disabled:u},b)),
|
|
14
|
+
/*#__PURE__*/e.jsx(l,{isSelected:n,isError:d,isDisabled:u,className:c})]})}));
|
|
15
15
|
/**
|
|
16
16
|
* 사용자가 여러 옵션 중 하나를 선택할 수 있는 라디오 버튼 컴포넌트입니다.
|
|
17
17
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("../../Base/Typography/Typography.js"),
|
|
2
|
-
return e.jsxs(
|
|
3
|
-
/*#__PURE__*/e.jsx(r.Typography,{variant:"body2",className:"flex-1 text-w-gray-400",children:t}),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("../../Base/Typography/Typography.js"),a=require("../../Base/Layouts/Box/Box.js");require("tailwind-merge"),require("../../Base/Layouts/FullBleed/FullBleed.js");exports.SupportTextContainer=({errorMessage:s,supportMessage:t,currentLength:i,maxLength:l,isMaxLengthVisible:o})=>{const x=t||o;/*#__PURE__*/
|
|
2
|
+
return e.jsxs(a.Box,{className:"flex flex-col gap-2 px-[17px]","data-testid":"design-system--support-text-container",children:[s&&/*#__PURE__*/e.jsx(r.Typography,{variant:"body2",className:"text-w-red-500",children:s}),x&&/*#__PURE__*/e.jsxs(a.Box,{className:"flex gap-6",children:[
|
|
3
|
+
/*#__PURE__*/e.jsx(r.Typography,{variant:"body2",className:"flex-1 text-w-gray-400",children:t}),o&&/*#__PURE__*/e.jsxs(r.Typography,{variant:"body2",className:"w-[72px] text-right text-w-gray-400",children:[null==i?void 0:i.toLocaleString(),"/",null==l?void 0:l.toLocaleString()]})]})]})};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("tailwind-merge"),n=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");var s=require("../../DataDisplays/SystemIcon/SystemIcon.js");require("../../DataDisplays/SystemIcon/SystemIcon.constants.js");var a=require("../TextFieldContainer/TextFieldContainer.js"),i=require("../SupportTextContainer/SupportTextContainer.js");function
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("tailwind-merge"),n=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js");var s=require("../../DataDisplays/SystemIcon/SystemIcon.js");require("../../DataDisplays/SystemIcon/SystemIcon.constants.js");var a=require("../TextFieldContainer/TextFieldContainer.js"),i=require("../SupportTextContainer/SupportTextContainer.js");function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){l(e,t,r[t])}))}return e}function u(e,t){if(null==e)return{};var r,n,s=function(e,t){if(null==e)return{};var r,n,s={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(s[r]=e[r]);return s}
|
|
2
2
|
/**
|
|
3
3
|
* 사용자가 여러 줄의 텍스트를 입력할 수 있는 textarea 컴포넌트입니다.
|
|
4
4
|
*
|
|
5
5
|
* @param {Object} props
|
|
6
6
|
* @param {boolean} [props.isError] - 에러 상태를 표시합니다
|
|
7
|
-
* @param {('sm'|'md'|'lg')} [props.size='md'] - textarea의 크기를 지정합니다
|
|
7
|
+
* @param {('sm'|'md'|'lg'|'full')} [props.size='md'] - textarea의 크기를 지정합니다
|
|
8
8
|
* @param {boolean} [props.resize=false] - 크기 조절 가능 여부를 설정합니다
|
|
9
9
|
* @param {string} [props.supportText] - 도움말 텍스트를 표시합니다
|
|
10
10
|
* @param {string} [props.errorText] - 에러 메시지를 표시합니다
|
|
@@ -32,8 +32,16 @@
|
|
|
32
32
|
* isLengthVisible={true}
|
|
33
33
|
* supportText="최대 1000자까지 입력 가능합니다"
|
|
34
34
|
* />
|
|
35
|
+
*
|
|
36
|
+
* // 외부 컨테이너 높이에 맞게 최대로 확장
|
|
37
|
+
* <div className="h-96">
|
|
38
|
+
* <Textarea
|
|
39
|
+
* size="full"
|
|
40
|
+
* placeholder="컨테이너 높이에 맞게 확장됩니다"
|
|
41
|
+
* />
|
|
42
|
+
* </div>
|
|
35
43
|
* ```
|
|
36
|
-
*/(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}exports.Textarea=
|
|
37
|
-
return e.jsxs(n.Box,{"data-testid":"design-system-textarea",className:"flex
|
|
38
|
-
/*#__PURE__*/e.jsxs(a.TextFieldContainer,{isDisabled:
|
|
39
|
-
/*#__PURE__*/e.jsx("textarea",
|
|
44
|
+
*/(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}exports.Textarea=l=>{var{isError:c=!1,size:x="md",resize:m=!1,isLengthVisible:p=!1,supportText:g,errorText:f,maxLength:d,value:y,disabled:h,name:b,onChange:j,onBlur:v}=l,w=u(l,["isError","size","resize","isLengthVisible","supportText","errorText","maxLength","value","disabled","name","onChange","onBlur"]);const[O,S]=t.useState(!1),T=c||g||p;/*#__PURE__*/
|
|
45
|
+
return e.jsxs(n.Box,{"data-testid":"design-system-textarea",className:r.twMerge("flex w-full flex-col gap-2","full"===x?"h-full":"h-fit"),children:[
|
|
46
|
+
/*#__PURE__*/e.jsxs(a.TextFieldContainer,{isDisabled:h,isError:c,isFocused:O,isTextarea:!0,className:r.twJoin("full"===x&&"h-full"),children:[
|
|
47
|
+
/*#__PURE__*/e.jsx("textarea",o({"data-testid":"design-system-textarea--textarea",className:r.twMerge("w-full overflow-y-scroll py-[11px] pl-4 font-[inherit] font-normal tracking-default text-w-gray-600 outline-none scrollbar-list placeholder:font-[inherit] placeholder:tracking-default placeholder:text-w-gray-300","sm"===x?"min-h-[118px]":"md"===x?"min-h-[238px]":"lg"===x?"min-h-[358px]":"full"===x?"min-h-full":void 0,m?"resize-y":"resize-none",h&&"resize-none"),name:b,value:y,disabled:h,onChange:j,maxLength:d,onFocus:e=>{S(!0)},onBlur:e=>{S(!1),v&&v(e)}},w)),m&&/*#__PURE__*/e.jsx(s.SystemIcon,{name:"small_resizer",className:"absolute bottom-[5px] right-[5px] text-w-gray-400",testId:"design-system-textarea--resize-icon"})]}),T&&/*#__PURE__*/e.jsx(i.SupportTextContainer,{errorMessage:f,supportMessage:g,currentLength:(null==y?void 0:y.toString().length)||0,maxLength:d,isMaxLengthVisible:p})]})};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wishket/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Wishket Design System",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -53,20 +53,18 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@babel/core": "^7.23.7",
|
|
55
55
|
"@babel/preset-env": "^7.23.7",
|
|
56
|
-
"@babel/preset-react": "^7.
|
|
56
|
+
"@babel/preset-react": "^7.27.1",
|
|
57
57
|
"@changesets/changelog-github": "^0.5.0",
|
|
58
58
|
"@changesets/cli": "^2.27.1",
|
|
59
|
-
"@chromatic-com/storybook": "^
|
|
59
|
+
"@chromatic-com/storybook": "^4.0.0",
|
|
60
60
|
"@faker-js/faker": "^8.4.1",
|
|
61
61
|
"@rollup/plugin-terser": "^0.4.4",
|
|
62
|
-
"@storybook/addon-
|
|
63
|
-
"@storybook/addon-
|
|
64
|
-
"@storybook/addon-
|
|
65
|
-
"@storybook/addon-
|
|
66
|
-
"@storybook/
|
|
67
|
-
"@storybook/nextjs": "^
|
|
68
|
-
"@storybook/react": "^8.4.0",
|
|
69
|
-
"@storybook/test": "^8.4.0",
|
|
62
|
+
"@storybook/addon-docs": "^9.0.9",
|
|
63
|
+
"@storybook/addon-links": "^9.0.9",
|
|
64
|
+
"@storybook/addon-onboarding": "^9.0.9",
|
|
65
|
+
"@storybook/addon-styling-webpack": "^2.0.0",
|
|
66
|
+
"@storybook/mdx2-csf": "^1.1.0",
|
|
67
|
+
"@storybook/nextjs": "^9.0.9",
|
|
70
68
|
"@swc/core": "^1.5.5",
|
|
71
69
|
"@testing-library/dom": "^9.3.4",
|
|
72
70
|
"@testing-library/jest-dom": "^6.2.0",
|
|
@@ -95,7 +93,7 @@
|
|
|
95
93
|
"rollup-plugin-copy": "^3.5.0",
|
|
96
94
|
"rollup-plugin-swc3": "^0.12.1",
|
|
97
95
|
"rollup-preserve-directives": "^1.1.3",
|
|
98
|
-
"storybook": "^
|
|
96
|
+
"storybook": "^9.0.9",
|
|
99
97
|
"tailwindcss": "^3.4.1",
|
|
100
98
|
"ts-jest": "^29.1.1",
|
|
101
99
|
"ts-node": "^10.9.2",
|