@dexma/ui-components 6.8.1 → 7.0.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/LICENSE +1 -1
- package/README.md +38 -36
- package/dist/index.d.ts +1 -0
- package/dist/lib/components/Alert/Alert.d.ts +13 -0
- package/dist/lib/components/Alert/index.d.ts +1 -0
- package/dist/lib/components/Button/Button.d.ts +50 -0
- package/dist/lib/components/Button/index.d.ts +1 -0
- package/dist/lib/components/Card/Card.d.ts +17 -0
- package/dist/lib/components/Card/index.d.ts +1 -0
- package/dist/lib/components/Cascader/Cascader.d.ts +19 -0
- package/dist/lib/components/Cascader/index.d.ts +1 -0
- package/dist/lib/components/Cell/Cell.d.ts +17 -0
- package/dist/lib/components/Cell/index.d.ts +1 -0
- package/dist/lib/components/Chart/Chart.d.ts +23 -0
- package/dist/lib/components/Chart/index.d.ts +1 -0
- package/dist/lib/components/Chart/types.d.ts +24 -0
- package/dist/lib/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/lib/components/Checkbox/index.d.ts +1 -0
- package/dist/lib/components/ColorPicker/ColorPicker.d.ts +15 -0
- package/dist/lib/components/ColorPicker/index.d.ts +1 -0
- package/dist/lib/components/DataId/DataIdProvider.d.ts +10 -0
- package/dist/lib/components/DataId/withDataId.d.ts +7 -0
- package/dist/lib/components/DatePicker/DatePicker.d.ts +24 -0
- package/dist/lib/components/DatePicker/datePickerUtils.d.ts +3 -0
- package/dist/lib/components/DatePicker/index.d.ts +1 -0
- package/dist/lib/components/Divider/Divider.d.ts +6 -0
- package/dist/lib/components/Divider/index.d.ts +1 -0
- package/dist/lib/components/Dots/Dots.d.ts +5 -0
- package/dist/lib/components/Dots/index.d.ts +1 -0
- package/dist/lib/components/Dropdown/Dropdown.d.ts +19 -0
- package/dist/lib/components/Dropdown/index.d.ts +1 -0
- package/dist/lib/components/FieldGroup/FieldGroup.d.ts +62 -0
- package/dist/lib/components/FieldGroup/index.d.ts +1 -0
- package/dist/lib/components/FormControl/FormControl.d.ts +35 -0
- package/dist/lib/components/FormControl/index.d.ts +1 -0
- package/dist/lib/components/Gauge/Gauge.d.ts +234 -0
- package/dist/lib/components/Gauge/index.d.ts +1 -0
- package/dist/lib/components/Grid/Grid.d.ts +5 -0
- package/dist/lib/components/Grid/index.d.ts +1 -0
- package/dist/lib/components/Heading/Heading.d.ts +10 -0
- package/dist/lib/components/Heading/index.d.ts +1 -0
- package/dist/lib/components/Icon/Icon.d.ts +17 -0
- package/dist/lib/components/Icon/index.d.ts +1 -0
- package/dist/lib/components/Input/Input.d.ts +17 -0
- package/dist/lib/components/Input/index.d.ts +1 -0
- package/dist/lib/components/Loading/Loading.d.ts +10 -0
- package/dist/lib/components/Loading/index.d.ts +1 -0
- package/dist/lib/components/Modal/Modal.d.ts +3 -0
- package/dist/lib/components/Modal/index.d.ts +1 -0
- package/dist/lib/components/Pagination/Pagination.d.ts +6 -0
- package/dist/lib/components/Pagination/index.d.ts +1 -0
- package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -0
- package/dist/lib/components/Paragraph/index.d.ts +1 -0
- package/dist/lib/components/Popover/Popover.d.ts +6 -0
- package/dist/lib/components/Popover/index.d.ts +1 -0
- package/dist/lib/components/Progress/Progress.d.ts +12 -0
- package/dist/lib/components/Progress/index.d.ts +1 -0
- package/dist/lib/components/Result/Result.d.ts +20 -0
- package/dist/lib/components/Result/index.d.ts +1 -0
- package/dist/lib/components/Row/Row.d.ts +8 -0
- package/dist/lib/components/Row/index.d.ts +1 -0
- package/dist/lib/components/Section/Section.d.ts +15 -0
- package/dist/lib/components/Section/index.d.ts +1 -0
- package/dist/lib/components/Select/ButtonPaginationSelector.d.ts +18 -0
- package/dist/lib/components/Select/Select.d.ts +58 -0
- package/dist/lib/components/Select/index.d.ts +1 -0
- package/dist/lib/components/Select/selectUtils.d.ts +21 -0
- package/dist/lib/components/Spinner/Spinner.d.ts +4 -0
- package/dist/lib/components/Spinner/index.d.ts +1 -0
- package/dist/lib/components/Switch/Switch.d.ts +19 -0
- package/dist/lib/components/Switch/index.d.ts +1 -0
- package/dist/lib/components/SwitchPeriodComparative/SwitchPeriodComparative.d.ts +24 -0
- package/dist/lib/components/SwitchPeriodComparative/index.d.ts +1 -0
- package/dist/lib/components/Table/Table.d.ts +16 -0
- package/dist/lib/components/Table/index.d.ts +1 -0
- package/dist/lib/components/Tabs/Tabs.d.ts +16 -0
- package/dist/lib/components/Tabs/index.d.ts +1 -0
- package/dist/lib/components/Tag/Tag.d.ts +22 -0
- package/dist/lib/components/Tag/index.d.ts +1 -0
- package/dist/lib/components/TagGroup/TagGroup.d.ts +7 -0
- package/dist/lib/components/TagGroup/index.d.ts +1 -0
- package/dist/lib/components/Theme/Theme.d.ts +8 -0
- package/dist/lib/components/Theme/index.d.ts +1 -0
- package/dist/lib/components/Toaster/Toast.d.ts +12 -0
- package/dist/lib/components/Toaster/Toaster.d.ts +7 -0
- package/dist/lib/components/Toaster/ToasterContext.d.ts +11 -0
- package/dist/lib/components/Toaster/index.d.ts +3 -0
- package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -0
- package/dist/lib/components/Tooltip/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts +42 -0
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/styles/Alert/StyledAlert.d.ts +12 -0
- package/dist/lib/styles/Button/StyledButton.d.ts +44 -0
- package/dist/lib/styles/Card/StyledCard.d.ts +14 -0
- package/dist/lib/styles/Cascader/StyledCascader.d.ts +11 -0
- package/dist/lib/styles/Cell/StyledCell.d.ts +16 -0
- package/dist/lib/styles/Chart/StyledChart.d.ts +3 -0
- package/dist/lib/styles/ColorPicker/StyledColorPicker.d.ts +50 -0
- package/dist/lib/styles/DatePicker/StyledDatePicker.d.ts +25 -0
- package/dist/lib/styles/Divider/StyledDivider.d.ts +7 -0
- package/dist/lib/styles/Dots/StyledDots.d.ts +10 -0
- package/dist/lib/styles/Dropdown/StyledDropdown.d.ts +88 -0
- package/dist/lib/styles/Fieldgroup/StyledFieldGroup.d.ts +16 -0
- package/dist/lib/styles/FromControl/StyledFormControl.d.ts +5 -0
- package/dist/lib/styles/Grid/StyledGrid.d.ts +7 -0
- package/dist/lib/styles/Heading/StyledHeading.d.ts +8 -0
- package/dist/lib/styles/Icon/StyledIcon.d.ts +5 -0
- package/dist/lib/styles/Input/StyledInput.d.ts +11 -0
- package/dist/lib/styles/Loading/StyledLoading.d.ts +2 -0
- package/dist/lib/styles/Modal/StyledModal.d.ts +14 -0
- package/dist/lib/styles/Pagination/StyledPagination.d.ts +7 -0
- package/dist/lib/styles/Paragraph/StyledParagraph.d.ts +9 -0
- package/dist/lib/styles/Progress/StyledProgress.d.ts +14 -0
- package/dist/lib/styles/Result/StyledResult.d.ts +10 -0
- package/dist/lib/styles/Row/StyledRow.d.ts +8 -0
- package/dist/lib/styles/Section/StyledSection.d.ts +9 -0
- package/dist/lib/styles/Select/StyledSelect.d.ts +98 -0
- package/dist/lib/styles/Spinner/StyledSpinner.d.ts +9 -0
- package/dist/lib/styles/Switch/StyledSwitch.d.ts +2 -0
- package/dist/lib/styles/SwitchPeriodComparative/StyledSwitchPeriodComparative.d.ts +7 -0
- package/dist/lib/styles/Table/StyledTable.d.ts +7 -0
- package/dist/lib/styles/Tabs/StyledTabs.d.ts +9 -0
- package/dist/lib/styles/Tag/StyledTag.d.ts +14 -0
- package/dist/lib/styles/TagGroup/StyledTagGroup.d.ts +6 -0
- package/dist/lib/styles/Toast/StyledToast.d.ts +2 -0
- package/dist/lib/utils/animation.d.ts +13 -0
- package/dist/lib/utils/dates.d.ts +29 -0
- package/dist/lib/utils/formatter.d.ts +2 -0
- package/dist/lib/utils/global.d.ts +4 -0
- package/dist/lib/utils/selectors.d.ts +113 -0
- package/dist/lib/utils/theme.d.ts +85 -0
- package/dist/ui-components.es.js +72660 -0
- package/dist/ui-components.umd.js +4967 -0
- package/package.json +42 -137
- package/.github/workflows/cd.yml +0 -36
- package/.github/workflows/ci.yml +0 -45
- package/CHANGELOG.md +0 -1556
- package/CONTRIBUTING.md +0 -154
- package/dist/main.bundle.js +0 -253
- package/dist/main.bundle.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -18,33 +18,35 @@
|
|
|
18
18
|
|
|
19
19
|
## Table of contents
|
|
20
20
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
21
|
+
- [Usage](#usage)
|
|
22
|
+
- [Installation](#installation)
|
|
23
|
+
- [Documentation](#documentation)
|
|
24
|
+
- [Changelog](#changelog)
|
|
25
|
+
- [Testing](#testing)
|
|
26
|
+
- [Contributing](#contributing)
|
|
27
27
|
|
|
28
28
|
## Usage
|
|
29
29
|
|
|
30
|
-
1
|
|
30
|
+
1. Install with [npm](https://www.npmjs.com): `npm install --save @dexma/ui-components`
|
|
31
31
|
|
|
32
|
-
2
|
|
32
|
+
2. Use the component importing from the library
|
|
33
33
|
|
|
34
|
-
```
|
|
35
|
-
import { Button } from
|
|
36
|
-
<Button text=
|
|
34
|
+
```typescript
|
|
35
|
+
import { Button } from '@dexma/ui-components';
|
|
36
|
+
<Button text='Some text' variant='primary' size='medium' />;
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
3
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
import { Theme, Button } from
|
|
43
|
-
<Theme
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
3. Optional: You can set the Theme with your personal variables, we provide the Theme component and you only need to set the options:
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { Theme, Button } from '@dexma/ui-components';
|
|
43
|
+
<Theme
|
|
44
|
+
options={{
|
|
45
|
+
primary: '#aa0800',
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<Button text='Some text' variant='primary' size='medium' />
|
|
49
|
+
</Theme>;
|
|
48
50
|
```
|
|
49
51
|
|
|
50
52
|
You can find all the configuration in the theme file [theme.js](https://github.com/dexma/ui-components/blob/master/src/styles/theme.js)
|
|
@@ -63,8 +65,8 @@ npm install
|
|
|
63
65
|
|
|
64
66
|
For the documentation we use storybook docs that transforms our stories into world-class component documentation.
|
|
65
67
|
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
+
- Run storybook: `npm run storybook`
|
|
69
|
+
- If you need to export static doc run `npm run build-storybook` this will export a static folder with all our component docs
|
|
68
70
|
|
|
69
71
|
## Changelog
|
|
70
72
|
|
|
@@ -74,25 +76,25 @@ For changelogs, check out [the CHANGELOG section of ui-components](https://githu
|
|
|
74
76
|
|
|
75
77
|
We use React Testing Library as our testing lib you can check out the [documentation](https://testing-library.com/docs/react-testing-library/intro)
|
|
76
78
|
|
|
77
|
-
-
|
|
79
|
+
- To run our test: `npm run test`
|
|
78
80
|
|
|
79
|
-
Note: Due to the use of third-party libraries, some components use methods that JSDOM (the DOM implementation used by Jest) hasn't implemented yet, testing it is not easily possible. This is the case with window.matchMedia(). Jest returns
|
|
81
|
+
Note: Due to the use of third-party libraries, some components use methods that JSDOM (the DOM implementation used by Jest) hasn't implemented yet, testing it is not easily possible. This is the case with window.matchMedia(). Jest returns `TypeError: window.matchMedia is not a function` and doesn't properly execute the test.
|
|
80
82
|
|
|
81
83
|
In this case, to resolve this issue to execute successfully your tests when @dexma/ui-components is used, include the following code on setupTest file for Jest to mock matchMedia and it should solve the issue:
|
|
82
84
|
|
|
83
|
-
```
|
|
85
|
+
```typescript
|
|
84
86
|
Object.defineProperty(window, 'matchMedia', {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
writable: true,
|
|
88
|
+
value: jest.fn().mockImplementation((query) => ({
|
|
89
|
+
matches: false,
|
|
90
|
+
media: query,
|
|
91
|
+
onchange: null,
|
|
92
|
+
addListener: jest.fn(), // deprecated
|
|
93
|
+
removeListener: jest.fn(), // deprecated
|
|
94
|
+
addEventListener: jest.fn(),
|
|
95
|
+
removeEventListener: jest.fn(),
|
|
96
|
+
dispatchEvent: jest.fn(),
|
|
97
|
+
})),
|
|
96
98
|
});
|
|
97
99
|
```
|
|
98
100
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/index'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type AlertProps = {
|
|
4
|
+
message?: ReactNode;
|
|
5
|
+
type: 'basic' | 'outline' | 'warning' | 'info' | 'success' | 'error';
|
|
6
|
+
onClose?: (e: any) => void;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
showIcon?: boolean;
|
|
9
|
+
closable?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
export declare const Alert: ({ type, closable, message, description, showIcon, onClose, ...props }: AlertProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Alert';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as React, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare enum ButtonSize {
|
|
4
|
+
SMALL = "small",
|
|
5
|
+
MEDIUM = "medium",
|
|
6
|
+
LARGE = "large",
|
|
7
|
+
XLARGE = "xlarge"
|
|
8
|
+
}
|
|
9
|
+
export declare const BUTTON_VARIANT: string[];
|
|
10
|
+
export declare const ButtonGroup: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export type ButtonProps = {
|
|
12
|
+
text?: string;
|
|
13
|
+
size?: string | ButtonSize;
|
|
14
|
+
variant?: string;
|
|
15
|
+
iconBefore?: string;
|
|
16
|
+
iconAfter?: string;
|
|
17
|
+
iconColor?: string;
|
|
18
|
+
tooltip?: string;
|
|
19
|
+
onClick?: (e?: any) => void;
|
|
20
|
+
onFocus?: () => void;
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
isDisabled?: boolean;
|
|
23
|
+
isCircle?: boolean;
|
|
24
|
+
isExpanded?: boolean;
|
|
25
|
+
debounceTime?: number;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
dataId?: string;
|
|
28
|
+
'data-testid'?: string;
|
|
29
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
30
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<{
|
|
31
|
+
text?: string;
|
|
32
|
+
size?: string | ButtonSize;
|
|
33
|
+
variant?: string;
|
|
34
|
+
iconBefore?: string;
|
|
35
|
+
iconAfter?: string;
|
|
36
|
+
iconColor?: string;
|
|
37
|
+
tooltip?: string;
|
|
38
|
+
onClick?: (e?: any) => void;
|
|
39
|
+
onFocus?: () => void;
|
|
40
|
+
isLoading?: boolean;
|
|
41
|
+
isDisabled?: boolean;
|
|
42
|
+
isCircle?: boolean;
|
|
43
|
+
isExpanded?: boolean;
|
|
44
|
+
debounceTime?: number;
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
dataId?: string;
|
|
47
|
+
'data-testid'?: string;
|
|
48
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>, "dataId"> & Partial<{
|
|
49
|
+
dataId?: string;
|
|
50
|
+
}> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type CardProps = {
|
|
4
|
+
link?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
footer?: React.ReactNode;
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
isHorizontal?: boolean;
|
|
13
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
14
|
+
onFocus?: (event: React.FocusEvent<HTMLAnchorElement>) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const Card: (props: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default Card;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CascaderProps as CascaderAntdProps } from 'antd';
|
|
3
|
+
import { DefaultOptionType } from 'antd/es/cascader';
|
|
4
|
+
import { DefaultTheme } from 'styled-components';
|
|
5
|
+
|
|
6
|
+
type Value = Array<string | number>;
|
|
7
|
+
type CascaderProps<OptionType extends DefaultOptionType> = CascaderAntdProps & {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
options?: OptionType[];
|
|
10
|
+
onChange?: (value: Value | Value[]) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const tagRender: (theme: DefaultTheme) => (props: {
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
value: string;
|
|
15
|
+
closable: boolean;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Cascader: <OptionType extends DefaultOptionType>({ multiple, options, maxTagCount, onChange, open, ...props }: CascaderProps<OptionType>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Cascader';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type CellProps = {
|
|
4
|
+
xs?: number;
|
|
5
|
+
sm?: number;
|
|
6
|
+
md?: number;
|
|
7
|
+
lg?: number;
|
|
8
|
+
xsOffset?: number;
|
|
9
|
+
smOffset?: number;
|
|
10
|
+
mdOffset?: number;
|
|
11
|
+
lgOffset?: number;
|
|
12
|
+
direction?: string;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
['data-testid']?: string;
|
|
15
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
export declare const Cell: ({ xs, sm, md, lg, xsOffset, smOffset, mdOffset, lgOffset, direction, children, onClick, ...props }: CellProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Cell';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as Highcharts } from 'highcharts';
|
|
3
|
+
import { HighchartsReactRefObject } from 'highcharts-react-official';
|
|
4
|
+
|
|
5
|
+
type ChartProps = {
|
|
6
|
+
options?: Highcharts.Options;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
showError?: boolean;
|
|
9
|
+
errorContent?: any;
|
|
10
|
+
dataId?: string;
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
decimalPoint?: string;
|
|
13
|
+
thousandsSep?: string;
|
|
14
|
+
numericSymbols?: string[];
|
|
15
|
+
months?: string[];
|
|
16
|
+
shortMonths?: string[];
|
|
17
|
+
weekdays?: string[];
|
|
18
|
+
callback?: () => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const Chart: React.ForwardRefExoticComponent<Omit<Omit<ChartProps & React.RefAttributes<HighchartsReactRefObject>, "dataId"> & Partial<{
|
|
21
|
+
dataId?: string;
|
|
22
|
+
}>, "ref"> & React.RefAttributes<unknown>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Chart';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { XAxisOptions, YAxisOptions, PlotOptions, PlotSeriesOptions, PlotColumnOptions } from 'highcharts';
|
|
2
|
+
|
|
3
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
4
|
+
type ChartXAxisOptions = XAxisOptions & {
|
|
5
|
+
index?: number;
|
|
6
|
+
isX?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type ChartYAxisOptions = YAxisOptions & {
|
|
9
|
+
index?: number;
|
|
10
|
+
};
|
|
11
|
+
export type ChartOptions = Modify<Highcharts.Options, {
|
|
12
|
+
xAxis?: ChartXAxisOptions | ChartXAxisOptions[];
|
|
13
|
+
yAxis?: ChartYAxisOptions | ChartYAxisOptions[];
|
|
14
|
+
plotOptions?: PlotOptions & {
|
|
15
|
+
series?: PlotSeriesOptions & {
|
|
16
|
+
grouping?: boolean;
|
|
17
|
+
};
|
|
18
|
+
column?: PlotColumnOptions & {
|
|
19
|
+
borderRadiusTopLeft?: number;
|
|
20
|
+
borderRadiusTopRight: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CheckboxProps as AntCheckboxProps } from 'antd';
|
|
3
|
+
|
|
4
|
+
export type CheckboxProps = {
|
|
5
|
+
dataId?: string;
|
|
6
|
+
} & AntCheckboxProps;
|
|
7
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<Omit<AntCheckboxProps, "dataId"> & Partial<{
|
|
8
|
+
dataId?: string;
|
|
9
|
+
}> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Checkbox';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ColorPickerProps = {
|
|
4
|
+
dataId?: string;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
presetColors?: string[];
|
|
8
|
+
onChangePicker?: (color: any) => void;
|
|
9
|
+
onChangeInput?: (e: any) => void;
|
|
10
|
+
showInput?: boolean;
|
|
11
|
+
value?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const ColorPicker: React.ForwardRefExoticComponent<Omit<Omit<ColorPickerProps & React.RefAttributes<HTMLInputElement>, "dataId"> & Partial<{
|
|
14
|
+
dataId?: string;
|
|
15
|
+
}>, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ColorPicker';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const DataIdContext: React.Context<string>;
|
|
4
|
+
export declare const DataIdProvider: {
|
|
5
|
+
(props: {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
dataId: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
context: React.Context<string>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React, ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
type WithDataIdProps = {
|
|
4
|
+
dataId?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const withDataId: <P extends object>(Component: ComponentType<P & WithDataIdProps>, defaultValue: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<P, "dataId"> & Partial<WithDataIdProps>> & React.RefAttributes<unknown>>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DatePickerProps } from 'antd';
|
|
3
|
+
import { RangePickerProps } from 'antd/lib/date-picker';
|
|
4
|
+
import { Theme } from '../../utils/theme';
|
|
5
|
+
|
|
6
|
+
type CommonProps = {
|
|
7
|
+
lang?: 'en' | 'bg' | 'br' | 'be' | 'ca' | 'da' | 'de' | 'el' | 'es' | 'fi' | 'fr' | 'it' | 'nl' | 'pl' | 'pt' | 'sl' | 'sv' | 'tr' | 'us' | 'zh';
|
|
8
|
+
dataId?: string;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
theme?: Theme;
|
|
11
|
+
};
|
|
12
|
+
export type AntdDatePickerProps = DatePickerProps & CommonProps;
|
|
13
|
+
export declare const AntdDatePicker: React.ForwardRefExoticComponent<Omit<AntdDatePickerProps, "dataId"> & Partial<{
|
|
14
|
+
dataId?: string;
|
|
15
|
+
}> & React.RefAttributes<unknown>>;
|
|
16
|
+
export type AntdRangePickerProps = RangePickerProps & CommonProps;
|
|
17
|
+
export declare const AntdRangePicker: React.ForwardRefExoticComponent<Omit<AntdRangePickerProps, "dataId"> & Partial<{
|
|
18
|
+
dataId?: string;
|
|
19
|
+
}> & React.RefAttributes<unknown>>;
|
|
20
|
+
type DatePickerType = {
|
|
21
|
+
type: 'date' | 'range';
|
|
22
|
+
} & (AntdDatePickerProps | AntdRangePickerProps);
|
|
23
|
+
export declare const DatePicker: ({ type, ...props }: DatePickerType) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DatePicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Divider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dots';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DropDownProps } from 'antd';
|
|
2
|
+
|
|
3
|
+
type DropdownContent = {
|
|
4
|
+
text: string;
|
|
5
|
+
key?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
dataId?: string;
|
|
8
|
+
variant?: string;
|
|
9
|
+
onClick?: (e: any) => void;
|
|
10
|
+
};
|
|
11
|
+
export type DropdownProps = DropDownProps & {
|
|
12
|
+
dataId?: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
variant?: string;
|
|
16
|
+
content?: DropdownContent[];
|
|
17
|
+
};
|
|
18
|
+
export declare const Dropdown: ({ dataId, trigger, text, placement, menu, icon, content, variant }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dropdown';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ButtonSize } from '../index.ts';
|
|
3
|
+
|
|
4
|
+
export declare enum FieldGroupType {
|
|
5
|
+
RADIO = "radio",
|
|
6
|
+
CHECKBOX = "checkbox"
|
|
7
|
+
}
|
|
8
|
+
export declare enum FieldGroupVariant {
|
|
9
|
+
JOINED = "joined",
|
|
10
|
+
SPLIT = "split",
|
|
11
|
+
CUSTOM = "custom"
|
|
12
|
+
}
|
|
13
|
+
type FieldGroupProps<V> = {
|
|
14
|
+
selectedValues: V;
|
|
15
|
+
variant?: FieldGroupVariant;
|
|
16
|
+
values: FieldGroupItem[];
|
|
17
|
+
size?: ButtonSize;
|
|
18
|
+
name?: string;
|
|
19
|
+
vertical?: boolean;
|
|
20
|
+
onChange?: (e: FieldGroupItem) => void;
|
|
21
|
+
onFieldClick?: (e: FieldGroupItem) => void;
|
|
22
|
+
dataId?: string;
|
|
23
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;
|
|
24
|
+
export type FieldGroupItem = {
|
|
25
|
+
id: string;
|
|
26
|
+
label?: ReactNode;
|
|
27
|
+
icon?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
uniqueId?: string;
|
|
30
|
+
value: string;
|
|
31
|
+
tooltip?: string;
|
|
32
|
+
isDisabled?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type RadioFieldGroupProps = FieldGroupProps<string | number>;
|
|
35
|
+
export type CheckboxFieldGroupProps = FieldGroupProps<Array<string | number>>;
|
|
36
|
+
export declare const RadioFieldGroup: React.ForwardRefExoticComponent<Omit<{
|
|
37
|
+
selectedValues: string | number;
|
|
38
|
+
variant?: FieldGroupVariant;
|
|
39
|
+
values: FieldGroupItem[];
|
|
40
|
+
size?: ButtonSize;
|
|
41
|
+
name?: string;
|
|
42
|
+
vertical?: boolean;
|
|
43
|
+
onChange?: (e: FieldGroupItem) => void;
|
|
44
|
+
onFieldClick?: (e: FieldGroupItem) => void;
|
|
45
|
+
dataId?: string;
|
|
46
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange">, "dataId"> & Partial<{
|
|
47
|
+
dataId?: string;
|
|
48
|
+
}> & React.RefAttributes<unknown>>;
|
|
49
|
+
export declare const CheckboxFieldGroup: React.ForwardRefExoticComponent<Omit<{
|
|
50
|
+
selectedValues: (string | number)[];
|
|
51
|
+
variant?: FieldGroupVariant;
|
|
52
|
+
values: FieldGroupItem[];
|
|
53
|
+
size?: ButtonSize;
|
|
54
|
+
name?: string;
|
|
55
|
+
vertical?: boolean;
|
|
56
|
+
onChange?: (e: FieldGroupItem) => void;
|
|
57
|
+
onFieldClick?: (e: FieldGroupItem) => void;
|
|
58
|
+
dataId?: string;
|
|
59
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange">, "dataId"> & Partial<{
|
|
60
|
+
dataId?: string;
|
|
61
|
+
}> & React.RefAttributes<unknown>>;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FieldGroup';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type FormControlProps = {
|
|
4
|
+
dataId?: string;
|
|
5
|
+
control: 'Input' | 'Checkbox' | 'Textarea' | 'Select' | 'ColorPicker' | 'DatePicker';
|
|
6
|
+
name?: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
success?: boolean;
|
|
9
|
+
message?: string;
|
|
10
|
+
options?: any[];
|
|
11
|
+
value?: any;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
type?: 'range' | 'date';
|
|
17
|
+
showInput?: boolean;
|
|
18
|
+
format?: string;
|
|
19
|
+
onChange?: any;
|
|
20
|
+
onFocus?: any;
|
|
21
|
+
onBlur?: any;
|
|
22
|
+
onChangeInput?: any;
|
|
23
|
+
onChangePicker?: (e: {
|
|
24
|
+
hex: string;
|
|
25
|
+
}) => void;
|
|
26
|
+
onDatesChange?: any;
|
|
27
|
+
initialColor?: string;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
maxLength?: number;
|
|
30
|
+
rows?: number;
|
|
31
|
+
};
|
|
32
|
+
export declare const FormControl: React.ForwardRefExoticComponent<Omit<Omit<FormControlProps & React.RefAttributes<HTMLElement>, "dataId"> & Partial<{
|
|
33
|
+
dataId?: string;
|
|
34
|
+
}>, "ref"> & React.RefAttributes<unknown>>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FormControl';
|