jongsultest 0.1.1 → 0.1.3
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/README.md +67 -0
- package/dist/atoms.d.mts +92 -0
- package/dist/atoms.d.ts +92 -0
- package/dist/atoms.js +363 -0
- package/dist/atoms.js.map +1 -0
- package/dist/atoms.mjs +336 -0
- package/dist/atoms.mjs.map +1 -0
- package/dist/blocks.d.mts +266 -0
- package/dist/blocks.d.ts +266 -0
- package/dist/blocks.js +1155 -0
- package/dist/blocks.js.map +1 -0
- package/dist/blocks.mjs +1132 -0
- package/dist/blocks.mjs.map +1 -0
- package/dist/index.d.mts +8 -353
- package/dist/index.d.ts +8 -353
- package/dist/utils.d.mts +3 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +14 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +12 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +40 -6
- package/src/stories/Button.stories.ts +54 -0
- package/src/stories/Button.tsx +39 -0
- package/src/stories/Configure.mdx +446 -0
- package/src/stories/Header.stories.ts +34 -0
- package/src/stories/Header.tsx +54 -0
- package/src/stories/Page.stories.ts +33 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/utils/index.ts +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Imform Design System
|
|
2
|
+
|
|
3
|
+
Mantine 기반의 공유 UI 컴포넌트 라이브러리입니다.
|
|
4
|
+
|
|
5
|
+
## 프로젝트 구조
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
├── atoms/ # 기본 UI 컴포넌트 (Button, Badge, Input 등)
|
|
10
|
+
├── blocks/ # 복합 UI 컴포넌트 (Modal, DataTable, Panel 등)
|
|
11
|
+
├── utils/ # 유틸리티 함수
|
|
12
|
+
└── index.ts # 엔트리포인트
|
|
13
|
+
playground/ # Next.js 기반 로컬 테스트 앱
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 기술 스택
|
|
17
|
+
|
|
18
|
+
- **React 19** + **TypeScript**
|
|
19
|
+
- **Mantine 8** (Core, Dates, Hooks, Notifications)
|
|
20
|
+
- **tsup** (빌드)
|
|
21
|
+
- **Storybook 10** (컴포넌트 문서)
|
|
22
|
+
- **Vitest** + **Playwright** (테스트)
|
|
23
|
+
|
|
24
|
+
## 시작하기
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# 의존성 설치
|
|
28
|
+
yarn install
|
|
29
|
+
|
|
30
|
+
# 개발 모드 (watch)
|
|
31
|
+
yarn dev
|
|
32
|
+
|
|
33
|
+
# 빌드
|
|
34
|
+
yarn build
|
|
35
|
+
|
|
36
|
+
# Storybook
|
|
37
|
+
yarn storybook
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Playground
|
|
41
|
+
|
|
42
|
+
로컬에서 컴포넌트를 직접 테스트할 수 있는 Next.js 앱입니다.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd playground
|
|
46
|
+
yarn install
|
|
47
|
+
yarn dev # http://localhost:3001
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 패키지 사용법
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 설치
|
|
54
|
+
yarn add jongsultest
|
|
55
|
+
|
|
56
|
+
# peer dependencies 설치
|
|
57
|
+
yarn add @mantine/core @mantine/hooks @mantine/dates @mantine/notifications @tabler/icons-react @hello-pangea/dnd dayjs
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { Button, InputText, Modal } from "jongsultest";
|
|
62
|
+
import "jongsultest/styles.css";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 라이선스
|
|
66
|
+
|
|
67
|
+
MIT
|
package/dist/atoms.d.mts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ButtonProps, TextInputProps, PasswordInputProps, NumberInputProps, ColorInputProps, FileInputProps, FileInput, TextareaProps, RadioProps, RadioGroupProps, SwitchProps as SwitchProps$1, SegmentedControlProps, SelectProps, AutocompleteProps, BadgeProps, ActionIconProps } from '@mantine/core';
|
|
3
|
+
import React, { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';
|
|
4
|
+
import { DatePickerInputProps, DateTimePickerProps } from '@mantine/dates';
|
|
5
|
+
|
|
6
|
+
type Props$1 = ButtonProps & ComponentPropsWithoutRef<"button">;
|
|
7
|
+
declare const Button: ({ style, ...props }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
declare const InputText: (props: TextInputProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
declare const InputPassword: (props: PasswordInputProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare const InputNumber: (props: NumberInputProps) => react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
declare const InputColor: (props: ColorInputProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
type FileInputComponentProps<Multiple extends boolean = false> = Omit<FileInputProps<Multiple>, "translate"> & {
|
|
18
|
+
translate?: string;
|
|
19
|
+
};
|
|
20
|
+
type FileInputComponent = (<Multiple extends boolean = false>(props: FileInputComponentProps<Multiple>) => React.JSX.Element) & {
|
|
21
|
+
extend: typeof FileInput.extend;
|
|
22
|
+
};
|
|
23
|
+
declare const InputFile: FileInputComponent;
|
|
24
|
+
|
|
25
|
+
declare const InputDatePicker: (props: DatePickerInputProps) => react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
declare const InputTextarea: (props: TextareaProps) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
declare const InputRadio: ((props: RadioProps) => react_jsx_runtime.JSX.Element) & {
|
|
30
|
+
Group: (props: RadioGroupProps) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type SwitchProps = SwitchProps$1;
|
|
34
|
+
declare const InputSwitch: ({ checked, style, classNames, ...props }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
interface SwitchInTableProps<T extends string> {
|
|
37
|
+
status: T;
|
|
38
|
+
onStatusChange: (id: number, status: T) => void;
|
|
39
|
+
id: number;
|
|
40
|
+
activeValue?: T;
|
|
41
|
+
inactiveValue?: T;
|
|
42
|
+
activeLabel?: string;
|
|
43
|
+
inactiveLabel?: string;
|
|
44
|
+
}
|
|
45
|
+
declare const InputSwitchInTable: <T extends string>({ status, onStatusChange, id, activeValue, inactiveValue, activeLabel, inactiveLabel, }: SwitchInTableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
declare const InputSegmentedControl: (props: SegmentedControlProps) => react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
declare const ComboboxSelect: (props: SelectProps) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
declare const ComboboxAutocomplete: (props: AutocompleteProps) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
53
|
+
declare const DateTimePicker: (props: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
declare const Badge: ({ className, classNames, isRemoveAble, onRemove, ...props }: BadgeProps & {
|
|
56
|
+
isRemoveAble?: boolean;
|
|
57
|
+
onRemove?: () => void;
|
|
58
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
interface IconSvgProps {
|
|
61
|
+
size?: number;
|
|
62
|
+
/** 프리셋("red", "white", "gray", "disabled") 또는 hex 값 */
|
|
63
|
+
color?: string;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** 원형 배경 + 십자 아이콘 (활성: #666666 / 비활성: #DDDDDD) */
|
|
67
|
+
declare const PlusIcon: ({ size, color, disabled }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
68
|
+
/** 휴지통 아이콘 (기본: "gray" / 삭제: "red" / 흰색: "white") */
|
|
69
|
+
declare const TrashIcon: ({ size, color }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
70
|
+
/** 드래그 핸들 아이콘 (6점 그리드) */
|
|
71
|
+
declare const GripVerticalIcon: ({ size, color }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
72
|
+
/** 하단 화살표 아이콘 */
|
|
73
|
+
declare const ChevronDownIcon: ({ size, color }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
74
|
+
|
|
75
|
+
type Props = ActionIconProps & ComponentPropsWithoutRef<"button"> & {
|
|
76
|
+
icon?: ComponentType<IconSvgProps>;
|
|
77
|
+
iconSize?: number;
|
|
78
|
+
iconColor?: string;
|
|
79
|
+
children?: ReactNode;
|
|
80
|
+
};
|
|
81
|
+
declare const IconButton: ({ icon: Icon, iconSize, iconColor, disabled, children, ...props }: Props) => react_jsx_runtime.JSX.Element;
|
|
82
|
+
|
|
83
|
+
declare const inputClassNames: {
|
|
84
|
+
input: string;
|
|
85
|
+
label: string;
|
|
86
|
+
placeholder: string;
|
|
87
|
+
error: string;
|
|
88
|
+
description: string;
|
|
89
|
+
root: string;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { Badge, Button, ChevronDownIcon, ComboboxAutocomplete, ComboboxSelect, DateTimePicker, GripVerticalIcon, IconButton, type IconSvgProps, InputColor, InputDatePicker, InputFile, InputNumber, InputPassword, InputRadio, InputSegmentedControl, InputSwitch, InputSwitchInTable, InputText, InputTextarea, PlusIcon, TrashIcon, inputClassNames };
|
package/dist/atoms.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ButtonProps, TextInputProps, PasswordInputProps, NumberInputProps, ColorInputProps, FileInputProps, FileInput, TextareaProps, RadioProps, RadioGroupProps, SwitchProps as SwitchProps$1, SegmentedControlProps, SelectProps, AutocompleteProps, BadgeProps, ActionIconProps } from '@mantine/core';
|
|
3
|
+
import React, { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';
|
|
4
|
+
import { DatePickerInputProps, DateTimePickerProps } from '@mantine/dates';
|
|
5
|
+
|
|
6
|
+
type Props$1 = ButtonProps & ComponentPropsWithoutRef<"button">;
|
|
7
|
+
declare const Button: ({ style, ...props }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
declare const InputText: (props: TextInputProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
declare const InputPassword: (props: PasswordInputProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare const InputNumber: (props: NumberInputProps) => react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
declare const InputColor: (props: ColorInputProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
type FileInputComponentProps<Multiple extends boolean = false> = Omit<FileInputProps<Multiple>, "translate"> & {
|
|
18
|
+
translate?: string;
|
|
19
|
+
};
|
|
20
|
+
type FileInputComponent = (<Multiple extends boolean = false>(props: FileInputComponentProps<Multiple>) => React.JSX.Element) & {
|
|
21
|
+
extend: typeof FileInput.extend;
|
|
22
|
+
};
|
|
23
|
+
declare const InputFile: FileInputComponent;
|
|
24
|
+
|
|
25
|
+
declare const InputDatePicker: (props: DatePickerInputProps) => react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
declare const InputTextarea: (props: TextareaProps) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
declare const InputRadio: ((props: RadioProps) => react_jsx_runtime.JSX.Element) & {
|
|
30
|
+
Group: (props: RadioGroupProps) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type SwitchProps = SwitchProps$1;
|
|
34
|
+
declare const InputSwitch: ({ checked, style, classNames, ...props }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
interface SwitchInTableProps<T extends string> {
|
|
37
|
+
status: T;
|
|
38
|
+
onStatusChange: (id: number, status: T) => void;
|
|
39
|
+
id: number;
|
|
40
|
+
activeValue?: T;
|
|
41
|
+
inactiveValue?: T;
|
|
42
|
+
activeLabel?: string;
|
|
43
|
+
inactiveLabel?: string;
|
|
44
|
+
}
|
|
45
|
+
declare const InputSwitchInTable: <T extends string>({ status, onStatusChange, id, activeValue, inactiveValue, activeLabel, inactiveLabel, }: SwitchInTableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
declare const InputSegmentedControl: (props: SegmentedControlProps) => react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
declare const ComboboxSelect: (props: SelectProps) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
declare const ComboboxAutocomplete: (props: AutocompleteProps) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
53
|
+
declare const DateTimePicker: (props: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
declare const Badge: ({ className, classNames, isRemoveAble, onRemove, ...props }: BadgeProps & {
|
|
56
|
+
isRemoveAble?: boolean;
|
|
57
|
+
onRemove?: () => void;
|
|
58
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
interface IconSvgProps {
|
|
61
|
+
size?: number;
|
|
62
|
+
/** 프리셋("red", "white", "gray", "disabled") 또는 hex 값 */
|
|
63
|
+
color?: string;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** 원형 배경 + 십자 아이콘 (활성: #666666 / 비활성: #DDDDDD) */
|
|
67
|
+
declare const PlusIcon: ({ size, color, disabled }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
68
|
+
/** 휴지통 아이콘 (기본: "gray" / 삭제: "red" / 흰색: "white") */
|
|
69
|
+
declare const TrashIcon: ({ size, color }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
70
|
+
/** 드래그 핸들 아이콘 (6점 그리드) */
|
|
71
|
+
declare const GripVerticalIcon: ({ size, color }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
72
|
+
/** 하단 화살표 아이콘 */
|
|
73
|
+
declare const ChevronDownIcon: ({ size, color }: IconSvgProps) => react_jsx_runtime.JSX.Element;
|
|
74
|
+
|
|
75
|
+
type Props = ActionIconProps & ComponentPropsWithoutRef<"button"> & {
|
|
76
|
+
icon?: ComponentType<IconSvgProps>;
|
|
77
|
+
iconSize?: number;
|
|
78
|
+
iconColor?: string;
|
|
79
|
+
children?: ReactNode;
|
|
80
|
+
};
|
|
81
|
+
declare const IconButton: ({ icon: Icon, iconSize, iconColor, disabled, children, ...props }: Props) => react_jsx_runtime.JSX.Element;
|
|
82
|
+
|
|
83
|
+
declare const inputClassNames: {
|
|
84
|
+
input: string;
|
|
85
|
+
label: string;
|
|
86
|
+
placeholder: string;
|
|
87
|
+
error: string;
|
|
88
|
+
description: string;
|
|
89
|
+
root: string;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { Badge, Button, ChevronDownIcon, ComboboxAutocomplete, ComboboxSelect, DateTimePicker, GripVerticalIcon, IconButton, type IconSvgProps, InputColor, InputDatePicker, InputFile, InputNumber, InputPassword, InputRadio, InputSegmentedControl, InputSwitch, InputSwitchInTable, InputText, InputTextarea, PlusIcon, TrashIcon, inputClassNames };
|
package/dist/atoms.js
ADDED
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var core = require('@mantine/core');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var iconsReact = require('@tabler/icons-react');
|
|
7
|
+
var dates = require('@mantine/dates');
|
|
8
|
+
var clsx = require('clsx');
|
|
9
|
+
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
13
|
+
|
|
14
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __defProps = Object.defineProperties;
|
|
16
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
17
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
18
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
19
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
20
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21
|
+
var __spreadValues = (a, b) => {
|
|
22
|
+
for (var prop in b || (b = {}))
|
|
23
|
+
if (__hasOwnProp.call(b, prop))
|
|
24
|
+
__defNormalProp(a, prop, b[prop]);
|
|
25
|
+
if (__getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
27
|
+
if (__propIsEnum.call(b, prop))
|
|
28
|
+
__defNormalProp(a, prop, b[prop]);
|
|
29
|
+
}
|
|
30
|
+
return a;
|
|
31
|
+
};
|
|
32
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
33
|
+
var __objRest = (source, exclude) => {
|
|
34
|
+
var target = {};
|
|
35
|
+
for (var prop in source)
|
|
36
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
37
|
+
target[prop] = source[prop];
|
|
38
|
+
if (source != null && __getOwnPropSymbols)
|
|
39
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
40
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
41
|
+
target[prop] = source[prop];
|
|
42
|
+
}
|
|
43
|
+
return target;
|
|
44
|
+
};
|
|
45
|
+
var COMMON_STYLES = {
|
|
46
|
+
"--button-fz": "14px",
|
|
47
|
+
"--button-radius": "6px"
|
|
48
|
+
};
|
|
49
|
+
var SIZE_STYLES = {
|
|
50
|
+
xs: {
|
|
51
|
+
"--button-height": "24px",
|
|
52
|
+
"--button-padding-x": "6px"
|
|
53
|
+
},
|
|
54
|
+
sm: {
|
|
55
|
+
"--button-height": "38px",
|
|
56
|
+
"--button-padding-x": "16px"
|
|
57
|
+
},
|
|
58
|
+
md: {
|
|
59
|
+
"--button-height": "40px",
|
|
60
|
+
"--button-padding-x": "24px"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var getVariantStyles = (variant, color) => {
|
|
64
|
+
if (variant === "outline" && color === "gray") {
|
|
65
|
+
return { color: "var(--color-body)", borderColor: "var(--color-gray-3)" };
|
|
66
|
+
}
|
|
67
|
+
if (variant === "default") {
|
|
68
|
+
return { backgroundColor: "var(--mantine-color-blue-6)", color: "#FFFFFF", border: "none" };
|
|
69
|
+
}
|
|
70
|
+
if (variant === "light" && !color) {
|
|
71
|
+
return { backgroundColor: "var(--color-button-light)", color: "var(--color-body)", border: "none" };
|
|
72
|
+
}
|
|
73
|
+
return {};
|
|
74
|
+
};
|
|
75
|
+
var Button = (_a) => {
|
|
76
|
+
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
77
|
+
var _a2;
|
|
78
|
+
const sizeVars = (_a2 = SIZE_STYLES[props.size]) != null ? _a2 : SIZE_STYLES.md;
|
|
79
|
+
const variantStyles = getVariantStyles(props.variant, props.color);
|
|
80
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
81
|
+
core.Button,
|
|
82
|
+
__spreadProps(__spreadValues({}, props), {
|
|
83
|
+
classNames: { label: "!font-bold" },
|
|
84
|
+
style: __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, COMMON_STYLES), sizeVars), variantStyles), style)
|
|
85
|
+
})
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// src/atoms/inputClassNames.ts
|
|
90
|
+
var inputClassNames = {
|
|
91
|
+
input: `!rounded-[8px] !border-input
|
|
92
|
+
!text-sm !h-12
|
|
93
|
+
|
|
94
|
+
data-[error=true]:!border-error-line
|
|
95
|
+
data-[error=true]:!border-2
|
|
96
|
+
data-[error=true]:!bg-error-fill
|
|
97
|
+
data-[error=true]:!text-body
|
|
98
|
+
|
|
99
|
+
data-[disabled=true]:!text-body
|
|
100
|
+
data-[disabled=true]:!bg-disabled-input
|
|
101
|
+
data-[disabled=true]:!opacity-100
|
|
102
|
+
data-[disabled=true]:!border-default
|
|
103
|
+
`,
|
|
104
|
+
label: "!text-sm !text-[#999] !font-bold !tracking-tight !mb-2",
|
|
105
|
+
placeholder: "!text-sm !tracking-normal",
|
|
106
|
+
error: "!mt-2 !ml-2",
|
|
107
|
+
description: "!-mt-[.5px] !mb-2",
|
|
108
|
+
root: "!leading-0"
|
|
109
|
+
};
|
|
110
|
+
var InputText = (props) => {
|
|
111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.TextInput, __spreadValues({ classNames: inputClassNames }, props));
|
|
112
|
+
};
|
|
113
|
+
var InputPassword = (props) => {
|
|
114
|
+
const { error } = props;
|
|
115
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
+
core.PasswordInput,
|
|
117
|
+
__spreadValues({
|
|
118
|
+
classNames: inputClassNames,
|
|
119
|
+
error: typeof error === "string" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-start gap-2", children: [
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconAlertCircle, { size: 16, className: "mt-[2px] shrink-0" }),
|
|
121
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
|
|
122
|
+
] }) : error
|
|
123
|
+
}, props)
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
var InputNumber = (props) => {
|
|
127
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
128
|
+
core.NumberInput,
|
|
129
|
+
__spreadValues({
|
|
130
|
+
classNames: __spreadProps(__spreadValues({}, inputClassNames), {
|
|
131
|
+
controls: "!h-8 !border-input",
|
|
132
|
+
control: "!border-input"
|
|
133
|
+
})
|
|
134
|
+
}, props)
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
var InputColor = (props) => {
|
|
138
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.ColorInput, __spreadValues({ classNames: inputClassNames }, props));
|
|
139
|
+
};
|
|
140
|
+
var InputFile = ((props) => {
|
|
141
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.FileInput, __spreadValues({ classNames: inputClassNames }, props));
|
|
142
|
+
});
|
|
143
|
+
var InputDatePicker = (props) => {
|
|
144
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dates.DatePickerInput, __spreadProps(__spreadValues({ classNames: inputClassNames }, props), { valueFormat: "YYYY-MM-DD" }));
|
|
145
|
+
};
|
|
146
|
+
var InputTextarea = (props) => {
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.Textarea, __spreadValues({ classNames: __spreadProps(__spreadValues({}, inputClassNames), { input: `${inputClassNames.input} !py-3` }) }, props));
|
|
148
|
+
};
|
|
149
|
+
var RadioBase = (props) => {
|
|
150
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.Radio, __spreadValues({}, props));
|
|
151
|
+
};
|
|
152
|
+
var RadioGroup = (props) => {
|
|
153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.Radio.Group, __spreadValues({ classNames: { label: inputClassNames.label } }, props));
|
|
154
|
+
};
|
|
155
|
+
var InputRadio = Object.assign(RadioBase, {
|
|
156
|
+
Group: RadioGroup
|
|
157
|
+
});
|
|
158
|
+
var InputSwitch = (_a) => {
|
|
159
|
+
var _b = _a, { checked, style, classNames } = _b, props = __objRest(_b, ["checked", "style", "classNames"]);
|
|
160
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
161
|
+
core.Switch,
|
|
162
|
+
__spreadProps(__spreadValues({
|
|
163
|
+
checked,
|
|
164
|
+
thumbIcon: /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconCheck, { size: 10, color: "white", stroke: 3 })
|
|
165
|
+
}, props), {
|
|
166
|
+
style: __spreadValues(__spreadValues({}, typeof style === "object" && style || {}), !checked && { "--switch-thumb-start": "6px" }),
|
|
167
|
+
classNames: __spreadValues({
|
|
168
|
+
thumb: "!w-[10px] !h-[10px] text-white",
|
|
169
|
+
label: "!text-gray-6 !font-medium"
|
|
170
|
+
}, classNames)
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
var InputSwitchInTable = ({
|
|
175
|
+
status,
|
|
176
|
+
onStatusChange,
|
|
177
|
+
id,
|
|
178
|
+
activeValue = "ACTIVE",
|
|
179
|
+
inactiveValue = "HIDDEN",
|
|
180
|
+
activeLabel = "\uD65C\uC131",
|
|
181
|
+
inactiveLabel = "\uC228\uAE40"
|
|
182
|
+
}) => {
|
|
183
|
+
const isActive = status === activeValue;
|
|
184
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
185
|
+
InputSwitch,
|
|
186
|
+
{
|
|
187
|
+
checked: isActive,
|
|
188
|
+
onChange: () => onStatusChange(id, isActive ? inactiveValue : activeValue),
|
|
189
|
+
size: "sm",
|
|
190
|
+
classNames: { label: "!font-semibold" }
|
|
191
|
+
}
|
|
192
|
+
) });
|
|
193
|
+
};
|
|
194
|
+
var InputSegmentedControl = (props) => {
|
|
195
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
196
|
+
core.SegmentedControl,
|
|
197
|
+
__spreadValues({
|
|
198
|
+
classNames: {
|
|
199
|
+
root: "p-2! rounded-md!",
|
|
200
|
+
// 루트
|
|
201
|
+
control: "",
|
|
202
|
+
// 버튼
|
|
203
|
+
label: "h-10 px-4 text-sm",
|
|
204
|
+
// 텍스트 패딩/타이포
|
|
205
|
+
innerLabel: "leading-9 color-white"
|
|
206
|
+
// 선택 인디케이터 높이도 같이
|
|
207
|
+
}
|
|
208
|
+
}, props)
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
var ComboboxSelect = (props) => {
|
|
212
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.Select, __spreadValues({ classNames: inputClassNames }, props));
|
|
213
|
+
};
|
|
214
|
+
var ComboboxAutocomplete = (props) => {
|
|
215
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.Autocomplete, __spreadValues({ classNames: inputClassNames }, props));
|
|
216
|
+
};
|
|
217
|
+
var DateTimePicker = (props) => {
|
|
218
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dates.DateTimePicker, __spreadValues({ classNames: inputClassNames }, props));
|
|
219
|
+
};
|
|
220
|
+
var REMOVE_ABLE_BADGE_STYLES = {
|
|
221
|
+
light: "gray",
|
|
222
|
+
blue: "gray"
|
|
223
|
+
// blue 임시 작업 blue 인 경우 생기면 컬러 변경 하셔도 됩니다.
|
|
224
|
+
};
|
|
225
|
+
var Badge = (_a) => {
|
|
226
|
+
var _b = _a, {
|
|
227
|
+
className,
|
|
228
|
+
classNames,
|
|
229
|
+
isRemoveAble = false,
|
|
230
|
+
onRemove
|
|
231
|
+
} = _b, props = __objRest(_b, [
|
|
232
|
+
"className",
|
|
233
|
+
"classNames",
|
|
234
|
+
"isRemoveAble",
|
|
235
|
+
"onRemove"
|
|
236
|
+
]);
|
|
237
|
+
var _a2;
|
|
238
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
239
|
+
core.Badge,
|
|
240
|
+
__spreadProps(__spreadValues({}, props), {
|
|
241
|
+
className,
|
|
242
|
+
classNames: __spreadProps(__spreadValues({}, classNames), {
|
|
243
|
+
label: clsx__default.default("!text-xs !font-semibold", classNames == null ? void 0 : classNames.label)
|
|
244
|
+
}),
|
|
245
|
+
rightSection: props.rightSection || (isRemoveAble ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
246
|
+
core.ActionIcon,
|
|
247
|
+
{
|
|
248
|
+
size: "xs",
|
|
249
|
+
variant: "transparent",
|
|
250
|
+
color: REMOVE_ABLE_BADGE_STYLES[(_a2 = props.variant) != null ? _a2 : "blue"],
|
|
251
|
+
onClick: onRemove,
|
|
252
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconX, { size: 12 })
|
|
253
|
+
}
|
|
254
|
+
) : void 0),
|
|
255
|
+
styles: {
|
|
256
|
+
root: {
|
|
257
|
+
"--mantine-color-gray-light-color": "var(--color-body)",
|
|
258
|
+
"--mantine-color-green-light-color": "#166534"
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
})
|
|
262
|
+
);
|
|
263
|
+
};
|
|
264
|
+
var IconButton = (_a) => {
|
|
265
|
+
var _b = _a, { icon: Icon, iconSize, iconColor, disabled, children } = _b, props = __objRest(_b, ["icon", "iconSize", "iconColor", "disabled", "children"]);
|
|
266
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, __spreadProps(__spreadValues({ variant: "subtle", color: "gray", disabled }, props), { children: Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: iconSize, color: iconColor, disabled }) : children }));
|
|
267
|
+
};
|
|
268
|
+
var colorPreset = {
|
|
269
|
+
red: "#FF4242",
|
|
270
|
+
white: "#FFFFFF",
|
|
271
|
+
gray: "#666666",
|
|
272
|
+
disabled: "#DDDDDD"
|
|
273
|
+
};
|
|
274
|
+
var resolveColor = (color) => {
|
|
275
|
+
var _a;
|
|
276
|
+
return (_a = colorPreset[color]) != null ? _a : color;
|
|
277
|
+
};
|
|
278
|
+
var PlusIcon = ({ size = 20, color = "gray", disabled }) => /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: [
|
|
279
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "10", r: "10", fill: disabled ? resolveColor("disabled") : resolveColor(color) }),
|
|
280
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 5.5V14.5M14.5 10L5.5 10", stroke: "white", strokeWidth: "1.2", strokeLinecap: "round" })
|
|
281
|
+
] });
|
|
282
|
+
var TrashIcon = ({ size = 20, color = "gray" }) => {
|
|
283
|
+
const c = resolveColor(color);
|
|
284
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: [
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
+
"path",
|
|
287
|
+
{
|
|
288
|
+
d: "M14 4.5V2C14 1.72386 13.7761 1.5 13.5 1.5H6.5C6.22386 1.5 6 1.72386 6 2V4.5",
|
|
289
|
+
stroke: c,
|
|
290
|
+
strokeWidth: "1.2"
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 4H18", stroke: c, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
294
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
295
|
+
"path",
|
|
296
|
+
{
|
|
297
|
+
d: "M4 7.00028V17C4 17.5523 4.44772 18 5 18H15C15.5523 18 16 17.5523 16 17V7",
|
|
298
|
+
stroke: c,
|
|
299
|
+
strokeWidth: "1.2",
|
|
300
|
+
strokeLinecap: "round"
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 7V13", stroke: c, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
304
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 7V13", stroke: c, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
305
|
+
] });
|
|
306
|
+
};
|
|
307
|
+
var GripVerticalIcon = ({ size = 20, color = "gray" }) => {
|
|
308
|
+
const c = resolveColor(color);
|
|
309
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
310
|
+
"svg",
|
|
311
|
+
{
|
|
312
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
313
|
+
width: size,
|
|
314
|
+
height: size,
|
|
315
|
+
viewBox: "0 0 20 20",
|
|
316
|
+
fill: "none",
|
|
317
|
+
className: "cursor-grab",
|
|
318
|
+
children: [
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "6.5", y: "3.5", width: "1.2", height: "1.2", rx: "0.6", stroke: c }),
|
|
320
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "6.5", y: "9.39844", width: "1.2", height: "1.2", rx: "0.6", stroke: c }),
|
|
321
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "6.5", y: "15.3008", width: "1.2", height: "1.2", rx: "0.6", stroke: c }),
|
|
322
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "12.3008", y: "3.5", width: "1.2", height: "1.2", rx: "0.6", stroke: c }),
|
|
323
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "12.3008", y: "9.39844", width: "1.2", height: "1.2", rx: "0.6", stroke: c }),
|
|
324
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "12.3008", y: "15.3008", width: "1.2", height: "1.2", rx: "0.6", stroke: c })
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
};
|
|
329
|
+
var ChevronDownIcon = ({ size = 20, color = "#191919" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
330
|
+
"path",
|
|
331
|
+
{
|
|
332
|
+
d: "M16 7L10.0007 13L4 7",
|
|
333
|
+
stroke: resolveColor(color),
|
|
334
|
+
strokeWidth: "1.2",
|
|
335
|
+
strokeLinecap: "round",
|
|
336
|
+
strokeLinejoin: "round"
|
|
337
|
+
}
|
|
338
|
+
) });
|
|
339
|
+
|
|
340
|
+
exports.Badge = Badge;
|
|
341
|
+
exports.Button = Button;
|
|
342
|
+
exports.ChevronDownIcon = ChevronDownIcon;
|
|
343
|
+
exports.ComboboxAutocomplete = ComboboxAutocomplete;
|
|
344
|
+
exports.ComboboxSelect = ComboboxSelect;
|
|
345
|
+
exports.DateTimePicker = DateTimePicker;
|
|
346
|
+
exports.GripVerticalIcon = GripVerticalIcon;
|
|
347
|
+
exports.IconButton = IconButton;
|
|
348
|
+
exports.InputColor = InputColor;
|
|
349
|
+
exports.InputDatePicker = InputDatePicker;
|
|
350
|
+
exports.InputFile = InputFile;
|
|
351
|
+
exports.InputNumber = InputNumber;
|
|
352
|
+
exports.InputPassword = InputPassword;
|
|
353
|
+
exports.InputRadio = InputRadio;
|
|
354
|
+
exports.InputSegmentedControl = InputSegmentedControl;
|
|
355
|
+
exports.InputSwitch = InputSwitch;
|
|
356
|
+
exports.InputSwitchInTable = InputSwitchInTable;
|
|
357
|
+
exports.InputText = InputText;
|
|
358
|
+
exports.InputTextarea = InputTextarea;
|
|
359
|
+
exports.PlusIcon = PlusIcon;
|
|
360
|
+
exports.TrashIcon = TrashIcon;
|
|
361
|
+
exports.inputClassNames = inputClassNames;
|
|
362
|
+
//# sourceMappingURL=atoms.js.map
|
|
363
|
+
//# sourceMappingURL=atoms.js.map
|