maru_design2 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/components/atoms/button/Button.d.ts +26 -5
  2. package/dist/components/atoms/button/index.d.ts +1 -1
  3. package/dist/components/atoms/checkbox/Checkbox.d.ts +22 -0
  4. package/dist/components/atoms/checkbox/index.d.ts +1 -0
  5. package/dist/components/atoms/chip/Chip.d.ts +25 -0
  6. package/dist/components/atoms/chip/index.d.ts +1 -0
  7. package/dist/components/atoms/icon/Icon.d.ts +18 -0
  8. package/dist/components/atoms/icon/iconmap.d.ts +188 -0
  9. package/dist/components/atoms/icon/index.d.ts +1 -0
  10. package/dist/components/atoms/input/Input.d.ts +32 -0
  11. package/dist/components/atoms/input/index.d.ts +1 -0
  12. package/dist/components/atoms/popover/Popover.d.ts +24 -0
  13. package/dist/components/atoms/popover/index.d.ts +1 -0
  14. package/dist/components/atoms/radio/Radio.d.ts +13 -0
  15. package/dist/components/atoms/radio/index.d.ts +1 -0
  16. package/dist/components/atoms/toggle/Toggle.d.ts +21 -0
  17. package/dist/components/atoms/toggle/index.d.ts +1 -0
  18. package/dist/components/atoms/tooltip/Tooltip.d.ts +23 -0
  19. package/dist/components/atoms/tooltip/index.d.ts +1 -0
  20. package/dist/components/molecules/dropdown/Dropdown.d.ts +89 -0
  21. package/dist/components/molecules/dropdown/Menu.d.ts +21 -0
  22. package/dist/components/molecules/dropdown/index.d.ts +1 -0
  23. package/dist/components/molecules/dropdown/toggles/Arrow.d.ts +7 -0
  24. package/dist/components/molecules/dropdown/toggles/Button.d.ts +24 -0
  25. package/dist/components/molecules/dropdown/toggles/Clear.d.ts +8 -0
  26. package/dist/components/molecules/dropdown/toggles/Input.d.ts +24 -0
  27. package/dist/components/molecules/modal/Modal.d.ts +51 -0
  28. package/dist/components/molecules/modal/index.d.ts +1 -0
  29. package/dist/components/molecules/pagination/Pagination.d.ts +27 -0
  30. package/dist/components/molecules/pagination/index.d.ts +1 -0
  31. package/dist/components/styleProvider/StyleProvider.d.ts +10 -0
  32. package/dist/components/styleProvider/index.d.ts +1 -0
  33. package/dist/enums/color.d.ts +13 -0
  34. package/dist/enums/direction.d.ts +2 -0
  35. package/dist/enums/gap.d.ts +2 -0
  36. package/dist/enums/size.d.ts +10 -0
  37. package/dist/enums/type.d.ts +4 -0
  38. package/dist/enums/variant.d.ts +4 -0
  39. package/dist/hooks/useButtonState.d.ts +18 -0
  40. package/dist/hooks/useColor.d.ts +4 -0
  41. package/dist/hooks/useCombineRef.d.ts +1 -1
  42. package/dist/hooks/useCreatePortal.d.ts +1 -1
  43. package/dist/hooks/useId.d.ts +7 -0
  44. package/dist/index.d.ts +13 -1
  45. package/dist/index.js +3281 -8
  46. package/package.json +21 -18
  47. package/scripts/svg-parser.js +224 -0
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { TColor } from '../../../enums/color';
3
+ import { TModalSize } from '../../../enums/size';
4
+ import './modal.scss';
5
+ export interface ModalProps {
6
+ children: React.ReactNode;
7
+ onClose: () => void;
8
+ open: boolean;
9
+ /**
10
+ * 배경 클릭 시 컴포넌트 닫히는지 여부. (@v1 backdropOff)
11
+ */
12
+ backdrop?: boolean;
13
+ /**
14
+ * 모달 취소버튼 설정. { content: string, disabled?: string}
15
+ */
16
+ cancelButton?: {
17
+ content: string;
18
+ disabled?: boolean;
19
+ };
20
+ className?: string;
21
+ /**
22
+ * 엔터키 비활성화 여부. (@v1 disableEnterKeyDown)
23
+ */
24
+ disabledEnter?: boolean;
25
+ /**
26
+ * 모달 닫기 버튼 숨김 여부. (@v1 hasCloseButton)
27
+ */
28
+ hiddenCloseButton?: boolean;
29
+ /**
30
+ * 모달 확인버튼 설정.
31
+ * { content: string,
32
+ * color?: 'primary' | 'secondary' | 'positive' | 'warning' | 'danger',
33
+ * disabled?: boolean, onClick?: () => void }. (@v1 confirmButton)
34
+ */
35
+ okButton?: {
36
+ content: string;
37
+ color?: TColor;
38
+ disabled?: boolean;
39
+ onClick?: () => void;
40
+ };
41
+ /**
42
+ * ['xs', 's', 'm', 'l', 'xl']
43
+ */
44
+ size?: TModalSize;
45
+ /**
46
+ * 모달 제목
47
+ */
48
+ title?: string;
49
+ }
50
+ declare function Modal({ children, onClose, open, backdrop, cancelButton, className, disabledEnter, hiddenCloseButton, okButton, size, title, }: ModalProps): import("react/jsx-runtime").JSX.Element;
51
+ export default Modal;
@@ -0,0 +1 @@
1
+ export * from './Modal';
@@ -0,0 +1,27 @@
1
+ import { TButtonType } from '../../../enums/type';
2
+ import './pagination.scss';
3
+ export interface PaginationProps {
4
+ /**
5
+ * 현재 페이지. (@v1 page.curPage)
6
+ */
7
+ page: number;
8
+ /**
9
+ * 현재 페이지 설정 함수. (@v1 page.setPage)
10
+ */
11
+ onPageChange: (page: number) => void;
12
+ /**
13
+ * 총 페이지
14
+ */
15
+ totalPage: number;
16
+ className?: string;
17
+ /**
18
+ * 페이지네이션의 전후 버튼 숨김 여부. (@v1 buttonVisibility)
19
+ */
20
+ hiddenButton?: boolean;
21
+ /**
22
+ * 데이터 타입. ['button', 'input'] (@v1 isSearch)
23
+ */
24
+ type?: TButtonType;
25
+ }
26
+ declare function Pagination({ page, onPageChange, totalPage, className, hiddenButton, type, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
27
+ export default Pagination;
@@ -0,0 +1 @@
1
+ export * from './Pagination';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { TTheme } from '../../enums/color';
3
+ import './reset.scss';
4
+ import './style-provider.scss';
5
+ interface Props {
6
+ children: React.ReactNode;
7
+ theme: TTheme;
8
+ }
9
+ export declare const StyleProvider: ({ children, theme }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export * from './StyleProvider';
@@ -0,0 +1,13 @@
1
+ export type TTheme = 'blue';
2
+ declare const DColor: {
3
+ readonly primary: "var(--p)";
4
+ readonly secondary: "#8c8c8c";
5
+ readonly positive: "#58c5a6";
6
+ readonly warning: "#ffb020";
7
+ readonly danger: "#e53e3e";
8
+ };
9
+ export declare const COLORS: string[];
10
+ export type TColor = (typeof COLORS)[number];
11
+ export { DColor };
12
+ export declare const TOOLTIP_COLORS: readonly ["default", "danger"];
13
+ export type TTooltipColor = (typeof TOOLTIP_COLORS)[number];
@@ -0,0 +1,2 @@
1
+ export declare const DIRECTIONS: readonly ["top-start", "top", "top-end", "left-start", "left", "left-end", "bottom-start", "bottom", "bottom-end", "right-start", "right", "right-end"];
2
+ export type TDirection = (typeof DIRECTIONS)[number];
@@ -0,0 +1,2 @@
1
+ export declare const GAPS: readonly ["8px", "4px"];
2
+ export type TGap = (typeof GAPS)[number];
@@ -0,0 +1,10 @@
1
+ export declare const BUTTON_SIZES: readonly ["small", "normal", "large"];
2
+ export type TButtonSize = (typeof BUTTON_SIZES)[number];
3
+ export declare const CHECKBOX_SIZES: readonly [16, 18, 24];
4
+ export type TCheckboxSize = (typeof CHECKBOX_SIZES)[number];
5
+ export declare const CHIP_SIZES: readonly ["small", "normal"];
6
+ export type TChipSize = (typeof CHIP_SIZES)[number];
7
+ export declare const ICON_SIZES: readonly [14, 16, 18, 20, 24, 40, 48];
8
+ export type TIconSize = (typeof ICON_SIZES)[number];
9
+ export declare const MODAL_SIZES: readonly ["xs", "s", "m", "l", "xl"];
10
+ export type TModalSize = (typeof MODAL_SIZES)[number];
@@ -0,0 +1,4 @@
1
+ export declare const INPUT_TYPES: readonly ["text", "password", "number"];
2
+ export type TInputType = (typeof INPUT_TYPES)[number];
3
+ export declare const BUTTON_TYPES: readonly ["button", "input"];
4
+ export type TButtonType = (typeof BUTTON_TYPES)[number];
@@ -0,0 +1,4 @@
1
+ export declare const BUTTON_VARIANTS: readonly ["default", "default-light", "outline", "text", "color-on-focus"];
2
+ export type TButtonVariant = (typeof BUTTON_VARIANTS)[number];
3
+ export declare const CHIP_VARIANTS: readonly ["default", "outline", "dot"];
4
+ export type TChipVariant = (typeof CHIP_VARIANTS)[number];
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * 버튼 hover/active/focus 상태를 추적할 때 사용.
4
+ */
5
+ interface IButtonState {
6
+ isHover: boolean;
7
+ isActive: boolean;
8
+ isFocused: boolean;
9
+ }
10
+ declare function useButtonState(): [
11
+ IButtonState,
12
+ {
13
+ setIsHover: React.Dispatch<React.SetStateAction<boolean>>;
14
+ setIsActive: React.Dispatch<React.SetStateAction<boolean>>;
15
+ setIsFocused: React.Dispatch<React.SetStateAction<boolean>>;
16
+ }
17
+ ];
18
+ export default useButtonState;
@@ -0,0 +1,4 @@
1
+ declare const useColor: (color?: string) => {
2
+ keyColor: "var(--p)" | "#8c8c8c" | "#58c5a6" | "#ffb020" | "#e53e3e";
3
+ };
4
+ export default useColor;
@@ -1,4 +1,4 @@
1
- import { Ref } from "react";
1
+ import { Ref } from 'react';
2
2
  /**
3
3
  * 파라미터로 들어온 ref들을 generic type을 가진 ref로 바꾸는 hook
4
4
  * ex. refs(주로 부모 refs)가 HTMLInputElement인 RefObject일 때,
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  interface CreatePortalProps {
3
3
  parent: HTMLElement;
4
4
  children: React.ReactNode;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 최대 32자리의 uuid를 생성합니다.
3
+ * @param length 1 <= lenght <= 32 or undefined
4
+ * @returns uuid
5
+ */
6
+ declare function uuidv4(length?: number): string;
7
+ export default uuidv4;
package/dist/index.d.ts CHANGED
@@ -1 +1,13 @@
1
- export * from "./components/atoms/button";
1
+ export * from './components/styleProvider';
2
+ export * from './components/atoms/button';
3
+ export * from './components/atoms/checkbox';
4
+ export * from './components/atoms/chip';
5
+ export * from './components/atoms/icon';
6
+ export * from './components/atoms/input';
7
+ export * from './components/atoms/popover';
8
+ export * from './components/atoms/radio';
9
+ export * from './components/atoms/toggle';
10
+ export * from './components/atoms/tooltip';
11
+ export * from './components/molecules/dropdown';
12
+ export * from './components/molecules/modal';
13
+ export * from './components/molecules/pagination';