@tide-design/components 0.11.1 → 0.11.2
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 +24 -0
- package/dist/Accordion/Accordion.js +32 -0
- package/dist/Accordion/components/AccordionItem.d.ts +14 -0
- package/dist/Accordion/components/AccordionItem.js +51 -0
- package/dist/Accordion/components/AccordionPanel.d.ts +13 -0
- package/dist/Accordion/components/AccordionPanel.js +27 -0
- package/dist/Accordion/components/AccordionTrigger.d.ts +17 -0
- package/dist/Accordion/components/AccordionTrigger.js +39 -0
- package/dist/Accordion/constants/accordionClass.js +12 -0
- package/dist/Accordion/hooks/useAccordionContext.js +8 -0
- package/dist/Accordion/hooks/useAccordionItemContext.js +13 -0
- package/dist/Accordion/index.d.ts +6 -0
- package/dist/Accordion/types.d.ts +2 -0
- package/dist/{Alert.d.ts → Alert/Alert.d.ts} +1 -1
- package/dist/{Alert.js → Alert/Alert.js} +5 -5
- package/dist/Alert/index.d.ts +2 -0
- package/dist/{AlertDialog.d.ts → AlertDialog/AlertDialog.d.ts} +1 -1
- package/dist/{AlertDialog.js → AlertDialog/AlertDialog.js} +2 -2
- package/dist/AlertDialog/index.d.ts +2 -0
- package/dist/{Avatar.d.ts → Avatar/Avatar.d.ts} +1 -1
- package/dist/{Avatar.js → Avatar/Avatar.js} +2 -2
- package/dist/Avatar/index.d.ts +2 -0
- package/dist/{Badge.d.ts → Badge/Badge.d.ts} +1 -1
- package/dist/{Badge.js → Badge/Badge.js} +2 -2
- package/dist/Badge/index.d.ts +2 -0
- package/dist/Breadcrumb/Breadcrumb.d.ts +11 -0
- package/dist/Breadcrumb/Breadcrumb.js +21 -0
- package/dist/Breadcrumb/components/BreadcrumbCurrent.d.ts +4 -0
- package/dist/Breadcrumb/components/BreadcrumbCurrent.js +15 -0
- package/dist/Breadcrumb/components/BreadcrumbItem.d.ts +4 -0
- package/dist/Breadcrumb/components/BreadcrumbItem.js +16 -0
- package/dist/Breadcrumb/components/BreadcrumbLink.d.ts +10 -0
- package/dist/Breadcrumb/components/BreadcrumbLink.js +15 -0
- package/dist/Breadcrumb/constants/breadcrumbClass.js +8 -0
- package/dist/Breadcrumb/index.d.ts +5 -0
- package/dist/{Button.d.ts → Button/Button.d.ts} +3 -7
- package/dist/{Button.js → Button/Button.js} +8 -27
- package/dist/Button/components/Icon.js +13 -0
- package/dist/Button/constants/buttonClass.js +17 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/types.d.ts +5 -0
- package/dist/{Card.js → Card/Card.js} +2 -2
- package/dist/Card/index.d.ts +2 -0
- package/dist/{Checkbox.d.ts → Checkbox/Checkbox.d.ts} +2 -2
- package/dist/{Checkbox.js → Checkbox/Checkbox.js} +5 -5
- package/dist/Checkbox/index.d.ts +2 -0
- package/dist/{CheckboxGroup.d.ts → CheckboxGroup/CheckboxGroup.d.ts} +3 -3
- package/dist/{CheckboxGroup.js → CheckboxGroup/CheckboxGroup.js} +6 -10
- package/dist/CheckboxGroup/index.d.ts +3 -0
- package/dist/{Combobox.d.ts → Combobox/Combobox.d.ts} +2 -17
- package/dist/{Combobox.js → Combobox/Combobox.js} +10 -99
- package/dist/Combobox/components/ComboboxItem.d.ts +9 -0
- package/dist/Combobox/components/ComboboxItem.js +17 -0
- package/dist/Combobox/components/ComboboxPopover.js +23 -0
- package/dist/Combobox/components/ComboboxPopoverInner.js +50 -0
- package/dist/Combobox/components/ComboboxSection.d.ts +7 -0
- package/dist/Combobox/components/ComboboxSection.js +15 -0
- package/dist/Combobox/constants/comboboxClass.js +21 -0
- package/dist/Combobox/index.d.ts +4 -0
- package/dist/Dialog/Dialog.d.ts +8 -0
- package/dist/Dialog/Dialog.js +18 -0
- package/dist/Dialog/components/DialogClose.d.ts +13 -0
- package/dist/Dialog/components/DialogClose.js +35 -0
- package/dist/Dialog/components/DialogContent.d.ts +15 -0
- package/dist/Dialog/components/DialogContent.js +31 -0
- package/dist/Dialog/components/DialogContentInner.js +68 -0
- package/dist/Dialog/components/DialogDescription.d.ts +7 -0
- package/dist/Dialog/components/DialogDescription.js +23 -0
- package/dist/Dialog/components/DialogFooter.d.ts +4 -0
- package/dist/Dialog/components/DialogFooter.js +13 -0
- package/dist/Dialog/components/DialogTitle.d.ts +7 -0
- package/dist/Dialog/components/DialogTitle.js +23 -0
- package/dist/Dialog/components/DialogTrigger.d.ts +13 -0
- package/dist/Dialog/components/DialogTrigger.js +49 -0
- package/dist/Dialog/constants/dialogClass.js +12 -0
- package/dist/Dialog/hooks/useDialogPartsContext.js +13 -0
- package/dist/Dialog/hooks/usePartId.js +17 -0
- package/dist/Dialog/index.d.ts +10 -0
- package/dist/Dialog/types.d.ts +2 -0
- package/dist/{Field.js → Field/Field.js} +3 -3
- package/dist/Field/index.d.ts +2 -0
- package/dist/{IconButton.d.ts → IconButton/IconButton.d.ts} +1 -1
- package/dist/{IconButton.js → IconButton/IconButton.js} +5 -5
- package/dist/IconButton/index.d.ts +2 -0
- package/dist/{Input.d.ts → Input/Input.d.ts} +1 -1
- package/dist/{Input.js → Input/Input.js} +4 -4
- package/dist/Input/index.d.ts +2 -0
- package/dist/{Link.d.ts → Link/Link.d.ts} +1 -1
- package/dist/{Link.js → Link/Link.js} +2 -2
- package/dist/Link/index.d.ts +2 -0
- package/dist/Menu/Menu.d.ts +16 -0
- package/dist/Menu/Menu.js +43 -0
- package/dist/Menu/components/MenuContent.d.ts +16 -0
- package/dist/Menu/components/MenuContent.js +30 -0
- package/dist/Menu/components/MenuContentInner.js +67 -0
- package/dist/Menu/components/MenuItem.d.ts +17 -0
- package/dist/Menu/components/MenuItem.js +16 -0
- package/dist/Menu/components/MenuItemView.js +34 -0
- package/dist/Menu/components/MenuSection.d.ts +13 -0
- package/dist/Menu/components/MenuSection.js +15 -0
- package/dist/Menu/components/MenuSectionView.js +33 -0
- package/dist/Menu/components/MenuTrigger.d.ts +13 -0
- package/dist/Menu/components/MenuTrigger.js +53 -0
- package/dist/Menu/hooks/useMenuContext.js +13 -0
- package/dist/Menu/index.d.ts +7 -0
- package/dist/Menu/types.d.ts +4 -0
- package/dist/Pagination/Pagination.d.ts +11 -0
- package/dist/Pagination/Pagination.js +21 -0
- package/dist/Pagination/components/PaginationEllipsis.d.ts +7 -0
- package/dist/Pagination/components/PaginationEllipsis.js +17 -0
- package/dist/Pagination/components/PaginationItem.d.ts +4 -0
- package/dist/Pagination/components/PaginationItem.js +9 -0
- package/dist/Pagination/components/PaginationLink.d.ts +15 -0
- package/dist/Pagination/components/PaginationLink.js +23 -0
- package/dist/Pagination/components/PaginationNext.d.ts +5 -0
- package/dist/Pagination/components/PaginationNext.js +18 -0
- package/dist/Pagination/components/PaginationPrevious.d.ts +5 -0
- package/dist/Pagination/components/PaginationPrevious.js +18 -0
- package/dist/Pagination/constants/paginationClass.js +6 -0
- package/dist/Pagination/index.d.ts +7 -0
- package/dist/Pagination/types.d.ts +6 -0
- package/dist/Popover/Popover.d.ts +16 -0
- package/dist/Popover/Popover.js +43 -0
- package/dist/Popover/components/PopoverContent.d.ts +14 -0
- package/dist/Popover/components/PopoverContent.js +30 -0
- package/dist/Popover/components/PopoverContentInner.js +48 -0
- package/dist/Popover/components/PopoverTrigger.d.ts +13 -0
- package/dist/Popover/components/PopoverTrigger.js +51 -0
- package/dist/Popover/constants/popoverClass.js +6 -0
- package/dist/Popover/hooks/usePopoverContext.js +13 -0
- package/dist/Popover/index.d.ts +5 -0
- package/dist/Popover/types.d.ts +3 -0
- package/dist/{Progress.d.ts → Progress/Progress.d.ts} +1 -1
- package/dist/{Progress.js → Progress/Progress.js} +2 -2
- package/dist/Progress/index.d.ts +2 -0
- package/dist/{Radio.d.ts → Radio/Radio.d.ts} +2 -2
- package/dist/{Radio.js → Radio/Radio.js} +5 -5
- package/dist/Radio/index.d.ts +2 -0
- package/dist/{RadioGroup.d.ts → RadioGroup/RadioGroup.d.ts} +1 -1
- package/dist/{RadioGroup.js → RadioGroup/RadioGroup.js} +5 -5
- package/dist/RadioGroup/index.d.ts +2 -0
- package/dist/{Select.d.ts → Select/Select.d.ts} +2 -17
- package/dist/Select/Select.js +97 -0
- package/dist/Select/components/SelectItem.d.ts +9 -0
- package/dist/Select/components/SelectItem.js +17 -0
- package/dist/Select/components/SelectPopover.js +23 -0
- package/dist/Select/components/SelectPopoverInner.js +51 -0
- package/dist/Select/components/SelectSection.d.ts +7 -0
- package/dist/Select/components/SelectSection.js +15 -0
- package/dist/Select/constants/selectClass.js +7 -0
- package/dist/Select/index.d.ts +4 -0
- package/dist/{Separator.js → Separator/Separator.js} +2 -2
- package/dist/Separator/index.d.ts +2 -0
- package/dist/{Skeleton.d.ts → Skeleton/Skeleton.d.ts} +1 -1
- package/dist/{Skeleton.js → Skeleton/Skeleton.js} +2 -2
- package/dist/Skeleton/index.d.ts +2 -0
- package/dist/{Spinner.d.ts → Spinner/Spinner.d.ts} +1 -1
- package/dist/{Spinner.js → Spinner/Spinner.js} +2 -2
- package/dist/Spinner/index.d.ts +2 -0
- package/dist/{Switch.d.ts → Switch/Switch.d.ts} +1 -1
- package/dist/{Switch.js → Switch/Switch.js} +3 -3
- package/dist/Switch/index.d.ts +2 -0
- package/dist/Table/Table.d.ts +7 -0
- package/dist/Table/Table.js +17 -0
- package/dist/Table/components/TableBody.d.ts +4 -0
- package/dist/Table/components/TableBody.js +9 -0
- package/dist/Table/components/TableCell.d.ts +4 -0
- package/dist/Table/components/TableCell.js +14 -0
- package/dist/Table/components/TableHead.d.ts +4 -0
- package/dist/Table/components/TableHead.js +9 -0
- package/dist/Table/components/TableHeaderCell.d.ts +13 -0
- package/dist/Table/components/TableHeaderCell.js +18 -0
- package/dist/Table/components/TableRow.d.ts +4 -0
- package/dist/Table/components/TableRow.js +14 -0
- package/dist/Table/constants/tableClass.js +7 -0
- package/dist/Table/index.d.ts +7 -0
- package/dist/Tabs/Tabs.d.ts +34 -0
- package/dist/Tabs/Tabs.js +56 -0
- package/dist/Tabs/components/Tab.d.ts +12 -0
- package/dist/Tabs/components/Tab.js +16 -0
- package/dist/Tabs/components/TabList.d.ts +10 -0
- package/dist/Tabs/components/TabList.js +47 -0
- package/dist/Tabs/components/TabPanel.d.ts +10 -0
- package/dist/Tabs/components/TabPanel.js +27 -0
- package/dist/Tabs/components/TabView.js +29 -0
- package/dist/Tabs/constants/tabsClass.js +23 -0
- package/dist/Tabs/hooks/useTabsContext.js +13 -0
- package/dist/Tabs/index.d.ts +6 -0
- package/dist/Tabs/types.d.ts +5 -0
- package/dist/Tag/Tag.d.ts +18 -0
- package/dist/Tag/Tag.js +15 -0
- package/dist/{Tag.d.ts → Tag/components/TagGroup.d.ts} +0 -17
- package/dist/Tag/components/TagGroup.js +49 -0
- package/dist/Tag/components/TagView.js +49 -0
- package/dist/Tag/constants/tagClass.js +13 -0
- package/dist/Tag/hooks/useTagGroupContext.js +8 -0
- package/dist/Tag/index.d.ts +3 -0
- package/dist/{Textarea.d.ts → Textarea/Textarea.d.ts} +1 -1
- package/dist/{Textarea.js → Textarea/Textarea.js} +4 -4
- package/dist/Textarea/index.d.ts +2 -0
- package/dist/Toast/Toast.d.ts +15 -0
- package/dist/Toast/Toast.js +43 -0
- package/dist/Toast/components/Region.js +28 -0
- package/dist/Toast/components/ToastItem.js +82 -0
- package/dist/Toast/constants/toastClass.js +8 -0
- package/dist/Toast/index.d.ts +4 -0
- package/dist/Toast/libs/mergeEntries.js +19 -0
- package/dist/Toast/libs/toastQueue.d.ts +20 -0
- package/dist/Toast/libs/toastQueue.js +49 -0
- package/dist/{Toast.d.ts → Toast/types.d.ts} +4 -33
- package/dist/Tooltip/Tooltip.d.ts +25 -0
- package/dist/Tooltip/Tooltip.js +42 -0
- package/dist/Tooltip/components/TooltipContent.d.ts +14 -0
- package/dist/Tooltip/components/TooltipContent.js +31 -0
- package/dist/Tooltip/components/TooltipContentInner.js +43 -0
- package/dist/Tooltip/components/TooltipTrigger.d.ts +14 -0
- package/dist/Tooltip/components/TooltipTrigger.js +38 -0
- package/dist/Tooltip/constants/tooltipClass.js +6 -0
- package/dist/Tooltip/hooks/useTooltipContext.js +13 -0
- package/dist/Tooltip/index.d.ts +5 -0
- package/dist/Tooltip/types.d.ts +3 -0
- package/dist/{Typography.js → Typography/Typography.js} +2 -2
- package/dist/Typography/index.d.ts +2 -0
- package/dist/{VisuallyHidden.js → VisuallyHidden/VisuallyHidden.js} +2 -2
- package/dist/VisuallyHidden/index.d.ts +2 -0
- package/dist/_internal/components/DialogRoot.d.ts +11 -0
- package/dist/_internal/components/DialogRoot.js +41 -0
- package/dist/_internal/components/ListBoxNodes/ListBoxNodes.js +35 -0
- package/dist/_internal/components/ListBoxNodes/components/ListBoxOptionView.js +42 -0
- package/dist/_internal/components/ListBoxNodes/components/ListBoxSectionView.js +33 -0
- package/dist/{components/ListBoxNodes.d.ts → _internal/components/ListBoxNodes/types.d.ts} +1 -1
- package/dist/{components → _internal/components}/OverlayPortal.js +1 -1
- package/dist/{constants → _internal/constants}/alertClass.js +1 -1
- package/dist/{constants → _internal/constants}/choiceClass.js +1 -1
- package/dist/_internal/constants/choiceGroupClass.d.ts +2 -0
- package/dist/_internal/constants/choiceGroupClass.js +8 -0
- package/dist/{constants → _internal/constants}/inputClass.d.ts +1 -1
- package/dist/{constants → _internal/constants}/inputClass.js +1 -1
- package/dist/{constants → _internal/constants}/listClass.js +1 -1
- package/dist/{constants → _internal/constants}/overlayClass.js +1 -1
- package/dist/{constants → _internal/constants}/pressableClass.js +1 -1
- package/dist/{hooks → _internal/hooks}/useChoiceGroup.js +1 -1
- package/dist/{hooks → _internal/hooks}/useCloseOnTab.js +1 -1
- package/dist/_internal/hooks/useDialogContext.js +14 -0
- package/dist/{hooks → _internal/hooks}/useFieldControl.js +1 -1
- package/dist/{hooks → _internal/hooks}/useOverlayPresence.js +1 -1
- package/dist/{hooks → _internal/hooks}/useOverlayTheme.js +1 -1
- package/dist/{hooks → _internal/hooks}/usePopoverOverlay.js +1 -1
- package/dist/{libs → _internal/libs}/alertStatusIcon.js +1 -1
- package/dist/{libs → _internal/libs}/cn.js +1 -1
- package/dist/{libs → _internal/libs}/listCollection.js +1 -1
- package/dist/{libs → _internal/libs}/overlayPosition.js +1 -1
- package/dist/{libs → _internal/libs}/pressableState.js +1 -1
- package/dist/{libs → _internal/libs}/renderElement.js +1 -1
- package/dist/index.d.ts +119 -36
- package/dist/index.js +75 -36
- package/package.json +3 -3
- package/dist/Accordion.d.ts +0 -66
- package/dist/Accordion.js +0 -127
- package/dist/Breadcrumb.d.ts +0 -26
- package/dist/Breadcrumb.js +0 -53
- package/dist/Dialog.d.ts +0 -70
- package/dist/Dialog.js +0 -257
- package/dist/Menu.d.ts +0 -72
- package/dist/Menu.js +0 -230
- package/dist/Pagination.d.ts +0 -46
- package/dist/Pagination.js +0 -79
- package/dist/Popover.d.ts +0 -43
- package/dist/Popover.js +0 -150
- package/dist/Select.js +0 -173
- package/dist/Table.d.ts +0 -31
- package/dist/Table.js +0 -53
- package/dist/Tabs.d.ts +0 -66
- package/dist/Tabs.js +0 -159
- package/dist/Tag.js +0 -102
- package/dist/Toast.js +0 -193
- package/dist/Tooltip.d.ts +0 -53
- package/dist/Tooltip.js +0 -132
- package/dist/components/ListBoxNodes.js +0 -90
- /package/dist/{Card.d.ts → Card/Card.d.ts} +0 -0
- /package/dist/{Field.d.ts → Field/Field.d.ts} +0 -0
- /package/dist/{Separator.d.ts → Separator/Separator.d.ts} +0 -0
- /package/dist/{Typography.d.ts → Typography/Typography.d.ts} +0 -0
- /package/dist/{VisuallyHidden.d.ts → VisuallyHidden/VisuallyHidden.d.ts} +0 -0
- /package/dist/{constants → _internal/constants}/choiceClass.d.ts +0 -0
- /package/dist/{libs → _internal/libs}/cn.d.ts +0 -0
- /package/dist/{libs → _internal/libs}/listCollection.d.ts +0 -0
- /package/dist/{libs → _internal/libs}/overlayPosition.d.ts +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createContext, use } from "react";
|
|
4
|
+
|
|
5
|
+
// src/_internal/hooks/useDialogContext.ts
|
|
6
|
+
const DialogContext = createContext(null);
|
|
7
|
+
/** Dialog나 AlertDialog 밖에서 부르면 `part` 이름을 담아 던진다. */
|
|
8
|
+
function useDialogContext(part) {
|
|
9
|
+
const context = use(DialogContext);
|
|
10
|
+
if (!context) throw new Error(`${part}는 Dialog나 AlertDialog 안에 둔다.`);
|
|
11
|
+
return context;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { DialogContext, useDialogContext };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useLayoutEffect } from "react";
|
|
4
4
|
|
|
5
|
-
// src/hooks/useOverlayTheme.ts
|
|
5
|
+
// src/_internal/hooks/useOverlayTheme.ts
|
|
6
6
|
/**
|
|
7
7
|
* 트리거가 놓인 Theme(`data-theme`)을 portal로 나간 오버레이에 옮긴다. Theme을 `<html>`이 아닌 일부 영역에
|
|
8
8
|
* 붙인 앱에서도 오버레이가 같은 색이 된다. 오버레이에 이미 `data-theme`이 있으면 두고, 트리거 위에 Theme이 없으면
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { overlayPositionProps } from "../libs/overlayPosition.js";
|
|
4
4
|
import { usePopover } from "react-aria";
|
|
5
5
|
|
|
6
|
-
// src/hooks/usePopoverOverlay.ts
|
|
6
|
+
// src/_internal/hooks/usePopoverOverlay.ts
|
|
7
7
|
/**
|
|
8
8
|
* 트리거에 붙는 오버레이(Popover, Menu, Select·Combobox 목록)의 위치·닫기 동작. React Aria `usePopover`를 감싼다.
|
|
9
9
|
* - 닫기: Esc, 바깥 누름, 포커스가 바깥으로 나감(`usePopover` 기본). 위에 쌓인 오버레이부터 닫힌다.
|
|
@@ -2,7 +2,7 @@ import { tailwindMergeConfig } from "@tide-design/foundation/tailwind-merge";
|
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
4
|
|
|
5
|
-
// src/libs/cn.ts
|
|
5
|
+
// src/_internal/libs/cn.ts
|
|
6
6
|
const twMerge = extendTailwindMerge(tailwindMergeConfig);
|
|
7
7
|
/**
|
|
8
8
|
* class를 합치고 충돌을 푼다. 뒤에 온 class가 이긴다.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Children, Fragment, createElement, isValidElement } from "react";
|
|
2
2
|
|
|
3
|
-
// src/libs/listCollection.ts
|
|
3
|
+
// src/_internal/libs/listCollection.ts
|
|
4
4
|
const lazyType = Symbol.for("react.lazy");
|
|
5
5
|
const isLazy = (type) => typeof type === "object" && type !== null && type.$$typeof === lazyType;
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pressableColorClass, pressableDisabledClass, pressableInteractionClass, pressableScaleClass } from "../constants/pressableClass.js";
|
|
2
2
|
|
|
3
|
-
// src/libs/pressableState.ts
|
|
3
|
+
// src/_internal/libs/pressableState.ts
|
|
4
4
|
/** `disabled`를 네이티브로 지원하는 요소인지. Button류가 렌더할 만한 요소 중에서는 `button`뿐이다. */
|
|
5
5
|
const supportsNativeDisabled = (render) => render === void 0 || render.type === "button";
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "./cn.js";
|
|
2
2
|
import { cloneElement, createElement } from "react";
|
|
3
3
|
|
|
4
|
-
// src/libs/renderElement.ts
|
|
4
|
+
// src/_internal/libs/renderElement.ts
|
|
5
5
|
const isHandlerName = (name) => /^on[A-Z]/.test(name);
|
|
6
6
|
/** ref 여러 개를 하나로 합친다. React 19의 cleanup 함수 반환도 지원한다. */
|
|
7
7
|
function mergeRefs(...refs) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,38 +1,121 @@
|
|
|
1
|
-
import { cn } from "./libs/cn.js";
|
|
2
|
-
import { VisuallyHidden, VisuallyHiddenProps } from "./VisuallyHidden.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
1
|
+
import { cn } from "./_internal/libs/cn.js";
|
|
2
|
+
import { VisuallyHidden, VisuallyHiddenProps } from "./VisuallyHidden/VisuallyHidden.js";
|
|
3
|
+
import "./VisuallyHidden/index.js";
|
|
4
|
+
import { Typography, TypographyProps } from "./Typography/Typography.js";
|
|
5
|
+
import "./Typography/index.js";
|
|
6
|
+
import "./Spinner/index.js";
|
|
7
|
+
import { Spinner, SpinnerProps } from "./Spinner/Spinner.js";
|
|
8
|
+
import "./Button/index.js";
|
|
9
|
+
import { Button, ButtonProps } from "./Button/Button.js";
|
|
10
|
+
import "./IconButton/index.js";
|
|
11
|
+
import { IconButton, IconButtonProps } from "./IconButton/IconButton.js";
|
|
12
|
+
import "./Link/index.js";
|
|
13
|
+
import { Link, LinkProps } from "./Link/Link.js";
|
|
14
|
+
import "./Field/index.js";
|
|
15
|
+
import { Field, FieldProps } from "./Field/Field.js";
|
|
16
|
+
import "./Input/index.js";
|
|
17
|
+
import { Input, InputProps } from "./Input/Input.js";
|
|
18
|
+
import "./Textarea/index.js";
|
|
19
|
+
import { Textarea, TextareaProps } from "./Textarea/Textarea.js";
|
|
20
|
+
import "./Checkbox/index.js";
|
|
21
|
+
import { Checkbox, CheckboxProps } from "./Checkbox/Checkbox.js";
|
|
22
|
+
import "./CheckboxGroup/index.js";
|
|
23
|
+
import { ChoiceOrientation } from "./_internal/constants/choiceGroupClass.js";
|
|
24
|
+
import { CheckboxGroup, CheckboxGroupProps } from "./CheckboxGroup/CheckboxGroup.js";
|
|
25
|
+
import "./Radio/index.js";
|
|
26
|
+
import { Radio, RadioProps } from "./Radio/Radio.js";
|
|
27
|
+
import "./RadioGroup/index.js";
|
|
28
|
+
import { RadioGroup, RadioGroupProps } from "./RadioGroup/RadioGroup.js";
|
|
29
|
+
import "./Switch/index.js";
|
|
30
|
+
import { Switch, SwitchProps } from "./Switch/Switch.js";
|
|
31
|
+
import "./Alert/index.js";
|
|
32
|
+
import { Alert, AlertProps } from "./Alert/Alert.js";
|
|
33
|
+
import "./Avatar/index.js";
|
|
34
|
+
import { Avatar, AvatarProps } from "./Avatar/Avatar.js";
|
|
35
|
+
import "./Badge/index.js";
|
|
36
|
+
import { Badge, BadgeProps } from "./Badge/Badge.js";
|
|
37
|
+
import "./Card/index.js";
|
|
38
|
+
import { Card, CardProps } from "./Card/Card.js";
|
|
39
|
+
import "./Separator/index.js";
|
|
40
|
+
import { Separator, SeparatorProps } from "./Separator/Separator.js";
|
|
41
|
+
import "./Skeleton/index.js";
|
|
42
|
+
import { Skeleton, SkeletonProps } from "./Skeleton/Skeleton.js";
|
|
43
|
+
import "./Progress/index.js";
|
|
44
|
+
import { Progress, ProgressProps } from "./Progress/Progress.js";
|
|
45
|
+
import "./Table/index.js";
|
|
46
|
+
import { Table, TableProps } from "./Table/Table.js";
|
|
47
|
+
import { TableHead, TableHeadProps } from "./Table/components/TableHead.js";
|
|
48
|
+
import { TableBody, TableBodyProps } from "./Table/components/TableBody.js";
|
|
49
|
+
import { TableRow, TableRowProps } from "./Table/components/TableRow.js";
|
|
50
|
+
import { TableHeaderCell, TableHeaderCellProps } from "./Table/components/TableHeaderCell.js";
|
|
51
|
+
import { TableCell, TableCellProps } from "./Table/components/TableCell.js";
|
|
52
|
+
import "./Breadcrumb/index.js";
|
|
53
|
+
import { Breadcrumb, BreadcrumbProps } from "./Breadcrumb/Breadcrumb.js";
|
|
54
|
+
import { BreadcrumbItem, BreadcrumbItemProps } from "./Breadcrumb/components/BreadcrumbItem.js";
|
|
55
|
+
import { BreadcrumbLink, BreadcrumbLinkProps } from "./Breadcrumb/components/BreadcrumbLink.js";
|
|
56
|
+
import { BreadcrumbCurrent, BreadcrumbCurrentProps } from "./Breadcrumb/components/BreadcrumbCurrent.js";
|
|
57
|
+
import "./Pagination/index.js";
|
|
58
|
+
import { Pagination, PaginationProps } from "./Pagination/Pagination.js";
|
|
59
|
+
import { PaginationItem, PaginationItemProps } from "./Pagination/components/PaginationItem.js";
|
|
60
|
+
import { PaginationLink, PaginationLinkProps } from "./Pagination/components/PaginationLink.js";
|
|
61
|
+
import { PaginationPrevious, PaginationPreviousProps } from "./Pagination/components/PaginationPrevious.js";
|
|
62
|
+
import { PaginationNext, PaginationNextProps } from "./Pagination/components/PaginationNext.js";
|
|
63
|
+
import { PaginationEllipsis, PaginationEllipsisProps } from "./Pagination/components/PaginationEllipsis.js";
|
|
64
|
+
import "./Menu/index.js";
|
|
65
|
+
import { Menu, MenuProps } from "./Menu/Menu.js";
|
|
66
|
+
import { MenuTrigger, MenuTriggerProps } from "./Menu/components/MenuTrigger.js";
|
|
67
|
+
import { MenuPlacement } from "./Menu/types.js";
|
|
68
|
+
import { MenuContent, MenuContentProps } from "./Menu/components/MenuContent.js";
|
|
69
|
+
import { MenuItem, MenuItemProps } from "./Menu/components/MenuItem.js";
|
|
70
|
+
import { MenuSection, MenuSectionProps } from "./Menu/components/MenuSection.js";
|
|
71
|
+
import "./Popover/index.js";
|
|
72
|
+
import { Popover, PopoverProps } from "./Popover/Popover.js";
|
|
73
|
+
import { PopoverTrigger, PopoverTriggerProps } from "./Popover/components/PopoverTrigger.js";
|
|
74
|
+
import { PopoverPlacement } from "./Popover/types.js";
|
|
75
|
+
import { PopoverContent, PopoverContentProps } from "./Popover/components/PopoverContent.js";
|
|
76
|
+
import "./Combobox/index.js";
|
|
77
|
+
import { Combobox, ComboboxProps } from "./Combobox/Combobox.js";
|
|
78
|
+
import { ComboboxItem, ComboboxItemProps } from "./Combobox/components/ComboboxItem.js";
|
|
79
|
+
import { ComboboxSection, ComboboxSectionProps } from "./Combobox/components/ComboboxSection.js";
|
|
80
|
+
import "./Select/index.js";
|
|
81
|
+
import { Select, SelectProps } from "./Select/Select.js";
|
|
82
|
+
import { SelectItem, SelectItemProps } from "./Select/components/SelectItem.js";
|
|
83
|
+
import { SelectSection, SelectSectionProps } from "./Select/components/SelectSection.js";
|
|
84
|
+
import "./AlertDialog/index.js";
|
|
85
|
+
import { DialogProps } from "./_internal/components/DialogRoot.js";
|
|
86
|
+
import { AlertDialog, AlertDialogProps } from "./AlertDialog/AlertDialog.js";
|
|
87
|
+
import "./Dialog/index.js";
|
|
88
|
+
import { Dialog } from "./Dialog/Dialog.js";
|
|
89
|
+
import { DialogTrigger, DialogTriggerProps } from "./Dialog/components/DialogTrigger.js";
|
|
90
|
+
import { DialogSize } from "./Dialog/types.js";
|
|
91
|
+
import { DialogContent, DialogContentProps } from "./Dialog/components/DialogContent.js";
|
|
92
|
+
import { DialogTitle, DialogTitleProps } from "./Dialog/components/DialogTitle.js";
|
|
93
|
+
import { DialogDescription, DialogDescriptionProps } from "./Dialog/components/DialogDescription.js";
|
|
94
|
+
import { DialogFooter, DialogFooterProps } from "./Dialog/components/DialogFooter.js";
|
|
95
|
+
import { DialogClose, DialogCloseProps } from "./Dialog/components/DialogClose.js";
|
|
96
|
+
import "./Accordion/index.js";
|
|
97
|
+
import { Accordion, AccordionProps } from "./Accordion/Accordion.js";
|
|
98
|
+
import { AccordionItem, AccordionItemProps } from "./Accordion/components/AccordionItem.js";
|
|
99
|
+
import { AccordionHeadingLevel } from "./Accordion/types.js";
|
|
100
|
+
import { AccordionTrigger, AccordionTriggerProps } from "./Accordion/components/AccordionTrigger.js";
|
|
101
|
+
import { AccordionPanel, AccordionPanelProps } from "./Accordion/components/AccordionPanel.js";
|
|
102
|
+
import "./Tabs/index.js";
|
|
103
|
+
import { TabsActivationMode, TabsOrientation } from "./Tabs/types.js";
|
|
104
|
+
import { Tabs, TabsProps } from "./Tabs/Tabs.js";
|
|
105
|
+
import { TabList, TabListProps } from "./Tabs/components/TabList.js";
|
|
106
|
+
import { Tab, TabProps } from "./Tabs/components/Tab.js";
|
|
107
|
+
import { TabPanel, TabPanelProps } from "./Tabs/components/TabPanel.js";
|
|
108
|
+
import "./Tag/index.js";
|
|
109
|
+
import { Tag, TagProps } from "./Tag/Tag.js";
|
|
110
|
+
import { TagGroup, TagGroupProps } from "./Tag/components/TagGroup.js";
|
|
111
|
+
import "./Toast/index.js";
|
|
112
|
+
import { ToastAction, ToastOptions, ToastQueueOptions } from "./Toast/types.js";
|
|
113
|
+
import { ToastQueue } from "./Toast/libs/toastQueue.js";
|
|
114
|
+
import { ToastRegion, ToastRegionProps } from "./Toast/Toast.js";
|
|
115
|
+
import "./Tooltip/index.js";
|
|
116
|
+
import { Tooltip, TooltipProps } from "./Tooltip/Tooltip.js";
|
|
117
|
+
import { TooltipTrigger, TooltipTriggerProps } from "./Tooltip/components/TooltipTrigger.js";
|
|
118
|
+
import { TooltipPlacement } from "./Tooltip/types.js";
|
|
119
|
+
import { TooltipContent, TooltipContentProps } from "./Tooltip/components/TooltipContent.js";
|
|
37
120
|
import { Color, ColorFamilyName, ColorFamilyRegistry, FillVariant, Role, RoleRegistry, Size } from "./types.js";
|
|
38
121
|
export { Accordion, type AccordionHeadingLevel, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumb, BreadcrumbCurrent, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ChoiceOrientation, type Color, type ColorFamilyName, type ColorFamilyRegistry, Combobox, ComboboxItem, type ComboboxItemProps, type ComboboxProps, ComboboxSection, type ComboboxSectionProps, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, type DialogProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Field, type FieldProps, type FillVariant, IconButton, type IconButtonProps, Input, type InputProps, Link, type LinkProps, Menu, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, type MenuPlacement, type MenuProps, MenuSection, type MenuSectionProps, MenuTrigger, type MenuTriggerProps, Pagination, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationPrevious, type PaginationPreviousProps, type PaginationProps, Popover, PopoverContent, type PopoverContentProps, type PopoverPlacement, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type Role, type RoleRegistry, Select, SelectItem, type SelectItemProps, type SelectProps, SelectSection, type SelectSectionProps, Separator, type SeparatorProps, type Size, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsActivationMode, type TabsOrientation, type TabsProps, Tag, TagGroup, type TagGroupProps, type TagProps, Textarea, type TextareaProps, type ToastAction, type ToastOptions, ToastQueue, type ToastQueueOptions, ToastRegion, type ToastRegionProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipPlacement, type TooltipProps, TooltipTrigger, type TooltipTriggerProps, Typography, type TypographyProps, VisuallyHidden, type VisuallyHiddenProps, cn };
|
package/dist/index.js
CHANGED
|
@@ -1,38 +1,77 @@
|
|
|
1
|
-
import { cn } from "./libs/cn.js";
|
|
2
|
-
import { VisuallyHidden } from "./VisuallyHidden.js";
|
|
3
|
-
import { Typography } from "./Typography.js";
|
|
4
|
-
import { Spinner } from "./Spinner.js";
|
|
5
|
-
import { Button } from "./Button.js";
|
|
6
|
-
import { IconButton } from "./IconButton.js";
|
|
7
|
-
import { Link } from "./Link.js";
|
|
8
|
-
import { Field } from "./Field.js";
|
|
9
|
-
import { Input } from "./Input.js";
|
|
10
|
-
import { Textarea } from "./Textarea.js";
|
|
11
|
-
import { Checkbox } from "./Checkbox.js";
|
|
12
|
-
import { CheckboxGroup } from "./CheckboxGroup.js";
|
|
13
|
-
import { Radio } from "./Radio.js";
|
|
14
|
-
import { RadioGroup } from "./RadioGroup.js";
|
|
15
|
-
import { Switch } from "./Switch.js";
|
|
16
|
-
import { Alert } from "./Alert.js";
|
|
17
|
-
import { Avatar } from "./Avatar.js";
|
|
18
|
-
import { Badge } from "./Badge.js";
|
|
19
|
-
import { Card } from "./Card.js";
|
|
20
|
-
import { Separator } from "./Separator.js";
|
|
21
|
-
import { Skeleton } from "./Skeleton.js";
|
|
22
|
-
import { Progress } from "./Progress.js";
|
|
23
|
-
import { Table
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
1
|
+
import { cn } from "./_internal/libs/cn.js";
|
|
2
|
+
import { VisuallyHidden } from "./VisuallyHidden/VisuallyHidden.js";
|
|
3
|
+
import { Typography } from "./Typography/Typography.js";
|
|
4
|
+
import { Spinner } from "./Spinner/Spinner.js";
|
|
5
|
+
import { Button } from "./Button/Button.js";
|
|
6
|
+
import { IconButton } from "./IconButton/IconButton.js";
|
|
7
|
+
import { Link } from "./Link/Link.js";
|
|
8
|
+
import { Field } from "./Field/Field.js";
|
|
9
|
+
import { Input } from "./Input/Input.js";
|
|
10
|
+
import { Textarea } from "./Textarea/Textarea.js";
|
|
11
|
+
import { Checkbox } from "./Checkbox/Checkbox.js";
|
|
12
|
+
import { CheckboxGroup } from "./CheckboxGroup/CheckboxGroup.js";
|
|
13
|
+
import { Radio } from "./Radio/Radio.js";
|
|
14
|
+
import { RadioGroup } from "./RadioGroup/RadioGroup.js";
|
|
15
|
+
import { Switch } from "./Switch/Switch.js";
|
|
16
|
+
import { Alert } from "./Alert/Alert.js";
|
|
17
|
+
import { Avatar } from "./Avatar/Avatar.js";
|
|
18
|
+
import { Badge } from "./Badge/Badge.js";
|
|
19
|
+
import { Card } from "./Card/Card.js";
|
|
20
|
+
import { Separator } from "./Separator/Separator.js";
|
|
21
|
+
import { Skeleton } from "./Skeleton/Skeleton.js";
|
|
22
|
+
import { Progress } from "./Progress/Progress.js";
|
|
23
|
+
import { Table } from "./Table/Table.js";
|
|
24
|
+
import { TableBody } from "./Table/components/TableBody.js";
|
|
25
|
+
import { TableCell } from "./Table/components/TableCell.js";
|
|
26
|
+
import { TableHead } from "./Table/components/TableHead.js";
|
|
27
|
+
import { TableHeaderCell } from "./Table/components/TableHeaderCell.js";
|
|
28
|
+
import { TableRow } from "./Table/components/TableRow.js";
|
|
29
|
+
import { Breadcrumb } from "./Breadcrumb/Breadcrumb.js";
|
|
30
|
+
import { BreadcrumbCurrent } from "./Breadcrumb/components/BreadcrumbCurrent.js";
|
|
31
|
+
import { BreadcrumbItem } from "./Breadcrumb/components/BreadcrumbItem.js";
|
|
32
|
+
import { BreadcrumbLink } from "./Breadcrumb/components/BreadcrumbLink.js";
|
|
33
|
+
import { Pagination } from "./Pagination/Pagination.js";
|
|
34
|
+
import { PaginationEllipsis } from "./Pagination/components/PaginationEllipsis.js";
|
|
35
|
+
import { PaginationItem } from "./Pagination/components/PaginationItem.js";
|
|
36
|
+
import { PaginationLink } from "./Pagination/components/PaginationLink.js";
|
|
37
|
+
import { PaginationNext } from "./Pagination/components/PaginationNext.js";
|
|
38
|
+
import { PaginationPrevious } from "./Pagination/components/PaginationPrevious.js";
|
|
39
|
+
import { Menu } from "./Menu/Menu.js";
|
|
40
|
+
import { MenuContent } from "./Menu/components/MenuContent.js";
|
|
41
|
+
import { MenuItem } from "./Menu/components/MenuItem.js";
|
|
42
|
+
import { MenuSection } from "./Menu/components/MenuSection.js";
|
|
43
|
+
import { MenuTrigger } from "./Menu/components/MenuTrigger.js";
|
|
44
|
+
import { Popover } from "./Popover/Popover.js";
|
|
45
|
+
import { PopoverContent } from "./Popover/components/PopoverContent.js";
|
|
46
|
+
import { PopoverTrigger } from "./Popover/components/PopoverTrigger.js";
|
|
47
|
+
import { Combobox } from "./Combobox/Combobox.js";
|
|
48
|
+
import { ComboboxItem } from "./Combobox/components/ComboboxItem.js";
|
|
49
|
+
import { ComboboxSection } from "./Combobox/components/ComboboxSection.js";
|
|
50
|
+
import { Select } from "./Select/Select.js";
|
|
51
|
+
import { SelectItem } from "./Select/components/SelectItem.js";
|
|
52
|
+
import { SelectSection } from "./Select/components/SelectSection.js";
|
|
53
|
+
import { AlertDialog } from "./AlertDialog/AlertDialog.js";
|
|
54
|
+
import { Dialog } from "./Dialog/Dialog.js";
|
|
55
|
+
import { DialogClose } from "./Dialog/components/DialogClose.js";
|
|
56
|
+
import { DialogContent } from "./Dialog/components/DialogContent.js";
|
|
57
|
+
import { DialogDescription } from "./Dialog/components/DialogDescription.js";
|
|
58
|
+
import { DialogFooter } from "./Dialog/components/DialogFooter.js";
|
|
59
|
+
import { DialogTitle } from "./Dialog/components/DialogTitle.js";
|
|
60
|
+
import { DialogTrigger } from "./Dialog/components/DialogTrigger.js";
|
|
61
|
+
import { Accordion } from "./Accordion/Accordion.js";
|
|
62
|
+
import { AccordionItem } from "./Accordion/components/AccordionItem.js";
|
|
63
|
+
import { AccordionPanel } from "./Accordion/components/AccordionPanel.js";
|
|
64
|
+
import { AccordionTrigger } from "./Accordion/components/AccordionTrigger.js";
|
|
65
|
+
import { Tab } from "./Tabs/components/Tab.js";
|
|
66
|
+
import { TabList } from "./Tabs/components/TabList.js";
|
|
67
|
+
import { TabPanel } from "./Tabs/components/TabPanel.js";
|
|
68
|
+
import { Tabs } from "./Tabs/Tabs.js";
|
|
69
|
+
import { Tag } from "./Tag/Tag.js";
|
|
70
|
+
import { TagGroup } from "./Tag/components/TagGroup.js";
|
|
71
|
+
import { ToastQueue } from "./Toast/libs/toastQueue.js";
|
|
72
|
+
import { ToastRegion } from "./Toast/Toast.js";
|
|
73
|
+
import { Tooltip } from "./Tooltip/Tooltip.js";
|
|
74
|
+
import { TooltipContent } from "./Tooltip/components/TooltipContent.js";
|
|
75
|
+
import { TooltipTrigger } from "./Tooltip/components/TooltipTrigger.js";
|
|
37
76
|
|
|
38
77
|
export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDialog, Avatar, Badge, Breadcrumb, BreadcrumbCurrent, BreadcrumbItem, BreadcrumbLink, Button, Card, Checkbox, CheckboxGroup, Combobox, ComboboxItem, ComboboxSection, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, Field, IconButton, Input, Link, Menu, MenuContent, MenuItem, MenuSection, MenuTrigger, Pagination, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioGroup, Select, SelectItem, SelectSection, Separator, Skeleton, Spinner, Switch, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Tag, TagGroup, Textarea, ToastQueue, ToastRegion, Tooltip, TooltipContent, TooltipTrigger, Typography, VisuallyHidden, cn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tide-design/components",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
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-design/foundation": "0.11.
|
|
27
|
-
"@tide-design/icons": "0.11.
|
|
26
|
+
"@tide-design/foundation": "0.11.2",
|
|
27
|
+
"@tide-design/icons": "0.11.2",
|
|
28
28
|
"clsx": "^2.1.1",
|
|
29
29
|
"react-aria": "^3.53.1",
|
|
30
30
|
"react-stately": "^3.51.0",
|
package/dist/Accordion.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
-
/** 트리거를 감싸는 제목 요소의 단계 */
|
|
3
|
-
export type AccordionHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
-
export interface AccordionProps extends Omit<ComponentProps<"div">, "defaultValue" | "onChange"> {
|
|
5
|
-
/**
|
|
6
|
-
* 펼친 항목의 값 목록(제어). 주면 `onValueChange`로 바꾼다.
|
|
7
|
-
* `multiple`이 아닌데 값이 둘 이상이면 첫 값만 남기며 `onValueChange`를 부른다.
|
|
8
|
-
*/
|
|
9
|
-
value?: readonly string[];
|
|
10
|
-
/** 처음 펼친 항목의 값 목록(비제어). 기본값은 빈 목록(모두 접힘)이다. */
|
|
11
|
-
defaultValue?: readonly string[];
|
|
12
|
-
/** 펼친 항목이 바뀌려 할 때 새 값 목록으로 부른다. 목록 순서는 펼친 순서다. */
|
|
13
|
-
onValueChange?: (value: string[]) => void;
|
|
14
|
-
/**
|
|
15
|
-
* 여러 항목을 함께 펼칠지. 기본값은 `false`로, 한 항목을 펼치면 펼쳐 있던 항목이 접힌다.
|
|
16
|
-
* 어느 쪽이든 펼친 항목을 다시 누르면 접힌다(모두 접을 수 있다).
|
|
17
|
-
*/
|
|
18
|
-
multiple?: boolean;
|
|
19
|
-
/** `AccordionItem`들 */
|
|
20
|
-
children?: ReactNode;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* 접고 펴는 영역 묶음. 루트는 `<div>`(radius `lg`, 장식용 경계)이고 안에 `AccordionItem`을 둔다.
|
|
24
|
-
* 기본은 한 번에 한 항목만 펼친다(`multiple`이면 여럿).
|
|
25
|
-
*/
|
|
26
|
-
export declare function Accordion({ value, defaultValue, onValueChange, multiple, ref, className, children, ...props }: AccordionProps): ReactElement;
|
|
27
|
-
export interface AccordionItemProps extends Omit<ComponentProps<"div">, "value"> {
|
|
28
|
-
/** 항목을 가리키는 값. `Accordion`의 `value`·`defaultValue` 목록에 이 값을 넣으면 펼친다. */
|
|
29
|
-
value: string;
|
|
30
|
-
/** 펼치거나 접을 수 없게 한다. 트리거가 네이티브 `disabled`가 된다. 펼친 채 비활성이면 펼친 채로 남는다. */
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
/** `AccordionTrigger` 하나와 `AccordionPanel` 하나 */
|
|
33
|
-
children?: ReactNode;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 항목 하나. 안에 `AccordionTrigger`와 `AccordionPanel`을 둔다.
|
|
37
|
-
* 펼쳐 있으면 `data-open`, 비활성이면 `data-disabled`가 붙는다.
|
|
38
|
-
*/
|
|
39
|
-
export declare function AccordionItem({ value, disabled, ref, className, children, ...props }: AccordionItemProps): ReactElement;
|
|
40
|
-
export interface AccordionTriggerProps extends Omit<ComponentProps<"button">, "type" | "id" | "disabled" | "aria-expanded" | "aria-controls"> {
|
|
41
|
-
/**
|
|
42
|
-
* 트리거를 감싸는 제목 요소의 단계(`<h1>`~`<h6>`). 기본값은 `3`이다.
|
|
43
|
-
* 페이지 제목 구조에 맞춘다(WAI-ARIA APG Accordion).
|
|
44
|
-
*/
|
|
45
|
-
level?: AccordionHeadingLevel;
|
|
46
|
-
/** 항목 제목. 제목 요소 안에는 버튼만 둔다(APG). */
|
|
47
|
-
children?: ReactNode;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* 항목 제목 버튼. 제목 요소(`level`, 기본 `<h3>`) 안의 `<button type="button">`이고 끝에 장식용 chevron이 있다.
|
|
51
|
-
* `ref`·`className`·나머지 props는 버튼에 간다. 펼침 상태는 `aria-expanded`와 `data-open`, 비활성은 `:disabled`다.
|
|
52
|
-
* Enter·Space·누름으로 펼치고 접는다.
|
|
53
|
-
*/
|
|
54
|
-
export declare function AccordionTrigger({ level, ref, className, children, ...props }: AccordionTriggerProps): ReactElement;
|
|
55
|
-
export interface AccordionPanelProps extends Omit<ComponentProps<"div">, "id" | "role" | "hidden" | "aria-labelledby"> {
|
|
56
|
-
/**
|
|
57
|
-
* 패널 역할. 기본값은 `region`(트리거 이름이 붙은 영역, APG 예시)이다.
|
|
58
|
-
* 함께 펼칠 수 있는 패널이 많으면(대략 6개 넘음) 영역 랜드마크가 너무 늘지 않게 `group`으로 둔다(APG).
|
|
59
|
-
*/
|
|
60
|
-
role?: "region" | "group";
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* 항목 내용. 트리거가 `aria-controls`로 가리키고 트리거 글자가 이름이 된다(`aria-labelledby`).
|
|
64
|
-
* 접혀 있으면 숨는다(`hidden`). 늘 렌더하므로 안의 입력 상태는 접어도 남는다.
|
|
65
|
-
*/
|
|
66
|
-
export declare function AccordionPanel({ role, ref, className, ...props }: AccordionPanelProps): ReactElement;
|
package/dist/Accordion.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "./libs/cn.js";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { createContext, use, useMemo, useRef } from "react";
|
|
6
|
-
import { ChevronDownIcon } from "@tide-design/icons";
|
|
7
|
-
import { mergeProps, mergeRefs, useButton, useDisclosure } from "react-aria";
|
|
8
|
-
import { useDisclosureGroupState, useDisclosureState } from "react-stately";
|
|
9
|
-
|
|
10
|
-
// src/Accordion.tsx
|
|
11
|
-
const AccordionContext = createContext(null);
|
|
12
|
-
const AccordionItemContext = createContext(null);
|
|
13
|
-
function useAccordionItemContext(part) {
|
|
14
|
-
const context = use(AccordionItemContext);
|
|
15
|
-
if (!context) throw new Error(`${part}는 AccordionItem 안에 둔다.`);
|
|
16
|
-
return context;
|
|
17
|
-
}
|
|
18
|
-
const accordionClass = "rounded-lg border border-default text-default";
|
|
19
|
-
const itemClass = "not-first:border-t not-first:border-default";
|
|
20
|
-
const triggerClass = [
|
|
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-hover focus-visible:focus-ring",
|
|
23
|
-
"disabled:cursor-not-allowed disabled:text-disabled"
|
|
24
|
-
].join(" ");
|
|
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";
|
|
26
|
-
const panelClass = "px-4 pb-4 text-body-md [&[hidden]]:p-0";
|
|
27
|
-
/**
|
|
28
|
-
* 접고 펴는 영역 묶음. 루트는 `<div>`(radius `lg`, 장식용 경계)이고 안에 `AccordionItem`을 둔다.
|
|
29
|
-
* 기본은 한 번에 한 항목만 펼친다(`multiple`이면 여럿).
|
|
30
|
-
*/
|
|
31
|
-
function Accordion({ value, defaultValue, onValueChange, multiple = false, ref, className, children, ...props }) {
|
|
32
|
-
const state = useDisclosureGroupState({
|
|
33
|
-
allowsMultipleExpanded: multiple,
|
|
34
|
-
expandedKeys: value,
|
|
35
|
-
defaultExpandedKeys: defaultValue,
|
|
36
|
-
onExpandedChange: onValueChange && ((keys) => onValueChange([...keys].map(String)))
|
|
37
|
-
});
|
|
38
|
-
return /* @__PURE__ */ jsx("div", {
|
|
39
|
-
...props,
|
|
40
|
-
ref,
|
|
41
|
-
className: cn(accordionClass, className),
|
|
42
|
-
children: /* @__PURE__ */ jsx(AccordionContext, {
|
|
43
|
-
value: state,
|
|
44
|
-
children
|
|
45
|
-
})
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 항목 하나. 안에 `AccordionTrigger`와 `AccordionPanel`을 둔다.
|
|
50
|
-
* 펼쳐 있으면 `data-open`, 비활성이면 `data-disabled`가 붙는다.
|
|
51
|
-
*/
|
|
52
|
-
function AccordionItem({ value, disabled = false, ref, className, children, ...props }) {
|
|
53
|
-
const group = use(AccordionContext);
|
|
54
|
-
if (!group) throw new Error("AccordionItem는 Accordion 안에 둔다.");
|
|
55
|
-
const panelRef = useRef(null);
|
|
56
|
-
const state = useDisclosureState({
|
|
57
|
-
isExpanded: group.expandedKeys.has(value),
|
|
58
|
-
onExpandedChange: () => group.toggleKey(value)
|
|
59
|
-
});
|
|
60
|
-
const { buttonProps, panelProps } = useDisclosure({ isDisabled: disabled }, state, panelRef);
|
|
61
|
-
const context = useMemo(() => ({
|
|
62
|
-
expanded: state.isExpanded,
|
|
63
|
-
disabled,
|
|
64
|
-
buttonProps,
|
|
65
|
-
panelProps,
|
|
66
|
-
panelRef
|
|
67
|
-
}), [
|
|
68
|
-
state.isExpanded,
|
|
69
|
-
disabled,
|
|
70
|
-
buttonProps,
|
|
71
|
-
panelProps
|
|
72
|
-
]);
|
|
73
|
-
return /* @__PURE__ */ jsx("div", {
|
|
74
|
-
...props,
|
|
75
|
-
ref,
|
|
76
|
-
"data-open": state.isExpanded ? "" : void 0,
|
|
77
|
-
"data-disabled": disabled ? "" : void 0,
|
|
78
|
-
className: cn(itemClass, className),
|
|
79
|
-
children: /* @__PURE__ */ jsx(AccordionItemContext, {
|
|
80
|
-
value: context,
|
|
81
|
-
children
|
|
82
|
-
})
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* 항목 제목 버튼. 제목 요소(`level`, 기본 `<h3>`) 안의 `<button type="button">`이고 끝에 장식용 chevron이 있다.
|
|
87
|
-
* `ref`·`className`·나머지 props는 버튼에 간다. 펼침 상태는 `aria-expanded`와 `data-open`, 비활성은 `:disabled`다.
|
|
88
|
-
* Enter·Space·누름으로 펼치고 접는다.
|
|
89
|
-
*/
|
|
90
|
-
function AccordionTrigger({ level = 3, ref, className, children, ...props }) {
|
|
91
|
-
const item = useAccordionItemContext("AccordionTrigger");
|
|
92
|
-
const buttonRef = useRef(null);
|
|
93
|
-
const { buttonProps } = useButton(item.buttonProps, buttonRef);
|
|
94
|
-
const mergedRef = useMemo(() => mergeRefs(ref, buttonRef), [ref, buttonRef]);
|
|
95
|
-
const Heading = `h${level}`;
|
|
96
|
-
return /* @__PURE__ */ jsx(Heading, {
|
|
97
|
-
className: "flex",
|
|
98
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
99
|
-
...mergeProps(props, buttonProps),
|
|
100
|
-
ref: mergedRef,
|
|
101
|
-
type: "button",
|
|
102
|
-
"data-open": item.expanded ? "" : void 0,
|
|
103
|
-
className: cn(triggerClass, className),
|
|
104
|
-
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
105
|
-
size: 16,
|
|
106
|
-
className: chevronClass
|
|
107
|
-
})]
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* 항목 내용. 트리거가 `aria-controls`로 가리키고 트리거 글자가 이름이 된다(`aria-labelledby`).
|
|
113
|
-
* 접혀 있으면 숨는다(`hidden`). 늘 렌더하므로 안의 입력 상태는 접어도 남는다.
|
|
114
|
-
*/
|
|
115
|
-
function AccordionPanel({ role = "region", ref, className, ...props }) {
|
|
116
|
-
const item = useAccordionItemContext("AccordionPanel");
|
|
117
|
-
const mergedRef = useMemo(() => mergeRefs(ref, item.panelRef), [ref, item.panelRef]);
|
|
118
|
-
return /* @__PURE__ */ jsx("div", {
|
|
119
|
-
...mergeProps(props, item.panelProps),
|
|
120
|
-
ref: mergedRef,
|
|
121
|
-
role,
|
|
122
|
-
"data-open": item.expanded ? "" : void 0,
|
|
123
|
-
className: cn(panelClass, className)
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger };
|