@croquiscom/pds 0.40.2 → 0.41.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 +38 -0
- package/dist/components/input/Input.stories.d.ts +2 -0
- package/dist/components/input/InputBase.d.ts +3 -0
- package/dist/components/input/NumericInput.d.ts +1 -1
- package/dist/components/modal/AlertModal.d.ts +1 -1
- package/dist/components/modal/AlertModal.stories.d.ts +1 -2
- package/dist/components/modal/ConfirmModal.d.ts +3 -3
- package/dist/components/modal/ConfirmModal.stories.d.ts +1 -2
- package/dist/components/modal/Modal.d.ts +10 -5
- package/dist/components/modal/Modal.stories.d.ts +7 -2
- package/dist/components/modal/ModalOverlay.d.ts +15 -5
- package/dist/components/modal/NoticeModal.d.ts +1 -1
- package/dist/components/textarea/Textarea.d.ts +0 -1
- package/dist/index.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/modal/renderModal.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @croquiscom/pds
|
|
2
2
|
|
|
3
|
+
## 0.41.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a20ad2b: Modal Event 변경 및 중첩 사용시 유니크 ID 처리 추가
|
|
8
|
+
|
|
9
|
+
## BreakPoint
|
|
10
|
+
|
|
11
|
+
Basic Modal Event 방식이 다음과 같이 변경되었습니다.
|
|
12
|
+
|
|
13
|
+
- onConfirm, onCancel 이벤트 발생시 동시에 전달하던 onClose 이벤트가 제거되었습니다.
|
|
14
|
+
- onClose 이벤트는 별도 외부 제어 이벤트가 없이 모달 자체의 close 트리거 발생할 경우 전달합니다.
|
|
15
|
+
- 외부 제어 이벤트(onCancel)없이 esc키 또는 오버레이 클릭등으로 닫힌 경우(canCloseEscapeKey => true, canClickOutside => true)
|
|
16
|
+
- onConfirm
|
|
17
|
+
- confirm 버튼 클릭시
|
|
18
|
+
- onCancel
|
|
19
|
+
- cancel 버튼 클릭시
|
|
20
|
+
- closeButton(x) 버튼 클릭시
|
|
21
|
+
- overlay 클릭시
|
|
22
|
+
- esc keyboard 이벤트 발생시
|
|
23
|
+
- onExit
|
|
24
|
+
- Modal destroy시
|
|
25
|
+
|
|
26
|
+
canCloseEscapeKey props 추가되었습니다.
|
|
27
|
+
|
|
28
|
+
- escapeKey 모달 닫힘 사용 여부로 현재 모달에 focus된 경우 동작합니다.
|
|
29
|
+
- onCancel 이벤트 제어가 있는 경우 내부 상태 제어를 하지 않습니다.
|
|
30
|
+
|
|
31
|
+
canClickOutside props default가 true로 변경되었습니다.
|
|
32
|
+
|
|
33
|
+
- onCancel 이벤트 제어가 있는 경우 내부 상태 제어를 하지 않습니다.
|
|
34
|
+
|
|
35
|
+
## 0.40.3
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 13c0716: TextArea count 스타일 변경, Input maxLength count 노출 추가
|
|
40
|
+
|
|
3
41
|
## 0.40.2
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -8,10 +8,12 @@ export declare const Success: any;
|
|
|
8
8
|
export declare const Disabled: any;
|
|
9
9
|
export declare const EnteredDisabled: any;
|
|
10
10
|
export declare const RightAlignment: any;
|
|
11
|
+
export declare const MaxLength: any;
|
|
11
12
|
export declare const Addon: any;
|
|
12
13
|
export declare const Width: any;
|
|
13
14
|
export declare const AddonWithWidth: any;
|
|
14
15
|
export declare const AddonWithFormHelperText: () => JSX.Element[];
|
|
16
|
+
export declare const MaxLengthWithCombined: () => JSX.Element;
|
|
15
17
|
export declare const Password: () => JSX.Element;
|
|
16
18
|
export declare const Search: any;
|
|
17
19
|
export declare const WithButton: () => JSX.Element;
|
|
@@ -16,6 +16,9 @@ export interface InputBaseType {
|
|
|
16
16
|
/** @desc suffix */
|
|
17
17
|
rightAddon?: InputAffixProps['suffix'];
|
|
18
18
|
width?: CSSValueWithLength;
|
|
19
|
+
/** @default false */
|
|
20
|
+
showCounter?: boolean;
|
|
19
21
|
}
|
|
20
22
|
export type InputBaseProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'width'> & InputBaseType;
|
|
23
|
+
export declare const controlledInputValue: (value: any) => string;
|
|
21
24
|
export declare const InputBase: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "width"> & InputBaseType & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ChangeEvent, InputHTMLAttributes } from 'react';
|
|
2
2
|
import { InputAffixProps } from './InputAffix';
|
|
3
3
|
import { InputBaseType } from './InputBase';
|
|
4
|
-
export interface NumericInputBaseType extends InputBaseType, InputAffixProps {
|
|
4
|
+
export interface NumericInputBaseType extends Omit<InputBaseType, 'showCounter'>, InputAffixProps {
|
|
5
5
|
value?: number | string | null;
|
|
6
6
|
defaultValue?: number | string;
|
|
7
7
|
/** @default true */
|
|
@@ -7,5 +7,5 @@ export interface AlertModalProps extends Omit<ConfirmModalProps, 'cancelText' |
|
|
|
7
7
|
*/
|
|
8
8
|
kind?: NotificationKind;
|
|
9
9
|
}
|
|
10
|
-
export declare const AlertModal: ({
|
|
10
|
+
export declare const AlertModal: ({ kind, dense, fill, title, confirmText, text, subtext, onConfirm, onExited, ...props }: AlertModalProps) => JSX.Element;
|
|
11
11
|
export declare const Alert: (properties: AlertModalProps) => Promise<void>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
3
|
import { AlertModal, AlertModalProps } from './AlertModal';
|
|
4
|
-
declare const _default: ComponentMeta<({
|
|
4
|
+
declare const _default: ComponentMeta<({ kind, dense, fill, title, confirmText, text, subtext, onConfirm, onExited, ...props }: AlertModalProps) => JSX.Element>;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Base: ComponentStory<typeof AlertModal>;
|
|
7
7
|
export declare const Dense: ComponentStory<typeof AlertModal>;
|
|
8
|
-
export declare const Fill: ComponentStory<typeof AlertModal>;
|
|
9
8
|
export declare const Kind: ComponentStory<typeof AlertModal>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ModalProps } from './Modal';
|
|
3
|
-
export interface ConfirmModalProps extends Omit<ModalProps, '
|
|
3
|
+
export interface ConfirmModalProps extends Omit<ModalProps, 'opened' | 'closeButton' | 'onConfirm' | 'onCancel' | 'width' | 'footerAddon' | 'fullScreen' | 'onClickBackButton'> {
|
|
4
4
|
onConfirm?: () => void | Promise<void>;
|
|
5
5
|
onCancel?: () => void | Promise<void>;
|
|
6
|
-
text
|
|
6
|
+
text?: ReactNode;
|
|
7
7
|
subtext?: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const ConfirmModal: ({
|
|
9
|
+
export declare const ConfirmModal: ({ title, dense, fill, text, subtext, confirmText, cancelText, onConfirm, onCancel, onClose, onExited, ...props }: ConfirmModalProps) => JSX.Element;
|
|
10
10
|
export declare const Confirm: (properties: ConfirmModalProps) => Promise<boolean>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
3
|
import { ConfirmModal } from './ConfirmModal';
|
|
4
|
-
declare const _default: ComponentMeta<({
|
|
4
|
+
declare const _default: ComponentMeta<({ title, dense, fill, text, subtext, confirmText, cancelText, onConfirm, onCancel, onClose, onExited, ...props }: import("./ConfirmModal").ConfirmModalProps) => JSX.Element>;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Base: ComponentStory<typeof ConfirmModal>;
|
|
7
7
|
export declare const Dense: ComponentStory<typeof ConfirmModal>;
|
|
8
|
-
export declare const Fill: ComponentStory<typeof ConfirmModal>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '../button';
|
|
3
3
|
import { SpaceProps } from '../../styles';
|
|
4
|
-
import { ModalOverlayBaseProps } from './ModalOverlay';
|
|
4
|
+
import { ModalOverlayBaseProps, ModalBaseCancelReason } from './ModalOverlay';
|
|
5
5
|
export type ModalButtonProps = Omit<ButtonProps, 'onClick'>;
|
|
6
|
+
export type ModalCancelReason = ModalBaseCancelReason;
|
|
6
7
|
export interface ModalProps extends ModalOverlayBaseProps {
|
|
7
8
|
title?: ReactNode;
|
|
8
9
|
confirmText?: string;
|
|
@@ -37,15 +38,19 @@ export interface ModalProps extends ModalOverlayBaseProps {
|
|
|
37
38
|
*/
|
|
38
39
|
fixedFooter?: boolean;
|
|
39
40
|
onConfirm?: () => void;
|
|
40
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @desc Modal Header backButton 클릭 이벤트
|
|
43
|
+
*/
|
|
41
44
|
onClickBackButton?: () => void;
|
|
42
|
-
onClickOverlay?: () => void;
|
|
43
45
|
}
|
|
44
46
|
export interface ModalContentProps extends Pick<ModalProps, 'fixedHeader' | 'fixedFooter' | 'dense'>, SpaceProps {
|
|
45
47
|
}
|
|
46
48
|
export declare const MIN_WIDTH = 480;
|
|
47
|
-
export declare const Modal: ({ opened: openProp, children, title, width, confirmText, cancelText, closeButton, backButton, dense, fill, fullScreen, fixedHeader, fixedFooter, footer, confirmButtonProps, cancelButtonProps, contentProps, onConfirm, onCancel,
|
|
49
|
+
export declare const Modal: ({ opened: openProp, children, title, width, confirmText, cancelText, closeButton, backButton, dense, fill, fullScreen, fixedHeader, fixedFooter, footer, confirmButtonProps, cancelButtonProps, contentProps, onConfirm, onCancel, onExited, onClickBackButton, ...props }: PropsWithChildren<ModalProps>) => JSX.Element;
|
|
48
50
|
export declare const ModalContent: import("@emotion/styled").StyledComponent<{
|
|
49
51
|
theme?: import("@emotion/react").Theme;
|
|
50
52
|
as?: React.ElementType<any>;
|
|
51
|
-
} & ModalContentProps
|
|
53
|
+
} & ModalContentProps & {
|
|
54
|
+
headerHeight: number;
|
|
55
|
+
footerHeight: number;
|
|
56
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
3
|
import { Modal } from './Modal';
|
|
4
|
-
declare const _default: ComponentMeta<({ opened: openProp, children, title, width, confirmText, cancelText, closeButton, backButton, dense, fill, fullScreen, fixedHeader, fixedFooter, footer, confirmButtonProps, cancelButtonProps, contentProps, onConfirm, onCancel,
|
|
4
|
+
declare const _default: ComponentMeta<({ opened: openProp, children, title, width, confirmText, cancelText, closeButton, backButton, dense, fill, fullScreen, fixedHeader, fixedFooter, footer, confirmButtonProps, cancelButtonProps, contentProps, onConfirm, onCancel, onExited, onClickBackButton, ...props }: React.PropsWithChildren<import("./Modal").ModalProps>) => JSX.Element>;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Base: any;
|
|
7
7
|
export declare const Dense: any;
|
|
8
8
|
export declare const Fill: any;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const DisabledOverlayEscape: any;
|
|
10
10
|
export declare const WithBackButton: any;
|
|
11
|
+
export declare const ControlledCancelEvent: ComponentStory<typeof Modal>;
|
|
12
|
+
export declare const UncontrolledCancelEvent: ComponentStory<typeof Modal>;
|
|
11
13
|
export declare const CustomFooter: ComponentStory<typeof Modal>;
|
|
12
14
|
export declare const CustomContent: ComponentStory<typeof Modal>;
|
|
15
|
+
export declare const NestingModal: ComponentStory<typeof Modal>;
|
|
16
|
+
export declare const NestingConfirm: ComponentStory<typeof Modal>;
|
|
13
17
|
export declare const FullScreen: ComponentStory<typeof Modal>;
|
|
18
|
+
export declare const MaxHeight: ComponentStory<typeof Modal>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren, Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { CSSValueWithLength } from '../../styles';
|
|
3
3
|
import { CornerRadiusSize } from '../../foundation';
|
|
4
|
+
export type ModalBaseCancelReason = 'cancelClick' | 'escapeKeyPress' | 'overlayClick';
|
|
5
|
+
export declare const SAFE_TOP_BOTTOM_AREA = 120;
|
|
6
|
+
export declare const SAFE_LEFT_RIGHT_AREA = 32;
|
|
4
7
|
export interface ModalOverlayBaseProps {
|
|
5
8
|
/**
|
|
6
9
|
* @default 'pds-floating-root'
|
|
@@ -25,19 +28,26 @@ export interface ModalOverlayBaseProps {
|
|
|
25
28
|
*/
|
|
26
29
|
zIndex?: number;
|
|
27
30
|
/**
|
|
28
|
-
* @
|
|
31
|
+
* @desc Modal Overlay 영역 클릭시 모달 닫힘 사용 여부, onCancel 이벤트 제어가 있는 경우 useFloating 내부 상태 제어를 하지 않습니다.
|
|
32
|
+
* @default true
|
|
29
33
|
*/
|
|
30
34
|
canClickOutside?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* @desc escapeKey 모달 닫힘 사용 여부, 현재 모달에 focus된 경우 동작합니다. onCancel 이벤트 제어가 있는 경우 useFloating 내부 상태 제어를 하지 않습니다.
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
canCloseEscapeKey?: boolean;
|
|
31
40
|
onExited?: () => void;
|
|
32
41
|
onClose?: () => void;
|
|
42
|
+
onCancel?: (reason: ModalBaseCancelReason) => void;
|
|
33
43
|
}
|
|
44
|
+
export type ModalCloseEventCallback = Omit<ModalBaseCancelReason, 'cancelClick'>;
|
|
34
45
|
export interface ModalOverlayProps extends ModalOverlayBaseProps {
|
|
35
|
-
maxWidth?: CSSValueWithLength;
|
|
36
46
|
/**
|
|
37
47
|
* @default large
|
|
38
48
|
*/
|
|
39
49
|
borderRadiusSize?: CornerRadiusSize;
|
|
40
|
-
setOpened
|
|
41
|
-
|
|
50
|
+
setOpened?: Dispatch<SetStateAction<boolean>>;
|
|
51
|
+
onCancelEventCallback?: (event: ModalCloseEventCallback) => void;
|
|
42
52
|
}
|
|
43
|
-
export declare const ModalOverlay: ({ floatingPortalId, width,
|
|
53
|
+
export declare const ModalOverlay: ({ floatingPortalId, width, borderRadiusSize, fill, fullScreen, className, children, opened: openProp, zIndex, canClickOutside, canCloseEscapeKey, onExited, onClose, onCancel, onCancelEventCallback, setOpened, }: PropsWithChildren<ModalOverlayProps>) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { ModalOverlayBaseProps } from './ModalOverlay';
|
|
3
|
-
export interface NoticeModalProps extends Omit<ModalOverlayBaseProps, 'fill' | 'fullScreen'
|
|
3
|
+
export interface NoticeModalProps extends Omit<ModalOverlayBaseProps, 'fill' | 'fullScreen'> {
|
|
4
4
|
label?: string;
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
text?: ReactNode;
|
|
@@ -2,7 +2,6 @@ import React, { TextareaHTMLAttributes } from 'react';
|
|
|
2
2
|
import { SizeProps } from '../../styles';
|
|
3
3
|
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, SizeProps {
|
|
4
4
|
error?: boolean;
|
|
5
|
-
value?: string;
|
|
6
5
|
/** @default false */
|
|
7
6
|
showCounter?: boolean;
|
|
8
7
|
}
|