@uniai-fe/uds-primitives 0.5.4 → 0.5.6
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/styles.css +38 -2
- package/package.json +3 -3
- package/src/components/chip/index.tsx +2 -1
- package/src/components/chip/markup/{Chip.tsx → foundation/Chip.tsx} +21 -4
- package/src/components/chip/markup/{Label.tsx → foundation/Label.tsx} +2 -2
- package/src/components/chip/markup/{ListRoot.tsx → foundation/ListRoot.tsx} +20 -4
- package/src/components/chip/markup/{RemoveButton.tsx → foundation/RemoveButton.tsx} +2 -2
- package/src/components/chip/markup/index.tsx +9 -6
- package/src/components/chip/markup/{DefaultStyle.tsx → templates/DefaultStyle.tsx} +2 -2
- package/src/components/chip/markup/{InputStyle.tsx → templates/InputStyle.tsx} +3 -3
- package/src/components/chip/markup/templates/TextStyle.tsx +69 -0
- package/src/components/chip/styles/chip.scss +28 -2
- package/src/components/chip/styles/variables.scss +6 -0
- package/src/components/chip/types/options.ts +3 -2
- package/src/components/chip/types/props.ts +1 -1
- package/src/components/drawer/styles/index.scss +4 -0
package/dist/styles.css
CHANGED
|
@@ -223,7 +223,11 @@
|
|
|
223
223
|
--theme-checkbox-icon-disabled-selected: var(--color-common-100);
|
|
224
224
|
--theme-checkbox-focus-ring: rgba(2, 84, 255, 0.32);
|
|
225
225
|
--theme-chip-height: var(--theme-size-small-3);
|
|
226
|
+
/* 변경: Figma text menu item은 기본 chip보다 낮은 24px height를 사용한다. */
|
|
227
|
+
--theme-chip-height-text: 24px;
|
|
226
228
|
--theme-chip-padding-horizontal: var(--spacing-padding-5);
|
|
229
|
+
/* 변경: Figma text menu item은 8px horizontal padding을 사용한다. */
|
|
230
|
+
--theme-chip-padding-horizontal-text: var(--spacing-padding-4);
|
|
227
231
|
--theme-chip-gap: var(--spacing-gap-1);
|
|
228
232
|
--theme-chip-assist-gap: var(--spacing-gap-2);
|
|
229
233
|
--theme-chip-input-gap: var(--spacing-gap-1);
|
|
@@ -250,11 +254,15 @@
|
|
|
250
254
|
--theme-chip-font-family: var(--font-body-medium-family);
|
|
251
255
|
--theme-chip-font-size: var(--font-body-xsmall-size);
|
|
252
256
|
--theme-chip-font-weight: var(--font-body-xsmall-weight);
|
|
257
|
+
/* 변경: text selected chip은 Figma semibold 상태를 foundation typography weight로 매핑한다. */
|
|
258
|
+
--theme-chip-text-font-weight-selected: var(--font-caption-large-weight);
|
|
253
259
|
--divider-width: 1px;
|
|
254
260
|
--divider-height: 12px;
|
|
255
261
|
--divider-color: var(--color-border-standard-cool-gray, #e4e5e7);
|
|
256
262
|
--divider-margin: var(--spacing-gap-4, 8px);
|
|
257
263
|
--drawer-overlay-bg: rgba(0, 0, 0, 0.44);
|
|
264
|
+
--drawer-overlay-z-index: 900;
|
|
265
|
+
--drawer-content-z-index: 901;
|
|
258
266
|
--drawer-surface-bg: var(--color-surface-static-white);
|
|
259
267
|
--drawer-radius-large: var(--theme-radius-large-2);
|
|
260
268
|
--drawer-radius-medium: var(--theme-radius-large-1);
|
|
@@ -1974,6 +1982,7 @@
|
|
|
1974
1982
|
|
|
1975
1983
|
.chip {
|
|
1976
1984
|
--chip-current-height: var(--theme-chip-height);
|
|
1985
|
+
--chip-padding-horizontal: var(--theme-chip-padding-horizontal);
|
|
1977
1986
|
--chip-gap: var(--theme-chip-gap);
|
|
1978
1987
|
--chip-bg: transparent;
|
|
1979
1988
|
--chip-border-color: transparent;
|
|
@@ -1983,8 +1992,8 @@
|
|
|
1983
1992
|
justify-content: center;
|
|
1984
1993
|
gap: var(--chip-gap);
|
|
1985
1994
|
height: var(--chip-current-height);
|
|
1986
|
-
padding-left: var(--
|
|
1987
|
-
padding-right: var(--
|
|
1995
|
+
padding-left: var(--chip-padding-horizontal);
|
|
1996
|
+
padding-right: var(--chip-padding-horizontal);
|
|
1988
1997
|
padding-block: 0;
|
|
1989
1998
|
border-radius: var(--theme-chip-radius);
|
|
1990
1999
|
border: 1px solid var(--chip-border-color);
|
|
@@ -2034,6 +2043,27 @@ figure.chip {
|
|
|
2034
2043
|
--chip-border-color: transparent;
|
|
2035
2044
|
}
|
|
2036
2045
|
|
|
2046
|
+
.chip:where([data-style=text]) {
|
|
2047
|
+
--chip-current-height: var(--theme-chip-height-text);
|
|
2048
|
+
--chip-padding-horizontal: var(--theme-chip-padding-horizontal-text);
|
|
2049
|
+
--chip-bg: transparent;
|
|
2050
|
+
--chip-border-color: transparent;
|
|
2051
|
+
--chip-label-color: var(--color-label-standard);
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
.chip:where([data-style=text]) .chip-label {
|
|
2055
|
+
text-decoration: none;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
.chip:where([data-style=text][data-selected=true]) {
|
|
2059
|
+
--chip-bg: var(--color-surface-standard);
|
|
2060
|
+
font-weight: var(--theme-chip-text-font-weight-selected);
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
.chip:where([data-style=text][data-selected=true]) .chip-label {
|
|
2064
|
+
text-decoration: underline;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2037
2067
|
.chip:where([data-style][data-rounded=true]) {
|
|
2038
2068
|
border-radius: calc(var(--chip-current-height) / 2);
|
|
2039
2069
|
}
|
|
@@ -2087,6 +2117,10 @@ figure.chip {
|
|
|
2087
2117
|
line-height: var(--theme-chip-line-height-table);
|
|
2088
2118
|
}
|
|
2089
2119
|
|
|
2120
|
+
.chip:where([data-size=table][data-style=text][data-selected=true]) {
|
|
2121
|
+
font-weight: var(--theme-chip-text-font-weight-selected);
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2090
2124
|
.chip:where([data-size=table][data-style=input]) {
|
|
2091
2125
|
padding-left: var(--theme-chip-padding-left-table);
|
|
2092
2126
|
padding-right: var(--theme-chip-padding-right-table);
|
|
@@ -2181,6 +2215,7 @@ figure.chip {
|
|
|
2181
2215
|
.drawer-overlay {
|
|
2182
2216
|
position: fixed;
|
|
2183
2217
|
inset: 0;
|
|
2218
|
+
z-index: var(--drawer-overlay-z-index);
|
|
2184
2219
|
background-color: var(--drawer-overlay-bg);
|
|
2185
2220
|
opacity: 0;
|
|
2186
2221
|
pointer-events: none;
|
|
@@ -2205,6 +2240,7 @@ figure.chip {
|
|
|
2205
2240
|
position: fixed;
|
|
2206
2241
|
display: flex;
|
|
2207
2242
|
flex-direction: column;
|
|
2243
|
+
z-index: var(--drawer-content-z-index);
|
|
2208
2244
|
background-color: var(--drawer-surface-bg);
|
|
2209
2245
|
outline: none;
|
|
2210
2246
|
border: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniai-fe/uds-primitives",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "UNIAI Design System; Primitives Components Package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"@uniai-fe/uds-foundation": "workspace:*",
|
|
103
103
|
"@uniai-fe/util-functions": "workspace:*",
|
|
104
104
|
"eslint": "^9.39.2",
|
|
105
|
-
"prettier": "^3.8.
|
|
105
|
+
"prettier": "^3.8.3",
|
|
106
106
|
"react-hook-form": "^7.72.1",
|
|
107
107
|
"sass": "^1.99.0",
|
|
108
|
-
"typescript": "
|
|
108
|
+
"typescript": "5.9.3"
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Chip; filter/assist/input chip 카테고리 배럴
|
|
2
|
+
* Chip; filter/assist/input/text chip 카테고리 배럴
|
|
3
3
|
* @desc
|
|
4
4
|
* - `Chip.Default`: style 분기 루트 컴포넌트다.
|
|
5
5
|
* - `Chip.ClickableStyle`: filter/assist button 렌더 전용 leaf다.
|
|
6
6
|
* - `Chip.InputStyle`: input figure 렌더 전용 leaf다.
|
|
7
|
+
* - `Chip.TextStyle`: text button 렌더 전용 leaf다.
|
|
7
8
|
* - `Chip.List`: chip 목록 템플릿이다.
|
|
8
9
|
* - `ChipProps`, `ChipListRootProps`, `ChipListItemData`: public contract 타입이다.
|
|
9
10
|
*/
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { forwardRef, type Ref } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import type { ChipInputProps, ChipProps } from "
|
|
4
|
-
import ChipClickableStyle from "
|
|
5
|
-
import ChipInputStyle from "
|
|
3
|
+
import type { ChipInputProps, ChipProps } from "../../types";
|
|
4
|
+
import ChipClickableStyle from "../templates/DefaultStyle";
|
|
5
|
+
import ChipInputStyle from "../templates/InputStyle";
|
|
6
|
+
import ChipTextStyle from "../templates/TextStyle";
|
|
6
7
|
|
|
7
8
|
// chipStyle === "input" 조합에서 props를 ChipInputProps로 좁히기 위한 type guard.
|
|
8
9
|
const isChipInputProps = (props: ChipProps): props is ChipInputProps =>
|
|
9
10
|
props.chipStyle === "input";
|
|
10
11
|
|
|
12
|
+
// chipStyle === "text" 조합에서 text leaf 분기를 고정하기 위한 type guard.
|
|
13
|
+
const isChipTextProps = (props: ChipProps): boolean =>
|
|
14
|
+
props.chipStyle === "text";
|
|
15
|
+
|
|
11
16
|
/**
|
|
12
17
|
* Chip Markup; Style별 렌더 분기 Orchestrator 컴포넌트
|
|
13
18
|
* @component
|
|
14
19
|
* @param {ChipProps} props Chip 공통/종류별 props
|
|
15
|
-
* @param {"filter" | "assist" | "input"} [props.chipStyle="filter"] Chip 스타일
|
|
20
|
+
* @param {"filter" | "assist" | "input" | "text"} [props.chipStyle="filter"] Chip 스타일
|
|
16
21
|
* @param {"solid" | "outlined"} [props.fill="solid"] Chip 채움 스타일
|
|
17
22
|
* @param {boolean} [props.rounded=false] pill radius 적용 여부
|
|
18
23
|
* @param {React.ReactNode} [props.children] Chip 라벨/콘텐츠
|
|
@@ -29,6 +34,7 @@ const isChipInputProps = (props: ChipProps): props is ChipInputProps =>
|
|
|
29
34
|
* @param {string} [props.title] root title
|
|
30
35
|
* @description
|
|
31
36
|
* - `chipStyle="input"`이면 `<figure>`를 렌더하고, 나머지 스타일은 `<button>`을 렌더한다.
|
|
37
|
+
* - `chipStyle="text"`일 때는 menu item 전용 text leaf를 렌더한다.
|
|
32
38
|
* - `chipStyle="input"`일 때 remove 버튼 클릭 이벤트는 root click으로 버블링되지 않도록 내부에서 차단한다.
|
|
33
39
|
* - native HTML attrs는 style에 맞는 root 요소로 그대로 전달된다.
|
|
34
40
|
* @returns {JSX.Element} style에 맞는 Chip root 요소
|
|
@@ -56,6 +62,17 @@ const ChipDefault = forwardRef<HTMLElement, ChipProps>((props, ref) => {
|
|
|
56
62
|
);
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
if (isChipTextProps(props)) {
|
|
66
|
+
return (
|
|
67
|
+
<ChipTextStyle
|
|
68
|
+
{...props}
|
|
69
|
+
// 변경: text leaf도 root 역할 className을 동일하게 누적한다.
|
|
70
|
+
className={mergedClassName}
|
|
71
|
+
ref={ref as Ref<HTMLButtonElement>}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
59
76
|
return (
|
|
60
77
|
// 변경: 역할 className을 루트 컴포넌트에서 누적 전달한다.
|
|
61
78
|
// 변경: interactive 경로도 forwardRef 기반 ref 전달로 통일한다.
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type CSSProperties } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import type { ChipListRootProps } from "
|
|
4
|
-
import ChipClickableStyle from "
|
|
5
|
-
import ChipInputStyle from "
|
|
3
|
+
import type { ChipListRootProps } from "../../types";
|
|
4
|
+
import ChipClickableStyle from "../templates/DefaultStyle";
|
|
5
|
+
import ChipInputStyle from "../templates/InputStyle";
|
|
6
|
+
import ChipTextStyle from "../templates/TextStyle";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Chip Markup; List Root 템플릿 컴포넌트
|
|
9
10
|
* @component
|
|
10
11
|
* @param {ChipListRootProps<OptionData>} props list root props
|
|
11
12
|
* @param {ChipListItemData<OptionData>[]} props.items 렌더링할 chip 엔트리 목록
|
|
12
|
-
* @param {"filter" | "assist" | "input"} [props.chipStyle="filter"] item 공통 chip 스타일
|
|
13
|
+
* @param {"filter" | "assist" | "input" | "text"} [props.chipStyle="filter"] item 공통 chip 스타일
|
|
13
14
|
* @param {"solid" | "outlined"} [props.fill="solid"] item 공통 chip 채움 스타일
|
|
14
15
|
* @param {boolean} [props.rounded=false] item 공통 pill radius 적용 여부
|
|
15
16
|
* @param {"default" | "table"} [props.size="default"] item 공통 chip 사이즈 축
|
|
@@ -35,6 +36,7 @@ function ChipListRoot<OptionData = unknown>({
|
|
|
35
36
|
style,
|
|
36
37
|
...restProps
|
|
37
38
|
}: ChipListRootProps<OptionData>) {
|
|
39
|
+
// 변경: text list는 title/header 없이 item row만 담당하고, 외부에서 헤더를 조합한다.
|
|
38
40
|
const mergedStyle = {
|
|
39
41
|
...style,
|
|
40
42
|
...(typeof gap === "undefined" ? {} : { gap }),
|
|
@@ -64,6 +66,20 @@ function ChipListRoot<OptionData = unknown>({
|
|
|
64
66
|
>
|
|
65
67
|
{item.label}
|
|
66
68
|
</ChipInputStyle>
|
|
69
|
+
) : chipStyle === "text" ? (
|
|
70
|
+
<ChipTextStyle
|
|
71
|
+
chipStyle="text"
|
|
72
|
+
fill={fill}
|
|
73
|
+
rounded={rounded}
|
|
74
|
+
size={size}
|
|
75
|
+
selected={item.selected}
|
|
76
|
+
disabled={item.disabled}
|
|
77
|
+
title={item.title}
|
|
78
|
+
className={clsx("chip-list-chip", item.className)}
|
|
79
|
+
onClick={item.onClick}
|
|
80
|
+
>
|
|
81
|
+
{item.label}
|
|
82
|
+
</ChipTextStyle>
|
|
67
83
|
) : (
|
|
68
84
|
<ChipClickableStyle
|
|
69
85
|
chipStyle={chipStyle}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
|
-
import RemoveIcon from "
|
|
3
|
-
import type { ChipRemoveButtonProps } from "
|
|
2
|
+
import RemoveIcon from "../../img/remove.svg";
|
|
3
|
+
import type { ChipRemoveButtonProps } from "../../types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Chip Markup; Input remove 버튼 컴포넌트
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { ChipDefault } from "./Chip";
|
|
2
|
-
import ChipClickableStyle from "./DefaultStyle";
|
|
3
|
-
import ChipInputStyle from "./InputStyle";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { ChipDefault } from "./foundation/Chip";
|
|
2
|
+
import ChipClickableStyle from "./templates/DefaultStyle";
|
|
3
|
+
import ChipInputStyle from "./templates/InputStyle";
|
|
4
|
+
import ChipTextStyle from "./templates/TextStyle";
|
|
5
|
+
import ChipLabel from "./foundation/Label";
|
|
6
|
+
import { ChipListRoot } from "./foundation/ListRoot";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* Chip; filter/assist/input namespace
|
|
9
|
+
* Chip; filter/assist/input/text namespace
|
|
9
10
|
* @desc
|
|
10
11
|
* - `Chip.Default`: style 분기 루트 컴포넌트다.
|
|
11
12
|
* - `Chip.ClickableStyle`: filter/assist button 렌더 전용 leaf다.
|
|
12
13
|
* - `Chip.InputStyle`: input figure 렌더 전용 leaf다.
|
|
14
|
+
* - `Chip.TextStyle`: text button 렌더 전용 leaf다.
|
|
13
15
|
* - `Chip.Label`: chip 텍스트 슬롯이다.
|
|
14
16
|
* - `Chip.List`: chip 목록 템플릿이다.
|
|
15
17
|
*/
|
|
@@ -17,6 +19,7 @@ export const Chip = {
|
|
|
17
19
|
Default: ChipDefault,
|
|
18
20
|
ClickableStyle: ChipClickableStyle,
|
|
19
21
|
InputStyle: ChipInputStyle,
|
|
22
|
+
TextStyle: ChipTextStyle,
|
|
20
23
|
Label: ChipLabel,
|
|
21
24
|
List: ChipListRoot,
|
|
22
25
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import type { ChipClickableStyleComponentProps } from "
|
|
4
|
-
import ChipLabel from "
|
|
3
|
+
import type { ChipClickableStyleComponentProps } from "../../types";
|
|
4
|
+
import ChipLabel from "../foundation/Label";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Chip Markup; Default/Interactive 스타일 렌더 컴포넌트
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { forwardRef } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import type { MouseEvent } from "react";
|
|
4
|
-
import type { ChipInputStyleProps } from "
|
|
5
|
-
import ChipRemoveButton from "
|
|
6
|
-
import ChipLabel from "
|
|
4
|
+
import type { ChipInputStyleProps } from "../../types";
|
|
5
|
+
import ChipRemoveButton from "../foundation/RemoveButton";
|
|
6
|
+
import ChipLabel from "../foundation/Label";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Chip Markup; Input 스타일 렌더 컴포넌트
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import type { ChipClickableStyleComponentProps } from "../../types";
|
|
4
|
+
import ChipLabel from "../foundation/Label";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Chip Markup; Text 스타일 렌더 컴포넌트
|
|
8
|
+
* @component
|
|
9
|
+
* @param {ChipClickableStyleComponentProps} props text 스타일 props
|
|
10
|
+
* @param {Ref<HTMLButtonElement>} ref button ref
|
|
11
|
+
* @param {React.ReactNode} [props.children] chip 라벨 콘텐츠
|
|
12
|
+
* @param {boolean} [props.selected] 선택 상태
|
|
13
|
+
* @param {string} [props.className] root className
|
|
14
|
+
* @param {"text"} [props.chipStyle] text style
|
|
15
|
+
* @param {"default" | "table"} [props.size] size 축
|
|
16
|
+
* @param {"solid" | "outlined"} [props.fill] 채움 스타일
|
|
17
|
+
* @param {boolean} [props.rounded] pill radius 적용 여부
|
|
18
|
+
* @param {"button" | "submit" | "reset"} [props.type] button type
|
|
19
|
+
* @example
|
|
20
|
+
* <ChipTextStyle chipStyle="text" selected ref={buttonRef}>
|
|
21
|
+
* 내용
|
|
22
|
+
* </ChipTextStyle>
|
|
23
|
+
*/
|
|
24
|
+
const ChipTextStyle = forwardRef<
|
|
25
|
+
HTMLButtonElement,
|
|
26
|
+
ChipClickableStyleComponentProps
|
|
27
|
+
>(
|
|
28
|
+
(
|
|
29
|
+
{
|
|
30
|
+
children,
|
|
31
|
+
selected,
|
|
32
|
+
className,
|
|
33
|
+
chipStyle: _chipStyle,
|
|
34
|
+
leading: _leading,
|
|
35
|
+
size = "default",
|
|
36
|
+
fill = "solid",
|
|
37
|
+
rounded = false,
|
|
38
|
+
type,
|
|
39
|
+
...restProps
|
|
40
|
+
},
|
|
41
|
+
ref,
|
|
42
|
+
) => {
|
|
43
|
+
void _chipStyle;
|
|
44
|
+
void _leading;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<button
|
|
48
|
+
{...restProps}
|
|
49
|
+
// 변경: text chip도 기존 interactive 계열과 동일한 forwardRef/button 계약을 유지한다.
|
|
50
|
+
ref={ref}
|
|
51
|
+
type={type ?? "button"}
|
|
52
|
+
className={clsx("chip", "chip-text-style", "chip-text-root", className)}
|
|
53
|
+
data-style="text"
|
|
54
|
+
data-fill={fill}
|
|
55
|
+
data-rounded={rounded ? "true" : undefined}
|
|
56
|
+
data-size={size}
|
|
57
|
+
data-selected={selected ? "true" : undefined}
|
|
58
|
+
aria-pressed={typeof selected === "boolean" ? selected : undefined}
|
|
59
|
+
>
|
|
60
|
+
{/* 변경: text style은 Figma 기준으로 leading slot을 열지 않고 label만 렌더한다. */}
|
|
61
|
+
<ChipLabel className="chip-text-label">{children}</ChipLabel>
|
|
62
|
+
</button>
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
ChipTextStyle.displayName = "ChipTextStyle";
|
|
68
|
+
|
|
69
|
+
export default ChipTextStyle;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.chip {
|
|
2
2
|
--chip-current-height: var(--theme-chip-height);
|
|
3
|
+
--chip-padding-horizontal: var(--theme-chip-padding-horizontal);
|
|
3
4
|
--chip-gap: var(--theme-chip-gap);
|
|
4
5
|
--chip-bg: transparent;
|
|
5
6
|
--chip-border-color: transparent;
|
|
@@ -9,8 +10,8 @@
|
|
|
9
10
|
justify-content: center;
|
|
10
11
|
gap: var(--chip-gap);
|
|
11
12
|
height: var(--chip-current-height);
|
|
12
|
-
padding-left: var(--
|
|
13
|
-
padding-right: var(--
|
|
13
|
+
padding-left: var(--chip-padding-horizontal);
|
|
14
|
+
padding-right: var(--chip-padding-horizontal);
|
|
14
15
|
padding-block: 0;
|
|
15
16
|
border-radius: var(--theme-chip-radius);
|
|
16
17
|
border: 1px solid var(--chip-border-color);
|
|
@@ -64,6 +65,27 @@ figure.chip {
|
|
|
64
65
|
--chip-border-color: transparent;
|
|
65
66
|
}
|
|
66
67
|
|
|
68
|
+
.chip:where([data-style="text"]) {
|
|
69
|
+
--chip-current-height: var(--theme-chip-height-text);
|
|
70
|
+
--chip-padding-horizontal: var(--theme-chip-padding-horizontal-text);
|
|
71
|
+
--chip-bg: transparent;
|
|
72
|
+
--chip-border-color: transparent;
|
|
73
|
+
--chip-label-color: var(--color-label-standard);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.chip:where([data-style="text"]) .chip-label {
|
|
77
|
+
text-decoration: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.chip:where([data-style="text"][data-selected="true"]) {
|
|
81
|
+
--chip-bg: var(--color-surface-standard);
|
|
82
|
+
font-weight: var(--theme-chip-text-font-weight-selected);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.chip:where([data-style="text"][data-selected="true"]) .chip-label {
|
|
86
|
+
text-decoration: underline;
|
|
87
|
+
}
|
|
88
|
+
|
|
67
89
|
.chip:where([data-style][data-rounded="true"]) {
|
|
68
90
|
border-radius: calc(var(--chip-current-height) / 2);
|
|
69
91
|
}
|
|
@@ -118,6 +140,10 @@ figure.chip {
|
|
|
118
140
|
line-height: var(--theme-chip-line-height-table);
|
|
119
141
|
}
|
|
120
142
|
|
|
143
|
+
.chip:where([data-size="table"][data-style="text"][data-selected="true"]) {
|
|
144
|
+
font-weight: var(--theme-chip-text-font-weight-selected);
|
|
145
|
+
}
|
|
146
|
+
|
|
121
147
|
.chip:where([data-size="table"][data-style="input"]) {
|
|
122
148
|
padding-left: var(--theme-chip-padding-left-table);
|
|
123
149
|
padding-right: var(--theme-chip-padding-right-table);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/* Chip 기본 토큰 래핑 */
|
|
2
2
|
:root {
|
|
3
3
|
--theme-chip-height: var(--theme-size-small-3);
|
|
4
|
+
/* 변경: Figma text menu item은 기본 chip보다 낮은 24px height를 사용한다. */
|
|
5
|
+
--theme-chip-height-text: 24px;
|
|
4
6
|
--theme-chip-padding-horizontal: var(--spacing-padding-5);
|
|
7
|
+
/* 변경: Figma text menu item은 8px horizontal padding을 사용한다. */
|
|
8
|
+
--theme-chip-padding-horizontal-text: var(--spacing-padding-4);
|
|
5
9
|
--theme-chip-gap: var(--spacing-gap-1);
|
|
6
10
|
--theme-chip-assist-gap: var(--spacing-gap-2);
|
|
7
11
|
--theme-chip-input-gap: var(--spacing-gap-1);
|
|
@@ -28,4 +32,6 @@
|
|
|
28
32
|
--theme-chip-font-family: var(--font-body-medium-family);
|
|
29
33
|
--theme-chip-font-size: var(--font-body-xsmall-size);
|
|
30
34
|
--theme-chip-font-weight: var(--font-body-xsmall-weight);
|
|
35
|
+
/* 변경: text selected chip은 Figma semibold 상태를 foundation typography weight로 매핑한다. */
|
|
36
|
+
--theme-chip-text-font-weight-selected: var(--font-caption-large-weight);
|
|
31
37
|
}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* - filter
|
|
5
5
|
* - assist
|
|
6
6
|
* - input
|
|
7
|
+
* - text
|
|
7
8
|
*/
|
|
8
|
-
export const CHIP_STYLES = ["filter", "assist", "input"] as const;
|
|
9
|
+
export const CHIP_STYLES = ["filter", "assist", "input", "text"] as const;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Chip Types; fill 옵션 목록
|
|
@@ -41,6 +42,6 @@ export type ChipSize = (typeof CHIP_SIZES)[number];
|
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Chip Types; interactive style union 타입
|
|
44
|
-
* @typedef {"filter" | "assist"} ChipInteractiveStyle
|
|
45
|
+
* @typedef {"filter" | "assist" | "text"} ChipInteractiveStyle
|
|
45
46
|
*/
|
|
46
47
|
export type ChipInteractiveStyle = Exclude<ChipStyle, "input">;
|
|
@@ -71,7 +71,7 @@ export interface ChipCommonProps {
|
|
|
71
71
|
export interface ChipInteractiveProps extends ChipCommonProps, ButtonProps {
|
|
72
72
|
/**
|
|
73
73
|
* input을 제외한 interactive 스타일.
|
|
74
|
-
* "filter" | "assist"
|
|
74
|
+
* "filter" | "assist" | "text"
|
|
75
75
|
*/
|
|
76
76
|
chipStyle?: ChipInteractiveStyle;
|
|
77
77
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
// Figma 기준 bottom sheet 여백/톤을 전역 변수로 정리한다.
|
|
3
3
|
--drawer-overlay-bg: rgba(0, 0, 0, 0.44);
|
|
4
|
+
--drawer-overlay-z-index: 900;
|
|
5
|
+
--drawer-content-z-index: 901;
|
|
4
6
|
--drawer-surface-bg: var(--color-surface-static-white);
|
|
5
7
|
--drawer-radius-large: var(--theme-radius-large-2);
|
|
6
8
|
--drawer-radius-medium: var(--theme-radius-large-1);
|
|
@@ -26,6 +28,7 @@
|
|
|
26
28
|
.drawer-overlay {
|
|
27
29
|
position: fixed;
|
|
28
30
|
inset: 0;
|
|
31
|
+
z-index: var(--drawer-overlay-z-index);
|
|
29
32
|
background-color: var(--drawer-overlay-bg);
|
|
30
33
|
opacity: 0;
|
|
31
34
|
pointer-events: none;
|
|
@@ -55,6 +58,7 @@
|
|
|
55
58
|
position: fixed;
|
|
56
59
|
display: flex;
|
|
57
60
|
flex-direction: column;
|
|
61
|
+
z-index: var(--drawer-content-z-index);
|
|
58
62
|
background-color: var(--drawer-surface-bg);
|
|
59
63
|
outline: none;
|
|
60
64
|
border: none;
|