@paygreen/pgui 2.1.0 → 2.1.3

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 (53) hide show
  1. package/README.md +38 -22
  2. package/dist/cjs/index.js +50728 -2677
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/components/DataList/index.d.ts +8 -1
  5. package/dist/cjs/types/components/DayPicker/index.d.ts +3 -0
  6. package/dist/cjs/types/components/InputDayPicker/index.d.ts +16 -0
  7. package/dist/cjs/types/components/SearchInput/index.d.ts +11 -0
  8. package/dist/cjs/types/components/Select/index.d.ts +116 -0
  9. package/dist/cjs/types/components/index.d.ts +4 -0
  10. package/dist/cjs/types/index.d.ts +2 -0
  11. package/dist/cjs/types/layout/TopBar/index.d.ts +10 -0
  12. package/dist/cjs/types/layout/index.d.ts +1 -0
  13. package/dist/cjs/types/theme/components/{Badge.d.ts → badge.d.ts} +2 -1
  14. package/dist/{esm/types/theme/components/Button.d.ts → cjs/types/theme/components/button.d.ts} +2 -7
  15. package/dist/cjs/types/theme/components/index.d.ts +4 -0
  16. package/dist/{esm/types/theme/components/Input.d.ts → cjs/types/theme/components/input.d.ts} +2 -1
  17. package/dist/{esm/types/theme/components/Tag.d.ts → cjs/types/theme/components/tag.d.ts} +2 -1
  18. package/dist/cjs/types/theme/externals/index.d.ts +1 -0
  19. package/dist/cjs/types/theme/externals/reactDayPicker.d.ts +2 -0
  20. package/dist/cjs/types/theme/externals-css.d.ts +1 -0
  21. package/dist/cjs/types/theme/foundations/colors.d.ts +1 -0
  22. package/dist/cjs/types/theme/foundations/index.d.ts +87 -0
  23. package/dist/cjs/types/theme/index.d.ts +2 -1
  24. package/dist/cjs/types/theme/styles.d.ts +2 -0
  25. package/dist/cjs/types/theme/theme.d.ts +1 -0
  26. package/dist/cjs/types/utils/date.d.ts +1 -0
  27. package/dist/esm/index.js +50699 -2679
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/types/components/DataList/index.d.ts +8 -1
  30. package/dist/esm/types/components/DayPicker/index.d.ts +3 -0
  31. package/dist/esm/types/components/InputDayPicker/index.d.ts +16 -0
  32. package/dist/esm/types/components/SearchInput/index.d.ts +11 -0
  33. package/dist/esm/types/components/Select/index.d.ts +116 -0
  34. package/dist/esm/types/components/index.d.ts +4 -0
  35. package/dist/esm/types/index.d.ts +2 -0
  36. package/dist/esm/types/layout/TopBar/index.d.ts +10 -0
  37. package/dist/esm/types/layout/index.d.ts +1 -0
  38. package/dist/esm/types/theme/components/{Badge.d.ts → badge.d.ts} +2 -1
  39. package/dist/{cjs/types/theme/components/Button.d.ts → esm/types/theme/components/button.d.ts} +2 -7
  40. package/dist/esm/types/theme/components/index.d.ts +4 -0
  41. package/dist/{cjs/types/theme/components/Input.d.ts → esm/types/theme/components/input.d.ts} +2 -1
  42. package/dist/{cjs/types/theme/components/Tag.d.ts → esm/types/theme/components/tag.d.ts} +2 -1
  43. package/dist/esm/types/theme/externals/index.d.ts +1 -0
  44. package/dist/esm/types/theme/externals/reactDayPicker.d.ts +2 -0
  45. package/dist/esm/types/theme/externals-css.d.ts +1 -0
  46. package/dist/esm/types/theme/foundations/colors.d.ts +1 -0
  47. package/dist/esm/types/theme/foundations/index.d.ts +87 -0
  48. package/dist/esm/types/theme/index.d.ts +2 -1
  49. package/dist/esm/types/theme/styles.d.ts +2 -0
  50. package/dist/esm/types/theme/theme.d.ts +1 -0
  51. package/dist/esm/types/utils/date.d.ts +1 -0
  52. package/dist/index.d.ts +170 -4
  53. package/package.json +14 -8
@@ -1,6 +1,12 @@
1
1
  import React, { FC } from 'react';
2
2
  import { AccordionProps, FlexProps } from '@chakra-ui/react';
3
- export declare const DataListContext: React.Context<any>;
3
+ declare type DataListColumns = Record<string, DataListCellProps>;
4
+ declare type DataListContextValue = {
5
+ setColumns: React.Dispatch<React.SetStateAction<DataListColumns>>;
6
+ columns: DataListColumns;
7
+ isHover: boolean;
8
+ };
9
+ export declare const DataListContext: React.Context<DataListContextValue>;
4
10
  export declare const DataListHeaderContext: React.Context<boolean>;
5
11
  export declare type DataListCellProps = FlexProps & {
6
12
  colName?: string;
@@ -33,3 +39,4 @@ export declare type DataListProps = AccordionProps & {
33
39
  isHover?: boolean;
34
40
  };
35
41
  export declare const DataList: FC<React.PropsWithChildren<DataListProps>>;
42
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { DayPickerProps } from 'react-day-picker';
3
+ export declare const DayPicker: (props: DayPickerProps) => JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { InputProps, PopoverProps } from '@chakra-ui/react';
3
+ import { DayPickerSingleProps, DaySelectionMode } from 'react-day-picker';
4
+ export declare type SingleDayPickerProps = {
5
+ mode?: DaySelectionMode;
6
+ } & DayPickerSingleProps;
7
+ export declare type InputDayPickerProps = {
8
+ isDisabled?: boolean;
9
+ popoverProps?: PopoverProps;
10
+ inputProps?: InputProps;
11
+ dayPickerProps?: SingleDayPickerProps;
12
+ dateFormat?: string;
13
+ value?: string | '';
14
+ onChange?: Dispatch<SetStateAction<string | undefined>>;
15
+ };
16
+ export declare const InputDayPicker: ({ isDisabled, popoverProps, inputProps, dayPickerProps, dateFormat, value, onChange, }: InputDayPickerProps) => JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { InputProps } from '@chakra-ui/react';
2
+ declare type CustomProps = {
3
+ value?: string;
4
+ defaultValue?: string;
5
+ onChange?(value?: string): void;
6
+ delay?: number;
7
+ clearLabel?: string;
8
+ };
9
+ declare type SearchInputProps = Overwrite<InputProps, CustomProps>;
10
+ export declare const SearchInput: import("@chakra-ui/react").ComponentWithAs<"input", SearchInputProps>;
11
+ export {};
@@ -0,0 +1,116 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { BoxProps } from '@chakra-ui/react';
3
+ import { GroupBase, Props } from 'react-select';
4
+ declare module 'react' {
5
+ function forwardRef<T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
6
+ }
7
+ export declare type SelectProps<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = {
8
+ isAsync?: boolean;
9
+ isCreatable?: boolean;
10
+ isError?: boolean;
11
+ size?: string;
12
+ formatCreateLabel?: (inputValue: string) => ReactNode;
13
+ loadOptions?: (input: unknown) => TODO;
14
+ defaultOptions?: unknown | boolean;
15
+ debounceDelay?: number;
16
+ variant?: 'unstyled' | 'filled' | 'outlined';
17
+ } & Props<Option, IsMulti, Group> & Omit<BoxProps, 'defaultValue'>;
18
+ export declare const Select: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: {
19
+ isAsync?: boolean | undefined;
20
+ isCreatable?: boolean | undefined;
21
+ isError?: boolean | undefined;
22
+ size?: string | undefined;
23
+ formatCreateLabel?: ((inputValue: string) => ReactNode) | undefined;
24
+ loadOptions?: ((input: unknown) => TODO) | undefined;
25
+ defaultOptions?: unknown | boolean;
26
+ debounceDelay?: number | undefined;
27
+ variant?: "unstyled" | "filled" | "outlined" | undefined;
28
+ } & Omit<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "aria-label" | "form" | "autoFocus" | "name" | "value" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "theme"> & {
29
+ placeholder?: React.ReactNode;
30
+ tabIndex?: number | undefined;
31
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
32
+ isLoading?: boolean | undefined;
33
+ isDisabled?: boolean | undefined;
34
+ components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
35
+ pageSize?: number | undefined;
36
+ backspaceRemovesValue?: boolean | undefined;
37
+ blurInputOnSelect?: boolean | undefined;
38
+ captureMenuScroll?: boolean | undefined;
39
+ closeMenuOnSelect?: boolean | undefined;
40
+ closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
41
+ controlShouldRenderValue?: boolean | undefined;
42
+ escapeClearsValue?: boolean | undefined;
43
+ filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
44
+ formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
45
+ getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
46
+ getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
47
+ isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
48
+ isMulti?: IsMulti | undefined;
49
+ isRtl?: boolean | undefined;
50
+ isSearchable?: boolean | undefined;
51
+ loadingMessage?: ((obj: {
52
+ inputValue: string;
53
+ }) => React.ReactNode) | undefined;
54
+ minMenuHeight?: number | undefined;
55
+ maxMenuHeight?: number | undefined;
56
+ menuIsOpen?: boolean | undefined;
57
+ menuPlacement?: import("react-select").MenuPlacement | undefined;
58
+ menuPosition?: import("react-select").MenuPosition | undefined;
59
+ menuShouldBlockScroll?: boolean | undefined;
60
+ menuShouldScrollIntoView?: boolean | undefined;
61
+ noOptionsMessage?: ((obj: {
62
+ inputValue: string;
63
+ }) => React.ReactNode) | undefined;
64
+ openMenuOnFocus?: boolean | undefined;
65
+ openMenuOnClick?: boolean | undefined;
66
+ options?: import("react-select").OptionsOrGroups<Option, Group> | undefined;
67
+ screenReaderStatus?: ((obj: {
68
+ count: number;
69
+ }) => string) | undefined;
70
+ styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
71
+ tabSelectsValue?: boolean | undefined;
72
+ } & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<Option, IsMulti, Group>, "aria-label" | "form" | "autoFocus" | "name" | "value" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "theme"> & {
73
+ placeholder?: React.ReactNode;
74
+ tabIndex?: number | undefined;
75
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
76
+ isLoading?: boolean | undefined;
77
+ isDisabled?: boolean | undefined;
78
+ components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, Group>> | undefined;
79
+ pageSize?: number | undefined;
80
+ backspaceRemovesValue?: boolean | undefined;
81
+ blurInputOnSelect?: boolean | undefined;
82
+ captureMenuScroll?: boolean | undefined;
83
+ closeMenuOnSelect?: boolean | undefined;
84
+ closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
85
+ controlShouldRenderValue?: boolean | undefined;
86
+ escapeClearsValue?: boolean | undefined;
87
+ filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<Option>, inputValue: string) => boolean) | null | undefined;
88
+ formatGroupLabel?: ((group: Group) => React.ReactNode) | undefined;
89
+ getOptionLabel?: import("react-select").GetOptionLabel<Option> | undefined;
90
+ getOptionValue?: import("react-select").GetOptionValue<Option> | undefined;
91
+ isOptionDisabled?: ((option: Option, selectValue: import("react-select").Options<Option>) => boolean) | undefined;
92
+ isMulti?: IsMulti | undefined;
93
+ isRtl?: boolean | undefined;
94
+ isSearchable?: boolean | undefined;
95
+ loadingMessage?: ((obj: {
96
+ inputValue: string;
97
+ }) => React.ReactNode) | undefined;
98
+ minMenuHeight?: number | undefined;
99
+ maxMenuHeight?: number | undefined;
100
+ menuIsOpen?: boolean | undefined;
101
+ menuPlacement?: import("react-select").MenuPlacement | undefined;
102
+ menuPosition?: import("react-select").MenuPosition | undefined;
103
+ menuShouldBlockScroll?: boolean | undefined;
104
+ menuShouldScrollIntoView?: boolean | undefined;
105
+ noOptionsMessage?: ((obj: {
106
+ inputValue: string;
107
+ }) => React.ReactNode) | undefined;
108
+ openMenuOnFocus?: boolean | undefined;
109
+ openMenuOnClick?: boolean | undefined;
110
+ options?: import("react-select").OptionsOrGroups<Option, Group> | undefined;
111
+ screenReaderStatus?: ((obj: {
112
+ count: number;
113
+ }) => string) | undefined;
114
+ styles?: import("react-select").StylesConfig<Option, IsMulti, Group> | undefined;
115
+ tabSelectsValue?: boolean | undefined;
116
+ } & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<Option> & Omit<BoxProps, "defaultValue"> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
@@ -1,4 +1,8 @@
1
1
  export * from './ActionsButton';
2
2
  export * from './DataList';
3
+ export * from './DayPicker';
3
4
  export * from './FormGroup';
5
+ export * from './InputDayPicker';
4
6
  export * from './Pagination';
7
+ export * from './SearchInput';
8
+ export * from './Select';
@@ -1 +1,3 @@
1
1
  export * from './components';
2
+ export * from './layout';
3
+ export * from './theme';
@@ -0,0 +1,10 @@
1
+ import { ReactComponentElement } from 'react';
2
+ import { FlexProps, StackProps } from '@chakra-ui/react';
3
+ export declare type TopBarBackActionProps = {
4
+ backAction?: () => void;
5
+ rightInformation?: ReactComponentElement<any>;
6
+ } & FlexProps;
7
+ export declare const TopBar: ({ ...props }: StackProps) => JSX.Element;
8
+ export declare const TopBarFirstElement: ({ ...props }: FlexProps) => JSX.Element;
9
+ export declare const TopBarLastElement: ({ ...props }: StackProps) => JSX.Element;
10
+ export declare const TopBarBackAction: ({ backAction, title, rightInformation, ...rest }: TopBarBackActionProps) => JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './TopBar';
@@ -1,7 +1,8 @@
1
- export declare const Badge: {
1
+ declare const _default: {
2
2
  baseStyle: {
3
3
  borderRadius: string;
4
4
  fontWeight: string;
5
5
  paddingX: number;
6
6
  };
7
7
  };
8
+ export default _default;
@@ -1,4 +1,4 @@
1
- export declare const Button: {
1
+ declare const _default: {
2
2
  baseStyle: {
3
3
  borderRadius: string;
4
4
  fontWeight: string;
@@ -91,9 +91,6 @@ export declare const Button: {
91
91
  };
92
92
  };
93
93
  '@white': (props: any) => {
94
- borderWidth: string;
95
- borderStyle: string;
96
- borderColor: string;
97
94
  bg: string;
98
95
  color: string;
99
96
  _focus: {
@@ -111,9 +108,6 @@ export declare const Button: {
111
108
  };
112
109
  };
113
110
  '@whiteNeutral': (props: any) => {
114
- borderWidth: string;
115
- borderStyle: string;
116
- borderColor: string;
117
111
  bg: string;
118
112
  color: string;
119
113
  _focus: {
@@ -138,3 +132,4 @@ export declare const Button: {
138
132
  };
139
133
  };
140
134
  };
135
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export { default as Badge } from './badge';
2
+ export { default as Button } from './button';
3
+ export { default as Input } from './input';
4
+ export { default as Tag } from './tag';
@@ -1,4 +1,4 @@
1
- export declare const Input: {
1
+ declare const _default: {
2
2
  baseStyle: {
3
3
  field: {
4
4
  borderRadius: string;
@@ -45,3 +45,4 @@ export declare const Input: {
45
45
  };
46
46
  };
47
47
  };
48
+ export default _default;
@@ -1,4 +1,4 @@
1
- export declare const Tag: {
1
+ declare const _default: {
2
2
  baseStyle: {
3
3
  container: {
4
4
  borderRadius: string;
@@ -6,3 +6,4 @@ export declare const Tag: {
6
6
  };
7
7
  };
8
8
  };
9
+ export default _default;
@@ -0,0 +1 @@
1
+ export { reactDayPicker } from './reactDayPicker';
@@ -0,0 +1,2 @@
1
+ import { Styles } from '@chakra-ui/theme-tools';
2
+ export declare const reactDayPicker: Styles['global'];
@@ -0,0 +1 @@
1
+ import 'react-day-picker/dist/style.css';
@@ -62,4 +62,5 @@ export declare const colors: {
62
62
  gradients: {
63
63
  primary: string;
64
64
  };
65
+ background: string;
65
66
  };
@@ -0,0 +1,87 @@
1
+ declare const foundations: {
2
+ shadows: {
3
+ xs: string;
4
+ sm: string;
5
+ base: string;
6
+ md: string;
7
+ lg: string;
8
+ xl: string;
9
+ '2xl': string;
10
+ layout: string;
11
+ };
12
+ fonts: {
13
+ heading: string;
14
+ body: string;
15
+ mono: string;
16
+ };
17
+ fontSizes: {
18
+ '2xs': string;
19
+ };
20
+ colors: {
21
+ brand: {
22
+ 50: string;
23
+ 100: string;
24
+ 200: string;
25
+ 300: string;
26
+ 400: string;
27
+ 500: string;
28
+ 600: string;
29
+ 700: string;
30
+ 800: string;
31
+ 900: string;
32
+ };
33
+ gray: {
34
+ 50: string;
35
+ 100: string;
36
+ 200: string;
37
+ 300: string;
38
+ 400: string;
39
+ 500: string;
40
+ 600: string;
41
+ 700: string;
42
+ 800: string;
43
+ 900: string;
44
+ };
45
+ red: {
46
+ 50: string;
47
+ 100: string;
48
+ 200: string;
49
+ 300: string;
50
+ 400: string;
51
+ 500: string;
52
+ 600: string;
53
+ 700: string;
54
+ 800: string;
55
+ 900: string;
56
+ };
57
+ orange: {
58
+ 50: string;
59
+ 100: string;
60
+ 200: string;
61
+ 300: string;
62
+ 400: string;
63
+ 500: string;
64
+ 600: string;
65
+ 700: string;
66
+ 800: string;
67
+ 900: string;
68
+ };
69
+ green: {
70
+ 50: string;
71
+ 100: string;
72
+ 200: string;
73
+ 300: string;
74
+ 400: string;
75
+ 500: string;
76
+ 600: string;
77
+ 700: string;
78
+ 800: string;
79
+ 900: string;
80
+ };
81
+ gradients: {
82
+ primary: string;
83
+ };
84
+ background: string;
85
+ };
86
+ };
87
+ export default foundations;
@@ -1 +1,2 @@
1
- export declare const theme: unknown;
1
+ import './externals-css';
2
+ export * from './theme';
@@ -0,0 +1,2 @@
1
+ import { Styles } from '@chakra-ui/theme-tools';
2
+ export declare const styles: Styles;
@@ -0,0 +1 @@
1
+ export declare const theme: any;
@@ -0,0 +1 @@
1
+ export declare const dateFormat = "dd/MM/yyyy";