@croquiscom/pds 3.10.0-alpha.6 → 4.0.0-next.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +4 -66
  2. package/dist/components/date-picker/Caption.d.ts +2 -3
  3. package/dist/components/date-picker/DatePicker.d.ts +0 -1
  4. package/dist/components/date-picker/DateRangeInput.d.ts +3 -14
  5. package/dist/components/date-picker/DateRangePicker.d.ts +1 -8
  6. package/dist/components/date-picker/DateRangePicker.stories.d.ts +1 -2
  7. package/dist/components/date-picker/hooks/constants.d.ts +2 -3
  8. package/dist/components/date-picker/hooks/useDatePickerAttributes.d.ts +4 -9
  9. package/dist/components/date-picker/styles.d.ts +15 -8
  10. package/dist/components/icons/generated/index.d.ts +0 -6
  11. package/dist/components/message/MessageManager.d.ts +15 -6
  12. package/dist/components/message/types.d.ts +1 -1
  13. package/dist/components/notification/Notification.d.ts +2 -4
  14. package/dist/components/notification/index.d.ts +1 -0
  15. package/dist/components/notification/styles.d.ts +2 -2
  16. package/dist/components/notification/types.d.ts +1 -1
  17. package/dist/components/notification/useNotification.d.ts +3 -0
  18. package/dist/components/toast/Toast.d.ts +0 -2
  19. package/dist/components/toast/index.d.ts +1 -0
  20. package/dist/components/toast/types.d.ts +1 -1
  21. package/dist/components/toast/useToast.d.ts +3 -0
  22. package/dist/index.es.js +3 -3
  23. package/dist/index.es.js.map +1 -1
  24. package/dist/index.js +3 -3
  25. package/dist/index.js.map +1 -1
  26. package/dist/locales/en.d.ts +0 -1
  27. package/dist/locales/ja.d.ts +0 -1
  28. package/dist/locales/ko.d.ts +0 -1
  29. package/locales/en.d.ts +0 -1
  30. package/locales/en.esm.d.ts +0 -1
  31. package/locales/en.esm.js +0 -1
  32. package/locales/en.esm.js.map +1 -1
  33. package/locales/en.js +0 -1
  34. package/locales/en.js.map +1 -1
  35. package/locales/ja.d.ts +0 -1
  36. package/locales/ja.esm.d.ts +0 -1
  37. package/locales/ja.esm.js +0 -1
  38. package/locales/ja.esm.js.map +1 -1
  39. package/locales/ja.js +0 -1
  40. package/locales/ja.js.map +1 -1
  41. package/locales/ko.d.ts +0 -1
  42. package/locales/ko.esm.d.ts +0 -1
  43. package/locales/ko.esm.js +0 -1
  44. package/locales/ko.esm.js.map +1 -1
  45. package/locales/ko.js +0 -1
  46. package/locales/ko.js.map +1 -1
  47. package/package.json +1 -1
  48. package/assets/icons/Cancel.svg +0 -3
  49. package/assets/icons/ColoredFaceBad.svg +0 -6
  50. package/assets/icons/ColoredFaceGood.svg +0 -6
  51. package/assets/icons/ColoredFaceNeutral.svg +0 -6
  52. package/assets/icons/ColoredFaceVeryBad.svg +0 -4
  53. package/assets/icons/ColoredFaceVeryGood.svg +0 -5
  54. package/dist/components/date-picker/YearMonthCalendar.d.ts +0 -20
  55. package/dist/components/date-picker/YearMonthCaption.d.ts +0 -14
  56. package/dist/components/date-picker/utils.d.ts +0 -6
  57. package/dist/components/icons/generated/Cancel.d.ts +0 -4
  58. package/dist/components/icons/generated/ColoredFaceBad.d.ts +0 -4
  59. package/dist/components/icons/generated/ColoredFaceGood.d.ts +0 -4
  60. package/dist/components/icons/generated/ColoredFaceNeutral.d.ts +0 -4
  61. package/dist/components/icons/generated/ColoredFaceVeryBad.d.ts +0 -4
  62. package/dist/components/icons/generated/ColoredFaceVeryGood.d.ts +0 -4
package/CHANGELOG.md CHANGED
@@ -1,73 +1,11 @@
1
1
  # @croquiscom/pds
2
2
 
3
- ## 3.10.0-alpha.6
3
+ ## 4.0.0-next.0
4
4
 
5
- ### Patch Changes
6
-
7
- - YearMonthCalendar panel disabled 조건변경
8
-
9
- ## 3.10.0-alpha.3
10
-
11
- ### Minor Changes
12
-
13
- - ecf6746: 인사이트 셀러피드백 아이콘 추가
14
-
15
- ### Patch Changes
16
-
17
- - f7537e5: DateRangePicker minDate/maxDate + maxRange 혼합 케이스 추가
18
-
19
- ## 3.10.0-alpha.2
20
-
21
- ### Patch Changes
22
-
23
- - db5bbd2: DateRangePicker MaxRange 사용시 날짜 모두 입력 후 시작일 클릭시 클릭 범위 초기화
24
- DatePicker,DateRangePicker 에러케이스여도 날짜 형식이 맞으면 달력 이동
25
-
26
- ## 3.10.0-alpha.1
27
-
28
- ### Patch Changes
29
-
30
- - 09019b3: 날짜 입력후 selectedDatePreset 값 변경
31
-
32
- ## 3.10.0-alpha.0
33
-
34
- ### Minor Changes
35
-
36
- - 36b35ec: DatePicker/DateRangePicker prevYear, nextYear 버튼 추가(default) 및 디자인 변경사항
37
-
38
- ## BreakPoint
39
-
40
- - DatePicker 내부 TodayButton kind 변경
41
- - DatePicker 내부 TimePicker 사이즈 변경
42
- - DatePicker showTimePicker 사용시 [오늘]버튼 [지금]버튼으로 변경
43
- - DateRangePicker Description 제거
44
- - DateRangePicker [오늘] 버튼 추가
45
-
46
- - 3806f94: DateRangePicker autoCloseable 추가 및 디자인 변경 사항 적용
47
-
48
- ## BreakPoint
49
-
50
- - autoCloseable (default=[true])
51
- - default true 속성으로 날짜 범위 선택 완료시 캘린더 창 자동 닫기 기능
52
- - displayMode 'popover'인 경우 하단의 footer 영역의 취소/확인 버튼은 노출되지 않습니다.
53
- - displayMode 'bottomSheet'인 경우 적용이 불가합니다. footer 영역의 취소/확인 버튼이 default로 노출됩니다.
54
- - DateRangePicker showDataPreset true인 경우, TodayButton 미노출
55
- - DatePicker/DateRangePicker 내부 캘린더 DayButton UI 변경
56
-
57
- - 4f33c17: DatePicker/DateRangePicker 날짜를 직접 입력할 수 있다.
58
- - 2e1d69f: DateRangePicker 시작일/종료일 포커싱 선택
59
- - 851dd98: DatePicker, DateRangePicker 연/월을 각각 빠르게 선택할 수 있다.
60
-
61
- ### Patch Changes
62
-
63
- - 3f5b2e1: - DateRangePicker 날짜가 모두 입력된 상태에서 열었을 때 시작일 또는 종료일을 현재 선택된 날짜와 관계없이 모두 선택 가능
64
- - DateRangePicker 범위 선택 hover ui 변경
65
-
66
- ## 3.10.0
67
-
68
- ### Minor Changes
5
+ ### Major Changes
69
6
 
70
- - ecf6746: 인사이트 셀러피드백 아이콘 추가
7
+ - 85a3423: - MessageManager를 이용한 컴포넌트들을 ssr시에도 사용할 수 있도록 변경
8
+ - Toast는 useToast의 형태로, Notification은 useNotification의 형태로 변경
71
9
 
72
10
  ## 3.9.0
73
11
 
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { Locale } from 'date-fns';
3
3
  import { CaptionProps } from 'react-day-picker';
4
- import { CaptionLabelType, DisplayMode } from './DatePicker';
4
+ import { DisplayMode } from './DatePicker';
5
5
  export declare const captionColor: (disabled: boolean) => string;
6
6
  export interface DatePickerCaptionProps extends CaptionProps {
7
7
  /**
@@ -12,6 +12,5 @@ export interface DatePickerCaptionProps extends CaptionProps {
12
12
  currentMonth?: Date;
13
13
  locale: Locale;
14
14
  displayMode: DisplayMode;
15
- onClickCaptionLabel?: (type: CaptionLabelType) => void;
16
15
  }
17
- export declare const Caption: ({ multipleMonths, currentMonth: controlledMonth, displayMode, className, locale, onClickCaptionLabel, ...props }: DatePickerCaptionProps) => JSX.Element;
16
+ export declare const Caption: ({ multipleMonths, currentMonth: controlledMonth, displayMode, className, locale, ...props }: DatePickerCaptionProps) => JSX.Element;
@@ -5,7 +5,6 @@ import { TimePickerProps } from '../time-picker';
5
5
  import { InputSize } from '../input/types';
6
6
  export type DisplayTimeFormat = 'hourMinute' | 'hourMinuteSecond';
7
7
  export type DisplayMode = 'popover' | 'bottomSheet';
8
- export type CaptionLabelType = 'month' | 'year';
9
8
  export declare const DATE_FORMAT = "yyyy.MM.dd";
10
9
  export declare const DATE_HOUR_MINUTE_FORMAT = "yyyy.MM.dd HH:mm";
11
10
  export declare const DATE_HOUR_MINUTE_SECOND_FORMAT = "yyyy.MM.dd HH:mm:ss";
@@ -1,21 +1,10 @@
1
- import React, { Dispatch, SetStateAction } from 'react';
1
+ import React from 'react';
2
2
  import { DatePickerIconProps } from './DatePickerIcon';
3
3
  import { InputBaseProps } from '../input/InputBase';
4
4
  import { AriaFocusProps } from '../../types/common';
5
- export type FocusType = null | 'start' | 'end';
6
5
  export interface DateRangeInputProps extends Omit<InputBaseProps, 'leftAddon' | 'rightAddon' | 'alignment'>, AriaFocusProps {
7
- placeholder?: string;
8
- focused?: FocusType;
9
- setFocused?: (focused: FocusType) => void;
6
+ fromDate?: string;
7
+ toDate?: string;
10
8
  onClickRemoveButton?: () => void;
11
- inputValue: {
12
- start: string;
13
- end: string;
14
- };
15
- fetchInputValue: Dispatch<SetStateAction<{
16
- start: string;
17
- end: string;
18
- }>>;
19
- modalOpen: boolean;
20
9
  }
21
10
  export declare const DateRangeInput: React.ForwardRefExoticComponent<DateRangeInputProps & DatePickerIconProps & React.RefAttributes<HTMLInputElement>>;
@@ -43,12 +43,5 @@ export interface DateRangePickerProps extends DatePickerBaseProps {
43
43
  */
44
44
  numberOfMonths?: number;
45
45
  onChange?: (start: Dates['from'], end: Dates['to']) => void;
46
- /**
47
- * 선택 완료시 자동으로 캘린더 선택 창을 닫습니다.
48
- * - displayMode 'bottomSheet'인 경우 적용이 불가합니다.
49
- * - displayMode 'popover'인 경우 하단의 footer 영역의 취소/확인 버튼은 노출되지 않습니다.
50
- * @default true
51
- */
52
- autoCloseable?: boolean;
53
46
  }
54
- export declare const DateRangePicker: ({ width, error, disabled, className, size, showDatePreset, showRadioGroupDatePreset, dates, maxDate, minDate, maxRange, numberOfMonths: numberOfMonthsProps, showRemoveButton, autoCloseable, opened: openProp, customDatePreset, displayMode, onOpen, onClose, onChange, }: DateRangePickerProps) => JSX.Element;
47
+ export declare const DateRangePicker: ({ width, error, disabled, className, size, showDatePreset, showRadioGroupDatePreset, dates, maxDate, minDate, maxRange, numberOfMonths: numberOfMonthsProps, showRemoveButton, opened: openProp, customDatePreset, displayMode, onOpen, onClose, onChange, }: DateRangePickerProps) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ComponentStory, ComponentMeta } from '@storybook/react';
3
3
  import { DateRangePicker } from './DateRangePicker';
4
- declare const _default: ComponentMeta<({ width, error, disabled, className, size, showDatePreset, showRadioGroupDatePreset, dates, maxDate, minDate, maxRange, numberOfMonths: numberOfMonthsProps, showRemoveButton, autoCloseable, opened: openProp, customDatePreset, displayMode, onOpen, onClose, onChange, }: import("./DateRangePicker").DateRangePickerProps) => JSX.Element>;
4
+ declare const _default: ComponentMeta<({ width, error, disabled, className, size, showDatePreset, showRadioGroupDatePreset, dates, maxDate, minDate, maxRange, numberOfMonths: numberOfMonthsProps, showRemoveButton, opened: openProp, customDatePreset, displayMode, onOpen, onClose, onChange, }: import("./DateRangePicker").DateRangePickerProps) => JSX.Element>;
5
5
  export default _default;
6
6
  export declare const Base: any;
7
7
  export declare const Disabled: any;
@@ -16,4 +16,3 @@ export declare const WithDatePreset: any;
16
16
  export declare const WithRadioGroupDatePreset: any;
17
17
  export declare const WithAllDatePreset: any;
18
18
  export declare const BottomSheetPicker: any;
19
- export declare const UnusedAutoCloseable: any;
@@ -1,6 +1,5 @@
1
- export declare const POPOVER_CELL_SIZE = 36;
2
- export declare const BOTTOM_SHEET_CELL_SIZE = 48;
3
- export declare const CELL_SIZE_MARGIN = 4;
1
+ export declare const POPOVER_CELL_SIZE = 32;
2
+ export declare const BOTTOM_SHEET_CELL_SIZE = 49;
4
3
  export declare const BOTTOM_SHEET_CAPTION_HEIGHT = 72;
5
4
  export declare const BOTTOM_SHEET_FOOTER_HEIGHT = 90;
6
5
  export declare const MIN_SATE_PADDING_TOP = 40;
@@ -5,18 +5,10 @@ import { ButtonProps } from '../../button';
5
5
  import { VStackProps, HStackProps } from '../../stack';
6
6
  interface DatePickerAttributes {
7
7
  maxHeight: number;
8
- panelSize: {
9
- width: number;
10
- height: number;
11
- };
12
8
  cellSize: number;
13
9
  caption: {
14
10
  kind: Typography;
15
- arrow: {
16
- size: number;
17
- width: number;
18
- height: number;
19
- };
11
+ arrowSize: number;
20
12
  style?: CSSObject;
21
13
  };
22
14
  footer: {
@@ -24,6 +16,9 @@ interface DatePickerAttributes {
24
16
  container: Partial<HStackProps & VStackProps> & {
25
17
  style?: CSSObject;
26
18
  };
19
+ description?: {
20
+ kind: Typography;
21
+ };
27
22
  };
28
23
  }
29
24
  export declare function useDatePickerAttributes(displayMode: DisplayMode): DatePickerAttributes;
@@ -1,11 +1,18 @@
1
- import { CSSProperties } from 'react';
2
- import { InputSize } from '../input/types';
3
1
  export declare const date_picker_base_css: import("@emotion/utils").SerializedStyles;
4
2
  export declare const popover_picker_css: import("@emotion/utils").SerializedStyles;
5
3
  export declare const bottom_sheet_picker_css: import("@emotion/utils").SerializedStyles;
6
- export declare const caption_text_button_css: import("@emotion/utils").SerializedStyles;
7
- export declare const caption_arrow_button_css: import("@emotion/utils").SerializedStyles;
8
- export declare const range_input_default_style: CSSProperties;
9
- export declare const range_picker_focus_style: import("@emotion/utils").SerializedStyles;
10
- export declare const year_month_select_panel_css: import("@emotion/utils").SerializedStyles;
11
- export declare const getRangeFocusInputStyle: (size: InputSize) => import("@emotion/utils").SerializedStyles;
4
+ export declare const caption_button_css: import("@emotion/utils").SerializedStyles;
5
+ export declare const range_input_default_style: {
6
+ border: number;
7
+ borderRadius: number;
8
+ backgroundColor: string;
9
+ padding: number;
10
+ transition: string;
11
+ '&:hover': {
12
+ borderColor: string;
13
+ };
14
+ '&:focus, &:focus-within': {
15
+ outline: string;
16
+ border: string;
17
+ };
18
+ };
@@ -46,7 +46,6 @@ export { default as IconBulb } from './Bulb';
46
46
  export { default as IconBulbFill } from './BulbFill';
47
47
  export { default as IconCalendar } from './Calendar';
48
48
  export { default as IconCamera } from './Camera';
49
- export { default as IconCancel } from './Cancel';
50
49
  export { default as IconCart } from './Cart';
51
50
  export { default as IconCategoryBeauty } from './CategoryBeauty';
52
51
  export { default as IconCategoryBrand } from './CategoryBrand';
@@ -91,11 +90,6 @@ export { default as IconColoredCoupon } from './ColoredCoupon';
91
90
  export { default as IconColoredDocument } from './ColoredDocument';
92
91
  export { default as IconColoredExcel } from './ColoredExcel';
93
92
  export { default as IconColoredEyes } from './ColoredEyes';
94
- export { default as IconColoredFaceBad } from './ColoredFaceBad';
95
- export { default as IconColoredFaceGood } from './ColoredFaceGood';
96
- export { default as IconColoredFaceNeutral } from './ColoredFaceNeutral';
97
- export { default as IconColoredFaceVeryBad } from './ColoredFaceVeryBad';
98
- export { default as IconColoredFaceVeryGood } from './ColoredFaceVeryGood';
99
93
  export { default as IconColoredFlag } from './ColoredFlag';
100
94
  export { default as IconColoredGift } from './ColoredGift';
101
95
  export { default as IconColoredGraphDown } from './ColoredGraphDown';
@@ -1,13 +1,13 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { NotificationComponentProps } from '../notification';
3
3
  import { ToastComponentProps } from '../toast';
4
- import { MessageDirection, MessagePosition } from './types';
4
+ import type { MessageDirection, MessagePositionType } from './types';
5
5
  export interface MessageContainerProps {
6
6
  /**
7
7
  * @desc 메세지 노출 위치
8
8
  * @default top-center
9
9
  */
10
- position: MessagePosition;
10
+ position: MessagePositionType;
11
11
  /**
12
12
  * @desc position 기준으로 커스텀 위치, center일 경우 적용되지 않습니다
13
13
  */
@@ -30,12 +30,14 @@ export interface MessageContainerProps {
30
30
  */
31
31
  direction?: MessageDirection;
32
32
  }
33
- type MessageContainerKey = `${MessagePosition}_${MessageDirection}_${number}_${number}`;
33
+ type MessageContainerType = 'toast' | 'notification';
34
+ type MessageContainerKey = `${MessagePositionType}_${MessageDirection}_${number}_${number}`;
34
35
  type MessageComponentTypes = ToastComponentProps | NotificationComponentProps;
35
36
  export type MessageOptions<T extends MessageComponentTypes> = Omit<T, 'destroy' | 'position'> & Partial<MessageContainerProps>;
36
37
  export declare class MessageManager<T extends MessageComponentTypes> {
37
38
  private root;
38
39
  private component;
40
+ private type;
39
41
  private z_index;
40
42
  private default_max_count;
41
43
  private default_offset;
@@ -43,15 +45,22 @@ export declare class MessageManager<T extends MessageComponentTypes> {
43
45
  private default_direction;
44
46
  private container_keys;
45
47
  private messages;
46
- constructor({ component, container_id, z_index, default_max_count, default_offset, default_position, default_direction, }: {
48
+ private static instance;
49
+ constructor({ component, type, z_index, default_max_count, default_offset, default_position, default_direction, }: {
47
50
  component: FunctionComponent<T>;
48
- container_id: 'notification' | 'toast';
51
+ type: MessageContainerType;
49
52
  z_index?: number;
50
53
  default_max_count?: number;
51
54
  default_offset?: number;
52
- default_position?: MessagePosition;
55
+ default_position?: MessagePositionType;
53
56
  default_direction?: MessageDirection;
54
57
  });
58
+ static getInstance(type: MessageContainerType): MessageManager<MessageComponentTypes>;
59
+ set setInstance({ default_max_count, default_offset, default_position, }: {
60
+ default_max_count: number;
61
+ default_offset: number;
62
+ default_position: MessagePositionType;
63
+ });
55
64
  static generateContainerKey({ position, direction, offset_x, offset_y }: MessageContainerProps): MessageContainerKey;
56
65
  static getContainerPropsByKey(key: MessageContainerKey): MessageContainerProps;
57
66
  private generateMessageId;
@@ -6,5 +6,5 @@ export declare const MessagePosition: {
6
6
  readonly BOTTOM_CENTER: "bottom-center";
7
7
  readonly CENTER: "center";
8
8
  };
9
- export type MessagePosition = typeof MessagePosition[keyof typeof MessagePosition];
9
+ export type MessagePositionType = typeof MessagePosition[keyof typeof MessagePosition];
10
10
  export type MessageDirection = Extract<CSSProperties['flexDirection'], 'column' | 'column-reverse'>;
@@ -1,6 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { MessageManager } from '../message';
3
- import { NotificationKind, NotificationPosition } from './types';
2
+ import type { NotificationKind, NotificationPositionType } from './types';
4
3
  export interface NotificationComponentProps {
5
4
  /**
6
5
  * id값을 지정할 수 있습니다.
@@ -29,7 +28,6 @@ export interface NotificationComponentProps {
29
28
  onClose?: () => void;
30
29
  onClickLink?: () => void;
31
30
  destroy: () => void;
32
- position: NotificationPosition;
31
+ position: NotificationPositionType;
33
32
  }
34
33
  export declare const NotificationComponent: React.FC<NotificationComponentProps>;
35
- export declare const Notification: MessageManager<NotificationComponentProps>;
@@ -1,2 +1,3 @@
1
1
  export * from './Notification';
2
2
  export * from './types';
3
+ export * from './useNotification';
@@ -1,3 +1,3 @@
1
- import { NotificationKind, NotificationPosition } from './types';
1
+ import type { NotificationKind, NotificationPositionType } from './types';
2
2
  export declare const notification_kind_css: Record<NotificationKind, string>;
3
- export declare const notification_hide_animation: (position: NotificationPosition) => import("@emotion/serialize").Keyframes;
3
+ export declare const notification_hide_animation: (position: NotificationPositionType) => import("@emotion/serialize").Keyframes;
@@ -6,4 +6,4 @@ export declare const NotificationPosition: {
6
6
  readonly BOTTOM_CENTER: "bottom-center";
7
7
  readonly CENTER: "center";
8
8
  };
9
- export type NotificationPosition = typeof NotificationPosition[keyof typeof NotificationPosition];
9
+ export type NotificationPositionType = typeof NotificationPosition[keyof typeof NotificationPosition];
@@ -0,0 +1,3 @@
1
+ import { MessageManager } from '../message';
2
+ import { NotificationComponentProps } from './Notification';
3
+ export declare function useNotification(): MessageManager<NotificationComponentProps>;
@@ -1,5 +1,4 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { MessageManager } from '../message';
3
2
  import { ToastSize, ToastKind } from './types';
4
3
  export interface ToastComponentProps {
5
4
  /**
@@ -27,4 +26,3 @@ export interface ToastComponentProps {
27
26
  destroy: () => void;
28
27
  }
29
28
  export declare const ToastComponent: React.FC<ToastComponentProps>;
30
- export declare const Toast: MessageManager<ToastComponentProps>;
@@ -1,2 +1,3 @@
1
1
  export * from './Toast';
2
2
  export * from './types';
3
+ export * from './useToast';
@@ -8,5 +8,5 @@ export declare const ToastPosition: {
8
8
  readonly BOTTOM_CENTER: "bottom-center";
9
9
  readonly CENTER: "center";
10
10
  };
11
- export type ToastPosition = typeof ToastPosition[keyof typeof ToastPosition];
11
+ export type ToastPositionType = typeof ToastPosition[keyof typeof ToastPosition];
12
12
  export type ToastDirection = MessageDirection;
@@ -0,0 +1,3 @@
1
+ import { MessageManager } from '../message';
2
+ import { ToastComponentProps } from './Toast';
3
+ export declare function useToast(): MessageManager<ToastComponentProps>;