@wireapp/react-ui-kit 9.72.1 → 9.73.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/lib/Identity/Theme/Theme.d.ts +6 -0
- package/lib/Identity/Theme/Theme.d.ts.map +1 -1
- package/lib/Identity/Theme/Theme.js +18 -0
- package/lib/Inputs/Select/Select.js +2 -2
- package/lib/Inputs/Switch/Switch.d.ts +3 -0
- package/lib/Inputs/Switch/Switch.d.ts.map +1 -1
- package/lib/Inputs/Switch/Switch.js +25 -11
- package/lib/Inputs/Switch/Switch.styles.d.ts +2 -1
- package/lib/Inputs/Switch/Switch.styles.d.ts.map +1 -1
- package/lib/Inputs/Switch/Switch.styles.js +2 -2
- package/package.json +2 -2
|
@@ -87,6 +87,12 @@ export interface Theme extends ETheme {
|
|
|
87
87
|
optionHoverBg: string;
|
|
88
88
|
selectedActiveBg: string;
|
|
89
89
|
};
|
|
90
|
+
Switch: {
|
|
91
|
+
activatedColor: string;
|
|
92
|
+
deactivatedColor: string;
|
|
93
|
+
disabledColor?: string;
|
|
94
|
+
};
|
|
95
|
+
themeId: THEME_ID;
|
|
90
96
|
}
|
|
91
97
|
export declare const themes: {
|
|
92
98
|
[themeId in THEME_ID]: Theme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/Identity/Theme/Theme.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAwC,KAAK,IAAI,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAMtF,oBAAY,QAAQ;IAClB,IAAI,eAAe;IACnB,KAAK,gBAAgB;IACrB,OAAO,kBAAkB;CAC1B;AAED,MAAM,WAAW,KAAM,SAAQ,MAAM;IACnC,SAAS,EAAE;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,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AG,KAAK;CAuPjD,CAAC;AAEF,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACxE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,UAAW,UAAU,qDAA4D,CAAC"}
|
|
@@ -14,6 +14,7 @@ var THEME_ID;
|
|
|
14
14
|
})(THEME_ID || (exports.THEME_ID = THEME_ID = {}));
|
|
15
15
|
exports.themes = {
|
|
16
16
|
[THEME_ID.DEFAULT]: {
|
|
17
|
+
themeId: THEME_ID.DEFAULT,
|
|
17
18
|
fontSizes: Sizes_1.fontSizes,
|
|
18
19
|
Button: {
|
|
19
20
|
primaryBg: 'var(--accent-color)',
|
|
@@ -88,8 +89,14 @@ exports.themes = {
|
|
|
88
89
|
contrastColor: 'var(--text-input-background)',
|
|
89
90
|
focusColor: 'var(--accent-color-focus)',
|
|
90
91
|
},
|
|
92
|
+
Switch: {
|
|
93
|
+
activatedColor: colors_1.COLOR.BLUE,
|
|
94
|
+
deactivatedColor: '#d2d2d2',
|
|
95
|
+
disabledColor: colors_1.COLOR.GRAY_LIGHTEN_88,
|
|
96
|
+
},
|
|
91
97
|
},
|
|
92
98
|
[THEME_ID.LIGHT]: {
|
|
99
|
+
themeId: THEME_ID.LIGHT,
|
|
93
100
|
fontSizes: Sizes_1.fontSizes,
|
|
94
101
|
Button: {
|
|
95
102
|
primaryBg: 'var(--accent-color)',
|
|
@@ -164,8 +171,14 @@ exports.themes = {
|
|
|
164
171
|
contrastColor: 'var(--text-input-background)',
|
|
165
172
|
focusColor: 'var(--accent-color-focus)',
|
|
166
173
|
},
|
|
174
|
+
Switch: {
|
|
175
|
+
activatedColor: colors_v2_1.BASE_LIGHT_COLOR.BLUE,
|
|
176
|
+
deactivatedColor: colors_v2_1.COLOR_V2.GRAY_70,
|
|
177
|
+
disabledColor: colors_v2_1.COLOR_V2.GRAY_70,
|
|
178
|
+
},
|
|
167
179
|
},
|
|
168
180
|
[THEME_ID.DARK]: {
|
|
181
|
+
themeId: THEME_ID.DARK,
|
|
169
182
|
fontSizes: Sizes_1.fontSizes,
|
|
170
183
|
Button: {
|
|
171
184
|
primaryBg: 'var(--accent-color)',
|
|
@@ -240,6 +253,11 @@ exports.themes = {
|
|
|
240
253
|
contrastColor: 'var(--text-input-background)',
|
|
241
254
|
focusColor: 'var(--accent-color-focus)',
|
|
242
255
|
},
|
|
256
|
+
Switch: {
|
|
257
|
+
activatedColor: colors_v2_1.BASE_DARK_COLOR.BLUE,
|
|
258
|
+
deactivatedColor: colors_v2_1.COLOR_V2.GRAY_60,
|
|
259
|
+
disabledColor: colors_v2_1.COLOR_V2.GRAY_60,
|
|
260
|
+
},
|
|
243
261
|
},
|
|
244
262
|
};
|
|
245
263
|
const ThemeProvider = (props) => (0, jsx_runtime_1.jsx)(react_1.ThemeProvider, { ...props, theme: props.theme });
|
|
@@ -29,7 +29,7 @@ const Select = ({ id, label, error, helperText, disabled = false, dataUieName, o
|
|
|
29
29
|
color: theme.general.primaryColor,
|
|
30
30
|
},
|
|
31
31
|
...wrapperCSS,
|
|
32
|
-
}), "data-uie-name": dataUieName, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, markInvalid: markInvalid, isRequired: required, children: label })), (0, jsx_runtime_1.jsx)(react_select_1.default, {
|
|
32
|
+
}), "data-uie-name": dataUieName, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, markInvalid: markInvalid, isRequired: required, children: label })), (0, jsx_runtime_1.jsx)(react_select_1.default, { styles: (0, Select_styles_1.customStyles)({
|
|
33
33
|
theme: theme,
|
|
34
34
|
markInvalid,
|
|
35
35
|
menuPosition: overlayMenu ? 'absolute' : 'relative',
|
|
@@ -48,7 +48,7 @@ const Select = ({ id, label, error, helperText, disabled = false, dataUieName, o
|
|
|
48
48
|
IndicatorsContainer: SelectIndicatorsContainer_1.SelectIndicatorsContainer,
|
|
49
49
|
...(hideControl && { Control: () => null }),
|
|
50
50
|
...(menuListHeading && { MenuList: (0, SelectMenuList_1.SelectMenuList)(menuListHeading, dataUieName) }),
|
|
51
|
-
}, tabIndex: enums_1.TabIndex.UNFOCUSABLE, isDisabled: disabled, hideSelectedOptions: false, isSearchable: isSearchable, isClearable: false, closeMenuOnSelect: !isMulti, isMulti: isMulti, options: options, ...props }), !hasError && helperText && ((0, jsx_runtime_1.jsx)("p", { css: (theme) => ({
|
|
51
|
+
}, inputId: id, tabIndex: enums_1.TabIndex.UNFOCUSABLE, isDisabled: disabled, hideSelectedOptions: false, isSearchable: isSearchable, isClearable: false, closeMenuOnSelect: !isMulti, isMulti: isMulti, options: options, ...props }), !hasError && helperText && ((0, jsx_runtime_1.jsx)("p", { css: (theme) => ({
|
|
52
52
|
fontSize: theme.fontSizes.small,
|
|
53
53
|
fontWeight: 400,
|
|
54
54
|
color: theme.Input.labelColor,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { InputProps } from '../Input';
|
|
2
2
|
export interface SwitchProps<T = HTMLInputElement> extends InputProps<T> {
|
|
3
3
|
activatedColor?: string;
|
|
4
|
+
activatedColorDark?: string;
|
|
4
5
|
checked: boolean;
|
|
5
6
|
deactivatedColor?: string;
|
|
7
|
+
deactivatedColorDark?: string;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
disabledColor?: string;
|
|
10
|
+
disabledColorDark?: string;
|
|
8
11
|
id?: string;
|
|
9
12
|
loadingColor?: string;
|
|
10
13
|
name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/Inputs/Switch/Switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/Inputs/Switch/Switch.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,gBAAgB,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,MAAM,yIAyElB,CAAC"}
|
|
@@ -21,18 +21,32 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
23
|
const react_1 = require("react");
|
|
24
|
+
const react_2 = require("@emotion/react");
|
|
24
25
|
const Switch_styles_1 = require("./Switch.styles");
|
|
25
26
|
const DataDisplay_1 = require("../../DataDisplay");
|
|
26
27
|
const Identity_1 = require("../../Identity");
|
|
27
|
-
exports.Switch = (0, react_1.forwardRef)(({ id = Math.random().toString(), checked, onToggle = () => { }, showLoading, disabled, loadingColor = Identity_1.COLOR.BLUE, activatedColor
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
exports.Switch = (0, react_1.forwardRef)(({ id = Math.random().toString(), checked, onToggle = () => { }, showLoading, disabled, loadingColor = Identity_1.COLOR.BLUE, activatedColor, activatedColorDark, deactivatedColor, deactivatedColorDark, disabledColor, disabledColorDark, name, dataUieName, }, ref) => {
|
|
29
|
+
const theme = (0, react_2.useTheme)();
|
|
30
|
+
const isDarkTheme = theme?.themeId === Identity_1.THEME_ID.DARK;
|
|
31
|
+
const switchTheme = theme?.Switch;
|
|
32
|
+
const resolvedActivatedColor = (isDarkTheme ? activatedColorDark ?? activatedColor : activatedColor) ??
|
|
33
|
+
switchTheme?.activatedColor ??
|
|
34
|
+
Identity_1.COLOR.BLUE;
|
|
35
|
+
const resolvedDeactivatedColor = (isDarkTheme ? deactivatedColorDark ?? deactivatedColor : deactivatedColor) ??
|
|
36
|
+
switchTheme?.deactivatedColor ??
|
|
37
|
+
'#d2d2d2';
|
|
38
|
+
const resolvedDisabledColor = (isDarkTheme ? disabledColorDark ?? disabledColor : disabledColor) ?? switchTheme?.disabledColor;
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Switch_styles_1.wrapperStyles, children: [(0, jsx_runtime_1.jsx)("input", { ref: ref, id: id, checked: checked, disabled: disabled, name: name, onChange: event => onToggle(event.target.checked), onKeyDown: event => {
|
|
40
|
+
if (event.key === 'Enter') {
|
|
41
|
+
onToggle(!event.target.checked);
|
|
42
|
+
}
|
|
43
|
+
}, type: "checkbox", css: Switch_styles_1.inputStyles, "data-uie-name": dataUieName }), (0, jsx_runtime_1.jsxs)("label", { htmlFor: id, css: (0, Switch_styles_1.labelStyles)(disabled, showLoading), children: [(0, jsx_runtime_1.jsx)("span", { css: (0, Switch_styles_1.switchStyles)({
|
|
44
|
+
disabled,
|
|
45
|
+
showLoading,
|
|
46
|
+
checked,
|
|
47
|
+
activatedColor: resolvedActivatedColor,
|
|
48
|
+
deactivatedColor: resolvedDeactivatedColor,
|
|
49
|
+
disabledColor: resolvedDisabledColor,
|
|
50
|
+
}) }), showLoading ? ((0, jsx_runtime_1.jsx)(DataDisplay_1.Loading, { size: 21, color: loadingColor, css: Switch_styles_1.loadingStyles })) : ((0, jsx_runtime_1.jsx)("span", { css: (0, Switch_styles_1.switchDotStyles)(disabled, checked) }))] })] }));
|
|
51
|
+
});
|
|
38
52
|
exports.Switch.displayName = 'Switch';
|
|
@@ -8,8 +8,9 @@ type SwitchStylesProps = {
|
|
|
8
8
|
checked: boolean;
|
|
9
9
|
activatedColor: string;
|
|
10
10
|
deactivatedColor: string;
|
|
11
|
+
disabledColor?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare const switchStyles: ({ disabled, showLoading, checked, activatedColor, deactivatedColor, }: SwitchStylesProps) => CSSObject;
|
|
13
|
+
export declare const switchStyles: ({ disabled, showLoading, checked, activatedColor, deactivatedColor, disabledColor, }: SwitchStylesProps) => CSSObject;
|
|
13
14
|
export declare const loadingStyles: CSSObject;
|
|
14
15
|
export declare const switchDotStyles: (disabled: boolean, checked: boolean) => CSSObject;
|
|
15
16
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.styles.d.ts","sourceRoot":"","sources":["../../../src/Inputs/Switch/Switch.styles.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIzC,eAAO,MAAM,aAAa,EAAE,SAO3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,SAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,aAAc,OAAO,eAAe,OAAO,KAAG,SAMpE,CAAC;AAEH,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.styles.d.ts","sourceRoot":"","sources":["../../../src/Inputs/Switch/Switch.styles.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIzC,eAAO,MAAM,aAAa,EAAE,SAO3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,SAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,aAAc,OAAO,eAAe,OAAO,KAAG,SAMpE,CAAC;AAEH,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,YAAY,yFAOtB,iBAAiB,KAAG,SA6BrB,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,SAI3B,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,OAAO,WAAW,OAAO,KAAG,SAcpE,CAAC"}
|
|
@@ -44,7 +44,7 @@ const labelStyles = (disabled, showLoading) => ({
|
|
|
44
44
|
overflow: 'hidden',
|
|
45
45
|
});
|
|
46
46
|
exports.labelStyles = labelStyles;
|
|
47
|
-
const switchStyles = ({ disabled, showLoading, checked, activatedColor, deactivatedColor, }) => ({
|
|
47
|
+
const switchStyles = ({ disabled, showLoading, checked, activatedColor, deactivatedColor, disabledColor, }) => ({
|
|
48
48
|
'&:after': {
|
|
49
49
|
content: '" "',
|
|
50
50
|
paddingRight: '10px',
|
|
@@ -56,7 +56,7 @@ const switchStyles = ({ disabled, showLoading, checked, activatedColor, deactiva
|
|
|
56
56
|
},
|
|
57
57
|
'&:before, &:after': {
|
|
58
58
|
backgroundColor: disabled || showLoading
|
|
59
|
-
? Identity_1.COLOR.tint(checked ? activatedColor : deactivatedColor, 0.4)
|
|
59
|
+
? disabledColor ?? Identity_1.COLOR.tint(checked ? activatedColor : deactivatedColor, 0.4)
|
|
60
60
|
: checked
|
|
61
61
|
? activatedColor
|
|
62
62
|
: deactivatedColor,
|
package/package.json
CHANGED