maru_design2 2.5.2 → 2.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.7.0](https://github.com/42maru-ai/maru-design2/compare/v2.6.0...v2.7.0) (2024-06-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * :sparkles: Toast - ADD details props ([b40843c](https://github.com/42maru-ai/maru-design2/commit/b40843c55c717d5fb7b3459c5ab8eaef19492f3d))
9
+ * :sparkles: Toast - ADD ToastTimer ([84bd953](https://github.com/42maru-ai/maru-design2/commit/84bd953ef265c29a8d02d8ca7c7db4d6506009e8))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * :adhesive_bandage: Toast - ADD details props ([6c3cbdd](https://github.com/42maru-ai/maru-design2/commit/6c3cbdd5cd5ad1db77d9f20a370b0b6b93d7ef57))
15
+ * :adhesive_bandage: Toast - UPDATE details ([be77f71](https://github.com/42maru-ai/maru-design2/commit/be77f71cd0179342f1a610a71ca99fcde83ce0a4))
16
+ * :adhesive_bandage: Toast - UPDATE props ([eb1be6c](https://github.com/42maru-ai/maru-design2/commit/eb1be6c6506127f768e619867305ea67eefa8060))
17
+ * :adhesive_bandage: Toast - UPDATE Reorder variable declarations ([ec08173](https://github.com/42maru-ai/maru-design2/commit/ec0817370ddcc86ce5e7c9f94f19dc0b7ced7d73))
18
+ * :fire: Toast - DELETE toaster ([d352672](https://github.com/42maru-ai/maru-design2/commit/d35267283f6f50611fa5942a4f2518e2885f6721))
19
+ * :fire: Toast - DELETE toaster css ([4a9eade](https://github.com/42maru-ai/maru-design2/commit/4a9eadefe695d55c615a17c9d26f25a97d82518d))
20
+ * :fire: Toast - UPDATE replace svg files to Icon ([f6fc591](https://github.com/42maru-ai/maru-design2/commit/f6fc591cbf82ce5b0fc3c16800885305e70f3130))
21
+ * :recycle: Toast - REFACTOR code review feedback ([1bf68ff](https://github.com/42maru-ai/maru-design2/commit/1bf68ffa6d3cbeee5cbad4653e4d0119fa6b9315))
22
+ * :recycle: Toast - REFACTOR extract Details component from Toast ([ae56649](https://github.com/42maru-ai/maru-design2/commit/ae5664997b5db7a52861717af4f6b4e72eaf4b48))
23
+ * :recycle: Toast - REFACTOR ToastTimer and ToastContext ([082f05f](https://github.com/42maru-ai/maru-design2/commit/082f05f40ceab170136020f9da1a3f1347a2084f))
24
+
25
+ ## [2.6.0](https://github.com/42maru-ai/maru-design2/compare/v2.5.2...v2.6.0) (2024-05-28)
26
+
27
+
28
+ ### Features
29
+
30
+ * :bento: ADD assets ([5d71dc6](https://github.com/42maru-ai/maru-design2/commit/5d71dc6dc5c6e7f1fff9e232a3801466ce94fb8c))
31
+ * :label: ADD variant type for toast ([3ee947b](https://github.com/42maru-ai/maru-design2/commit/3ee947b8b106d9f250ab876fefb150778273a909))
32
+ * :sparkles: ADD toast ([fd72b15](https://github.com/42maru-ai/maru-design2/commit/fd72b15ae376c3990f090474e77af90f64d823ff))
33
+ * ADD Calendar ([e119e76](https://github.com/42maru-ai/maru-design2/commit/e119e762ea81f01c868b7b296c33c30394ef6d9c))
34
+ * ADD error,success,warning icons, UPDATE parser ([de0facb](https://github.com/42maru-ai/maru-design2/commit/de0facb55886cee9b22eb863e2f2a5aeb5266920))
35
+ * ADD Input option - hiddenClearButton ([3828d12](https://github.com/42maru-ai/maru-design2/commit/3828d129839fc853e3e340ab612c447df3c6bccc))
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * :adhesive_bandage: ADD id props ([d6e6186](https://github.com/42maru-ai/maru-design2/commit/d6e61869d3441335fcd5d71efcbcf2f1837aab44))
41
+ * :pencil2: FIX typo ([7c4895d](https://github.com/42maru-ai/maru-design2/commit/7c4895d972f0e47977faa5b20da4077141456869))
42
+ * calendar day-name parse error ([45f2190](https://github.com/42maru-ai/maru-design2/commit/45f219070f4b70e43c4093531e534117910be7a9))
43
+ * icon documents ([1254267](https://github.com/42maru-ai/maru-design2/commit/1254267f54ed1cc68dde3da01c53758ef120478e))
44
+ * UPDATE calendar footer input hidden clear btn ([cef27ec](https://github.com/42maru-ai/maru-design2/commit/cef27ecff581f3274f4633991d691c3ddf799e8e))
45
+
3
46
  ## [2.5.2](https://github.com/42maru-ai/maru-design2/compare/v2.5.1...v2.5.2) (2024-05-20)
4
47
 
5
48
 
@@ -20,6 +20,15 @@ export declare const iconmap: {
20
20
  r: string;
21
21
  fill: string;
22
22
  }[];
23
+ rects: {
24
+ x: string;
25
+ y: string;
26
+ width: string;
27
+ height: string;
28
+ rx: string;
29
+ transform: string;
30
+ fill: string;
31
+ }[];
23
32
  };
24
33
  };
25
34
  export declare const ICONS: {
@@ -84,6 +93,7 @@ export declare const ICONS: {
84
93
  readonly Download01Thin: "Download01Thin";
85
94
  readonly Downstream: "Downstream";
86
95
  readonly Edit03Thin: "Edit03Thin";
96
+ readonly Error: "Error";
87
97
  readonly ExpandThin: "ExpandThin";
88
98
  readonly FiEyeOffThin: "FiEyeOffThin";
89
99
  readonly FiEyeThin: "FiEyeThin";
@@ -151,6 +161,7 @@ export declare const ICONS: {
151
161
  readonly StopCircle: "StopCircle";
152
162
  readonly SubtractLineThin: "SubtractLineThin";
153
163
  readonly SuccessThin: "SuccessThin";
164
+ readonly Success: "Success";
154
165
  readonly SwitchHorizontal02Thin: "SwitchHorizontal02Thin";
155
166
  readonly TransformThin: "TransformThin";
156
167
  readonly Trash01Thin: "Trash01Thin";
@@ -162,6 +173,7 @@ export declare const ICONS: {
162
173
  readonly UserPlusThin: "UserPlusThin";
163
174
  readonly Users01Thin: "Users01Thin";
164
175
  readonly Users01: "Users01";
176
+ readonly Warning: "Warning";
165
177
  readonly XCircleThin: "XCircleThin";
166
178
  readonly XCircle: "XCircle";
167
179
  readonly XLarge: "XLarge";
@@ -15,6 +15,10 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
15
15
  * 초기화 함수 (@v1 hasClearBtn, onClear)
16
16
  */
17
17
  onClear?: () => void;
18
+ /**
19
+ * 초기화 버튼 숨기기
20
+ */
21
+ hiddenClearButton?: boolean;
18
22
  /**
19
23
  * input을 감싸고 있는 div의 ref, input은 일반 ref 사용
20
24
  */
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './calendar.scss';
3
+ export interface CalendarProps {
4
+ /**
5
+ * Maru Datepicker를 띄울 대상이 되는 컴포넌트. setOpen을 변수로 전달해서 외부에서 datepicker를 띄울 수 있도록 설정
6
+ * @param setOpen 토글형태로 동작. children의 onClick 메서드에서 실행 필요
7
+ */
8
+ children: ({ setOpen }: {
9
+ setOpen: () => void;
10
+ }) => React.ReactNode;
11
+ saveButtonContent: string;
12
+ /**
13
+ * 캘린더 하단 버튼을 누르면 동작할 함수, 선택한 startDate와 endDate를 전달
14
+ * @param startDate 시작일
15
+ * @param endDate 마지막일
16
+ */
17
+ onSaveClick: (startDate?: string, endDate?: string) => void;
18
+ className?: string;
19
+ }
20
+ export declare function Calendar({ children, saveButtonContent, onSaveClick, className, }: CalendarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ReactDatePickerCustomHeaderProps } from 'react-datepicker';
2
+ declare function DatePickerHeader({ date, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, }: ReactDatePickerCustomHeaderProps): import("react/jsx-runtime").JSX.Element;
3
+ export default DatePickerHeader;
@@ -0,0 +1,8 @@
1
+ import 'react-datepicker/dist/react-datepicker.css';
2
+ interface Props {
3
+ saveButtonContent?: string;
4
+ onSaveClick: (startDate?: string, endDate?: string) => void;
5
+ setOpen: (open: boolean) => void;
6
+ }
7
+ declare function DatePickerWrapper({ saveButtonContent, onSaveClick, setOpen }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export default DatePickerWrapper;
@@ -0,0 +1 @@
1
+ export * from './Calendar';
@@ -0,0 +1,7 @@
1
+ interface DetailsProps {
2
+ details: string[] | undefined;
3
+ isDetailsOpen: boolean;
4
+ handleToggleDetails: () => void;
5
+ }
6
+ export default function Details({ details, isDetailsOpen, handleToggleDetails, }: DetailsProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ import { TToastVariant } from '../../../enums/variant';
2
+ export interface IToast {
3
+ id: string;
4
+ variant: TToastVariant;
5
+ content: string;
6
+ details?: string[];
7
+ disableAutoOff?: boolean;
8
+ }
9
+ export interface ToastProps {
10
+ id: string;
11
+ toast: IToast;
12
+ drop: (id: string) => void;
13
+ className?: string;
14
+ }
15
+ export declare function Toast({ id, toast, drop, className }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,15 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { IToast } from './Toast';
3
+ interface ToastContextProps {
4
+ toasts: {
5
+ [id: string]: IToast;
6
+ };
7
+ pop: (toast: Omit<IToast, 'id'>) => void;
8
+ drop: (id: string) => void;
9
+ }
10
+ declare const ToastContext: React.Context<ToastContextProps | undefined>;
11
+ declare function ToastProvider({ children }: {
12
+ children: ReactNode;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ export declare const useToast: () => ToastContextProps;
15
+ export { ToastContext, ToastProvider };
@@ -0,0 +1,18 @@
1
+ import { TToastVariant } from '../../../enums/variant';
2
+ import './toast.scss';
3
+ export interface ToastStyleProps {
4
+ /**
5
+ * ['success', 'warning', 'danger'].
6
+ */
7
+ variant: TToastVariant;
8
+ /**
9
+ * 컴포넌트에 들어갈 내용
10
+ */
11
+ content: string;
12
+ /**
13
+ * details, summary 태그를 활용하여 노출할 내용
14
+ */
15
+ details?: string[];
16
+ onClose: () => void;
17
+ }
18
+ export declare function ToastStyle({ variant, content, details, onClose, }: ToastStyleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Toast';
@@ -4,3 +4,5 @@ export declare const CHIP_VARIANTS: readonly ["default", "outline", "dot"];
4
4
  export type TChipVariant = (typeof CHIP_VARIANTS)[number];
5
5
  export declare const TOOLTIP_VARIANTS: readonly ["default", "error"];
6
6
  export type TTooltipVariant = (typeof TOOLTIP_VARIANTS)[number];
7
+ export declare const TOAST_VARIANTS: readonly ["success", "warning", "danger"];
8
+ export type TToastVariant = (typeof TOAST_VARIANTS)[number];
package/dist/index.d.ts CHANGED
@@ -8,7 +8,9 @@ export * from './components/atoms/popover';
8
8
  export * from './components/atoms/radio';
9
9
  export * from './components/atoms/toggle';
10
10
  export * from './components/atoms/tooltip';
11
+ export * from './components/molecules/calendar';
11
12
  export * from './components/molecules/dropdown';
12
13
  export * from './components/molecules/modal';
13
14
  export * from './components/molecules/pagination';
14
15
  export * from './components/molecules/table';
16
+ export * from './components/molecules/toast';