@uniai-fe/uds-primitives 0.12.14 → 0.13.1
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 +68 -0
- package/dist/styles.css +331 -52
- package/package.json +3 -3
- package/src/components/calendar/styles/mantine-calendar.scss +5 -0
- package/src/components/checkbox/styles/index.scss +1 -7
- package/src/components/chip/styles/chip.scss +0 -5
- package/src/components/fab/index.scss +1 -0
- package/src/components/fab/index.tsx +34 -0
- package/src/components/fab/markup/Base.tsx +62 -0
- package/src/components/fab/markup/Default.tsx +33 -0
- package/src/components/fab/markup/Extended.tsx +35 -0
- package/src/components/fab/markup/Label.tsx +16 -0
- package/src/components/fab/markup/Menu.tsx +114 -0
- package/src/components/fab/markup/Root.tsx +263 -0
- package/src/components/fab/markup/Template.tsx +79 -0
- package/src/components/fab/markup/Trigger.tsx +65 -0
- package/src/components/fab/markup/index.ts +7 -0
- package/src/components/fab/styles/composition.scss +80 -0
- package/src/components/fab/styles/fab.scss +135 -0
- package/src/components/fab/styles/index.scss +4 -0
- package/src/components/fab/styles/variables.scss +24 -0
- package/src/components/fab/types/composition.ts +288 -0
- package/src/components/fab/types/index.ts +3 -0
- package/src/components/fab/types/options.ts +39 -0
- package/src/components/fab/types/props.ts +124 -0
- package/src/components/navigation/styles/index.scss +0 -6
- package/src/components/radio/styles/index.scss +1 -8
- package/src/components/segmented-control/styles/index.scss +0 -5
- package/src/components/select/styles/select.scss +0 -5
- package/src/components/select/styles/variables.scss +0 -1
- package/src/components/switch/styles/switch.scss +0 -10
- package/src/components/switch/styles/variables.scss +0 -1
- package/src/components/tab/markup/TabTrigger.tsx +8 -8
- package/src/components/tab/styles/tab.scss +0 -5
- package/src/components/tooltip/markup/Text.tsx +10 -3
- package/src/components/tooltip/types/text.ts +8 -3
- package/src/index.scss +1 -0
- package/src/index.tsx +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BUTTON_FILLS, BUTTON_PRIORITIES } from "../../button/types/options";
|
|
2
|
+
import type { ButtonFill, ButtonPriority } from "../../button/types/props";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fab Types; 크기 옵션
|
|
6
|
+
* @desc Figma small 40px, medium 48px, large 56px에 대응한다.
|
|
7
|
+
*/
|
|
8
|
+
export type FabSize = "small" | "medium" | "large";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Fab Types; 채움 스타일
|
|
12
|
+
* @desc Button과 같은 "solid" | "outlined" 축이며 모든 priority에 적용한다.
|
|
13
|
+
*/
|
|
14
|
+
export type FabFill = ButtonFill;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fab Types; 색상 priority
|
|
18
|
+
* @desc Button과 같은 "primary" | "secondary" | "tertiary" | "green" | "yellow" | "orange" | "teal" | "pink" | "red" | "darkGray" | "lightGray"를 두 fill 모두에 적용한다.
|
|
19
|
+
* @see ButtonPriority
|
|
20
|
+
*/
|
|
21
|
+
export type FabPriority = ButtonPriority;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fab Options; 공개 크기 목록
|
|
25
|
+
* @desc Controls와 소비 예시에서 Figma 크기 축을 공유한다.
|
|
26
|
+
*/
|
|
27
|
+
export const FAB_SIZES = ["small", "medium", "large"] as const;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fab Options; 공개 채움 스타일 목록
|
|
31
|
+
* @desc 채움과 외곽선을 독립된 시각 옵션으로 선택한다.
|
|
32
|
+
*/
|
|
33
|
+
export const FAB_FILLS = [...BUTTON_FILLS] as const;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Fab Options; 공개 색상 priority 목록
|
|
37
|
+
* @desc Button의 semantic priority와 고정 색상 preset 목록을 공유한다.
|
|
38
|
+
*/
|
|
39
|
+
export const FAB_PRIORITIES = [...BUTTON_PRIORITIES] as const;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import type { FabFill, FabPriority, FabSize } from "./options";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fab Types; 시각 옵션의 조합 계약
|
|
6
|
+
* @property {"solid" | "outlined"} fill 모든 priority에서 선택하는 필수 채움 스타일.
|
|
7
|
+
* @property {"primary" | "secondary" | "tertiary" | "green" | "yellow" | "orange" | "teal" | "pink" | "red" | "darkGray" | "lightGray"} priority 두 fill 모두에서 필수인 색상.
|
|
8
|
+
* @desc Button의 색상 계약을 재사용하며 priority와 fill을 독립적으로 조합한다. outlined의 기본 면은 불투명 흰색이다.
|
|
9
|
+
*/
|
|
10
|
+
export type FabStyleOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* 허용 값: "solid" | "outlined". 모든 priority에서 필수다.
|
|
13
|
+
*/
|
|
14
|
+
fill: FabFill;
|
|
15
|
+
/**
|
|
16
|
+
* 허용 값: "primary" | "secondary" | "tertiary" | "green" | "yellow" |
|
|
17
|
+
* "orange" | "teal" | "pink" | "red" | "darkGray" | "lightGray".
|
|
18
|
+
* 두 fill 모두에서 필수이며 배경·외곽선·콘텐츠 색상을 결정한다.
|
|
19
|
+
*/
|
|
20
|
+
priority: FabPriority;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fab Props; 공통 native 버튼 계약
|
|
25
|
+
* @property {"small" | "medium" | "large"} size 필수 크기. small/medium/large의 높이는 40/48/56px, icon 영역은 16/20/24px다.
|
|
26
|
+
* @property {"solid" | "outlined"} fill 모든 priority에서 선택하는 필수 채움 스타일.
|
|
27
|
+
* @property {"primary" | "secondary" | "tertiary" | "green" | "yellow" | "orange" | "teal" | "pink" | "red" | "darkGray" | "lightGray"} priority solid와 outlined 모두에서 필수인 색상.
|
|
28
|
+
* @property {ReactNode} icon 필수 장식용 콘텐츠. icon 영역은 aria-hidden이므로 행동 이름을 대신하지 않는다.
|
|
29
|
+
* @property {string} [aria-label] native 접근 가능한 이름. 표시 라벨과 별도 이름이 필요할 때 제공한다.
|
|
30
|
+
* @property {"button" | "submit" | "reset"} [type="button"] native 버튼 종류. submit과 reset은 소비자가 명시한다.
|
|
31
|
+
* @property {boolean} [disabled] native 클릭·키보드 실행을 차단한다.
|
|
32
|
+
* @property {string} [className] 최상위 native 버튼에 병합하는 추가 클래스.
|
|
33
|
+
* @property {React.CSSProperties} [style] 최상위 native 버튼에 전달하는 inline style.
|
|
34
|
+
* @property {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] native 클릭 handler. Enter·Space의 native 버튼 실행에서도 호출한다.
|
|
35
|
+
* @desc FabStyleOptions와 children을 제외한 native button 입력을 조합한다. size·fill·priority·icon은 필수이며 나머지 native button 이벤트와 aria attribute를 유지한다. ref는 각 컴포넌트의 forwardRef로 native 버튼에 연결한다. viewport 배치는 소비자의 책임이다.
|
|
36
|
+
* @see FabStyleOptions
|
|
37
|
+
*/
|
|
38
|
+
export type FabProps = Omit<ComponentPropsWithoutRef<"button">, "children"> &
|
|
39
|
+
FabStyleOptions & {
|
|
40
|
+
/**
|
|
41
|
+
* 필수 크기. 허용 값: "small" | "medium" | "large".
|
|
42
|
+
* 높이는 각각 40/48/56px, icon 영역은 16/20/24px다.
|
|
43
|
+
*/
|
|
44
|
+
size: FabSize;
|
|
45
|
+
/**
|
|
46
|
+
* 필수 ReactNode 영역. 아이콘 외에도 비인터랙티브 콘텐츠를 받을 수 있다.
|
|
47
|
+
* 내부 콘텐츠는 aria-hidden으로 처리하므로 행동 이름은 버튼 라벨로 제공한다.
|
|
48
|
+
*/
|
|
49
|
+
icon: ReactNode;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Fab Props; 아이콘 전용 액션
|
|
54
|
+
* @property {"small" | "medium" | "large"} size 필수 크기. small/medium/large의 높이는 40/48/56px, icon 영역은 16/20/24px다.
|
|
55
|
+
* @property {"solid" | "outlined"} fill 모든 priority에서 선택하는 필수 채움 스타일.
|
|
56
|
+
* @property {"primary" | "secondary" | "tertiary" | "green" | "yellow" | "orange" | "teal" | "pink" | "red" | "darkGray" | "lightGray"} priority solid와 outlined 모두에서 필수인 색상.
|
|
57
|
+
* @property {ReactNode} icon 필수 장식용 콘텐츠. icon 영역은 aria-hidden이므로 행동 이름을 대신하지 않는다.
|
|
58
|
+
* @property {string} aria-label 필수 행동 이름. icon 콘텐츠는 접근 가능한 이름에서 제외된다.
|
|
59
|
+
* @property {"button" | "submit" | "reset"} [type="button"] native 버튼 종류. submit과 reset은 소비자가 명시한다.
|
|
60
|
+
* @property {boolean} [disabled] native 클릭·키보드 실행을 차단한다.
|
|
61
|
+
* @property {string} [className] 최상위 native 버튼에 병합하는 추가 클래스.
|
|
62
|
+
* @property {React.CSSProperties} [style] 최상위 native 버튼에 전달하는 inline style.
|
|
63
|
+
* @property {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] native 클릭 handler. Enter·Space의 native 버튼 실행에서도 호출한다.
|
|
64
|
+
* @desc FabProps에 필수 aria-label을 추가한 Fab.Button과 호환 이름 Fab.Default의 계약이다. children을 받지 않으며 icon은 장식용으로 처리한다. 다른 native button 입력과 컴포넌트의 DOM ref를 유지한다.
|
|
65
|
+
* @see FabProps
|
|
66
|
+
*/
|
|
67
|
+
export type FabDefaultProps = FabProps & {
|
|
68
|
+
/**
|
|
69
|
+
* 아이콘이 실행하는 행동을 설명하는 필수 접근 가능한 이름.
|
|
70
|
+
*/
|
|
71
|
+
"aria-label": string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Fab Props; 아이콘과 라벨을 나란히 표시하는 확장형 액션
|
|
76
|
+
* @property {"small" | "medium" | "large"} size 필수 크기. small/medium/large의 높이는 40/48/56px, icon 영역은 16/20/24px다.
|
|
77
|
+
* @property {"solid" | "outlined"} fill 모든 priority에서 선택하는 필수 채움 스타일.
|
|
78
|
+
* @property {"primary" | "secondary" | "tertiary" | "green" | "yellow" | "orange" | "teal" | "pink" | "red" | "darkGray" | "lightGray"} priority solid와 outlined 모두에서 필수인 색상.
|
|
79
|
+
* @property {ReactNode} icon 필수 장식용 콘텐츠. icon 영역은 aria-hidden이므로 행동 이름을 대신하지 않는다.
|
|
80
|
+
* @property {string} [aria-label] native 접근 가능한 이름. 표시 라벨과 별도 이름이 필요할 때 제공한다.
|
|
81
|
+
* @property {"button" | "submit" | "reset"} [type="button"] native 버튼 종류. submit과 reset은 소비자가 명시한다.
|
|
82
|
+
* @property {boolean} [disabled] native 클릭·키보드 실행을 차단한다.
|
|
83
|
+
* @property {string} [className] 최상위 native 버튼에 병합하는 추가 클래스.
|
|
84
|
+
* @property {React.CSSProperties} [style] 최상위 native 버튼에 전달하는 inline style.
|
|
85
|
+
* @property {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] native 클릭 handler. Enter·Space의 native 버튼 실행에서도 호출한다.
|
|
86
|
+
* @property {ReactNode} children 필수 행동 라벨. 문자열·숫자는 Fab.Label로 감싸고 다른 ReactNode는 그대로 표시한다.
|
|
87
|
+
* @desc FabProps에 필수 children을 추가한 Fab.Expand와 호환 이름 Fab.Extended의 계약이다. icon과 행동 라벨을 나란히 표시하며 다른 native button 입력과 컴포넌트의 DOM ref를 유지한다. 액션 목록의 열림을 담당하지 않는다.
|
|
88
|
+
* @see FabProps
|
|
89
|
+
*/
|
|
90
|
+
export type FabExtendedProps = FabProps & {
|
|
91
|
+
/**
|
|
92
|
+
* 필수 행동 라벨. 문자열·숫자는 Fab.Label로 감싸고 복합 JSX는 그대로 표시한다.
|
|
93
|
+
* 복합 JSX에도 접근 가능한 이름과 필요한 라벨 스타일을 제공한다.
|
|
94
|
+
*/
|
|
95
|
+
children: ReactNode;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Fab Props; 내부 공통 마크업 입력
|
|
100
|
+
* @property {"small" | "medium" | "large"} size 필수 크기. small/medium/large의 높이는 40/48/56px, icon 영역은 16/20/24px다.
|
|
101
|
+
* @property {"solid" | "outlined"} fill 모든 priority에서 선택하는 필수 채움 스타일.
|
|
102
|
+
* @property {"primary" | "secondary" | "tertiary" | "green" | "yellow" | "orange" | "teal" | "pink" | "red" | "darkGray" | "lightGray"} priority solid와 outlined 모두에서 필수인 색상.
|
|
103
|
+
* @property {ReactNode} icon 필수 장식용 콘텐츠. icon 영역은 aria-hidden이므로 행동 이름을 대신하지 않는다.
|
|
104
|
+
* @property {string} [aria-label] native 접근 가능한 이름. 표시 라벨과 별도 이름이 필요할 때 제공한다.
|
|
105
|
+
* @property {"button" | "submit" | "reset"} [type="button"] native 버튼 종류. submit과 reset은 소비자가 명시한다.
|
|
106
|
+
* @property {boolean} [disabled] native 클릭·키보드 실행을 차단한다.
|
|
107
|
+
* @property {string} [className] 최상위 native 버튼에 병합하는 추가 클래스.
|
|
108
|
+
* @property {React.CSSProperties} [style] 최상위 native 버튼에 전달하는 inline style.
|
|
109
|
+
* @property {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick] native 클릭 handler. Enter·Space의 native 버튼 실행에서도 호출한다.
|
|
110
|
+
* @property {ReactNode} [children] extended가 true일 때 표시하는 행동 라벨.
|
|
111
|
+
* @property {boolean} [extended=false] true이면 라벨과 자연 너비 규격을 적용한다. false이면 원형 icon 버튼 규격을 적용한다.
|
|
112
|
+
* @desc FabProps를 상속한 내부 마크업 계약이다. Fab.Button/Fab.Default는 extended=false, Fab.Expand/Fab.Extended는 extended=true로 같은 native button을 사용한다. 다른 native button 입력과 컴포넌트의 DOM ref를 유지한다.
|
|
113
|
+
* @see FabProps
|
|
114
|
+
*/
|
|
115
|
+
export type FabButtonProps = FabProps & {
|
|
116
|
+
/**
|
|
117
|
+
* 확장형에서 사용하는 라벨.
|
|
118
|
+
*/
|
|
119
|
+
children?: ReactNode;
|
|
120
|
+
/**
|
|
121
|
+
* 기본값 false. true이면 라벨과 자연 너비 규격을, false이면 원형 아이콘 규격을 적용한다.
|
|
122
|
+
*/
|
|
123
|
+
extended?: boolean;
|
|
124
|
+
};
|
|
@@ -86,12 +86,6 @@
|
|
|
86
86
|
pointer-events: none;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
.bottom-navigation-trigger:focus-visible {
|
|
90
|
-
outline: none;
|
|
91
|
-
border-radius: var(--theme-radius-large-1, 12px);
|
|
92
|
-
box-shadow: 0 0 0 2px var(--color-primary-focus, rgba(0, 97, 255, 0.2));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
89
|
.navigation-item-icon {
|
|
96
90
|
display: inline-flex;
|
|
97
91
|
align-items: center;
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
--theme-radio-card-description-color: var(--color-label-neutral);
|
|
24
24
|
--theme-radio-card-badge-background: var(--color-surface-static-blue);
|
|
25
25
|
--theme-radio-card-badge-color: var(--color-primary-default);
|
|
26
|
-
--theme-radio-focus-ring: rgba(2, 84, 255, 0.32);
|
|
27
26
|
--theme-radio-disabled-selected-opacity: 0.28;
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -38,9 +37,7 @@
|
|
|
38
37
|
border-radius: 0;
|
|
39
38
|
padding: 0;
|
|
40
39
|
cursor: pointer;
|
|
41
|
-
transition:
|
|
42
|
-
box-shadow 0.15s ease,
|
|
43
|
-
transform 0.15s ease;
|
|
40
|
+
transition: transform 0.15s ease;
|
|
44
41
|
|
|
45
42
|
&[data-size="large"] {
|
|
46
43
|
inline-size: var(--theme-radio-frame-size-large);
|
|
@@ -53,10 +50,6 @@
|
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
.radio:focus-visible {
|
|
57
|
-
box-shadow: 0 0 0 2px var(--theme-radio-focus-ring);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
53
|
.radio-indicator {
|
|
61
54
|
inline-size: var(--theme-radio-indicator-size-medium);
|
|
62
55
|
block-size: var(--theme-radio-indicator-size-medium);
|
|
@@ -92,11 +92,6 @@
|
|
|
92
92
|
opacity: var(--segmented-disabled-opacity);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
.segmented-control-button:where(:focus-visible) {
|
|
96
|
-
outline: 2px solid var(--color-focus-ring, var(--color-primary-default));
|
|
97
|
-
outline-offset: 2px;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
95
|
.segmented-control-label {
|
|
101
96
|
display: flex;
|
|
102
97
|
align-items: center;
|
|
@@ -485,11 +485,6 @@
|
|
|
485
485
|
border-radius: 9999px;
|
|
486
486
|
transition: color 150ms ease;
|
|
487
487
|
|
|
488
|
-
&:focus-visible {
|
|
489
|
-
outline: 0.2rem solid var(--select-multiple-chip-remove-focus-outline-color);
|
|
490
|
-
outline-offset: 0.1rem;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
488
|
&:hover {
|
|
494
489
|
color: var(--select-multiple-chip-remove-hover-color);
|
|
495
490
|
}
|
|
@@ -147,7 +147,6 @@
|
|
|
147
147
|
--select-multiple-chip-border-color: transparent;
|
|
148
148
|
--select-multiple-chip-remove-color: var(--color-label-strong);
|
|
149
149
|
--select-multiple-chip-remove-hover-color: var(--color-label-strong);
|
|
150
|
-
--select-multiple-chip-remove-focus-outline-color: var(--color-border-strong);
|
|
151
150
|
--select-multiple-chip-summary-color: var(--color-label-standard);
|
|
152
151
|
--select-multiple-chip-summary-surface: var(--color-surface-standard);
|
|
153
152
|
--select-multiple-chip-summary-border-color: transparent;
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
cursor: pointer;
|
|
17
17
|
transition:
|
|
18
18
|
background-color 0.2s ease,
|
|
19
|
-
box-shadow 0.2s ease,
|
|
20
19
|
opacity 0.2s ease;
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -31,10 +30,6 @@
|
|
|
31
30
|
background-color: var(--switch-track-background-checked);
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
.switch:where(:focus-visible) {
|
|
35
|
-
box-shadow: 0 0 0 2px var(--switch-focus-ring);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
33
|
.switch:where(:disabled) {
|
|
39
34
|
cursor: not-allowed;
|
|
40
35
|
opacity: var(--switch-disabled-opacity);
|
|
@@ -165,11 +160,6 @@
|
|
|
165
160
|
cursor: not-allowed;
|
|
166
161
|
}
|
|
167
162
|
|
|
168
|
-
.switch-text-button:where(:focus-visible) {
|
|
169
|
-
outline: 2px solid var(--switch-focus-ring);
|
|
170
|
-
outline-offset: 2px;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
163
|
.switch-text-label {
|
|
174
164
|
display: flex;
|
|
175
165
|
align-items: center;
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
0px 2px 8px rgba(0, 0, 0, 0.04), 0px 0px 4px rgba(0, 0, 0, 0.08);
|
|
17
17
|
--switch-thumb-shadow-checked:
|
|
18
18
|
0px 2px 8px rgba(0, 0, 0, 0.08), 0px 0px 4px rgba(0, 0, 0, 0.12);
|
|
19
|
-
--switch-focus-ring: var(--color-primary-focus);
|
|
20
19
|
--switch-disabled-opacity: 0.4;
|
|
21
20
|
|
|
22
21
|
--switch-text-width: fit-content;
|
|
@@ -6,20 +6,20 @@ import { useTabContext } from "../utils";
|
|
|
6
6
|
import { TabLabel } from "./Label";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Tab Trigger; 개별 탭 선택
|
|
10
10
|
* @component
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
16
|
-
* @
|
|
11
|
+
* @property {TabTriggerProps} props Radix 탭 입력과 icon을 전달한다.
|
|
12
|
+
* @property {React.ReactNode} [props.icon] 라벨 앞 아이콘.
|
|
13
|
+
* @property {React.ReactNode} [props.children] 라벨 콘텐츠.
|
|
14
|
+
* @property {string} [props.className] trigger에 병합할 className.
|
|
15
|
+
* @property {string} props.value 선택할 탭 값.
|
|
16
|
+
* @property {boolean} [props.disabled] 비활성 상태.
|
|
17
|
+
* @desc 선택·focus·disabled와 native handler를 Radix에 위임하고 초점 테두리는 Foundation reset을 따른다.
|
|
17
18
|
*/
|
|
18
19
|
const TabTrigger = forwardRef<HTMLButtonElement, TabTriggerProps>(
|
|
19
20
|
({ icon, children, className, ...restProps }, forwardedRef) => {
|
|
20
21
|
const { variant, scale } = useTabContext();
|
|
21
22
|
const hasIcon = Boolean(icon);
|
|
22
|
-
|
|
23
23
|
return (
|
|
24
24
|
<TabsPrimitive.Trigger
|
|
25
25
|
{...restProps}
|
|
@@ -68,11 +68,6 @@
|
|
|
68
68
|
transition: background-color 0.2s ease;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.tab-trigger:where(:focus-visible) {
|
|
72
|
-
outline: 2px solid var(--color-primary-default);
|
|
73
|
-
outline-offset: 2px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
71
|
.tab-trigger:where([data-disabled="true"]) {
|
|
77
72
|
cursor: not-allowed;
|
|
78
73
|
opacity: var(--tab-disabled-opacity);
|
|
@@ -3,15 +3,22 @@ import type { TooltipTextProps } from "../types";
|
|
|
3
3
|
import { Slot } from "../../slot";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Tooltip Text; Tooltip
|
|
6
|
+
* Tooltip Text; Tooltip 문구의 고정 스타일
|
|
7
7
|
* @component
|
|
8
|
-
* @
|
|
8
|
+
* @property {ReactNode} [props.children] 문자열·숫자는 span으로 감싸고 다른 ReactNode는 그대로 반환한다.
|
|
9
|
+
* @property {"span"} [props.as="span"] 문자열·숫자 문구의 렌더 요소. 현재 공개 타입은 span 입력을 받는다.
|
|
10
|
+
* @property {string} [props.className] 문자열·숫자 문구에 slot-text·tooltip-message-text와 병합할 추가 클래스.
|
|
11
|
+
* @property {string} [props.title] 문구의 native title. 생략하면 문자열·숫자 children의 문자열 값을 사용한다.
|
|
12
|
+
* @property {string} [props.id] 문자열·숫자 문구를 감싼 span의 DOM ID.
|
|
13
|
+
* @property {CSSProperties} [props.style] 문자열·숫자 문구를 감싼 span의 inline style.
|
|
14
|
+
* @see TooltipTextProps
|
|
15
|
+
* @desc Tooltip.Text와 Fab.Menu.Label이 같은 구현을 사용한다. TooltipTextProps가 상속한 SlotTextProps는 ComponentPropsWithoutRef<"span"> 계약으로 ref를 받지 않는다. Tooltip의 스타일 문맥에서 문구를 표현하며 나머지 native span 속성은 래핑한 텍스트에 전달한다. 복합 JSX는 wrapper·클래스·속성 주입 없이 반환한다. Tooltip 표시 상태와 접근 가능한 버튼 이름을 설정하는 부품은 아니다.
|
|
9
16
|
*/
|
|
10
17
|
export default function TooltipText({
|
|
11
18
|
className,
|
|
12
19
|
...restProps
|
|
13
20
|
}: TooltipTextProps) {
|
|
14
|
-
//
|
|
21
|
+
// 문구의 전용 클래스를 유지해 Tooltip의 색상과 타이포그래피를 적용한다.
|
|
15
22
|
return (
|
|
16
23
|
<Slot.Text
|
|
17
24
|
className={clsx("tooltip-message-text", className)}
|
|
@@ -2,8 +2,13 @@ import type { SlotTextProps } from "../../slot";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Tooltip Types; Text 마크업 props
|
|
5
|
-
* @property {
|
|
6
|
-
* @property {React.ReactNode} [children]
|
|
7
|
-
* @property {string} [className] tooltip-text와 병합할
|
|
5
|
+
* @property {"span"} [as="span"] 문자열·숫자 문구의 렌더 요소. SlotTextProps의 기본 generic span을 사용한다.
|
|
6
|
+
* @property {React.ReactNode} [children] 문자열·숫자는 span으로 감싸고 복합 JSX는 속성 주입 없이 반환한다.
|
|
7
|
+
* @property {string} [className] 문자열·숫자 문구에 slot-text·tooltip-message-text와 병합할 추가 클래스.
|
|
8
|
+
* @property {string} [title] 문자열·숫자 문구의 native title. 생략하면 children의 문자열 값을 사용한다.
|
|
9
|
+
* @property {string} [id] 문자열·숫자 문구를 감싼 span의 DOM ID.
|
|
10
|
+
* @property {React.CSSProperties} [style] 문자열·숫자 문구를 감싼 span의 inline style.
|
|
11
|
+
* @see SlotTextProps
|
|
12
|
+
* @desc Tooltip.Text와 Fab.Menu.Label이 공유하는 문구 입력이다. native span 속성을 상속하며 복합 JSX에는 wrapper·클래스·속성을 주입하지 않는다. 표시 상태와 접근 가능한 버튼 이름은 상위 조합에서 설정한다.
|
|
8
13
|
*/
|
|
9
14
|
export type TooltipTextProps = SlotTextProps;
|
package/src/index.scss
CHANGED
package/src/index.tsx
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./components/chip";
|
|
|
13
13
|
export * from "./components/divider";
|
|
14
14
|
export * from "./components/drawer";
|
|
15
15
|
export * from "./components/dropdown";
|
|
16
|
+
export * from "./components/fab";
|
|
16
17
|
export * from "./components/form";
|
|
17
18
|
export * from "./components/info-box";
|
|
18
19
|
export * from "./components/input";
|