@cocso-ui/react 0.0.4-beta.1 → 0.1.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/lib/components/{Accordion → accordion}/Accordion.d.ts +6 -3
- package/lib/components/body/Body.d.ts +12 -0
- package/lib/components/button/Button.d.ts +18 -0
- package/lib/components/checkbox/Checkbox.d.ts +14 -0
- package/lib/components/display/Display.d.ts +12 -0
- package/lib/components/{FileUpload → file-upload}/FileUpload.d.ts +5 -5
- package/lib/components/heading/Heading.d.ts +13 -0
- package/lib/components/link/Link.d.ts +12 -0
- package/lib/components/{Modal → modal}/Modal.d.ts +1 -1
- package/lib/components/pagination/Pagination.d.ts +8 -0
- package/lib/components/select/Select.d.ts +8 -0
- package/lib/components/spinner/Spinner.d.ts +10 -0
- package/lib/components/stock-quantity-status/StockQuantityStatus.d.ts +7 -0
- package/lib/components/switch/Switch.d.ts +12 -0
- package/lib/components/toast/index.d.ts +1 -0
- package/lib/components/token/color.d.ts +80 -0
- package/lib/components/token/index.d.ts +2 -0
- package/lib/components/token/typography.d.ts +36 -0
- package/lib/components/typography/Typography.d.ts +17 -0
- package/lib/components/typography/index.d.ts +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.css +1 -0
- package/lib/index.d.ts +20 -20
- package/lib/index.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/token.d.ts +0 -14
- package/package.json +23 -14
- package/lib/components/Body/Body.d.ts +0 -16
- package/lib/components/Button/Button.d.ts +0 -22
- package/lib/components/Checkbox/Checkbox.d.ts +0 -21
- package/lib/components/Display/Display.d.ts +0 -16
- package/lib/components/Heading/Heading.d.ts +0 -16
- package/lib/components/Label/Label.d.ts +0 -16
- package/lib/components/Label/index.d.ts +0 -1
- package/lib/components/Link/Link.d.ts +0 -16
- package/lib/components/Pagination/Pagination.d.ts +0 -15
- package/lib/components/Select/Select.d.ts +0 -11
- package/lib/components/Spinner/Spinner.d.ts +0 -19
- package/lib/components/StockQuantityStatus/StockQuantityStatus.d.ts +0 -10
- package/lib/components/Switch/Switch.d.ts +0 -18
- package/lib/components/Toast/Toast.d.ts +0 -5
- package/lib/components/Toast/index.d.ts +0 -1
- package/lib/utils/cn.d.ts +0 -2
- /package/lib/components/{Accordion → accordion}/index.d.ts +0 -0
- /package/lib/components/{Body → body}/index.d.ts +0 -0
- /package/lib/components/{Button → button}/index.d.ts +0 -0
- /package/lib/components/{Checkbox → checkbox}/index.d.ts +0 -0
- /package/lib/components/{Display → display}/index.d.ts +0 -0
- /package/lib/components/{Dropdown → dropdown}/Dropdown.d.ts +0 -0
- /package/lib/components/{Dropdown → dropdown}/index.d.ts +0 -0
- /package/lib/components/{FileUpload → file-upload}/index.d.ts +0 -0
- /package/lib/components/{Heading → heading}/index.d.ts +0 -0
- /package/lib/components/{Link → link}/index.d.ts +0 -0
- /package/lib/components/{Modal → modal}/index.d.ts +0 -0
- /package/lib/components/{OneTimePasswordField → one-time-password-field}/OneTimePasswordField.d.ts +0 -0
- /package/lib/components/{OneTimePasswordField → one-time-password-field}/index.d.ts +0 -0
- /package/lib/components/{Pagination → pagination}/index.d.ts +0 -0
- /package/lib/components/{Popover → popover}/Popover.d.ts +0 -0
- /package/lib/components/{Popover → popover}/index.d.ts +0 -0
- /package/lib/components/{Select → select}/index.d.ts +0 -0
- /package/lib/components/{Spinner → spinner}/index.d.ts +0 -0
- /package/lib/components/{StockQuantityStatus → stock-quantity-status}/index.d.ts +0 -0
- /package/lib/components/{Switch → switch}/index.d.ts +0 -0
- /package/lib/components/{Tab → tab}/Tab.d.ts +0 -0
- /package/lib/components/{Tab → tab}/index.d.ts +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
interface TriggerProps extends ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> {
|
|
4
|
+
chevron?: boolean;
|
|
5
|
+
}
|
|
2
6
|
export declare const Accordion: import("react").ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>> & {
|
|
3
7
|
Item: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
8
|
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>>;
|
|
9
|
+
Trigger: import("react").ForwardRefExoticComponent<TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
10
|
Content: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
11
|
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { type FontWeight, type LineHeight } from '../typography';
|
|
3
|
+
type FontSize = 'lg' | 'md' | 'sm' | 'xs';
|
|
4
|
+
export interface BodyProps extends ComponentPropsWithoutRef<'p'> {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: FontSize;
|
|
8
|
+
weight?: FontWeight;
|
|
9
|
+
lineHeight?: LineHeight;
|
|
10
|
+
}
|
|
11
|
+
export declare const Body: import("react").ForwardRefExoticComponent<BodyProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { FontWeight } from '../typography';
|
|
3
|
+
export type ButtonSize = 'tiny' | 'small' | 'medium' | 'large';
|
|
4
|
+
export type ButtonType = 'primary' | 'secondary' | 'tertiary' | 'success' | 'error' | 'warning' | 'neutral';
|
|
5
|
+
export type ButtonShape = 'square' | 'circle' | 'rounded';
|
|
6
|
+
export interface ButtonProps extends Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'prefix'> {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
type?: ButtonType;
|
|
10
|
+
weight?: FontWeight;
|
|
11
|
+
shape?: ButtonShape;
|
|
12
|
+
prefix?: ReactNode;
|
|
13
|
+
suffix?: ReactNode;
|
|
14
|
+
svgOnly?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
type CheckboxSize = 'lg' | 'md' | 'sm';
|
|
4
|
+
export type CheckboxStatus = 'on' | 'off' | 'intermediate';
|
|
5
|
+
export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'checked' | 'onCheckedChange' | 'onChange'> {
|
|
6
|
+
id?: string;
|
|
7
|
+
size?: CheckboxSize;
|
|
8
|
+
status: CheckboxStatus;
|
|
9
|
+
onChange: (status: CheckboxStatus) => void;
|
|
10
|
+
label?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { type FontWeight, type LineHeight } from '../typography';
|
|
3
|
+
type FontSize = 'lg' | 'md' | 'sm';
|
|
4
|
+
export interface DisplayProps extends ComponentPropsWithoutRef<'h1'> {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: FontSize;
|
|
8
|
+
weight?: FontWeight;
|
|
9
|
+
lineHeight?: LineHeight;
|
|
10
|
+
}
|
|
11
|
+
export declare const Display: import("react").ForwardRefExoticComponent<DisplayProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
12
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
3
|
export interface FileItem {
|
|
3
4
|
file: File;
|
|
4
5
|
name: string;
|
|
5
6
|
size: number;
|
|
6
7
|
}
|
|
7
|
-
export
|
|
8
|
+
export interface FileUploadProps extends ComponentPropsWithoutRef<'input'> {
|
|
8
9
|
maxFiles?: number;
|
|
9
10
|
files: FileItem[];
|
|
10
11
|
onFilesChange: (files: FileItem[]) => void;
|
|
11
12
|
onRemove?: (fileName: string) => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
};
|
|
13
|
+
}
|
|
14
|
+
export declare const FileUpload: React.ForwardRefExoticComponent<FileUploadProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import type { fontWeight as fontWeightToken, lineHeight as lineHeightToken } from '../token';
|
|
3
|
+
type FontSize = 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
|
|
4
|
+
type FontWeight = keyof typeof fontWeightToken;
|
|
5
|
+
type LineHeight = keyof typeof lineHeightToken;
|
|
6
|
+
export interface HeadingProps extends ComponentPropsWithoutRef<'h2'> {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
size?: FontSize;
|
|
9
|
+
weight?: FontWeight;
|
|
10
|
+
lineHeight?: LineHeight;
|
|
11
|
+
}
|
|
12
|
+
export declare const Heading: import("react").ForwardRefExoticComponent<HeadingProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import type { FontWeight, LineHeight } from '../typography';
|
|
3
|
+
type LinkSize = 'lg' | 'md' | 'sm' | 'xs';
|
|
4
|
+
export interface LinkProps extends ComponentPropsWithoutRef<'a'> {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
size?: LinkSize;
|
|
7
|
+
weight?: FontWeight;
|
|
8
|
+
lineHeight?: LineHeight;
|
|
9
|
+
indicator?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
12
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import * as ModalPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
export declare const Modal: import("react").FC<ModalPrimitive.DialogProps> & {
|
|
3
3
|
Trigger: import("react").ForwardRefExoticComponent<ModalPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
Content: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
-
Close: import("react").ForwardRefExoticComponent<Omit<
|
|
5
|
+
Close: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
Title: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
7
7
|
Description: import("react").ForwardRefExoticComponent<Omit<ModalPrimitive.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
8
8
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface PaginationProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
3
|
+
page: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
maxVisible?: number;
|
|
6
|
+
onChange: (pageNumber: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type SelectSize = 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
|
|
3
|
+
export interface SelectProps extends Omit<ComponentPropsWithoutRef<'select'>, 'size'> {
|
|
4
|
+
size?: SelectSize;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type SpinnerSize = 'xlarge' | 'large' | 'medium' | 'small';
|
|
3
|
+
type SpinnerColor = 'primary' | 'neutral' | 'white';
|
|
4
|
+
export interface SpinnerProps extends Omit<ComponentPropsWithoutRef<'div'>, 'size' | 'color'> {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
size?: SpinnerSize;
|
|
7
|
+
color?: SpinnerColor;
|
|
8
|
+
}
|
|
9
|
+
export declare const Spinner: import("react").ForwardRefExoticComponent<SpinnerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type QuantityStatus = '보통' | '여유' | '부족';
|
|
3
|
+
export interface QuantityStatusProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
quantity: QuantityStatus;
|
|
5
|
+
}
|
|
6
|
+
export declare const StockQuantityStatus: import("react").ForwardRefExoticComponent<QuantityStatusProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const getColor: (quantity: QuantityStatus) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
type SwitchSize = 'lg' | 'md';
|
|
4
|
+
export interface SwitchProps extends ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
|
|
5
|
+
id?: string;
|
|
6
|
+
size?: SwitchSize;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
label?: string;
|
|
9
|
+
position?: 'left' | 'right';
|
|
10
|
+
}
|
|
11
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toaster, toast } from 'sonner';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export declare const colors: {
|
|
2
|
+
transparent: string;
|
|
3
|
+
white: string;
|
|
4
|
+
whiteAlpha5: string;
|
|
5
|
+
whiteAlpha10: string;
|
|
6
|
+
whiteAlpha20: string;
|
|
7
|
+
whiteAlpha30: string;
|
|
8
|
+
whiteAlpha40: string;
|
|
9
|
+
whiteAlpha50: string;
|
|
10
|
+
whiteAlpha60: string;
|
|
11
|
+
whiteAlpha70: string;
|
|
12
|
+
whiteAlpha80: string;
|
|
13
|
+
whiteAlpha90: string;
|
|
14
|
+
black: string;
|
|
15
|
+
blackAlpha5: string;
|
|
16
|
+
blackAlpha10: string;
|
|
17
|
+
blackAlpha20: string;
|
|
18
|
+
blackAlpha30: string;
|
|
19
|
+
blackAlpha40: string;
|
|
20
|
+
blackAlpha50: string;
|
|
21
|
+
blackAlpha60: string;
|
|
22
|
+
blackAlpha70: string;
|
|
23
|
+
blackAlpha80: string;
|
|
24
|
+
blackAlpha90: string;
|
|
25
|
+
neutral50: string;
|
|
26
|
+
neutral100: string;
|
|
27
|
+
neutral200: string;
|
|
28
|
+
neutral300: string;
|
|
29
|
+
neutral400: string;
|
|
30
|
+
neutral500: string;
|
|
31
|
+
neutral600: string;
|
|
32
|
+
neutral700: string;
|
|
33
|
+
neutral800: string;
|
|
34
|
+
neutral900: string;
|
|
35
|
+
neutral950: string;
|
|
36
|
+
primary50: string;
|
|
37
|
+
primary100: string;
|
|
38
|
+
primary200: string;
|
|
39
|
+
primary300: string;
|
|
40
|
+
primary400: string;
|
|
41
|
+
primary500: string;
|
|
42
|
+
primary600: string;
|
|
43
|
+
primary700: string;
|
|
44
|
+
primary800: string;
|
|
45
|
+
primary900: string;
|
|
46
|
+
primary950: string;
|
|
47
|
+
danger50: string;
|
|
48
|
+
danger100: string;
|
|
49
|
+
danger200: string;
|
|
50
|
+
danger300: string;
|
|
51
|
+
danger400: string;
|
|
52
|
+
danger500: string;
|
|
53
|
+
danger600: string;
|
|
54
|
+
danger700: string;
|
|
55
|
+
danger800: string;
|
|
56
|
+
danger900: string;
|
|
57
|
+
danger950: string;
|
|
58
|
+
warning50: string;
|
|
59
|
+
warning100: string;
|
|
60
|
+
warning200: string;
|
|
61
|
+
warning300: string;
|
|
62
|
+
warning400: string;
|
|
63
|
+
warning500: string;
|
|
64
|
+
warning600: string;
|
|
65
|
+
warning700: string;
|
|
66
|
+
warning800: string;
|
|
67
|
+
warning900: string;
|
|
68
|
+
warning950: string;
|
|
69
|
+
success50: string;
|
|
70
|
+
success100: string;
|
|
71
|
+
success200: string;
|
|
72
|
+
success300: string;
|
|
73
|
+
success400: string;
|
|
74
|
+
success500: string;
|
|
75
|
+
success600: string;
|
|
76
|
+
success700: string;
|
|
77
|
+
success800: string;
|
|
78
|
+
success900: string;
|
|
79
|
+
success950: string;
|
|
80
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const fontSize: {
|
|
2
|
+
readonly 10: 10;
|
|
3
|
+
readonly 11: 11;
|
|
4
|
+
readonly 12: 12;
|
|
5
|
+
readonly 13: 13;
|
|
6
|
+
readonly 14: 14;
|
|
7
|
+
readonly 15: 15;
|
|
8
|
+
readonly 16: 16;
|
|
9
|
+
readonly 18: 18;
|
|
10
|
+
readonly 20: 20;
|
|
11
|
+
readonly 24: 24;
|
|
12
|
+
readonly 28: 28;
|
|
13
|
+
readonly 32: 32;
|
|
14
|
+
readonly 36: 36;
|
|
15
|
+
readonly 44: 44;
|
|
16
|
+
readonly 60: 60;
|
|
17
|
+
};
|
|
18
|
+
export declare const fontWeight: {
|
|
19
|
+
readonly thin: 100;
|
|
20
|
+
readonly extraLight: 200;
|
|
21
|
+
readonly light: 300;
|
|
22
|
+
readonly normal: 400;
|
|
23
|
+
readonly medium: 500;
|
|
24
|
+
readonly semiBold: 600;
|
|
25
|
+
readonly bold: 700;
|
|
26
|
+
readonly extraBold: 800;
|
|
27
|
+
readonly black: 900;
|
|
28
|
+
};
|
|
29
|
+
export declare const lineHeight: {
|
|
30
|
+
readonly none: 1;
|
|
31
|
+
readonly tight: 1.25;
|
|
32
|
+
readonly snug: 1.375;
|
|
33
|
+
readonly normal: 1.5;
|
|
34
|
+
readonly relaxed: 1.625;
|
|
35
|
+
readonly loose: 2;
|
|
36
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { fontSize as fontSizeToken, fontWeight as fontWeightToken, lineHeight as lineHeightToken } from '../token';
|
|
3
|
+
export type FontSize = keyof typeof fontSizeToken;
|
|
4
|
+
export type ResponsiveFontSize = FontSize | [FontSize, FontSize?, FontSize?] | {
|
|
5
|
+
base: FontSize;
|
|
6
|
+
tablet?: FontSize;
|
|
7
|
+
desktop?: FontSize;
|
|
8
|
+
};
|
|
9
|
+
export type FontWeight = keyof typeof fontWeightToken;
|
|
10
|
+
export type LineHeight = keyof typeof lineHeightToken;
|
|
11
|
+
export interface TypographyProps extends ComponentPropsWithoutRef<'p'> {
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
size?: ResponsiveFontSize;
|
|
14
|
+
weight?: FontWeight;
|
|
15
|
+
lineHeight?: LineHeight;
|
|
16
|
+
}
|
|
17
|
+
export declare const Typography: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Typography';
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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"});
|
|
1
|
+
"use strict";var Ht=Object.create;var te=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty;var Bt=(e,t)=>{for(var o in t)te(e,o,{get:t[o],enumerable:!0})},De=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Dt(t))!Mt.call(e,r)&&r!==o&&te(e,r,{get:()=>t[r],enumerable:!(i=Ft(t,r))||i.enumerable});return e};var F=(e,t,o)=>(o=e!=null?Ht(Lt(e)):{},De(t||!e||!e.__esModule?te(o,"default",{value:e,enumerable:!0}):o,e)),At=e=>De(te({},"__esModule",{value:!0}),e);var Uo={};Bt(Uo,{Accordion:()=>Vt,Body:()=>v,Button:()=>Ut,Checkbox:()=>no,Display:()=>lo,Dropdown:()=>uo,FileUpload:()=>vo,Heading:()=>ke,Link:()=>wo,Modal:()=>Ro,OneTimePasswordField:()=>Ho,Pagination:()=>Do,Popover:()=>Bo,Select:()=>No,Spinner:()=>ge,StockQuantityStatus:()=>Eo,Switch:()=>Zo,Tab:()=>qo,Toaster:()=>ue.Toaster,Typography:()=>B,getColor:()=>wt,toast:()=>ue.toast});module.exports=At(Uo);var Le=require("@cocso-ui/react-icons"),k=F(require("@radix-ui/react-accordion"),1),oe=require("clsx"),re=require("react");var _={item:"D",content:"c","slide-down":"g","slide-up":"u",trigger:"s",chevron:"l"};var E=require("react/jsx-runtime"),It=(0,re.forwardRef)(({className:e,...t},o)=>(0,E.jsx)(k.Item,{ref:o,className:(0,oe.clsx)(_.item,e),...t})),Ot=(0,re.forwardRef)(({className:e,children:t,chevron:o=!0,...i},r)=>(0,E.jsxs)(k.Trigger,{ref:r,className:(0,oe.clsx)(_.trigger,e),...i,children:[t,o&&(0,E.jsx)(Le.KeyboardArrowDownIcon,{className:_.chevron})]})),Et=(0,re.forwardRef)(({className:e,...t},o)=>(0,E.jsx)(k.Content,{ref:o,className:(0,oe.clsx)(_.content,e),...t})),Vt=Object.assign(k.Root,{Item:It,Header:k.Header,Trigger:Ot,Content:Et});var Ve=require("react"),Ze=require("ts-pattern");var Ne=require("@radix-ui/react-slot"),Ie=require("clsx"),Oe=require("react");function Me(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var c={transparent:"var(--ds-transparent)",white:"var(--ds-white)",whiteAlpha5:"var(--ds-white-alpha-5)",whiteAlpha10:"var(--ds-white-alpha-10)",whiteAlpha20:"var(--ds-white-alpha-20)",whiteAlpha30:"var(--ds-white-alpha-30)",whiteAlpha40:"var(--ds-white-alpha-40)",whiteAlpha50:"var(--ds-white-alpha-50)",whiteAlpha60:"var(--ds-white-alpha-60)",whiteAlpha70:"var(--ds-white-alpha-70)",whiteAlpha80:"var(--ds-white-alpha-80)",whiteAlpha90:"var(--ds-white-alpha-90)",black:"var(--ds-black)",blackAlpha5:"var(--ds-black-alpha-5)",blackAlpha10:"var(--ds-black-alpha-10)",blackAlpha20:"var(--ds-black-alpha-20)",blackAlpha30:"var(--ds-black-alpha-30)",blackAlpha40:"var(--ds-black-alpha-40)",blackAlpha50:"var(--ds-black-alpha-50)",blackAlpha60:"var(--ds-black-alpha-60)",blackAlpha70:"var(--ds-black-alpha-70)",blackAlpha80:"var(--ds-black-alpha-80)",blackAlpha90:"var(--ds-black-alpha-90)",neutral50:"var(--ds-neutral-50)",neutral100:"var(--ds-neutral-100)",neutral200:"var(--ds-neutral-200)",neutral300:"var(--ds-neutral-300)",neutral400:"var(--ds-neutral-400)",neutral500:"var(--ds-neutral-500)",neutral600:"var(--ds-neutral-600)",neutral700:"var(--ds-neutral-700)",neutral800:"var(--ds-neutral-800)",neutral900:"var(--ds-neutral-900)",neutral950:"var(--ds-neutral-950)",primary50:"var(--ds-primary-50)",primary100:"var(--ds-primary-100)",primary200:"var(--ds-primary-200)",primary300:"var(--ds-primary-300)",primary400:"var(--ds-primary-400)",primary500:"var(--ds-primary-500)",primary600:"var(--ds-primary-600)",primary700:"var(--ds-primary-700)",primary800:"var(--ds-primary-800)",primary900:"var(--ds-primary-900)",primary950:"var(--ds-primary-950)",danger50:"var(--ds-danger-50)",danger100:"var(--ds-danger-100)",danger200:"var(--ds-danger-200)",danger300:"var(--ds-danger-300)",danger400:"var(--ds-danger-400)",danger500:"var(--ds-danger-500)",danger600:"var(--ds-danger-600)",danger700:"var(--ds-danger-700)",danger800:"var(--ds-danger-800)",danger900:"var(--ds-danger-900)",danger950:"var(--ds-danger-950)",warning50:"var(--ds-warning-50)",warning100:"var(--ds-warning-100)",warning200:"var(--ds-warning-200)",warning300:"var(--ds-warning-300)",warning400:"var(--ds-warning-400)",warning500:"var(--ds-warning-500)",warning600:"var(--ds-warning-600)",warning700:"var(--ds-warning-700)",warning800:"var(--ds-warning-800)",warning900:"var(--ds-warning-900)",warning950:"var(--ds-warning-950)",success50:"var(--ds-success-50)",success100:"var(--ds-success-100)",success200:"var(--ds-success-200)",success300:"var(--ds-success-300)",success400:"var(--ds-success-400)",success500:"var(--ds-success-500)",success600:"var(--ds-success-600)",success700:"var(--ds-success-700)",success800:"var(--ds-success-800)",success900:"var(--ds-success-900)",success950:"var(--ds-success-950)"};var ie={10:10,11:11,12:12,13:13,14:14,15:15,16:16,18:18,20:20,24:24,28:28,32:32,36:36,44:44,60:60},ne={thin:100,extraLight:200,light:300,normal:400,medium:500,semiBold:600,bold:700,extraBold:800,black:900},Be={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2};var Ae={typography:"r"};var Ee=require("react/jsx-runtime"),B=(0,Oe.forwardRef)(({asChild:e,className:t,style:o,color:i,size:r=16,weight:n="normal",lineHeight:l="normal",...s},d)=>{let p=e?Ne.Slot:"p",f,m,y;Array.isArray(r)?[f,m,y]=r:typeof r=="object"?{base:f,tablet:m,desktop:y}=r:f=r;let W={...o,"--cocso-typography-font-color":Me(i),"--cocso-typography-font-size":`${ie[f]}px`,...m!==void 0&&{"--cocso-tablet-typography-font-size":`${ie[m]}px`},...y!==void 0&&{"--cocso-desktop-typography-font-size":`${ie[y]}px`},"--cocso-typography-font-weight":ne[n],"--cocso-typography-line-height":Be[l]};return(0,Ee.jsx)(p,{ref:d,className:(0,Ie.clsx)(Ae.typography,t),style:W,...s})});var $e=require("react/jsx-runtime"),v=(0,Ve.forwardRef)(({asChild:e,className:t,style:o,color:i,size:r="md",weight:n,lineHeight:l,...s},d)=>{let p=$t(r);return(0,$e.jsx)(B,{ref:d,color:i,size:p,weight:n,lineHeight:l,asChild:e,...s})}),$t=e=>(0,Ze.match)(e).with("lg",()=>18).with("md",()=>16).with("sm",()=>14).with("xs",()=>12).exhaustive();var je=require("@radix-ui/react-slot"),qe=require("clsx"),Ue=require("react"),C=require("ts-pattern");var Qe=require("@radix-ui/react-slot"),Xe=require("react"),j=require("ts-pattern");var Ye={"donut-spin":"m",spinner:"E"};var _e=require("react/jsx-runtime"),ge=(0,Xe.forwardRef)(({asChild:e,size:t="medium",color:o="primary",className:i,style:r,...n},l)=>{let s=e?Qe.Slot:"div",d={...r,"--cocso-spinner-size":`${Qt(t)}px`,"--cocso-spinner-border-width":`${Xt(t)}px`,"--cocso-spinner-border-color":_t(o),"--cocso-spinner-bg-color":jt(o)};return(0,_e.jsx)(s,{ref:l,className:Ye.spinner,style:d,...n})}),Qt=e=>(0,j.match)(e).with("xlarge",()=>40).with("large",()=>32).with("medium",()=>24).with("small",()=>20).exhaustive(),Xt=e=>(0,j.match)(e).with("xlarge",()=>5).with("large",()=>4).with("medium",()=>3).with("small",()=>3).exhaustive(),_t=e=>(0,j.match)(e).with("primary",()=>c.primary500).with("neutral",()=>c.neutral600).with("white",()=>c.white).exhaustive(),jt=e=>(0,j.match)(e).with("primary",()=>c.primary100).with("neutral",()=>c.neutral100).with("white",()=>c.whiteAlpha20).exhaustive();var A={button:"d",disabled:"h",content:"F",prefix:"G",suffix:"H",svgOnly:"I"};var N=require("react/jsx-runtime"),Ut=(0,Ue.forwardRef)(({asChild:e,className:t,style:o,children:i,size:r="medium",type:n="primary",weight:l="medium",shape:s="square",prefix:d,suffix:p,svgOnly:f=!1,disabled:m=!1,loading:y=!1,...W},O)=>{let H={...o,...Kt(r),"--cocso-button-font-color":Jt(n),"--cocso-button-font-weight":ne[l],"--cocso-button-border":eo(n),"--cocso-button-border-radius":Gt(s,r),"--cocso-button-bg-color":to(n),"--cocso-button-bg-color-hover":oo(n),"--cocso-button-bg-color-active":ro(n)},X=e?je.Slot:"button",J=m||y;return(0,N.jsxs)(X,{ref:O,className:(0,qe.clsx)(A.button,J&&A.disabled,f&&A.svgOnly,t),disabled:J,style:H,...W,children:[y&&(0,N.jsx)(ge,{size:"small",color:"white"}),d&&(0,N.jsx)("span",{className:A.prefix,children:d}),(0,N.jsx)("span",{className:A.content,children:i}),p&&(0,N.jsx)("span",{className:A.suffix,children:p})]})}),Kt=e=>{let t=(0,C.match)(e).with("tiny",()=>24).with("small",()=>32).with("medium",()=>40).with("large",()=>48).exhaustive(),o=(0,C.match)(e).with("tiny",()=>0).with("small",()=>6).with("medium",()=>10).with("large",()=>14).exhaustive(),i=(0,C.match)(e).with("tiny",()=>12).with("large",()=>16).otherwise(()=>14);return{"--cocso-button-height":`${t}px`,"--cocso-button-padding-inline":`${o}px`,"--cocso-button-font-size":`${i}px`}},Gt=(e,t)=>(0,C.match)(e).with("square",()=>(0,C.match)(t).with("tiny",()=>"4px").with("small",()=>"6px").with("medium",()=>"6px").with("large",()=>"8px").exhaustive()).with("circle",()=>"100%").with("rounded",()=>"100px").exhaustive(),Jt=e=>(0,C.match)(e).with("primary","success","error","neutral",()=>c.white).with("secondary","tertiary","warning",()=>c.neutral950).exhaustive(),eo=e=>(0,C.match)(e).with("tertiary",()=>`1px solid ${c.neutral100}`).otherwise(()=>"none"),to=e=>(0,C.match)(e).with("primary",()=>c.primary500).with("secondary",()=>c.white).with("tertiary",()=>c.transparent).with("success",()=>c.success500).with("error",()=>c.danger500).with("warning",()=>c.warning300).with("neutral",()=>c.neutral950).exhaustive(),oo=e=>(0,C.match)(e).with("primary",()=>c.primary600).with("secondary",()=>c.neutral50).with("tertiary",()=>c.neutral50).with("success",()=>c.success600).with("error",()=>c.danger600).with("warning",()=>c.warning400).with("neutral",()=>c.neutral800).exhaustive(),ro=e=>(0,C.match)(e).with("primary",()=>c.primary700).with("secondary",()=>c.neutral100).with("tertiary",()=>c.neutral100).with("success",()=>c.success700).with("error",()=>c.danger700).with("warning",()=>c.warning500).with("neutral",()=>c.neutral700).exhaustive();var ve=require("@cocso-ui/react-icons"),ae=F(require("@radix-ui/react-checkbox"),1),Ke=require("clsx"),se=require("react"),Z=require("ts-pattern");var V={wrapper:"J",checkbox:"e",indicator:"K",label:"v"};var S=require("react/jsx-runtime"),no=(0,se.forwardRef)(({id:e,className:t,style:o,size:i="md",status:r,onChange:n,label:l,disabled:s=!1,...d},p)=>{let f=(0,se.useId)(),m=e??f,y=H=>{if(!s){let X=(0,Z.match)(H).with(!0,()=>"on").with("indeterminate",()=>"intermediate").with(!1,()=>"off").exhaustive();n(X)}},W=()=>(0,Z.match)(r).with("on",()=>!0).with("intermediate",()=>"indeterminate").with("off",()=>!1).exhaustive(),O={...o,"--cocso-checkbox-size":ao(i),"--cocso-checkbox-color":"var(--color-palette-gray-0)","--cocso-checkbox-border-color":so(r),"--cocso-checkbox-bg-color":co(r)};return(0,S.jsxs)("div",{className:(0,Ke.clsx)(V.wrapper,t),style:O,children:[(0,S.jsxs)(ae.Root,{ref:p,id:m,className:V.checkbox,checked:W(),onCheckedChange:y,disabled:s,...d,children:[(0,S.jsx)(ae.Indicator,{className:V.indicator,style:{opacity:r==="on"?1:0},"aria-hidden":"true",children:(0,S.jsx)(ve.CheckIcon,{size:24})}),(0,S.jsx)("div",{className:V.indicator,style:{opacity:r==="intermediate"?1:0},"aria-hidden":"true",children:(0,S.jsx)(ve.CheckIcon,{size:24})})]}),l&&(0,S.jsx)(v,{className:V.label,size:i,"aria-disabled":s,asChild:!0,children:(0,S.jsx)("label",{htmlFor:m,children:l})})]})}),ao=e=>(0,Z.match)(e).with("lg",()=>"var(--number-10)").with("md",()=>"var(--number-9)").with("sm",()=>"var(--number-8)").exhaustive(),so=e=>(0,Z.match)(e).with("on",()=>"var(--color-palette-primary-500)").with("intermediate",()=>"var(--color-palette-primary-500)").with("off",()=>"var(--color-divider-gray-light)").exhaustive(),co=e=>(0,Z.match)(e).with("on",()=>"var(--color-palette-primary-500)").with("intermediate",()=>"var(--color-palette-primary-500)").with("off",()=>"var(--color-palette-gray-0)").exhaustive();var Ge=require("@radix-ui/react-slot"),Je=require("react"),et=require("ts-pattern");var be=require("react/jsx-runtime"),lo=(0,Je.forwardRef)(({asChild:e,className:t,color:o,size:i="md",weight:r,lineHeight:n,...l},s)=>{let d=e?Ge.Slot:"h1",p=po(i);return(0,be.jsx)(B,{ref:s,color:o,size:p,weight:r,lineHeight:n,asChild:!0,children:(0,be.jsx)(d,{...l})})}),po=e=>(0,et.match)(e).with("lg",()=>({base:44,tablet:60})).with("md",()=>({base:32,tablet:44})).with("sm",()=>({base:28,tablet:36})).exhaustive();var R=F(require("@radix-ui/react-dropdown-menu"),1),we=require("clsx"),xe=require("react");var ye={"dropdown-slide-up":"f","dropdown-slide-down":"y",content:"p",item:"L"};var Ce=require("react/jsx-runtime"),ho=(0,xe.forwardRef)(({className:e,...t},o)=>(0,Ce.jsx)(R.Content,{ref:o,className:(0,we.clsx)(ye.content,e),...t})),fo=(0,xe.forwardRef)(({className:e,...t},o)=>(0,Ce.jsx)(R.Item,{ref:o,className:(0,we.clsx)(ye.item,e),...t})),uo=Object.assign(R.Root,{Trigger:R.Trigger,Portal:R.Portal,Content:ho,Item:fo});var ce=require("@cocso-ui/react-icons"),h=require("react");var $={wrapper:"M",uploader:"b",list:"N",item:"O",remove:"P"};var w=require("react/jsx-runtime"),vo=(0,h.forwardRef)(({maxFiles:e=2,files:t,onFilesChange:o,onRemove:i,multiple:r=!0,accept:n,...l},s)=>{let[d,p]=(0,h.useState)(!1),f=(0,h.useRef)(null),m=(0,h.useRef)(null),y=3*1024*1024,W=(0,h.useCallback)(a=>n?n.split(",").map(x=>x.trim()).some(x=>{if(x.endsWith("/*")){let ee=x.slice(0,-2);return a.type.startsWith(ee)}return a.type===x||a.name.toLowerCase().endsWith(x)}):!0,[n]),O=(0,h.useCallback)(a=>a.size>y?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),H=(0,h.useCallback)(a=>{let x=Array.from(a).filter(M=>W(M)?O(M):(alert(`${M.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(x.length===0)return;let ee=e-t.length;if(ee<=0){alert(`\uCD5C\uB300 ${e}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let Wt=x.slice(0,ee).map(M=>({file:M,name:M.name,size:M.size}));o([...t,...Wt])},[t,e,o,W,O]),X=(0,h.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),p(!0)},[]),J=(0,h.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),m.current&&!m.current.contains(a.relatedTarget)&&p(!1)},[]),Pt=(0,h.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),kt=(0,h.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),p(!1);let{files:z}=a.dataTransfer;z&&H(z)},[H]),St=(0,h.useCallback)(a=>{let{files:z}=a.target;z&&H(z)},[H]),Rt=(0,h.useCallback)(a=>{let z=t.filter(x=>x.name!==a);o(z),i?.(a)},[t,o,i]),zt=(0,h.useCallback)(()=>{f.current?.click()},[]),Tt=t.length>=e||!r&&t.length>=1;return(0,w.jsxs)("div",{className:$.wrapper,children:[!Tt&&(0,w.jsxs)("div",{ref:m,className:$.uploader,onDragEnter:X,onDragOver:Pt,onDragLeave:J,onDrop:kt,onClick:zt,"data-drag-active":d,children:[(0,w.jsx)("input",{ref:a=>{f.current=a,typeof s=="function"?s(a):s&&(s.current=a)},type:"file",onChange:St,multiple:r,accept:n,style:{display:"none"},...l}),(0,w.jsxs)(v,{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,w.jsx)("br",{}),"(\uCD5C\uB300 3MB)"]}),(0,w.jsx)(ce.PlusIcon,{size:20})]}),t.length>0&&(0,w.jsx)("div",{className:$.list,children:t.map(a=>(0,w.jsxs)("div",{className:$.item,children:[(0,w.jsx)(v,{size:"xs",children:a.name}),(0,w.jsx)("button",{type:"button",onClick:()=>Rt(a.name),className:$.remove,children:(0,w.jsx)(ce.CloseIcon,{size:16})})]},a.name))})]})});var tt=require("@radix-ui/react-slot"),ot=require("react"),rt=require("ts-pattern");var Pe=require("react/jsx-runtime"),ke=(0,ot.forwardRef)(({asChild:e,className:t,color:o,size:i="md",weight:r="bold",lineHeight:n,...l},s)=>{let d=e?tt.Slot:"h2",p=bo(i);return(0,Pe.jsx)(B,{ref:s,color:o,size:p,weight:r,lineHeight:n,asChild:!0,children:(0,Pe.jsx)(d,{...l})})}),bo=e=>(0,rt.match)(e).with("xl",()=>({base:28,tablet:40})).with("lg",()=>({base:24,tablet:32})).with("md",()=>({base:22,tablet:24})).with("sm",()=>18).with("xs",()=>16).with("2xs",()=>14).exhaustive();var it=require("@radix-ui/react-slot"),nt=require("clsx"),at=require("react");var Se={link:"x",indicator:"Q"};var Re=require("react/jsx-runtime"),wo=(0,at.forwardRef)(({asChild:e,className:t,style:o,size:i,weight:r,lineHeight:n,indicator:l=!0,...s},d)=>(0,Re.jsx)(v,{size:i,weight:r,lineHeight:n,asChild:!0,children:(0,Re.jsx)(e?it.Slot:"a",{ref:d,className:(0,nt.clsx)(Se.link,l&&Se.indicator,t),style:o,...s,children:s.children})}));var st=require("@cocso-ui/react-icons"),g=F(require("@radix-ui/react-dialog"),1),q=require("clsx"),U=require("react");var Y={"overlay-show":"w",overlay:"R","content-show":"k",content:"S",close:"T",title:"U",description:"V"};var P=require("react/jsx-runtime"),Co=(0,U.forwardRef)(({className:e,children:t,...o},i)=>(0,P.jsxs)(g.Portal,{children:[(0,P.jsx)(g.Overlay,{className:Y.overlay}),(0,P.jsx)(g.Content,{ref:i,className:(0,q.clsx)(Y.content,e),...o,children:t})]})),Po=(0,U.forwardRef)(({className:e,children:t,...o},i)=>(0,P.jsx)(g.Close,{ref:i,className:(0,q.clsx)(Y.close,e),...o,children:(0,P.jsx)(st.CloseIcon,{size:24})})),ko=(0,U.forwardRef)(({className:e,children:t,...o},i)=>(0,P.jsx)(g.Title,{ref:i,className:(0,q.clsx)(Y.title,e),asChild:!0,...o,children:(0,P.jsx)(ke,{color:"text.basic",children:t})})),So=(0,U.forwardRef)(({className:e,children:t,...o},i)=>(0,P.jsx)(g.Description,{ref:i,className:(0,q.clsx)(Y.description,e),asChild:!0,...o,children:(0,P.jsx)(v,{size:"sm",color:"text.subtle",children:t})})),Ro=Object.assign(g.Root,{Trigger:g.Trigger,Content:Co,Close:Po,Title:ko,Description:So});var le=F(require("@radix-ui/react-one-time-password-field"),1),Te=require("clsx"),We=require("react");var ze={otp:"W",input:"a"};var He=require("react/jsx-runtime"),To=(0,We.forwardRef)(({className:e,...t},o)=>(0,He.jsx)(le.Root,{ref:o,className:(0,Te.clsx)(ze.otp,e),...t})),Wo=(0,We.forwardRef)(({className:e,...t},o)=>(0,He.jsx)(le.Input,{ref:o,className:(0,Te.clsx)(ze.input,e),...t})),Ho=Object.assign(To,{Input:Wo});var ct=require("clsx"),lt=require("react");var I={pagination:"_",arrow:"o",item:"i",trunc:"oo"};var b=require("react/jsx-runtime"),Do=(0,lt.forwardRef)(({className:e,page:t,totalPages:o,maxVisible:i=5,onChange:r,...n},l)=>{let s=Math.ceil(i/2),d=p=>(0,b.jsx)("button",{type:"button",className:I.item,onClick:()=>r(p),"data-active":t===p,children:p},p);return(0,b.jsxs)("div",{ref:l,className:(0,ct.clsx)(I.pagination,e),...n,children:[o>1&&(0,b.jsx)("button",{className:I.arrow,type:"button",disabled:t===1,onClick:()=>t>1&&r(t-1),children:(0,b.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","aria-hidden":"true",children:(0,b.jsx)("path",{d:"m15 18-6-6 6-6"})})}),o<=i+2?Array(o).fill(0).map((p,f)=>d(f+1)):(0,b.jsxs)(b.Fragment,{children:[d(1),t>1+s&&(0,b.jsx)("span",{className:I.trunc,children:"..."}),Array(i).fill(0).map((p,f)=>{let m=t-s+f+1;return m>1&&m<o?d(m):""}),t<o-s&&(0,b.jsx)("span",{className:I.trunc,children:"..."}),d(o)]}),o>1&&(0,b.jsx)("button",{className:I.arrow,type:"button",disabled:t===o,onClick:()=>t<o&&r(t+1),children:(0,b.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","aria-hidden":"true",children:(0,b.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})});var D=F(require("@radix-ui/react-popover"),1),dt=require("clsx"),mt=require("react");var pt={"slide-up-and-fade":"z","slide-right-and-fade":"j","slide-down-and-fade":"Y","slide-left-and-fade":"X",content:"t"};var ht=require("react/jsx-runtime"),Mo=(0,mt.forwardRef)(({className:e,...t},o)=>(0,ht.jsx)(D.Content,{ref:o,className:(0,dt.clsx)(pt.content,e),...t})),Bo=Object.assign(D.Root,{Trigger:D.Trigger,Portal:D.Portal,Content:Mo});var ft=require("@cocso-ui/react-icons"),ut=require("clsx"),gt=require("react"),vt=require("ts-pattern");var pe={wrapper:"to",select:"q",icon:"Z"};var Q=require("react/jsx-runtime"),No=(0,gt.forwardRef)(({className:e,style:t,size:o="md",disabled:i=!1,children:r,...n},l)=>{let s={...t,...Io(o)};return(0,Q.jsxs)("div",{className:pe.wrapper,children:[(0,Q.jsx)("select",{ref:l,className:(0,ut.clsx)(pe.select,e),style:s,disabled:i,...n,children:r}),(0,Q.jsx)("span",{className:pe.icon,children:(0,Q.jsx)(ft.KeyboardArrowDownIcon,{size:20})})]})}),Io=e=>(0,vt.match)(e).with("2xs",()=>({"--cocso-select-min-width":"var(--number-11)","--cocso-select-height":"var(--number-11)","--cocso-select-padding-left":"var(--number-5)","--cocso-select-padding-right":"calc(var(--number-8) + 16px)","--cocso-select-font-size":"12px","--cocso-select-border-radius":"var(--number-3)"})).with("xs",()=>({"--cocso-select-min-width":"var(--number-12)","--cocso-select-height":"var(--number-12)","--cocso-select-padding-left":"var(--number-6)","--cocso-select-padding-right":"calc(var(--number-7) + 16px)","--cocso-select-font-size":"14px","--cocso-select-border-radius":"var(--number-3)"})).with("sm",()=>({"--cocso-select-min-width":"var(--number-14)","--cocso-select-height":"var(--number-14)","--cocso-select-padding-left":"var(--number-7)","--cocso-select-padding-right":"calc(var(--number-7) + 16px)","--cocso-select-font-size":"14px","--cocso-select-border-radius":"var(--number-3)"})).with("md",()=>({"--cocso-select-min-width":"var(--number-16)","--cocso-select-height":"var(--number-16)","--cocso-select-padding-left":"var(--number-8)","--cocso-select-padding-right":"calc(var(--number-8) + 16px)","--cocso-select-font-size":"16px","--cocso-select-border-radius":"var(--number-4)"})).with("lg",()=>({"--cocso-select-min-width":"var(--number-17)","--cocso-select-height":"var(--number-17)","--cocso-select-padding-left":"var(--number-9)","--cocso-select-padding-right":"calc(var(--number-9) + 16px)","--cocso-select-font-size":"18px","--cocso-select-border-radius":"var(--number-4)"})).with("xl",()=>({"--cocso-select-min-width":"var(--number-18)","--cocso-select-height":"var(--number-18)","--cocso-select-padding-left":"var(--number-10)","--cocso-select-padding-right":"calc(var(--number-10) + 16px)","--cocso-select-font-size":"18px","--cocso-select-border-radius":"var(--number-4)"})).exhaustive();var bt=require("clsx"),yt=require("react");var Fe={stock:"ro",indicator:"A"};var u=require("react/jsx-runtime"),Eo=(0,yt.forwardRef)(({className:e,style:t,onChange:o,quantity:i,...r},n)=>{let l={...t,"--cocso-stock-quantity-status-color":wt(i)};return(0,u.jsxs)("div",{ref:n,className:(0,bt.clsx)(Fe.stock,e),style:l,...r,children:[(0,u.jsx)("span",{className:Fe.indicator,children:i==="\uC5EC\uC720"?(0,u.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,u.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,u.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,u.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"})]}):i==="\uBCF4\uD1B5"?(0,u.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,u.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,u.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,u.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,u.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,u.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,u.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,u.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,u.jsx)(v,{size:"sm",color:"currentColor",children:i})]})}),wt=e=>{switch(e){case"\uC5EC\uC720":return"var(--color-palette-primary-500)";case"\uBCF4\uD1B5":return"var(--color-palette-success-400)";case"\uBD80\uC871":return"var(--color-palette-danger-500)"}};var me=F(require("@radix-ui/react-switch"),1),Ct=require("clsx"),he=require("react"),fe=require("ts-pattern");var de={wrapper:"B",switch:"n",thumb:"C"};var T=require("react/jsx-runtime"),Zo=(0,he.forwardRef)(({id:e,className:t,style:o,children:i,disabled:r=!1,size:n="md",position:l="right",label:s,...d},p)=>{let f=(0,he.useId)(),m=e??f,y={...o,"--cocso-switch-width":$o(n),"--cocso-switch-height":Yo(n),"--cocso-switch-thumb-width":xt(n),"--cocso-switch-thumb-height":xt(n),"--cocso-switch-bg-color":"var(--color-palette-secondary-200)"};return(0,T.jsxs)("div",{className:(0,Ct.clsx)(de.wrapper,t),"aria-disabled":r,style:y,children:[l==="left"&&(0,T.jsx)(v,{size:n,asChild:!0,children:(0,T.jsx)("label",{htmlFor:m,children:s})}),(0,T.jsx)(me.Root,{ref:p,className:de.switch,disabled:r,...d,children:(0,T.jsx)(me.Thumb,{className:de.thumb})}),l==="right"&&(0,T.jsx)(v,{size:n,"aria-disabled":r,asChild:!0,children:(0,T.jsx)("label",{htmlFor:m,children:s})})]})}),$o=e=>(0,fe.match)(e).with("lg",()=>"var(--number-14)").with("md",()=>"var(--number-12)").exhaustive(),Yo=e=>(0,fe.match)(e).with("lg",()=>"var(--number-10)").with("md",()=>"var(--number-9)").exhaustive(),xt=e=>(0,fe.match)(e).with("lg",()=>"var(--number-9)").with("md",()=>"var(--number-8)").exhaustive();var L=F(require("@radix-ui/react-tabs"),1),K=require("react"),G=require("react/jsx-runtime"),Qo=(0,K.forwardRef)(({...e},t)=>(0,G.jsx)(L.Root,{ref:t,...e})),Xo=(0,K.forwardRef)(({...e},t)=>(0,G.jsx)(L.List,{ref:t,...e})),_o=(0,K.forwardRef)(({...e},t)=>(0,G.jsx)(L.Trigger,{ref:t,...e})),jo=(0,K.forwardRef)(({...e},t)=>(0,G.jsx)(L.Content,{ref:t,...e})),qo=Object.assign(Qo,{List:Xo,Trigger:_o,Content:jo});var ue=require("sonner");
|
package/lib/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.D,.c{overflow:hidden}.c[data-state=open]{animation:g .3s cubic-bezier(.87,0,.13,1)}.c[data-state=closed]{animation:u .3s cubic-bezier(.87,0,.13,1)}.s{display:flex;justify-content:space-between;width:100%;cursor:pointer}.l{display:inline-block;width:var(--number-10);height:var(--number-10);transition:transform .2s ease-in-out}.s[data-state=closed]>.l{transform:rotate(0)}.s[data-state=open]>.l{transform:rotate(180deg)}@keyframes u{0%{height:var(--radix-accordion-content-height)}to{height:0}}@keyframes g{0%{height:0}to{height:var(--radix-accordion-content-height)}}.r{color:var(--cocso-typography-font-color);font-size:var(--cocso-typography-font-size);font-weight:var(--cocso-typography-font-weight);line-height:var(--cocso-typography-line-height);--cocso-typography-font-color: inherit;--cocso-typography-font-size: inherit;--cocso-typography-font-weight: inherit;--cocso-typography-line-height: inherit}.r[aria-disabled=true]{cursor:not-allowed;opacity:.5}@media (min-width: 768px){.r{font-size:var(--cocso-tablet-typography-font-size, var(--cocso-typography-font-size))}}@media (min-width: 1024px){.r{font-size:var(--cocso-desktop-typography-font-size, var(--cocso-tablet-typography-font-size, var(--cocso-typography-font-size)))}}@keyframes m{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.E{position:relative;display:inline-block;width:var(--cocso-spinner-size);height:var(--cocso-spinner-size);border:var(--cocso-spinner-border-width) solid var(--cocso-spinner-bg-color);border-top-color:var(--cocso-spinner-border-color);border-radius:50%;animation:m .75s linear infinite;transform-origin:center center;--cocso-spinner-size: inherit;--cocso-spinner-border-width: inherit;--cocso-spinner-border-color: inherit;--cocso-spinner-bg-color: inherit}.d{position:relative;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;opacity:1;transition:background-color .15s ease-in-out;transform:translateZ(0);height:var(--cocso-button-height);padding-inline:var(--cocso-button-padding-inline);color:var(--cocso-button-font-color);font-size:var(--cocso-button-font-size);font-weight:var(--cocso-button-font-weight);border:var(--cocso-button-border);border-radius:var(--cocso-button-border-radius);background-color:var(--cocso-button-bg-color);--cocso-button-height: inherit;--cocso-button-padding-inline: inherit;--cocso-button-font-color: inherit;--cocso-button-font-size: inherit;--cocso-button-font-weight: inherit;--cocso-button-border: inherit;--cocso-button-border-radius: inherit;--cocso-button-bg-color: inherit}.d:not(.h):hover{background-color:var(--cocso-button-bg-color-hover);--cocso-button-bg-color-hover: inherit}.d:not(.h):active{background-color:var(--cocso-button-bg-color-active);--cocso-button-bg-color-active: inherit}.F{padding:0 6px}.G{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:20px;margin-right:2px}.H{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:20px;margin-left:2px}.h{opacity:.4;cursor:not-allowed}.I{aspect-ratio:1/1;padding:0}.J{display:flex;align-items:center;gap:var(--number-5)}.e{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--cocso-checkbox-size);height:var(--cocso-checkbox-size);color:var(--cocso-checkbox-color);cursor:pointer;border:1px solid var(--cocso-checkbox-border-color);border-radius:4px;background-color:var(--cocso-checkbox-bg-color);opacity:1;transition:color .15s ease-in-out,border-color .15s ease-in-out,background-color .15s ease-in-out;--cocso-checkbox-size: inherit;--cocso-checkbox-color: inherit;--cocso-checkbox-border-color: inherit;--cocso-checkbox-bg-color: inherit}.e>svg{display:block;max-width:100%;height:auto;transition:stroke .15s ease-in-out;stroke:var(--cocso-checkbox-color)}.e input[type=checkbox]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.K{position:absolute;top:var(--number-1);right:var(--number-1);bottom:var(--number-1);left:var(--number-1);transition:opacity .15s ease-in-out}.v{opacity:1;cursor:pointer}.e[disabled],.v[aria-disabled=true]{opacity:.5;cursor:not-allowed}@keyframes f{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes y{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}.p{display:flex;flex-direction:column;border-radius:var(--number-3);background-color:var(--color-background-white);box-shadow:var(--shadow-1);will-change:transform,opacity;z-index:var(--z-index-overlay)}.p[data-side=top]{animation:f .4s cubic-bezier(.16,1,.3,1)}.p[data-side=bottom]{animation:y .4s cubic-bezier(.16,1,.3,1)}.L{display:flex;flex-direction:column}.M{display:flex;flex-direction:column;width:100%;margin-inline:auto;gap:var(--number-5)}.b{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--number-8);color:var(--color-palette-gray-600);text-align:center;cursor:pointer;border:var(--number-1) dashed var(--color-palette-gray-200);border-radius:var(--number-2);background-color:var(--color-palette-gray-50);gap:var(--number-5);transition:border-color .15s ease-in-out,background-color .15s ease-in-out}.b[data-drag-active=true]{border-color:var(--color-palette-gray-100);background-color:var(--color-palette-gray-100)}.b>input[type=file]{display:none}.N{display:flex;flex-direction:column;gap:var(--number-5)}.O{display:flex;align-items:center;justify-content:space-between}.P{display:flex;align-items:center;justify-content:center;width:var(--number-9);height:var(--number-9);cursor:pointer}.x{display:inline-flex;align-items:center;justify-content:center;width:fit-content;text-decoration:none;cursor:pointer;gap:var(--number-2);transition:color .15s ease-in-out}.x>svg{width:var(--number-8);height:var(--number-8);flex-shrink:0}.Q{text-decoration:underline}@keyframes w{0%{opacity:0}to{opacity:1}}.R{position:fixed;inset:0;background-color:var(--color-palette-blackalpha-25);animation:w .15s cubic-bezier(.16,1,.3,1);z-index:var(--z-index-overlay)}@keyframes k{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}.S{position:fixed;display:flex;flex-direction:column;top:50%;left:50%;transform:translate(-50%,-50%);width:90vw;max-width:420px;max-height:85vh;padding:var(--number-8);border-radius:8px;background-color:var(--color-palette-gray-0);animation:k .15s cubic-bezier(.16,1,.3,1);z-index:var(--z-index-modal)}.T{display:flex;justify-content:center;align-items:center;width:var(--number-10);height:var(--number-10);cursor:pointer}.U{text-align:center;word-break:keep-all}.V{margin-top:var(--number-5);text-align:center}.W{display:flex;align-items:center;gap:var(--number-5)}.a{flex:1;display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%;color:var(--color-text-basic);font-size:16px;font-weight:var(--font-weight-medium);text-align:center;text-transform:uppercase;line-height:var(--letter-spacing-1);outline:none;border:none;border-radius:var(--number-2);background-color:var(--color-palette-gray-50);box-shadow:0 0 0 var(--number-1, 1px) var(--color-palette-gray-50);transition:background-color .15s ease-in-out,box-shadow .15s ease-in-out}.a:hover{box-shadow:0 0 0 var(--number-1, 1px) var(--color-palette-gray-200)}.a:focus{box-shadow:0 0 0 var(--number-1, 1px) var(--color-palette-gray-200)}.a::selection{background-color:var(--color-palette-gray-400)}._{display:flex;align-items:center;justify-content:center;margin-inline:auto;gap:var(--number-2)}.o,.i{display:inline-flex;align-items:center;justify-content:center;width:var(--number-13);height:var(--number-13);color:var(--cocso-pagination-font-color);font-size:16px;font-weight:var(--cocso-pagination-font-weight);cursor:pointer;border-radius:var(--number-4);background-color:var(--cocso-pagination-bg-color);transition:background-color .15s ease-in-out;--cocso-pagination-font-color: var(--color-text-basic);--cocso-pagination-font-weight: inherit;--cocso-pagination-bg-color: inherit}.o:disabled{opacity:.5;cursor:not-allowed}.o:not([disabled]):hover{--cocso-pagination-bg-color: var(--color-button-tertiary-fill-hover)}.o:not([disabled]):active{--cocso-pagination-bg-color: var(--color-button-tertiary-fill-pressed)}.o>svg{width:var(--number-8);height:var(--number-8);flex-shrink:0}.i[data-active=true]{--cocso-pagination-font-color: var(--color-palette-gray-0);--cocso-pagination-bg-color: var(--color-button-primary-fill);--cocso-pagination-font-weight: var(--font-weight-semi-bold)}.i[data-active=false]:hover{--cocso-pagination-bg-color: var(--color-button-tertiary-fill-hover)}.i[data-active=false]:active{--cocso-pagination-bg-color: var(--color-button-tertiary-fill-pressed)}.oo{display:inline-flex;align-items:center;justify-content:center;width:var(--number-13);height:var(--number-13);color:var(--color-text-basic);font-size:16px}@keyframes z{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes j{0%{opacity:0;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@keyframes Y{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}@keyframes X{0%{opacity:0;transform:translate(2px)}to{opacity:1;transform:translate(0)}}.t{padding-block:var(--number-6);padding-inline:var(--number-8);border:1px solid var(--color-border-gray-light);border-radius:var(--number-4);background-color:var(--color-background-white);animation-duration:.4s;animation-timing-function:cubic-bezier(.16,1,.3,1);will-change:transform,opacity;box-shadow:var(--shadow-3)}.t[data-state=open][data-side=top]{animation-name:Y}.t[data-state=open][data-side=right]{animation-name:X}.t[data-state=open][data-side=bottom]{animation-name:z}.t[data-state=open][data-side=left]{animation-name:j}.to{position:relative;width:fit-content;cursor:pointer}.q{min-width:var(--cocso-select-min-width);height:var(--cocso-select-height);padding-left:var(--cocso-select-padding-left);padding-right:var(--cocso-select-padding-right);color:var(--color-text-basic);font-size:var(--cocso-select-font-size);border:1px solid var(--color-border-gray-light);border-radius:var(--cocso-select-border-radius);background-color:var(--color-background-white);appearance:none;-o-appearance:none;-moz-appearance:none;-webkit-appearance:none;--cocso-select-min-width: inherit;--cocso-select-height: inherit;--cocso-select-padding-left: inherit;--cocso-select-padding-right: inherit;--cocso-select-font-size: inherit;--cocso-select-border-radius: inherit}.q[disabled]{cursor:not-allowed}.Z{position:absolute;top:50%;right:var(--number-5);transform:translateY(-50%);pointer-events:none;color:var(--color-text-disabled)}.Z[disabled]{cursor:not-allowed}.ro{display:inline-flex;align-items:center;gap:var(--number-2);color:var(--cocso-stock-quantity-status-color);--cocso-stock-quantity-status-color: inherit}.A{width:var(--number-9);height:auto;flex-shrink:0}.A>svg{width:100%;height:100%}.B{display:flex;align-items:center;gap:var(--number-5)}.B[aria-disabled=true]{cursor:not-allowed;opacity:.5}.n{position:relative;width:var(--cocso-switch-width);height:var(--cocso-switch-height);cursor:pointer;border-radius:var(--number-max);background-color:var(--cocso-switch-bg-color);opacity:1;--cocso-switch-width: inherit;--cocso-switch-height: inherit;--cocso-switch-bg-color: inherit}.n[disabled],.n[data-disabled=true]{cursor:not-allowed;opacity:.5}.n[data-state=checked]{--cocso-switch-bg-color: var(--color-palette-primary-500)}.C{display:block;width:var(--cocso-switch-thumb-width);height:var(--cocso-switch-thumb-width);border-radius:var(--number-max);background-color:var(--color-background-white);transform:translate(var(--number-2));transition:transform .15s ease;will-change:transform;--cocso-switch-thumb-width: inherit;--cocso-switch-thumb-height: inherit}.C[data-state=checked]{transform:translate(calc(var(--cocso-switch-width) - var(--cocso-switch-thumb-width) - var(--number-2)))}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from './components/
|
|
2
|
-
export * from './components/
|
|
3
|
-
export * from './components/
|
|
4
|
-
export * from './components/
|
|
5
|
-
export * from './components/
|
|
6
|
-
export * from './components/
|
|
7
|
-
export * from './components/
|
|
8
|
-
export * from './components/
|
|
9
|
-
export * from './components/
|
|
10
|
-
export * from './components/
|
|
11
|
-
export * from './components/
|
|
12
|
-
export * from './components/
|
|
13
|
-
export * from './components/
|
|
14
|
-
export * from './components/
|
|
15
|
-
export * from './components/
|
|
16
|
-
export * from './components/
|
|
17
|
-
export * from './components/
|
|
18
|
-
export * from './components/
|
|
19
|
-
export * from './components/
|
|
20
|
-
export * from './components/
|
|
1
|
+
export * from './components/accordion';
|
|
2
|
+
export * from './components/body';
|
|
3
|
+
export * from './components/button';
|
|
4
|
+
export * from './components/checkbox';
|
|
5
|
+
export * from './components/display';
|
|
6
|
+
export * from './components/dropdown';
|
|
7
|
+
export * from './components/file-upload';
|
|
8
|
+
export * from './components/heading';
|
|
9
|
+
export * from './components/link';
|
|
10
|
+
export * from './components/modal';
|
|
11
|
+
export * from './components/one-time-password-field';
|
|
12
|
+
export * from './components/pagination';
|
|
13
|
+
export * from './components/popover';
|
|
14
|
+
export * from './components/select';
|
|
15
|
+
export * from './components/spinner';
|
|
16
|
+
export * from './components/stock-quantity-status';
|
|
17
|
+
export * from './components/switch';
|
|
18
|
+
export * from './components/tab';
|
|
19
|
+
export * from './components/toast';
|
|
20
|
+
export * from './components/typography';
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
import{KeyboardArrowDownIcon as Qe}from"@cocso-ui/react-icons";import*as y from"@radix-ui/react-accordion";import{clsx as se}from"clsx";import{forwardRef as ce}from"react";var Z={item:"D",content:"c","slide-down":"g","slide-up":"u",trigger:"s",chevron:"l"};import{jsx as le,jsxs as qe}from"react/jsx-runtime";var Xe=ce(({className:e,...t},o)=>le(y.Item,{ref:o,className:se(Z.item,e),...t})),_e=ce(({className:e,children:t,chevron:o=!0,...r},i)=>qe(y.Trigger,{ref:i,className:se(Z.trigger,e),...r,children:[t,o&&le(Qe,{className:Z.chevron})]})),je=ce(({className:e,...t},o)=>le(y.Content,{ref:o,className:se(Z.content,e),...t})),Qo=Object.assign(y.Root,{Item:Xe,Header:y.Header,Trigger:_e,Content:je});import{forwardRef as tt}from"react";import{match as ot}from"ts-pattern";import{Slot as Ke}from"@radix-ui/react-slot";import{clsx as Ge}from"clsx";import{forwardRef as Je}from"react";function ge(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var c={transparent:"var(--ds-transparent)",white:"var(--ds-white)",whiteAlpha5:"var(--ds-white-alpha-5)",whiteAlpha10:"var(--ds-white-alpha-10)",whiteAlpha20:"var(--ds-white-alpha-20)",whiteAlpha30:"var(--ds-white-alpha-30)",whiteAlpha40:"var(--ds-white-alpha-40)",whiteAlpha50:"var(--ds-white-alpha-50)",whiteAlpha60:"var(--ds-white-alpha-60)",whiteAlpha70:"var(--ds-white-alpha-70)",whiteAlpha80:"var(--ds-white-alpha-80)",whiteAlpha90:"var(--ds-white-alpha-90)",black:"var(--ds-black)",blackAlpha5:"var(--ds-black-alpha-5)",blackAlpha10:"var(--ds-black-alpha-10)",blackAlpha20:"var(--ds-black-alpha-20)",blackAlpha30:"var(--ds-black-alpha-30)",blackAlpha40:"var(--ds-black-alpha-40)",blackAlpha50:"var(--ds-black-alpha-50)",blackAlpha60:"var(--ds-black-alpha-60)",blackAlpha70:"var(--ds-black-alpha-70)",blackAlpha80:"var(--ds-black-alpha-80)",blackAlpha90:"var(--ds-black-alpha-90)",neutral50:"var(--ds-neutral-50)",neutral100:"var(--ds-neutral-100)",neutral200:"var(--ds-neutral-200)",neutral300:"var(--ds-neutral-300)",neutral400:"var(--ds-neutral-400)",neutral500:"var(--ds-neutral-500)",neutral600:"var(--ds-neutral-600)",neutral700:"var(--ds-neutral-700)",neutral800:"var(--ds-neutral-800)",neutral900:"var(--ds-neutral-900)",neutral950:"var(--ds-neutral-950)",primary50:"var(--ds-primary-50)",primary100:"var(--ds-primary-100)",primary200:"var(--ds-primary-200)",primary300:"var(--ds-primary-300)",primary400:"var(--ds-primary-400)",primary500:"var(--ds-primary-500)",primary600:"var(--ds-primary-600)",primary700:"var(--ds-primary-700)",primary800:"var(--ds-primary-800)",primary900:"var(--ds-primary-900)",primary950:"var(--ds-primary-950)",danger50:"var(--ds-danger-50)",danger100:"var(--ds-danger-100)",danger200:"var(--ds-danger-200)",danger300:"var(--ds-danger-300)",danger400:"var(--ds-danger-400)",danger500:"var(--ds-danger-500)",danger600:"var(--ds-danger-600)",danger700:"var(--ds-danger-700)",danger800:"var(--ds-danger-800)",danger900:"var(--ds-danger-900)",danger950:"var(--ds-danger-950)",warning50:"var(--ds-warning-50)",warning100:"var(--ds-warning-100)",warning200:"var(--ds-warning-200)",warning300:"var(--ds-warning-300)",warning400:"var(--ds-warning-400)",warning500:"var(--ds-warning-500)",warning600:"var(--ds-warning-600)",warning700:"var(--ds-warning-700)",warning800:"var(--ds-warning-800)",warning900:"var(--ds-warning-900)",warning950:"var(--ds-warning-950)",success50:"var(--ds-success-50)",success100:"var(--ds-success-100)",success200:"var(--ds-success-200)",success300:"var(--ds-success-300)",success400:"var(--ds-success-400)",success500:"var(--ds-success-500)",success600:"var(--ds-success-600)",success700:"var(--ds-success-700)",success800:"var(--ds-success-800)",success900:"var(--ds-success-900)",success950:"var(--ds-success-950)"};var X={10:10,11:11,12:12,13:13,14:14,15:15,16:16,18:18,20:20,24:24,28:28,32:32,36:36,44:44,60:60},_={thin:100,extraLight:200,light:300,normal:400,medium:500,semiBold:600,bold:700,extraBold:800,black:900},ve={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2};var be={typography:"r"};import{jsx as et}from"react/jsx-runtime";var B=Je(({asChild:e,className:t,style:o,color:r,size:i=16,weight:n="normal",lineHeight:l="normal",...s},d)=>{let p=e?Ke:"p",h,m,g;Array.isArray(i)?[h,m,g]=i:typeof i=="object"?{base:h,tablet:m,desktop:g}=i:h=i;let S={...o,"--cocso-typography-font-color":ge(r),"--cocso-typography-font-size":`${X[h]}px`,...m!==void 0&&{"--cocso-tablet-typography-font-size":`${X[m]}px`},...g!==void 0&&{"--cocso-desktop-typography-font-size":`${X[g]}px`},"--cocso-typography-font-weight":_[n],"--cocso-typography-line-height":ve[l]};return et(p,{ref:d,className:Ge(be.typography,t),style:S,...s})});import{jsx as it}from"react/jsx-runtime";var u=tt(({asChild:e,className:t,style:o,color:r,size:i="md",weight:n,lineHeight:l,...s},d)=>{let p=rt(i);return it(B,{ref:d,color:r,size:p,weight:n,lineHeight:l,asChild:e,...s})}),rt=e=>ot(e).with("lg",()=>18).with("md",()=>16).with("sm",()=>14).with("xs",()=>12).exhaustive();import{Slot as ft}from"@radix-ui/react-slot";import{clsx as ut}from"clsx";import{forwardRef as gt}from"react";import{match as w}from"ts-pattern";import{Slot as at}from"@radix-ui/react-slot";import{forwardRef as st}from"react";import{match as j}from"ts-pattern";var ye={"donut-spin":"m",spinner:"E"};import{jsx as mt}from"react/jsx-runtime";var we=st(({asChild:e,size:t="medium",color:o="primary",className:r,style:i,...n},l)=>{let s=e?at:"div",d={...i,"--cocso-spinner-size":`${ct(t)}px`,"--cocso-spinner-border-width":`${lt(t)}px`,"--cocso-spinner-border-color":pt(o),"--cocso-spinner-bg-color":dt(o)};return mt(s,{ref:l,className:ye.spinner,style:d,...n})}),ct=e=>j(e).with("xlarge",()=>40).with("large",()=>32).with("medium",()=>24).with("small",()=>20).exhaustive(),lt=e=>j(e).with("xlarge",()=>5).with("large",()=>4).with("medium",()=>3).with("small",()=>3).exhaustive(),pt=e=>j(e).with("primary",()=>c.primary500).with("neutral",()=>c.neutral600).with("white",()=>c.white).exhaustive(),dt=e=>j(e).with("primary",()=>c.primary100).with("neutral",()=>c.neutral100).with("white",()=>c.whiteAlpha20).exhaustive();var F={button:"d",disabled:"h",content:"F",prefix:"G",suffix:"H",svgOnly:"I"};import{jsx as q,jsxs as kt}from"react/jsx-runtime";var Er=gt(({asChild:e,className:t,style:o,children:r,size:i="medium",type:n="primary",weight:l="medium",shape:s="square",prefix:d,suffix:p,svgOnly:h=!1,disabled:m=!1,loading:g=!1,...S},M)=>{let R={...o,...vt(i),"--cocso-button-font-color":yt(n),"--cocso-button-font-weight":_[l],"--cocso-button-border":wt(n),"--cocso-button-border-radius":bt(s,i),"--cocso-button-bg-color":xt(n),"--cocso-button-bg-color-hover":Ct(n),"--cocso-button-bg-color-active":Pt(n)},V=e?ft:"button",Y=m||g;return kt(V,{ref:M,className:ut(F.button,Y&&F.disabled,h&&F.svgOnly,t),disabled:Y,style:R,...S,children:[g&&q(we,{size:"small",color:"white"}),d&&q("span",{className:F.prefix,children:d}),q("span",{className:F.content,children:r}),p&&q("span",{className:F.suffix,children:p})]})}),vt=e=>{let t=w(e).with("tiny",()=>24).with("small",()=>32).with("medium",()=>40).with("large",()=>48).exhaustive(),o=w(e).with("tiny",()=>0).with("small",()=>6).with("medium",()=>10).with("large",()=>14).exhaustive(),r=w(e).with("tiny",()=>12).with("large",()=>16).otherwise(()=>14);return{"--cocso-button-height":`${t}px`,"--cocso-button-padding-inline":`${o}px`,"--cocso-button-font-size":`${r}px`}},bt=(e,t)=>w(e).with("square",()=>w(t).with("tiny",()=>"4px").with("small",()=>"6px").with("medium",()=>"6px").with("large",()=>"8px").exhaustive()).with("circle",()=>"100%").with("rounded",()=>"100px").exhaustive(),yt=e=>w(e).with("primary","success","error","neutral",()=>c.white).with("secondary","tertiary","warning",()=>c.neutral950).exhaustive(),wt=e=>w(e).with("tertiary",()=>`1px solid ${c.neutral100}`).otherwise(()=>"none"),xt=e=>w(e).with("primary",()=>c.primary500).with("secondary",()=>c.white).with("tertiary",()=>c.transparent).with("success",()=>c.success500).with("error",()=>c.danger500).with("warning",()=>c.warning300).with("neutral",()=>c.neutral950).exhaustive(),Ct=e=>w(e).with("primary",()=>c.primary600).with("secondary",()=>c.neutral50).with("tertiary",()=>c.neutral50).with("success",()=>c.success600).with("error",()=>c.danger600).with("warning",()=>c.warning400).with("neutral",()=>c.neutral800).exhaustive(),Pt=e=>w(e).with("primary",()=>c.primary700).with("secondary",()=>c.neutral100).with("tertiary",()=>c.neutral100).with("success",()=>c.success700).with("error",()=>c.danger700).with("warning",()=>c.warning500).with("neutral",()=>c.neutral700).exhaustive();import{CheckIcon as xe}from"@cocso-ui/react-icons";import*as U from"@radix-ui/react-checkbox";import{clsx as Rt}from"clsx";import{forwardRef as zt,useId as Tt}from"react";import{match as $}from"ts-pattern";var A={wrapper:"J",checkbox:"e",indicator:"K",label:"v"};import{jsx as N,jsxs as Ce}from"react/jsx-runtime";var Gr=zt(({id:e,className:t,style:o,size:r="md",status:i,onChange:n,label:l,disabled:s=!1,...d},p)=>{let h=Tt(),m=e??h,g=R=>{if(!s){let V=$(R).with(!0,()=>"on").with("indeterminate",()=>"intermediate").with(!1,()=>"off").exhaustive();n(V)}},S=()=>$(i).with("on",()=>!0).with("intermediate",()=>"indeterminate").with("off",()=>!1).exhaustive(),M={...o,"--cocso-checkbox-size":Wt(r),"--cocso-checkbox-color":"var(--color-palette-gray-0)","--cocso-checkbox-border-color":Ht(i),"--cocso-checkbox-bg-color":Ft(i)};return Ce("div",{className:Rt(A.wrapper,t),style:M,children:[Ce(U.Root,{ref:p,id:m,className:A.checkbox,checked:S(),onCheckedChange:g,disabled:s,...d,children:[N(U.Indicator,{className:A.indicator,style:{opacity:i==="on"?1:0},"aria-hidden":"true",children:N(xe,{size:24})}),N("div",{className:A.indicator,style:{opacity:i==="intermediate"?1:0},"aria-hidden":"true",children:N(xe,{size:24})})]}),l&&N(u,{className:A.label,size:r,"aria-disabled":s,asChild:!0,children:N("label",{htmlFor:m,children:l})})]})}),Wt=e=>$(e).with("lg",()=>"var(--number-10)").with("md",()=>"var(--number-9)").with("sm",()=>"var(--number-8)").exhaustive(),Ht=e=>$(e).with("on",()=>"var(--color-palette-primary-500)").with("intermediate",()=>"var(--color-palette-primary-500)").with("off",()=>"var(--color-divider-gray-light)").exhaustive(),Ft=e=>$(e).with("on",()=>"var(--color-palette-primary-500)").with("intermediate",()=>"var(--color-palette-primary-500)").with("off",()=>"var(--color-palette-gray-0)").exhaustive();import{Slot as Dt}from"@radix-ui/react-slot";import{forwardRef as Lt}from"react";import{match as Mt}from"ts-pattern";import{jsx as Pe}from"react/jsx-runtime";var si=Lt(({asChild:e,className:t,color:o,size:r="md",weight:i,lineHeight:n,...l},s)=>{let d=e?Dt:"h1",p=Bt(r);return Pe(B,{ref:s,color:o,size:p,weight:i,lineHeight:n,asChild:!0,children:Pe(d,{...l})})}),Bt=e=>Mt(e).with("lg",()=>({base:44,tablet:60})).with("md",()=>({base:32,tablet:44})).with("sm",()=>({base:28,tablet:36})).exhaustive();import*as x from"@radix-ui/react-dropdown-menu";import{clsx as ke}from"clsx";import{forwardRef as Se}from"react";var pe={"dropdown-slide-up":"f","dropdown-slide-down":"y",content:"p",item:"L"};import{jsx as Re}from"react/jsx-runtime";var Nt=Se(({className:e,...t},o)=>Re(x.Content,{ref:o,className:ke(pe.content,e),...t})),It=Se(({className:e,...t},o)=>Re(x.Item,{ref:o,className:ke(pe.item,e),...t})),gi=Object.assign(x.Root,{Trigger:x.Trigger,Portal:x.Portal,Content:Nt,Item:It});import{CloseIcon as Et,PlusIcon as Vt}from"@cocso-ui/react-icons";import{forwardRef as Zt,useCallback as C,useRef as ze,useState as $t}from"react";var I={wrapper:"M",uploader:"b",list:"N",item:"O",remove:"P"};import{jsx as D,jsxs as K}from"react/jsx-runtime";var Ri=Zt(({maxFiles:e=2,files:t,onFilesChange:o,onRemove:r,multiple:i=!0,accept:n,...l},s)=>{let[d,p]=$t(!1),h=ze(null),m=ze(null),g=3*1024*1024,S=C(a=>n?n.split(",").map(v=>v.trim()).some(v=>{if(v.endsWith("/*")){let Q=v.slice(0,-2);return a.type.startsWith(Q)}return a.type===v||a.name.toLowerCase().endsWith(v)}):!0,[n]),M=C(a=>a.size>g?(alert(`${a.name}\uC740(\uB294) 3MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.`),!1):!0,[]),R=C(a=>{let v=Array.from(a).filter(H=>S(H)?M(H):(alert(`${H.name}\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD0C0\uC785\uC785\uB2C8\uB2E4.`),!1));if(v.length===0)return;let Q=e-t.length;if(Q<=0){alert(`\uCD5C\uB300 ${e}\uAC1C\uC758 \uD30C\uC77C\uB9CC \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);return}let $e=v.slice(0,Q).map(H=>({file:H,name:H.name,size:H.size}));o([...t,...$e])},[t,e,o,S,M]),V=C(a=>{a.preventDefault(),a.stopPropagation(),p(!0)},[]),Y=C(a=>{a.preventDefault(),a.stopPropagation(),m.current&&!m.current.contains(a.relatedTarget)&&p(!1)},[]),Ne=C(a=>{a.preventDefault(),a.stopPropagation()},[]),Ie=C(a=>{a.preventDefault(),a.stopPropagation(),p(!1);let{files:P}=a.dataTransfer;P&&R(P)},[R]),Oe=C(a=>{let{files:P}=a.target;P&&R(P)},[R]),Ee=C(a=>{let P=t.filter(v=>v.name!==a);o(P),r?.(a)},[t,o,r]),Ve=C(()=>{h.current?.click()},[]),Ze=t.length>=e||!i&&t.length>=1;return K("div",{className:I.wrapper,children:[!Ze&&K("div",{ref:m,className:I.uploader,onDragEnter:V,onDragOver:Ne,onDragLeave:Y,onDrop:Ie,onClick:Ve,"data-drag-active":d,children:[D("input",{ref:a=>{h.current=a,typeof s=="function"?s(a):s&&(s.current=a)},type:"file",onChange:Oe,multiple:i,accept:n,style:{display:"none"},...l}),K(u,{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",D("br",{}),"(\uCD5C\uB300 3MB)"]}),D(Vt,{size:20})]}),t.length>0&&D("div",{className:I.list,children:t.map(a=>K("div",{className:I.item,children:[D(u,{size:"xs",children:a.name}),D("button",{type:"button",onClick:()=>Ee(a.name),className:I.remove,children:D(Et,{size:16})})]},a.name))})]})});import{Slot as Yt}from"@radix-ui/react-slot";import{forwardRef as Qt}from"react";import{match as Xt}from"ts-pattern";import{jsx as Te}from"react/jsx-runtime";var We=Qt(({asChild:e,className:t,color:o,size:r="md",weight:i="bold",lineHeight:n,...l},s)=>{let d=e?Yt:"h2",p=_t(r);return Te(B,{ref:s,color:o,size:p,weight:i,lineHeight:n,asChild:!0,children:Te(d,{...l})})}),_t=e=>Xt(e).with("xl",()=>({base:28,tablet:40})).with("lg",()=>({base:24,tablet:32})).with("md",()=>({base:22,tablet:24})).with("sm",()=>18).with("xs",()=>16).with("2xs",()=>14).exhaustive();import{Slot as qt}from"@radix-ui/react-slot";import{clsx as Ut}from"clsx";import{forwardRef as Kt}from"react";var de={link:"x",indicator:"Q"};import{jsx as He}from"react/jsx-runtime";var Qi=Kt(({asChild:e,className:t,style:o,size:r,weight:i,lineHeight:n,indicator:l=!0,...s},d)=>He(u,{size:r,weight:i,lineHeight:n,asChild:!0,children:He(e?qt:"a",{ref:d,className:Ut(de.link,l&&de.indicator,t),style:o,...s,children:s.children})}));import{CloseIcon as Jt}from"@cocso-ui/react-icons";import*as f from"@radix-ui/react-dialog";import{clsx as G}from"clsx";import{forwardRef as J}from"react";var O={"overlay-show":"w",overlay:"R","content-show":"k",content:"S",close:"T",title:"U",description:"V"};import{jsx as z,jsxs as io}from"react/jsx-runtime";var eo=J(({className:e,children:t,...o},r)=>io(f.Portal,{children:[z(f.Overlay,{className:O.overlay}),z(f.Content,{ref:r,className:G(O.content,e),...o,children:t})]})),to=J(({className:e,children:t,...o},r)=>z(f.Close,{ref:r,className:G(O.close,e),...o,children:z(Jt,{size:24})})),oo=J(({className:e,children:t,...o},r)=>z(f.Title,{ref:r,className:G(O.title,e),asChild:!0,...o,children:z(We,{color:"text.basic",children:t})})),ro=J(({className:e,children:t,...o},r)=>z(f.Description,{ref:r,className:G(O.description,e),asChild:!0,...o,children:z(u,{size:"sm",color:"text.subtle",children:t})})),rn=Object.assign(f.Root,{Trigger:f.Trigger,Content:eo,Close:to,Title:oo,Description:ro});import*as ee from"@radix-ui/react-one-time-password-field";import{clsx as Fe}from"clsx";import{forwardRef as De}from"react";var me={otp:"W",input:"a"};import{jsx as Le}from"react/jsx-runtime";var ao=De(({className:e,...t},o)=>Le(ee.Root,{ref:o,className:Fe(me.otp,e),...t})),so=De(({className:e,...t},o)=>Le(ee.Input,{ref:o,className:Fe(me.input,e),...t})),hn=Object.assign(ao,{Input:so});import{clsx as lo}from"clsx";import{forwardRef as po}from"react";var L={pagination:"_",arrow:"o",item:"i",trunc:"oo"};import{Fragment as mo,jsx as k,jsxs as Me}from"react/jsx-runtime";var Cn=po(({className:e,page:t,totalPages:o,maxVisible:r=5,onChange:i,...n},l)=>{let s=Math.ceil(r/2),d=p=>k("button",{type:"button",className:L.item,onClick:()=>i(p),"data-active":t===p,children:p},p);return Me("div",{ref:l,className:lo(L.pagination,e),...n,children:[o>1&&k("button",{className:L.arrow,type:"button",disabled:t===1,onClick:()=>t>1&&i(t-1),children:k("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","aria-hidden":"true",children:k("path",{d:"m15 18-6-6 6-6"})})}),o<=r+2?Array(o).fill(0).map((p,h)=>d(h+1)):Me(mo,{children:[d(1),t>1+s&&k("span",{className:L.trunc,children:"..."}),Array(r).fill(0).map((p,h)=>{let m=t-s+h+1;return m>1&&m<o?d(m):""}),t<o-s&&k("span",{className:L.trunc,children:"..."}),d(o)]}),o>1&&k("button",{className:L.arrow,type:"button",disabled:t===o,onClick:()=>t<o&&i(t+1),children:k("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","aria-hidden":"true",children:k("path",{d:"m9 18 6-6-6-6"})})})]})});import*as T from"@radix-ui/react-popover";import{clsx as fo}from"clsx";import{forwardRef as uo}from"react";var Be={"slide-up-and-fade":"z","slide-right-and-fade":"j","slide-down-and-fade":"Y","slide-left-and-fade":"X",content:"t"};import{jsx as vo}from"react/jsx-runtime";var go=uo(({className:e,...t},o)=>vo(T.Content,{ref:o,className:fo(Be.content,e),...t})),Fn=Object.assign(T.Root,{Trigger:T.Trigger,Portal:T.Portal,Content:go});import{KeyboardArrowDownIcon as yo}from"@cocso-ui/react-icons";import{clsx as wo}from"clsx";import{forwardRef as xo}from"react";import{match as Co}from"ts-pattern";var te={wrapper:"to",select:"q",icon:"Z"};import{jsx as he,jsxs as ko}from"react/jsx-runtime";var Zn=xo(({className:e,style:t,size:o="md",disabled:r=!1,children:i,...n},l)=>{let s={...t,...Po(o)};return ko("div",{className:te.wrapper,children:[he("select",{ref:l,className:wo(te.select,e),style:s,disabled:r,...n,children:i}),he("span",{className:te.icon,children:he(yo,{size:20})})]})}),Po=e=>Co(e).with("2xs",()=>({"--cocso-select-min-width":"var(--number-11)","--cocso-select-height":"var(--number-11)","--cocso-select-padding-left":"var(--number-5)","--cocso-select-padding-right":"calc(var(--number-8) + 16px)","--cocso-select-font-size":"12px","--cocso-select-border-radius":"var(--number-3)"})).with("xs",()=>({"--cocso-select-min-width":"var(--number-12)","--cocso-select-height":"var(--number-12)","--cocso-select-padding-left":"var(--number-6)","--cocso-select-padding-right":"calc(var(--number-7) + 16px)","--cocso-select-font-size":"14px","--cocso-select-border-radius":"var(--number-3)"})).with("sm",()=>({"--cocso-select-min-width":"var(--number-14)","--cocso-select-height":"var(--number-14)","--cocso-select-padding-left":"var(--number-7)","--cocso-select-padding-right":"calc(var(--number-7) + 16px)","--cocso-select-font-size":"14px","--cocso-select-border-radius":"var(--number-3)"})).with("md",()=>({"--cocso-select-min-width":"var(--number-16)","--cocso-select-height":"var(--number-16)","--cocso-select-padding-left":"var(--number-8)","--cocso-select-padding-right":"calc(var(--number-8) + 16px)","--cocso-select-font-size":"16px","--cocso-select-border-radius":"var(--number-4)"})).with("lg",()=>({"--cocso-select-min-width":"var(--number-17)","--cocso-select-height":"var(--number-17)","--cocso-select-padding-left":"var(--number-9)","--cocso-select-padding-right":"calc(var(--number-9) + 16px)","--cocso-select-font-size":"18px","--cocso-select-border-radius":"var(--number-4)"})).with("xl",()=>({"--cocso-select-min-width":"var(--number-18)","--cocso-select-height":"var(--number-18)","--cocso-select-padding-left":"var(--number-10)","--cocso-select-padding-right":"calc(var(--number-10) + 16px)","--cocso-select-font-size":"18px","--cocso-select-border-radius":"var(--number-4)"})).exhaustive();import{clsx as Ro}from"clsx";import{forwardRef as zo}from"react";var fe={stock:"ro",indicator:"A"};import{jsx as b,jsxs as oe}from"react/jsx-runtime";var Gn=zo(({className:e,style:t,onChange:o,quantity:r,...i},n)=>{let l={...t,"--cocso-stock-quantity-status-color":To(r)};return oe("div",{ref:n,className:Ro(fe.stock,e),style:l,...i,children:[b("span",{className:fe.indicator,children:r==="\uC5EC\uC720"?oe("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b("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"}),b("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"}),b("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"})]}):r==="\uBCF4\uD1B5"?oe("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b("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"}),b("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"}),b("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"})]}):oe("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b("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"}),b("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"}),b("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"})]})}),b(u,{size:"sm",color:"currentColor",children:r})]})}),To=e=>{switch(e){case"\uC5EC\uC720":return"var(--color-palette-primary-500)";case"\uBCF4\uD1B5":return"var(--color-palette-success-400)";case"\uBD80\uC871":return"var(--color-palette-danger-500)"}};import*as ie from"@radix-ui/react-switch";import{clsx as Ho}from"clsx";import{forwardRef as Fo,useId as Do}from"react";import{match as ue}from"ts-pattern";var re={wrapper:"B",switch:"n",thumb:"C"};import{jsx as E,jsxs as Bo}from"react/jsx-runtime";var la=Fo(({id:e,className:t,style:o,children:r,disabled:i=!1,size:n="md",position:l="right",label:s,...d},p)=>{let h=Do(),m=e??h,g={...o,"--cocso-switch-width":Lo(n),"--cocso-switch-height":Mo(n),"--cocso-switch-thumb-width":Ae(n),"--cocso-switch-thumb-height":Ae(n),"--cocso-switch-bg-color":"var(--color-palette-secondary-200)"};return Bo("div",{className:Ho(re.wrapper,t),"aria-disabled":i,style:g,children:[l==="left"&&E(u,{size:n,asChild:!0,children:E("label",{htmlFor:m,children:s})}),E(ie.Root,{ref:p,className:re.switch,disabled:i,...d,children:E(ie.Thumb,{className:re.thumb})}),l==="right"&&E(u,{size:n,"aria-disabled":i,asChild:!0,children:E("label",{htmlFor:m,children:s})})]})}),Lo=e=>ue(e).with("lg",()=>"var(--number-14)").with("md",()=>"var(--number-12)").exhaustive(),Mo=e=>ue(e).with("lg",()=>"var(--number-10)").with("md",()=>"var(--number-9)").exhaustive(),Ae=e=>ue(e).with("lg",()=>"var(--number-9)").with("md",()=>"var(--number-8)").exhaustive();import*as W from"@radix-ui/react-tabs";import{forwardRef as ne}from"react";import{jsx as ae}from"react/jsx-runtime";var Ao=ne(({...e},t)=>ae(W.Root,{ref:t,...e})),No=ne(({...e},t)=>ae(W.List,{ref:t,...e})),Io=ne(({...e},t)=>ae(W.Trigger,{ref:t,...e})),Oo=ne(({...e},t)=>ae(W.Content,{ref:t,...e})),ua=Object.assign(Ao,{List:No,Trigger:Io,Content:Oo});import{Toaster as Ca,toast as Pa}from"sonner";export{Qo as Accordion,u as Body,Er as Button,Gr as Checkbox,si as Display,gi as Dropdown,Ri as FileUpload,We as Heading,Qi as Link,rn as Modal,hn as OneTimePasswordField,Cn as Pagination,Fn as Popover,Zn as Select,we as Spinner,Gn as StockQuantityStatus,la as Switch,ua as Tab,Ca as Toaster,B as Typography,To as getColor,Pa as toast};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './token';
|
package/lib/utils/token.d.ts
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
1
|
export declare function createColor(token: string | undefined): string | undefined;
|
|
2
|
-
declare const FONT_WEIGHT_MAP: {
|
|
3
|
-
readonly thin: "100";
|
|
4
|
-
readonly extralight: "200";
|
|
5
|
-
readonly light: "300";
|
|
6
|
-
readonly normal: "400";
|
|
7
|
-
readonly medium: "500";
|
|
8
|
-
readonly semibold: "600";
|
|
9
|
-
readonly bold: "700";
|
|
10
|
-
readonly extrabold: "800";
|
|
11
|
-
readonly black: "900";
|
|
12
|
-
};
|
|
13
|
-
export type FontWeightToken = keyof typeof FONT_WEIGHT_MAP;
|
|
14
|
-
export declare function createFontWeight(token: string | undefined): string | undefined;
|
|
15
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocso-ui/react",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cocso/cocso-ui.git",
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "rm -rf lib && bun run build.js && bun x tsc",
|
|
11
|
-
"dev": "bun run build.js --watch"
|
|
11
|
+
"dev": "bun run build.js --watch",
|
|
12
|
+
"lint": "biome lint .",
|
|
13
|
+
"lint:fix": "biome lint . --fix"
|
|
12
14
|
},
|
|
13
15
|
"type": "module",
|
|
14
16
|
"main": "./lib/index.cjs",
|
|
@@ -19,32 +21,39 @@
|
|
|
19
21
|
"types": "./lib/index.d.ts",
|
|
20
22
|
"import": "./lib/index.js",
|
|
21
23
|
"require": "./lib/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./styles.css": {
|
|
26
|
+
"import": "./lib/index.css",
|
|
27
|
+
"require": "./lib/index.css"
|
|
22
28
|
}
|
|
23
29
|
},
|
|
24
30
|
"files": [
|
|
25
31
|
"lib"
|
|
26
32
|
],
|
|
27
33
|
"dependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@radix-ui/react-
|
|
30
|
-
"@radix-ui/react-
|
|
31
|
-
"@radix-ui/react-
|
|
32
|
-
"@radix-ui/react-
|
|
33
|
-
"@radix-ui/react-
|
|
34
|
+
"@cocso-ui/react-icons": "^0.0.6",
|
|
35
|
+
"@radix-ui/react-accordion": "^1.2.12",
|
|
36
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
37
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
38
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
39
|
+
"@radix-ui/react-one-time-password-field": "^0.1.8",
|
|
40
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
34
41
|
"@radix-ui/react-slot": "^1.2.3",
|
|
35
|
-
"@radix-ui/react-switch": "^1.2.
|
|
36
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
37
|
-
"
|
|
42
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
43
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
44
|
+
"clsx": "^2.1.1",
|
|
45
|
+
"sonner": "^2.0.7",
|
|
46
|
+
"ts-pattern": "^5.8.0"
|
|
38
47
|
},
|
|
39
48
|
"peerDependencies": {
|
|
40
49
|
"react": "^19.1.1",
|
|
41
50
|
"react-dom": "^19.1.1"
|
|
42
51
|
},
|
|
43
52
|
"devDependencies": {
|
|
44
|
-
"@types/react": "^19.1.
|
|
53
|
+
"@types/react": "^19.1.11",
|
|
45
54
|
"@types/react-dom": "^19.1.7",
|
|
46
|
-
"esbuild": "^0.25.
|
|
47
|
-
"typescript": "^5.
|
|
55
|
+
"esbuild": "^0.25.9",
|
|
56
|
+
"typescript": "^5.9.2"
|
|
48
57
|
},
|
|
49
58
|
"publishConfig": {
|
|
50
59
|
"access": "public"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type FontWeightToken } from '../../utils/token';
|
|
3
|
-
export type BodyProps = {
|
|
4
|
-
asChild?: boolean;
|
|
5
|
-
size?: 'lg' | 'md' | 'sm' | 'xs';
|
|
6
|
-
color?: string;
|
|
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
|
-
displayName: string;
|
|
16
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
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';
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
color?: string;
|
|
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>> & {
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type FontWeightToken } from '../../utils/token';
|
|
3
|
-
export type DisplayProps = {
|
|
4
|
-
asChild?: boolean;
|
|
5
|
-
size?: 'lg' | 'md' | 'sm';
|
|
6
|
-
color?: string;
|
|
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
|
-
displayName: string;
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type FontWeightToken } from '../../utils/token';
|
|
3
|
-
export type HeadingProps = {
|
|
4
|
-
asChild?: boolean;
|
|
5
|
-
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
|
|
6
|
-
color?: string;
|
|
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
|
-
displayName: string;
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Label';
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Toast';
|
package/lib/utils/cn.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const cn: (...classes: (string | undefined | null | false)[]) => string;
|
|
2
|
-
export declare const createClassName: (baseClass: string, variants: Record<string, any>, compoundVariants?: Record<string, any>[], ...additionalClasses: (string | undefined | null | false)[]) => string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/components/{OneTimePasswordField → one-time-password-field}/OneTimePasswordField.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|