@true-engineering/true-react-common-ui-kit 4.0.0-alpha44 → 4.0.0-alpha46
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/dist/components/AccountInfo/AccountInfo.styles.d.ts +1 -1
- package/dist/components/AddButton/AddButton.styles.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.styles.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -1
- package/dist/components/CloseButton/CloseButton.styles.d.ts +1 -1
- package/dist/components/ControlWrapper/ControlWrapper.d.ts +2 -2
- package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +1 -1
- package/dist/components/ControlWrapper/constants.d.ts +1 -0
- package/dist/components/ControlWrapper/index.d.ts +1 -0
- package/dist/components/ControlWrapper/types.d.ts +3 -1
- package/dist/components/CssBaseline/CssBaseline.styles.d.ts +1 -1
- package/dist/components/DateInput/DateInput.d.ts +1 -2
- package/dist/components/DateInput/DateInput.styles.d.ts +1 -1
- package/dist/components/DateInput/constants.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +2 -3
- package/dist/components/DatePicker/DatePicker.styles.d.ts +1 -1
- package/dist/components/DatePicker/components/DatePickerBase/DatePickerBase.d.ts +1 -1
- package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +1 -1
- package/dist/components/DatePicker/constants.d.ts +1 -1
- package/dist/components/DatePicker/types.d.ts +2 -2
- package/dist/components/Description/Description.styles.d.ts +1 -1
- package/dist/components/FileInput/FileInput.d.ts +1 -1
- package/dist/components/FileInput/FileInput.styles.d.ts +1 -1
- package/dist/components/FileItem/FileItem.styles.d.ts +1 -1
- package/dist/components/FiltersPane/FiltersPane.d.ts +0 -1
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/Filter/Filter.d.ts +1 -2
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +3 -6
- package/dist/components/FiltersPane/components/FilterMultiSelect/FilterMultiSelect.d.ts +0 -1
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +3 -6
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.d.ts +1 -2
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +5 -11
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +0 -1
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +1 -1
- package/dist/components/FiltersPane/constants.d.ts +1 -1
- package/dist/components/FiltersPane/helpers.d.ts +1 -1
- package/dist/components/FiltersPane/types.d.ts +1 -1
- package/dist/components/Flag/Flag.styles.d.ts +1 -1
- package/dist/components/Flag/customFlags/customFlags.d.ts +2 -2
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +2 -2
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/helpers.d.ts +2 -2
- package/dist/components/FloatDocActions/FloatDocActions.styles.d.ts +1 -1
- package/dist/components/FloatDocActions/components/DocActions/DocActions.styles.d.ts +1 -1
- package/dist/components/Icon/Icon.styles.d.ts +1 -1
- package/dist/components/Icon/icons/index.d.ts +29 -29
- package/dist/components/IconButton/IconButton.d.ts +1 -2
- package/dist/components/IconButton/IconButton.styles.d.ts +1 -1
- package/dist/components/IncrementInput/IncrementInput.styles.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -2
- package/dist/components/Input/Input.styles.d.ts +1 -1
- package/dist/components/Input/InputBase.d.ts +1 -1
- package/dist/components/List/List.styles.d.ts +1 -1
- package/dist/components/List/components/ListItem/ListItem.styles.d.ts +1 -1
- package/dist/components/Modal/Modal.styles.d.ts +1 -1
- package/dist/components/MoreMenu/MoreMenu.styles.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -1
- package/dist/components/MultiSelect/MultiSelect.styles.d.ts +1 -1
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +1 -1
- package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +1 -1
- package/dist/components/MultiSelectList/constants.d.ts +1 -1
- package/dist/components/MultiSelectList/helpers.d.ts +1 -1
- package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +1 -1
- package/dist/components/Notification/Notification.styles.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +1 -2
- package/dist/components/NumberInput/helpers.d.ts +2 -2
- package/dist/components/PhoneInput/PhoneInput.styles.d.ts +1 -1
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.styles.d.ts +1 -1
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +3 -373
- package/dist/components/ScrollIntoViewIfNeeded/constants.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +1 -2
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.styles.d.ts +12 -22
- package/dist/components/Select/components/SelectList/SelectList.d.ts +5 -5
- package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +1 -1
- package/dist/components/Select/components/SelectListItem/SelectListItem.d.ts +2 -2
- package/dist/components/Select/helpers.d.ts +1 -1
- package/dist/components/Selector/Selector.d.ts +0 -1
- package/dist/components/Selector/Selector.styles.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.styles.d.ts +1 -1
- package/dist/components/SmartInput/SmartInput.d.ts +1 -1
- package/dist/components/Status/Status.styles.d.ts +1 -1
- package/dist/components/Status/types.d.ts +1 -1
- package/dist/components/Switch/Switch.styles.d.ts +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.styles.d.ts +1 -1
- package/dist/components/TextButton/TextButton.d.ts +1 -1
- package/dist/components/TextButton/TextButton.styles.d.ts +1 -1
- package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +1 -1
- package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.d.ts +1 -1
- package/dist/components/Toaster/Toaster.styles.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.styles.d.ts +1 -1
- package/dist/components/WithMessages/WithMessages.d.ts +1 -1
- package/dist/components/WithMessages/WithMessages.styles.d.ts +1 -1
- package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
- package/dist/components/WithPopup/types.d.ts +4 -4
- package/dist/components/index.d.ts +0 -1
- package/dist/constants/phone-info.d.ts +1 -1
- package/dist/helpers/misc.d.ts +2 -1
- package/dist/helpers/phone.d.ts +1 -1
- package/dist/hooks/use-dropdown.d.ts +3 -3
- package/dist/hooks/use-merge.d.ts +1 -1
- package/dist/hooks/use-mixed-styles.d.ts +3 -3
- package/dist/hooks/use-tweak-styles.d.ts +5 -5
- package/dist/theme/Provider.d.ts +2 -2
- package/dist/theme/common.d.ts +1 -1
- package/dist/theme/helpers.d.ts +3 -3
- package/dist/theme/true-jss/ThemedStylesManager.d.ts +1 -1
- package/dist/theme/true-jss/TweakStylesManager.d.ts +1 -1
- package/dist/theme/types.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +881 -733
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +881 -733
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +4 -4
- package/package.json +14 -16
- package/src/components/AccountInfo/AccountInfo.stories.tsx +19 -27
- package/src/components/AddButton/AddButton.stories.tsx +14 -17
- package/src/components/Button/Button.stories.tsx +7 -24
- package/src/components/Checkbox/Checkbox.stories.tsx +24 -26
- package/src/components/Checkbox/types.ts +1 -1
- package/src/components/CloseButton/CloseButton.stories.tsx +5 -6
- package/src/components/Colors/Colors.stories.tsx +63 -3
- package/src/components/ControlWrapper/ControlWrapper.stories.tsx +43 -38
- package/src/components/ControlWrapper/ControlWrapper.tsx +2 -11
- package/src/components/ControlWrapper/constants.ts +11 -0
- package/src/components/ControlWrapper/index.ts +1 -0
- package/src/components/ControlWrapper/types.ts +4 -1
- package/src/components/DateInput/DateInput.stories.tsx +13 -30
- package/src/components/DatePicker/DatePicker.stories.tsx +15 -52
- package/src/components/Description/Description.stories.tsx +11 -16
- package/src/components/FileInput/FileInput.stories.tsx +59 -63
- package/src/components/FileItem/FileItem.stories.tsx +46 -45
- package/src/components/FiltersPane/FiltersPane.stories.tsx +27 -30
- package/src/components/FiltersPane/components/Filter/Filter.tsx +1 -1
- package/src/components/FiltersPane/components/Filter/helpers.ts +3 -3
- package/src/components/FiltersPane/types.ts +0 -2
- package/src/components/Flag/Flag.stories.tsx +15 -20
- package/src/components/Flag/Flag.tsx +2 -2
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +47 -50
- package/src/components/FloatDocActions/FloatDocActions.stories.tsx +18 -24
- package/src/components/Icon/Icon.stories.tsx +9 -5
- package/src/components/Icon/types.ts +1 -1
- package/src/components/IconButton/IconButton.stories.tsx +7 -11
- package/src/components/IncrementInput/IncrementInput.stories.tsx +25 -25
- package/src/components/Input/Input.stories.tsx +35 -61
- package/src/components/List/List.stories.tsx +22 -17
- package/src/components/List/List.styles.ts +2 -1
- package/src/components/Modal/Modal.stories.tsx +50 -59
- package/src/components/MoreMenu/MoreMenu.stories.tsx +24 -15
- package/src/components/MultiSelect/MultiSelect.stories.tsx +23 -20
- package/src/components/NewMoreMenu/NewMoreMenu.stories.tsx +42 -40
- package/src/components/Notification/Notification.stories.tsx +34 -32
- package/src/components/NumberInput/NumberInput.stories.tsx +27 -27
- package/src/components/PhoneInput/PhoneInput.stories.tsx +28 -54
- package/src/components/PhoneInput/PhoneInput.tsx +1 -1
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +5 -11
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +1 -4
- package/src/components/RadioButton/RadioButton.stories.tsx +28 -31
- package/src/components/RadioButton/types.ts +1 -1
- package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +15 -9
- package/src/components/SearchInput/SearchInput.stories.tsx +14 -14
- package/src/components/Select/CustomSelect.stories.tsx +29 -33
- package/src/components/Select/MultiSelect.stories.tsx +41 -46
- package/src/components/Select/Select.stories.tsx +41 -46
- package/src/components/Select/Select.tsx +27 -27
- package/src/components/Select/components/SelectList/SelectList.tsx +4 -4
- package/src/components/Selector/Selector.stories.tsx +25 -27
- package/src/components/Selector/Selector.tsx +1 -2
- package/src/components/Skeleton/Skeleton.stories.tsx +13 -12
- package/src/components/SmartInput/SmartInput.stories.tsx +23 -23
- package/src/components/Status/Status.stories.tsx +29 -30
- package/src/components/Status/types.ts +1 -1
- package/src/components/Switch/Switch.stories.tsx +19 -26
- package/src/components/TextArea/TextArea.stories.tsx +32 -35
- package/src/components/TextArea/types.ts +1 -1
- package/src/components/TextButton/TextButton.stories.tsx +6 -16
- package/src/components/TextWithInfo/TextWithInfo.stories.tsx +13 -21
- package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +26 -25
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +1 -2
- package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +12 -23
- package/src/components/Toaster/Toaster.stories.tsx +16 -14
- package/src/components/Tooltip/Tooltip.stories.tsx +5 -4
- package/src/components/WithMessages/WithMessages.stories.tsx +16 -20
- package/src/components/WithPopup/WithPopup.stories.tsx +27 -26
- package/src/components/WithTooltip/WithTooltip.stories.tsx +28 -28
- package/src/components/index.ts +0 -1
- package/src/helpers/misc.ts +8 -5
- package/src/helpers/popper-helpers.ts +0 -1
- package/src/theme/helpers.ts +3 -1
- package/src/theme/true-jss/ThemedStylesManager.ts +2 -1
- package/src/theme/true-jss/TweakStylesManager.ts +1 -2
- package/src/theme/types.ts +0 -1
- package/src/types.ts +0 -2
- package/dist/components/Colors/Colors.d.ts +0 -2
- package/dist/components/Colors/Colors.styles.d.ts +0 -1
- package/dist/components/Colors/index.d.ts +0 -1
- package/src/components/Colors/Colors.styles.ts +0 -36
- package/src/components/Colors/Colors.tsx +0 -26
- package/src/components/Colors/index.ts +0 -1
- package/src/components/Flag/customFlags/augment.d.ts +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { FocusEventHandler, KeyboardEvent, KeyboardEventHandler, MouseEvent, MouseEventHandler, PointerEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { Modifier, Placement } from 'react-overlays/usePopper';
|
|
3
|
+
import { JssStyle } from 'jss';
|
|
4
|
+
import { IMaybeArray } from './theme';
|
|
5
5
|
export interface ITestIdProps {
|
|
6
6
|
testId?: string;
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@true-engineering/true-react-common-ui-kit",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-alpha46",
|
|
4
4
|
"description": "True Engineering React UI Kit with theming support",
|
|
5
5
|
"author": "True Engineering (https://trueengineering.ru)",
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@floating-ui/react": "^0.27.13",
|
|
51
51
|
"@true-engineering/true-react-platform-helpers": "^1.0.0",
|
|
52
52
|
"clsx": "^2.1.1",
|
|
53
|
-
"country-flag-icons": "1.5.
|
|
53
|
+
"country-flag-icons": "1.5.21",
|
|
54
54
|
"date-fns": "^4.1.0",
|
|
55
55
|
"filesize": "10.1.1",
|
|
56
56
|
"hex-to-rgba": "2.0.1",
|
|
@@ -69,32 +69,30 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@babel/core": "7.20.12",
|
|
72
|
-
"@storybook/
|
|
73
|
-
"@storybook/blocks": "7.6.17",
|
|
74
|
-
"@storybook/react": "7.6.17",
|
|
75
|
-
"@storybook/react-vite": "7.6.17",
|
|
76
|
-
"@storybook/test": "7.6.17",
|
|
72
|
+
"@storybook/react": "9.1.10",
|
|
77
73
|
"@swc/core": "^1.3.30",
|
|
78
74
|
"@trivago/prettier-plugin-sort-imports": "4.3.0",
|
|
79
75
|
"@types/lodash-es": "4.17.11",
|
|
76
|
+
"@types/node": "^24.7.2",
|
|
80
77
|
"@types/react": "18.2.79",
|
|
81
78
|
"@types/react-dom": "18.2.25",
|
|
82
79
|
"@types/react-input-mask": "3.0.2",
|
|
83
80
|
"@types/react-transition-group": "4.4.10",
|
|
84
|
-
"@typescript-eslint/eslint-plugin": "5.48.2",
|
|
85
|
-
"@typescript-eslint/parser": "5.48.2",
|
|
86
81
|
"@vitejs/plugin-react": "3.0.0",
|
|
87
|
-
"eslint": "
|
|
88
|
-
"eslint-config-prettier": "
|
|
89
|
-
"eslint-
|
|
90
|
-
"eslint-plugin-
|
|
91
|
-
"eslint-plugin-react
|
|
82
|
+
"eslint": "^9.34.0",
|
|
83
|
+
"eslint-config-prettier": "^10.1.8",
|
|
84
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
85
|
+
"eslint-plugin-import": "^2.32.0",
|
|
86
|
+
"eslint-plugin-react": "^7.37.5",
|
|
87
|
+
"eslint-plugin-react-hooks": "6.0.0-rc.1",
|
|
88
|
+
"globals": "^16.3.0",
|
|
92
89
|
"prettier": "2.8.3",
|
|
93
90
|
"rollup-plugin-swc3": "0.3.0",
|
|
94
|
-
"typescript": "
|
|
91
|
+
"typescript": "5.8.2",
|
|
92
|
+
"typescript-eslint": "^8.42.0",
|
|
95
93
|
"unplugin-swc": "1.3.2",
|
|
96
94
|
"vite": "4.0.0",
|
|
97
|
-
"vite-plugin-dts": "
|
|
95
|
+
"vite-plugin-dts": "4.5.4"
|
|
98
96
|
},
|
|
99
97
|
"resolutions": {
|
|
100
98
|
"strip-ansi": "6.0.1"
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
3
|
+
import { excludeStorybookParams } from '../../helpers';
|
|
4
|
+
import { AccountInfo, IAccountInfoProps } from './AccountInfo';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
component: AccountInfo,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const Template: ComponentStory<typeof AccountInfo> = (args) => (
|
|
10
|
-
<div
|
|
11
|
-
style={{
|
|
12
|
-
display: 'flex',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
justifyContent: 'center',
|
|
15
|
-
width: 400,
|
|
16
|
-
height: 200,
|
|
17
|
-
border: '1px dotted rgba(0, 0, 0, 0.2)',
|
|
18
|
-
}}
|
|
19
|
-
>
|
|
20
|
-
<AccountInfo {...args} options={[{ item: 'Logout', onClick: () => console.log('logout') }]} />
|
|
21
|
-
</div>
|
|
6
|
+
const Story: FC<IAccountInfoProps> = (args) => (
|
|
7
|
+
<AccountInfo {...args} options={[{ item: 'Logout', onClick: () => console.log('logout') }]} />
|
|
22
8
|
);
|
|
23
9
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
const meta: Meta<typeof Story> = {
|
|
11
|
+
title: 'Data Display/AccountInfo',
|
|
12
|
+
component: Story,
|
|
13
|
+
args: {
|
|
14
|
+
accountName: 'Ivan Ivanov',
|
|
15
|
+
},
|
|
16
|
+
parameters: {
|
|
17
|
+
controls: {
|
|
18
|
+
exclude: excludeStorybookParams(['avatar', 'options']),
|
|
19
|
+
},
|
|
31
20
|
},
|
|
32
21
|
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
export const Default = {};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
3
|
+
import { AddButton, IAddButtonProps } from '../AddButton';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
title: 'Buttons/AddButton',
|
|
6
|
-
component: AddButton,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const Template: ComponentStory<typeof AddButton> = (args) => (
|
|
10
|
-
<AddButton {...args} onClick={console.log} />
|
|
11
|
-
);
|
|
5
|
+
const Story: FC<IAddButtonProps> = (args) => <AddButton {...args} onClick={console.log} />;
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
const meta: Meta<typeof Story> = {
|
|
8
|
+
title: 'Buttons/AddButton',
|
|
9
|
+
component: Story,
|
|
10
|
+
args: {
|
|
11
|
+
text: 'Добавить билет',
|
|
12
|
+
isDisabled: false,
|
|
13
|
+
isFullWidth: false,
|
|
14
|
+
},
|
|
19
15
|
};
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
export default meta;
|
|
18
|
+
export const Default = {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Meta } from '@storybook/react';
|
|
2
2
|
import { iconsMap } from '../Icon';
|
|
3
3
|
import { Button, IButtonProps } from './Button';
|
|
4
|
-
import { BUTTON_SIZES
|
|
5
|
-
|
|
6
|
-
const icons = [undefined, ...Object.keys(iconsMap)];
|
|
4
|
+
import { BUTTON_SIZES } from './constants';
|
|
7
5
|
|
|
8
6
|
const preloaderTypes: Array<IButtonProps['preloaderType']> = ['dots', 'default', 'logo'];
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
const meta: Meta<typeof Button> = {
|
|
11
9
|
title: 'Buttons/Button',
|
|
12
10
|
component: Button,
|
|
13
11
|
args: {
|
|
@@ -24,26 +22,11 @@ export default {
|
|
|
24
22
|
isFullWidth: false,
|
|
25
23
|
},
|
|
26
24
|
argTypes: {
|
|
27
|
-
icon: { options:
|
|
25
|
+
icon: { options: [undefined, ...Object.keys(iconsMap)], control: 'select' },
|
|
28
26
|
size: { options: BUTTON_SIZES, control: 'inline-radio' },
|
|
29
|
-
view: { options: BUTTON_VIEWS, control: 'inline-radio' },
|
|
30
|
-
iconPosition: { options: ['left', 'right'], control: 'inline-radio' },
|
|
31
27
|
preloaderType: { options: preloaderTypes, control: 'inline-radio' },
|
|
32
28
|
},
|
|
33
|
-
|
|
34
|
-
controls: {
|
|
35
|
-
exclude: [
|
|
36
|
-
'data',
|
|
37
|
-
'testId',
|
|
38
|
-
'onClick',
|
|
39
|
-
'onMouseDown',
|
|
40
|
-
'tweakStyles',
|
|
41
|
-
'shouldSkipTabNavigation',
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
} as ComponentMeta<typeof Button>;
|
|
29
|
+
};
|
|
46
30
|
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
);
|
|
31
|
+
export default meta;
|
|
32
|
+
export const Default = {};
|
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import { FC, useState } from 'react';
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
3
|
+
import { excludeStorybookParams } from '../../helpers';
|
|
3
4
|
import { IExtendableProps } from '../../types';
|
|
4
|
-
import { Checkbox
|
|
5
|
+
import { Checkbox, ICheckboxProps } from '../Checkbox';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const SIZES = ['micro'] as const;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
declare module './types' {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
11
|
+
export interface ICheckboxSizes extends IExtendableProps<typeof SIZES> {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Story: FC<ICheckboxProps<string>> = (args) => {
|
|
9
15
|
const [isChecked, setIsChecked] = useState(false);
|
|
10
16
|
const [isSemiChecked, setIsSemiChecked] = useState(false);
|
|
11
17
|
|
|
12
18
|
return (
|
|
13
19
|
<div style={{ gap: 10, display: 'grid' }}>
|
|
14
|
-
<
|
|
20
|
+
<Checkbox
|
|
15
21
|
isChecked={isChecked}
|
|
16
22
|
isSemiChecked={isSemiChecked}
|
|
17
23
|
onSelect={({ isSelected }) => {
|
|
18
24
|
setIsChecked(isSelected);
|
|
19
25
|
setIsSemiChecked(false);
|
|
20
26
|
}}
|
|
21
|
-
{...
|
|
27
|
+
{...args}
|
|
22
28
|
>
|
|
23
29
|
Use wrapping paper
|
|
24
|
-
</
|
|
25
|
-
<
|
|
30
|
+
</Checkbox>
|
|
31
|
+
<Checkbox
|
|
26
32
|
value={undefined}
|
|
27
33
|
isChecked={isSemiChecked}
|
|
28
34
|
onSelect={({ isSelected }) => setIsSemiChecked(isSelected)}
|
|
29
|
-
{...
|
|
35
|
+
{...args}
|
|
30
36
|
>
|
|
31
37
|
Is Semi Checked
|
|
32
|
-
</
|
|
38
|
+
</Checkbox>
|
|
33
39
|
</div>
|
|
34
40
|
);
|
|
35
41
|
};
|
|
36
42
|
|
|
37
|
-
const meta: Meta<typeof
|
|
43
|
+
const meta: Meta<typeof Story> = {
|
|
38
44
|
title: 'Controls/Checkbox',
|
|
39
|
-
component:
|
|
45
|
+
component: Story,
|
|
40
46
|
args: {
|
|
41
47
|
value: 'value',
|
|
42
48
|
labelPosition: 'right',
|
|
@@ -45,23 +51,15 @@ const meta: Meta<typeof CheckboxComponentWithData> = {
|
|
|
45
51
|
isDisabled: false,
|
|
46
52
|
isReadonly: false,
|
|
47
53
|
},
|
|
54
|
+
argTypes: {
|
|
55
|
+
size: { options: [undefined, ...SIZES], control: 'inline-radio' },
|
|
56
|
+
},
|
|
48
57
|
parameters: {
|
|
49
58
|
controls: {
|
|
50
|
-
exclude: ['
|
|
59
|
+
exclude: excludeStorybookParams(['isChecked', 'isSemiChecked']),
|
|
51
60
|
},
|
|
52
61
|
},
|
|
53
|
-
argTypes: {
|
|
54
|
-
size: { options: [undefined, ...CHECKBOX_SIZES], control: 'inline-radio' },
|
|
55
|
-
},
|
|
56
62
|
};
|
|
57
63
|
|
|
58
|
-
declare module './types' {
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
60
|
-
export interface ICheckboxSizes extends IExtendableProps<typeof CHECKBOX_SIZES> {}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
64
|
export default meta;
|
|
64
|
-
|
|
65
|
-
type Story = StoryObj<typeof CheckboxComponent>;
|
|
66
|
-
|
|
67
|
-
export const Default: Story = {};
|
|
65
|
+
export const Default = {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Meta } from '@storybook/react';
|
|
2
2
|
import { CloseButton } from './CloseButton';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const meta: Meta<typeof CloseButton> = {
|
|
5
5
|
title: 'Buttons/CloseButton',
|
|
6
6
|
component: CloseButton,
|
|
7
|
-
|
|
8
|
-
argTypes: {},
|
|
9
|
-
} as ComponentMeta<typeof CloseButton>;
|
|
7
|
+
};
|
|
10
8
|
|
|
11
|
-
export
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {};
|
|
@@ -1,7 +1,67 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type Meta } from '@storybook/react';
|
|
3
|
+
import { createThemedStyles, useTheme } from '../../theme';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
const useStyles = createThemedStyles({
|
|
6
|
+
root: {
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexWrap: 'wrap',
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
colorCard: {
|
|
12
|
+
width: 120,
|
|
13
|
+
border: 'solid 1px #dde3ed',
|
|
14
|
+
borderRadius: 8,
|
|
15
|
+
color: '#222a37',
|
|
16
|
+
fontSize: 14,
|
|
17
|
+
margin: 6,
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
color: {
|
|
21
|
+
height: 120,
|
|
22
|
+
borderTopLeftRadius: 8,
|
|
23
|
+
borderTopRightRadius: 8,
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
colorName: {
|
|
27
|
+
marginBottom: 6,
|
|
28
|
+
padding: 6,
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
hex: {
|
|
33
|
+
marginTop: 6,
|
|
34
|
+
textTransform: 'uppercase',
|
|
35
|
+
fontWeight: 'bold',
|
|
36
|
+
padding: [0, 6, 6],
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const Story: FC = () => {
|
|
41
|
+
const classes = useStyles();
|
|
42
|
+
const theme = useTheme();
|
|
43
|
+
const { colors = {} } = theme;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div className={classes.root}>
|
|
47
|
+
{Object.entries(colors as Record<string, string>).map(([colorName, color]) => {
|
|
48
|
+
const name = colorName.split('_').join(' ').toLowerCase();
|
|
49
|
+
return (
|
|
50
|
+
<div key={colorName} className={classes.colorCard}>
|
|
51
|
+
<div className={classes.color} style={{ backgroundColor: color }} />
|
|
52
|
+
<div className={classes.colorName}>{`${name[0].toUpperCase()}${name.slice(1)}`}</div>
|
|
53
|
+
<div className={classes.hex}>{color}</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
})}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const meta: Meta = {
|
|
4
62
|
title: 'Data Display/Colors',
|
|
63
|
+
component: Story,
|
|
5
64
|
};
|
|
6
65
|
|
|
7
|
-
export
|
|
66
|
+
export default meta;
|
|
67
|
+
export const Default = {};
|
|
@@ -1,50 +1,55 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { doNothing } from '@true-engineering/true-react-platform-helpers';
|
|
2
|
-
import {
|
|
3
|
+
import { type Meta } from '@storybook/react';
|
|
4
|
+
import { excludeStorybookParams } from '../../helpers';
|
|
5
|
+
import { IExtendableProps } from '../../types';
|
|
3
6
|
import { Icon, iconsMap } from '../Icon';
|
|
4
|
-
import { ControlWrapper } from './ControlWrapper';
|
|
7
|
+
import { ControlWrapper, IControlWrapperProps } from './ControlWrapper';
|
|
8
|
+
import { GROUP_PLACEMENTS } from './constants';
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
const SIZES = ['micro'] as const;
|
|
11
|
+
|
|
12
|
+
declare module './types' {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
14
|
+
export interface IControlWrapperSizes extends IExtendableProps<typeof SIZES> {}
|
|
15
|
+
}
|
|
10
16
|
|
|
11
|
-
const
|
|
17
|
+
const Story: FC<IControlWrapperProps> = (args) => (
|
|
12
18
|
<ControlWrapper {...args} onClear={doNothing}>
|
|
13
19
|
<div style={{ minWidth: 200, height: 48 }} />
|
|
14
20
|
</ControlWrapper>
|
|
15
21
|
);
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
Default.argTypes = {
|
|
35
|
-
icon: { control: 'select', options: [undefined, ...Object.keys(iconsMap)] },
|
|
36
|
-
groupPlacement: {
|
|
37
|
-
control: 'select',
|
|
38
|
-
options: [
|
|
39
|
-
'top',
|
|
40
|
-
'bottom',
|
|
41
|
-
'top-left',
|
|
42
|
-
'top-right',
|
|
43
|
-
'bottom-left',
|
|
44
|
-
'bottom-right',
|
|
45
|
-
'left',
|
|
46
|
-
'right',
|
|
47
|
-
'middle',
|
|
23
|
+
const meta: Meta<typeof Story> = {
|
|
24
|
+
title: 'Controls/ControlWrapper',
|
|
25
|
+
component: Story,
|
|
26
|
+
args: {
|
|
27
|
+
label: 'Label',
|
|
28
|
+
isInvalid: false,
|
|
29
|
+
isFocused: false,
|
|
30
|
+
isRequired: false,
|
|
31
|
+
isLoading: false,
|
|
32
|
+
isDisabled: false,
|
|
33
|
+
hasValue: false,
|
|
34
|
+
isActive: false,
|
|
35
|
+
isFullWidth: false,
|
|
36
|
+
icon: [
|
|
37
|
+
{ iconComponent: <div>Бу</div>, onClick: () => console.log('close'), shouldResetSize: true },
|
|
38
|
+
{ iconComponent: <Icon type="plus" /> },
|
|
39
|
+
{ iconComponent: 'search', onClick: () => console.log('search') },
|
|
48
40
|
],
|
|
49
41
|
},
|
|
42
|
+
argTypes: {
|
|
43
|
+
size: { options: [undefined, ...SIZES], control: 'inline-radio' },
|
|
44
|
+
icon: { options: [undefined, ...Object.keys(iconsMap)], control: 'select' },
|
|
45
|
+
groupPlacement: { options: [undefined, ...GROUP_PLACEMENTS], control: 'select' },
|
|
46
|
+
},
|
|
47
|
+
parameters: {
|
|
48
|
+
controls: {
|
|
49
|
+
exclude: excludeStorybookParams(['children']),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
50
52
|
};
|
|
53
|
+
|
|
54
|
+
export default meta;
|
|
55
|
+
export const Default = {};
|
|
@@ -15,7 +15,7 @@ import { IClickHandlerEvent, ICommonProps } from '../../types';
|
|
|
15
15
|
import { Icon, IIcon, renderIcon } from '../Icon';
|
|
16
16
|
import { ThemedPreloader } from '../ThemedPreloader';
|
|
17
17
|
import { convertToControlWrapperIcon } from './helpers';
|
|
18
|
-
import { IControlWrapperIcon, IControlWrapperSize } from './types';
|
|
18
|
+
import { IControlWrapperIcon, IControlWrapperSize, IGroupPlacement } from './types';
|
|
19
19
|
import { IControlWrapperStyles, useStyles } from './ControlWrapper.styles';
|
|
20
20
|
|
|
21
21
|
export interface IControlWrapperProps extends ICommonProps<IControlWrapperStyles> {
|
|
@@ -23,16 +23,7 @@ export interface IControlWrapperProps extends ICommonProps<IControlWrapperStyles
|
|
|
23
23
|
label?: ReactNode;
|
|
24
24
|
icon?: IMaybeArray<IIcon | IControlWrapperIcon>;
|
|
25
25
|
size?: IControlWrapperSize;
|
|
26
|
-
groupPlacement?:
|
|
27
|
-
| 'left'
|
|
28
|
-
| 'right'
|
|
29
|
-
| 'middle'
|
|
30
|
-
| 'top'
|
|
31
|
-
| 'bottom'
|
|
32
|
-
| 'top-left'
|
|
33
|
-
| 'top-right'
|
|
34
|
-
| 'bottom-left'
|
|
35
|
-
| 'bottom-right';
|
|
26
|
+
groupPlacement?: IGroupPlacement;
|
|
36
27
|
/** @default false */
|
|
37
28
|
isInvalid?: boolean;
|
|
38
29
|
/** @default false */
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type Key } from 'react';
|
|
2
2
|
import { IClickHandlerEvent } from '../../types';
|
|
3
3
|
import { IIcon } from '../Icon';
|
|
4
|
+
import { GROUP_PLACEMENTS } from './constants';
|
|
4
5
|
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
6
7
|
export interface IControlWrapperSizes {}
|
|
7
8
|
|
|
8
9
|
export type IControlWrapperSize = keyof IControlWrapperSizes;
|
|
9
10
|
|
|
11
|
+
export type IGroupPlacement = (typeof GROUP_PLACEMENTS)[number];
|
|
12
|
+
|
|
10
13
|
// подумать над extend HTMLAttributes<HTMLDivElement>
|
|
11
14
|
export interface IControlWrapperIcon {
|
|
12
15
|
key?: Key;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { FC, useEffect, useState } from 'react';
|
|
2
2
|
import { format, isValid } from 'date-fns';
|
|
3
|
-
import {
|
|
4
|
-
import { DateInput } from './DateInput';
|
|
3
|
+
import { type Meta } from '@storybook/react';
|
|
4
|
+
import { DateInput, IDateInputProps } from './DateInput';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
title: 'Inputs/DateInput',
|
|
8
|
-
component: DateInput,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof DateInput> = ({ date, startDate, endDate, ...args }) => {
|
|
6
|
+
const Story: FC<IDateInputProps> = ({ date, startDate, endDate, ...args }) => {
|
|
12
7
|
const [value, setValue] = useState(date);
|
|
13
8
|
|
|
14
9
|
const startDateValue = isValid(startDate)
|
|
@@ -35,26 +30,14 @@ const Template: ComponentStory<typeof DateInput> = ({ date, startDate, endDate,
|
|
|
35
30
|
);
|
|
36
31
|
};
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
isRange: false,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
Default.parameters = {
|
|
48
|
-
controls: {
|
|
49
|
-
exclude: [
|
|
50
|
-
'data',
|
|
51
|
-
'testId',
|
|
52
|
-
'tabIndex',
|
|
53
|
-
'onChange',
|
|
54
|
-
'onFocus',
|
|
55
|
-
'onBlur',
|
|
56
|
-
'onPaste',
|
|
57
|
-
'onKeyDown',
|
|
58
|
-
],
|
|
33
|
+
const meta: Meta<typeof Story> = {
|
|
34
|
+
title: 'Inputs/DateInput',
|
|
35
|
+
component: Story,
|
|
36
|
+
args: {
|
|
37
|
+
date: '23.01.2023',
|
|
38
|
+
isRange: false,
|
|
59
39
|
},
|
|
60
40
|
};
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
export const Default = {};
|