@1d1s/design-system 0.2.24 → 0.2.26
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/AvatarImagePicker/AvatarImagePicker.d.ts +24 -0
- package/dist/components/AvatarImagePicker/AvatarImagePicker.stories.d.ts +7 -0
- package/dist/components/AvatarImagePicker/index.d.ts +1 -0
- package/dist/components/GoalAddList/GoalAddList.d.ts +2 -1
- package/dist/components/ImagePicker/ImagePicker.d.ts +35 -15
- package/dist/components/ImagePicker/ImagePicker.stories.d.ts +1 -0
- package/dist/components/Layout/Layout.d.ts +69 -0
- package/dist/components/Layout/Layout.stories.d.ts +7 -0
- package/dist/components/Layout/LayoutContext.d.ts +12 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Profile/Profile.d.ts +37 -0
- package/dist/components/Profile/Profile.stories.d.ts +12 -0
- package/dist/components/Profile/index.d.ts +1 -0
- package/dist/components/index.d.ts +3 -5
- package/dist/index.es.js +3737 -3993
- package/dist/index.umd.js +12 -12
- package/package.json +1 -1
- package/dist/components/ChallengeCard/ChallengeCard.d.ts +0 -23
- package/dist/components/ChallengeCard/ChallengeCard.stories.d.ts +0 -15
- package/dist/components/ChallengeCard/index.d.ts +0 -1
- package/dist/components/ChallengeListItem/ChallengeListItem.d.ts +0 -19
- package/dist/components/ChallengeListItem/ChallengeListItem.stories.d.ts +0 -14
- package/dist/components/ChallengeListItem/index.d.ts +0 -1
- package/dist/components/DiaryCard/DiaryCard.d.ts +0 -23
- package/dist/components/DiaryCard/DiaryCard.stories.d.ts +0 -9
- package/dist/components/DiaryCard/index.d.ts +0 -1
- package/dist/components/DiaryListItem/DiaryListItem.d.ts +0 -22
- package/dist/components/DiaryListItem/DiaryListItem.stories.d.ts +0 -11
- package/dist/components/DiaryListItem/index.d.ts +0 -1
- package/dist/components/UserListItem/UserListItem.d.ts +0 -10
- package/dist/components/UserListItem/UserListItem.stories.d.ts +0 -7
- package/dist/components/UserListItem/index.d.ts +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface AvatarImagePickerProps extends Omit<React.ComponentPropsWithoutRef<"input">, "size"> {
|
|
3
|
+
/** 원형 이미지 영역 지름(px) */
|
|
4
|
+
size?: number;
|
|
5
|
+
/** 초기 이미지 URL */
|
|
6
|
+
defaultImageUrl?: string;
|
|
7
|
+
/** 하단 변경 버튼 텍스트 */
|
|
8
|
+
changeLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AvatarImagePicker
|
|
12
|
+
* 이미지 업로드 및 미리보기를 위한 컴포넌트
|
|
13
|
+
*
|
|
14
|
+
* @param onChange 파일 선택 시 호출되는 콜백 함수(optional)
|
|
15
|
+
* @param size 원형 이미지 영역 지름(px), 기본값 300
|
|
16
|
+
* @param defaultImageUrl 초기 이미지 URL
|
|
17
|
+
* @param changeLabel 하단 변경 버튼 텍스트(기본값: Change)
|
|
18
|
+
*
|
|
19
|
+
* @example 기본 사용
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <AvatarImagePicker onChange={(e) => console.log(e.target.files)} />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function AvatarImagePicker({ onChange, size, defaultImageUrl, changeLabel, ...props }: AvatarImagePickerProps): React.ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { AvatarImagePicker } from './AvatarImagePicker';
|
|
3
|
+
declare const meta: Meta<typeof AvatarImagePicker>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AvatarImagePicker>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithImage: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AvatarImagePicker';
|
|
@@ -7,9 +7,10 @@ export interface GoalAddListProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
addOnBlur?: boolean;
|
|
9
9
|
inputAriaLabel?: string;
|
|
10
|
+
maxGoals?: number;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* GoalAddList
|
|
13
14
|
* 목표 문자열 목록을 보여주고 하단 입력창에서 Enter로 새 목표를 추가하는 컴포넌트.
|
|
14
15
|
*/
|
|
15
|
-
export declare function GoalAddList({ goals, defaultGoals, onGoalsChange, placeholder, disabled, addOnBlur, inputAriaLabel, className, ...props }: GoalAddListProps): React.ReactElement;
|
|
16
|
+
export declare function GoalAddList({ goals, defaultGoals, onGoalsChange, placeholder, disabled, addOnBlur, inputAriaLabel, maxGoals, className, ...props }: GoalAddListProps): React.ReactElement;
|
|
@@ -1,24 +1,44 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export interface ImagePickerProps
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
2
|
+
export interface ImagePickerProps {
|
|
3
|
+
/** 현재 미리보기 이미지 URL (blob: / data: / https: 모두 가능) */
|
|
4
|
+
previewUrl?: string;
|
|
5
|
+
/** 파일 선택 시 호출되는 콜백 */
|
|
6
|
+
onSelectFile: (file: File) => void;
|
|
7
|
+
/** 선택 해제 버튼 클릭 시 호출되는 콜백 */
|
|
8
|
+
onClear?: () => void;
|
|
9
|
+
/** 이미지 미선택 시 안내 텍스트 (기본값: "썸네일 영역을 클릭해 이미지를 선택하세요.") */
|
|
10
|
+
placeholderTitle?: string;
|
|
11
|
+
/** 이미지 미선택 시 보조 안내 텍스트 (기본값: "또는 이미지를 드래그해서 놓아주세요.") */
|
|
12
|
+
placeholderSubtitle?: string;
|
|
13
|
+
/** 하단 도움말 텍스트 (기본값: "JPG, PNG, GIF 파일을 업로드할 수 있습니다.") */
|
|
14
|
+
helperText?: string;
|
|
15
|
+
/** 선택 해제 버튼 텍스트 (기본값: "선택 해제") */
|
|
16
|
+
clearLabel?: string;
|
|
17
|
+
/** 추가 className */
|
|
18
|
+
className?: string;
|
|
9
19
|
}
|
|
10
20
|
/**
|
|
11
21
|
* ImagePicker
|
|
12
|
-
*
|
|
22
|
+
* 일지 썸네일 이미지 선택 컴포넌트
|
|
13
23
|
*
|
|
14
|
-
*
|
|
15
|
-
* @param size 원형 이미지 영역 지름(px), 기본값 300
|
|
16
|
-
* @param defaultImageUrl 초기 이미지 URL
|
|
17
|
-
* @param changeLabel 하단 변경 버튼 텍스트(기본값: Change)
|
|
24
|
+
* 클릭 또는 드래그 앤 드롭으로 이미지를 선택할 수 있습니다.
|
|
18
25
|
*
|
|
19
|
-
* @
|
|
26
|
+
* @param previewUrl 현재 미리보기 이미지 URL
|
|
27
|
+
* @param onSelectFile 파일 선택 시 호출되는 콜백
|
|
28
|
+
* @param onClear 선택 해제 버튼 클릭 시 호출되는 콜백
|
|
29
|
+
* @param placeholderTitle 이미지 미선택 시 안내 텍스트
|
|
30
|
+
* @param placeholderSubtitle 이미지 미선택 시 보조 안내 텍스트
|
|
31
|
+
* @param helperText 하단 도움말 텍스트
|
|
32
|
+
* @param clearLabel 선택 해제 버튼 텍스트
|
|
33
|
+
* @param className 추가 className
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
20
36
|
* ```tsx
|
|
21
|
-
* <ImagePicker
|
|
37
|
+
* <ImagePicker
|
|
38
|
+
* previewUrl={previewUrl}
|
|
39
|
+
* onSelectFile={(file) => setFile(file)}
|
|
40
|
+
* onClear={() => setFile(null)}
|
|
41
|
+
* />
|
|
22
42
|
* ```
|
|
23
43
|
*/
|
|
24
|
-
export declare function ImagePicker({
|
|
44
|
+
export declare function ImagePicker({ previewUrl, onSelectFile, onClear, placeholderTitle, placeholderSubtitle, helperText, clearLabel, className, }: ImagePickerProps): React.ReactElement;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface AppLayoutProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* AppLayout
|
|
8
|
+
* 전체 페이지의 최상위 래퍼 컴포넌트.
|
|
9
|
+
* `AppLayoutHeader`, `AppLayoutBody`와 함께 사용합니다.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <AppLayout>
|
|
14
|
+
* <AppLayoutHeader>
|
|
15
|
+
* <AppHeader ... />
|
|
16
|
+
* </AppLayoutHeader>
|
|
17
|
+
* <AppLayoutBody sidebar={<AppLayoutSidebar>...</AppLayoutSidebar>}>
|
|
18
|
+
* {children}
|
|
19
|
+
* </AppLayoutBody>
|
|
20
|
+
* </AppLayout>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function AppLayout({ children, className, }: AppLayoutProps): React.ReactElement;
|
|
24
|
+
export interface AppLayoutHeaderProps {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* AppLayoutHeader
|
|
30
|
+
* 화면 상단에 sticky하게 고정되는 헤더 슬롯.
|
|
31
|
+
*/
|
|
32
|
+
export declare function AppLayoutHeader({ children, className, }: AppLayoutHeaderProps): React.ReactElement;
|
|
33
|
+
export interface AppLayoutBodyProps {
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
/** 전달 시 오른쪽에 사이드바 열 추가 (lg 이상에서만 표시) */
|
|
36
|
+
sidebar?: React.ReactNode;
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* AppLayoutBody
|
|
41
|
+
* 메인 콘텐츠 영역. `sidebar` prop을 전달하면 lg 이상에서 오른쪽 사이드바 열이 추가됩니다.
|
|
42
|
+
*/
|
|
43
|
+
export declare function AppLayoutBody({ children, sidebar, className, }: AppLayoutBodyProps): React.ReactElement;
|
|
44
|
+
export interface AppLayoutSidebarProps {
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
/** sticky top 위치 — 헤더가 있으면 "top-28", 없으면 "top-6" */
|
|
47
|
+
stickyTop?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* AppLayoutSidebar
|
|
52
|
+
* 데스크톱(lg 이상)에서 오른쪽에 sticky하게 고정되는 사이드바 슬롯.
|
|
53
|
+
* `AppLayoutBody`의 `sidebar` prop으로 전달합니다.
|
|
54
|
+
*/
|
|
55
|
+
export declare function AppLayoutSidebar({ children, stickyTop, className, }: AppLayoutSidebarProps): React.ReactElement;
|
|
56
|
+
export interface AppLayoutOverlayProps {
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
/** 오버레이 표시 여부 (opacity 트랜지션 적용) */
|
|
59
|
+
open: boolean;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* AppLayoutOverlay
|
|
64
|
+
* 화면 우측 상단에 fixed로 표시되는 오버레이 패널.
|
|
65
|
+
* 주로 모바일에서 프로필 클릭 시 나타나는 사이드바에 사용합니다.
|
|
66
|
+
*
|
|
67
|
+
* 마운트/언마운트는 부모에서 관리하고, `open` prop으로 fade를 제어합니다.
|
|
68
|
+
*/
|
|
69
|
+
export declare function AppLayoutOverlay({ children, open, className, }: AppLayoutOverlayProps): React.ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface AppLayoutContextValue {
|
|
3
|
+
/** 오른쪽 사이드바가 렌더링되어 있는지 여부 */
|
|
4
|
+
hasRightSidebar: boolean;
|
|
5
|
+
/** 오른쪽 사이드바가 접혀있는지 여부 */
|
|
6
|
+
isRightSidebarCollapsed: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function AppLayoutProvider({ value, children, }: {
|
|
9
|
+
value: AppLayoutContextValue;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}): React.ReactElement;
|
|
12
|
+
export declare function useAppLayoutContext(): AppLayoutContextValue;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type ProfileSize = "sm" | "md" | "lg";
|
|
3
|
+
type ProfileLayout = "horizontal" | "vertical";
|
|
4
|
+
export interface ProfileProps {
|
|
5
|
+
/** 닉네임 */
|
|
6
|
+
nickname: string;
|
|
7
|
+
/** 프로필 이미지 URL */
|
|
8
|
+
imageUrl?: string;
|
|
9
|
+
/** 크기 (기본값: md) */
|
|
10
|
+
size?: ProfileSize;
|
|
11
|
+
/** 레이아웃 방향 (기본값: horizontal) */
|
|
12
|
+
layout?: ProfileLayout;
|
|
13
|
+
/** 닉네임 아래(vertical) 또는 옆(horizontal)에 표시되는 상태 텍스트 */
|
|
14
|
+
statusText?: string;
|
|
15
|
+
/** 클릭 핸들러 — 전달 시 버튼으로 렌더링됩니다 */
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Profile
|
|
21
|
+
* 프로필 사진과 닉네임을 함께 보여주는 컴포넌트.
|
|
22
|
+
*
|
|
23
|
+
* @param nickname 닉네임
|
|
24
|
+
* @param imageUrl 프로필 이미지 URL
|
|
25
|
+
* @param size 크기: sm | md | lg (기본값: md)
|
|
26
|
+
* @param layout 방향: horizontal | vertical (기본값: horizontal)
|
|
27
|
+
* @param statusText 닉네임 옆/아래에 표시되는 상태 텍스트
|
|
28
|
+
* @param onClick 전달 시 버튼으로 렌더링
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Profile nickname="홍길동" imageUrl="/profile.jpg" size="md" />
|
|
33
|
+
* <Profile nickname="홍길동" statusText="온라인" layout="vertical" size="lg" onClick={() => router.push('/profile')} />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function Profile({ nickname, imageUrl, size, layout, statusText, onClick, className, }: ProfileProps): React.ReactElement;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Profile } from './Profile';
|
|
3
|
+
declare const meta: Meta<typeof Profile>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Profile>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithStatus: Story;
|
|
8
|
+
export declare const WithImage: Story;
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
export declare const Vertical: Story;
|
|
11
|
+
export declare const VerticalWithStatus: Story;
|
|
12
|
+
export declare const Clickable: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Profile';
|
|
@@ -3,8 +3,6 @@ export * from './AppHeader';
|
|
|
3
3
|
export * from './BannerCarousel';
|
|
4
4
|
export * from './Button';
|
|
5
5
|
export * from './Calendar';
|
|
6
|
-
export * from './ChallengeCard';
|
|
7
|
-
export * from './ChallengeListItem';
|
|
8
6
|
export * from './CheckContainer';
|
|
9
7
|
export * from './CheckList';
|
|
10
8
|
export * from './Checkbox';
|
|
@@ -12,18 +10,19 @@ export * from './CircleAvatar';
|
|
|
12
10
|
export * from './CircularProgress';
|
|
13
11
|
export * from './DatePicker';
|
|
14
12
|
export * from './Dialog';
|
|
15
|
-
export * from './DiaryCard';
|
|
16
|
-
export * from './DiaryListItem';
|
|
17
13
|
export * from './Dropdown';
|
|
18
14
|
export * from './GoalAddList';
|
|
19
15
|
export { Icon } from './Icons/Icon';
|
|
20
16
|
export type { IconName, IconProps } from './Icons/Icon';
|
|
17
|
+
export * from './AvatarImagePicker';
|
|
21
18
|
export * from './ImagePlaceholder';
|
|
22
19
|
export * from './ImagePicker';
|
|
23
20
|
export * from './InfoButton';
|
|
21
|
+
export * from './Layout';
|
|
24
22
|
export * from './Text';
|
|
25
23
|
export * from './PageWatermark';
|
|
26
24
|
export * from './Pagination';
|
|
25
|
+
export * from './Profile';
|
|
27
26
|
export * from './ProgressBar';
|
|
28
27
|
export * from './RightSidebar';
|
|
29
28
|
export * from './ScheduleCalendar';
|
|
@@ -35,4 +34,3 @@ export * from './TextField';
|
|
|
35
34
|
export * from './Toggle';
|
|
36
35
|
export * from './ToggleGroup';
|
|
37
36
|
export * from './Tooltip';
|
|
38
|
-
export * from './UserListItem';
|