@tide-tds/components 0.5.1 → 0.7.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/dist/Accordion.js +1 -1
- package/dist/Alert.js +2 -2
- package/dist/Avatar.d.ts +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Badge.d.ts +10 -4
- package/dist/Badge.js +2 -1
- package/dist/Table.js +1 -1
- package/dist/Tag.d.ts +1 -1
- package/dist/Tag.js +1 -1
- package/dist/Toast.d.ts +1 -1
- package/dist/Toast.js +2 -2
- package/dist/alert-style.js +12 -7
- package/dist/list-style.js +5 -4
- package/dist/pressable.js +7 -4
- package/package.json +3 -3
package/dist/Accordion.js
CHANGED
|
@@ -19,7 +19,7 @@ const accordionClass = "rounded-lg border border-default text-default";
|
|
|
19
19
|
const itemClass = "not-first:border-t not-first:border-default";
|
|
20
20
|
const triggerClass = [
|
|
21
21
|
"group flex flex-1 cursor-pointer items-center gap-3 rounded-md px-4 py-3 text-start text-label-lg outline-none select-none",
|
|
22
|
-
"enabled:hover:bg-
|
|
22
|
+
"enabled:hover:bg-hover focus-visible:focus-ring",
|
|
23
23
|
"disabled:cursor-not-allowed disabled:text-disabled"
|
|
24
24
|
].join(" ");
|
|
25
25
|
const chevronClass = "ms-auto shrink-0 text-muted group-hover:group-enabled:text-default group-disabled:text-disabled group-aria-expanded:rotate-180 motion-safe:transition-[rotate] forced-colors:text-current forced-colors:group-disabled:text-current";
|
package/dist/Alert.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { alertCloseClass, alertContentClass, alertDescriptionClass, alertIconClass, alertLayoutClass, alertStatusIcon, alertSurfaceClass, alertTitleClass } from "./alert-style.js";
|
|
1
|
+
import { alertCloseClass, alertContentClass, alertDescriptionClass, alertIconClass, alertLayoutClass, alertStatusIcon, alertSubtleCloseClass, alertSurfaceClass, alertTitleClass } from "./alert-style.js";
|
|
2
2
|
import { cn } from "./cn.js";
|
|
3
3
|
import { IconButton } from "./IconButton.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -37,7 +37,7 @@ function Alert({ color = "info", title, children, onClose, closeLabel = "닫기"
|
|
|
37
37
|
color,
|
|
38
38
|
size: "xs",
|
|
39
39
|
onClick: onClose,
|
|
40
|
-
className: "-my-0.5 -me-1"
|
|
40
|
+
className: `${"-my-0.5 -me-1"} ${"text-accent-on-subtle hover:bg-accent-subtle-hover active:bg-accent-subtle-active"}`,
|
|
41
41
|
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
42
42
|
})
|
|
43
43
|
]
|
package/dist/Avatar.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface AvatarProps extends Omit<ComponentProps<"span">, "color" | "chi
|
|
|
13
13
|
/** `xs` 24px, `sm` 32px, `md` 40px, `lg` 48px. 기본값은 `md`다. */
|
|
14
14
|
size?: AvatarSize;
|
|
15
15
|
/**
|
|
16
|
-
* fallback 배경과 아이콘의 색 계열(Tide 색 계열
|
|
16
|
+
* fallback 배경과 아이콘의 색 계열(Tide 색 계열 8개(장식 계열 purple·mint 포함)와 앱이 `ColorFamilyRegistry`에 더한 계열).
|
|
17
17
|
* 뜻이 없는 장식 색이라 Role은 받지 않는다(ADR 0016·0017 후속). 기본값은 `gray`다.
|
|
18
18
|
* 루트에 `data-color`로 붙고 바깥 요소의 색을 물려받지 않는다.
|
|
19
19
|
*/
|
package/dist/Avatar.js
CHANGED
|
@@ -10,7 +10,7 @@ const sizeClass = {
|
|
|
10
10
|
md: "size-10 [&_svg]:size-6",
|
|
11
11
|
lg: "size-12 [&_svg]:size-7"
|
|
12
12
|
};
|
|
13
|
-
const baseClass = "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-accent-subtle text-accent align-middle select-none [&_svg]:shrink-0";
|
|
13
|
+
const baseClass = "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-accent-subtle text-accent-on-subtle align-middle select-none [&_svg]:shrink-0";
|
|
14
14
|
/** 이미지 층. 아이콘 위에 원 전체를 덮고, `object-fit: cover`처럼 가운데를 채운다. */
|
|
15
15
|
const imageClass = "absolute inset-0 bg-cover bg-center bg-no-repeat";
|
|
16
16
|
/**
|
package/dist/Badge.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { Color, FillVariant, Size } from "./types.js";
|
|
2
2
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Badge의 채움 방식. 상호작용이 없어 테두리·투명 채움(`outline`·`ghost`)은 받지 않는다.
|
|
5
|
+
* `faint`는 Badge에만 있는 가장 옅은 강도라(ADR 0022 §1) Button류 공통 `FillVariant`에 넣지 않는다.
|
|
6
|
+
*/
|
|
7
|
+
type BadgeVariant = Extract<FillVariant, "subtle" | "solid"> | "faint";
|
|
5
8
|
/** Badge의 size. 조작 요소가 아니라 높이가 size 표보다 한 단계 작다(`sm` 20px, `md` 24px). */
|
|
6
9
|
type BadgeSize = Extract<Size, "sm" | "md">;
|
|
7
10
|
export interface BadgeProps extends Omit<ComponentProps<"span">, "color" | "children"> {
|
|
8
11
|
/** 상태를 말하는 텍스트. 필수다. 색만으로 상태를 전하지 않기 위해서다(WCAG 1.4.1). */
|
|
9
12
|
children: ReactNode;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* `subtle`(파스텔 배경과 테두리, 기본값), `faint`(가장 옅은 배경, 테두리 없음), `solid`(진한 배경).
|
|
15
|
+
* 같은 화면 안에서는 한 가지로 맞춘다.
|
|
16
|
+
*/
|
|
11
17
|
variant?: BadgeVariant;
|
|
12
18
|
/** `sm` 높이 20px·`label-sm`, `md` 높이 24px·`label-md`. 기본값은 `md`다. */
|
|
13
19
|
size?: BadgeSize;
|
|
14
20
|
/**
|
|
15
21
|
* 색 이름. 상태는 Role(Tide Role 6개와 앱이 `RoleRegistry`에 더한 Role), 뜻 없는 분류는 색 계열 이름
|
|
16
|
-
* (Tide 색 계열
|
|
22
|
+
* (Tide 색 계열 8개(장식 계열 purple·mint 포함)와 앱이 `ColorFamilyRegistry`에 더한 계열)을 쓴다(ADR 0016·0017). 기본값은 `neutral`이다.
|
|
17
23
|
* 루트에 `data-color`로 붙고 바깥 요소의 색을 물려받지 않는다.
|
|
18
24
|
*/
|
|
19
25
|
color?: Color;
|
package/dist/Badge.js
CHANGED
|
@@ -3,7 +3,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
// src/Badge.tsx
|
|
5
5
|
const variantClass = {
|
|
6
|
-
subtle: "bg-accent-subtle text-accent",
|
|
6
|
+
subtle: "border-accent-subtle bg-accent-subtle text-accent-on-subtle",
|
|
7
|
+
faint: "bg-accent-faint text-accent-on-subtle",
|
|
7
8
|
solid: "bg-accent-solid text-accent-on-solid"
|
|
8
9
|
};
|
|
9
10
|
/** 높이는 border 1px를 포함한다. 글자 줄 높이(label-sm 16px, label-md 20px) + border 2px + 세로 여백이다. */
|
package/dist/Table.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
// src/Table.tsx
|
|
5
5
|
const tableClass = "w-full border-collapse text-body-sm text-default";
|
|
6
|
-
const rowClass = "border-b border-default [:where(tbody>&)]:hover:bg-
|
|
6
|
+
const rowClass = "border-b border-default [:where(tbody>&)]:hover:bg-hover";
|
|
7
7
|
const headerCellClass = "px-3 py-2.5 text-start align-middle text-label-md";
|
|
8
8
|
const cellClass = "px-3 py-2.5 text-start align-middle";
|
|
9
9
|
/**
|
package/dist/Tag.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface TagProps extends Omit<ComponentProps<"div">, "color" | "role" |
|
|
|
34
34
|
/** 태그 글자. 필수다. 아이콘(장식용)을 앞에 함께 둘 수 있다. */
|
|
35
35
|
children: ReactNode;
|
|
36
36
|
/**
|
|
37
|
-
* 색 계열 이름. Tide 색 계열
|
|
37
|
+
* 색 계열 이름. Tide 색 계열 8개(장식 계열 purple·mint 포함)와 앱이 `ColorFamilyRegistry`에 더한 계열을 받는다. 기본값은 `gray`다.
|
|
38
38
|
* 분류를 구분하는 뜻 없는 색이라 Role(`primary`·`danger` 등)은 받지 않는다(ADR 0016·0017 후속).
|
|
39
39
|
* 루트에 `data-color`로 붙고 바깥 요소의 색을 물려받지 않는다.
|
|
40
40
|
*/
|
package/dist/Tag.js
CHANGED
|
@@ -13,7 +13,7 @@ import { useListState } from "react-stately";
|
|
|
13
13
|
const TagGroupContext = createContext(null);
|
|
14
14
|
const tagGroupClass = "flex flex-wrap items-center gap-2 outline-none";
|
|
15
15
|
const tagClass = [
|
|
16
|
-
"inline-flex h-8 max-w-full min-w-0 shrink-0 items-center rounded-sm border border-
|
|
16
|
+
"inline-flex h-8 max-w-full min-w-0 shrink-0 items-center rounded-sm border border-accent-subtle bg-accent-subtle ps-2.5 align-middle text-label-md whitespace-nowrap text-accent-on-subtle outline-none select-none",
|
|
17
17
|
"[--tag-remove-hover:var(--tide-accent-subtle-hover)] [--tag-remove-active:var(--tide-accent-subtle-active)]",
|
|
18
18
|
"aria-disabled:bg-disabled aria-disabled:text-disabled focus-visible:focus-ring"
|
|
19
19
|
].join(" ");
|
package/dist/Toast.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface ToastOptions {
|
|
|
17
17
|
description?: ReactNode;
|
|
18
18
|
/**
|
|
19
19
|
* Role. Tide Role 6개와 앱이 `RoleRegistry`에 더한 Role을 받는다. 기본값은 `info`다(Alert와 같다).
|
|
20
|
-
* 상태 아이콘과 그
|
|
20
|
+
* 상태 아이콘과 그 색을 정한다. 닫기·액션 버튼은 색과 관계없이 neutral이다. `danger`(오류)는 자동으로 닫지 않는다.
|
|
21
21
|
* 색 계열 이름(`blue` 등)은 받지 않는다(ADR 0016).
|
|
22
22
|
*/
|
|
23
23
|
color?: Role;
|
package/dist/Toast.js
CHANGED
|
@@ -165,7 +165,7 @@ function ToastItem({ toast, open, state, onExited }) {
|
|
|
165
165
|
})]
|
|
166
166
|
}), action !== void 0 && /* @__PURE__ */ jsx(Button, {
|
|
167
167
|
variant: "outline",
|
|
168
|
-
color,
|
|
168
|
+
color: "neutral",
|
|
169
169
|
size: "sm",
|
|
170
170
|
className: "self-start",
|
|
171
171
|
onClick: (event) => {
|
|
@@ -178,7 +178,7 @@ function ToastItem({ toast, open, state, onExited }) {
|
|
|
178
178
|
/* @__PURE__ */ jsx(IconButton, {
|
|
179
179
|
"aria-label": closeLabel,
|
|
180
180
|
variant: "ghost",
|
|
181
|
-
color,
|
|
181
|
+
color: "neutral",
|
|
182
182
|
size: "xs",
|
|
183
183
|
onClick: close,
|
|
184
184
|
className: alertCloseClass,
|
package/dist/alert-style.js
CHANGED
|
@@ -7,13 +7,12 @@ import { CircleCheckIcon, InfoIcon, OctagonExclamationPointIcon, TriangleExclama
|
|
|
7
7
|
*/
|
|
8
8
|
const alertLayoutClass = "flex items-start gap-3 rounded-lg border p-4";
|
|
9
9
|
/**
|
|
10
|
-
* Alert의 subtle
|
|
11
|
-
* - 글자·아이콘: text-accent × bg-accent-subtle 4.5:1(Role `text-<role
|
|
12
|
-
* bg-neutral-subtle, 앱 Role은 색 이름 규칙
|
|
13
|
-
* - 경계: border-accent
|
|
14
|
-
* × 안쪽 bg-accent-subtle 3:1(`border-<role>` × `bg-<role>-subtle`, neutral은 border-strong × bg-neutral-subtle)
|
|
10
|
+
* Alert의 subtle 표면(ADR 0022 §1).
|
|
11
|
+
* - 글자·아이콘: text-accent-on-subtle × bg-accent-subtle 4.5:1(Role `text-<role>-on-subtle` × `bg-<role>-subtle`, neutral은
|
|
12
|
+
* text-default × bg-neutral-subtle, 앱 Role은 색 이름 규칙 on-subtle × subtle)
|
|
13
|
+
* - 경계: 파스텔 테두리 border-accent-subtle. 바탕과 글자만으로 알아볼 수 있어 꾸밈이고 대비 검사에서 뺐다.
|
|
15
14
|
*/
|
|
16
|
-
const alertSurfaceClass = "border-accent bg-accent-subtle text-accent";
|
|
15
|
+
const alertSurfaceClass = "border-accent-subtle bg-accent-subtle text-accent-on-subtle";
|
|
17
16
|
/** 상태 아이콘 자리. 글자 첫 줄 높이(body-sm 20px)와 같은 20px라 첫 줄 가운데에 맞는다. */
|
|
18
17
|
const alertIconClass = "size-5 shrink-0";
|
|
19
18
|
/** 제목과 본문을 세로로 쌓는다. 긴 단어가 닫기 버튼을 밀어내지 않게 min-w-0을 둔다. */
|
|
@@ -24,6 +23,12 @@ const alertTitleClass = "text-body-sm font-semibold";
|
|
|
24
23
|
const alertDescriptionClass = "text-body-sm";
|
|
25
24
|
/** 닫기 버튼(IconButton xs, 24px). 위아래 2px를 겹쳐 첫 줄 높이(20px)를 늘리지 않고, 끝쪽 4px를 여백에 겹친다. */
|
|
26
25
|
const alertCloseClass = "-my-0.5 -me-1";
|
|
26
|
+
/**
|
|
27
|
+
* Alert(subtle 표면) 안 닫기 버튼의 색. ghost의 기본(text-accent, bg-hover·bg-active)을 덮어쓴다.
|
|
28
|
+
* subtle 바탕 위라 글자는 on-subtle이고, hover·누름은 같은 색의 subtle-hover·subtle-active다
|
|
29
|
+
* (on-subtle × subtle 4.5:1, × subtle-hover·subtle-active 4:1 등록, ADR 0022·0023).
|
|
30
|
+
*/
|
|
31
|
+
const alertSubtleCloseClass = "text-accent-on-subtle hover:bg-accent-subtle-hover active:bg-accent-subtle-active";
|
|
27
32
|
const statusIcons = {
|
|
28
33
|
neutral: InfoIcon,
|
|
29
34
|
primary: InfoIcon,
|
|
@@ -37,4 +42,4 @@ function alertStatusIcon(color) {
|
|
|
37
42
|
return Object.hasOwn(statusIcons, color) ? statusIcons[color] : InfoIcon;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
export { alertCloseClass, alertContentClass, alertDescriptionClass, alertIconClass, alertLayoutClass, alertStatusIcon, alertSurfaceClass, alertTitleClass };
|
|
45
|
+
export { alertCloseClass, alertContentClass, alertDescriptionClass, alertIconClass, alertLayoutClass, alertStatusIcon, alertSubtleCloseClass, alertSurfaceClass, alertTitleClass };
|
package/dist/list-style.js
CHANGED
|
@@ -21,9 +21,10 @@ const listPopupClass = `isolate z-popover min-w-40 max-w-80 overflow-auto p-[3px
|
|
|
21
21
|
* 투명 outline은 평소에는 보이지 않고 forced-colors에서 시스템 색으로 그려져 위치가 남는다(그 모드는 배경을 덮는다).
|
|
22
22
|
* 기본 `outline-none`이 outline 모양 변수를 none으로 두므로 `outline-solid`를 함께 쓴다.
|
|
23
23
|
* 항목 안쪽(`-outline-offset-2`)에 그려 이웃 항목·목록 경계와 겹치지 않는다.
|
|
24
|
-
* - `hover`(highlight가 아닐 때):
|
|
25
|
-
* 마우스가 다른 항목 위에 있는 경우다.
|
|
26
|
-
* - `data-selected`(highlight가 아닐 때): 선택 유지 `subtle-active`(neutral).
|
|
24
|
+
* - `hover`(highlight가 아닐 때): 색 없이 덮는 `bg-hover`(ADR 0022 §3). 키보드로 옮긴 위치가 따로 있을 때
|
|
25
|
+
* 마우스가 다른 항목 위에 있는 경우다. text-default × bg-hover(bg-raised 위 합성)가 4:1(일시 상태, ADR 0023)로 등록되어 있다.
|
|
26
|
+
* - `data-selected`(highlight가 아닐 때): 선택 유지 `subtle-active`(neutral). 상태를 나타내는 바탕이라 덮기로 바꾸지 않는다.
|
|
27
|
+
* Select·Combobox의 고른 옵션이 쓴다.
|
|
27
28
|
* - `data-disabled`: `text-disabled`, `cursor-not-allowed`. hover 배경이 없다.
|
|
28
29
|
* - 상태끼리 겹칠 때 순서에 기대지 않도록 `not-data-highlighted:`로 서로 뺀다.
|
|
29
30
|
* - transition이 없다. 반복되는 목록 항목은 바로 바뀐다(spec 「motion 적용」).
|
|
@@ -32,7 +33,7 @@ const listPopupClass = `isolate z-popover min-w-40 max-w-80 overflow-auto p-[3px
|
|
|
32
33
|
*/
|
|
33
34
|
const listItemClass = [
|
|
34
35
|
"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-md text-default outline-none select-none [&>svg]:size-4 [&>svg]:shrink-0",
|
|
35
|
-
"hover:not-data-highlighted:not-data-disabled:bg-
|
|
36
|
+
"hover:not-data-highlighted:not-data-disabled:bg-hover",
|
|
36
37
|
"data-selected:not-data-highlighted:bg-neutral-subtle-active",
|
|
37
38
|
"data-highlighted:bg-primary-subtle data-highlighted:text-primary data-highlighted:outline-2 data-highlighted:outline-solid data-highlighted:-outline-offset-2 data-highlighted:outline-transparent",
|
|
38
39
|
"data-disabled:cursor-not-allowed data-disabled:text-disabled"
|
package/dist/pressable.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// src/pressable.ts
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* 기본 색(배경, 글자, 경계). 색 이름마다 Foundation이 같은 대비 규칙으로 검사한다.
|
|
4
|
+
* subtle 바탕 위 글자는 파스텔 글자 on-subtle이고(ADR 0022 §1), outline·ghost 글자는 바탕 없는 색 글자 text다.
|
|
5
|
+
*/
|
|
3
6
|
const colorClass = {
|
|
4
7
|
solid: "border-transparent bg-accent-solid text-accent-on-solid",
|
|
5
|
-
subtle: "border-transparent bg-accent-subtle text-accent",
|
|
8
|
+
subtle: "border-transparent bg-accent-subtle text-accent-on-subtle",
|
|
6
9
|
outline: "border-accent text-accent",
|
|
7
10
|
ghost: "border-transparent text-accent"
|
|
8
11
|
};
|
|
@@ -10,8 +13,8 @@ const colorClass = {
|
|
|
10
13
|
const interactionClass = {
|
|
11
14
|
solid: "hover:bg-accent-solid-hover active:bg-accent-solid-active",
|
|
12
15
|
subtle: "hover:bg-accent-subtle-hover active:bg-accent-subtle-active",
|
|
13
|
-
outline: "hover:bg-
|
|
14
|
-
ghost: "hover:bg-
|
|
16
|
+
outline: "hover:bg-hover active:bg-active",
|
|
17
|
+
ghost: "hover:bg-hover active:bg-active"
|
|
15
18
|
};
|
|
16
19
|
/** 비활성 색. 색 이름과 관계없이 같다. disabled Token은 대비 검사 대상이 아니다. */
|
|
17
20
|
const disabledClass = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tide-tds/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Tide 디자인 시스템의 React Component",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"./styles.css": "./dist/styles.css"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tide-tds/foundation": "0.
|
|
27
|
-
"@tide-tds/icons": "0.
|
|
26
|
+
"@tide-tds/foundation": "0.7.0",
|
|
27
|
+
"@tide-tds/icons": "0.7.0",
|
|
28
28
|
"clsx": "^2.1.1",
|
|
29
29
|
"react-aria": "^3.53.1",
|
|
30
30
|
"react-stately": "^3.51.0",
|