@tide-design/components 0.11.4 → 0.12.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/Accordion.d.ts +6 -2
- package/dist/Accordion/Accordion.js +4 -1
- package/dist/Accordion/components/AccordionItem.d.ts +3 -1
- package/dist/Accordion/components/AccordionItem.js +1 -0
- package/dist/Accordion/components/AccordionPanel.d.ts +3 -1
- package/dist/Accordion/components/AccordionPanel.js +1 -0
- package/dist/Accordion/components/AccordionTrigger.d.ts +3 -1
- package/dist/Accordion/components/AccordionTrigger.js +1 -0
- package/dist/Accordion/index.d.ts +5 -5
- package/dist/Alert/Alert.d.ts +6 -2
- package/dist/Alert/Alert.js +4 -1
- package/dist/Alert/index.d.ts +2 -2
- package/dist/Avatar/Avatar.d.ts +3 -1
- package/dist/Avatar/Avatar.js +1 -0
- package/dist/Avatar/index.d.ts +2 -2
- package/dist/Badge/Badge.d.ts +6 -2
- package/dist/Badge/Badge.js +4 -1
- package/dist/Badge/index.d.ts +2 -2
- package/dist/Breadcrumb/Breadcrumb.d.ts +3 -1
- package/dist/Breadcrumb/Breadcrumb.js +1 -0
- package/dist/Breadcrumb/components/BreadcrumbLink.d.ts +6 -2
- package/dist/Breadcrumb/components/BreadcrumbLink.js +4 -1
- package/dist/Breadcrumb/index.d.ts +3 -3
- package/dist/Button/Button.d.ts +6 -2
- package/dist/Button/Button.js +4 -1
- package/dist/Button/index.d.ts +2 -2
- package/dist/Card/Card.d.ts +3 -1
- package/dist/Card/Card.js +1 -0
- package/dist/Card/index.d.ts +2 -2
- package/dist/Checkbox/Checkbox.d.ts +6 -2
- package/dist/Checkbox/Checkbox.js +4 -1
- package/dist/Checkbox/index.d.ts +2 -2
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +3 -1
- package/dist/CheckboxGroup/CheckboxGroup.js +1 -0
- package/dist/CheckboxGroup/index.d.ts +2 -2
- package/dist/Combobox/Combobox.d.ts +3 -1
- package/dist/Combobox/Combobox.js +1 -0
- package/dist/Combobox/components/ComboboxItem.d.ts +3 -1
- package/dist/Combobox/components/ComboboxItem.js +1 -0
- package/dist/Combobox/index.d.ts +3 -3
- package/dist/Dialog/components/DialogClose.d.ts +3 -1
- package/dist/Dialog/components/DialogClose.js +1 -0
- package/dist/Dialog/components/DialogContent.d.ts +3 -1
- package/dist/Dialog/components/DialogContent.js +1 -0
- package/dist/Dialog/components/DialogTrigger.d.ts +3 -1
- package/dist/Dialog/components/DialogTrigger.js +1 -0
- package/dist/Dialog/index.d.ts +4 -4
- package/dist/Field/Field.d.ts +3 -1
- package/dist/Field/Field.js +1 -0
- package/dist/Field/index.d.ts +2 -2
- package/dist/IconButton/IconButton.d.ts +6 -2
- package/dist/IconButton/IconButton.js +4 -1
- package/dist/IconButton/index.d.ts +2 -2
- package/dist/Input/Input.d.ts +3 -1
- package/dist/Input/Input.js +1 -0
- package/dist/Input/index.d.ts +2 -2
- package/dist/Link/Link.d.ts +6 -2
- package/dist/Link/Link.js +4 -1
- package/dist/Link/index.d.ts +2 -2
- package/dist/Menu/components/MenuContent.d.ts +3 -1
- package/dist/Menu/components/MenuContent.js +1 -0
- package/dist/Menu/components/MenuItem.d.ts +3 -1
- package/dist/Menu/components/MenuItem.js +1 -0
- package/dist/Menu/components/MenuTrigger.d.ts +3 -1
- package/dist/Menu/components/MenuTrigger.js +1 -0
- package/dist/Menu/index.d.ts +4 -4
- package/dist/Pagination/Pagination.d.ts +3 -1
- package/dist/Pagination/Pagination.js +1 -0
- package/dist/Pagination/components/PaginationEllipsis.d.ts +6 -2
- package/dist/Pagination/components/PaginationEllipsis.js +4 -1
- package/dist/Pagination/components/PaginationLink.d.ts +6 -2
- package/dist/Pagination/components/PaginationLink.js +4 -1
- package/dist/Pagination/components/PaginationNext.d.ts +6 -2
- package/dist/Pagination/components/PaginationNext.js +4 -1
- package/dist/Pagination/components/PaginationPrevious.d.ts +6 -2
- package/dist/Pagination/components/PaginationPrevious.js +4 -1
- package/dist/Pagination/index.d.ts +6 -6
- package/dist/Pagination/types.d.ts +5 -4
- package/dist/Popover/components/PopoverContent.d.ts +3 -1
- package/dist/Popover/components/PopoverContent.js +1 -0
- package/dist/Popover/components/PopoverTrigger.d.ts +3 -1
- package/dist/Popover/components/PopoverTrigger.js +1 -0
- package/dist/Popover/index.d.ts +3 -3
- package/dist/Progress/Progress.d.ts +6 -3
- package/dist/Progress/Progress.js +4 -1
- package/dist/Progress/index.d.ts +2 -2
- package/dist/Radio/Radio.d.ts +6 -2
- package/dist/Radio/Radio.js +4 -1
- package/dist/Radio/index.d.ts +2 -2
- package/dist/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/RadioGroup/RadioGroup.js +1 -0
- package/dist/RadioGroup/index.d.ts +2 -2
- package/dist/Select/Select.d.ts +3 -1
- package/dist/Select/Select.js +1 -0
- package/dist/Select/components/SelectItem.d.ts +3 -1
- package/dist/Select/components/SelectItem.js +1 -0
- package/dist/Select/index.d.ts +3 -3
- package/dist/Separator/Separator.d.ts +6 -2
- package/dist/Separator/Separator.js +4 -1
- package/dist/Separator/index.d.ts +2 -2
- package/dist/Skeleton/Skeleton.d.ts +4 -3
- package/dist/Skeleton/Skeleton.js +1 -0
- package/dist/Skeleton/index.d.ts +2 -2
- package/dist/Spinner/Spinner.d.ts +3 -1
- package/dist/Spinner/Spinner.js +1 -0
- package/dist/Spinner/index.d.ts +2 -2
- package/dist/Switch/Switch.d.ts +3 -1
- package/dist/Switch/Switch.js +2 -1
- package/dist/Switch/index.d.ts +2 -2
- package/dist/Table/components/TableHeaderCell.d.ts +3 -1
- package/dist/Table/components/TableHeaderCell.js +1 -0
- package/dist/Table/index.d.ts +2 -2
- package/dist/Tabs/Tabs.d.ts +4 -2
- package/dist/Tabs/Tabs.js +1 -0
- package/dist/Tabs/components/Tab.d.ts +3 -1
- package/dist/Tabs/components/Tab.js +1 -0
- package/dist/Tabs/components/TabList.d.ts +3 -1
- package/dist/Tabs/components/TabList.js +1 -0
- package/dist/Tabs/components/TabPanel.d.ts +3 -1
- package/dist/Tabs/components/TabPanel.js +1 -0
- package/dist/Tabs/index.d.ts +5 -5
- package/dist/Tag/Tag.d.ts +3 -1
- package/dist/Tag/Tag.js +1 -0
- package/dist/Tag/components/TagGroup.d.ts +3 -2
- package/dist/Tag/components/TagGroup.js +1 -0
- package/dist/Tag/index.d.ts +3 -3
- package/dist/Textarea/Textarea.d.ts +3 -1
- package/dist/Textarea/Textarea.js +1 -0
- package/dist/Textarea/index.d.ts +2 -2
- package/dist/Toast/Toast.d.ts +3 -1
- package/dist/Toast/Toast.js +1 -0
- package/dist/Toast/index.d.ts +2 -2
- package/dist/Tooltip/components/TooltipContent.d.ts +3 -1
- package/dist/Tooltip/components/TooltipContent.js +1 -0
- package/dist/Tooltip/components/TooltipTrigger.d.ts +3 -1
- package/dist/Tooltip/components/TooltipTrigger.js +1 -0
- package/dist/Tooltip/index.d.ts +3 -3
- package/dist/Typography/Typography.d.ts +8 -4
- package/dist/Typography/Typography.js +1 -0
- package/dist/Typography/index.d.ts +2 -2
- package/dist/_internal/components/ListBoxNodes/types.d.ts +2 -1
- package/dist/_internal/constants/choiceClass.js +1 -1
- package/dist/_internal/constants/pressableClass.js +9 -2
- package/dist/_internal/libs/pressableState.js +2 -1
- package/dist/index.d.ts +54 -54
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface AccordionOwnProps {
|
|
3
3
|
/** 펼친 항목의 값 목록(제어). `multiple`이 아닌데 값이 둘 이상이면 첫 값만 남긴다. */
|
|
4
4
|
value?: readonly string[];
|
|
5
5
|
/** 처음 펼친 항목의 값 목록(비제어). 기본값은 빈 목록(모두 접힘)이다. */
|
|
@@ -11,5 +11,9 @@ export interface AccordionProps extends Omit<ComponentProps<"div">, "defaultValu
|
|
|
11
11
|
/** `AccordionItem`들 */
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
export interface AccordionProps extends AccordionOwnProps, Omit<ComponentProps<"div">, keyof AccordionOwnProps | "onChange"> {}
|
|
15
|
+
/**
|
|
16
|
+
* 접고 펴는 영역 묶음. 안에 `AccordionItem`을 둔다. 기본은 한 번에 한 항목만 펼친다.
|
|
17
|
+
* Tide props: `value`, `defaultValue`, `onValueChange`, `multiple`, `children` ({@link AccordionOwnProps}). 나머지는 `<div>` 속성.
|
|
18
|
+
*/
|
|
15
19
|
export declare function Accordion({ value, defaultValue, onValueChange, multiple, ref, className, children, ...props }: AccordionProps): ReactElement;
|
|
@@ -7,7 +7,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useDisclosureGroupState } from "react-stately";
|
|
8
8
|
|
|
9
9
|
// src/Accordion/Accordion.tsx
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* 접고 펴는 영역 묶음. 안에 `AccordionItem`을 둔다. 기본은 한 번에 한 항목만 펼친다.
|
|
12
|
+
* Tide props: `value`, `defaultValue`, `onValueChange`, `multiple`, `children` ({@link AccordionOwnProps}). 나머지는 `<div>` 속성.
|
|
13
|
+
*/
|
|
11
14
|
function Accordion({ value, defaultValue, onValueChange, multiple = false, ref, className, children, ...props }) {
|
|
12
15
|
const state = useDisclosureGroupState({
|
|
13
16
|
allowsMultipleExpanded: multiple,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface AccordionItemOwnProps {
|
|
3
3
|
/** 항목을 가리키는 값. `Accordion`의 `value`·`defaultValue` 목록에 이 값을 넣으면 펼친다. */
|
|
4
4
|
value: string;
|
|
5
5
|
/** 펼치거나 접을 수 없게 한다. 트리거가 네이티브 `disabled`가 된다. 펼친 채 비활성이면 펼친 채로 남는다. */
|
|
@@ -7,8 +7,10 @@ export interface AccordionItemProps extends Omit<ComponentProps<"div">, "value">
|
|
|
7
7
|
/** `AccordionTrigger` 하나와 `AccordionPanel` 하나 */
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
}
|
|
10
|
+
export interface AccordionItemProps extends AccordionItemOwnProps, Omit<ComponentProps<"div">, keyof AccordionItemOwnProps> {}
|
|
10
11
|
/**
|
|
11
12
|
* 항목 하나. 안에 `AccordionTrigger`와 `AccordionPanel`을 둔다.
|
|
12
13
|
* 펼쳐 있으면 `data-open`, 비활성이면 `data-disabled`가 붙는다.
|
|
14
|
+
* Tide props: `value`, `disabled`, `children` ({@link AccordionItemOwnProps}). 나머지는 `<div>` 속성.
|
|
13
15
|
*/
|
|
14
16
|
export declare function AccordionItem({ value, disabled, ref, className, children, ...props }: AccordionItemProps): ReactElement;
|
|
@@ -13,6 +13,7 @@ import { useDisclosureState } from "react-stately";
|
|
|
13
13
|
/**
|
|
14
14
|
* 항목 하나. 안에 `AccordionTrigger`와 `AccordionPanel`을 둔다.
|
|
15
15
|
* 펼쳐 있으면 `data-open`, 비활성이면 `data-disabled`가 붙는다.
|
|
16
|
+
* Tide props: `value`, `disabled`, `children` ({@link AccordionItemOwnProps}). 나머지는 `<div>` 속성.
|
|
16
17
|
*/
|
|
17
18
|
function AccordionItem({ value, disabled = false, ref, className, children, ...props }) {
|
|
18
19
|
const group = use(AccordionContext);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface AccordionPanelOwnProps {
|
|
3
3
|
/** 패널 역할. 기본값 `region`. 함께 펼칠 패널이 많으면(대략 6개 넘음) `group`으로 둔다(APG). */
|
|
4
4
|
role?: "region" | "group";
|
|
5
5
|
}
|
|
6
|
+
export interface AccordionPanelProps extends AccordionPanelOwnProps, Omit<ComponentProps<"div">, keyof AccordionPanelOwnProps | "id" | "hidden" | "aria-labelledby"> {}
|
|
6
7
|
/**
|
|
7
8
|
* 항목 내용. 트리거가 `aria-controls`로 가리키고 트리거 글자가 이름이 된다(`aria-labelledby`).
|
|
8
9
|
* 접혀 있으면 숨는다(`hidden`). 늘 렌더하므로 안의 입력 상태는 접어도 남는다.
|
|
10
|
+
* Tide props: `role` ({@link AccordionPanelOwnProps}). 나머지는 `<div>` 속성.
|
|
9
11
|
*/
|
|
10
12
|
export declare function AccordionPanel({ role, ref, className, ...props }: AccordionPanelProps): ReactElement;
|
|
@@ -11,6 +11,7 @@ import { mergeProps, mergeRefs } from "react-aria";
|
|
|
11
11
|
/**
|
|
12
12
|
* 항목 내용. 트리거가 `aria-controls`로 가리키고 트리거 글자가 이름이 된다(`aria-labelledby`).
|
|
13
13
|
* 접혀 있으면 숨는다(`hidden`). 늘 렌더하므로 안의 입력 상태는 접어도 남는다.
|
|
14
|
+
* Tide props: `role` ({@link AccordionPanelOwnProps}). 나머지는 `<div>` 속성.
|
|
14
15
|
*/
|
|
15
16
|
function AccordionPanel({ role = "region", ref, className, ...props }) {
|
|
16
17
|
const item = useAccordionItemContext("AccordionPanel");
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { AccordionHeadingLevel } from "../types.js";
|
|
2
2
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface AccordionTriggerOwnProps {
|
|
4
4
|
/** 트리거를 감싸는 제목 요소의 단계(`<h1>`~`<h6>`). 기본값 `3`. 페이지 제목 구조에 맞춘다. */
|
|
5
5
|
level?: AccordionHeadingLevel;
|
|
6
6
|
/** 항목 제목. 제목 요소 안에는 버튼만 둔다(APG). */
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
|
+
export interface AccordionTriggerProps extends AccordionTriggerOwnProps, Omit<ComponentProps<"button">, keyof AccordionTriggerOwnProps | "type" | "id" | "disabled" | "aria-expanded" | "aria-controls"> {}
|
|
9
10
|
/**
|
|
10
11
|
* 항목 제목 버튼. 제목 요소(`level`, 기본 `<h3>`) 안의 `<button>`이고 끝에 장식용 chevron이 있다.
|
|
11
12
|
* `ref`·`className`·나머지 props는 버튼에 간다. 펼침 상태는 `aria-expanded`와 `data-open`이다.
|
|
13
|
+
* Tide props: `level`, `children` ({@link AccordionTriggerOwnProps}). 나머지는 `<button>` 속성.
|
|
12
14
|
*/
|
|
13
15
|
export declare function AccordionTrigger({ level, ref, className, children, ...props }: AccordionTriggerProps): ReactElement;
|
|
@@ -12,6 +12,7 @@ import { mergeProps, mergeRefs, useButton } from "react-aria";
|
|
|
12
12
|
/**
|
|
13
13
|
* 항목 제목 버튼. 제목 요소(`level`, 기본 `<h3>`) 안의 `<button>`이고 끝에 장식용 chevron이 있다.
|
|
14
14
|
* `ref`·`className`·나머지 props는 버튼에 간다. 펼침 상태는 `aria-expanded`와 `data-open`이다.
|
|
15
|
+
* Tide props: `level`, `children` ({@link AccordionTriggerOwnProps}). 나머지는 `<button>` 속성.
|
|
15
16
|
*/
|
|
16
17
|
function AccordionTrigger({ level = 3, ref, className, children, ...props }) {
|
|
17
18
|
const item = useAccordionItemContext("AccordionTrigger");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Accordion, AccordionProps } from "./Accordion.js";
|
|
2
|
-
import { AccordionItem, AccordionItemProps } from "./components/AccordionItem.js";
|
|
1
|
+
import { Accordion, AccordionOwnProps, AccordionProps } from "./Accordion.js";
|
|
2
|
+
import { AccordionItem, AccordionItemOwnProps, AccordionItemProps } from "./components/AccordionItem.js";
|
|
3
3
|
import { AccordionHeadingLevel } from "./types.js";
|
|
4
|
-
import { AccordionTrigger, AccordionTriggerProps } from "./components/AccordionTrigger.js";
|
|
5
|
-
import { AccordionPanel, AccordionPanelProps } from "./components/AccordionPanel.js";
|
|
6
|
-
export { Accordion, type AccordionHeadingLevel, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
|
|
4
|
+
import { AccordionTrigger, AccordionTriggerOwnProps, AccordionTriggerProps } from "./components/AccordionTrigger.js";
|
|
5
|
+
import { AccordionPanel, AccordionPanelOwnProps, AccordionPanelProps } from "./components/AccordionPanel.js";
|
|
6
|
+
export { Accordion, type AccordionHeadingLevel, AccordionItem, type AccordionItemOwnProps, type AccordionItemProps, type AccordionOwnProps, AccordionPanel, type AccordionPanelOwnProps, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerOwnProps, type AccordionTriggerProps };
|
package/dist/Alert/Alert.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Role } from "../types.js";
|
|
2
2
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface AlertOwnProps {
|
|
4
4
|
/**
|
|
5
5
|
* Role(Tide Role + 앱 Role). 기본값 `info`. 색 계열 이름은 받지 않는다.
|
|
6
6
|
* `info`·`success`·`warning`·`danger`는 상태마다 다른 아이콘, 나머지는 `info` 아이콘이다.
|
|
@@ -20,5 +20,9 @@ export interface AlertProps extends Omit<ComponentProps<"div">, "color" | "title
|
|
|
20
20
|
/** 닫기 버튼 이름. 기본값 `"닫기"`. Alert가 여럿이면 `"결제 알림 닫기"`처럼 구분한다. */
|
|
21
21
|
closeLabel?: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
export interface AlertProps extends AlertOwnProps, Omit<ComponentProps<"div">, keyof AlertOwnProps> {}
|
|
24
|
+
/**
|
|
25
|
+
* 화면 안에서 상태나 알릴 내용을 보여 주는 표면. 서버 컴포넌트로 쓸 수 있다.
|
|
26
|
+
* Tide props: `color`, `title`, `children`, `role`, `onClose`, `closeLabel` ({@link AlertOwnProps}). 나머지는 `<div>` 속성.
|
|
27
|
+
*/
|
|
24
28
|
export declare function Alert({ color, title, children, onClose, closeLabel, className, ...props }: AlertProps): ReactElement;
|
package/dist/Alert/Alert.js
CHANGED
|
@@ -6,7 +6,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { XIcon } from "@tide-design/icons";
|
|
7
7
|
|
|
8
8
|
// src/Alert/Alert.tsx
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* 화면 안에서 상태나 알릴 내용을 보여 주는 표면. 서버 컴포넌트로 쓸 수 있다.
|
|
11
|
+
* Tide props: `color`, `title`, `children`, `role`, `onClose`, `closeLabel` ({@link AlertOwnProps}). 나머지는 `<div>` 속성.
|
|
12
|
+
*/
|
|
10
13
|
function Alert({ color = "info", title, children, onClose, closeLabel = "닫기", className, ...props }) {
|
|
11
14
|
const StatusIcon = alertStatusIcon(color);
|
|
12
15
|
return /* @__PURE__ */ jsxs("div", {
|
package/dist/Alert/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Alert, AlertProps } from "./Alert.js";
|
|
2
|
-
export { Alert, type AlertProps };
|
|
1
|
+
import { Alert, AlertOwnProps, AlertProps } from "./Alert.js";
|
|
2
|
+
export { Alert, type AlertOwnProps, type AlertProps };
|
package/dist/Avatar/Avatar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColorFamilyName, Size } from "../types.js";
|
|
2
2
|
import { ComponentProps, ReactElement } from "react";
|
|
3
3
|
type AvatarSize = Extract<Size, "xs" | "sm" | "md" | "lg">;
|
|
4
|
-
export interface
|
|
4
|
+
export interface AvatarOwnProps {
|
|
5
5
|
/** 사용자 이미지 주소. 없거나 빈 문자열이거나 불러오지 못하면 fallback 아이콘이 보인다. */
|
|
6
6
|
src?: string;
|
|
7
7
|
/**
|
|
@@ -17,9 +17,11 @@ export interface AvatarProps extends Omit<ComponentProps<"span">, "color" | "chi
|
|
|
17
17
|
*/
|
|
18
18
|
color?: ColorFamilyName;
|
|
19
19
|
}
|
|
20
|
+
export interface AvatarProps extends AvatarOwnProps, Omit<ComponentProps<"span">, keyof AvatarOwnProps | "children" | "role" | "aria-label"> {}
|
|
20
21
|
/**
|
|
21
22
|
* 사용자 이미지를 원 안에 보여 준다. 이미지가 없거나 불러오지 못하면 fallback 아이콘이 보인다.
|
|
22
23
|
* 누르는 동작이 없다. 클릭이 필요하면 Button이나 IconButton 안에 넣는다. 서버 컴포넌트로 쓸 수 있다.
|
|
24
|
+
* Tide props: `src`, `alt`, `size`, `color` ({@link AvatarOwnProps}). 나머지는 `<span>` 속성.
|
|
23
25
|
*/
|
|
24
26
|
export declare function Avatar({ src, alt, size, color, className, ...props }: AvatarProps): ReactElement;
|
|
25
27
|
export {};
|
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -18,6 +18,7 @@ function cssUrl(src) {
|
|
|
18
18
|
/**
|
|
19
19
|
* 사용자 이미지를 원 안에 보여 준다. 이미지가 없거나 불러오지 못하면 fallback 아이콘이 보인다.
|
|
20
20
|
* 누르는 동작이 없다. 클릭이 필요하면 Button이나 IconButton 안에 넣는다. 서버 컴포넌트로 쓸 수 있다.
|
|
21
|
+
* Tide props: `src`, `alt`, `size`, `color` ({@link AvatarOwnProps}). 나머지는 `<span>` 속성.
|
|
21
22
|
*/
|
|
22
23
|
function Avatar({ src, alt, size = "md", color = "gray", className, ...props }) {
|
|
23
24
|
const named = alt !== "";
|
package/dist/Avatar/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Avatar, AvatarProps } from "./Avatar.js";
|
|
2
|
-
export { Avatar, type AvatarProps };
|
|
1
|
+
import { Avatar, AvatarOwnProps, AvatarProps } from "./Avatar.js";
|
|
2
|
+
export { Avatar, type AvatarOwnProps, type AvatarProps };
|
package/dist/Badge/Badge.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Color, FillVariant, Size } from "../types.js";
|
|
|
2
2
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
3
3
|
type BadgeVariant = Extract<FillVariant, "subtle" | "solid"> | "faint";
|
|
4
4
|
type BadgeSize = Extract<Size, "sm" | "md">;
|
|
5
|
-
export interface
|
|
5
|
+
export interface BadgeOwnProps {
|
|
6
6
|
/** 상태를 말하는 텍스트. 색만으로 상태를 전하지 않도록 필수다(WCAG 1.4.1). */
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
/** `subtle`(파스텔 배경+테두리, 기본값), `faint`(가장 옅은 배경), `solid`(진한 배경). 한 화면에서는 하나로 맞춘다. */
|
|
@@ -12,6 +12,10 @@ export interface BadgeProps extends Omit<ComponentProps<"span">, "color" | "chil
|
|
|
12
12
|
/** 색 이름. 상태는 Role, 뜻 없는 분류는 색 계열 이름(앱 등록 포함). 기본값 `neutral`. */
|
|
13
13
|
color?: Color;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
export interface BadgeProps extends BadgeOwnProps, Omit<ComponentProps<"span">, keyof BadgeOwnProps> {}
|
|
16
|
+
/**
|
|
17
|
+
* 상태나 분류를 짧은 텍스트로 보여 주는 라벨. 뜻은 반드시 텍스트로 적는다. 서버 컴포넌트로 쓸 수 있다.
|
|
18
|
+
* Tide props: `children`, `variant`, `size`, `color` ({@link BadgeOwnProps}). 나머지는 `<span>` 속성.
|
|
19
|
+
*/
|
|
16
20
|
export declare function Badge({ variant, size, color, className, ...props }: BadgeProps): ReactElement;
|
|
17
21
|
export {};
|
package/dist/Badge/Badge.js
CHANGED
|
@@ -12,7 +12,10 @@ const sizeClass = {
|
|
|
12
12
|
md: "h-6 gap-1 px-2 text-label-md"
|
|
13
13
|
};
|
|
14
14
|
const baseClass = "inline-flex max-w-full shrink-0 items-center rounded-sm border border-transparent align-middle whitespace-nowrap [&_svg]:size-3 [&_svg]:shrink-0";
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* 상태나 분류를 짧은 텍스트로 보여 주는 라벨. 뜻은 반드시 텍스트로 적는다. 서버 컴포넌트로 쓸 수 있다.
|
|
17
|
+
* Tide props: `children`, `variant`, `size`, `color` ({@link BadgeOwnProps}). 나머지는 `<span>` 속성.
|
|
18
|
+
*/
|
|
16
19
|
function Badge({ variant = "subtle", size = "md", color = "neutral", className, ...props }) {
|
|
17
20
|
return /* @__PURE__ */ jsx("span", {
|
|
18
21
|
...props,
|
package/dist/Badge/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Badge, BadgeProps } from "./Badge.js";
|
|
2
|
-
export { Badge, type BadgeProps };
|
|
1
|
+
import { Badge, BadgeOwnProps, BadgeProps } from "./Badge.js";
|
|
2
|
+
export { Badge, type BadgeOwnProps, type BadgeProps };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface BreadcrumbOwnProps {
|
|
3
3
|
/** 탐색 영역 이름. 기본값 `"이동 경로"`. 한 화면에 같은 이름의 탐색 영역이 겹치지 않게 한다. */
|
|
4
4
|
"aria-label"?: string;
|
|
5
5
|
}
|
|
6
|
+
export interface BreadcrumbProps extends BreadcrumbOwnProps, Omit<ComponentProps<"nav">, keyof BreadcrumbOwnProps> {}
|
|
6
7
|
/**
|
|
7
8
|
* 현재 페이지까지의 경로를 보여 주는 탐색 영역(`<nav>` 안의 `<ol>`). 자식은 `BreadcrumbItem`이다.
|
|
8
9
|
* `ref`·`className`은 `<nav>`에 붙는다. 서버 컴포넌트로 쓸 수 있다.
|
|
10
|
+
* Tide props: `aria-label` ({@link BreadcrumbOwnProps}). 나머지는 `<nav>` 속성.
|
|
9
11
|
*/
|
|
10
12
|
export declare function Breadcrumb({ "aria-label": ariaLabel, children, ...props }: BreadcrumbProps): ReactElement;
|
|
@@ -5,6 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
/**
|
|
6
6
|
* 현재 페이지까지의 경로를 보여 주는 탐색 영역(`<nav>` 안의 `<ol>`). 자식은 `BreadcrumbItem`이다.
|
|
7
7
|
* `ref`·`className`은 `<nav>`에 붙는다. 서버 컴포넌트로 쓸 수 있다.
|
|
8
|
+
* Tide props: `aria-label` ({@link BreadcrumbOwnProps}). 나머지는 `<nav>` 속성.
|
|
8
9
|
*/
|
|
9
10
|
function Breadcrumb({ "aria-label": ariaLabel = "이동 경로", children, ...props }) {
|
|
10
11
|
return /* @__PURE__ */ jsx("nav", {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface BreadcrumbLinkOwnProps {
|
|
3
3
|
/** 다른 요소로 렌더한다. 예: `render={<NextLink href="/docs" />}`. props·ref·className을 병합한다. */
|
|
4
4
|
render?: ReactElement;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
export interface BreadcrumbLinkProps extends BreadcrumbLinkOwnProps, Omit<ComponentProps<"a">, keyof BreadcrumbLinkOwnProps | "color"> {}
|
|
7
|
+
/**
|
|
8
|
+
* 상위 페이지 링크 `<a>`. 밑줄이 있고 hover에 짙어진다.
|
|
9
|
+
* Tide props: `render` ({@link BreadcrumbLinkOwnProps}). 나머지는 `<a>` 속성.
|
|
10
|
+
*/
|
|
7
11
|
export declare function BreadcrumbLink({ render, ...props }: BreadcrumbLinkProps): ReactElement;
|
|
@@ -2,7 +2,10 @@ import { renderElement } from "../../_internal/libs/renderElement.js";
|
|
|
2
2
|
import { linkClass } from "../constants/breadcrumbClass.js";
|
|
3
3
|
|
|
4
4
|
// src/Breadcrumb/components/BreadcrumbLink.tsx
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* 상위 페이지 링크 `<a>`. 밑줄이 있고 hover에 짙어진다.
|
|
7
|
+
* Tide props: `render` ({@link BreadcrumbLinkOwnProps}). 나머지는 `<a>` 속성.
|
|
8
|
+
*/
|
|
6
9
|
function BreadcrumbLink({ render, ...props }) {
|
|
7
10
|
return renderElement({
|
|
8
11
|
defaultElement: "a",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Breadcrumb, BreadcrumbProps } from "./Breadcrumb.js";
|
|
1
|
+
import { Breadcrumb, BreadcrumbOwnProps, BreadcrumbProps } from "./Breadcrumb.js";
|
|
2
2
|
import { BreadcrumbItem, BreadcrumbItemProps } from "./components/BreadcrumbItem.js";
|
|
3
|
-
import { BreadcrumbLink, BreadcrumbLinkProps } from "./components/BreadcrumbLink.js";
|
|
3
|
+
import { BreadcrumbLink, BreadcrumbLinkOwnProps, BreadcrumbLinkProps } from "./components/BreadcrumbLink.js";
|
|
4
4
|
import { BreadcrumbCurrent, BreadcrumbCurrentProps } from "./components/BreadcrumbCurrent.js";
|
|
5
|
-
export { Breadcrumb, BreadcrumbCurrent, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbProps };
|
|
5
|
+
export { Breadcrumb, BreadcrumbCurrent, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkOwnProps, type BreadcrumbLinkProps, type BreadcrumbOwnProps, type BreadcrumbProps };
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Role } from "../types.js";
|
|
2
2
|
import { ButtonSize, ButtonVariant } from "./types.js";
|
|
3
3
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
4
|
-
export interface
|
|
4
|
+
export interface ButtonOwnProps {
|
|
5
5
|
/** 채움 방식. 기본값은 `solid`다. */
|
|
6
6
|
variant?: ButtonVariant;
|
|
7
7
|
/** Role(Tide Role + 앱 Role). 기본값 `primary`. 색 계열 이름은 받지 않는다. */
|
|
@@ -21,5 +21,9 @@ export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
|
|
|
21
21
|
/** 다른 요소로 렌더한다. 예: `render={<Link href="/x" />}`. 그 요소의 `disabled`는 `aria-disabled`로 바뀐다. */
|
|
22
22
|
render?: ReactElement;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
export interface ButtonProps extends ButtonOwnProps, Omit<ComponentProps<"button">, keyof ButtonOwnProps> {}
|
|
25
|
+
/**
|
|
26
|
+
* 누르면 동작을 실행하는 버튼. 링크로 렌더하려면 `render={<Link href="/x" />}`를 쓴다.
|
|
27
|
+
* Tide props: `variant`, `color`, `size`, `startIcon`, `endIcon`, `loading`, `loadingLabel`, `noPressScale`, `render` ({@link ButtonOwnProps}). 나머지는 `<button>` 속성.
|
|
28
|
+
*/
|
|
25
29
|
export declare function Button({ variant, color, size, startIcon, endIcon, loading, loadingLabel, noPressScale, render, disabled, type, children, onClick, ...props }: ButtonProps): ReactElement;
|
package/dist/Button/Button.js
CHANGED
|
@@ -10,7 +10,10 @@ import { sizeClass } from "./constants/buttonClass.js";
|
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
// src/Button/Button.tsx
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* 누르면 동작을 실행하는 버튼. 링크로 렌더하려면 `render={<Link href="/x" />}`를 쓴다.
|
|
15
|
+
* Tide props: `variant`, `color`, `size`, `startIcon`, `endIcon`, `loading`, `loadingLabel`, `noPressScale`, `render` ({@link ButtonOwnProps}). 나머지는 `<button>` 속성.
|
|
16
|
+
*/
|
|
14
17
|
function Button({ variant = "solid", color = "primary", size = "md", startIcon, endIcon, loading = false, loadingLabel = "로딩 중", noPressScale = false, render, disabled = false, type, children, onClick, ...props }) {
|
|
15
18
|
const state = pressableState({
|
|
16
19
|
variant,
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Button, ButtonProps } from "./Button.js";
|
|
2
|
-
export { Button, type ButtonProps };
|
|
1
|
+
import { Button, ButtonOwnProps, ButtonProps } from "./Button.js";
|
|
2
|
+
export { Button, type ButtonOwnProps, type ButtonProps };
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface CardOwnProps {
|
|
3
3
|
/**
|
|
4
4
|
* 다른 요소로 렌더한다. 예: `render={<article />}`, `render={<li />}`.
|
|
5
5
|
* 묶음의 뜻이 있으면 그 요소를 고른다. props, ref, className을 그 요소에 병합한다.
|
|
6
6
|
*/
|
|
7
7
|
render?: ReactElement;
|
|
8
8
|
}
|
|
9
|
+
export interface CardProps extends CardOwnProps, Omit<ComponentProps<"div">, keyof CardOwnProps> {}
|
|
9
10
|
/**
|
|
10
11
|
* 관련 내용을 한 덩어리로 묶는 surface 표면 컨테이너. 경계만 있고 그림자는 없다.
|
|
11
12
|
* 기본 요소는 `div`이고, `render`로 `article`·`section`·`li` 등을 쓴다. 서버 컴포넌트로 쓸 수 있다.
|
|
13
|
+
* Tide props: `render` ({@link CardOwnProps}). 나머지는 `<div>` 속성.
|
|
12
14
|
*/
|
|
13
15
|
export declare function Card({ render, ...props }: CardProps): ReactElement;
|
package/dist/Card/Card.js
CHANGED
|
@@ -5,6 +5,7 @@ const baseClass = "rounded-lg border border-default bg-surface p-4 text-default"
|
|
|
5
5
|
/**
|
|
6
6
|
* 관련 내용을 한 덩어리로 묶는 surface 표면 컨테이너. 경계만 있고 그림자는 없다.
|
|
7
7
|
* 기본 요소는 `div`이고, `render`로 `article`·`section`·`li` 등을 쓴다. 서버 컴포넌트로 쓸 수 있다.
|
|
8
|
+
* Tide props: `render` ({@link CardOwnProps}). 나머지는 `<div>` 속성.
|
|
8
9
|
*/
|
|
9
10
|
function Card({ render, ...props }) {
|
|
10
11
|
return renderElement({
|
package/dist/Card/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Card, CardProps } from "./Card.js";
|
|
2
|
-
export { Card, type CardProps };
|
|
1
|
+
import { Card, CardOwnProps, CardProps } from "./Card.js";
|
|
2
|
+
export { Card, type CardOwnProps, type CardProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChoiceSize } from "../_internal/constants/choiceClass.js";
|
|
2
2
|
import { Role } from "../types.js";
|
|
3
3
|
import { CSSProperties, ComponentProps, ReactElement, ReactNode } from "react";
|
|
4
|
-
export interface
|
|
4
|
+
export interface CheckboxOwnProps {
|
|
5
5
|
/** 상자 옆에 보이는 label. 체크박스의 이름이 된다. 없으면 `aria-label`을 준다. */
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
/** 상자 16px(`sm`) 또는 20px(`md`). 누르는 영역은 둘 다 24×24px. 기본값 `md`. */
|
|
@@ -17,5 +17,9 @@ export interface CheckboxProps extends Omit<ComponentProps<"input">, "type" | "s
|
|
|
17
17
|
/** 루트 label의 style */
|
|
18
18
|
style?: CSSProperties;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
export interface CheckboxProps extends CheckboxOwnProps, Omit<ComponentProps<"input">, keyof CheckboxOwnProps | "type"> {}
|
|
21
|
+
/**
|
|
22
|
+
* 네이티브 체크박스. 여러 개를 묶어 이름·설명·오류를 붙이려면 `Field group` 안의 `CheckboxGroup`에 둔다.
|
|
23
|
+
* Tide props: `children`, `size`, `color`, `indeterminate`, `invalid`, `className`, `style` ({@link CheckboxOwnProps}). 나머지는 `<input>` 속성.
|
|
24
|
+
*/
|
|
21
25
|
export declare function Checkbox({ children, size, color, indeterminate, invalid, id, disabled, required, className, style, ref, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }: CheckboxProps): ReactElement;
|
|
@@ -17,7 +17,10 @@ const iconSize = {
|
|
|
17
17
|
sm: 12,
|
|
18
18
|
md: 16
|
|
19
19
|
};
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* 네이티브 체크박스. 여러 개를 묶어 이름·설명·오류를 붙이려면 `Field group` 안의 `CheckboxGroup`에 둔다.
|
|
22
|
+
* Tide props: `children`, `size`, `color`, `indeterminate`, `invalid`, `className`, `style` ({@link CheckboxOwnProps}). 나머지는 `<input>` 속성.
|
|
23
|
+
*/
|
|
21
24
|
function Checkbox({ children, size = "md", color = "primary", indeterminate = false, invalid, id, disabled, required, className, style, ref, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }) {
|
|
22
25
|
const group = use(CheckboxGroupContext);
|
|
23
26
|
const control = useFieldControl({
|
package/dist/Checkbox/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Checkbox, CheckboxProps } from "./Checkbox.js";
|
|
2
|
-
export { Checkbox, type CheckboxProps };
|
|
1
|
+
import { Checkbox, CheckboxOwnProps, CheckboxProps } from "./Checkbox.js";
|
|
2
|
+
export { Checkbox, type CheckboxOwnProps, type CheckboxProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChoiceOrientation } from "../_internal/constants/choiceGroupClass.js";
|
|
2
2
|
import { ComponentProps, ReactElement } from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface CheckboxGroupOwnProps {
|
|
4
4
|
/** 항목을 세로(`vertical`)로 쌓거나 가로(`horizontal`)로 늘어놓는다. 기본값은 `vertical`이다. */
|
|
5
5
|
orientation?: ChoiceOrientation;
|
|
6
6
|
/** 오류 상태. 안의 Checkbox마다 `aria-invalid="true"`, 묶음에 `data-invalid`. Field 안에서는 여기 준 값이 이긴다. */
|
|
@@ -8,9 +8,11 @@ export interface CheckboxGroupProps extends ComponentProps<"div"> {
|
|
|
8
8
|
/** 안의 Checkbox를 모두 비활성으로 만든다. Field 안에서는 Field의 값을 따른다. */
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}
|
|
11
|
+
export interface CheckboxGroupProps extends CheckboxGroupOwnProps, Omit<ComponentProps<"div">, keyof CheckboxGroupOwnProps> {}
|
|
11
12
|
/**
|
|
12
13
|
* Checkbox 여러 개를 하나의 이름으로 묶는다. 값은 각 Checkbox가 가진다(묶음은 값을 모으지 않는다).
|
|
13
14
|
* `<Field label group>` 안에서는 Field label·설명이 이름·설명이 되고, 밖에서는 `aria-label`·`aria-labelledby`를 준다.
|
|
15
|
+
* Tide props: `orientation`, `invalid`, `disabled` ({@link CheckboxGroupOwnProps}). 나머지는 `<div>` 속성.
|
|
14
16
|
*/
|
|
15
17
|
export declare function CheckboxGroup({ orientation, invalid, disabled, id, className, children, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...props }: CheckboxGroupProps): ReactElement;
|
|
16
18
|
export type { ChoiceOrientation };
|
|
@@ -10,6 +10,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
10
10
|
/**
|
|
11
11
|
* Checkbox 여러 개를 하나의 이름으로 묶는다. 값은 각 Checkbox가 가진다(묶음은 값을 모으지 않는다).
|
|
12
12
|
* `<Field label group>` 안에서는 Field label·설명이 이름·설명이 되고, 밖에서는 `aria-label`·`aria-labelledby`를 준다.
|
|
13
|
+
* Tide props: `orientation`, `invalid`, `disabled` ({@link CheckboxGroupOwnProps}). 나머지는 `<div>` 속성.
|
|
13
14
|
*/
|
|
14
15
|
function CheckboxGroup({ orientation = "vertical", invalid, disabled, id, className, children, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...props }) {
|
|
15
16
|
const connection = useChoiceGroup({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChoiceOrientation } from "../_internal/constants/choiceGroupClass.js";
|
|
2
|
-
import { CheckboxGroup, CheckboxGroupProps } from "./CheckboxGroup.js";
|
|
3
|
-
export { CheckboxGroup, type CheckboxGroupProps, type ChoiceOrientation };
|
|
2
|
+
import { CheckboxGroup, CheckboxGroupOwnProps, CheckboxGroupProps } from "./CheckboxGroup.js";
|
|
3
|
+
export { CheckboxGroup, type CheckboxGroupOwnProps, type CheckboxGroupProps, type ChoiceOrientation };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputSize } from "../_internal/constants/inputClass.js";
|
|
2
2
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface ComboboxOwnProps {
|
|
4
4
|
/** 고른 값(제어). 고른 옵션의 `value`다. `null`이면 아무것도 고르지 않은 상태다. 주면 `onValueChange`로 바꾼다. */
|
|
5
5
|
value?: string | null;
|
|
6
6
|
/** 처음 고른 값(비제어). 입력에 그 옵션의 글자가 보인다. 폼을 reset하면 이 값으로 돌아간다. */
|
|
@@ -27,8 +27,10 @@ export interface ComboboxProps extends Omit<ComponentProps<"input">, "value" | "
|
|
|
27
27
|
/** `ComboboxItem`과 `ComboboxSection`. 이 요소들을 바로 아래(또는 Fragment·배열 안)에 둔다. */
|
|
28
28
|
children?: ReactNode;
|
|
29
29
|
}
|
|
30
|
+
export interface ComboboxProps extends ComboboxOwnProps, Omit<ComponentProps<"input">, keyof ComboboxOwnProps | "onChange" | "type" | "list"> {}
|
|
30
31
|
/**
|
|
31
32
|
* 글자를 쳐서 옵션을 거르고 하나를 고르는 입력. 포커스가 나가면 고르지 않은 글자는 지워진다(자유 입력 없음).
|
|
32
33
|
* Field 안에 두면 label·설명·오류가 연결되고, `name`을 주면 고른 옵션의 `value`가 제출된다.
|
|
34
|
+
* Tide props: `value`, `defaultValue`, `onValueChange`, `onOpenChange`, `emptyMessage`, `name`, `form`, `size`, `invalid`, `required`, `children` ({@link ComboboxOwnProps}). 나머지는 `<input>` 속성.
|
|
33
35
|
*/
|
|
34
36
|
export declare function Combobox({ value, defaultValue, onValueChange, onOpenChange, emptyMessage, name, form, size, invalid, disabled, required, readOnly, id, ref, className, children, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ComboboxProps): ReactElement;
|
|
@@ -17,6 +17,7 @@ const isComposingKey = (event) => event.nativeEvent.isComposing || event.keyCode
|
|
|
17
17
|
/**
|
|
18
18
|
* 글자를 쳐서 옵션을 거르고 하나를 고르는 입력. 포커스가 나가면 고르지 않은 글자는 지워진다(자유 입력 없음).
|
|
19
19
|
* Field 안에 두면 label·설명·오류가 연결되고, `name`을 주면 고른 옵션의 `value`가 제출된다.
|
|
20
|
+
* Tide props: `value`, `defaultValue`, `onValueChange`, `onOpenChange`, `emptyMessage`, `name`, `form`, `size`, `invalid`, `required`, `children` ({@link ComboboxOwnProps}). 나머지는 `<input>` 속성.
|
|
20
21
|
*/
|
|
21
22
|
function Combobox({ value, defaultValue, onValueChange, onOpenChange, emptyMessage = "결과가 없습니다", name, form, size = "md", invalid, disabled, required, readOnly, id, ref, className, children, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }) {
|
|
22
23
|
const field = use(FieldContext);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ListBoxOptionProps } from "../../_internal/components/ListBoxNodes/types.js";
|
|
1
|
+
import { ListBoxOptionOwnProps, ListBoxOptionProps } from "../../_internal/components/ListBoxNodes/types.js";
|
|
2
|
+
export interface ComboboxItemOwnProps extends ListBoxOptionOwnProps {}
|
|
2
3
|
export interface ComboboxItemProps extends ListBoxOptionProps {}
|
|
3
4
|
/**
|
|
4
5
|
* Combobox의 옵션(`role="option"`). `Combobox`나 `ComboboxSection` 바로 안에 둔다. `value`가 고른 값이고 제출된다.
|
|
5
6
|
* 거르기와 고른 뒤 입력에 들어가는 글자는 `textValue`(기본은 내용의 글자)다.
|
|
7
|
+
* Tide props: `value`, `disabled`, `textValue`, `aria-label`, `children` ({@link ComboboxItemOwnProps}). 나머지는 `<div>` 속성.
|
|
6
8
|
*/
|
|
7
9
|
export declare function ComboboxItem(_props: ComboboxItemProps): null;
|
|
@@ -6,6 +6,7 @@ import { asCollectionComponent, valueItemCollectionNode } from "../../_internal/
|
|
|
6
6
|
/**
|
|
7
7
|
* Combobox의 옵션(`role="option"`). `Combobox`나 `ComboboxSection` 바로 안에 둔다. `value`가 고른 값이고 제출된다.
|
|
8
8
|
* 거르기와 고른 뒤 입력에 들어가는 글자는 `textValue`(기본은 내용의 글자)다.
|
|
9
|
+
* Tide props: `value`, `disabled`, `textValue`, `aria-label`, `children` ({@link ComboboxItemOwnProps}). 나머지는 `<div>` 속성.
|
|
9
10
|
*/
|
|
10
11
|
function ComboboxItem(_props) {
|
|
11
12
|
return null;
|
package/dist/Combobox/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Combobox, ComboboxProps } from "./Combobox.js";
|
|
2
|
-
import { ComboboxItem, ComboboxItemProps } from "./components/ComboboxItem.js";
|
|
1
|
+
import { Combobox, ComboboxOwnProps, ComboboxProps } from "./Combobox.js";
|
|
2
|
+
import { ComboboxItem, ComboboxItemOwnProps, ComboboxItemProps } from "./components/ComboboxItem.js";
|
|
3
3
|
import { ComboboxSection, ComboboxSectionProps } from "./components/ComboboxSection.js";
|
|
4
|
-
export { Combobox, ComboboxItem, type ComboboxItemProps, type ComboboxProps, ComboboxSection, type ComboboxSectionProps };
|
|
4
|
+
export { Combobox, ComboboxItem, type ComboboxItemOwnProps, type ComboboxItemProps, type ComboboxOwnProps, type ComboboxProps, ComboboxSection, type ComboboxSectionProps };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface DialogCloseOwnProps {
|
|
3
3
|
/** 다른 요소로 렌더한다(예: `render={<Button variant="ghost" color="neutral" />}`). 기본은 class 없는 `<button type="button">`. */
|
|
4
4
|
render?: ReactElement;
|
|
5
5
|
}
|
|
6
|
+
export interface DialogCloseProps extends DialogCloseOwnProps, Omit<ComponentProps<"button">, keyof DialogCloseOwnProps> {}
|
|
6
7
|
/**
|
|
7
8
|
* 누르면 Dialog를 닫는 버튼. `onClick`을 먼저 부르고, 그 안에서 `event.preventDefault()`를 부르면 닫지 않는다.
|
|
8
9
|
* 닫히면 포커스는 열기 전 요소로 돌아간다.
|
|
10
|
+
* Tide props: `render` ({@link DialogCloseOwnProps}). 나머지는 `<button>` 속성.
|
|
9
11
|
*/
|
|
10
12
|
export declare function DialogClose({ render, onClick, className, ...props }: DialogCloseProps): ReactElement;
|
|
@@ -8,6 +8,7 @@ import { createElement } from "react";
|
|
|
8
8
|
/**
|
|
9
9
|
* 누르면 Dialog를 닫는 버튼. `onClick`을 먼저 부르고, 그 안에서 `event.preventDefault()`를 부르면 닫지 않는다.
|
|
10
10
|
* 닫히면 포커스는 열기 전 요소로 돌아간다.
|
|
11
|
+
* Tide props: `render` ({@link DialogCloseOwnProps}). 나머지는 `<button>` 속성.
|
|
11
12
|
*/
|
|
12
13
|
function DialogClose({ render, onClick, className, ...props }) {
|
|
13
14
|
const { state } = useDialogContext("DialogClose");
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { DialogSize } from "../types.js";
|
|
2
2
|
import { ComponentProps, ReactElement } from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface DialogContentOwnProps {
|
|
4
4
|
/** 최대 폭. 기본값은 `md`(32rem)다. 화면이 좁으면 화면 폭 − 32px까지 줄어든다. */
|
|
5
5
|
size?: DialogSize;
|
|
6
6
|
/** 닫기 버튼(IconButton)의 이름. 기본값은 `"닫기"`다. AlertDialog에는 닫기 버튼이 없어 쓰지 않는다. */
|
|
7
7
|
closeLabel?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface DialogContentProps extends DialogContentOwnProps, Omit<ComponentProps<"div">, keyof DialogContentOwnProps | "id" | "role"> {}
|
|
9
10
|
/**
|
|
10
11
|
* 화면 가운데 뜨는 모달 내용(`role="dialog"`, AlertDialog 안에서는 `alertdialog`). 열릴 때만 `document.body`에 portal한다.
|
|
11
12
|
* Dialog는 끝 위쪽 닫기 버튼과 바깥 막 누름으로 닫히고, AlertDialog는 둘 다 없다(Esc는 닫는다).
|
|
13
|
+
* Tide props: `size`, `closeLabel` ({@link DialogContentOwnProps}). 나머지는 `<div>` 속성.
|
|
12
14
|
*/
|
|
13
15
|
export declare function DialogContent(props: DialogContentProps): ReactElement | null;
|
|
@@ -11,6 +11,7 @@ import { useRef } from "react";
|
|
|
11
11
|
/**
|
|
12
12
|
* 화면 가운데 뜨는 모달 내용(`role="dialog"`, AlertDialog 안에서는 `alertdialog`). 열릴 때만 `document.body`에 portal한다.
|
|
13
13
|
* Dialog는 끝 위쪽 닫기 버튼과 바깥 막 누름으로 닫히고, AlertDialog는 둘 다 없다(Esc는 닫는다).
|
|
14
|
+
* Tide props: `size`, `closeLabel` ({@link DialogContentOwnProps}). 나머지는 `<div>` 속성.
|
|
14
15
|
*/
|
|
15
16
|
function DialogContent(props) {
|
|
16
17
|
const context = useDialogContext("DialogContent");
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement } from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface DialogTriggerOwnProps {
|
|
3
3
|
/**
|
|
4
4
|
* 다른 요소로 렌더한다. 예: `render={<Button variant="outline" />}`, `render={<IconButton aria-label="삭제" />}`.
|
|
5
5
|
* props, ref, className, 이벤트 핸들러를 그 요소에 병합한다. 기본은 class 없는 `<button type="button">`이다.
|
|
6
6
|
*/
|
|
7
7
|
render?: ReactElement;
|
|
8
8
|
}
|
|
9
|
+
export interface DialogTriggerProps extends DialogTriggerOwnProps, Omit<ComponentProps<"button">, keyof DialogTriggerOwnProps> {}
|
|
9
10
|
/**
|
|
10
11
|
* Dialog를 여는 버튼. 누르면(마우스, 터치, Enter, Space) 연다. 열린 동안은 바깥이 inert라 다시 누를 수 없다.
|
|
11
12
|
* `aria-expanded`, 열렸을 때 `aria-controls`와 `data-open`이 붙는다.
|
|
13
|
+
* Tide props: `render` ({@link DialogTriggerOwnProps}). 나머지는 `<button>` 속성.
|
|
12
14
|
*/
|
|
13
15
|
export declare function DialogTrigger({ render, ref, id, className, ...props }: DialogTriggerProps): ReactElement;
|