@uniai-fe/uds-primitives 0.3.59 → 0.4.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/README.md +209 -3
- package/dist/styles.css +91 -76
- package/package.json +1 -1
- package/src/components/alternate/index.tsx +7 -1
- package/src/components/alternate/markup/Label.tsx +10 -5
- package/src/components/alternate/markup/empty/Data.tsx +9 -6
- package/src/components/alternate/markup/index.tsx +8 -0
- package/src/components/alternate/markup/loading/Default.tsx +10 -6
- package/src/components/alternate/markup/loading/Icon.tsx +11 -4
- package/src/components/alternate/types/index.ts +75 -2
- package/src/components/badge/index.tsx +4 -1
- package/src/components/badge/markup/Badge.tsx +10 -8
- package/src/components/badge/types/index.ts +26 -2
- package/src/components/button/index.tsx +6 -1
- package/src/components/button/markup/Base.tsx +20 -18
- package/src/components/button/markup/Rounded.tsx +7 -4
- package/src/components/button/markup/Text.tsx +7 -4
- package/src/components/calendar/index.tsx +8 -0
- package/src/components/calendar/markup/index.tsx +7 -7
- package/src/components/carousel/index.tsx +8 -0
- package/src/components/carousel/markup/index.tsx +9 -0
- package/src/components/checkbox/index.tsx +7 -0
- package/src/components/chip/index.tsx +7 -1
- package/src/components/chip/markup/index.tsx +9 -0
- package/src/components/divider/index.tsx +4 -0
- package/src/components/divider/markup/Divider.tsx +11 -7
- package/src/components/divider/types/index.ts +1 -0
- package/src/components/divider/types/props.ts +27 -0
- package/src/components/drawer/index.tsx +7 -0
- package/src/components/drawer/markup/index.tsx +6 -0
- package/src/components/dropdown/index.tsx +7 -0
- package/src/components/dropdown/markup/Template.tsx +9 -2
- package/src/components/dropdown/markup/foundation/Container.tsx +30 -12
- package/src/components/dropdown/markup/index.tsx +9 -10
- package/src/components/dropdown/types/base.ts +13 -0
- package/src/components/dropdown/types/props.ts +19 -2
- package/src/components/form/index.tsx +7 -0
- package/src/components/form/markup/index.tsx +6 -2
- package/src/components/info-box/index.tsx +7 -0
- package/src/components/info-box/markup/InfoBox.tsx +1 -1
- package/src/components/info-box/markup/index.ts +6 -0
- package/src/components/info-box/types/props.ts +2 -2
- package/src/components/input/index.tsx +6 -1
- package/src/components/input/markup/foundation/Input.tsx +2 -2
- package/src/components/input/styles/foundation.scss +57 -54
- package/src/components/input/types/foundation.ts +1 -1
- package/src/components/navigation/index.tsx +7 -0
- package/src/components/navigation/markup/index.tsx +6 -0
- package/src/components/pagination/index.tsx +6 -1
- package/src/components/pagination/markup/index.tsx +7 -0
- package/src/components/pop-over/index.tsx +7 -0
- package/src/components/pop-over/markup/index.tsx +5 -4
- package/src/components/radio/index.tsx +5 -1
- package/src/components/scrollbar/hooks/index.ts +1 -1
- package/src/components/scrollbar/index.tsx +1 -1
- package/src/components/scrollbar/markup/index.tsx +1 -1
- package/src/components/scrollbar/types/index.ts +1 -1
- package/src/components/scrollbar/utils/index.ts +1 -1
- package/src/components/segmented-control/index.tsx +5 -1
- package/src/components/segmented-control/markup/index.ts +6 -0
- package/src/components/select/index.tsx +6 -1
- package/src/components/select/markup/Default.tsx +10 -13
- package/src/components/select/markup/foundation/Selected.tsx +31 -26
- package/src/components/select/markup/index.tsx +1 -1
- package/src/components/select/markup/multiple/Multiple.tsx +32 -15
- package/src/components/select/styles/select.scss +15 -6
- package/src/components/select/styles/variables.scss +4 -0
- package/src/components/select/types/multiple.ts +19 -0
- package/src/components/select/types/props.ts +19 -6
- package/src/components/select/utils/display.tsx +41 -0
- package/src/components/select/utils/index.ts +1 -4
- package/src/components/slot/index.tsx +7 -0
- package/src/components/slot/markup/index.tsx +6 -0
- package/src/components/spinner/hooks/index.ts +1 -1
- package/src/components/spinner/index.tsx +1 -1
- package/src/components/spinner/markup/index.tsx +1 -1
- package/src/components/spinner/types/index.ts +1 -1
- package/src/components/spinner/utils/index.ts +1 -1
- package/src/components/tab/index.tsx +5 -1
- package/src/components/tab/markup/index.tsx +8 -0
- package/src/components/table/index.tsx +3 -0
- package/src/components/tooltip/index.tsx +7 -0
- package/src/components/tooltip/markup/index.tsx +7 -6
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Alternate; empty/loading fallback 유닛 카테고리 배럴
|
|
3
|
+
* @desc
|
|
4
|
+
* - `Alternate.EmptyData`: 빈 데이터 안내 레이아웃이다.
|
|
5
|
+
* - `Alternate.LoadingDefault`: 로딩 아이콘과 안내 문구를 함께 렌더링한다.
|
|
6
|
+
* - `Alternate.LoadingIcon`: 단독 스피너 아이콘이다.
|
|
7
|
+
* - `Alternate.Text`: fallback 문구 스타일 슬롯이다.
|
|
3
8
|
*/
|
|
4
9
|
export { default as Alternate } from "./markup";
|
|
10
|
+
export type * from "./types";
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Slot } from "../../slot";
|
|
2
|
+
import type { AlternateTextProps } from "../types";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
/**
|
|
5
|
+
* Alternate Text; fallback 문구 슬롯
|
|
6
|
+
* @component
|
|
7
|
+
* @param {AlternateTextProps} props
|
|
8
|
+
* @param {React.ReactNode} props.children 렌더링할 문구 콘텐츠다.
|
|
9
|
+
* @example
|
|
10
|
+
* <Alternate.Text>데이터가 없습니다.</Alternate.Text>
|
|
11
|
+
*/
|
|
12
|
+
export default function AlternateText({ children }: AlternateTextProps) {
|
|
8
13
|
return <Slot.Text className="alternate-text">{children}</Slot.Text>;
|
|
9
14
|
}
|
|
@@ -2,20 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import AlternateText from "../Label";
|
|
5
|
+
import type { AlternateEmptyDataProps } from "../../types";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Alternate EmptyData; 빈 데이터 안내 레이아웃
|
|
8
9
|
* @component
|
|
10
|
+
* @param {AlternateEmptyDataProps} props
|
|
11
|
+
* @param {string} [props.className] 루트 className override다.
|
|
12
|
+
* @param {"vertical" | "horizontal"} [props.direction="vertical"] 아이콘/문구 배치 방향이다.
|
|
13
|
+
* @param {React.ReactNode} [props.children] 안내 문구 콘텐츠다. 비어 있으면 기본 문구를 사용한다.
|
|
14
|
+
* @example
|
|
15
|
+
* <Alternate.EmptyData direction="horizontal">데이터가 없습니다.</Alternate.EmptyData>
|
|
9
16
|
*/
|
|
10
17
|
export default function AlternateEmptyData({
|
|
11
18
|
className,
|
|
12
19
|
direction = "vertical",
|
|
13
20
|
children: text,
|
|
14
|
-
}:
|
|
15
|
-
className: string;
|
|
16
|
-
direction: "vertical" | "horizontal";
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
}>) {
|
|
21
|
+
}: AlternateEmptyDataProps) {
|
|
19
22
|
const directionClass =
|
|
20
23
|
direction === "horizontal" ? "is-horizontal" : "is-vertical";
|
|
21
24
|
|
|
@@ -3,6 +3,14 @@ import AlternateText from "./Label";
|
|
|
3
3
|
import AlternateLoadingDefault from "./loading/Default";
|
|
4
4
|
import AlternateLoadingIcon from "./loading/Icon";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Alternate; empty/loading fallback namespace
|
|
8
|
+
* @desc
|
|
9
|
+
* - `Alternate.EmptyData`: 빈 데이터 안내 레이아웃이다.
|
|
10
|
+
* - `Alternate.LoadingDefault`: 로딩 안내 레이아웃이다.
|
|
11
|
+
* - `Alternate.LoadingIcon`: 단독 스피너 아이콘이다.
|
|
12
|
+
* - `Alternate.Text`: 안내 문구 슬롯이다.
|
|
13
|
+
*/
|
|
6
14
|
const Alternate = {
|
|
7
15
|
EmptyData: AlternateEmptyData,
|
|
8
16
|
LoadingDefault: AlternateLoadingDefault,
|
|
@@ -3,25 +3,29 @@
|
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import AlternateLoadingIcon from "./Icon";
|
|
5
5
|
import AlternateText from "../Label";
|
|
6
|
+
import type { AlternateLoadingDefaultProps } from "../../types";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Alternate LoadingDefault; 로딩 안내 레이아웃
|
|
9
10
|
* @component
|
|
11
|
+
* @param {AlternateLoadingDefaultProps} props
|
|
12
|
+
* @param {"vertical" | "horizontal"} [props.direction="vertical"] 아이콘/문구 배치 방향이다.
|
|
13
|
+
* @param {React.ReactNode} [props.children] 안내 문구 콘텐츠다. 비어 있으면 기본 문구를 사용한다.
|
|
14
|
+
* @example
|
|
15
|
+
* <Alternate.LoadingDefault>데이터를 불러오는 중입니다.</Alternate.LoadingDefault>
|
|
10
16
|
*/
|
|
11
17
|
export default function AlternateLoadingDefault({
|
|
12
18
|
direction = "vertical",
|
|
13
19
|
children: text,
|
|
14
|
-
}:
|
|
15
|
-
direction: "vertical" | "horizontal";
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
}>) {
|
|
20
|
+
}: AlternateLoadingDefaultProps) {
|
|
18
21
|
const directionClass =
|
|
19
22
|
direction === "horizontal" ? "is-horizontal" : "is-vertical";
|
|
20
23
|
|
|
21
24
|
return (
|
|
22
25
|
<div className={clsx("alternate loading", directionClass)}>
|
|
23
26
|
<AlternateLoadingIcon direction={direction} />
|
|
24
|
-
{
|
|
27
|
+
{/* string/number만 Slot.Text로 감싸고, 그 외 ReactNode는 그대로 렌더링한다. */}
|
|
28
|
+
{["string", "number", "undefined"].includes(typeof text) ? (
|
|
25
29
|
<AlternateText>{text || "데이터를 불러오는 중입니다."}</AlternateText>
|
|
26
30
|
) : (
|
|
27
31
|
text
|
|
@@ -4,14 +4,21 @@ import { clsx } from "clsx";
|
|
|
4
4
|
import SpinnerSmallIcon from "../../img/spinner-small-24x24.svg";
|
|
5
5
|
import SpinnerMediumIcon from "../../img/spinner-medium-36x36.svg";
|
|
6
6
|
import SpinnerLargeIcon from "../../img/spinner-large-52x52.svg";
|
|
7
|
+
import type { AlternateLoadingIconProps } from "../../types";
|
|
7
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Alternate LoadingIcon; 단독 스피너 아이콘
|
|
11
|
+
* @component
|
|
12
|
+
* @param {AlternateLoadingIconProps} props
|
|
13
|
+
* @param {"small" | "medium" | "large"} [props.size="small"] 로딩 아이콘 스케일이다.
|
|
14
|
+
* @param {"vertical" | "horizontal"} [props.direction] 부모 레이아웃 방향 클래스 동기화용 값이다.
|
|
15
|
+
* @example
|
|
16
|
+
* <Alternate.LoadingIcon size="medium" />
|
|
17
|
+
*/
|
|
8
18
|
export default function AlternateLoadingIcon({
|
|
9
19
|
size = "small",
|
|
10
20
|
direction,
|
|
11
|
-
}: {
|
|
12
|
-
size?: "small" | "medium" | "large";
|
|
13
|
-
direction?: "vertical" | "horizontal";
|
|
14
|
-
}) {
|
|
21
|
+
}: AlternateLoadingIconProps) {
|
|
15
22
|
const directionClass =
|
|
16
23
|
direction === "horizontal" ? "is-horizontal" : "is-vertical";
|
|
17
24
|
const sizeClass = size ? `is-${size}` : undefined;
|
|
@@ -1,4 +1,77 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Alternate Direction; fallback 레이아웃 방향 축
|
|
5
|
+
* @typedef {"vertical" | "horizontal"} AlternateDirection
|
|
3
6
|
*/
|
|
4
|
-
export
|
|
7
|
+
export type AlternateDirection = "vertical" | "horizontal";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Alternate Loading Icon Size; 로딩 아이콘 스케일 축
|
|
11
|
+
* @typedef {"small" | "medium" | "large"} AlternateLoadingIconSize
|
|
12
|
+
*/
|
|
13
|
+
export type AlternateLoadingIconSize = "small" | "medium" | "large";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Alternate Text Props; fallback 문구 슬롯 props
|
|
17
|
+
* @property {ReactNode} children 렌더링할 문구 콘텐츠다.
|
|
18
|
+
*/
|
|
19
|
+
export interface AlternateTextProps {
|
|
20
|
+
/**
|
|
21
|
+
* 렌더링할 문구 콘텐츠다.
|
|
22
|
+
*/
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Alternate Empty Data Props; 빈 데이터 안내 레이아웃 props
|
|
28
|
+
* @property {string} [className] 루트 className override다.
|
|
29
|
+
* @property {"vertical" | "horizontal"} [direction] 아이콘/문구 배치 방향이다.
|
|
30
|
+
* @property {ReactNode} [children] 안내 문구 콘텐츠다.
|
|
31
|
+
*/
|
|
32
|
+
export interface AlternateEmptyDataProps {
|
|
33
|
+
/**
|
|
34
|
+
* 루트 className override다.
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* 아이콘/문구 배치 방향이다.
|
|
39
|
+
*/
|
|
40
|
+
direction?: AlternateDirection;
|
|
41
|
+
/**
|
|
42
|
+
* 안내 문구 콘텐츠다.
|
|
43
|
+
*/
|
|
44
|
+
children?: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Alternate Loading Default Props; 로딩 안내 레이아웃 props
|
|
49
|
+
* @property {"vertical" | "horizontal"} [direction] 아이콘/문구 배치 방향이다.
|
|
50
|
+
* @property {ReactNode} [children] 안내 문구 콘텐츠다.
|
|
51
|
+
*/
|
|
52
|
+
export interface AlternateLoadingDefaultProps {
|
|
53
|
+
/**
|
|
54
|
+
* 아이콘/문구 배치 방향이다.
|
|
55
|
+
*/
|
|
56
|
+
direction?: AlternateDirection;
|
|
57
|
+
/**
|
|
58
|
+
* 안내 문구 콘텐츠다.
|
|
59
|
+
*/
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Alternate Loading Icon Props; 단독 스피너 아이콘 props
|
|
65
|
+
* @property {"small" | "medium" | "large"} [size] 로딩 아이콘 스케일이다.
|
|
66
|
+
* @property {"vertical" | "horizontal"} [direction] 부모 레이아웃 방향 클래스 동기화용 값이다.
|
|
67
|
+
*/
|
|
68
|
+
export interface AlternateLoadingIconProps {
|
|
69
|
+
/**
|
|
70
|
+
* 로딩 아이콘 스케일이다.
|
|
71
|
+
*/
|
|
72
|
+
size?: AlternateLoadingIconSize;
|
|
73
|
+
/**
|
|
74
|
+
* 부모 레이아웃 방향 클래스 동기화용 값이다.
|
|
75
|
+
*/
|
|
76
|
+
direction?: AlternateDirection;
|
|
77
|
+
}
|
|
@@ -4,17 +4,19 @@ import { composeBadgeClassName } from "../utils";
|
|
|
4
4
|
import { Slot } from "../../slot";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Badge
|
|
7
|
+
* Badge; status/info label 렌더링 leaf 컴포넌트
|
|
8
8
|
* @component
|
|
9
9
|
* @param {BadgeProps} props
|
|
10
|
-
* @param {"xsmall" | "small"} [props.size="xsmall"] 토큰 size
|
|
11
|
-
* @param {"fill" | "outlined" | "dot"} [props.style="fill"] 시각
|
|
10
|
+
* @param {"xsmall" | "small"} [props.size="xsmall"] 토큰 size 축이다.
|
|
11
|
+
* @param {"fill" | "outlined" | "dot"} [props.style="fill"] 시각 스타일 축이다.
|
|
12
12
|
* @param {"primary" | "secondary" | "tertiary" | "gray" | "green" | "yellow" | "orange" | "red"} [props.intent="primary"]
|
|
13
|
-
* fill/outlined 스타일에서 사용되는 intent
|
|
14
|
-
* @param {"primary" | "feedback"} [props.tone="primary"] dot
|
|
15
|
-
* @param {React.ReactNode} [props.children] 라벨
|
|
16
|
-
* @param {string} [props.className] figure className
|
|
17
|
-
* @param {React.CSSProperties} [props.inlineStyle] figure inline style
|
|
13
|
+
* fill/outlined 스타일에서 사용되는 intent 축이다.
|
|
14
|
+
* @param {"primary" | "feedback"} [props.tone="primary"] dot 스타일 전용 tone 축이다.
|
|
15
|
+
* @param {React.ReactNode} [props.children] 라벨 텍스트다. dot 스타일에서 생략하면 점만 렌더링한다.
|
|
16
|
+
* @param {string} [props.className] figure root className override다.
|
|
17
|
+
* @param {React.CSSProperties} [props.inlineStyle] figure root inline style이다.
|
|
18
|
+
* @example
|
|
19
|
+
* <Badge style="fill" intent="primary">승인됨</Badge>
|
|
18
20
|
*/
|
|
19
21
|
const Badge = forwardRef<HTMLElementTagNameMap["figure"], BadgeProps>(
|
|
20
22
|
(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import type { CSSProperties, ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
export const BADGE_SIZES = ["xsmall", "small"] as const;
|
|
4
4
|
export const BADGE_STYLES = ["fill", "outlined", "dot"] as const;
|
|
@@ -21,6 +21,15 @@ export type BadgeTone = (typeof BADGE_TONES)[number];
|
|
|
21
21
|
|
|
22
22
|
type NativeFigureProps = Omit<ComponentPropsWithoutRef<"figure">, "style">;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Badge Props; status/info label badge public props
|
|
26
|
+
* @property {ReactNode} [children] 표시할 라벨이다. 생략하면 dot만 렌더링한다.
|
|
27
|
+
* @property {"xsmall" | "small"} [size] Figma size 축이다.
|
|
28
|
+
* @property {"fill" | "outlined" | "dot"} [style] badge 시각 스타일 축이다.
|
|
29
|
+
* @property {"primary" | "secondary" | "tertiary" | "gray" | "green" | "yellow" | "orange" | "red"} [intent] fill/outlined 변형의 색상 의도다.
|
|
30
|
+
* @property {"primary" | "feedback"} [tone] dot 변형 전용 tone 축이다.
|
|
31
|
+
* @property {CSSProperties} [inlineStyle] 원본 figure 요소에 적용할 inline style이다.
|
|
32
|
+
*/
|
|
24
33
|
export interface BadgeProps extends Omit<NativeFigureProps, "children"> {
|
|
25
34
|
/**
|
|
26
35
|
* 표시할 라벨. 생략하면 dot 스타일만 렌더링된다.
|
|
@@ -45,11 +54,26 @@ export interface BadgeProps extends Omit<NativeFigureProps, "children"> {
|
|
|
45
54
|
/**
|
|
46
55
|
* 원본 figure 요소에 적용할 인라인 스타일.
|
|
47
56
|
*/
|
|
48
|
-
inlineStyle?:
|
|
57
|
+
inlineStyle?: CSSProperties;
|
|
49
58
|
}
|
|
50
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Badge ClassName Options; badge root className 조합 입력값
|
|
62
|
+
* @property {"xsmall" | "small"} size badge size 축이다.
|
|
63
|
+
* @property {"fill" | "outlined" | "dot"} style badge style 축이다.
|
|
64
|
+
* @property {string} [className] 외부 className override다.
|
|
65
|
+
*/
|
|
51
66
|
export interface BadgeClassNameOptions {
|
|
67
|
+
/**
|
|
68
|
+
* badge size 축이다.
|
|
69
|
+
*/
|
|
52
70
|
size: BadgeSize;
|
|
71
|
+
/**
|
|
72
|
+
* badge style 축이다.
|
|
73
|
+
*/
|
|
53
74
|
style: BadgeStyle;
|
|
75
|
+
/**
|
|
76
|
+
* 외부 className override다.
|
|
77
|
+
*/
|
|
54
78
|
className?: string;
|
|
55
79
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Button; namespace 배럴 export
|
|
3
|
+
* @desc
|
|
4
|
+
* - `Button.Default`: fill/priority/size 축 기반 기본 버튼
|
|
5
|
+
* - `Button.Text`: text action 템플릿
|
|
6
|
+
* - `Button.Rounded`: round icon action 템플릿
|
|
7
|
+
* - `Button.Label`: button-label className 고정 래퍼
|
|
3
8
|
*/
|
|
4
9
|
import "./index.scss";
|
|
5
10
|
|
|
@@ -11,27 +11,29 @@ import {
|
|
|
11
11
|
} from "../../form/utils/form-field";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Button Component; Default action button
|
|
15
15
|
* @component
|
|
16
16
|
* @param {ButtonProps} props
|
|
17
|
-
* @param {ElementType} [props.as="button"]
|
|
18
|
-
* @param {React.ReactNode} [props.children]
|
|
19
|
-
* @param {
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* } [props.
|
|
25
|
-
* @param {"
|
|
26
|
-
* @param {
|
|
27
|
-
* @param {
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {boolean} [props.block=false] true면 width 100%.
|
|
30
|
-
* @param {boolean} [props.loading=false] true면 readonly 처리 + aria-busy.
|
|
17
|
+
* @param {ElementType} [props.as="button"] 렌더링할 요소.
|
|
18
|
+
* @param {React.ReactNode} [props.children] 문자열/숫자는 `.button-label`로 래핑하고, 그 외 ReactNode는 그대로 렌더링한다.
|
|
19
|
+
* @param {"solid-xlarge" | "solid-large" | "solid-medium" | "solid-small" | "outlined-xlarge" | "outlined-large" | "outlined-medium" | "outlined-small"} [props.scale] legacy fill/size fallback 식별자.
|
|
20
|
+
* @param {"solid" | "outlined"} props.fill 채움 스타일.
|
|
21
|
+
* @param {"xlarge" | "large" | "medium" | "small" | "table"} props.size 버튼 크기. `table`은 Table 셀 액션용 compact 규격이다.
|
|
22
|
+
* @param {"primary" | "secondary" | "tertiary"} props.priority semantic color priority.
|
|
23
|
+
* @param {"default" | "readonly" | "disabled"} [props.state="default"] 내부 상태. `disabled`/`loading`과 병합된다.
|
|
24
|
+
* @param {boolean} [props.block=false] true면 폭을 100%로 확장한다.
|
|
25
|
+
* @param {"full" | "fit" | "fill" | "auto" | number | string} [props.width] Form.Field width preset 또는 custom width.
|
|
26
|
+
* @param {boolean} [props.loading=false] true면 readonly 상태와 `aria-busy`를 강제한다.
|
|
27
|
+
* @param {React.ReactNode} [props.left] 라벨 왼쪽 콘텐츠.
|
|
28
|
+
* @param {React.ReactNode} [props.right] 라벨 오른쪽 콘텐츠.
|
|
31
29
|
* @param {string} [props.className] 추가 className.
|
|
32
|
-
* @param {"button" | "submit" | "reset"} [props.type="button"] button
|
|
33
|
-
* @param {boolean} [props.disabled] native disabled. state
|
|
34
|
-
* @param {"hover" | "pressed"} [props
|
|
30
|
+
* @param {"button" | "submit" | "reset"} [props.type="button"] `button` 태그일 때 native type.
|
|
31
|
+
* @param {boolean} [props.disabled] native disabled. `state`보다 우선한다.
|
|
32
|
+
* @param {"hover" | "pressed"} [props["data-user-action"]] Storybook 시각 상태 고정용 data attribute.
|
|
33
|
+
* @example
|
|
34
|
+
* <Button.Default fill="solid" size="medium" priority="primary">
|
|
35
|
+
* 확인
|
|
36
|
+
* </Button.Default>
|
|
35
37
|
*/
|
|
36
38
|
const ButtonDefault = forwardRef<HTMLElement, ButtonProps>(
|
|
37
39
|
(
|
|
@@ -4,12 +4,15 @@ import type { RoundButtonProps } from "../types";
|
|
|
4
4
|
import { ButtonDefault } from "./Base";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Button Component; Rounded action button
|
|
8
8
|
* @component
|
|
9
9
|
* @param {RoundButtonProps} props
|
|
10
|
-
* @param {"small" | "medium" | "large"} props.size
|
|
11
|
-
* @param {"primary" | "secondary" | "tertiary"} props.priority semantic color.
|
|
12
|
-
* @
|
|
10
|
+
* @param {"small" | "medium" | "large"} props.size 라운드 버튼 크기 축.
|
|
11
|
+
* @param {"primary" | "secondary" | "tertiary"} props.priority semantic color priority.
|
|
12
|
+
* @example
|
|
13
|
+
* <Button.Rounded size="small" priority="primary" aria-label="추가">
|
|
14
|
+
* <span aria-hidden="true">+</span>
|
|
15
|
+
* </Button.Rounded>
|
|
13
16
|
*/
|
|
14
17
|
const ButtonRounded = forwardRef<HTMLElement, RoundButtonProps>(
|
|
15
18
|
// 라운드 전용 템플릿도 fill/size/priority를 직접 주입해 공통 규칙을 따른다.
|
|
@@ -4,12 +4,15 @@ import type { TextButtonProps } from "../types";
|
|
|
4
4
|
import { ButtonDefault } from "./Base";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Button Component; Text action button
|
|
8
8
|
* @component
|
|
9
9
|
* @param {TextButtonProps} props
|
|
10
|
-
* @param {"small" | "medium" | "large"} props.size
|
|
11
|
-
* @param {"secondary" | "tertiary"} props.priority
|
|
12
|
-
* @
|
|
10
|
+
* @param {"small" | "medium" | "large"} props.size 텍스트 버튼 크기 축.
|
|
11
|
+
* @param {"secondary" | "tertiary"} props.priority 텍스트 버튼 priority 축.
|
|
12
|
+
* @example
|
|
13
|
+
* <Button.Text size="medium" priority="secondary">
|
|
14
|
+
* 자세히 보기
|
|
15
|
+
* </Button.Text>
|
|
13
16
|
*/
|
|
14
17
|
const ButtonText = forwardRef<HTMLElement, TextButtonProps>(
|
|
15
18
|
// 템플릿 레벨에서 fill/size/priority를 강제해 ButtonDefault 정책과 동기화한다.
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar; date picker 조합 카테고리 배럴
|
|
3
|
+
* @desc
|
|
4
|
+
* - `Calendar.Root`: trigger + popover + core 조합 템플릿이다.
|
|
5
|
+
* - `Calendar.Container`: Header/Body/Footer 레이아웃 컨테이너다.
|
|
6
|
+
* - `Calendar.Core`: Mantine DatePicker SOT 렌더러다.
|
|
7
|
+
* - `CalendarHooks`, `CalendarUtils`: 관련 hook/util namespace다.
|
|
8
|
+
*/
|
|
1
9
|
import "./index.scss";
|
|
2
10
|
|
|
3
11
|
export * from "./markup";
|
|
@@ -7,13 +7,13 @@ import CalendarRoot from "./Root";
|
|
|
7
7
|
import { CalendarIcon } from "./Icon";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Calendar namespace
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
13
|
-
* - Header
|
|
14
|
-
* - Body
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
10
|
+
* Calendar; date picker namespace
|
|
11
|
+
* @desc
|
|
12
|
+
* - `Calendar.Root`: trigger + popover + core 조합 템플릿이다.
|
|
13
|
+
* - `Calendar.Container`: Header/Body/Footer 레이아웃 컨테이너다.
|
|
14
|
+
* - `Calendar.Header`, `Calendar.Body`, `Calendar.Footer`: depth 고정 레이아웃 섹션이다.
|
|
15
|
+
* - `Calendar.Core`: Mantine DatePicker SOT 렌더러다.
|
|
16
|
+
* - `Calendar.Icon`: 입력/네비게이션 아이콘 namespace다.
|
|
17
17
|
*/
|
|
18
18
|
export const Calendar = {
|
|
19
19
|
Root: CalendarRoot,
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carousel; viewport scroll carousel 카테고리 배럴
|
|
3
|
+
* @desc
|
|
4
|
+
* - `Carousel.Provider`: viewport/track 상태 공유 루트다.
|
|
5
|
+
* - `Carousel.Track`: viewport + track 렌더러다.
|
|
6
|
+
* - `Carousel.Control`, `Carousel.Button.*`: 이동 제어 도구다.
|
|
7
|
+
* - `useCarousel`: provider context 접근 hook이다.
|
|
8
|
+
*/
|
|
1
9
|
import "./index.scss";
|
|
2
10
|
|
|
3
11
|
export * from "./markup";
|
|
@@ -6,6 +6,15 @@ import { CarouselPrevButton } from "./button/Prev";
|
|
|
6
6
|
import { CarouselProvider } from "./Provider";
|
|
7
7
|
import { CarouselTrack } from "./Track";
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Carousel; viewport scroll carousel namespace
|
|
11
|
+
* @desc
|
|
12
|
+
* - `Carousel.Provider`: viewport/track 상태 공유 루트다.
|
|
13
|
+
* - `Carousel.Container`: Provider + Control 프리셋이다.
|
|
14
|
+
* - `Carousel.Control`: Prev/Track/Next 조합 컨트롤이다.
|
|
15
|
+
* - `Carousel.Track`: viewport + track 렌더러다.
|
|
16
|
+
* - `Carousel.Button.Base|Prev|Next`: 이동 제어 leaf 버튼이다.
|
|
17
|
+
*/
|
|
9
18
|
export const Carousel = {
|
|
10
19
|
Provider: CarouselProvider,
|
|
11
20
|
Container: CarouselContainer,
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Chip; filter/assist/input chip 카테고리 배럴
|
|
3
|
+
* @desc
|
|
4
|
+
* - `Chip.Default`: style 분기 루트 컴포넌트다.
|
|
5
|
+
* - `Chip.ClickableStyle`: filter/assist button 렌더 전용 leaf다.
|
|
6
|
+
* - `Chip.InputStyle`: input figure 렌더 전용 leaf다.
|
|
7
|
+
* - `Chip.List`: chip 목록 템플릿이다.
|
|
8
|
+
* - `ChipProps`, `ChipListRootProps`, `ChipListItemData`: public contract 타입이다.
|
|
3
9
|
*/
|
|
4
10
|
import "./index.scss";
|
|
5
11
|
|
|
@@ -4,6 +4,15 @@ import ChipInputStyle from "./InputStyle";
|
|
|
4
4
|
import ChipLabel from "./Label";
|
|
5
5
|
import { ChipListRoot } from "./ListRoot";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Chip; filter/assist/input namespace
|
|
9
|
+
* @desc
|
|
10
|
+
* - `Chip.Default`: style 분기 루트 컴포넌트다.
|
|
11
|
+
* - `Chip.ClickableStyle`: filter/assist button 렌더 전용 leaf다.
|
|
12
|
+
* - `Chip.InputStyle`: input figure 렌더 전용 leaf다.
|
|
13
|
+
* - `Chip.Label`: chip 텍스트 슬롯이다.
|
|
14
|
+
* - `Chip.List`: chip 목록 템플릿이다.
|
|
15
|
+
*/
|
|
7
16
|
export const Chip = {
|
|
8
17
|
Default: ChipDefault,
|
|
9
18
|
ClickableStyle: ChipClickableStyle,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
|
+
import type { DividerProps } from "../types";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Divider; 수평/수직 구분선 마크업
|
|
6
|
+
* @component
|
|
7
|
+
* @param {DividerProps} props
|
|
8
|
+
* @param {string} [props.className] divider 루트 className
|
|
9
|
+
* @param {"horizontal" | "vertical"} [props.direction] 구분선 방향
|
|
10
|
+
* @example
|
|
11
|
+
* <Divider direction="horizontal" />
|
|
12
|
+
*/
|
|
13
|
+
export function Divider({ className, direction = "vertical" }: DividerProps) {
|
|
10
14
|
return <div className={clsx("divider", direction, className)}></div>;
|
|
11
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { DividerDirection, DividerProps } from "./props";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DividerDirection; divider 방향 축
|
|
5
|
+
* @typedef {"horizontal" | "vertical"} DividerDirection
|
|
6
|
+
*/
|
|
7
|
+
export type DividerDirection = "horizontal" | "vertical";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Divider Props; divider 루트 속성
|
|
11
|
+
* @property {string} [className] divider 루트 className
|
|
12
|
+
* @property {"horizontal" | "vertical"} [direction] 구분선 방향
|
|
13
|
+
* @see React.ComponentPropsWithoutRef<"div">
|
|
14
|
+
*/
|
|
15
|
+
export interface DividerProps extends Omit<
|
|
16
|
+
ComponentPropsWithoutRef<"div">,
|
|
17
|
+
"children"
|
|
18
|
+
> {
|
|
19
|
+
/**
|
|
20
|
+
* divider 루트 className
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 구분선 방향
|
|
25
|
+
*/
|
|
26
|
+
direction?: DividerDirection;
|
|
27
|
+
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drawer; bottom sheet 카테고리 배럴
|
|
3
|
+
* @desc
|
|
4
|
+
* - `DrawerRoot`, `DrawerTrigger`, `DrawerPortal`, `DrawerOverlay`, `DrawerContent`: 루트/레이어 조합 축이다.
|
|
5
|
+
* - `DrawerHeader`, `DrawerBody`, `DrawerFooter`, `DrawerTitle`, `DrawerDescription`, `DrawerClose`: anatomy 도구다.
|
|
6
|
+
* - `useDrawerDrag`: handle drag 제어 hook이다.
|
|
7
|
+
*/
|
|
1
8
|
import "./index.scss";
|
|
2
9
|
|
|
3
10
|
export * from "./markup";
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Drawer; bottom sheet markup export 배럴
|
|
5
|
+
* @desc
|
|
6
|
+
* - `DrawerRoot`, `DrawerTrigger`, `DrawerPortal`, `DrawerOverlay`, `DrawerContent`: 루트/레이어 조합 축이다.
|
|
7
|
+
* - `DrawerHeader`, `DrawerBody`, `DrawerFooter`, `DrawerTitle`, `DrawerDescription`, `DrawerClose`: anatomy 도구다.
|
|
8
|
+
*/
|
|
3
9
|
export * from "./Drawer";
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dropdown; namespace 배럴 export
|
|
3
|
+
* @desc
|
|
4
|
+
* - `Dropdown.Root`, `Dropdown.Trigger`, `Dropdown.Container`: foundation 레이어
|
|
5
|
+
* - `Dropdown.Menu.*`: list/item 조합 레이어
|
|
6
|
+
* - `Dropdown.Template`: items[].selected + onChange(payload) preset
|
|
7
|
+
*/
|
|
1
8
|
import "./index.scss";
|
|
2
9
|
|
|
3
10
|
export * from "./markup";
|