@cocso-ui/react 0.0.1-beta.9 → 0.0.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.
Files changed (42) hide show
  1. package/README.md +23 -0
  2. package/lib/components/Accordion/Accordion.d.ts +9 -0
  3. package/lib/components/Accordion/index.d.ts +1 -0
  4. package/lib/components/Body/Body.d.ts +11 -12
  5. package/lib/components/Button/Button.d.ts +16 -14
  6. package/lib/components/Checkbox/Checkbox.d.ts +21 -0
  7. package/lib/components/Checkbox/index.d.ts +1 -0
  8. package/lib/components/Display/Display.d.ts +11 -12
  9. package/lib/components/Dropdown/Dropdown.d.ts +7 -0
  10. package/lib/components/Dropdown/index.d.ts +1 -0
  11. package/lib/components/FileUpload/FileUpload.d.ts +14 -0
  12. package/lib/components/FileUpload/index.d.ts +1 -0
  13. package/lib/components/Heading/Heading.d.ts +11 -12
  14. package/lib/components/Label/Label.d.ts +16 -0
  15. package/lib/components/Label/index.d.ts +1 -0
  16. package/lib/components/Link/Link.d.ts +16 -0
  17. package/lib/components/Link/index.d.ts +1 -0
  18. package/lib/components/Modal/Modal.d.ts +8 -0
  19. package/lib/components/Modal/index.d.ts +1 -0
  20. package/lib/components/OneTimePasswordField/OneTimePasswordField.d.ts +4 -0
  21. package/lib/components/OneTimePasswordField/index.d.ts +1 -0
  22. package/lib/components/Pagination/Pagination.d.ts +15 -0
  23. package/lib/components/Pagination/index.d.ts +1 -0
  24. package/lib/components/Popover/Popover.d.ts +6 -0
  25. package/lib/components/Popover/index.d.ts +1 -0
  26. package/lib/components/Select/Select.d.ts +11 -0
  27. package/lib/components/Select/index.d.ts +1 -0
  28. package/lib/components/Spinner/Spinner.d.ts +19 -0
  29. package/lib/components/Spinner/index.d.ts +1 -0
  30. package/lib/components/StockQuantityStatus/StockQuantityStatus.d.ts +10 -0
  31. package/lib/components/StockQuantityStatus/index.d.ts +1 -0
  32. package/lib/components/Switch/Switch.d.ts +18 -0
  33. package/lib/components/Switch/index.d.ts +1 -0
  34. package/lib/components/Tab/Tab.d.ts +6 -0
  35. package/lib/components/Tab/index.d.ts +1 -0
  36. package/lib/components/Toast/Toast.d.ts +5 -0
  37. package/lib/components/Toast/index.d.ts +1 -0
  38. package/lib/index.cjs +1 -1
  39. package/lib/index.d.ts +16 -0
  40. package/lib/index.js +1 -1
  41. package/lib/utils/{tokens.d.ts → token.d.ts} +3 -3
  42. package/package.json +19 -8
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ ## `@cocso-ui/react`
2
+
3
+ 이 Package는 리액트 기반 컴포넌트를 제공해요.
4
+
5
+ `radix-ui`의 헤드리스 컴포넌트를 사용하여 접근성과 커스터마이징을 고려한 컴포넌트를 구현하고 있어요.
6
+
7
+ ### Installation
8
+
9
+ ```bash
10
+ pnpm install @cocso-ui/react
11
+ ```
12
+
13
+ ### Usage
14
+
15
+ 컴포넌트를 아래와 같은 형태로 import 할 수 있어요.
16
+
17
+ ```javascript
18
+ import {Button} from '@cocso-ui/react';
19
+ ```
20
+
21
+ ### Dependencies
22
+
23
+ - [@cocso-ui/css](../css)
@@ -0,0 +1,9 @@
1
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
2
+ export declare const Accordion: import("react").ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>> & {
3
+ Item: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
4
+ Header: import("react").ForwardRefExoticComponent<AccordionPrimitive.AccordionHeaderProps & import("react").RefAttributes<HTMLHeadingElement>>;
5
+ Trigger: import("react").ForwardRefExoticComponent<{
6
+ chevron?: boolean;
7
+ } & Omit<AccordionPrimitive.AccordionTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
8
+ Content: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
9
+ };
@@ -0,0 +1 @@
1
+ export * from './Accordion';
@@ -1,17 +1,16 @@
1
1
  import * as React from 'react';
2
- import { type FontWeightToken } from '../../utils/tokens';
3
- declare const tags: readonly ["p", "a", "span", "div", "label", "li", "td", "th", "figcaption", "blockquote", "cite"];
4
- type Element = (typeof tags)[number];
5
- type Default = (typeof tags)[0];
6
- export type BodyProps<T extends Element = Default> = {
7
- as?: T;
2
+ import { type FontWeightToken } from '../../utils/token';
3
+ export type BodyProps = {
4
+ asChild?: boolean;
8
5
  size?: 'lg' | 'md' | 'sm' | 'xs';
9
6
  color?: string;
10
- fontWeight?: FontWeightToken;
11
- } & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color' | 'fontWeight'>;
12
- export declare const Body: (<T extends Element = "p">(props: BodyProps<T> & {
13
- ref?: React.ForwardedRef<React.ComponentRef<T>>;
14
- }) => React.ReactElement) & {
7
+ weight?: FontWeightToken;
8
+ } & React.ComponentPropsWithoutRef<'p'>;
9
+ export declare const Body: React.ForwardRefExoticComponent<{
10
+ asChild?: boolean;
11
+ size?: "lg" | "md" | "sm" | "xs";
12
+ color?: string;
13
+ weight?: FontWeightToken;
14
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>> & {
15
15
  displayName: string;
16
16
  };
17
- export {};
@@ -1,20 +1,22 @@
1
1
  import * as React from 'react';
2
- import { type FontWeightToken } from '../../utils/tokens';
3
- declare const tags: readonly ["button"];
4
- type Element = (typeof tags)[number];
5
- type Default = (typeof tags)[0];
6
- export type ButtonProps<T extends Element = Default> = {
7
- as?: T;
8
- variant?: 'primary' | 'secondary' | 'tertiary' | 'text';
9
- size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';
2
+ import { type FontWeightToken } from '../../utils/token';
3
+ export type ButtonProps = {
4
+ asChild?: boolean;
5
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'success' | 'text';
6
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
10
7
  disabled?: boolean;
11
8
  loading?: boolean;
12
9
  color?: string;
13
- fontWeight?: FontWeightToken;
14
- } & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color' | 'fontWeight'>;
15
- export declare const Button: (<T extends Element = "button">(props: ButtonProps<T> & {
16
- ref?: React.ForwardedRef<React.ComponentRef<T>>;
17
- }) => React.ReactElement) & {
10
+ weight?: FontWeightToken;
11
+ } & React.ComponentPropsWithoutRef<'button'>;
12
+ export declare const Button: React.ForwardRefExoticComponent<{
13
+ asChild?: boolean;
14
+ variant?: "primary" | "secondary" | "tertiary" | "danger" | "success" | "text";
15
+ size?: "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
16
+ disabled?: boolean;
17
+ loading?: boolean;
18
+ color?: string;
19
+ weight?: FontWeightToken;
20
+ } & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>> & {
18
21
  displayName: string;
19
22
  };
20
- export {};
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
+ export type CheckboxStatus = 'on' | 'off' | 'intermediate';
4
+ export type CheckboxProps = {
5
+ id?: string;
6
+ size?: 'lg' | 'md' | 'sm';
7
+ status: CheckboxStatus;
8
+ onChange: (next: CheckboxStatus) => void;
9
+ label?: string;
10
+ disabled?: boolean;
11
+ } & Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'checked' | 'onCheckedChange'>;
12
+ export declare const Checkbox: React.ForwardRefExoticComponent<{
13
+ id?: string;
14
+ size?: "lg" | "md" | "sm";
15
+ status: CheckboxStatus;
16
+ onChange: (next: CheckboxStatus) => void;
17
+ label?: string;
18
+ disabled?: boolean;
19
+ } & Omit<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref">, "checked" | "onCheckedChange"> & React.RefAttributes<HTMLButtonElement>> & {
20
+ displayName: string;
21
+ };
@@ -0,0 +1 @@
1
+ export * from './Checkbox';
@@ -1,17 +1,16 @@
1
1
  import * as React from 'react';
2
- import { type FontWeightToken } from '../../utils/tokens';
3
- declare const tags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
4
- type Element = (typeof tags)[number];
5
- type Default = (typeof tags)[0];
6
- export type DisplayProps<T extends Element = Default> = {
7
- as?: T;
2
+ import { type FontWeightToken } from '../../utils/token';
3
+ export type DisplayProps = {
4
+ asChild?: boolean;
8
5
  size?: 'lg' | 'md' | 'sm';
9
6
  color?: string;
10
- fontWeight?: FontWeightToken;
11
- } & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color' | 'fontWeight'>;
12
- export declare const Display: (<T extends Element = "h1">(props: DisplayProps<T> & {
13
- ref?: React.ForwardedRef<React.ComponentRef<T>>;
14
- }) => React.ReactElement) & {
7
+ weight?: FontWeightToken;
8
+ } & React.ComponentPropsWithoutRef<'h1'>;
9
+ export declare const Display: React.ForwardRefExoticComponent<{
10
+ asChild?: boolean;
11
+ size?: "lg" | "md" | "sm";
12
+ color?: string;
13
+ weight?: FontWeightToken;
14
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>> & {
15
15
  displayName: string;
16
16
  };
17
- export {};
@@ -0,0 +1,7 @@
1
+ import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu';
2
+ export declare const Dropdown: import("react").FC<DropdownPrimitive.DropdownMenuProps> & {
3
+ Trigger: import("react").ForwardRefExoticComponent<DropdownPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
+ Portal: import("react").FC<DropdownPrimitive.DropdownMenuPortalProps>;
5
+ Content: import("react").ForwardRefExoticComponent<Omit<DropdownPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ Item: import("react").ForwardRefExoticComponent<Omit<DropdownPrimitive.DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
7
+ };
@@ -0,0 +1 @@
1
+ export * from './Dropdown';
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ export interface FileItem {
3
+ file: File;
4
+ name: string;
5
+ size: number;
6
+ }
7
+ export declare const FileUpload: React.ForwardRefExoticComponent<{
8
+ maxFiles?: number;
9
+ files: FileItem[];
10
+ onFilesChange: (files: FileItem[]) => void;
11
+ onRemove?: (fileName: string) => void;
12
+ } & Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>> & {
13
+ displayName: string;
14
+ };
@@ -0,0 +1 @@
1
+ export * from './FileUpload';
@@ -1,17 +1,16 @@
1
1
  import * as React from 'react';
2
- import { type FontWeightToken } from '../../utils/tokens';
3
- declare const tags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
4
- type Element = (typeof tags)[number];
5
- type Default = (typeof tags)[1];
6
- export type HeadingProps<T extends Element = Default> = {
7
- as?: T;
2
+ import { type FontWeightToken } from '../../utils/token';
3
+ export type HeadingProps = {
4
+ asChild?: boolean;
8
5
  size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
9
6
  color?: string;
10
- fontWeight?: FontWeightToken;
11
- } & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color' | 'fontWeight'>;
12
- export declare const Heading: (<T extends Element = "h2">(props: HeadingProps<T> & {
13
- ref?: React.ForwardedRef<React.ComponentRef<T>>;
14
- }) => React.ReactElement) & {
7
+ weight?: FontWeightToken;
8
+ } & React.ComponentPropsWithoutRef<'h2'>;
9
+ export declare const Heading: React.ForwardRefExoticComponent<{
10
+ asChild?: boolean;
11
+ size?: "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
12
+ color?: string;
13
+ weight?: FontWeightToken;
14
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>> & {
15
15
  displayName: string;
16
16
  };
17
- export {};
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { type FontWeightToken } from '../../utils/token';
3
+ export type LabelProps = {
4
+ asChild?: boolean;
5
+ size?: 'lg' | 'md' | 'sm' | 'xs';
6
+ color?: string;
7
+ weight?: FontWeightToken;
8
+ } & React.ComponentPropsWithoutRef<'label'>;
9
+ export declare const Label: React.ForwardRefExoticComponent<{
10
+ asChild?: boolean;
11
+ size?: "lg" | "md" | "sm" | "xs";
12
+ color?: string;
13
+ weight?: FontWeightToken;
14
+ } & Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>> & {
15
+ displayName: string;
16
+ };
@@ -0,0 +1 @@
1
+ export * from './Label';
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { type FontWeightToken } from '../../utils/token';
3
+ export type LinkProps = {
4
+ asChild?: boolean;
5
+ size?: 'lg' | 'md' | 'sm' | 'xs';
6
+ weight?: FontWeightToken;
7
+ indicator?: boolean;
8
+ } & React.ComponentPropsWithoutRef<'a'>;
9
+ export declare const Link: React.ForwardRefExoticComponent<{
10
+ asChild?: boolean;
11
+ size?: "lg" | "md" | "sm" | "xs";
12
+ weight?: FontWeightToken;
13
+ indicator?: boolean;
14
+ } & Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>> & {
15
+ displayName: string;
16
+ };
@@ -0,0 +1 @@
1
+ export * from './Link';
@@ -0,0 +1,8 @@
1
+ import * as ModalPrimitive from '@radix-ui/react-dialog';
2
+ export declare const Modal: import("react").FC<ModalPrimitive.DialogProps> & {
3
+ Trigger: import("react").ForwardRefExoticComponent<ModalPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
+ Content: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
5
+ Close: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ Title: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
7
+ Description: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
8
+ };
@@ -0,0 +1 @@
1
+ export * from './Modal';
@@ -0,0 +1,4 @@
1
+ import * as OneTimePasswordFieldPrimitive from '@radix-ui/react-one-time-password-field';
2
+ export declare const OneTimePasswordField: import("react").ForwardRefExoticComponent<Omit<Omit<OneTimePasswordFieldPrimitive.OneTimePasswordFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
3
+ Input: import("react").ForwardRefExoticComponent<Omit<Omit<OneTimePasswordFieldPrimitive.OneTimePasswordFieldInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
4
+ };
@@ -0,0 +1 @@
1
+ export * from './OneTimePasswordField';
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ export type PaginationProps = {
3
+ page: number;
4
+ totalPages: number;
5
+ maxVisible?: number;
6
+ onChange: (pageNumber: number) => void;
7
+ } & Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'>;
8
+ export declare const Pagination: React.ForwardRefExoticComponent<{
9
+ page: number;
10
+ totalPages: number;
11
+ maxVisible?: number;
12
+ onChange: (pageNumber: number) => void;
13
+ } & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange"> & React.RefAttributes<HTMLDivElement>> & {
14
+ displayName: string;
15
+ };
@@ -0,0 +1 @@
1
+ export * from './Pagination';
@@ -0,0 +1,6 @@
1
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
2
+ export declare const Popover: import("react").FC<PopoverPrimitive.PopoverProps> & {
3
+ Trigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
+ Portal: import("react").FC<PopoverPrimitive.PopoverPortalProps>;
5
+ Content: import("react").ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ };
@@ -0,0 +1 @@
1
+ export * from './Popover';
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ export type SelectProps = {
3
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
4
+ disabled?: boolean;
5
+ } & Omit<React.ComponentPropsWithoutRef<'select'>, 'size'>;
6
+ export declare const Select: React.ForwardRefExoticComponent<{
7
+ size?: "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
8
+ disabled?: boolean;
9
+ } & Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "size"> & React.RefAttributes<HTMLSelectElement>> & {
10
+ displayName: string;
11
+ };
@@ -0,0 +1 @@
1
+ export * from './Select';
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ declare const tags: readonly ["div"];
3
+ type Element = (typeof tags)[number];
4
+ type Default = (typeof tags)[0];
5
+ export type SpinnerProps<T extends Element = Default> = {
6
+ as?: T;
7
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';
8
+ color?: string;
9
+ bg?: string;
10
+ } & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color'>;
11
+ export declare const Spinner: React.ForwardRefExoticComponent<{
12
+ as?: "div" | undefined;
13
+ size?: "xl" | "lg" | "md" | "sm" | "xs";
14
+ color?: string;
15
+ bg?: string;
16
+ } & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "color" | "size"> & React.RefAttributes<HTMLDivElement>> & {
17
+ displayName: string;
18
+ };
19
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Spinner';
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ export type QuantityStatus = '보통' | '여유' | '부족';
3
+ export type QuantityStatusProps = {
4
+ quantity: QuantityStatus;
5
+ } & React.ComponentPropsWithoutRef<'div'>;
6
+ export declare const StockQuantityStatus: React.ForwardRefExoticComponent<{
7
+ quantity: QuantityStatus;
8
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
9
+ displayName: string;
10
+ };
@@ -0,0 +1 @@
1
+ export * from './StockQuantityStatus';
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import * as SwitchPrimitive from '@radix-ui/react-switch';
3
+ export type SwitchProps = {
4
+ id: string;
5
+ size?: 'lg' | 'md';
6
+ disabled?: boolean;
7
+ label?: string;
8
+ position?: 'left' | 'right';
9
+ } & React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>;
10
+ export declare const Switch: React.ForwardRefExoticComponent<{
11
+ id: string;
12
+ size?: "lg" | "md";
13
+ disabled?: boolean;
14
+ label?: string;
15
+ position?: "left" | "right";
16
+ } & Omit<SwitchPrimitive.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>> & {
17
+ displayName: string;
18
+ };
@@ -0,0 +1 @@
1
+ export * from './Switch';
@@ -0,0 +1,6 @@
1
+ import * as TabPrimitive from '@radix-ui/react-tabs';
2
+ export declare const Tab: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
3
+ List: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsListProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
4
+ Trigger: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
5
+ Content: import("react").ForwardRefExoticComponent<Omit<TabPrimitive.TabsContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ };
@@ -0,0 +1 @@
1
+ export * from './Tab';
@@ -0,0 +1,5 @@
1
+ import { toast } from 'sonner';
2
+ export declare const Toaster: import("react").ForwardRefExoticComponent<import("sonner").ToasterProps & import("react").RefAttributes<HTMLElement>> & {
3
+ displayName: string;
4
+ };
5
+ export { toast };
@@ -0,0 +1 @@
1
+ export * from './Toast';
package/lib/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var N=Object.create;var g=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var k=(e,t)=>{for(var o in t)g(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of B(t))!v.call(e,s)&&s!==o&&g(e,s,{get:()=>t[s],enumerable:!(n=w(t,s))||n.enumerable});return e};var R=(e,t,o)=>(o=e!=null?N(O(e)):{},y(t||!e||!e.__esModule?g(o,"default",{value:e,enumerable:!0}):o,e)),z=e=>y(g({},"__esModule",{value:!0}),e);var ee={};k(ee,{Body:()=>M,Button:()=>K,Display:()=>U,Heading:()=>Z});module.exports=z(ee);var u=R(require("react"),1);function c(e){if(e)return`var(--color-${e.replace(/\./g,"-")})`}var H={thin:"100","extra-light":"200",light:"300",normal:"400",medium:"500","semi-bold":"600",bold:"700","extra-bold":"800",black:"900"};function i(e){if(e)return H[e]??e}var S=(...e)=>e.filter(Boolean).join(" ").trim(),$=(e,t,o)=>`${e}--${t}_${o}`,j=(e,t)=>Object.entries(t).map(([o,n])=>$(e,o,n)).join(" "),_=(e,t)=>Object.entries(e).every(([o,n])=>t[o]===n),V=(e,t)=>{let o=Object.entries(t).map(([n,s])=>`${n}_${s}`).join("-");return`${e}--${o}`},A=(e,t,o)=>o.filter(n=>_(n,t)).map(n=>V(e,n)).join(" "),l=(e,t,o=[],...n)=>{let s=e,a=j(e,t),r=A(e,t,o);return S(s,a,r,...n)};var T=require("react/jsx-runtime"),G=["p","a","span","div","label","li","td","th","figcaption","blockquote","cite"],I=u.forwardRef(({as:e=G[0],size:t="md",color:o,fontWeight:n="normal",className:s,style:a,...r},p)=>{let m=e,d=l("cocso-body",{size:t},[],s);return(0,T.jsx)(m,{ref:p,className:d,style:{"--cocso-body-color":c(o),"--cocso-body-weight":i(n),...a},...r})}),M=Object.assign(I,{displayName:"Body"});var h=R(require("react"),1);var C=require("react/jsx-runtime"),q=["button"],J=h.forwardRef(({as:e=q[0],variant:t="primary",size:o="md",disabled:n=!1,loading:s=!1,color:a,fontWeight:r="bold",className:p,style:m,...f},d)=>{let F=e,D={variant:t,size:o,...n&&{disabled:"true"},...s&&{loading:"true"}},P=l("cocso-button",D,[],p);return(0,C.jsx)(F,{ref:d,className:P,style:{"--cocso-button-color":c(a),"--cocso-button-weight":i(r),...m},...f})}),K=Object.assign(J,{displayName:"Button"});var x=R(require("react"),1);var b=require("react/jsx-runtime"),L=["h1","h2","h3","h4","h5","h6"],Q=x.forwardRef(({as:e=L[0],size:t="md",color:o,fontWeight:n="bold",className:s,style:a,...r},p)=>{let m=e,d=l("cocso-display",{size:t},[],s);return(0,b.jsx)(m,{ref:p,className:d,style:{"--cocso-display-color":c(o),"--cocso-display-weight":i(n),...a},...r})}),U=Object.assign(Q,{displayName:"Display"});var E=R(require("react"),1);var W=require("react/jsx-runtime"),X=["h1","h2","h3","h4","h5","h6"],Y=E.forwardRef(({as:e=X[1],size:t="md",color:o,fontWeight:n="bold",className:s,style:a,...r},p)=>{let m=e,d=l("cocso-heading",{size:t},[],s);return(0,W.jsx)(m,{ref:p,className:d,style:{"--cocso-heading-color":c(o),"--cocso-heading-weight":i(n),...a},...r})}),Z=Object.assign(Y,{displayName:"Heading"});
1
+ "use strict";var Zo=Object.create;var U=Object.defineProperty;var $o=Object.getOwnPropertyDescriptor;var _o=Object.getOwnPropertyNames;var Qo=Object.getPrototypeOf,Uo=Object.prototype.hasOwnProperty;var Go=(o,e)=>{for(var t in e)U(o,t,{get:e[t],enumerable:!0})},ho=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _o(e))!Uo.call(o,i)&&i!==t&&U(o,i,{get:()=>e[i],enumerable:!(r=$o(e,i))||r.enumerable});return o};var f=(o,e,t)=>(t=o!=null?Zo(Qo(o)):{},ho(e||!o||!o.__esModule?U(t,"default",{value:o,enumerable:!0}):t,o)),Ko=o=>ho(U({},"__esModule",{value:!0}),o);var $e={};Go($e,{Accordion:()=>oe,Body:()=>V,Button:()=>se,Checkbox:()=>De,Display:()=>ce,Dropdown:()=>pe,FileUpload:()=>he,Heading:()=>co,Label:()=>W,Link:()=>ue,Modal:()=>we,OneTimePasswordField:()=>Ne,Pagination:()=>Te,Popover:()=>Se,Select:()=>Ze,Spinner:()=>io,StockQuantityStatus:()=>Oe,Switch:()=>He,Tab:()=>ze,Toaster:()=>Ve,toast:()=>X.toast});module.exports=Ko($e);var L=f(require("@radix-ui/react-accordion"),1),G=require("react");var qo=(...o)=>o.filter(Boolean).join(" ").trim(),n=(o,e,t=[],...r)=>{let i=Object.entries(e).filter(([,m])=>m!==!1&&m!==null&&m!==void 0).map(([m,c])=>`${o}--${m}_${c}`).join(" "),s=t.filter(m=>Object.entries(m).every(([c,p])=>e[c]===p)).map(m=>{let c=Object.entries(m).map(([p,l])=>`${p}_${l}`).join("-");return`${o}--${c}`}).join(" ");return qo(o,i,s,...r)};var go=require("@radix-ui/react-slot"),O=require("react/jsx-runtime"),Jo=(0,G.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-item",{},[],o);return(0,O.jsx)(L.Item,{ref:t,className:r,...e})}),Xo=(0,G.forwardRef)(({className:o,children:e,chevron:t=!0,...r},i)=>{let s=n("cocso-accordion-trigger",{},[],o);return(0,O.jsx)(L.Trigger,{ref:i,className:s,...r,children:(0,O.jsxs)(go.Slottable,{children:[e,t&&(0,O.jsx)("div",{className:"cocso-accordion-chevron",children:(0,O.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,O.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})})}),Yo=(0,G.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-accordion-content",{},[],o);return(0,O.jsx)(L.Content,{ref:t,className:r,...e})}),oe=Object.assign(L.Root,{Item:Jo,Header:L.Header,Trigger:Xo,Content:Yo});var uo=f(require("react"),1),vo=require("@radix-ui/react-slot");function b(o){if(o)return o.includes(".")?`var(--color-${o.replace(/\./g,"-")})`:o}var Co={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function y(o){if(o)return o in Co?Co[o]:o}var Po=require("react/jsx-runtime"),ee=uo.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="normal",className:i,style:s,...m},c)=>{let l=n("cocso-body",{size:e},[],i);return(0,Po.jsx)(o?vo.Slot:"p",{ref:c,className:l,style:{"--cocso-body-color":b(t),"--cocso-body-weight":y(r),...s},...m})}),V=Object.assign(ee,{displayName:"Body"});var j=f(require("react"),1),bo=require("@radix-ui/react-slot");var Ro=f(require("react"),1);var A=require("react/jsx-runtime"),te=["div"],re=Ro.forwardRef(({as:o=te[0],size:e="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:i,style:s,...m},c)=>{let p=o,d=n("cocso-spinner",{size:e},[],i);return(0,A.jsx)(p,{ref:c,className:d,style:{"--cocso-spinner-bg":b(r),"--cocso-spinner-color":b(t),...s},...m,children:(0,A.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,A.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),(0,A.jsx)("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),io=Object.assign(re,{displayName:"Spinner"});var no=require("react/jsx-runtime"),ie=o=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[o],ne=j.forwardRef(({asChild:o=!1,variant:e="primary",size:t="md",disabled:r=!1,loading:i=!1,color:s,weight:m="normal",className:c,style:p,children:l,onClick:d,onKeyDown:w,...D},z)=>{let R=r||i,x=j.useCallback(T=>{if(R){T.preventDefault();return}d?.(T)},[R,d]),Y=j.useCallback(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),R||T.currentTarget.click()),w?.(T)},[R,w]),oo={variant:e,size:t,loading:i,disabled:R},eo=[...r?[{variant:e,disabled:r}]:[],...i?[{variant:e,loading:i}]:[]],to=n("cocso-button",oo,eo,c),ro={"--cocso-button-color":b(s),"--cocso-button-weight":y(m),...p};return(0,no.jsx)(o?bo.Slot:"button",{ref:z,className:to,onClick:x,onKeyDown:Y,role:"button",disabled:R,"aria-disabled":R,"aria-busy":i,style:ro,...D,children:i?(0,no.jsx)(io,{className:"cocso-button-spinner",size:ie(t),color:"currentColor"}):l})}),se=Object.assign(ne,{displayName:"Button"});var wo=f(require("react"),1),yo=require("@radix-ui/react-slot");var xo=require("react/jsx-runtime"),ae=wo.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="bold",className:i,style:s,...m},c)=>{let l=n("cocso-display",{size:e},[],i);return(0,xo.jsx)(o?yo.Slot:"h1",{ref:c,className:l,style:{"--cocso-display-color":b(t),"--cocso-display-weight":y(r),...s},...m})}),ce=Object.assign(ae,{displayName:"Display"});var S=f(require("@radix-ui/react-dropdown-menu"),1),so=require("react");var ao=require("react/jsx-runtime"),me=(0,so.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-dropdown-content",{},[],o);return(0,ao.jsx)(S.Content,{ref:t,className:r,...e})}),le=(0,so.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-dropdown-item",{},[],o);return(0,ao.jsx)(S.Item,{ref:t,className:r,...e})}),pe=Object.assign(S.Root,{Trigger:S.Trigger,Portal:S.Portal,Content:me,Item:le});var Lo=f(require("react"),1),C=require("react");var No=f(require("react"),1),ko=require("@radix-ui/react-slot");var To=require("react/jsx-runtime"),de=No.forwardRef(({asChild:o=!1,size:e="md",color:t="text.basic",weight:r="normal",className:i,style:s,...m},c)=>{let l=n("cocso-label",{size:e},[],i);return(0,To.jsx)(o?ko.Slot:"label",{ref:c,className:l,style:{"--cocso-label-color":b(t),"--cocso-label-weight":y(r),...s},...m})}),W=Object.assign(de,{displayName:"Label"});var h=require("react/jsx-runtime"),fe=Lo.forwardRef(({maxFiles:o=2,files:e,onFilesChange:t,onRemove:r,multiple:i=!0,accept:s,...m},c)=>{let[p,l]=(0,C.useState)(!1),d=(0,C.useRef)(null),w=(0,C.useRef)(null),D=3*1024*1024,z=(0,C.useCallback)(a=>s?s.split(",").map(N=>N.trim()).some(N=>{if(N.endsWith("/*")){let Q=N.slice(0,-2);return a.type.startsWith(Q)}return a.type===N||a.name.toLowerCase().endsWith(N)}):!0,[s]),R=(0,C.useCallback)(a=>a.size>D?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),x=(0,C.useCallback)(a=>{let N=Array.from(a).filter(B=>z(B)?R(B):(alert(`${B.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(N.length===0)return;let Q=o-e.length;if(Q<=0){alert(`\uCD5C\uB300 ${o}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let jo=N.slice(0,Q).map(B=>({file:B,name:B.name,size:B.size}));t([...e,...jo])},[e,o,t,z,R]),Y=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),oo=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),w.current&&!w.current.contains(a.relatedTarget)&&l(!1)},[]),eo=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),to=(0,C.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:M}=a.dataTransfer;M&&x(M)},[x]),ro=(0,C.useCallback)(a=>{let{files:M}=a.target;M&&x(M)},[x]),po=(0,C.useCallback)(a=>{let M=e.filter(N=>N.name!==a);t(M),r?.(a)},[e,t,r]),T=(0,C.useCallback)(()=>{d.current?.click()},[]),fo=e.length>=o||!i&&e.length>=1;return(0,h.jsxs)("div",{className:"cocso-file-upload-wrapper",children:[!fo&&(0,h.jsxs)("div",{ref:w,onDragEnter:Y,onDragOver:eo,onDragLeave:oo,onDrop:to,onClick:T,className:"cocso-file-upload","data-drag-active":p,children:[(0,h.jsx)("input",{ref:a=>{d.current=a,typeof c=="function"?c(a):c&&(c.current=a)},type:"file",onChange:ro,multiple:i,accept:s,style:{display:"none"},...m}),(0,h.jsxs)(W,{size:"xs",color:"palette.gray-600",children:["\uD30C\uC77C\uC744 \uC5EC\uAE30\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098, \uD074\uB9AD\uD558\uC5EC \uD30C\uC77C\uC744 \uC120\uD0DD\uD558\uC138\uC694",(0,h.jsx)("br",{}),"(\uCD5C\uB300 3MB)"]}),(0,h.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,h.jsx)("path",{d:"M5 12h14"}),(0,h.jsx)("path",{d:"M12 5v14"})]})]}),e.length>0&&(0,h.jsx)("div",{className:"cocso-file-upload-list",children:e.map(a=>(0,h.jsxs)("div",{className:"cocso-file-upload-item",children:[(0,h.jsx)(V,{size:"xs",children:a.name}),(0,h.jsx)("button",{type:"button",onClick:()=>po(a.name),className:"cocso-file-upload-remove",children:(0,h.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,h.jsx)("path",{d:"M18 6 6 18"}),(0,h.jsx)("path",{d:"m6 6 12 12"})]})})]},a.name))})]})}),he=Object.assign(fe,{displayName:"FileUpload"});var So=f(require("react"),1),Wo=require("@radix-ui/react-slot");var Do=require("react/jsx-runtime"),ge=So.forwardRef(({asChild:o=!1,size:e="md",color:t,weight:r="bold",className:i,style:s,...m},c)=>{let l=n("cocso-heading",{size:e},[],i);return(0,Do.jsx)(o?Wo.Slot:"h2",{ref:c,className:l,style:{"--cocso-heading-color":b(t),"--cocso-heading-weight":y(r),...s},...m})}),co=Object.assign(ge,{displayName:"Heading"});var Mo=f(require("react"),1),Oo=require("@radix-ui/react-slot");var Fo=require("react/jsx-runtime"),Ce=Mo.forwardRef(({asChild:o=!1,size:e="md",weight:t="normal",indicator:r=!0,className:i,style:s,...m},c)=>{let l=n("cocso-link",{size:e,indicator:r},[],i);return(0,Fo.jsx)(o?Oo.Slot:"a",{ref:c,className:l,style:{"--cocso-link-weight":y(t),...s},...m})}),ue=Object.assign(Ce,{displayName:"Link"});var u=f(require("@radix-ui/react-dialog"),1),Z=require("react");var P=require("react/jsx-runtime"),ve=(0,Z.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-content",{},[],o);return(0,P.jsxs)(u.Portal,{children:[(0,P.jsx)(u.Overlay,{className:"cocso-modal-overlay"}),(0,P.jsx)(u.Content,{ref:r,className:i,...t,children:e})]})}),Pe=(0,Z.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-close-wrapper",{},[],o);return(0,P.jsx)("div",{className:i,...t,children:(0,P.jsx)(u.Close,{className:"cocso-modal-close",children:(0,P.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,P.jsx)("path",{d:"M18 6 6 18"}),(0,P.jsx)("path",{d:"m6 6 12 12"})]})})})}),Re=(0,Z.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-title",{},[],o);return(0,P.jsx)(u.Title,{ref:r,className:i,asChild:!0,...t,children:(0,P.jsx)(co,{color:"text.basic",children:e})})}),be=(0,Z.forwardRef)(({className:o,children:e,...t},r)=>{let i=n("cocso-modal-description",{},[],o);return(0,P.jsx)(u.Description,{ref:r,className:i,asChild:!0,...t,children:(0,P.jsx)(V,{size:"sm",color:"text.subtle",children:e})})}),we=Object.assign(u.Root,{Trigger:u.Trigger,Content:ve,Close:Pe,Title:Re,Description:be});var K=f(require("@radix-ui/react-one-time-password-field"),1),mo=require("react");var lo=require("react/jsx-runtime"),ye=(0,mo.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp",{},[],o);return(0,lo.jsx)(K.Root,{ref:t,className:r,...e})}),xe=(0,mo.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-otp-input",{},[],o);return(0,lo.jsx)(K.Input,{ref:t,className:r,...e})}),Ne=Object.assign(ye,{Input:xe});var Ho=f(require("react"),1);var v=require("react/jsx-runtime"),ke=Ho.forwardRef(({className:o,page:e,totalPages:t,maxVisible:r=5,onChange:i,...s},m)=>{let c=Math.ceil(r/2),p=d=>(0,v.jsx)("button",{className:"cocso-pagination-item",onClick:()=>i(d),"data-active":e===d,children:d},d),l=n("cocso-pagination",{},[],o);return(0,v.jsxs)("div",{ref:m,className:l,...s,children:[t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:e===1,onClick:()=>e>1&&i(e-1),children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,v.jsx)("path",{d:"m15 18-6-6 6-6"})})}),t<=r+2?Array(t).fill(0).map((d,w)=>p(w+1)):(0,v.jsxs)(v.Fragment,{children:[p(1),e>1+c&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((d,w)=>{let D=e-c+w+1;return D>1&&D<t?p(D):""}),e<t-c&&(0,v.jsx)("span",{className:"cocso-pagination-trunc",children:"..."}),p(t)]}),t>1&&(0,v.jsx)("button",{className:"cocso-pagination-arrow",disabled:e===t,onClick:()=>e<t&&i(e+1),children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,v.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})}),Te=Object.assign(ke,{displayName:"Pagination"});var F=f(require("@radix-ui/react-popover"),1),Bo=require("react");var Eo=require("react/jsx-runtime"),Le=(0,Bo.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-popover-content",{},[],o);return(0,Eo.jsx)(F.Content,{ref:t,className:r,...e})}),Se=Object.assign(F.Root,{Trigger:F.Trigger,Portal:F.Portal,Content:Le});var Io=f(require("react"),1),q=f(require("@radix-ui/react-checkbox"),1);var k=require("react/jsx-runtime"),We=Io.forwardRef(({id:o,size:e="md",status:t,onChange:r,label:i,disabled:s=!1,className:m,...c},p)=>{let l={size:e,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],w=n("cocso-checkbox",l,d,m),D=R=>{if(!s){let x;R===!0?x="on":R==="indeterminate"?x="intermediate":x="off",r(x)}};return(0,k.jsxs)("div",{className:"cocso-checkbox-wrapper",children:[(0,k.jsxs)(q.Root,{ref:p,id:o,className:w,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:D,disabled:s,...c,children:[(0,k.jsx)(q.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,k.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,k.jsx)("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:(0,k.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,k.jsx)("path",{d:"M5 12h14"})})})]}),i&&(0,k.jsx)(W,{className:n("cocso-checkbox-label",{disabled:s}),size:e,htmlFor:o,children:i})]})}),De=Object.assign(We,{displayName:"Checkbox"});var Ao=f(require("react"),1);var g=require("react/jsx-runtime"),Me=Ao.forwardRef(({quantity:o,className:e,onChange:t,...r},i)=>{let s=n("cocso-stock-quantity-status",{},[],e);return(0,g.jsxs)("div",{ref:i,className:s,"data-status":o,...r,children:[(0,g.jsx)("span",{className:"cocso-stock-quantity-status-indicator",children:o==="\uC5EC\uC720"?(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48047 6.10059H7.06543C5.98955 6.10059 5.11719 6.968 5.11719 8.03809C5.11741 9.10782 5.98893 9.97532 7.06445 9.97559H9.48047V13.0752H7.06445C4.35911 13.0749 2.14983 10.9652 2.00781 8.30957V7.76465C2.15041 5.10939 4.36025 3 7.06543 3H9.48047V6.10059ZM12.0518 6.10059C13.1276 6.10059 14 6.968 14 8.03809C13.9999 9.10806 13.1276 9.97559 12.0518 9.97559H9.48047V6.10059H12.0518Z",fill:"currentColor"})]}):o==="\uBCF4\uD1B5"?(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48145 6.0752V6.10059H7.06641C5.99053 6.10059 5.11817 6.968 5.11816 8.03809C5.11839 9.10782 5.98991 9.97532 7.06543 9.97559H9.48145V13.0752H7.06543C4.35577 13.0749 2.14345 10.9585 2.00781 8.29688V7.77832C2.03849 7.17662 2.17568 6.60303 2.40039 6.0752H9.48145ZM12.0527 6.10059C13.1286 6.10059 14.001 6.968 14.001 8.03809C14.0008 9.10806 13.1285 9.97559 12.0527 9.97559H9.48145V6.10059H12.0527Z",fill:"currentColor"})]}):(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),(0,g.jsx)("path",{d:"M7.04688 9.97461C7.05273 9.97466 7.05859 9.97558 7.06445 9.97559H9.48047V13.0752H7.06445C4.95754 13.075 3.15182 11.7952 2.38867 9.97461H7.04688ZM12.0713 9.97461C12.0648 9.97467 12.0582 9.97559 12.0518 9.97559H9.48047V9.97461H12.0713Z",fill:"currentColor"})]})}),(0,g.jsx)(W,{size:"sm",color:"currentColor",children:o})]})}),Oe=Object.assign(Me,{displayName:"StockQuantityStatus"});var zo=f(require("react"),1),J=f(require("@radix-ui/react-switch"),1);var E=require("react/jsx-runtime"),Fe=zo.forwardRef(({id:o,size:e="md",disabled:t=!1,label:r,position:i="right",className:s,children:m,...c},p)=>{let l=n("cocso-switch",{size:e,disabled:t},[],s),d=n("cocso-switch-thumb",{size:e});return(0,E.jsxs)("div",{className:"cocso-switch-wrapper",children:[i==="left"&&(0,E.jsx)(W,{size:e,htmlFor:o,children:r}),(0,E.jsx)(J.Root,{ref:p,className:l,...c,children:(0,E.jsx)(J.Thumb,{className:d})}),i==="right"&&(0,E.jsx)(W,{size:e,htmlFor:o,children:r})]})}),He=Object.assign(Fe,{displayName:"Switch"});var H=f(require("@radix-ui/react-tabs"),1),$=require("react");var _=require("react/jsx-runtime"),Be=(0,$.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab",{},[],o);return(0,_.jsx)(H.Root,{ref:t,className:r,...e})}),Ee=(0,$.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-list",{},[],o);return(0,_.jsx)(H.List,{ref:t,className:r,...e})}),Ie=(0,$.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-trigger",{},[],o);return(0,_.jsx)(H.Trigger,{ref:t,className:r,...e})}),Ae=(0,$.forwardRef)(({className:o,...e},t)=>{let r=n("cocso-tab-content",{},[],o);return(0,_.jsx)(H.Content,{ref:t,className:r,...e})}),ze=Object.assign(Be,{List:Ee,Trigger:Ie,Content:Ae});var X=require("sonner"),Ve=Object.assign(X.Toaster,{displayName:"Toast"});var Vo=f(require("react"),1);var I=require("react/jsx-runtime"),je=Vo.forwardRef(({size:o="md",disabled:e=!1,className:t,style:r,children:i,...s},m)=>{let c=n("cocso-select",{size:o,disabled:e},[],t);return(0,I.jsxs)("div",{className:"cocso-select-wrapper",children:[(0,I.jsx)("select",{ref:m,className:c,disabled:e,...s,children:i}),(0,I.jsx)("i",{className:"cocso-select-icon",children:(0,I.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,I.jsx)("path",{d:"m6 9 6 6 6-6"})})})]})}),Ze=Object.assign(je,{displayName:"Select"});
package/lib/index.d.ts CHANGED
@@ -1,4 +1,20 @@
1
+ export * from './components/Accordion';
1
2
  export * from './components/Body';
2
3
  export * from './components/Button';
3
4
  export * from './components/Display';
5
+ export * from './components/Dropdown';
6
+ export * from './components/FileUpload';
4
7
  export * from './components/Heading';
8
+ export * from './components/Label';
9
+ export * from './components/Link';
10
+ export * from './components/Modal';
11
+ export * from './components/OneTimePasswordField';
12
+ export * from './components/Pagination';
13
+ export * from './components/Popover';
14
+ export * from './components/Checkbox';
15
+ export * from './components/Spinner';
16
+ export * from './components/StockQuantityStatus';
17
+ export * from './components/Switch';
18
+ export * from './components/Tab';
19
+ export * from './components/Toast';
20
+ export * from './components/Select';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- import*as g from"react";function c(e){if(e)return`var(--color-${e.replace(/\./g,"-")})`}var x={thin:"100","extra-light":"200",light:"300",normal:"400",medium:"500","semi-bold":"600",bold:"700","extra-bold":"800",black:"900"};function i(e){if(e)return x[e]??e}var b=(...e)=>e.filter(Boolean).join(" ").trim(),E=(e,t,o)=>`${e}--${t}_${o}`,W=(e,t)=>Object.entries(t).map(([o,n])=>E(e,o,n)).join(" "),F=(e,t)=>Object.entries(e).every(([o,n])=>t[o]===n),D=(e,t)=>{let o=Object.entries(t).map(([n,s])=>`${n}_${s}`).join("-");return`${e}--${o}`},P=(e,t,o)=>o.filter(n=>F(n,t)).map(n=>D(e,n)).join(" "),l=(e,t,o=[],...n)=>{let s=e,a=W(e,t),r=P(e,t,o);return b(s,a,r,...n)};import{jsx as B}from"react/jsx-runtime";var N=["p","a","span","div","label","li","td","th","figcaption","blockquote","cite"],w=g.forwardRef(({as:e=N[0],size:t="md",color:o,fontWeight:n="normal",className:s,style:a,...r},p)=>{let m=e,d=l("cocso-body",{size:t},[],s);return B(m,{ref:p,className:d,style:{"--cocso-body-color":c(o),"--cocso-body-weight":i(n),...a},...r})}),M=Object.assign(w,{displayName:"Body"});import*as R from"react";import{jsx as k}from"react/jsx-runtime";var O=["button"],v=R.forwardRef(({as:e=O[0],variant:t="primary",size:o="md",disabled:n=!1,loading:s=!1,color:a,fontWeight:r="bold",className:p,style:m,...f},d)=>{let T=e,h={variant:t,size:o,...n&&{disabled:"true"},...s&&{loading:"true"}},C=l("cocso-button",h,[],p);return k(T,{ref:d,className:C,style:{"--cocso-button-color":c(a),"--cocso-button-weight":i(r),...m},...f})}),X=Object.assign(v,{displayName:"Button"});import*as y from"react";import{jsx as S}from"react/jsx-runtime";var z=["h1","h2","h3","h4","h5","h6"],H=y.forwardRef(({as:e=z[0],size:t="md",color:o,fontWeight:n="bold",className:s,style:a,...r},p)=>{let m=e,d=l("cocso-display",{size:t},[],s);return S(m,{ref:p,className:d,style:{"--cocso-display-color":c(o),"--cocso-display-weight":i(n),...a},...r})}),se=Object.assign(H,{displayName:"Display"});import*as u from"react";import{jsx as _}from"react/jsx-runtime";var $=["h1","h2","h3","h4","h5","h6"],j=u.forwardRef(({as:e=$[1],size:t="md",color:o,fontWeight:n="bold",className:s,style:a,...r},p)=>{let m=e,d=l("cocso-heading",{size:t},[],s);return _(m,{ref:p,className:d,style:{"--cocso-heading-color":c(o),"--cocso-heading-weight":i(n),...a},...r})}),me=Object.assign(j,{displayName:"Heading"});export{M as Body,X as Button,se as Display,me as Heading};
1
+ import*as w from"@radix-ui/react-accordion";import{forwardRef as eo}from"react";var Do=(...e)=>e.filter(Boolean).join(" ").trim(),i=(e,o,t=[],...r)=>{let n=Object.entries(o).filter(([,m])=>m!==!1&&m!==null&&m!==void 0).map(([m,c])=>`${e}--${m}_${c}`).join(" "),s=t.filter(m=>Object.entries(m).every(([c,p])=>o[c]===p)).map(m=>{let c=Object.entries(m).map(([p,l])=>`${p}_${l}`).join("-");return`${e}--${c}`}).join(" ");return Do(e,n,s,...r)};import{Slottable as Mo}from"@radix-ui/react-slot";import{jsx as H,jsxs as Bo}from"react/jsx-runtime";var Oo=eo(({className:e,...o},t)=>{let r=i("cocso-accordion-item",{},[],e);return H(w.Item,{ref:t,className:r,...o})}),Fo=eo(({className:e,children:o,chevron:t=!0,...r},n)=>{let s=i("cocso-accordion-trigger",{},[],e);return H(w.Trigger,{ref:n,className:s,...r,children:Bo(Mo,{children:[o,t&&H("div",{className:"cocso-accordion-chevron",children:H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:H("path",{d:"m6 9 6 6 6-6"})})})]})})}),Ho=eo(({className:e,...o},t)=>{let r=i("cocso-accordion-content",{},[],e);return H(w.Content,{ref:t,className:r,...o})}),Be=Object.assign(w.Root,{Item:Oo,Header:w.Header,Trigger:Fo,Content:Ho});import*as so from"react";import{Slot as Eo}from"@radix-ui/react-slot";function g(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var no={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function u(e){if(e)return e in no?no[e]:e}import{jsx as Ao}from"react/jsx-runtime";var Io=so.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="normal",className:n,style:s,...m},c)=>{let l=i("cocso-body",{size:o},[],n);return Ao(e?Eo:"p",{ref:c,className:l,style:{"--cocso-body-color":g(t),"--cocso-body-weight":u(r),...s},...m})}),z=Object.assign(Io,{displayName:"Body"});import*as I from"react";import{Slot as Zo}from"@radix-ui/react-slot";import*as ao from"react";import{jsx as to,jsxs as jo}from"react/jsx-runtime";var zo=["div"],Vo=ao.forwardRef(({as:e=zo[0],size:o="md",color:t="palette.primary-500",bg:r="palette.gray-200",className:n,style:s,...m},c)=>{let p=e,d=i("cocso-spinner",{size:o},[],n);return to(p,{ref:c,className:d,style:{"--cocso-spinner-bg":g(r),"--cocso-spinner-color":g(t),...s},...m,children:jo("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[to("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),to("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),co=Object.assign(Vo,{displayName:"Spinner"});import{jsx as mo}from"react/jsx-runtime";var $o=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],_o=I.forwardRef(({asChild:e=!1,variant:o="primary",size:t="md",disabled:r=!1,loading:n=!1,color:s,weight:m="normal",className:c,style:p,children:l,onClick:d,onKeyDown:C,...k},E)=>{let h=r||n,v=I.useCallback(b=>{if(h){b.preventDefault();return}d?.(b)},[h,d]),q=I.useCallback(b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h||b.currentTarget.click()),C?.(b)},[h,C]),J={variant:o,size:t,loading:n,disabled:h},X=[...r?[{variant:o,disabled:r}]:[],...n?[{variant:o,loading:n}]:[]],Y=i("cocso-button",J,X,c),oo={"--cocso-button-color":g(s),"--cocso-button-weight":u(m),...p};return mo(e?Zo:"button",{ref:E,className:Y,onClick:v,onKeyDown:q,role:"button",disabled:h,"aria-disabled":h,"aria-busy":n,style:oo,...k,children:n?mo(co,{className:"cocso-button-spinner",size:$o(t),color:"currentColor"}):l})}),nt=Object.assign(_o,{displayName:"Button"});import*as lo from"react";import{Slot as Qo}from"@radix-ui/react-slot";import{jsx as Go}from"react/jsx-runtime";var Uo=lo.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...m},c)=>{let l=i("cocso-display",{size:o},[],n);return Go(e?Qo:"h1",{ref:c,className:l,style:{"--cocso-display-color":g(t),"--cocso-display-weight":u(r),...s},...m})}),ft=Object.assign(Uo,{displayName:"Display"});import*as y from"@radix-ui/react-dropdown-menu";import{forwardRef as po}from"react";import{jsx as fo}from"react/jsx-runtime";var Ko=po(({className:e,...o},t)=>{let r=i("cocso-dropdown-content",{},[],e);return fo(y.Content,{ref:t,className:r,...o})}),qo=po(({className:e,...o},t)=>{let r=i("cocso-dropdown-item",{},[],e);return fo(y.Item,{ref:t,className:r,...o})}),wt=Object.assign(y.Root,{Trigger:y.Trigger,Portal:y.Portal,Content:Ko,Item:qo});import*as Co from"react";import{useRef as go,useState as oe,useCallback as x}from"react";import*as ho from"react";import{Slot as Jo}from"@radix-ui/react-slot";import{jsx as Yo}from"react/jsx-runtime";var Xo=ho.forwardRef(({asChild:e=!1,size:o="md",color:t="text.basic",weight:r="normal",className:n,style:s,...m},c)=>{let l=i("cocso-label",{size:o},[],n);return Yo(e?Jo:"label",{ref:c,className:l,style:{"--cocso-label-color":g(t),"--cocso-label-weight":u(r),...s},...m})}),L=Object.assign(Xo,{displayName:"Label"});import{jsx as S,jsxs as B}from"react/jsx-runtime";var ee=Co.forwardRef(({maxFiles:e=2,files:o,onFilesChange:t,onRemove:r,multiple:n=!0,accept:s,...m},c)=>{let[p,l]=oe(!1),d=go(null),C=go(null),k=3*1024*1024,E=x(a=>s?s.split(",").map(P=>P.trim()).some(P=>{if(P.endsWith("/*")){let A=P.slice(0,-2);return a.type.startsWith(A)}return a.type===P||a.name.toLowerCase().endsWith(P)}):!0,[s]),h=x(a=>a.size>k?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),v=x(a=>{let P=Array.from(a).filter(O=>E(O)?h(O):(alert(`${O.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(P.length===0)return;let A=e-o.length;if(A<=0){alert(`\uCD5C\uB300 ${e}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let Wo=P.slice(0,A).map(O=>({file:O,name:O.name,size:O.size}));t([...o,...Wo])},[o,e,t,E,h]),q=x(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),J=x(a=>{a.preventDefault(),a.stopPropagation(),C.current&&!C.current.contains(a.relatedTarget)&&l(!1)},[]),X=x(a=>{a.preventDefault(),a.stopPropagation()},[]),Y=x(a=>{a.preventDefault(),a.stopPropagation(),l(!1);let{files:T}=a.dataTransfer;T&&v(T)},[v]),oo=x(a=>{let{files:T}=a.target;T&&v(T)},[v]),ro=x(a=>{let T=o.filter(P=>P.name!==a);t(T),r?.(a)},[o,t,r]),b=x(()=>{d.current?.click()},[]),io=o.length>=e||!n&&o.length>=1;return B("div",{className:"cocso-file-upload-wrapper",children:[!io&&B("div",{ref:C,onDragEnter:q,onDragOver:X,onDragLeave:J,onDrop:Y,onClick:b,className:"cocso-file-upload","data-drag-active":p,children:[S("input",{ref:a=>{d.current=a,typeof c=="function"?c(a):c&&(c.current=a)},type:"file",onChange:oo,multiple:n,accept:s,style:{display:"none"},...m}),B(L,{size:"xs",color:"palette.gray-600",children:["\uD30C\uC77C\uC744 \uC5EC\uAE30\uC5D0 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098, \uD074\uB9AD\uD558\uC5EC \uD30C\uC77C\uC744 \uC120\uD0DD\uD558\uC138\uC694",S("br",{}),"(\uCD5C\uB300 3MB)"]}),B("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S("path",{d:"M5 12h14"}),S("path",{d:"M12 5v14"})]})]}),o.length>0&&S("div",{className:"cocso-file-upload-list",children:o.map(a=>B("div",{className:"cocso-file-upload-item",children:[S(z,{size:"xs",children:a.name}),S("button",{type:"button",onClick:()=>ro(a.name),className:"cocso-file-upload-remove",children:B("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[S("path",{d:"M18 6 6 18"}),S("path",{d:"m6 6 12 12"})]})})]},a.name))})]})}),Et=Object.assign(ee,{displayName:"FileUpload"});import*as uo from"react";import{Slot as te}from"@radix-ui/react-slot";import{jsx as ie}from"react/jsx-runtime";var re=uo.forwardRef(({asChild:e=!1,size:o="md",color:t,weight:r="bold",className:n,style:s,...m},c)=>{let l=i("cocso-heading",{size:o},[],n);return ie(e?te:"h2",{ref:c,className:l,style:{"--cocso-heading-color":g(t),"--cocso-heading-weight":u(r),...s},...m})}),vo=Object.assign(re,{displayName:"Heading"});import*as Po from"react";import{Slot as ne}from"@radix-ui/react-slot";import{jsx as ae}from"react/jsx-runtime";var se=Po.forwardRef(({asChild:e=!1,size:o="md",weight:t="normal",indicator:r=!0,className:n,style:s,...m},c)=>{let l=i("cocso-link",{size:o,indicator:r},[],n);return ae(e?ne:"a",{ref:c,className:l,style:{"--cocso-link-weight":u(t),...s},...m})}),Xt=Object.assign(se,{displayName:"Link"});import*as f from"@radix-ui/react-dialog";import{forwardRef as V}from"react";import{jsx as N,jsxs as Ro}from"react/jsx-runtime";var ce=V(({className:e,children:o,...t},r)=>{let n=i("cocso-modal-content",{},[],e);return Ro(f.Portal,{children:[N(f.Overlay,{className:"cocso-modal-overlay"}),N(f.Content,{ref:r,className:n,...t,children:o})]})}),me=V(({className:e,children:o,...t},r)=>{let n=i("cocso-modal-close-wrapper",{},[],e);return N("div",{className:n,...t,children:N(f.Close,{className:"cocso-modal-close",children:Ro("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[N("path",{d:"M18 6 6 18"}),N("path",{d:"m6 6 12 12"})]})})})}),le=V(({className:e,children:o,...t},r)=>{let n=i("cocso-modal-title",{},[],e);return N(f.Title,{ref:r,className:n,asChild:!0,...t,children:N(vo,{color:"text.basic",children:o})})}),pe=V(({className:e,children:o,...t},r)=>{let n=i("cocso-modal-description",{},[],e);return N(f.Description,{ref:r,className:n,asChild:!0,...t,children:N(z,{size:"sm",color:"text.subtle",children:o})})}),mr=Object.assign(f.Root,{Trigger:f.Trigger,Content:ce,Close:me,Title:le,Description:pe});import*as j from"@radix-ui/react-one-time-password-field";import{forwardRef as bo}from"react";import{jsx as wo}from"react/jsx-runtime";var de=bo(({className:e,...o},t)=>{let r=i("cocso-otp",{},[],e);return wo(j.Root,{ref:t,className:r,...o})}),fe=bo(({className:e,...o},t)=>{let r=i("cocso-otp-input",{},[],e);return wo(j.Input,{ref:t,className:r,...o})}),vr=Object.assign(de,{Input:fe});import*as xo from"react";import{Fragment as ge,jsx as W,jsxs as yo}from"react/jsx-runtime";var he=xo.forwardRef(({className:e,page:o,totalPages:t,maxVisible:r=5,onChange:n,...s},m)=>{let c=Math.ceil(r/2),p=d=>W("button",{className:"cocso-pagination-item",onClick:()=>n(d),"data-active":o===d,children:d},d),l=i("cocso-pagination",{},[],e);return yo("div",{ref:m,className:l,...s,children:[t>1&&W("button",{className:"cocso-pagination-arrow",disabled:o===1,onClick:()=>o>1&&n(o-1),children:W("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:W("path",{d:"m15 18-6-6 6-6"})})}),t<=r+2?Array(t).fill(0).map((d,C)=>p(C+1)):yo(ge,{children:[p(1),o>1+c&&W("span",{className:"cocso-pagination-trunc",children:"..."}),Array(r).fill(0).map((d,C)=>{let k=o-c+C+1;return k>1&&k<t?p(k):""}),o<t-c&&W("span",{className:"cocso-pagination-trunc",children:"..."}),p(t)]}),t>1&&W("button",{className:"cocso-pagination-arrow",disabled:o===t,onClick:()=>o<t&&n(o+1),children:W("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:W("path",{d:"m9 18 6-6-6-6"})})})]})}),xr=Object.assign(he,{displayName:"Pagination"});import*as D from"@radix-ui/react-popover";import{forwardRef as Ce}from"react";import{jsx as ve}from"react/jsx-runtime";var ue=Ce(({className:e,...o},t)=>{let r=i("cocso-popover-content",{},[],e);return ve(D.Content,{ref:t,className:r,...o})}),Or=Object.assign(D.Root,{Trigger:D.Trigger,Portal:D.Portal,Content:ue});import*as ko from"react";import*as Z from"@radix-ui/react-checkbox";import{jsx as F,jsxs as No}from"react/jsx-runtime";var Pe=ko.forwardRef(({id:e,size:o="md",status:t,onChange:r,label:n,disabled:s=!1,className:m,...c},p)=>{let l={size:o,disabled:s,status:t},d=[...s?[{status:t,disabled:s}]:[]],C=i("cocso-checkbox",l,d,m),k=h=>{if(!s){let v;h===!0?v="on":h==="indeterminate"?v="intermediate":v="off",r(v)}};return No("div",{className:"cocso-checkbox-wrapper",children:[No(Z.Root,{ref:p,id:e,className:C,checked:(()=>{switch(t){case"on":return!0;case"intermediate":return"indeterminate";case"off":default:return!1}})(),onCheckedChange:k,disabled:s,...c,children:[F(Z.Indicator,{className:"cocso-checkbox-indicator",style:{opacity:t==="on"?1:0},children:F("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:F("path",{d:"M20 6 9 17l-5-5"})})}),F("div",{className:"cocso-checkbox-indicator",style:{opacity:t==="intermediate"?1:0},children:F("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:F("path",{d:"M5 12h14"})})})]}),n&&F(L,{className:i("cocso-checkbox-label",{disabled:s}),size:o,htmlFor:e,children:n})]})}),zr=Object.assign(Pe,{displayName:"Checkbox"});import*as To from"react";import{jsx as R,jsxs as $}from"react/jsx-runtime";var Re=To.forwardRef(({quantity:e,className:o,onChange:t,...r},n)=>{let s=i("cocso-stock-quantity-status",{},[],o);return $("div",{ref:n,className:s,"data-status":e,...r,children:[R("span",{className:"cocso-stock-quantity-status-indicator",children:e==="\uC5EC\uC720"?$("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),R("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),R("path",{d:"M9.48047 6.10059H7.06543C5.98955 6.10059 5.11719 6.968 5.11719 8.03809C5.11741 9.10782 5.98893 9.97532 7.06445 9.97559H9.48047V13.0752H7.06445C4.35911 13.0749 2.14983 10.9652 2.00781 8.30957V7.76465C2.15041 5.10939 4.36025 3 7.06543 3H9.48047V6.10059ZM12.0518 6.10059C13.1276 6.10059 14 6.968 14 8.03809C13.9999 9.10806 13.1276 9.97559 12.0518 9.97559H9.48047V6.10059H12.0518Z",fill:"currentColor"})]}):e==="\uBCF4\uD1B5"?$("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),R("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),R("path",{d:"M9.48145 6.0752V6.10059H7.06641C5.99053 6.10059 5.11817 6.968 5.11816 8.03809C5.11839 9.10782 5.98991 9.97532 7.06543 9.97559H9.48145V13.0752H7.06543C4.35577 13.0749 2.14345 10.9585 2.00781 8.29688V7.77832C2.03849 7.17662 2.17568 6.60303 2.40039 6.0752H9.48145ZM12.0527 6.10059C13.1286 6.10059 14.001 6.968 14.001 8.03809C14.0008 9.10806 13.1285 9.97559 12.0527 9.97559H9.48145V6.10059H12.0527Z",fill:"currentColor"})]}):$("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),R("path",{d:"M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",fill:"#D9D9D9",fillOpacity:"0.85098"}),R("path",{d:"M7.04688 9.97461C7.05273 9.97466 7.05859 9.97558 7.06445 9.97559H9.48047V13.0752H7.06445C4.95754 13.075 3.15182 11.7952 2.38867 9.97461H7.04688ZM12.0713 9.97461C12.0648 9.97467 12.0582 9.97559 12.0518 9.97559H9.48047V9.97461H12.0713Z",fill:"currentColor"})]})}),R(L,{size:"sm",color:"currentColor",children:e})]})}),Ur=Object.assign(Re,{displayName:"StockQuantityStatus"});import*as Lo from"react";import*as Q from"@radix-ui/react-switch";import{jsx as _,jsxs as we}from"react/jsx-runtime";var be=Lo.forwardRef(({id:e,size:o="md",disabled:t=!1,label:r,position:n="right",className:s,children:m,...c},p)=>{let l=i("cocso-switch",{size:o,disabled:t},[],s),d=i("cocso-switch-thumb",{size:o});return we("div",{className:"cocso-switch-wrapper",children:[n==="left"&&_(L,{size:o,htmlFor:e,children:r}),_(Q.Root,{ref:p,className:l,...c,children:_(Q.Thumb,{className:d})}),n==="right"&&_(L,{size:o,htmlFor:e,children:r})]})}),oi=Object.assign(be,{displayName:"Switch"});import*as M from"@radix-ui/react-tabs";import{forwardRef as U}from"react";import{jsx as G}from"react/jsx-runtime";var ye=U(({className:e,...o},t)=>{let r=i("cocso-tab",{},[],e);return G(M.Root,{ref:t,className:r,...o})}),xe=U(({className:e,...o},t)=>{let r=i("cocso-tab-list",{},[],e);return G(M.List,{ref:t,className:r,...o})}),Ne=U(({className:e,...o},t)=>{let r=i("cocso-tab-trigger",{},[],e);return G(M.Trigger,{ref:t,className:r,...o})}),ke=U(({className:e,...o},t)=>{let r=i("cocso-tab-content",{},[],e);return G(M.Content,{ref:t,className:r,...o})}),mi=Object.assign(ye,{List:xe,Trigger:Ne,Content:ke});import{Toaster as Te,toast as gi}from"sonner";var Ci=Object.assign(Te,{displayName:"Toast"});import*as So from"react";import{jsx as K,jsxs as Se}from"react/jsx-runtime";var Le=So.forwardRef(({size:e="md",disabled:o=!1,className:t,style:r,children:n,...s},m)=>{let c=i("cocso-select",{size:e,disabled:o},[],t);return Se("div",{className:"cocso-select-wrapper",children:[K("select",{ref:m,className:c,disabled:o,...s,children:n}),K("i",{className:"cocso-select-icon",children:K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:K("path",{d:"m6 9 6 6 6-6"})})})]})}),bi=Object.assign(Le,{displayName:"Select"});export{Be as Accordion,z as Body,nt as Button,zr as Checkbox,ft as Display,wt as Dropdown,Et as FileUpload,vo as Heading,L as Label,Xt as Link,mr as Modal,vr as OneTimePasswordField,xr as Pagination,Or as Popover,bi as Select,co as Spinner,Ur as StockQuantityStatus,oi as Switch,mi as Tab,Ci as Toaster,gi as toast};
@@ -1,13 +1,13 @@
1
1
  export declare function createColor(token: string | undefined): string | undefined;
2
2
  declare const FONT_WEIGHT_MAP: {
3
3
  readonly thin: "100";
4
- readonly 'extra-light': "200";
4
+ readonly extralight: "200";
5
5
  readonly light: "300";
6
6
  readonly normal: "400";
7
7
  readonly medium: "500";
8
- readonly 'semi-bold': "600";
8
+ readonly semibold: "600";
9
9
  readonly bold: "700";
10
- readonly 'extra-bold': "800";
10
+ readonly extrabold: "800";
11
11
  readonly black: "900";
12
12
  };
13
13
  export type FontWeightToken = keyof typeof FONT_WEIGHT_MAP;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocso-ui/react",
3
- "version": "0.0.1-beta.9",
3
+ "version": "0.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cocso/cocso-ui.git",
@@ -24,16 +24,27 @@
24
24
  "files": [
25
25
  "lib"
26
26
  ],
27
- "dependencies": {},
27
+ "dependencies": {
28
+ "@radix-ui/react-accordion": "^1.2.11",
29
+ "@radix-ui/react-checkbox": "^1.3.2",
30
+ "@radix-ui/react-dialog": "^1.1.14",
31
+ "@radix-ui/react-dropdown-menu": "^2.1.15",
32
+ "@radix-ui/react-one-time-password-field": "^0.1.7",
33
+ "@radix-ui/react-popover": "^1.1.14",
34
+ "@radix-ui/react-slot": "^1.2.3",
35
+ "@radix-ui/react-switch": "^1.2.5",
36
+ "@radix-ui/react-tabs": "^1.1.12",
37
+ "sonner": "^2.0.6"
38
+ },
28
39
  "peerDependencies": {
29
- "react": "^18 || ^19",
30
- "react-dom": "^18 || ^19"
40
+ "react": "^19.1.0",
41
+ "react-dom": "^19.1.0"
31
42
  },
32
43
  "devDependencies": {
33
- "@types/react": "^19",
34
- "@types/react-dom": "^19",
35
- "esbuild": "^0.24.0",
36
- "typescript": "^5.0.0"
44
+ "@types/react": "^19.1.8",
45
+ "@types/react-dom": "^19.1.6",
46
+ "esbuild": "^0.25.8",
47
+ "typescript": "^5.8.3"
37
48
  },
38
49
  "publishConfig": {
39
50
  "access": "public"