@wishket/design-system 3.0.1 → 3.1.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.
@@ -51,6 +51,6 @@ declare const GNBList: {
51
51
  UserInfo: ({ imgUrl, username, email, children, onClick, }: import("./GNBList.types").UserInfoProps) => import("react/jsx-runtime").JSX.Element;
52
52
  List: ({ children }: import("react").PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
53
53
  SubList: ({ children }: import("react").PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
54
- Item: ({ hasNew, children, className, textClassName, href, as: LinkComponent, ...rest }: import("./GNBList.types").GNBListItemProps) => import("react/jsx-runtime").JSX.Element;
54
+ Item: <T extends import("react").ElementType = "a">({ hasNew, children, className, textClassName, href, as, ...rest }: import("./GNBList.types").GNBListItemProps<T>) => import("react/jsx-runtime").JSX.Element;
55
55
  };
56
56
  export { GNBList };
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { ElementType, PropsWithChildren } from 'react';
2
2
  import { GNBListRootProps, GNBListItemProps, UserInfoProps } from './GNBList.types';
3
3
  /**
4
4
  * GNB 리스트의 루트 컴포넌트
@@ -132,5 +132,5 @@ declare const SubList: ({ children }: PropsWithChildren) => import("react/jsx-ru
132
132
  * 특별 메뉴
133
133
  * </Item>
134
134
  */
135
- declare const Item: ({ hasNew, children, className, textClassName, href, as: LinkComponent, ...rest }: GNBListItemProps) => import("react/jsx-runtime").JSX.Element;
135
+ declare const Item: <T extends ElementType = "a">({ hasNew, children, className, textClassName, href, as, ...rest }: GNBListItemProps<T>) => import("react/jsx-runtime").JSX.Element;
136
136
  export { Root, UserInfo, List, SubList, Item };
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Children as a,Fragment as t}from"react";import{twMerge as l}from"tailwind-merge";import{Avatar as n}from"../../DataDisplays/Avatar/Avatar.js";import{Typography as o}from"../../Base/Typography/Typography.js";import{Box as s}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";import"../../DataDisplays/SystemIcon/SystemIcon.constants.js";import{NewBadge as i}from"../../DataDisplays/NewBadge/NewBadge.js";import{Divider as c}from"../../DataDisplays/Divider/Divider.js";import"../../DataDisplays/Accordion/Accordion.js";function m(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function p(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{},t=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),t.forEach((function(r){m(e,r,a[r])}))}return e}function f(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r.push.apply(r,a)}return r}(Object(r)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})),e}function u(e,r){if(null==e)return{};var a,t,l=function(e,r){if(null==e)return{};var a,t,l={},n=Object.keys(e);for(t=0;t<n.length;t++)a=n[t],r.indexOf(a)>=0||(l[a]=e[a]);return l}
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Children as a,Fragment as l}from"react";import{twMerge as t}from"tailwind-merge";import{Avatar as n}from"../../DataDisplays/Avatar/Avatar.js";import{Typography as o}from"../../Base/Typography/Typography.js";import{Box as s}from"../../Base/Layouts/Box/Box.js";import"../../Base/Layouts/FullBleed/FullBleed.js";import"../../DataDisplays/SystemIcon/SystemIcon.constants.js";import{NewBadge as i}from"../../DataDisplays/NewBadge/NewBadge.js";import{Divider as c}from"../../DataDisplays/Divider/Divider.js";import"../../DataDisplays/Accordion/Accordion.js";function m(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function p(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{},l=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(l=l.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),l.forEach((function(r){m(e,r,a[r])}))}return e}function f(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r.push.apply(r,a)}return r}(Object(r)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})),e}function u(e,r){if(null==e)return{};var a,l,t=function(e,r){if(null==e)return{};var a,l,t={},n=Object.keys(e);for(l=0;l<n.length;l++)a=n[l],r.indexOf(a)>=0||(t[a]=e[a]);return t}
2
2
  /**
3
3
  * GNB 리스트의 루트 컴포넌트
4
4
  *
@@ -31,16 +31,16 @@ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Children as a,Fragment
31
31
  * <Item href="/logout">로그아웃</Item>
32
32
  * </SubList>
33
33
  * </Root>
34
- */(e,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(t=0;t<n.length;t++)a=n[t],r.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}const y=({withUserInfo:n=!1,children:o,className:i})=>{const m=a.map(o,((a,l)=>0===l?a:/*#__PURE__*/r(t,{children:[
34
+ */(e,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)a=n[l],r.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}const y=({withUserInfo:n=!1,children:o,className:i})=>{const m=a.map(o,((a,t)=>0===t?a:/*#__PURE__*/r(l,{children:[
35
35
  /*#__PURE__*/e(c,{className:"my-2"}),a]})));/*#__PURE__*/
36
- return e(s,{as:"nav","aria-label":"네비게이션 메뉴",className:l("absolute flex flex-col rounded-xl bg-w-white shadow-graymedium",n?"w-[280px] pb-3 pt-5":"h-auto w-[200px] overflow-hidden py-3",i),children:m})},b=({imgUrl:a,username:t,email:l,children:i,onClick:c})=>/*#__PURE__*/r(s,{role:"region","aria-label":"사용자 정보",className:"flex w-full flex-col gap-4 px-6 pb-4",children:[
36
+ return e(s,{as:"nav","aria-label":"네비게이션 메뉴",className:t("absolute flex flex-col rounded-xl bg-w-white shadow-graymedium",n?"w-[280px] pb-3 pt-5":"h-auto w-[200px] overflow-hidden py-3",i),children:m})},b=({imgUrl:a,username:l,email:t,children:i,onClick:c})=>/*#__PURE__*/r(s,{role:"region","aria-label":"사용자 정보",className:"flex w-full flex-col gap-4 px-6 pb-4",children:[
37
37
  /*#__PURE__*/r(s,{className:"flex w-full items-center gap-4",children:[
38
38
  /*#__PURE__*/e(n,{size:"lg",isEditable:!0,imgUrl:a,onClick:c}),
39
39
  /*#__PURE__*/r(s,{className:"flex w-full flex-col gap-0.5",children:[
40
- /*#__PURE__*/e(o,{variant:"body16",className:"text-w-gray-900 font-medium",children:t}),
41
- /*#__PURE__*/e(o,{variant:"body14",className:"text-w-gray-600 line-clamp-2 break-all",children:l})]})]}),i&&/*#__PURE__*/e(s,{className:"flex w-full flex-col gap-2",children:i})]}),d=({children:r})=>/*#__PURE__*/e(s,{as:"ul","aria-label":"메인 메뉴",className:"text-w-gray-900 w-full",children:r}),h=({children:r})=>/*#__PURE__*/e(s,{as:"ul","aria-label":"서브 메뉴",className:"text-w-gray-600 w-full",children:r}),g=a=>{var{hasNew:t=!1,children:n,className:c,textClassName:m,href:y,as:b="a"}=a,d=u(a,["hasNew","children","className","textClassName","href","as"]);/*#__PURE__*/
42
- return e(s,{as:"li",children:/*#__PURE__*/r(b,f(p({href:y,className:l("hover:bg-primary-10 flex w-full cursor-pointer gap-1 px-6 py-2",c)},d),{children:[
43
- /*#__PURE__*/e(o,{variant:"body14",className:m,children:n}),t&&/*#__PURE__*/e(i,{className:"mt-1","aria-label":"새 소식"})]}))})};
40
+ /*#__PURE__*/e(o,{variant:"body16",className:"text-w-gray-900 font-medium",children:l}),
41
+ /*#__PURE__*/e(o,{variant:"body14",className:"text-w-gray-600 line-clamp-2 break-all",children:t})]})]}),i&&/*#__PURE__*/e(s,{className:"flex w-full flex-col gap-2",children:i})]}),d=({children:r})=>/*#__PURE__*/e(s,{as:"ul","aria-label":"메인 메뉴",className:"text-w-gray-900 w-full",children:r}),h=({children:r})=>/*#__PURE__*/e(s,{as:"ul","aria-label":"서브 메뉴",className:"text-w-gray-600 w-full",children:r}),g=a=>{var{hasNew:l=!1,children:n,className:c,textClassName:m,href:y,as:b}=a,d=u(a,["hasNew","children","className","textClassName","href","as"]);/*#__PURE__*/
42
+ return e(s,{as:"li",children:/*#__PURE__*/r(null!=b?b:"a",f(p({href:y,className:t("hover:bg-primary-10 flex w-full cursor-pointer gap-1 px-6 py-2",c)},d),{children:[
43
+ /*#__PURE__*/e(o,{variant:"body14",className:m,children:n}),l&&/*#__PURE__*/e(i,{className:"mt-1","aria-label":"새 소식"})]}))})};
44
44
  /**
45
45
  * 사용자 정보 컴포넌트
46
46
  *
@@ -1,4 +1,4 @@
1
- import { ComponentPropsWithoutRef, ElementType, PropsWithChildren } from 'react';
1
+ import { ComponentPropsWithoutRef, ElementType, PropsWithChildren, ReactNode } from 'react';
2
2
  export interface GNBListRootProps extends PropsWithChildren {
3
3
  withUserInfo?: boolean;
4
4
  className?: string;
@@ -9,13 +9,19 @@ export interface UserInfoProps extends PropsWithChildren {
9
9
  email?: string;
10
10
  onClick?: () => void;
11
11
  }
12
- export interface GNBListItemProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'> {
12
+ type GNBListItemOwnProps = {
13
13
  href: string;
14
14
  hasNew?: boolean;
15
15
  textClassName?: string;
16
+ className?: string;
17
+ children?: ReactNode;
18
+ };
19
+ export type GNBListItemProps<T extends ElementType = 'a'> = GNBListItemOwnProps & {
16
20
  /**
17
21
  * Item에서 anchor로 렌더할 컴포넌트. 기본값은 일반 `<a>` 태그이며,
18
- * Next.js의 Link 등을 주입할 수 있습니다.
22
+ * Next.js의 Link 등을 주입할 수 있습니다. 주입된 컴포넌트의 전용
23
+ * prop(예: next/link의 `prefetch`)도 타입 추론됩니다.
19
24
  */
20
- as?: ElementType;
21
- }
25
+ as?: T;
26
+ } & Omit<ComponentPropsWithoutRef<T>, 'as' | 'href' | 'children' | 'className'>;
27
+ export {};
@@ -26,15 +26,16 @@ export interface MenuCommonProps {
26
26
  *
27
27
  * - `href`가 필수이며, 기본 anchor(`<a>`) 또는 `as`로 주입된 컴포넌트로 렌더링됩니다.
28
28
  * - anchor 관련 native 속성(`target`, `rel`, `download` 등)을 그대로 받습니다.
29
+ * - `as`로 컴포넌트를 주입하면 해당 컴포넌트의 전용 props(예: `next/link`의 `prefetch`)도 타입 추론됩니다.
29
30
  */
30
- export type MenuLinkProps = MenuCommonProps & Omit<ComponentPropsWithoutRef<'a'>, 'href' | 'className' | 'children' | 'as'> & {
31
+ export type MenuLinkProps<T extends ElementType = 'a'> = MenuCommonProps & {
31
32
  href: string;
32
33
  /**
33
34
  * anchor 자리에 렌더할 컴포넌트. 기본값은 일반 `<a>` 태그이며,
34
35
  * Next.js의 Link 등을 주입할 수 있습니다.
35
36
  */
36
- as?: ElementType;
37
- };
37
+ as?: T;
38
+ } & Omit<ComponentPropsWithoutRef<T>, 'href' | 'className' | 'children' | 'as' | keyof MenuCommonProps>;
38
39
  /**
39
40
  * `MenuButton`의 props.
40
41
  *
@@ -1,3 +1,4 @@
1
+ import { ElementType } from 'react';
1
2
  import { MenuLinkProps } from './Menu.types';
2
3
  /**
3
4
  * 네비게이션에서 사용되는 링크형 메뉴 항목.
@@ -39,5 +40,5 @@ import { MenuLinkProps } from './Menu.types';
39
40
  * rel="noopener noreferrer"
40
41
  * />
41
42
  */
42
- declare const MenuLink: ({ type, variant, name, badgeCount, isSelected, leadingIcon, iconButtonName, onOptionClick, items, selectedItem, onItemClick, href, as: LinkComponent, children: _children, ...rest }: MenuLinkProps) => import("react/jsx-runtime").JSX.Element;
43
+ declare const MenuLink: <T extends ElementType = "a">({ type, variant, name, badgeCount, isSelected, leadingIcon, iconButtonName, onOptionClick, items, selectedItem, onItemClick, href, as, children: _children, ...rest }: MenuLinkProps<T>) => import("react/jsx-runtime").JSX.Element;
43
44
  export { MenuLink };
@@ -38,5 +38,5 @@ import{jsx as e}from"react/jsx-runtime";import{MenuBase as t}from"./MenuBase.js"
38
38
  * target="_blank"
39
39
  * rel="noopener noreferrer"
40
40
  * />
41
- */(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const i=n=>{var{type:i,variant:c,name:a,badgeCount:l,isSelected:u,leadingIcon:m,iconButtonName:f,onOptionClick:s,items:p,selectedItem:b,onItemClick:O,href:y,as:d="a",children:g}=n,j=o(n,["type","variant","name","badgeCount","isSelected","leadingIcon","iconButtonName","onOptionClick","items","selectedItem","onItemClick","href","as","children"]);/*#__PURE__*/
42
- return e(t,{type:i,variant:c,name:a,badgeCount:l,isSelected:u,leadingIcon:m,iconButtonName:f,onOptionClick:s,items:p,selectedItem:b,onItemClick:O,as:d,wrapperProps:r({href:y},j)})};export{i as MenuLink};
41
+ */(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const i=n=>{var{type:i,variant:c,name:l,badgeCount:a,isSelected:u,leadingIcon:m,iconButtonName:f,onOptionClick:s,items:p,selectedItem:b,onItemClick:O,href:y,as:d,children:g}=n,j=o(n,["type","variant","name","badgeCount","isSelected","leadingIcon","iconButtonName","onOptionClick","items","selectedItem","onItemClick","href","as","children"]);/*#__PURE__*/
42
+ return e(t,{type:i,variant:c,name:l,badgeCount:a,isSelected:u,leadingIcon:m,iconButtonName:f,onOptionClick:s,items:p,selectedItem:b,onItemClick:O,as:null!=d?d:"a",wrapperProps:r({href:y},j)})};export{i as MenuLink};
@@ -1,15 +1,18 @@
1
1
  import { ComponentPropsWithoutRef, ElementType } from 'react';
2
2
  import { TextWithIconsProps } from '../../Base/TextWithIcons/TextWithIcons';
3
- interface TextLinkProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'>, TextWithIconsProps {
3
+ type TextLinkOwnProps = TextWithIconsProps & {
4
4
  href: string;
5
- as?: ElementType;
6
- }
5
+ };
6
+ export type TextLinkProps<T extends ElementType = 'a'> = TextLinkOwnProps & {
7
+ as?: T;
8
+ } & Omit<ComponentPropsWithoutRef<T>, 'as' | 'href' | 'children' | keyof TextLinkOwnProps>;
7
9
  /**
8
10
  * 텍스트 기반의 링크 컴포넌트입니다.
9
11
  *
10
12
  * @description
11
13
  * TextButton과 동일한 스타일을 가지지만 기본적으로 `<a>` 태그 기반으로 페이지 네비게이션을 담당합니다.
12
- * `as` prop으로 Next.js의 `Link`나 React Router의 `Link` 등 임의의 컴포넌트를 주입할 수 있습니다.
14
+ * `as` prop으로 Next.js의 `Link`나 React Router의 `Link` 등 임의의 컴포넌트를 주입할 수 있고,
15
+ * 주입된 컴포넌트의 전용 props(예: next/link의 `prefetch`)도 타입 추론됩니다.
13
16
  *
14
17
  * @component
15
18
  * @param {Object} props - TextLink 컴포넌트의 props
@@ -27,9 +30,9 @@ interface TextLinkProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'>, Tex
27
30
  * <TextLink href="/about" text="소개 페이지로 이동" />
28
31
  *
29
32
  * @example
30
- * // Next.js Link와 함께 사용
33
+ * // Next.js Link와 함께 사용 — prefetch 등 Link 전용 prop도 타입 추론됨
31
34
  * import Link from 'next/link';
32
- * <TextLink as={Link} href="/about" text="소개" />
35
+ * <TextLink as={Link} href="/about" text="소개" prefetch={false} />
33
36
  *
34
37
  * @example
35
38
  * // 외부 링크
@@ -40,5 +43,5 @@ interface TextLinkProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'>, Tex
40
43
  * rel="noopener noreferrer"
41
44
  * />
42
45
  */
43
- declare const TextLink: ({ as: Component, href, text, leadingIcon, trailingIcon, isTextSmall, isGray, isUnderline, className, ...rest }: TextLinkProps) => import("react/jsx-runtime").JSX.Element;
46
+ declare const TextLink: <T extends ElementType = "a">({ as, href, text, leadingIcon, trailingIcon, isTextSmall, isGray, isUnderline, className, ...rest }: TextLinkProps<T>) => import("react/jsx-runtime").JSX.Element;
44
47
  export { TextLink };
@@ -4,7 +4,8 @@ import{jsx as e}from"react/jsx-runtime";import{twMerge as t}from"tailwind-merge"
4
4
  *
5
5
  * @description
6
6
  * TextButton과 동일한 스타일을 가지지만 기본적으로 `<a>` 태그 기반으로 페이지 네비게이션을 담당합니다.
7
- * `as` prop으로 Next.js의 `Link`나 React Router의 `Link` 등 임의의 컴포넌트를 주입할 수 있습니다.
7
+ * `as` prop으로 Next.js의 `Link`나 React Router의 `Link` 등 임의의 컴포넌트를 주입할 수 있고,
8
+ * 주입된 컴포넌트의 전용 props(예: next/link의 `prefetch`)도 타입 추론됩니다.
8
9
  *
9
10
  * @component
10
11
  * @param {Object} props - TextLink 컴포넌트의 props
@@ -22,9 +23,9 @@ import{jsx as e}from"react/jsx-runtime";import{twMerge as t}from"tailwind-merge"
22
23
  * <TextLink href="/about" text="소개 페이지로 이동" />
23
24
  *
24
25
  * @example
25
- * // Next.js Link와 함께 사용
26
+ * // Next.js Link와 함께 사용 — prefetch 등 Link 전용 prop도 타입 추론됨
26
27
  * import Link from 'next/link';
27
- * <TextLink as={Link} href="/about" text="소개" />
28
+ * <TextLink as={Link} href="/about" text="소개" prefetch={false} />
28
29
  *
29
30
  * @example
30
31
  * // 외부 링크
@@ -34,5 +35,5 @@ import{jsx as e}from"react/jsx-runtime";import{twMerge as t}from"tailwind-merge"
34
35
  * target="_blank"
35
36
  * rel="noopener noreferrer"
36
37
  * />
37
- */(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const c=c=>{var{as:l="a",href:a,text:s,leadingIcon:f,trailingIcon:u,isTextSmall:p=!1,isGray:O=!1,isUnderline:b=!1,className:y}=c,m=o(c,["as","href","text","leadingIcon","trailingIcon","isTextSmall","isGray","isUnderline","className"]);/*#__PURE__*/
38
- return e(l,i(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){n(e,t,r[t])}))}return e}({href:a,className:t("flex min-h-6 w-fit items-center justify-center",p?"gap-x-0.5":"gap-x-1",y)},m),{children:/*#__PURE__*/e(r,{text:s,leadingIcon:f,trailingIcon:u,isTextSmall:p,isUnderline:b,isGray:O})}))};export{c as TextLink};
38
+ */(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const c=c=>{var{as:l,href:a,text:s,leadingIcon:f,trailingIcon:u,isTextSmall:p=!1,isGray:O=!1,isUnderline:b=!1,className:y}=c,m=o(c,["as","href","text","leadingIcon","trailingIcon","isTextSmall","isGray","isUnderline","className"]);/*#__PURE__*/
39
+ return e(null!=l?l:"a",i(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){n(e,t,r[t])}))}return e}({href:a,className:t("flex min-h-6 w-fit items-center justify-center",p?"gap-x-0.5":"gap-x-1",y)},m),{children:/*#__PURE__*/e(r,{text:s,leadingIcon:f,trailingIcon:u,isTextSmall:p,isUnderline:b,isGray:O})}))};export{c as TextLink};
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),a=require("tailwind-merge"),t=require("../../DataDisplays/Avatar/Avatar.js"),l=require("../../Base/Typography/Typography.js"),s=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js"),require("../../DataDisplays/SystemIcon/SystemIcon.constants.js");var i=require("../../DataDisplays/NewBadge/NewBadge.js"),n=require("../../DataDisplays/Divider/Divider.js");function o(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function c(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{},t=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),t.forEach((function(r){o(e,r,a[r])}))}return e}function u(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r.push.apply(r,a)}return r}(Object(r)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})),e}function p(e,r){if(null==e)return{};var a,t,l=function(e,r){if(null==e)return{};var a,t,l={},s=Object.keys(e);for(t=0;t<s.length;t++)a=s[t],r.indexOf(a)>=0||(l[a]=e[a]);return l}
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),a=require("tailwind-merge"),t=require("../../DataDisplays/Avatar/Avatar.js"),l=require("../../Base/Typography/Typography.js"),s=require("../../Base/Layouts/Box/Box.js");require("../../Base/Layouts/FullBleed/FullBleed.js"),require("../../DataDisplays/SystemIcon/SystemIcon.constants.js");var n=require("../../DataDisplays/NewBadge/NewBadge.js"),i=require("../../DataDisplays/Divider/Divider.js");function o(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function c(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{},t=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),t.forEach((function(r){o(e,r,a[r])}))}return e}function u(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r.push.apply(r,a)}return r}(Object(r)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})),e}function p(e,r){if(null==e)return{};var a,t,l=function(e,r){if(null==e)return{};var a,t,l={},s=Object.keys(e);for(t=0;t<s.length;t++)a=s[t],r.indexOf(a)>=0||(l[a]=e[a]);return l}
2
2
  /**
3
3
  * GNB 리스트의 루트 컴포넌트
4
4
  *
@@ -31,13 +31,13 @@
31
31
  * <Item href="/logout">로그아웃</Item>
32
32
  * </SubList>
33
33
  * </Root>
34
- */(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t<s.length;t++)a=s[t],r.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}require("../../DataDisplays/Accordion/Accordion.js");exports.Item=r=>{var{hasNew:t=!1,children:n,className:o,textClassName:y,href:x,as:f="a"}=r,d=p(r,["hasNew","children","className","textClassName","href","as"]);/*#__PURE__*/
35
- return e.jsx(s.Box,{as:"li",children:/*#__PURE__*/e.jsxs(f,u(c({href:x,className:a.twMerge("hover:bg-primary-10 flex w-full cursor-pointer gap-1 px-6 py-2",o)},d),{children:[
36
- /*#__PURE__*/e.jsx(l.Typography,{variant:"body14",className:y,children:n}),t&&/*#__PURE__*/e.jsx(i.NewBadge,{className:"mt-1","aria-label":"새 소식"})]}))})},exports.List=({children:r})=>/*#__PURE__*/e.jsx(s.Box,{as:"ul","aria-label":"메인 메뉴",className:"text-w-gray-900 w-full",children:r}),exports.Root=({withUserInfo:t=!1,children:l,className:i})=>{const o=r.Children.map(l,((a,t)=>0===t?a:/*#__PURE__*/e.jsxs(r.Fragment,{children:[
37
- /*#__PURE__*/e.jsx(n.Divider,{className:"my-2"}),a]}))),c=t?"w-[280px] pb-3 pt-5":"h-auto w-[200px] overflow-hidden py-3";/*#__PURE__*/
38
- return e.jsx(s.Box,{as:"nav","aria-label":"네비게이션 메뉴",className:a.twMerge("absolute flex flex-col rounded-xl bg-w-white shadow-graymedium",c,i),children:o})},exports.SubList=({children:r})=>/*#__PURE__*/e.jsx(s.Box,{as:"ul","aria-label":"서브 메뉴",className:"text-w-gray-600 w-full",children:r}),exports.UserInfo=({imgUrl:r,username:a,email:i,children:n,onClick:o})=>/*#__PURE__*/e.jsxs(s.Box,{role:"region","aria-label":"사용자 정보",className:"flex w-full flex-col gap-4 px-6 pb-4",children:[
34
+ */(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t<s.length;t++)a=s[t],r.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}require("../../DataDisplays/Accordion/Accordion.js");exports.Item=r=>{var{hasNew:t=!1,children:i,className:o,textClassName:y,href:x,as:f}=r,d=p(r,["hasNew","children","className","textClassName","href","as"]);const m=null!=f?f:"a";/*#__PURE__*/
35
+ return e.jsx(s.Box,{as:"li",children:/*#__PURE__*/e.jsxs(m,u(c({href:x,className:a.twMerge("hover:bg-primary-10 flex w-full cursor-pointer gap-1 px-6 py-2",o)},d),{children:[
36
+ /*#__PURE__*/e.jsx(l.Typography,{variant:"body14",className:y,children:i}),t&&/*#__PURE__*/e.jsx(n.NewBadge,{className:"mt-1","aria-label":"새 소식"})]}))})},exports.List=({children:r})=>/*#__PURE__*/e.jsx(s.Box,{as:"ul","aria-label":"메인 메뉴",className:"text-w-gray-900 w-full",children:r}),exports.Root=({withUserInfo:t=!1,children:l,className:n})=>{const o=r.Children.map(l,((a,t)=>0===t?a:/*#__PURE__*/e.jsxs(r.Fragment,{children:[
37
+ /*#__PURE__*/e.jsx(i.Divider,{className:"my-2"}),a]}))),c=t?"w-[280px] pb-3 pt-5":"h-auto w-[200px] overflow-hidden py-3";/*#__PURE__*/
38
+ return e.jsx(s.Box,{as:"nav","aria-label":"네비게이션 메뉴",className:a.twMerge("absolute flex flex-col rounded-xl bg-w-white shadow-graymedium",c,n),children:o})},exports.SubList=({children:r})=>/*#__PURE__*/e.jsx(s.Box,{as:"ul","aria-label":"서브 메뉴",className:"text-w-gray-600 w-full",children:r}),exports.UserInfo=({imgUrl:r,username:a,email:n,children:i,onClick:o})=>/*#__PURE__*/e.jsxs(s.Box,{role:"region","aria-label":"사용자 정보",className:"flex w-full flex-col gap-4 px-6 pb-4",children:[
39
39
  /*#__PURE__*/e.jsxs(s.Box,{className:"flex w-full items-center gap-4",children:[
40
40
  /*#__PURE__*/e.jsx(t.Avatar,{size:"lg",isEditable:!0,imgUrl:r,onClick:o}),
41
41
  /*#__PURE__*/e.jsxs(s.Box,{className:"flex w-full flex-col gap-0.5",children:[
42
42
  /*#__PURE__*/e.jsx(l.Typography,{variant:"body16",className:"text-w-gray-900 font-medium",children:a}),
43
- /*#__PURE__*/e.jsx(l.Typography,{variant:"body14",className:"text-w-gray-600 line-clamp-2 break-all",children:i})]})]}),n&&/*#__PURE__*/e.jsx(s.Box,{className:"flex w-full flex-col gap-2",children:n})]});
43
+ /*#__PURE__*/e.jsx(l.Typography,{variant:"body14",className:"text-w-gray-600 line-clamp-2 break-all",children:n})]})]}),i&&/*#__PURE__*/e.jsx(s.Box,{className:"flex w-full flex-col gap-2",children:i})]});
@@ -38,5 +38,5 @@
38
38
  * target="_blank"
39
39
  * rel="noopener noreferrer"
40
40
  * />
41
- */(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}exports.MenuLink=n=>{var{type:i,variant:c,name:a,badgeCount:l,isSelected:u,leadingIcon:s,iconButtonName:f,onOptionClick:m,items:p,selectedItem:b,onItemClick:O,href:y,as:d="a",children:g}=n,j=o(n,["type","variant","name","badgeCount","isSelected","leadingIcon","iconButtonName","onOptionClick","items","selectedItem","onItemClick","href","as","children"]);/*#__PURE__*/
42
- return e.jsx(t.MenuBase,{type:i,variant:c,name:a,badgeCount:l,isSelected:u,leadingIcon:s,iconButtonName:f,onOptionClick:m,items:p,selectedItem:b,onItemClick:O,as:d,wrapperProps:r({href:y},j)})};
41
+ */(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}exports.MenuLink=n=>{var{type:i,variant:c,name:a,badgeCount:l,isSelected:u,leadingIcon:s,iconButtonName:f,onOptionClick:m,items:p,selectedItem:b,onItemClick:O,href:y,as:d,children:g}=n,j=o(n,["type","variant","name","badgeCount","isSelected","leadingIcon","iconButtonName","onOptionClick","items","selectedItem","onItemClick","href","as","children"]);const v=null!=d?d:"a";/*#__PURE__*/
42
+ return e.jsx(t.MenuBase,{type:i,variant:c,name:a,badgeCount:l,isSelected:u,leadingIcon:s,iconButtonName:f,onOptionClick:m,items:p,selectedItem:b,onItemClick:O,as:v,wrapperProps:r({href:y},j)})};
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * @description
6
6
  * TextButton과 동일한 스타일을 가지지만 기본적으로 `<a>` 태그 기반으로 페이지 네비게이션을 담당합니다.
7
- * `as` prop으로 Next.js의 `Link`나 React Router의 `Link` 등 임의의 컴포넌트를 주입할 수 있습니다.
7
+ * `as` prop으로 Next.js의 `Link`나 React Router의 `Link` 등 임의의 컴포넌트를 주입할 수 있고,
8
+ * 주입된 컴포넌트의 전용 props(예: next/link의 `prefetch`)도 타입 추론됩니다.
8
9
  *
9
10
  * @component
10
11
  * @param {Object} props - TextLink 컴포넌트의 props
@@ -22,9 +23,9 @@
22
23
  * <TextLink href="/about" text="소개 페이지로 이동" />
23
24
  *
24
25
  * @example
25
- * // Next.js Link와 함께 사용
26
+ * // Next.js Link와 함께 사용 — prefetch 등 Link 전용 prop도 타입 추론됨
26
27
  * import Link from 'next/link';
27
- * <TextLink as={Link} href="/about" text="소개" />
28
+ * <TextLink as={Link} href="/about" text="소개" prefetch={false} />
28
29
  *
29
30
  * @example
30
31
  * // 외부 링크
@@ -34,5 +35,5 @@
34
35
  * target="_blank"
35
36
  * rel="noopener noreferrer"
36
37
  * />
37
- */(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}exports.TextLink=o=>{var{as:l="a",href:s,text:a,leadingIcon:u,trailingIcon:f,isTextSmall:O=!1,isGray:b=!1,isUnderline:y=!1,className:p}=o,g=c(o,["as","href","text","leadingIcon","trailingIcon","isTextSmall","isGray","isUnderline","className"]);/*#__PURE__*/
38
- return e.jsx(l,i(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){n(e,t,r[t])}))}return e}({href:s,className:t.twMerge("flex min-h-6 w-fit items-center justify-center",O?"gap-x-0.5":"gap-x-1",p)},g),{children:/*#__PURE__*/e.jsx(r.TextWithIcons,{text:a,leadingIcon:u,trailingIcon:f,isTextSmall:O,isUnderline:y,isGray:b})}))};
38
+ */(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}exports.TextLink=o=>{var{as:l,href:s,text:a,leadingIcon:u,trailingIcon:f,isTextSmall:O=!1,isGray:b=!1,isUnderline:y=!1,className:p}=o,g=c(o,["as","href","text","leadingIcon","trailingIcon","isTextSmall","isGray","isUnderline","className"]);const j=null!=l?l:"a";/*#__PURE__*/
39
+ return e.jsx(j,i(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){n(e,t,r[t])}))}return e}({href:s,className:t.twMerge("flex min-h-6 w-fit items-center justify-center",O?"gap-x-0.5":"gap-x-1",p)},g),{children:/*#__PURE__*/e.jsx(r.TextWithIcons,{text:a,leadingIcon:u,trailingIcon:f,isTextSmall:O,isUnderline:y,isGray:b})}))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wishket/design-system",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "description": "Wishket Design System",
6
6
  "main": "dist/index.js",