@paygreen/pgui 2.10.0 → 2.11.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 (28) hide show
  1. package/dist/cjs/index.js +318 -117
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/Card/index.d.ts +1 -0
  4. package/dist/cjs/types/components/ConfirmMenuItem/index.d.ts +12 -3
  5. package/dist/cjs/types/components/DayPicker/index.d.ts +1 -1
  6. package/dist/cjs/types/components/InputDayPicker/index.d.ts +2 -2
  7. package/dist/cjs/types/components/SearchInput/index.d.ts +12 -1
  8. package/dist/cjs/types/components/Select/index.d.ts +10 -10
  9. package/dist/cjs/types/components/Textarea/index.d.ts +6 -1
  10. package/dist/cjs/types/layout/BottomBar/index.d.ts +1 -0
  11. package/dist/cjs/types/layout/LayoutContainer/index.d.ts +1 -0
  12. package/dist/cjs/types/layout/TopBar/index.d.ts +1 -1
  13. package/dist/cjs/types/theme/theme.d.ts +1 -1
  14. package/dist/esm/index.js +319 -118
  15. package/dist/esm/index.js.map +1 -1
  16. package/dist/esm/types/components/Card/index.d.ts +1 -0
  17. package/dist/esm/types/components/ConfirmMenuItem/index.d.ts +12 -3
  18. package/dist/esm/types/components/DayPicker/index.d.ts +1 -1
  19. package/dist/esm/types/components/InputDayPicker/index.d.ts +2 -2
  20. package/dist/esm/types/components/SearchInput/index.d.ts +12 -1
  21. package/dist/esm/types/components/Select/index.d.ts +10 -10
  22. package/dist/esm/types/components/Textarea/index.d.ts +6 -1
  23. package/dist/esm/types/layout/BottomBar/index.d.ts +1 -0
  24. package/dist/esm/types/layout/LayoutContainer/index.d.ts +1 -0
  25. package/dist/esm/types/layout/TopBar/index.d.ts +1 -1
  26. package/dist/esm/types/theme/theme.d.ts +1 -1
  27. package/dist/index.d.ts +47 -30
  28. package/package.json +52 -51
@@ -1,2 +1,3 @@
1
1
  import React from 'react';
2
+ import { CardProps } from '@chakra-ui/react';
2
3
  export declare const Card: (props: CardProps) => React.JSX.Element;
@@ -1,4 +1,13 @@
1
- import { HTMLChakraProps } from '@chakra-ui/react';
1
+ import React from 'react';
2
+ import { HTMLChakraProps, MenuItemProps } from '@chakra-ui/react';
2
3
  export type StyledMenuItemProps = HTMLChakraProps<'button'>;
3
- export declare const MenuItem: any;
4
- export declare const ConfirmMenuItem: any;
4
+ export declare const MenuItem: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"button", MenuItemProps>;
5
+ type ConfirmMenuItemProps = MenuItemProps & {
6
+ confirmDelay?: number;
7
+ confirmColorScheme?: string;
8
+ confirmContent?: React.ReactNode;
9
+ confirmText?: React.ReactNode;
10
+ confirmIcon?: React.FC<React.PropsWithChildren<unknown>>;
11
+ };
12
+ export declare const ConfirmMenuItem: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"button", ConfirmMenuItemProps>;
13
+ export {};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import 'dayjs/locale/en';
3
3
  import 'dayjs/locale/fr';
4
4
  export type DayPickerProps = {
5
- defaultValue?: string | Date;
5
+ defaultValue?: string | Date | undefined;
6
6
  onChange: (e: string | undefined) => void;
7
7
  locale?: string;
8
8
  customFormat?: string;
@@ -1,6 +1,6 @@
1
1
  import React, { Dispatch, SetStateAction } from 'react';
2
2
  import { InputProps } from '@chakra-ui/react';
3
- export type InputDayPickerProps = {
3
+ export type InputDayPickerProps = Omit<InputProps, 'minDate' | 'maxDate' | 'defaultValue'> & {
4
4
  name: string;
5
5
  placeholder?: string;
6
6
  onChange: Dispatch<SetStateAction<string | undefined | null>>;
@@ -13,5 +13,5 @@ export type InputDayPickerProps = {
13
13
  maxDate?: Date | null | undefined;
14
14
  calendarFunc?: (date: any) => 'after-max-date' | 'before-min-date' | undefined;
15
15
  isDisabled?: boolean;
16
- } & InputProps;
16
+ };
17
17
  export declare const InputDayPicker: ({ name, placeholder, value, onChange, locale, variant, format, withTime, minDate, maxDate, calendarFunc, isDisabled, ...inputProps }: InputDayPickerProps) => React.JSX.Element;
@@ -1 +1,12 @@
1
- export declare const SearchInput: any;
1
+ import { InputProps } from '@chakra-ui/react';
2
+ type CustomProps = {
3
+ value?: string;
4
+ defaultValue?: string;
5
+ onChange?(value?: string): void;
6
+ delay?: number;
7
+ clearLabel?: string;
8
+ inputProps?: object;
9
+ };
10
+ type SearchInputProps = Overwrite<InputProps, CustomProps>;
11
+ export declare const SearchInput: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"input", SearchInputProps>;
12
+ export {};
@@ -25,26 +25,27 @@ export declare const Select: <Option, IsMulti extends boolean = false, Group ext
25
25
  defaultOptions?: unknown | boolean;
26
26
  debounceDelay?: number | undefined;
27
27
  variant?: "outline" | "filled" | undefined;
28
- } & Omit<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "aria-label" | "form" | "value" | "onChange" | "inputValue" | "theme" | "className" | "id" | "name" | "autoFocus" | "onFocus" | "onBlur" | "onKeyDown" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "required"> & {
28
+ } & Omit<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "aria-label" | "form" | "name" | "value" | "autoFocus" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "inputValue" | "theme" | "required" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
29
+ tabIndex?: number | undefined;
30
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
31
+ isLoading?: boolean | undefined;
29
32
  isDisabled?: boolean | undefined;
33
+ components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
30
34
  placeholder?: React.ReactNode;
31
35
  options?: import("react-select").OptionsOrGroups<Option, Group> | undefined;
32
36
  pageSize?: number | undefined;
33
- 'aria-live'?: "off" | "assertive" | "polite" | undefined;
34
37
  backspaceRemovesValue?: boolean | undefined;
35
38
  blurInputOnSelect?: boolean | undefined;
36
39
  captureMenuScroll?: boolean | undefined;
37
40
  classNames?: import("react-select").ClassNamesConfig<Option, IsMulti, Group> | undefined;
38
41
  closeMenuOnSelect?: boolean | undefined;
39
42
  closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
40
- components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
41
43
  controlShouldRenderValue?: boolean | undefined;
42
44
  escapeClearsValue?: boolean | undefined;
43
45
  filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
44
46
  formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
45
47
  getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
46
48
  getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
47
- isLoading?: boolean | undefined;
48
49
  isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
49
50
  isMulti?: IsMulti | undefined;
50
51
  isRtl?: boolean | undefined;
@@ -68,29 +69,29 @@ export declare const Select: <Option, IsMulti extends boolean = false, Group ext
68
69
  count: number;
69
70
  }) => string) | undefined;
70
71
  styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
71
- tabIndex?: number | undefined;
72
72
  tabSelectsValue?: boolean | undefined;
73
73
  unstyled?: boolean | undefined;
74
- } & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "aria-label" | "form" | "value" | "onChange" | "inputValue" | "theme" | "className" | "id" | "name" | "autoFocus" | "onFocus" | "onBlur" | "onKeyDown" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "required"> & {
74
+ } & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "aria-label" | "form" | "name" | "value" | "autoFocus" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "inputValue" | "theme" | "required" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
75
+ tabIndex?: number | undefined;
76
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
77
+ isLoading?: boolean | undefined;
75
78
  isDisabled?: boolean | undefined;
79
+ components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
76
80
  placeholder?: React.ReactNode;
77
81
  options?: import("react-select").OptionsOrGroups<Option, Group> | undefined;
78
82
  pageSize?: number | undefined;
79
- 'aria-live'?: "off" | "assertive" | "polite" | undefined;
80
83
  backspaceRemovesValue?: boolean | undefined;
81
84
  blurInputOnSelect?: boolean | undefined;
82
85
  captureMenuScroll?: boolean | undefined;
83
86
  classNames?: import("react-select").ClassNamesConfig<Option, IsMulti, Group> | undefined;
84
87
  closeMenuOnSelect?: boolean | undefined;
85
88
  closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
86
- components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
87
89
  controlShouldRenderValue?: boolean | undefined;
88
90
  escapeClearsValue?: boolean | undefined;
89
91
  filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
90
92
  formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
91
93
  getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
92
94
  getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
93
- isLoading?: boolean | undefined;
94
95
  isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
95
96
  isMulti?: IsMulti | undefined;
96
97
  isRtl?: boolean | undefined;
@@ -114,7 +115,6 @@ export declare const Select: <Option, IsMulti extends boolean = false, Group ext
114
115
  count: number;
115
116
  }) => string) | undefined;
116
117
  styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
117
- tabIndex?: number | undefined;
118
118
  tabSelectsValue?: boolean | undefined;
119
119
  unstyled?: boolean | undefined;
120
120
  } & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<Option> & Omit<BoxProps, "defaultValue"> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
@@ -1,3 +1,8 @@
1
1
  import React from 'react';
2
2
  import { TextareaProps } from '@chakra-ui/react';
3
- export declare const Textarea: ({ onFocus, onBlur, onMouseEnter, onMouseLeave, variant, borderRadius, ...rest }: any) => React.JSX.Element;
3
+ export declare const Textarea: ({ onFocus, onBlur, onMouseEnter, onMouseLeave, variant, borderRadius, ...rest }: TextareaProps & {
4
+ onFocus?: (() => void) | undefined;
5
+ onBlur?: (() => void) | undefined;
6
+ onMouseEnter?: (() => void) | undefined;
7
+ onMouseLeave?: (() => void) | undefined;
8
+ }) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
1
  import React from 'react';
2
+ import { FlexProps } from '@chakra-ui/react';
2
3
  export declare const BottomBar: (props: FlexProps) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
1
  import React from 'react';
2
+ import { FlexProps } from '@chakra-ui/react';
2
3
  export declare const LayoutContainer: (props: FlexProps) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React, { ReactComponentElement } from 'react';
2
- import { FlexProps } from '@chakra-ui/react';
2
+ import { FlexProps, StackProps } from '@chakra-ui/react';
3
3
  export type TopBarBackActionProps = {
4
4
  backAction?: () => void;
5
5
  rightInformation?: ReactComponentElement<any>;
@@ -1 +1 @@
1
- export declare const theme: any;
1
+ export declare const theme: Record<string, any>;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import React, { FC, PropsWithChildren, ReactNode, Dispatch, SetStateAction, ReactComponentElement } from 'react';
2
- import { IconButtonProps, HTMLChakraProps, FlexProps as FlexProps$1, AccordionProps, FormControlProps, InputProps, ModalProps, DrawerProps, StackProps as StackProps$1, BoxProps, DrawerContentProps, ButtonProps, TextProps } from '@chakra-ui/react';
2
+ import { IconButtonProps, CardProps, HTMLChakraProps, MenuItemProps, FlexProps, AccordionProps, FormControlProps, InputProps, ModalProps, DrawerProps, StackProps, BoxProps, DrawerContentProps, ButtonProps, TextProps } from '@chakra-ui/react';
3
+ import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
3
4
  import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
4
5
  import * as react_select_dist_declarations_src_useStateManager from 'react-select/dist/declarations/src/useStateManager';
5
6
  import * as react_select_dist_declarations_src_filters from 'react-select/dist/declarations/src/filters';
6
- import * as react_select_dist_declarations_src_components from 'react-select/dist/declarations/src/components';
7
7
  import * as react_select from 'react-select';
8
8
  import { GroupBase, Props } from 'react-select';
9
+ import * as react_select_dist_declarations_src_components from 'react-select/dist/declarations/src/components';
9
10
  import * as react_select_dist_declarations_src_Select from 'react-select/dist/declarations/src/Select';
10
11
 
11
12
  type ActionsButtonProps = Omit<IconButtonProps, 'aria-label'> & {
@@ -16,8 +17,15 @@ declare const ActionsButton: FC<PropsWithChildren<ActionsButtonProps>>;
16
17
  declare const Card: (props: CardProps) => React.JSX.Element;
17
18
 
18
19
  type StyledMenuItemProps = HTMLChakraProps<'button'>;
19
- declare const MenuItem: any;
20
- declare const ConfirmMenuItem: any;
20
+ declare const MenuItem: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", MenuItemProps>;
21
+ type ConfirmMenuItemProps = MenuItemProps & {
22
+ confirmDelay?: number;
23
+ confirmColorScheme?: string;
24
+ confirmContent?: React.ReactNode;
25
+ confirmText?: React.ReactNode;
26
+ confirmIcon?: React.FC<React.PropsWithChildren<unknown>>;
27
+ };
28
+ declare const ConfirmMenuItem: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", ConfirmMenuItemProps>;
21
29
 
22
30
  type DataListColumns = Record<string, DataListCellProps>;
23
31
  type DataListContextValue = {
@@ -27,7 +35,7 @@ type DataListContextValue = {
27
35
  };
28
36
  declare const DataListContext: React.Context<DataListContextValue>;
29
37
  declare const DataListHeaderContext: React.Context<boolean>;
30
- type DataListCellProps = FlexProps$1 & {
38
+ type DataListCellProps = FlexProps & {
31
39
  colName?: string;
32
40
  colWidth?: string | number | Record<string, string | number>;
33
41
  isVisible?: boolean | boolean[] | Record<string, boolean>;
@@ -45,7 +53,7 @@ declare const DataListAccordionIcon: ({ ...rest }: {
45
53
  declare const DataListAccordionPanel: ({ ...rest }: {
46
54
  [x: string]: any;
47
55
  }) => React.JSX.Element;
48
- type DataListRowProps = FlexProps$1 & {
56
+ type DataListRowProps = FlexProps & {
49
57
  isVisible?: boolean | boolean[] | Record<string, boolean>;
50
58
  isDisabled?: boolean;
51
59
  };
@@ -60,7 +68,7 @@ type DataListProps = AccordionProps & {
60
68
  declare const DataList: FC<PropsWithChildren<DataListProps>>;
61
69
 
62
70
  type DayPickerProps = {
63
- defaultValue?: string | Date;
71
+ defaultValue?: string | Date | undefined;
64
72
  onChange: (e: string | undefined) => void;
65
73
  locale?: string;
66
74
  customFormat?: string;
@@ -83,7 +91,7 @@ type FormGroupProps = Omit<FormControlProps, 'onChange' | 'defaultValue' | 'labe
83
91
  };
84
92
  declare const FormGroup: ({ children, errorMessage, helper, id, isRequired, label, showError, ...props }: FormGroupProps) => React.JSX.Element;
85
93
 
86
- type InputDayPickerProps = {
94
+ type InputDayPickerProps = Omit<InputProps, 'minDate' | 'maxDate' | 'defaultValue'> & {
87
95
  name: string;
88
96
  placeholder?: string;
89
97
  onChange: Dispatch<SetStateAction<string | undefined | null>>;
@@ -96,7 +104,7 @@ type InputDayPickerProps = {
96
104
  maxDate?: Date | null | undefined;
97
105
  calendarFunc?: (date: any) => 'after-max-date' | 'before-min-date' | undefined;
98
106
  isDisabled?: boolean;
99
- } & InputProps;
107
+ };
100
108
  declare const InputDayPicker: ({ name, placeholder, value, onChange, locale, variant, format, withTime, minDate, maxDate, calendarFunc, isDisabled, ...inputProps }: InputDayPickerProps) => React.JSX.Element;
101
109
 
102
110
  var css_248z = "/* CSS variables. */\r\n:root {\r\n\t--PhoneInput-color--focus: #03b2cb;\r\n\t--PhoneInputInternationalIconPhone-opacity: 0.8;\r\n\t--PhoneInputInternationalIconGlobe-opacity: 0.65;\r\n\t--PhoneInputCountrySelect-marginRight: 0.35em;\r\n\t--PhoneInputCountrySelectArrow-width: 0.3em;\r\n\t--PhoneInputCountrySelectArrow-marginLeft: var(--PhoneInputCountrySelect-marginRight);\r\n\t--PhoneInputCountrySelectArrow-borderWidth: 1px;\r\n\t--PhoneInputCountrySelectArrow-opacity: 0.45;\r\n\t--PhoneInputCountrySelectArrow-color: currentColor;\r\n\t--PhoneInputCountrySelectArrow-color--focus: var(--PhoneInput-color--focus);\r\n\t--PhoneInputCountrySelectArrow-transform: rotate(45deg);\r\n\t--PhoneInputCountryFlag-aspectRatio: 1.5;\r\n\t--PhoneInputCountryFlag-height: 1em;\r\n\t--PhoneInputCountryFlag-borderWidth: 1px;\r\n\t--PhoneInputCountryFlag-borderColor: rgba(0,0,0,0.5);\r\n\t--PhoneInputCountryFlag-borderColor--focus: var(--PhoneInput-color--focus);\r\n\t--PhoneInputCountryFlag-backgroundColor--loading: rgba(0,0,0,0.1);\r\n}\r\n\r\n.PhoneInput {\r\n\t/* This is done to stretch the contents of this component. */\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n}\r\n\r\n.PhoneInputInput {\r\n\t/* The phone number input stretches to fill all empty space */\r\n\tflex: 1;\r\n\t/* The phone number input should shrink\r\n\t to make room for the extension input */\r\n\tmin-width: 0;\r\n}\r\n\r\n.PhoneInputCountryIcon {\r\n\twidth: calc(var(--PhoneInputCountryFlag-height) * var(--PhoneInputCountryFlag-aspectRatio));\r\n\theight: var(--PhoneInputCountryFlag-height);\r\n}\r\n\r\n.PhoneInputCountryIcon--square {\r\n\twidth: var(--PhoneInputCountryFlag-height);\r\n}\r\n\r\n.PhoneInputCountryIcon--border {\r\n\t/* Removed `background-color` because when an `<img/>` was still loading\r\n\t it would show a dark gray rectangle. */\r\n\t/* For some reason the `<img/>` is not stretched to 100% width and height\r\n\t and sometime there can be seen white pixels of the background at top and bottom. */\r\n\tbackground-color: var(--PhoneInputCountryFlag-backgroundColor--loading);\r\n\t/* Border is added via `box-shadow` because `border` interferes with `width`/`height`. */\r\n\t/* For some reason the `<img/>` is not stretched to 100% width and height\r\n\t and sometime there can be seen white pixels of the background at top and bottom,\r\n\t so an additional \"inset\" border is added. */\r\n\tbox-shadow: 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor),\r\n\t\tinset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor);\r\n}\r\n\r\n.PhoneInputCountryIconImg {\r\n\t/* Fixes weird vertical space above the flag icon. */\r\n\t/* https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/7#note_348586559 */\r\n\tdisplay: block;\r\n\t/* 3rd party <SVG/> flag icons won't stretch if they have `width` and `height`.\r\n\t Also, if an <SVG/> icon's aspect ratio was different, it wouldn't fit too. */\r\n\twidth: 100%;\r\n\theight: 100%;\r\n}\r\n\r\n.PhoneInputInternationalIconPhone {\r\n\topacity: var(--PhoneInputInternationalIconPhone-opacity);\r\n}\r\n\r\n.PhoneInputInternationalIconGlobe {\r\n\topacity: var(--PhoneInputInternationalIconGlobe-opacity);\r\n}\r\n\r\n/* Styling native country `<select/>`. */\r\n\r\n.PhoneInputCountry {\r\n\tposition: relative;\r\n\talign-self: stretch;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tmargin-right: var(--PhoneInputCountrySelect-marginRight);\r\n}\r\n\r\n.PhoneInputCountrySelect {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\theight: 100%;\r\n\twidth: 100%;\r\n\tz-index: 1;\r\n\tborder: 0;\r\n\topacity: 0;\r\n\tcursor: pointer;\r\n}\r\n\r\n.PhoneInputCountrySelect[disabled],\r\n.PhoneInputCountrySelect[readonly] {\r\n\tcursor: default;\r\n}\r\n\r\n.PhoneInputCountrySelectArrow {\r\n\tdisplay: block;\r\n\tcontent: '';\r\n\twidth: var(--PhoneInputCountrySelectArrow-width);\r\n\theight: var(--PhoneInputCountrySelectArrow-width);\r\n\tmargin-left: var(--PhoneInputCountrySelectArrow-marginLeft);\r\n\tborder-style: solid;\r\n\tborder-color: var(--PhoneInputCountrySelectArrow-color);\r\n\tborder-top-width: 0;\r\n\tborder-bottom-width: var(--PhoneInputCountrySelectArrow-borderWidth);\r\n\tborder-left-width: 0;\r\n\tborder-right-width: var(--PhoneInputCountrySelectArrow-borderWidth);\r\n\ttransform: var(--PhoneInputCountrySelectArrow-transform);\r\n\topacity: var(--PhoneInputCountrySelectArrow-opacity);\r\n}\r\n\r\n.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon + .PhoneInputCountrySelectArrow {\r\n\topacity: 1;\r\n\tcolor: var(--PhoneInputCountrySelectArrow-color--focus);\r\n}\r\n\r\n.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon--border {\r\n\tbox-shadow: 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus),\r\n\t\tinset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus);\r\n}\r\n\r\n.PhoneInputCountrySelect:focus + .PhoneInputCountryIcon .PhoneInputInternationalIconGlobe {\r\n\topacity: 1;\r\n\tcolor: var(--PhoneInputCountrySelectArrow-color--focus);\r\n}";
@@ -166,7 +174,7 @@ declare const PaginationButtonNextPage: FC<PropsWithChildren<Omit<IconButtonProp
166
174
  declare const PaginationInfo: ({ ...rest }: {
167
175
  [x: string]: any;
168
176
  }) => React.JSX.Element;
169
- type PaginationProps = StackProps$1 & {
177
+ type PaginationProps = StackProps & {
170
178
  setPage: (page: number) => void;
171
179
  page?: number;
172
180
  pageSize?: number;
@@ -175,7 +183,16 @@ type PaginationProps = StackProps$1 & {
175
183
  };
176
184
  declare const Pagination: ({ setPage, page, pageSize, totalItems, isLoadingPage, children, ...rest }: PaginationProps) => React.JSX.Element;
177
185
 
178
- declare const SearchInput: any;
186
+ type CustomProps = {
187
+ value?: string;
188
+ defaultValue?: string;
189
+ onChange?(value?: string): void;
190
+ delay?: number;
191
+ clearLabel?: string;
192
+ inputProps?: object;
193
+ };
194
+ type SearchInputProps = Overwrite<InputProps, CustomProps>;
195
+ declare const SearchInput: _chakra_ui_system_dist_system_types.ComponentWithAs<"input", SearchInputProps>;
179
196
 
180
197
  declare module 'react' {
181
198
  function forwardRef<T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
@@ -201,26 +218,27 @@ declare const Select: <Option, IsMulti extends boolean = false, Group extends Gr
201
218
  defaultOptions?: unknown | boolean;
202
219
  debounceDelay?: number | undefined;
203
220
  variant?: "outline" | "filled" | undefined;
204
- } & Omit<Pick<react_select_dist_declarations_src_Select.Props<Option, IsMulti, Group>, "aria-label" | "form" | "value" | "onChange" | "inputValue" | "theme" | "className" | "id" | "name" | "autoFocus" | "onFocus" | "onBlur" | "onKeyDown" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "required"> & {
221
+ } & Omit<Pick<react_select_dist_declarations_src_Select.Props<Option, IsMulti, Group>, "aria-label" | "form" | "name" | "value" | "autoFocus" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "inputValue" | "theme" | "required" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
222
+ tabIndex?: number | undefined;
223
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
224
+ isLoading?: boolean | undefined;
205
225
  isDisabled?: boolean | undefined;
226
+ components?: Partial<react_select_dist_declarations_src_components.SelectComponents<Option, IsMulti, Group>> | undefined;
206
227
  placeholder?: React.ReactNode;
207
228
  options?: react_select.OptionsOrGroups<Option, Group> | undefined;
208
229
  pageSize?: number | undefined;
209
- 'aria-live'?: "off" | "assertive" | "polite" | undefined;
210
230
  backspaceRemovesValue?: boolean | undefined;
211
231
  blurInputOnSelect?: boolean | undefined;
212
232
  captureMenuScroll?: boolean | undefined;
213
233
  classNames?: react_select.ClassNamesConfig<Option, IsMulti, Group> | undefined;
214
234
  closeMenuOnSelect?: boolean | undefined;
215
235
  closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
216
- components?: Partial<react_select_dist_declarations_src_components.SelectComponents<Option, IsMulti, Group>> | undefined;
217
236
  controlShouldRenderValue?: boolean | undefined;
218
237
  escapeClearsValue?: boolean | undefined;
219
238
  filterOption?: ((option: react_select_dist_declarations_src_filters.FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
220
239
  formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
221
240
  getOptionLabel?: react_select.GetOptionLabel<Option> | undefined;
222
241
  getOptionValue?: react_select.GetOptionValue<Option> | undefined;
223
- isLoading?: boolean | undefined;
224
242
  isOptionDisabled?: ((option: Option, selectValue: react_select.Options<Option>) => boolean) | undefined;
225
243
  isMulti?: IsMulti | undefined;
226
244
  isRtl?: boolean | undefined;
@@ -244,29 +262,29 @@ declare const Select: <Option, IsMulti extends boolean = false, Group extends Gr
244
262
  count: number;
245
263
  }) => string) | undefined;
246
264
  styles?: react_select.StylesConfig<Option, IsMulti, Group> | undefined;
247
- tabIndex?: number | undefined;
248
265
  tabSelectsValue?: boolean | undefined;
249
266
  unstyled?: boolean | undefined;
250
- } & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<react_select_dist_declarations_src_Select.Props<Option, IsMulti, Group>, "aria-label" | "form" | "value" | "onChange" | "inputValue" | "theme" | "className" | "id" | "name" | "autoFocus" | "onFocus" | "onBlur" | "onKeyDown" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "required"> & {
267
+ } & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<react_select_dist_declarations_src_Select.Props<Option, IsMulti, Group>, "aria-label" | "form" | "name" | "value" | "autoFocus" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "inputValue" | "theme" | "required" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
268
+ tabIndex?: number | undefined;
269
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
270
+ isLoading?: boolean | undefined;
251
271
  isDisabled?: boolean | undefined;
272
+ components?: Partial<react_select_dist_declarations_src_components.SelectComponents<Option, IsMulti, Group>> | undefined;
252
273
  placeholder?: React.ReactNode;
253
274
  options?: react_select.OptionsOrGroups<Option, Group> | undefined;
254
275
  pageSize?: number | undefined;
255
- 'aria-live'?: "off" | "assertive" | "polite" | undefined;
256
276
  backspaceRemovesValue?: boolean | undefined;
257
277
  blurInputOnSelect?: boolean | undefined;
258
278
  captureMenuScroll?: boolean | undefined;
259
279
  classNames?: react_select.ClassNamesConfig<Option, IsMulti, Group> | undefined;
260
280
  closeMenuOnSelect?: boolean | undefined;
261
281
  closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
262
- components?: Partial<react_select_dist_declarations_src_components.SelectComponents<Option, IsMulti, Group>> | undefined;
263
282
  controlShouldRenderValue?: boolean | undefined;
264
283
  escapeClearsValue?: boolean | undefined;
265
284
  filterOption?: ((option: react_select_dist_declarations_src_filters.FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
266
285
  formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
267
286
  getOptionLabel?: react_select.GetOptionLabel<Option> | undefined;
268
287
  getOptionValue?: react_select.GetOptionValue<Option> | undefined;
269
- isLoading?: boolean | undefined;
270
288
  isOptionDisabled?: ((option: Option, selectValue: react_select.Options<Option>) => boolean) | undefined;
271
289
  isMulti?: IsMulti | undefined;
272
290
  isRtl?: boolean | undefined;
@@ -290,7 +308,6 @@ declare const Select: <Option, IsMulti extends boolean = false, Group extends Gr
290
308
  count: number;
291
309
  }) => string) | undefined;
292
310
  styles?: react_select.StylesConfig<Option, IsMulti, Group> | undefined;
293
- tabIndex?: number | undefined;
294
311
  tabSelectsValue?: boolean | undefined;
295
312
  unstyled?: boolean | undefined;
296
313
  } & {}> & react_select_dist_declarations_src_useStateManager.StateManagerAdditionalProps<Option> & Omit<BoxProps, "defaultValue"> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
@@ -302,31 +319,31 @@ declare const LayoutContainer: (props: FlexProps) => React.JSX.Element;
302
319
  type SideNavProps = {
303
320
  isMobileMenuOpen: boolean;
304
321
  onMobileMenuClose: () => void;
305
- } & FlexProps$1 & DrawerContentProps;
322
+ } & FlexProps & DrawerContentProps;
306
323
  type SideNavMenuItemProps = {
307
324
  isActive?: boolean;
308
325
  } & ButtonProps;
309
326
  type SideNavMenuProps = {
310
327
  textProps?: TextProps;
311
- } & StackProps$1;
328
+ } & StackProps;
312
329
  declare const SideNav: ({ isMobileMenuOpen, onMobileMenuClose, children, ...props }: SideNavProps) => React.JSX.Element;
313
- declare const SideNavContainer: (props: StackProps$1) => React.JSX.Element;
314
- declare const SideNavHeader: ({ children, ...rest }: FlexProps$1) => React.JSX.Element;
315
- declare const SideNavBody: ({ children, ...rest }: StackProps$1) => React.JSX.Element;
316
- declare const SideNavFooter: ({ children, ...rest }: FlexProps$1) => React.JSX.Element;
330
+ declare const SideNavContainer: (props: StackProps) => React.JSX.Element;
331
+ declare const SideNavHeader: ({ children, ...rest }: FlexProps) => React.JSX.Element;
332
+ declare const SideNavBody: ({ children, ...rest }: StackProps) => React.JSX.Element;
333
+ declare const SideNavFooter: ({ children, ...rest }: FlexProps) => React.JSX.Element;
317
334
  declare const SideNavMenu: ({ title, children, textProps, ...rest }: SideNavMenuProps) => React.JSX.Element;
318
335
  declare const SideNavMenuItem: ({ isActive, children, ...rest }: SideNavMenuItemProps) => React.JSX.Element;
319
336
 
320
337
  type TopBarBackActionProps = {
321
338
  backAction?: () => void;
322
339
  rightInformation?: ReactComponentElement<any>;
323
- } & FlexProps$1;
340
+ } & FlexProps;
324
341
  declare const TopBar: (props: StackProps) => React.JSX.Element;
325
- declare const TopBarFirstElement: (props: FlexProps$1) => React.JSX.Element;
342
+ declare const TopBarFirstElement: (props: FlexProps) => React.JSX.Element;
326
343
  declare const TopBarLastElement: (props: StackProps) => React.JSX.Element;
327
344
  declare const TopBarBackAction: ({ backAction, title, rightInformation, ...rest }: TopBarBackActionProps) => React.JSX.Element;
328
345
 
329
- declare const theme: any;
346
+ declare const theme: Record<string, any>;
330
347
 
331
348
  declare const dateFormat = "dd/MM/yyyy";
332
349
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paygreen/pgui",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "PGUI is the design system coming from Paygreen.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -44,74 +44,75 @@
44
44
  },
45
45
  "homepage": "https://gitlab.com/Paygreen-paygreen/v3/pgui#readme",
46
46
  "devDependencies": {
47
- "@babel/core": "^7.18.6",
48
- "@babel/plugin-transform-runtime": "^7.18.6",
49
- "@babel/preset-env": "^7.18.6",
50
- "@babel/preset-react": "^7.18.6",
51
- "@babel/preset-typescript": "^7.18.6",
52
- "@chakra-ui/theme-tools": "^2.0.14",
53
- "@emotion/react": "^11.9.3",
54
- "@emotion/styled": "^11.9.3",
55
- "@rollup/plugin-commonjs": "^22.0.1",
47
+ "@babel/core": "^7.23.7",
48
+ "@babel/plugin-transform-runtime": "^7.23.7",
49
+ "@babel/preset-env": "^7.23.8",
50
+ "@babel/preset-react": "^7.23.3",
51
+ "@babel/preset-typescript": "^7.23.3",
52
+ "@chakra-ui/react": "^2.8.2",
53
+ "@chakra-ui/theme-tools": "^2.1.2",
54
+ "@emotion/react": "^11.11.3",
55
+ "@emotion/styled": "^11.11.0",
56
+ "@rollup/plugin-commonjs": "^22.0.2",
56
57
  "@rollup/plugin-node-resolve": "^13.3.0",
57
- "@rollup/plugin-typescript": "11.1.4",
58
- "@storybook/addon-actions": "^7.4.0",
59
- "@storybook/addon-docs": "^7.4.0",
60
- "@storybook/addon-essentials": "^7.4.0",
61
- "@storybook/addon-interactions": "^7.4.0",
62
- "@storybook/addon-links": "^7.4.0",
63
- "@storybook/react": "^7.4.0",
64
- "@storybook/react-webpack5": "^7.4.0",
65
- "@storybook/testing-library": "^0.2.1-next.0",
66
- "@trivago/prettier-plugin-sort-imports": "^4.2.1",
67
- "@types/react": "^18.0.26",
68
- "@typescript-eslint/eslint-plugin": "^5.30.6",
69
- "@typescript-eslint/parser": "^5.30.6",
58
+ "@rollup/plugin-typescript": "11.1.5",
59
+ "@storybook/addon-actions": "^7.6.7",
60
+ "@storybook/addon-docs": "^7.6.7",
61
+ "@storybook/addon-essentials": "^7.6.7",
62
+ "@storybook/addon-interactions": "^7.6.7",
63
+ "@storybook/addon-links": "^7.6.7",
64
+ "@storybook/react": "^7.6.7",
65
+ "@storybook/react-webpack5": "^7.6.7",
66
+ "@storybook/testing-library": "^0.2.2",
67
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
68
+ "@types/react": "^18.2.47",
69
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
70
+ "@typescript-eslint/parser": "^5.62.0",
70
71
  "babel-jest": "^26.6.3",
71
- "babel-loader": "^8.1.0",
72
- "babel-plugin-import": "^1.13.5",
72
+ "babel-loader": "^8.3.0",
73
+ "babel-plugin-import": "^1.13.8",
73
74
  "babel-plugin-module-resolver": "^5.0.0",
74
- "css-loader": "^5.0.1",
75
- "date-fns": "^2.29.3",
76
- "dayjs": "^1.11.7",
75
+ "css-loader": "^5.2.7",
76
+ "date-fns": "^2.30.0",
77
+ "dayjs": "^1.11.10",
77
78
  "dotenv-webpack": "^8.0.1",
78
- "eslint": "^8.20.0",
79
+ "eslint": "^8.56.0",
79
80
  "eslint-config-airbnb-base": "^15.0.0",
80
- "eslint-config-airbnb-typescript": "^17.0.0",
81
- "eslint-config-prettier": "^8.5.0",
82
- "eslint-import-resolver-typescript": "^3.2.7",
83
- "eslint-plugin-import": "^2.26.0",
84
- "eslint-plugin-jsx-a11y": "^6.6.1",
81
+ "eslint-config-airbnb-typescript": "^17.1.0",
82
+ "eslint-config-prettier": "^8.10.0",
83
+ "eslint-import-resolver-typescript": "^3.6.1",
84
+ "eslint-plugin-import": "^2.29.1",
85
+ "eslint-plugin-jsx-a11y": "^6.8.0",
85
86
  "eslint-plugin-prettier": "^4.2.1",
86
- "eslint-plugin-react": "^7.30.1",
87
+ "eslint-plugin-react": "^7.33.2",
87
88
  "eslint-plugin-react-hooks": "^4.6.0",
88
- "eslint-plugin-storybook": "^0.6.8",
89
+ "eslint-plugin-storybook": "^0.6.15",
89
90
  "framer-motion": "4.1.17",
90
- "husky": "^8.0.2",
91
- "lint-staged": "^13.0.3",
92
- "postcss": "^8.4.19",
93
- "prettier": "^2.7.1",
94
- "react-calendar": "^4.0.0",
95
- "react-day-picker": "^8.3.7",
91
+ "husky": "^8.0.3",
92
+ "lint-staged": "^13.3.0",
93
+ "postcss": "^8.4.33",
94
+ "prettier": "^2.8.8",
95
+ "react-calendar": "^4.7.0",
96
+ "react-day-picker": "^8.10.0",
96
97
  "react-dom": "^18.2.0",
97
- "react-focus-lock": "^2.9.2",
98
- "react-icons": "^4.4.0",
98
+ "react-focus-lock": "^2.9.6",
99
+ "react-icons": "^4.12.0",
99
100
  "react-input-mask": "^3.0.0-alpha.2",
100
- "react-phone-number-input": "^3.2.13",
101
- "react-select": "^5.4.0",
101
+ "react-phone-number-input": "^3.3.9",
102
+ "react-select": "^5.8.0",
102
103
  "relative-deps": "^0.0.2",
103
- "rollup": "^2.77.0",
104
- "rollup-plugin-dts": "^4.2.2",
104
+ "rollup": "^2.79.1",
105
+ "rollup-plugin-dts": "^4.2.3",
105
106
  "rollup-plugin-node-externals": "^4.1.1",
106
107
  "rollup-plugin-peer-deps-external": "^2.2.4",
107
108
  "rollup-plugin-postcss": "^4.0.2",
108
109
  "rollup-plugin-terser": "^7.0.2",
109
- "sass": "^1.53.0",
110
+ "sass": "^1.69.7",
110
111
  "sass-loader": "^12.6.0",
111
- "storybook": "^7.4.0",
112
+ "storybook": "^7.6.7",
112
113
  "style-loader": "^2.0.0",
113
114
  "tslib": "^2.6.2",
114
- "typescript": "^4.7.4"
115
+ "typescript": "^4.9.5"
115
116
  },
116
117
  "relativeDependencies": {}
117
118
  }