@tide-design/components 0.18.3 → 0.19.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/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { cn } from "./_internal/libs/cn.js";
2
2
  import { VisuallyHidden, VisuallyHiddenProps } from "./VisuallyHidden/VisuallyHidden.js";
3
3
  import "./VisuallyHidden/index.js";
4
- import { Typography, TypographyOwnProps, TypographyProps } from "./Typography/Typography.js";
5
- import "./Typography/index.js";
6
4
  import "./Spinner/index.js";
7
5
  import { Spinner, SpinnerOwnProps, SpinnerProps } from "./Spinner/Spinner.js";
8
6
  import "./Button/index.js";
@@ -119,4 +117,4 @@ import { TooltipTrigger, TooltipTriggerOwnProps, TooltipTriggerProps } from "./T
119
117
  import { TooltipPlacement } from "./Tooltip/types.js";
120
118
  import { TooltipContent, TooltipContentOwnProps, TooltipContentProps } from "./Tooltip/components/TooltipContent.js";
121
119
  import { Color, ColorFamilyName, ColorFamilyRegistry, FillVariant, Role, RoleRegistry, Size } from "./types.js";
122
- export { Accordion, type AccordionHeadingLevel, AccordionItem, type AccordionItemOwnProps, type AccordionItemProps, type AccordionOwnProps, AccordionPanel, type AccordionPanelOwnProps, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerOwnProps, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertOwnProps, type AlertProps, Avatar, type AvatarOwnProps, type AvatarProps, Badge, type BadgeOwnProps, type BadgeProps, Breadcrumb, BreadcrumbCurrent, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkOwnProps, type BreadcrumbLinkProps, type BreadcrumbOwnProps, type BreadcrumbProps, Button, type ButtonOwnProps, type ButtonProps, Card, type CardOwnProps, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupOwnProps, type CheckboxGroupProps, type CheckboxOwnProps, type CheckboxProps, type ChoiceOrientation, type Color, type ColorFamilyName, type ColorFamilyRegistry, Combobox, ComboboxItem, type ComboboxItemOwnProps, type ComboboxItemProps, type ComboboxOwnProps, type ComboboxProps, ComboboxSection, type ComboboxSectionProps, Dialog, DialogClose, type DialogCloseOwnProps, type DialogCloseProps, DialogContent, type DialogContentOwnProps, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderAlign, type DialogHeaderOwnProps, type DialogHeaderProps, type DialogProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerOwnProps, type DialogTriggerProps, Field, type FieldOwnProps, type FieldProps, type FillVariant, IconButton, type IconButtonOwnProps, type IconButtonProps, Input, type InputOwnProps, type InputProps, Link, type LinkOwnProps, type LinkProps, Menu, MenuContent, type MenuContentOwnProps, type MenuContentProps, MenuItem, type MenuItemOwnProps, type MenuItemProps, type MenuPlacement, type MenuProps, MenuSection, type MenuSectionProps, MenuTrigger, type MenuTriggerOwnProps, type MenuTriggerProps, Pagination, PaginationEllipsis, type PaginationEllipsisOwnProps, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkOwnProps, type PaginationLinkProps, PaginationNext, type PaginationNextOwnProps, type PaginationNextProps, type PaginationOwnProps, PaginationPrevious, type PaginationPreviousOwnProps, type PaginationPreviousProps, type PaginationProps, Popover, PopoverContent, type PopoverContentOwnProps, type PopoverContentProps, type PopoverPlacement, type PopoverProps, PopoverTrigger, type PopoverTriggerOwnProps, type PopoverTriggerProps, Progress, type ProgressOwnProps, type ProgressProps, Radio, RadioGroup, type RadioGroupOwnProps, type RadioGroupProps, type RadioOwnProps, type RadioProps, type Role, type RoleRegistry, Select, SelectItem, type SelectItemOwnProps, type SelectItemProps, type SelectOwnProps, type SelectProps, SelectSection, type SelectSectionProps, Separator, type SeparatorOwnProps, type SeparatorProps, type Size, Skeleton, type SkeletonOwnProps, type SkeletonProps, Spinner, type SpinnerOwnProps, type SpinnerProps, Switch, type SwitchOwnProps, type SwitchProps, Tab, TabList, type TabListOwnProps, type TabListProps, type TabOwnProps, TabPanel, type TabPanelOwnProps, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeaderCell, type TableHeaderCellOwnProps, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsActivationMode, type TabsOrientation, type TabsOwnProps, type TabsProps, type TabsShape, Tag, TagGroup, type TagGroupOwnProps, type TagGroupProps, type TagOwnProps, type TagProps, Textarea, type TextareaOwnProps, type TextareaProps, type ToastAction, type ToastOptions, ToastQueue, type ToastQueueOptions, ToastRegion, type ToastRegionOwnProps, type ToastRegionProps, Tooltip, TooltipContent, type TooltipContentOwnProps, type TooltipContentProps, type TooltipPlacement, type TooltipProps, TooltipTrigger, type TooltipTriggerOwnProps, type TooltipTriggerProps, Typography, type TypographyOwnProps, type TypographyProps, VisuallyHidden, type VisuallyHiddenProps, cn };
120
+ export { Accordion, type AccordionHeadingLevel, AccordionItem, type AccordionItemOwnProps, type AccordionItemProps, type AccordionOwnProps, AccordionPanel, type AccordionPanelOwnProps, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerOwnProps, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertOwnProps, type AlertProps, Avatar, type AvatarOwnProps, type AvatarProps, Badge, type BadgeOwnProps, type BadgeProps, Breadcrumb, BreadcrumbCurrent, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkOwnProps, type BreadcrumbLinkProps, type BreadcrumbOwnProps, type BreadcrumbProps, Button, type ButtonOwnProps, type ButtonProps, Card, type CardOwnProps, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupOwnProps, type CheckboxGroupProps, type CheckboxOwnProps, type CheckboxProps, type ChoiceOrientation, type Color, type ColorFamilyName, type ColorFamilyRegistry, Combobox, ComboboxItem, type ComboboxItemOwnProps, type ComboboxItemProps, type ComboboxOwnProps, type ComboboxProps, ComboboxSection, type ComboboxSectionProps, Dialog, DialogClose, type DialogCloseOwnProps, type DialogCloseProps, DialogContent, type DialogContentOwnProps, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderAlign, type DialogHeaderOwnProps, type DialogHeaderProps, type DialogProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerOwnProps, type DialogTriggerProps, Field, type FieldOwnProps, type FieldProps, type FillVariant, IconButton, type IconButtonOwnProps, type IconButtonProps, Input, type InputOwnProps, type InputProps, Link, type LinkOwnProps, type LinkProps, Menu, MenuContent, type MenuContentOwnProps, type MenuContentProps, MenuItem, type MenuItemOwnProps, type MenuItemProps, type MenuPlacement, type MenuProps, MenuSection, type MenuSectionProps, MenuTrigger, type MenuTriggerOwnProps, type MenuTriggerProps, Pagination, PaginationEllipsis, type PaginationEllipsisOwnProps, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkOwnProps, type PaginationLinkProps, PaginationNext, type PaginationNextOwnProps, type PaginationNextProps, type PaginationOwnProps, PaginationPrevious, type PaginationPreviousOwnProps, type PaginationPreviousProps, type PaginationProps, Popover, PopoverContent, type PopoverContentOwnProps, type PopoverContentProps, type PopoverPlacement, type PopoverProps, PopoverTrigger, type PopoverTriggerOwnProps, type PopoverTriggerProps, Progress, type ProgressOwnProps, type ProgressProps, Radio, RadioGroup, type RadioGroupOwnProps, type RadioGroupProps, type RadioOwnProps, type RadioProps, type Role, type RoleRegistry, Select, SelectItem, type SelectItemOwnProps, type SelectItemProps, type SelectOwnProps, type SelectProps, SelectSection, type SelectSectionProps, Separator, type SeparatorOwnProps, type SeparatorProps, type Size, Skeleton, type SkeletonOwnProps, type SkeletonProps, Spinner, type SpinnerOwnProps, type SpinnerProps, Switch, type SwitchOwnProps, type SwitchProps, Tab, TabList, type TabListOwnProps, type TabListProps, type TabOwnProps, TabPanel, type TabPanelOwnProps, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeaderCell, type TableHeaderCellOwnProps, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsActivationMode, type TabsOrientation, type TabsOwnProps, type TabsProps, type TabsShape, Tag, TagGroup, type TagGroupOwnProps, type TagGroupProps, type TagOwnProps, type TagProps, Textarea, type TextareaOwnProps, type TextareaProps, type ToastAction, type ToastOptions, ToastQueue, type ToastQueueOptions, ToastRegion, type ToastRegionOwnProps, type ToastRegionProps, Tooltip, TooltipContent, type TooltipContentOwnProps, type TooltipContentProps, type TooltipPlacement, type TooltipProps, TooltipTrigger, type TooltipTriggerOwnProps, type TooltipTriggerProps, VisuallyHidden, type VisuallyHiddenProps, cn };
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { cn } from "./_internal/libs/cn.js";
2
2
  import { VisuallyHidden } from "./VisuallyHidden/VisuallyHidden.js";
3
- import { Typography } from "./Typography/Typography.js";
4
3
  import { Spinner } from "./Spinner/Spinner.js";
5
4
  import { Button } from "./Button/Button.js";
6
5
  import { IconButton } from "./IconButton/IconButton.js";
@@ -75,4 +74,4 @@ import { Tooltip } from "./Tooltip/Tooltip.js";
75
74
  import { TooltipContent } from "./Tooltip/components/TooltipContent.js";
76
75
  import { TooltipTrigger } from "./Tooltip/components/TooltipTrigger.js";
77
76
 
78
- 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, DialogHeader, 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 };
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, DialogHeader, 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, VisuallyHidden, cn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tide-design/components",
3
- "version": "0.18.3",
3
+ "version": "0.19.0",
4
4
  "description": "Tide 디자인 시스템의 React Component",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -34,8 +34,8 @@
34
34
  "./styles.css": "./dist/styles.css"
35
35
  },
36
36
  "dependencies": {
37
- "@tide-design/foundation": "0.18.3",
38
- "@tide-design/icons": "0.18.3",
37
+ "@tide-design/foundation": "0.19.0",
38
+ "@tide-design/icons": "0.19.0",
39
39
  "clsx": "^2.1.1",
40
40
  "react-aria": "^3.53.1",
41
41
  "react-stately": "^3.51.0",
@@ -1,34 +0,0 @@
1
- import { HTMLAttributes, ReactElement, Ref } from "react";
2
- import { TextStyleName } from "@tide-design/foundation";
3
- type HeadingVariant = Extract<TextStyleName, `display-${string}` | `heading-${string}`>;
4
- type TextVariant = Exclude<TextStyleName, HeadingVariant>;
5
- type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
6
- interface TypographyElementProps extends HTMLAttributes<HTMLElement> {
7
- /** 루트 DOM 요소에 연결한다. */
8
- ref?: Ref<HTMLElement>;
9
- }
10
- interface TypographyRenderProps {
11
- /** 다른 요소로 렌더한다. 예: `render={<label htmlFor="name" />}`. 이때 `level`은 무시한다. */
12
- render?: ReactElement;
13
- }
14
- interface TypographyHeadingProps extends TypographyRenderProps {
15
- /** 텍스트 스타일 이름 */
16
- variant: HeadingVariant;
17
- /** 제목 단계. 주지 않으면 텍스트 스타일의 기본 단계를 쓴다. */
18
- level?: HeadingLevel;
19
- }
20
- interface TypographyTextProps extends TypographyRenderProps {
21
- /** 텍스트 스타일 이름. 기본값 `body-md`. */
22
- variant?: TextVariant;
23
- /** heading·display 텍스트 스타일에만 있다. */
24
- level?: never;
25
- }
26
- export type TypographyOwnProps = TypographyHeadingProps | TypographyTextProps;
27
- export type TypographyProps = TypographyOwnProps & Omit<TypographyElementProps, keyof TypographyOwnProps>;
28
- /**
29
- * 텍스트 스타일 하나로 크기·행간·굵기를 정하고 알맞은 시맨틱 요소로 렌더한다.
30
- * heading·display는 항상 `<h*>`다. 다른 요소는 `render`로. 서버 컴포넌트로 쓸 수 있다.
31
- * Tide props: `render`, `variant`, `level` ({@link TypographyOwnProps}). 나머지는 HTML 요소 속성.
32
- */
33
- export declare function Typography({ variant, level, render, ...props }: TypographyProps): ReactElement;
34
- export {};
@@ -1,51 +0,0 @@
1
- import { renderElement } from "../_internal/libs/renderElement.js";
2
-
3
- // src/Typography/Typography.tsx
4
- const variantClass = {
5
- "display-lg": "text-display-lg",
6
- "display-md": "text-display-md",
7
- "heading-xl": "text-heading-xl",
8
- "heading-lg": "text-heading-lg",
9
- "heading-md": "text-heading-md",
10
- "heading-sm": "text-heading-sm",
11
- "heading-xs": "text-heading-xs",
12
- "body-lg": "text-body-lg",
13
- "body-md": "text-body-md",
14
- "body-sm": "text-body-sm",
15
- "label-lg": "text-label-lg",
16
- "label-md": "text-label-md",
17
- "label-sm": "text-label-sm",
18
- caption: "text-caption"
19
- };
20
- const elementByVariant = {
21
- "display-lg": 1,
22
- "display-md": 1,
23
- "heading-xl": 1,
24
- "heading-lg": 2,
25
- "heading-md": 3,
26
- "heading-sm": 4,
27
- "heading-xs": 5,
28
- "body-lg": "p",
29
- "body-md": "p",
30
- "body-sm": "p",
31
- "label-lg": "span",
32
- "label-md": "span",
33
- "label-sm": "span",
34
- caption: "p"
35
- };
36
- /**
37
- * 텍스트 스타일 하나로 크기·행간·굵기를 정하고 알맞은 시맨틱 요소로 렌더한다.
38
- * heading·display는 항상 `<h*>`다. 다른 요소는 `render`로. 서버 컴포넌트로 쓸 수 있다.
39
- * Tide props: `render`, `variant`, `level` ({@link TypographyOwnProps}). 나머지는 HTML 요소 속성.
40
- */
41
- function Typography({ variant = "body-md", level, render, ...props }) {
42
- const element = elementByVariant[variant];
43
- return renderElement({
44
- defaultElement: typeof element === "number" ? `h${level ?? element}` : element,
45
- render,
46
- baseClassName: variantClass[variant],
47
- props
48
- });
49
- }
50
-
51
- export { Typography };
@@ -1,2 +0,0 @@
1
- import { Typography, TypographyOwnProps, TypographyProps } from "./Typography.js";
2
- export { Typography, type TypographyOwnProps, type TypographyProps };