@croquiscom/pds 9.2.0 → 9.3.1
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 +14 -0
- package/dist/components/bottom-sheet/BottomSheet.d.ts +1 -0
- package/dist/components/bottom-sheet/BottomSheet.stories.d.ts +1 -0
- package/dist/components/button/FloatingButton.d.ts +6 -0
- package/dist/components/button/FloatingButton.figma.d.ts +1 -0
- package/dist/components/button/FloatingButton.stories.d.ts +6 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/styles.d.ts +2 -0
- package/dist/components/date-picker/DatePicker.stories.d.ts +1 -0
- package/dist/components/message/MessageManager.d.ts +8 -2
- package/dist/components/modal/FloatingModal.d.ts +9 -0
- package/dist/components/modal/FloatingModal.figma.d.ts +1 -0
- package/dist/components/modal/FloatingModal.stories.d.ts +9 -0
- package/dist/components/modal/FloatingModalContainer.d.ts +13 -0
- package/dist/components/modal/FloatingModalContent.d.ts +77 -0
- package/dist/components/modal/ModalHeader.d.ts +23 -0
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/toast/Toast.stories.d.ts +1 -0
- package/dist/components/toast/useToast.d.ts +9 -2
- package/dist/index.es.js +8 -8
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/plugin/ui.html +1 -1
- package/plugin/ui.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @croquiscom/pds
|
|
2
2
|
|
|
3
|
+
## 9.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7bc3625: DatePicker value값 변경 시 라벨 미갱신 오류 수정
|
|
8
|
+
|
|
9
|
+
## 9.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- c8b890c: FloatingButton, FloatingModal 컴포넌트 추가
|
|
14
|
+
- 8345d24: Toast inline으로 사용가능하도록 수정
|
|
15
|
+
- c9e312a: BottomSheet inline 사용가능하도록 수정
|
|
16
|
+
|
|
3
17
|
## 9.2.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from './Button';
|
|
3
|
+
export interface FloatingButtonProps extends Omit<ButtonProps, 'fill' | 'kind' | 'size' | 'type'> {
|
|
4
|
+
opened?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const FloatingButton: React.ForwardRefExoticComponent<FloatingButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,3 +12,5 @@ export declare const text_button_size_css: Record<TextButtonSize, string>;
|
|
|
12
12
|
export declare const getTextButtonStyle: (kind: TextButtonKind, fixed_color: string) => import("@emotion/utils").SerializedStyles;
|
|
13
13
|
export declare const accordion_button_css: import("@emotion/utils").SerializedStyles;
|
|
14
14
|
export declare const accordion_button_size_css: Record<AccordionButtonSize, string>;
|
|
15
|
+
export declare const floating_button_css: import("@emotion/utils").SerializedStyles;
|
|
16
|
+
export declare const getFloatingButtonCss: (opened: boolean, width?: number) => string;
|
|
@@ -29,10 +29,14 @@ export interface MessageContainerProps {
|
|
|
29
29
|
* @default 'column'
|
|
30
30
|
*/
|
|
31
31
|
direction?: MessageDirection;
|
|
32
|
+
/**
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
use_inline?: boolean;
|
|
32
36
|
}
|
|
33
37
|
type MessageContainerType = 'toast' | 'notification';
|
|
34
|
-
type MessageContainerKey = `${MessagePositionType}_${MessageDirection}_${number}_${number}`;
|
|
35
38
|
type MessageComponentTypes = ToastComponentProps | NotificationComponentProps;
|
|
39
|
+
export type MessageContainerKey = `${MessagePositionType}_${MessageDirection}_${number}_${number}`;
|
|
36
40
|
export type MessageOptions<T extends MessageComponentTypes> = Omit<T, 'destroy' | 'position'> & Partial<MessageContainerProps>;
|
|
37
41
|
export declare class MessageManager<T extends MessageComponentTypes> {
|
|
38
42
|
private root;
|
|
@@ -45,8 +49,9 @@ export declare class MessageManager<T extends MessageComponentTypes> {
|
|
|
45
49
|
private default_direction;
|
|
46
50
|
private container_keys;
|
|
47
51
|
private messages;
|
|
52
|
+
private use_inline;
|
|
48
53
|
private static instance;
|
|
49
|
-
constructor({ component, type, z_index, default_max_count, default_offset, default_position, default_direction, }: {
|
|
54
|
+
constructor({ component, type, z_index, default_max_count, default_offset, default_position, default_direction, root_container, }: {
|
|
50
55
|
component: FunctionComponent<T>;
|
|
51
56
|
type: MessageContainerType;
|
|
52
57
|
z_index?: number;
|
|
@@ -54,6 +59,7 @@ export declare class MessageManager<T extends MessageComponentTypes> {
|
|
|
54
59
|
default_offset?: number;
|
|
55
60
|
default_position?: MessagePositionType;
|
|
56
61
|
default_direction?: MessageDirection;
|
|
62
|
+
root_container?: HTMLElement;
|
|
57
63
|
});
|
|
58
64
|
static getInstance(type: MessageContainerType): MessageManager<MessageComponentTypes>;
|
|
59
65
|
set setInstance({ default_max_count, default_offset, default_position, }: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { FloatingModalContainerProps } from './FloatingModalContainer';
|
|
3
|
+
import { FloatingModalContentProps } from './FloatingModalContent';
|
|
4
|
+
export interface FloatingModalProps extends FloatingModalContentProps, Omit<FloatingModalContainerProps, 'setOpened'> {
|
|
5
|
+
opened: boolean;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
onOpen?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const FloatingModal: ({ canClickOutside, canCloseEscapeKey, openerTriggerEvent, trigger, onClose, onOpen, ...props }: PropsWithChildren<FloatingModalProps>) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FloatingModal } from './FloatingModal';
|
|
3
|
+
declare const meta: Meta<typeof FloatingModal>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FloatingModal>;
|
|
6
|
+
export declare const BottomRight: Story;
|
|
7
|
+
export declare const BottomLeft: Story;
|
|
8
|
+
export declare const TopLeft: Story;
|
|
9
|
+
export declare const TopRight: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface FloatingModalContainerProps {
|
|
3
|
+
position?: 'bottom-right' | 'top-right' | 'bottom-left' | 'top-left';
|
|
4
|
+
canClickOutside?: boolean;
|
|
5
|
+
canCloseEscapeKey?: boolean;
|
|
6
|
+
openerTriggerEvent?: 'click' | 'none';
|
|
7
|
+
className?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
trigger: ReactNode;
|
|
10
|
+
opened?: boolean;
|
|
11
|
+
setOpened: (opened: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const FloatingModalContainer: React.FC<FloatingModalContainerProps>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { CSSValueWithLength } from '../../styles';
|
|
3
|
+
import { ModalActionButtonType } from './ModalActionButton';
|
|
4
|
+
import { ModalButtonProps, ModalContentProps } from './Modal';
|
|
5
|
+
type LayoutHeightType = {
|
|
6
|
+
header: number;
|
|
7
|
+
footer: number;
|
|
8
|
+
};
|
|
9
|
+
export interface FloatingModalContentProps {
|
|
10
|
+
opened: boolean;
|
|
11
|
+
width?: CSSValueWithLength;
|
|
12
|
+
/**
|
|
13
|
+
* @default 'bottom-right'
|
|
14
|
+
*/
|
|
15
|
+
position?: 'bottom-right' | 'top-right' | 'bottom-left' | 'top-left';
|
|
16
|
+
title?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* 기본적으로 open transition delay가 0.15s가 있습니다. delay를 제거하려면 false로 설정합니다.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
hasTransitionDelay?: boolean;
|
|
22
|
+
confirmText?: string;
|
|
23
|
+
/**
|
|
24
|
+
* [ButtonProps](https://storybook.kakaostyle.in/master/pds/?path=/docs/component-button--primary)를 confirmButton에 적용할 수 있습니다.
|
|
25
|
+
*/
|
|
26
|
+
confirmButtonProps?: ModalButtonProps;
|
|
27
|
+
cancelText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* [ButtonProps](https://storybook.kakaostyle.in/master/pds/?path=/docs/component-button--primary)를 cancelButton에 적용할 수 있습니다.
|
|
30
|
+
*/
|
|
31
|
+
cancelButtonProps?: ModalButtonProps;
|
|
32
|
+
/**
|
|
33
|
+
* autofocus 지정할 기본 버튼 요소
|
|
34
|
+
* @default null
|
|
35
|
+
*/
|
|
36
|
+
autoFocusButton?: ModalActionButtonType | null;
|
|
37
|
+
/**
|
|
38
|
+
* 헤더 영역 타이틀 좌측 backButton 사용 유무
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
backButton?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
closeButton?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 바디 영역 콘텐츠 ModalContentProps를 통한 커스텀이 가능합니다.
|
|
48
|
+
* - [SpaceProps](https://github.com/croquiscom/pds/blob/main/src/styles/space.ts)
|
|
49
|
+
* - maxHeight: 콘텐츠 영역 maxHeight을 커스텀할 수 있습니다. 지정하지 않을 경우 안전여백내에서 계산된 자동 최대 maxHeight값이 적용됩니다.
|
|
50
|
+
* - scrollable: true일 경우 콘텐츠 영역에 overflow-y: auto값이 적용됩니다.
|
|
51
|
+
*/
|
|
52
|
+
contentProps?: ModalContentProps;
|
|
53
|
+
/**
|
|
54
|
+
* 푸터 영역을 커스텀할 수 있습니다.
|
|
55
|
+
* - 기본 Footer(confirmText, cancelText)는 미노출됩니다.
|
|
56
|
+
*/
|
|
57
|
+
footer?: ReactNode;
|
|
58
|
+
onConfirm?: () => void;
|
|
59
|
+
/**
|
|
60
|
+
* reason을 포함한 cancel 이벤트를 전달합니다.
|
|
61
|
+
* - 'cancelClick' | 'escapeKeyPress' | 'overlayClick'
|
|
62
|
+
*/
|
|
63
|
+
onCancel?: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Modal Header backButton 클릭 이벤트
|
|
66
|
+
*/
|
|
67
|
+
onClickBackButton?: () => void;
|
|
68
|
+
}
|
|
69
|
+
export declare const FloatingModalContent: React.ComponentType<React.PropsWithChildren<FloatingModalContentProps>>;
|
|
70
|
+
export declare const FloatingModalBody: import("@emotion/styled").StyledComponent<{
|
|
71
|
+
theme?: import("@emotion/react").Theme;
|
|
72
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
73
|
+
} & ModalContentProps & {
|
|
74
|
+
layoutHeight: LayoutHeightType;
|
|
75
|
+
contentOverflow: boolean;
|
|
76
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export interface ModalHeaderProps {
|
|
3
|
+
title?: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* 헤더 영역 타이틀 좌측 backButton 사용 유무
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
backButton?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
closeButton?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* reason을 포함한 cancel 이벤트를 전달합니다.
|
|
15
|
+
* - 'cancelClick' | 'escapeKeyPress' | 'overlayClick'
|
|
16
|
+
*/
|
|
17
|
+
onCancel?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Modal Header backButton 클릭 이벤트
|
|
20
|
+
*/
|
|
21
|
+
onClickBackButton?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const ModalHeader: ({ title, backButton, closeButton, onCancel, onClickBackButton, }: PropsWithChildren<ModalHeaderProps>) => React.JSX.Element;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessageContainerKey, MessageOptions } from '../message';
|
|
2
2
|
import { ToastComponentProps } from './Toast';
|
|
3
|
-
|
|
3
|
+
interface ToastShowProps extends MessageOptions<ToastComponentProps> {
|
|
4
|
+
root?: HTMLElement | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function useToast(): {
|
|
7
|
+
show(props: ToastShowProps): void;
|
|
8
|
+
destroy(id: string, key?: MessageContainerKey): void;
|
|
9
|
+
};
|
|
10
|
+
export {};
|