@croquiscom/pds 0.40.3 → 0.42.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,50 @@
1
1
  # @croquiscom/pds
2
2
 
3
+ ## 0.42.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4fa2b71: IconVideo24 추가
8
+
9
+ ### Patch Changes
10
+
11
+ - 05d8c33: Basic Modal onClose 이벤트 제거
12
+ - 6eda063: z-index 내부 정의값 위계 변경, Dropdown, Popover hideMiddleware, flip 처리 추가
13
+
14
+ ## BreakPoint
15
+
16
+ z-index 위계가 아래와 같이 변경되었습니다.
17
+
18
+ - BottomSheet 1010 => 1020
19
+ - Modal 1020 => 1010
20
+
21
+ ## 0.41.0
22
+
23
+ ### Minor Changes
24
+
25
+ - a20ad2b: Modal Event 변경 및 중첩 사용시 유니크 ID 처리 추가
26
+
27
+ ## BreakPoint
28
+
29
+ Basic Modal Event 방식이 다음과 같이 변경되었습니다.
30
+
31
+ - onConfirm, onCancel 이벤트 발생시 동시에 전달하던 onClose 이벤트가 제거되었습니다.
32
+ - onConfirm
33
+ - confirm 버튼 클릭시
34
+ - onCancel
35
+ - cancel 버튼 클릭시
36
+ - closeButton(x) 버튼 클릭시
37
+ - overlay 클릭시
38
+ - esc keyboard 이벤트 발생시
39
+ - onExit
40
+ - Modal destroy시
41
+
42
+ canCloseEscapeKey props 추가되었습니다.
43
+
44
+ - escapeKey 모달 닫힘 사용 여부로 현재 모달에 focus된 경우 동작합니다.
45
+
46
+ canClickOutside props default가 true로 변경되었습니다.
47
+
3
48
  ## 0.40.3
4
49
 
5
50
  ### Patch Changes
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3 9C3 7.34315 4.34315 6 6 6H14C15.5949 6 16.8992 7.24464 16.9944 8.81563L18.0979 7.71213C19.1689 6.64119 21 7.39968 21 8.91421V15.0858C21 16.6003 19.1689 17.3588 18.0979 16.2879L16.9944 15.1844C16.8992 16.7554 15.5949 18 14 18H6C4.34315 18 3 16.6569 3 15V9ZM6 7.4H14C14.8837 7.4 15.6 8.11634 15.6 9V15C15.6 15.8837 14.8837 16.6 14 16.6H6C5.11634 16.6 4.4 15.8837 4.4 15V9C4.4 8.11634 5.11634 7.4 6 7.4ZM19.0879 8.70208C19.2769 8.51309 19.6 8.64694 19.6 8.91421V15.0858C19.6 15.3531 19.2769 15.4869 19.0879 15.2979L17.0879 13.2979C17.0316 13.2417 17 13.1654 17 13.0858V10.9142C17 10.8346 17.0316 10.7583 17.0879 10.7021L19.0879 8.70208Z" fill="#363644"/>
3
+ </svg>
@@ -5,7 +5,7 @@ type BottomSheetContentWithCloseAction = (action: {
5
5
  export interface BottomSheetProps {
6
6
  className?: string;
7
7
  opened?: boolean;
8
- /** @default 1010 */
8
+ /** @default 1020 */
9
9
  zIndex?: number;
10
10
  title?: ReactNode;
11
11
  subTitle?: ReactNode;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from '.';
3
+ declare const SvgVideo24: ({ size, color, secondaryColor, ...props }: IconProps) => JSX.Element;
4
+ export default SvgVideo24;
@@ -164,6 +164,7 @@ export { default as IconTwo18 } from './Two18';
164
164
  export { default as IconUpload50 } from './Upload50';
165
165
  export { default as IconUser18 } from './User18';
166
166
  export { default as IconVideo16 } from './Video16';
167
+ export { default as IconVideo24 } from './Video24';
167
168
  export { default as IconVvip18 } from './Vvip18';
168
169
  export { default as IconWarning24 } from './Warning24';
169
170
  export { default as IconWon16 } from './Won16';
@@ -7,5 +7,5 @@ export interface AlertModalProps extends Omit<ConfirmModalProps, 'cancelText' |
7
7
  */
8
8
  kind?: NotificationKind;
9
9
  }
10
- export declare const AlertModal: ({ opened: openProp, kind, dense, fill, title, confirmText, text, subtext, onConfirm, onExited, ...props }: AlertModalProps) => JSX.Element;
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<({ opened: openProp, kind, dense, fill, title, confirmText, text, subtext, onConfirm, onExited, ...props }: AlertModalProps) => JSX.Element>;
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,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ModalProps } from './Modal';
3
- export interface ConfirmModalProps extends Omit<ModalProps, 'closeButton' | 'onConfirm' | 'onCancel' | 'onClose' | 'width' | 'footerAddon' | 'fullScreen' | 'canClickOutside'> {
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: ReactNode;
6
+ onClose?: () => void | Promise<void>;
7
+ text?: ReactNode;
7
8
  subtext?: ReactNode;
8
9
  }
9
- export declare const ConfirmModal: ({ opened: openProp, title, dense, fill, text, subtext, confirmText, cancelText, onConfirm, onCancel, onExited, ...props }: ConfirmModalProps) => JSX.Element;
10
+ export declare const ConfirmModal: ({ title, dense, fill, text, subtext, confirmText, cancelText, onConfirm, onCancel, onClose, onExited, ...props }: ConfirmModalProps) => JSX.Element;
10
11
  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<({ opened: openProp, title, dense, fill, text, subtext, confirmText, cancelText, onConfirm, onCancel, onExited, ...props }: import("./ConfirmModal").ConfirmModalProps) => JSX.Element>;
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,9 +1,10 @@
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 interface ModalProps extends ModalOverlayBaseProps {
6
+ export type ModalCancelReason = ModalBaseCancelReason;
7
+ export interface ModalProps extends Omit<ModalOverlayBaseProps, 'onClose'> {
7
8
  title?: ReactNode;
8
9
  confirmText?: string;
9
10
  confirmButtonProps?: ModalButtonProps;
@@ -37,15 +38,23 @@ export interface ModalProps extends ModalOverlayBaseProps {
37
38
  */
38
39
  fixedFooter?: boolean;
39
40
  onConfirm?: () => void;
40
- onCancel?: () => void;
41
+ /**
42
+ * @desc cancel 이벤트, reason('cancelClick' | 'escapeKeyPress' | 'overlayClick')을 포함하여 전달합니다.
43
+ */
44
+ onCancel?: (reason: ModalBaseCancelReason) => void;
45
+ /**
46
+ * @desc Modal Header backButton 클릭 이벤트
47
+ */
41
48
  onClickBackButton?: () => void;
42
- onClickOverlay?: () => void;
43
49
  }
44
50
  export interface ModalContentProps extends Pick<ModalProps, 'fixedHeader' | 'fixedFooter' | 'dense'>, SpaceProps {
45
51
  }
46
52
  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, onClose, onExited, onClickBackButton, onClickOverlay, ...props }: PropsWithChildren<ModalProps>) => JSX.Element;
53
+ 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
54
  export declare const ModalContent: import("@emotion/styled").StyledComponent<{
49
55
  theme?: import("@emotion/react").Theme;
50
56
  as?: React.ElementType<any>;
51
- } & ModalContentProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
57
+ } & ModalContentProps & {
58
+ headerHeight: number;
59
+ footerHeight: number;
60
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,13 +1,17 @@
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, onClose, onExited, onClickBackButton, onClickOverlay, ...props }: React.PropsWithChildren<import("./Modal").ModalProps>) => JSX.Element>;
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 canClickOutside: any;
9
+ export declare const DisabledOverlayEscape: any;
10
10
  export declare const WithBackButton: any;
11
+ export declare const ControlledCancelEvent: ComponentStory<typeof Modal>;
11
12
  export declare const CustomFooter: ComponentStory<typeof Modal>;
12
13
  export declare const CustomContent: ComponentStory<typeof Modal>;
14
+ export declare const NestingModal: ComponentStory<typeof Modal>;
15
+ export declare const NestingConfirm: ComponentStory<typeof Modal>;
13
16
  export declare const FullScreen: ComponentStory<typeof Modal>;
17
+ export declare const MaxHeight: ComponentStory<typeof Modal>;
@@ -1,6 +1,10 @@
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 type ModalCloseEventCallback = Omit<ModalBaseCancelReason, 'cancelClick'>;
6
+ export declare const SAFE_TOP_BOTTOM_AREA = 120;
7
+ export declare const SAFE_LEFT_RIGHT_AREA = 32;
4
8
  export interface ModalOverlayBaseProps {
5
9
  /**
6
10
  * @default 'pds-floating-root'
@@ -21,23 +25,33 @@ export interface ModalOverlayBaseProps {
21
25
  className?: string;
22
26
  opened?: boolean;
23
27
  /**
24
- * @default 1020
28
+ * @default 1010
25
29
  */
26
30
  zIndex?: number;
27
31
  /**
28
- * @default false
32
+ * @desc Modal Overlay 영역 클릭시 모달 닫힘 사용 여부
33
+ * @default true
29
34
  */
30
35
  canClickOutside?: boolean;
36
+ /**
37
+ * @desc escapeKey 모달 닫힘 사용 여부, 현재 모달에 focus된 경우 동작합니다.
38
+ * @default true
39
+ */
40
+ canCloseEscapeKey?: boolean;
31
41
  onExited?: () => void;
32
42
  onClose?: () => void;
33
43
  }
34
44
  export interface ModalOverlayProps extends ModalOverlayBaseProps {
35
- maxWidth?: CSSValueWithLength;
36
45
  /**
37
46
  * @default large
38
47
  */
39
48
  borderRadiusSize?: CornerRadiusSize;
40
- setOpened: Dispatch<SetStateAction<boolean>>;
41
- onCloseOutsidePress?: () => void;
49
+ setOpened?: Dispatch<SetStateAction<boolean>>;
50
+ onCancelEventCallback?: (event: ModalCloseEventCallback) => void;
51
+ /**
52
+ * @desc esc, overlay 클릭으로 인한 모달 닫힘 상태 내부 제어 여부, Confirm/Alert 모달과 같이 함수 호출형 컴포넌트에 해당합니다.
53
+ * @default false
54
+ */
55
+ uncontrolledOpen?: boolean;
42
56
  }
43
- export declare const ModalOverlay: ({ floatingPortalId, width, maxWidth, borderRadiusSize, fill, fullScreen, className, children, opened: openProp, zIndex, canClickOutside, onExited, onClose, onCloseOutsidePress, setOpened, }: PropsWithChildren<ModalOverlayProps>) => JSX.Element;
57
+ export declare const ModalOverlay: ({ floatingPortalId, width, borderRadiusSize, fill, fullScreen, className, children, opened: openProp, zIndex, canClickOutside, canCloseEscapeKey, uncontrolledOpen, onExited, onClose, 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' | 'canClickOutside'> {
3
+ export interface NoticeModalProps extends Omit<ModalOverlayBaseProps, 'fill' | 'fullScreen'> {
4
4
  label?: string;
5
5
  title?: ReactNode;
6
6
  text?: ReactNode;