@mailstep/design-system 0.8.16-beta.2 → 0.8.16-beta.21
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/package.json +12 -6
- package/ui/Blocks/CommonGrid/components/ColumnTitle.js +4 -2
- package/ui/Blocks/CommonGrid/components/ControlButtons/styles.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/DropdownButton/DropdownButton.js +1 -1
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +9 -8
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +1 -2
- package/ui/Blocks/CommonGrid/components/Filters/GridSelect/GridSelect.js +5 -4
- package/ui/Blocks/CommonGrid/components/Filters/TextRange/TextRange.js +1 -1
- package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/styles.d.ts +2 -2
- package/ui/Blocks/CommonGrid/components/MobileFilterModal.js +2 -2
- package/ui/Blocks/CommonGrid/components/MobileSortModal.js +1 -1
- package/ui/Blocks/CommonGrid/components/QuickFilter/QuickFilter.js +1 -4
- package/ui/Blocks/CommonGrid/components/Table.d.ts +28 -28
- package/ui/Blocks/CommonGrid/components/Table.js +1 -1
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useEvent.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useUxReset.d.ts +1 -1
- package/ui/Blocks/CommonGrid/store/index.d.ts +14 -14
- package/ui/Blocks/CommonGrid/styles.d.ts +6 -5
- package/ui/Blocks/CommonGrid/styles.js +6 -9
- package/ui/Blocks/CommonGrid/utils/index.d.ts +1 -1
- package/ui/Blocks/Header/components/MenuItems/styles.d.ts +1 -1
- package/ui/Blocks/Header/components/MenuItems/styles.js +1 -1
- package/ui/Blocks/Header/hooks/useChangeLanguage.js +0 -1
- package/ui/Blocks/Header/stories/Header.stories.d.ts +16 -16
- package/ui/Blocks/Header/styles.js +2 -2
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +2 -2
- package/ui/Blocks/ImageList/components/AddPhoto/styles.d.ts +2 -2
- package/ui/Blocks/ImageList/components/CloseButton/styles.d.ts +1 -1
- package/ui/Blocks/ImageList/components/ImageElement/styles.d.ts +1 -1
- package/ui/Blocks/ImageList/styles.d.ts +2 -2
- package/ui/Blocks/LanguageSwitch/LanguageSwitch.js +10 -5
- package/ui/Blocks/LanguageSwitch/styles.d.ts +2 -7
- package/ui/Blocks/LanguageSwitch/styles.js +3 -11
- package/ui/Blocks/LoginPage/stories/LoginPage.stories.js +2 -2
- package/ui/Blocks/LoginPage/styles.d.ts +2 -3
- package/ui/Blocks/Modal/styles.d.ts +7 -7
- package/ui/Blocks/Modal/styles.js +8 -8
- package/ui/Blocks/Scheduler/components/Groups/styles.d.ts +1 -1
- package/ui/Blocks/Scheduler/components/TimeSlots/styles.d.ts +1 -1
- package/ui/Blocks/SideMenu/components/Footer.d.ts +1 -1
- package/ui/Blocks/SideMenu/components/HamburgerMenu.js +2 -3
- package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +1 -0
- package/ui/Blocks/SideMenu/styles.d.ts +15 -15
- package/ui/Blocks/Stepper/components/StepCircle/styles.d.ts +2 -2
- package/ui/Blocks/Stepper/components/StepItem/styles.d.ts +3 -3
- package/ui/Blocks/Table/stories/Table.stories.d.ts +3 -2
- package/ui/Blocks/Tabs/styles.d.ts +6 -5
- package/ui/Elements/Alert/styles.d.ts +18 -17
- package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +2 -1
- package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.js +2 -2
- package/ui/Elements/BarChartSymbol/styles.d.ts +2 -2
- package/ui/Elements/BorderedBox/types.d.ts +1 -0
- package/ui/Elements/Button/styles.d.ts +6 -5
- package/ui/Elements/Card/styles.d.ts +2 -2
- package/ui/Elements/Card/types.d.ts +1 -0
- package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +2 -2
- package/ui/Elements/DatePicker/Datetime/components/FooterRow.d.ts +1 -1
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +1 -1
- package/ui/Elements/DatePicker/styles.d.ts +2 -1
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +1 -1
- package/ui/Elements/Icon/Icon.js +6 -6
- package/ui/Elements/Icon/icons/FlagHU.js +1 -1
- package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +1 -1
- package/ui/Elements/Label/Label.d.ts +1 -1
- package/ui/Elements/Label/stories/Label.stories.d.ts +1 -1
- package/ui/Elements/Link/stories/Link.stories.d.ts +12 -12
- package/ui/Elements/Logo/Logo.js +2 -2
- package/ui/Elements/Pagination/styled.d.ts +2 -1
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +5 -5
- package/ui/Elements/ProgressBar/styles.d.ts +1 -1
- package/ui/Elements/Select/Select.js +6 -6
- package/ui/Elements/Select/components/ConnectedMenu.js +2 -3
- package/ui/Elements/Select/components/CountMultiValue.d.ts +10 -1
- package/ui/Elements/Select/components/CountMultiValue.js +16 -7
- package/ui/Elements/Select/components/DropdownIndicator.d.ts +6 -1
- package/ui/Elements/Select/components/DropdownIndicator.js +3 -2
- package/ui/Elements/Select/components/IconValueContainer.js +1 -1
- package/ui/Elements/Select/components/SimplifiedOption.d.ts +1 -0
- package/ui/Elements/Select/stories/Select.stories.d.ts +10 -0
- package/ui/Elements/Select/stories/Select.stories.js +15 -0
- package/ui/Elements/Select/themes/index.d.ts +1 -1
- package/ui/Elements/Select/themes/index.js +4 -14
- package/ui/Elements/Select/themes/selectStyles.d.ts +1 -1
- package/ui/Elements/Select/themes/selectStyles.js +28 -30
- package/ui/Elements/Select/types.d.ts +10 -7
- package/ui/Elements/SingleSelect/SingleSelect.d.ts +2 -2
- package/ui/Elements/SingleSelect/SingleSelect.js +13 -22
- package/ui/Elements/SpaceAround/types.d.ts +1 -0
- package/ui/Elements/Spinner/styles.d.ts +1 -1
- package/ui/Elements/Tag/types.d.ts +1 -0
- package/ui/Elements/Toast/styles.d.ts +1 -1
- package/ui/Forms/Checkbox/styles.d.ts +2 -1
- package/ui/Forms/Checkbox/styles.js +1 -1
- package/ui/Forms/Input/styles.d.ts +3 -3
- package/ui/Forms/Input/styles.js +2 -2
- package/ui/Forms/TextArea/styles.d.ts +5 -5
- package/ui/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/ui/ThemeProvider/ThemeProvider.js +1 -1
- package/ui/ThemeProvider/themes/dark.d.ts +154 -0
- package/ui/ThemeProvider/themes/dark.js +14 -0
- package/ui/ThemeProvider/themes/default.d.ts +2 -0
- package/ui/ThemeProvider/themes/default.js +13 -9
- package/ui/ThemeProvider/themes/index.d.ts +155 -1
- package/ui/ThemeProvider/themes/index.js +3 -3
- package/ui/ThemeProvider/themes/mailwise.js +1 -1
- package/ui/ThemeProvider/types.d.ts +13 -33
- package/ui/index.es.js +15390 -16026
- package/ui/index.umd.js +502 -516
- package/ui/utils/index.js +1 -1
- package/ui/utils/translations.d.ts +4 -1
- package/ui/utils/translations.js +2 -2
- package/ui/Elements/Select/components/ResetAll.d.ts +0 -5
- package/ui/Elements/Select/components/ResetAll.js +0 -15
- package/ui/ThemeProvider/themes/light.d.ts +0 -4
- package/ui/ThemeProvider/themes/light.js +0 -7
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const StyledWrapper: import('styled-components').StyledComponent<"span", import('@xstyled/system').Theme, {}, never>;
|
|
2
3
|
export declare const LoadingIconWrapper: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
3
4
|
$addMarginRight: boolean;
|
|
4
5
|
}, never>;
|
|
5
6
|
export declare const StyledIcon: import('styled-components').StyledComponent<import('react').FC<import('../Icon').IconProps>, import('@xstyled/system').Theme, {
|
|
6
|
-
$addMarginRight?: boolean;
|
|
7
|
-
$addMarginLeft?: boolean;
|
|
7
|
+
$addMarginRight?: boolean | undefined;
|
|
8
|
+
$addMarginLeft?: boolean | undefined;
|
|
8
9
|
}, never>;
|
|
9
10
|
export declare const StyledButton: import('styled-components').StyledComponent<"button", import('@xstyled/system').Theme, {
|
|
10
11
|
disabled: boolean;
|
|
11
12
|
children?: any;
|
|
12
13
|
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
13
|
-
iconPadding?: boolean;
|
|
14
|
-
fullWidth?: boolean;
|
|
15
|
-
height?: string;
|
|
14
|
+
iconPadding?: boolean | undefined;
|
|
15
|
+
fullWidth?: boolean | undefined;
|
|
16
|
+
height?: string | undefined;
|
|
16
17
|
}, never>;
|
|
@@ -2,7 +2,7 @@ import { Display } from './types';
|
|
|
2
2
|
|
|
3
3
|
export declare const StyledCard: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
4
4
|
display: Display;
|
|
5
|
-
bg?: string;
|
|
5
|
+
bg?: string | undefined;
|
|
6
6
|
hasOnClick: boolean;
|
|
7
|
-
maxWidth?: string;
|
|
7
|
+
maxWidth?: string | undefined;
|
|
8
8
|
}, never>;
|
|
@@ -3,8 +3,8 @@ import { StoryObj } from '@storybook/react-webpack5';
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: import('react').FC<{
|
|
6
|
-
checked?: boolean;
|
|
7
|
-
color?: string;
|
|
6
|
+
checked?: boolean | undefined;
|
|
7
|
+
color?: string | undefined;
|
|
8
8
|
}>;
|
|
9
9
|
tags: string[];
|
|
10
10
|
argTypes: {};
|
|
@@ -24,7 +24,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
-
import {
|
|
27
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
28
28
|
// @ts-nocheck
|
|
29
29
|
import React from 'react';
|
|
30
30
|
import { DateRepeater } from '../components/DateRepeater';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DatePickerBase: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements, "color">) => import('react').ReactElement<any, string>, import('@xstyled/system').Theme, import('@xstyled/system').SystemProps<import('@xstyled/system').Theme>, "color">;
|
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
import styled, { css } from '@xstyled/styled-components';
|
|
7
|
-
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"], ["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"])), function (props) {
|
|
7
|
+
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n display: flex;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"], ["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n display: flex;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"])), function (props) {
|
|
8
8
|
return props.hasSeparator && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-top: slim;\n border-color: lightGray2;\n "], ["\n border-top: slim;\n border-color: lightGray2;\n "])));
|
|
9
9
|
});
|
|
10
10
|
var IconWrap = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-right: 10px;\n"], ["\n margin-right: 10px;\n"])));
|
package/ui/Elements/Icon/Icon.js
CHANGED
|
@@ -146,12 +146,12 @@ export var iconDictionary = {
|
|
|
146
146
|
chevronDown: faChevronDown,
|
|
147
147
|
chevronRight: farChevronRight,
|
|
148
148
|
clock: faClock,
|
|
149
|
-
complaint: faFileAlt,
|
|
149
|
+
complaint: faFileAlt,
|
|
150
150
|
computerMouseScrollwheel: faComputerMouseScrollwheel,
|
|
151
151
|
mailLight: faEnvelopeLight,
|
|
152
152
|
eshop: faStore,
|
|
153
|
-
expedition: faShippingFast,
|
|
154
|
-
equals: faEquals,
|
|
153
|
+
expedition: faShippingFast,
|
|
154
|
+
equals: faEquals,
|
|
155
155
|
fluxCapacitor: faFluxCapacitor,
|
|
156
156
|
wineGlassCrack: faWineGlassCrack,
|
|
157
157
|
paperPlane: faPaperPlane,
|
|
@@ -181,10 +181,10 @@ export var iconDictionary = {
|
|
|
181
181
|
boxChecked: faBoxCircleCheck,
|
|
182
182
|
shelves: faShelves,
|
|
183
183
|
reservation: faHandHoldingBox,
|
|
184
|
-
return: [faShareSquare, 'horizontal'],
|
|
185
|
-
search: faSearch,
|
|
184
|
+
return: [faShareSquare, 'horizontal'],
|
|
185
|
+
search: faSearch,
|
|
186
186
|
supplier: farTriangleExclamation,
|
|
187
|
-
transfer: faExchange,
|
|
187
|
+
transfer: faExchange,
|
|
188
188
|
users: faUsersGear,
|
|
189
189
|
warning: farTriangleExclamation,
|
|
190
190
|
close: fasXmark,
|
|
@@ -10,4 +10,4 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
export var FlagHU = function (props) { return (_jsxs("svg", __assign({ width: "28", height: "20" }, props, { children: [_jsx("
|
|
13
|
+
export var FlagHU = function (props) { return (_jsxs("svg", __assign({ width: "28", height: "20", viewBox: "0 0 9 6" }, props, { children: [_jsx("rect", { fill: "#477050", width: "9", height: "6" }), _jsx("rect", { fill: "#FFF", width: "9", height: "4" }), _jsx("rect", { fill: "#ce2939", width: "9", height: "2" })] }))); };
|
|
@@ -11,7 +11,7 @@ declare const meta: {
|
|
|
11
11
|
style?: "normal" | "light" | "solid" | undefined;
|
|
12
12
|
fill?: string | undefined;
|
|
13
13
|
stroke?: string | undefined;
|
|
14
|
-
size?:
|
|
14
|
+
size?: string | number | undefined;
|
|
15
15
|
className?: string | undefined;
|
|
16
16
|
fixedWidth?: boolean | undefined;
|
|
17
17
|
spinning?: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const Label: import('styled-components').StyledComponent<"label", import('@xstyled/system').Theme, {
|
|
2
|
-
fontSize?: number |
|
|
2
|
+
fontSize?: string | number | undefined;
|
|
3
3
|
}, never>;
|
|
4
4
|
export declare const FieldLabel: import('styled-components').StyledComponent<"label", import('@xstyled/system').Theme, {}, never>;
|
|
@@ -3,7 +3,7 @@ import { StoryObj } from '@storybook/react-webpack5';
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: import('styled-components').StyledComponent<"label", import('@xstyled/system').Theme, {
|
|
6
|
-
fontSize?: number |
|
|
6
|
+
fontSize?: string | number | undefined;
|
|
7
7
|
}, never>;
|
|
8
8
|
tags: string[];
|
|
9
9
|
argTypes: {};
|
|
@@ -4,18 +4,18 @@ declare const meta: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
component: import('react').FC<{
|
|
6
6
|
as?: any;
|
|
7
|
-
children?:
|
|
8
|
-
to?: string | {
|
|
9
|
-
pathname?: string;
|
|
10
|
-
search?: string;
|
|
11
|
-
hash?: string;
|
|
12
|
-
state?: object;
|
|
13
|
-
} |
|
|
14
|
-
target?: string;
|
|
15
|
-
color?: string;
|
|
16
|
-
size?: number | "inherit";
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
onClick?: Function;
|
|
7
|
+
children?: import('react').ReactNode;
|
|
8
|
+
to?: string | Function | {
|
|
9
|
+
pathname?: string | undefined;
|
|
10
|
+
search?: string | undefined;
|
|
11
|
+
hash?: string | undefined;
|
|
12
|
+
state?: object | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
target?: string | undefined;
|
|
15
|
+
color?: string | undefined;
|
|
16
|
+
size?: number | "inherit" | undefined;
|
|
17
|
+
disabled?: boolean | undefined;
|
|
18
|
+
onClick?: Function | undefined;
|
|
19
19
|
}>;
|
|
20
20
|
tags: string[];
|
|
21
21
|
argTypes: {};
|
package/ui/Elements/Logo/Logo.js
CHANGED
|
@@ -41,8 +41,8 @@ import warehouseManager3 from './assets/warehouse/manager3.svg';
|
|
|
41
41
|
import warehouseManager from './assets/warehouse/manager.svg';
|
|
42
42
|
import styled from '@xstyled/styled-components';
|
|
43
43
|
var defaultSizes = {
|
|
44
|
-
small: '30px',
|
|
45
|
-
medium: '46px',
|
|
44
|
+
small: '30px',
|
|
45
|
+
medium: '46px',
|
|
46
46
|
big: '61px' // cca 200px width on full logo
|
|
47
47
|
};
|
|
48
48
|
var variantMap = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements, "color">) => import('react').ReactElement<any, string>, import('@xstyled/system').Theme, import('@xstyled/system').SystemProps<import('@xstyled/system').Theme>, "color">;
|
|
2
3
|
export declare const Btn: import('styled-components').StyledComponent<"button", import('@xstyled/system').Theme, {
|
|
3
4
|
disabled: boolean;
|
|
4
5
|
}, never>;
|
|
@@ -3,11 +3,11 @@ import { StoryObj } from '@storybook/react-webpack5';
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: import('react').FC<{
|
|
6
|
-
progress?: number;
|
|
7
|
-
status?: "loading" | "finished" |
|
|
8
|
-
errorMessage?: string;
|
|
9
|
-
noText?: boolean;
|
|
10
|
-
variant?: "normal" | "thin";
|
|
6
|
+
progress?: number | undefined;
|
|
7
|
+
status?: "error" | "loading" | "finished" | undefined;
|
|
8
|
+
errorMessage?: string | undefined;
|
|
9
|
+
noText?: boolean | undefined;
|
|
10
|
+
variant?: "normal" | "thin" | undefined;
|
|
11
11
|
}>;
|
|
12
12
|
tags: string[];
|
|
13
13
|
argTypes: {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const StyledProgressBar: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
2
2
|
status: string | null | undefined;
|
|
3
|
-
variant?: "normal" | "thin";
|
|
3
|
+
variant?: "normal" | "thin" | undefined;
|
|
4
4
|
}, never>;
|
|
5
5
|
export declare const Progress: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
6
6
|
progress: number;
|
|
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
23
|
-
return g
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -69,7 +69,7 @@ var emptyOptions = [];
|
|
|
69
69
|
var noOptionsMessage = function () { return i18n._({ id: 'select.noOptions', message: 'no options' }); };
|
|
70
70
|
var loadingMessage = function () { return i18n._({ id: 'components.dropdown.loading', message: 'Loading...' }); };
|
|
71
71
|
var Select = function (_a) {
|
|
72
|
-
var label = _a.label, name = _a.name, _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.options, options = _c === void 0 ? emptyOptions : _c, defaultOptions = _a.defaultOptions, loadOptions = _a.loadOptions, onChange = _a.onChange, onBlur = _a.onBlur, error = _a.error, isInvalid = _a.isInvalid, isLoading = _a.isLoading, isDarkPlaceholderText = _a.isDarkPlaceholderText, _d = _a.spaceAround, spaceAround = _d === void 0 ? false : _d, disabled = _a.disabled, onInputChange = _a.onInputChange, isSearchable = _a.isSearchable, isMulti = _a.isMulti, className = _a.className, _e = _a.useSimplifiedOptions, useSimplifiedOptions = _e === void 0 ? false : _e, _f = _a.showSelectAllButton, showSelectAllButton = _f === void 0 ? false : _f, _g = _a.
|
|
72
|
+
var label = _a.label, name = _a.name, _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.options, options = _c === void 0 ? emptyOptions : _c, defaultOptions = _a.defaultOptions, loadOptions = _a.loadOptions, onChange = _a.onChange, onBlur = _a.onBlur, error = _a.error, isInvalid = _a.isInvalid, isLoading = _a.isLoading, isDarkPlaceholderText = _a.isDarkPlaceholderText, _d = _a.spaceAround, spaceAround = _d === void 0 ? false : _d, disabled = _a.disabled, onInputChange = _a.onInputChange, isSearchable = _a.isSearchable, isMulti = _a.isMulti, className = _a.className, _e = _a.useSimplifiedOptions, useSimplifiedOptions = _e === void 0 ? false : _e, _f = _a.showSelectAllButton, showSelectAllButton = _f === void 0 ? false : _f, _g = _a.shortValues, shortValues = _g === void 0 ? true : _g, _h = _a.shortVariant, shortVariant = _h === void 0 ? 'block' : _h, style = _a.style, optionVariant = _a.optionVariant, multiLabelVariant = _a.multiLabelVariant, containerVariant = _a.containerVariant, placeholder = _a.placeholder, placeholderIcon = _a.placeholderIcon, innerRef = _a.innerRef, maxMenuHeight = _a.maxMenuHeight, getOptionValue = _a.getOptionValue, onIconClick = _a.onIconClick, passTroughProps = __rest(_a, ["label", "name", "value", "options", "defaultOptions", "loadOptions", "onChange", "onBlur", "error", "isInvalid", "isLoading", "isDarkPlaceholderText", "spaceAround", "disabled", "onInputChange", "isSearchable", "isMulti", "className", "useSimplifiedOptions", "showSelectAllButton", "shortValues", "shortVariant", "style", "optionVariant", "multiLabelVariant", "containerVariant", "placeholder", "placeholderIcon", "innerRef", "maxMenuHeight", "getOptionValue", "onIconClick"]);
|
|
73
73
|
var isAsync = !!loadOptions;
|
|
74
74
|
if (showSelectAllButton && !isMulti) {
|
|
75
75
|
console.error('CheckboxSelect incompatible props');
|
|
@@ -84,8 +84,8 @@ var Select = function (_a) {
|
|
|
84
84
|
}
|
|
85
85
|
}, [onChange]);
|
|
86
86
|
var icon = containerVariant === 'search' && !placeholderIcon && placeholderIcon !== null ? 'search' : placeholderIcon || undefined;
|
|
87
|
-
var modifiedMaxMenuHeight =
|
|
88
|
-
var _j = useStylesAndComponents(style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton
|
|
87
|
+
var modifiedMaxMenuHeight = showSelectAllButton && maxMenuHeight ? maxMenuHeight - 30 : maxMenuHeight;
|
|
88
|
+
var _j = useStylesAndComponents(style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton), customComponents = _j[0], customTheme = _j[1], customStyles = _j[2];
|
|
89
89
|
var RenderComponent = isAsync ? StyledAsyncSelect : StyledReactSelect;
|
|
90
90
|
var selectedOption;
|
|
91
91
|
var localGetOptionValue = useMemo(function () { return getOptionValue || (function (option) { return option === null || option === void 0 ? void 0 : option.value; }); }, [getOptionValue]);
|
|
@@ -106,6 +106,6 @@ var Select = function (_a) {
|
|
|
106
106
|
}
|
|
107
107
|
}); }); } : undefined;
|
|
108
108
|
}, [loadOptions]);
|
|
109
|
-
return (_jsxs(SpaceAroundWrap, { spaceAround: spaceAround, className: className, children: [_jsxs(Wrapper, { children: [label && _jsx(FieldLabel, { htmlFor: name, children: label }), _jsx(RenderComponent, __assign({ id: name, name: name, options: options, loadOptions: handleLoadOptions, defaultOptions: defaultOptions, value: selectedOption, onChange: onChange, onBlur: onBlur, isDisabled: disabled || isLoading, isLoading: isLoading, isInvalid: isInvalid !== undefined ? isInvalid : !!error, isDarkPlaceholderText: isDarkPlaceholderText, placeholder: placeholder || i18n._({ id: 'components.dropdown.placeholder', message: 'Select...' }), styles: customStyles, theme: customTheme, icon: icon, onIconClick: onIconClick, hideSelectedOptions: !!(isMulti && multiLabelVariant
|
|
109
|
+
return (_jsxs(SpaceAroundWrap, { spaceAround: spaceAround, className: className, children: [_jsxs(Wrapper, { children: [label && _jsx(FieldLabel, { htmlFor: name, children: label }), _jsx(RenderComponent, __assign({ id: name, name: name, options: options, loadOptions: handleLoadOptions, defaultOptions: defaultOptions, value: selectedOption, onChange: onChange, onBlur: onBlur, isDisabled: disabled || isLoading, isLoading: isLoading, isInvalid: isInvalid !== undefined ? isInvalid : !!error, isDarkPlaceholderText: isDarkPlaceholderText, placeholder: placeholder || i18n._({ id: 'components.dropdown.placeholder', message: 'Select...' }), styles: customStyles, theme: customTheme, icon: icon, onIconClick: onIconClick, hideSelectedOptions: !!(isMulti && multiLabelVariant !== 'count'), onInputChange: onInputChange, isSearchable: isAsync || isSearchable, isMulti: isMulti, classNamePrefix: "react-select", components: customComponents, closeMenuOnSelect: isMulti ? false : undefined, noOptionsMessage: noOptionsMessage }, passTroughProps, { ref: innerRef, tabIndex: null, systemTheme: theme, onCustomSelectAll: setAllOptions, onCustomDeselectAll: unsetAllOptions, selectAllButton: showSelectAllButton, maxMenuHeight: modifiedMaxMenuHeight, getOptionValue: getOptionValue, loadingMessage: loadingMessage, shortValues: shortValues, shortVariant: shortVariant, containerVariant: containerVariant }))] }), error && _jsx(ErrorMessage, { children: error })] }));
|
|
110
110
|
};
|
|
111
111
|
export default Select;
|
|
@@ -12,17 +12,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
14
|
import { components as selectComponents } from 'react-select';
|
|
15
|
-
import ResetAll from '../components/ResetAll';
|
|
16
15
|
import SelectAll from '../components/SelectAll';
|
|
17
16
|
var ConnectedMenu = function (props) {
|
|
18
17
|
var theme = props.theme;
|
|
19
|
-
var _a = props.selectProps,
|
|
18
|
+
var _a = props.selectProps, onCustomSelectAll = _a.onCustomSelectAll, onCustomDeselectAll = _a.onCustomDeselectAll, value = _a.value, selectAllButton = _a.selectAllButton, maxMenuHeight = _a.maxMenuHeight, isLoading = _a.isLoading;
|
|
20
19
|
// because the filterd options (filterd by the search input) are not passed to the menu list (there are all options),
|
|
21
20
|
// we need to specify them here by children
|
|
22
21
|
var filteredOptions = useMemo(function () { var _a, _b; return (_b = (_a = props.children) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, function (_a) {
|
|
23
22
|
var _b = _a.props, value = _b.value, label = _b.label;
|
|
24
23
|
return ({ label: label, value: value });
|
|
25
24
|
}); }, [props.children]);
|
|
26
|
-
return (_jsxs(selectComponents.MenuList, __assign({}, props, { children: [selectAllButton && !isLoading && (_jsx(SelectAll, { theme: theme, onCustomSelectAll: onCustomSelectAll, onCustomDeselectAll: onCustomDeselectAll, value: value, options: filteredOptions, maxMenuHeight: maxMenuHeight })), props.children
|
|
25
|
+
return (_jsxs(selectComponents.MenuList, __assign({}, props, { children: [selectAllButton && !isLoading && (_jsx(SelectAll, { theme: theme, onCustomSelectAll: onCustomSelectAll, onCustomDeselectAll: onCustomDeselectAll, value: value, options: filteredOptions, maxMenuHeight: maxMenuHeight })), props.children] })));
|
|
27
26
|
};
|
|
28
27
|
export default ConnectedMenu;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { MultiValueProps } from 'react-select';
|
|
2
|
+
|
|
3
|
+
type CountMultiValueProps = MultiValueProps & {
|
|
4
|
+
data: unknown;
|
|
5
|
+
selectProps: MultiValueProps<unknown, boolean, any>['selectProps'] & {
|
|
6
|
+
shortValues?: boolean;
|
|
7
|
+
shortVariant?: 'block' | 'join';
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare const CountMultiValue: (props: CountMultiValueProps) => React.ReactNode;
|
|
2
11
|
export default CountMultiValue;
|
|
@@ -17,21 +17,30 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
17
17
|
import { components as selectComponents } from 'react-select';
|
|
18
18
|
import styled, { th } from '@xstyled/styled-components';
|
|
19
19
|
// MultiValue container with count of selected options
|
|
20
|
-
var StyledNumber = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n height: 25px;\n justify-content: center;\n align-items: center;\n display: flex;\n border-radius: md;\n padding: 2px 6px;\n"], ["\n background: ", ";\n height: 25px;\n justify-content: center;\n align-items: center;\n display: flex;\n border-radius: md;\n padding: 2px 6px;\n"])), th.color('lightGray7'));
|
|
20
|
+
var StyledNumber = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n height: 25px;\n justify-content: center;\n align-items: center;\n display: flex;\n border-radius: md;\n padding: 2px 6px;\n"], ["\n background-color: ", ";\n height: 25px;\n justify-content: center;\n align-items: center;\n display: flex;\n border-radius: md;\n padding: 2px 6px;\n"])), th.color('lightGray7'));
|
|
21
|
+
var JoinedMultiValue = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n white-space: nowrap;\n position: absolute;\n color: gray3;\n padding-left: ", ";\n"], ["\n white-space: nowrap;\n position: absolute;\n color: gray3;\n padding-left: ", ";\n"])), function (_a) {
|
|
22
|
+
var isFocused = _a.isFocused;
|
|
23
|
+
return (isFocused ? '8px' : '0');
|
|
24
|
+
});
|
|
21
25
|
var CountMultiValue = function (props) {
|
|
22
|
-
var _a
|
|
26
|
+
var _a;
|
|
23
27
|
var shortValues = props.selectProps.shortValues;
|
|
24
28
|
var selectVal = props.selectProps.value;
|
|
25
29
|
var inputVal = props.selectProps.inputValue;
|
|
30
|
+
var shortVariant = props.selectProps.shortVariant;
|
|
31
|
+
var data = props.data;
|
|
32
|
+
var isFirst = (data === null || data === void 0 ? void 0 : data.value) === ((_a = selectVal[0]) === null || _a === void 0 ? void 0 : _a.value);
|
|
33
|
+
var menuIsOpen = props.selectProps.menuIsOpen;
|
|
26
34
|
if (!shortValues) {
|
|
27
35
|
return _jsx(selectComponents.MultiValue, __assign({}, props, { children: props.children }));
|
|
28
36
|
}
|
|
29
|
-
if (!
|
|
30
|
-
return (_jsxs(_Fragment, { children: [_jsx(selectComponents.MultiValue, __assign({}, props, { children: props.children })), selectVal.length > 1 ? _jsxs(StyledNumber, { children: ["+", selectVal.length - 1] }) : null] }));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
37
|
+
if (!isFirst || inputVal) {
|
|
33
38
|
return null;
|
|
34
39
|
}
|
|
40
|
+
if (shortVariant === 'join') {
|
|
41
|
+
return (_jsxs(JoinedMultiValue, { isFocused: menuIsOpen, children: [selectVal.length > 1 ? "(".concat(Number(selectVal.length), ") ") : '', selectVal.map(function (option) { return option.label; }).join(', ')] }));
|
|
42
|
+
}
|
|
43
|
+
return (_jsxs(_Fragment, { children: [_jsx(selectComponents.MultiValue, __assign({}, props, { children: props.children })), selectVal.length > 1 ? _jsxs(StyledNumber, { children: ["+", selectVal.length - 1] }) : null] }));
|
|
35
44
|
};
|
|
36
45
|
export default CountMultiValue;
|
|
37
|
-
var templateObject_1;
|
|
46
|
+
var templateObject_1, templateObject_2;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { DropdownIndicatorProps } from 'react-select';
|
|
2
|
+
|
|
3
|
+
type DropdownIndicatorCustomProps = DropdownIndicatorProps & {
|
|
4
|
+
theme: any;
|
|
5
|
+
};
|
|
6
|
+
export declare const DropdownIndicator: (props: DropdownIndicatorCustomProps) => any;
|
|
2
7
|
export default DropdownIndicator;
|
|
@@ -15,14 +15,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
15
15
|
};
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { components as selectComponents } from 'react-select';
|
|
18
|
-
import styled from '@xstyled/styled-components';
|
|
19
18
|
import { ArrowDown } from '../../Icon/icons/ArrowDown';
|
|
20
19
|
import { ArrowUp } from '../../Icon/icons/ArrowUp';
|
|
20
|
+
import styled from '@xstyled/styled-components';
|
|
21
21
|
// Option with chevron form new design
|
|
22
22
|
var ChevronDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: center;\n display: flex;\n"], ["\n align-self: center;\n display: flex;\n"])));
|
|
23
23
|
export var DropdownIndicator = function (props) {
|
|
24
24
|
var _a = props.selectProps, menuIsOpen = _a.menuIsOpen, name = _a.name;
|
|
25
|
-
|
|
25
|
+
var iconColor = props.theme.colors.placeholderTextColor;
|
|
26
|
+
return (_jsx(selectComponents.DropdownIndicator, __assign({}, props, { children: _jsx(ChevronDiv, { className: "chevron", "data-cy": "".concat(name || '', "ChevronBtn"), children: menuIsOpen ? _jsx(ArrowUp, { width: "16px", stroke: iconColor }) : _jsx(ArrowDown, { width: "16px", stroke: iconColor }) }) })));
|
|
26
27
|
};
|
|
27
28
|
export default DropdownIndicator;
|
|
28
29
|
var templateObject_1;
|
|
@@ -29,7 +29,7 @@ import { components } from 'react-select';
|
|
|
29
29
|
import Icon from '../../Icon/Icon';
|
|
30
30
|
import styled from '@xstyled/styled-components';
|
|
31
31
|
// Value container with icon
|
|
32
|
-
var IconDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left:
|
|
32
|
+
var IconDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: 7px;\n margin-right: -3px;\n align-self: center;\n & > * {\n color: ", ";\n }\n"], ["\n padding-left: 7px;\n margin-right: -3px;\n align-self: center;\n & > * {\n color: ", ";\n }\n"])), function (_a) {
|
|
33
33
|
var hasValue = _a.hasValue;
|
|
34
34
|
return (hasValue ? 'black' : '#a3b3c1');
|
|
35
35
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Select from '../Select';
|
|
3
|
+
var meta = {
|
|
4
|
+
title: 'Forms/Select',
|
|
5
|
+
component: Select,
|
|
6
|
+
argTypes: {}
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
var options = [
|
|
10
|
+
{ value: '1', label: 'Option 1' },
|
|
11
|
+
{ value: '2', label: 'Option 2' },
|
|
12
|
+
{ value: '3', label: 'Option 3' }
|
|
13
|
+
];
|
|
14
|
+
export var Default = function () { return (_jsx(Select, { label: "Primary Select", onChange: console.log, options: options, value: "1" })); };
|
|
15
|
+
export var MultiSelect = function () { return (_jsx(Select, { label: "Multi Select Input", onChange: console.log, options: options, isMulti: true, value: ['1', '2'] })); };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StylesConfig, SelectComponentsConfig } from 'react-select';
|
|
2
2
|
import { SelectProps } from '../types';
|
|
3
3
|
|
|
4
|
-
export declare const useStylesAndComponents: (style?: SelectProps[
|
|
4
|
+
export declare const useStylesAndComponents: (style?: SelectProps['style'], optionVariant?: SelectProps['optionVariant'], multiLabelVariant?: SelectProps['multiLabelVariant'], containerVariant?: SelectProps['containerVariant'], useSimplifiedOptions?: SelectProps['useSimplifiedOptions'], showSelectAllButton?: SelectProps['showSelectAllButton']) => [SelectComponentsConfig<unknown, boolean, any>, any, StylesConfig];
|
|
@@ -8,14 +8,13 @@ import IconValueContainer from '../components/IconValueContainer';
|
|
|
8
8
|
import SimplifiedOption from '../components/SimplifiedOption';
|
|
9
9
|
import { useTheme } from '@xstyled/styled-components';
|
|
10
10
|
import { getCustomTheme as getFormCustomTheme, CustomStyles as SelectCustomStyles } from './selectStyles';
|
|
11
|
-
export var useStylesAndComponents = function (style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton
|
|
11
|
+
export var useStylesAndComponents = function (style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton) {
|
|
12
12
|
if (style === void 0) { style = 'form'; }
|
|
13
13
|
if (optionVariant === void 0) { optionVariant = 'default'; }
|
|
14
14
|
if (multiLabelVariant === void 0) { multiLabelVariant = 'default'; }
|
|
15
15
|
if (containerVariant === void 0) { containerVariant = 'default'; }
|
|
16
16
|
if (useSimplifiedOptions === void 0) { useSimplifiedOptions = false; }
|
|
17
17
|
if (showSelectAllButton === void 0) { showSelectAllButton = false; }
|
|
18
|
-
if (showResetGridButton === void 0) { showResetGridButton = false; }
|
|
19
18
|
var systemTheme = useTheme();
|
|
20
19
|
return useMemo(function () {
|
|
21
20
|
var components = {
|
|
@@ -28,25 +27,16 @@ export var useStylesAndComponents = function (style, optionVariant, multiLabelVa
|
|
|
28
27
|
if (containerVariant === 'search') {
|
|
29
28
|
components.DropdownIndicator = null;
|
|
30
29
|
}
|
|
31
|
-
if (
|
|
30
|
+
if (showSelectAllButton) {
|
|
32
31
|
components.MenuList = ConnectedMenu;
|
|
33
32
|
}
|
|
34
33
|
components.Input = CustomInput;
|
|
35
|
-
var themes = getFormCustomTheme(systemTheme, optionVariant, style
|
|
34
|
+
var themes = getFormCustomTheme(systemTheme, optionVariant, style === 'gridFilter');
|
|
36
35
|
var styles = SelectCustomStyles;
|
|
37
36
|
components.Option = ChevronOption;
|
|
38
37
|
// performance reasons
|
|
39
38
|
if (useSimplifiedOptions)
|
|
40
39
|
components.Option = SimplifiedOption;
|
|
41
40
|
return [components, themes, styles];
|
|
42
|
-
}, [
|
|
43
|
-
multiLabelVariant,
|
|
44
|
-
containerVariant,
|
|
45
|
-
showResetGridButton,
|
|
46
|
-
showSelectAllButton,
|
|
47
|
-
style,
|
|
48
|
-
useSimplifiedOptions,
|
|
49
|
-
systemTheme,
|
|
50
|
-
optionVariant
|
|
51
|
-
]);
|
|
41
|
+
}, [multiLabelVariant, containerVariant, showSelectAllButton, style, useSimplifiedOptions, systemTheme, optionVariant]);
|
|
52
42
|
};
|
|
@@ -2,5 +2,5 @@ import { SelectProps, StylesConfig, CustomTheme } from '../types';
|
|
|
2
2
|
|
|
3
3
|
export declare const CustomStyles: StylesConfig<State>;
|
|
4
4
|
type ThemeGetter = (theme: any) => CustomTheme;
|
|
5
|
-
export declare const getCustomTheme: (theme: any, optionVariant: Required<SelectProps>[
|
|
5
|
+
export declare const getCustomTheme: (theme: any, optionVariant: Required<SelectProps>['optionVariant'], useFilterSubvariant: boolean) => ThemeGetter;
|
|
6
6
|
export {};
|