@wireapp/react-ui-kit 9.19.0 → 9.21.0
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/Form/Select.d.ts +2 -1
- package/lib/Form/Select.d.ts.map +1 -1
- package/lib/Form/Select.js +2 -2
- package/lib/Form/SelectComponents.d.ts +2 -1
- package/lib/Form/SelectComponents.d.ts.map +1 -1
- package/lib/Form/SelectComponents.js +2 -20
- package/lib/Layout/MatchMedia.d.ts +1 -1
- package/lib/Layout/MatchMedia.d.ts.map +1 -1
- package/lib/Layout/MatchMedia.js +3 -2
- package/package.json +2 -2
package/lib/Form/Select.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ interface SelectProps<IsMulti extends boolean, Group extends GroupBase<Option>>
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
dataUieName: string;
|
|
15
15
|
options: Option[] | Group[];
|
|
16
|
+
menuCSS?: CSSObject;
|
|
16
17
|
wrapperCSS?: CSSObject;
|
|
17
18
|
label?: string;
|
|
18
19
|
helperText?: string;
|
|
@@ -23,6 +24,6 @@ interface SelectProps<IsMulti extends boolean, Group extends GroupBase<Option>>
|
|
|
23
24
|
isSearchable?: boolean;
|
|
24
25
|
overlayMenu?: boolean;
|
|
25
26
|
}
|
|
26
|
-
export declare const Select: <IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ id, label, error, helperText, disabled, dataUieName, options, isMulti, wrapperCSS, markInvalid, required, isSearchable, overlayMenu, ...props }: SelectProps<IsMulti, Group>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const Select: <IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ id, label, error, helperText, disabled, dataUieName, options, isMulti, wrapperCSS, menuCSS, markInvalid, required, isSearchable, overlayMenu, ...props }: SelectProps<IsMulti, Group>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
28
|
export {};
|
|
28
29
|
//# sourceMappingUR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AAK,SAAS,SAAS,CAAC,MAAM,CAAC,kLAgBpF,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,qDAoE7B,CAAC"}
|
package/lib/Form/Select.js
CHANGED
|
@@ -11,7 +11,7 @@ const InputLabel_1 = require("./InputLabel");
|
|
|
11
11
|
const SelectComponents_1 = require("./SelectComponents");
|
|
12
12
|
const SelectStyles_1 = require("./SelectStyles");
|
|
13
13
|
const enums_1 = require("../types/enums");
|
|
14
|
-
const Select = ({ id, label, error, helperText, disabled = false, dataUieName, options, isMulti, wrapperCSS = {}, markInvalid = false, required = false, isSearchable = false, overlayMenu = true, ...props }) => {
|
|
14
|
+
const Select = ({ id, label, error, helperText, disabled = false, dataUieName, options, isMulti, wrapperCSS = {}, menuCSS = {}, markInvalid = false, required = false, isSearchable = false, overlayMenu = true, ...props }) => {
|
|
15
15
|
const theme = (0, react_1.useTheme)();
|
|
16
16
|
const hasError = !!error;
|
|
17
17
|
return ((0, jsx_runtime_1.jsxs)("div", {
|
|
@@ -31,7 +31,7 @@ const Select = ({ id, label, error, helperText, disabled = false, dataUieName, o
|
|
|
31
31
|
SelectContainer: SelectComponents_1.SelectContainer,
|
|
32
32
|
DropdownIndicator: SelectComponents_1.DropdownIndicator,
|
|
33
33
|
Option: (0, SelectComponents_1.CustomOption)(dataUieName),
|
|
34
|
-
Menu: (0, SelectComponents_1.Menu)(dataUieName),
|
|
34
|
+
Menu: (0, SelectComponents_1.Menu)(dataUieName, menuCSS),
|
|
35
35
|
ValueContainer: SelectComponents_1.ValueContainer,
|
|
36
36
|
IndicatorsContainer: SelectComponents_1.IndicatorsContainer,
|
|
37
37
|
}, 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) => ({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { CSSObject } from '@emotion/react';
|
|
1
2
|
import { ContainerProps, DropdownIndicatorProps, OptionProps, ValueContainerProps, IndicatorsContainerProps, MenuProps, GroupBase, OptionsOrGroups } from 'react-select';
|
|
2
3
|
import { Option } from './Select';
|
|
3
4
|
export declare const SelectContainer: (props: ContainerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
5
|
export declare const isGroup: (options: OptionsOrGroups<Option, GroupBase<Option>>) => options is GroupBase<Option>[];
|
|
5
6
|
export declare const DropdownIndicator: (props: DropdownIndicatorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
7
|
export declare const CustomOption: (dataUieName: string) => (props: OptionProps<Option>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const Menu: (dataUieName: string) => (props: MenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Menu: (dataUieName: string, css?: CSSObject) => (props: MenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
9
|
export declare const renderValue: (value: any) => any;
|
|
9
10
|
export declare const ValueContainer: ({ children, ...restProps }: ValueContainerProps<Option>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
11
|
export declare const IndicatorsContainer: ({ children, ...restProps }: IndicatorsContainerProps<Option>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectComponents.d.ts","sourceRoot":"","sources":["../../src/Form/SelectComponents.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAOhC,eAAO,MAAM,eAAe,UAAW,cAAc,qDAMpD,CAAC;AAEF,eAAO,MAAM,OAAO,YAAa,eAAe,CAAC,MAAM,EAAE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|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IndicatorsContainer = exports.ValueContainer = exports.renderValue = exports.Menu = exports.CustomOption = exports.DropdownIndicator = exports.isGroup = exports.SelectContainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
-
/*
|
|
6
|
-
* Wire
|
|
7
|
-
* Copyright (C) 2022 Wire Swiss GmbH
|
|
8
|
-
*
|
|
9
|
-
* This program is free software: you can redistribute it and/or modify
|
|
10
|
-
* it under the terms of the GNU General Public License as published by
|
|
11
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
-
* (at your option) any later version.
|
|
13
|
-
*
|
|
14
|
-
* This program is distributed in the hope that it will be useful,
|
|
15
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
-
* GNU General Public License for more details.
|
|
18
|
-
*
|
|
19
|
-
* You should have received a copy of the GNU General Public License
|
|
20
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
5
|
const react_select_1 = require("react-select");
|
|
24
6
|
const Icon_1 = require("../Icon");
|
|
25
7
|
const ArrowDown_1 = require("../Icon/ArrowDown");
|
|
@@ -64,9 +46,9 @@ const CustomOption = (dataUieName) => (props) => {
|
|
|
64
46
|
};
|
|
65
47
|
exports.CustomOption = CustomOption;
|
|
66
48
|
// eslint-disable-next-line react/display-name
|
|
67
|
-
const Menu = (dataUieName) => (props) => {
|
|
49
|
+
const Menu = (dataUieName, css) => (props) => {
|
|
68
50
|
const { children } = props;
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(react_select_1.components.Menu, { ...props, children: (0, jsx_runtime_1.jsx)("div", { ...(dataUieName && {
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(react_select_1.components.Menu, { ...props, css: css, children: (0, jsx_runtime_1.jsx)("div", { ...(dataUieName && {
|
|
70
52
|
'data-uie-name': `dropdown-${dataUieName}`,
|
|
71
53
|
}), children: children }) }));
|
|
72
54
|
};
|
|
@@ -6,7 +6,7 @@ export interface MatchMediaProps extends React.HTMLProps<ReactFragment> {
|
|
|
6
6
|
not?: boolean;
|
|
7
7
|
query: Query;
|
|
8
8
|
}
|
|
9
|
-
export declare const useMatchMedia: (query: Query) => boolean;
|
|
9
|
+
export declare const useMatchMedia: (query: Query, customWindowObj?: Window) => boolean;
|
|
10
10
|
export declare const MatchMedia: React.FC<MatchMediaProps>;
|
|
11
11
|
export type NamedMatchMediaProps = Omit<MatchMediaProps, 'query'>;
|
|
12
12
|
export declare const IsDesktop: (props: NamedMatchMediaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatchMedia.d.ts","sourceRoot":"","sources":["../../src/Layout/MatchMedia.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,aAAa,EAA+B,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAQ,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAEjD,KAAK,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhC,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IACrE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CACd;AAED,eAAO,MAAM,aAAa,UAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"MatchMedia.d.ts","sourceRoot":"","sources":["../../src/Layout/MatchMedia.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,aAAa,EAA+B,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAQ,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAEjD,KAAK,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhC,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IACrE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CACd;AAED,eAAO,MAAM,aAAa,UAAW,KAAK,oBAAoB,MAAM,YAgBnE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAIhD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAElE,eAAO,MAAM,SAAS,UAAW,oBAAoB,qDAAwD,CAAC;AAC9G,eAAO,MAAM,WAAW,UAAW,oBAAoB,qDAA2D,CAAC;AACnH,eAAO,MAAM,QAAQ,UAAW,oBAAoB,qDAAuD,CAAC;AAC5G,eAAO,MAAM,YAAY,UAAW,oBAAoB,qDAA4D,CAAC;AACrH,eAAO,MAAM,UAAU,UAAW,oBAAoB,qDAA0D,CAAC;AACjH,eAAO,MAAM,QAAQ,UAAW,oBAAoB,qDAAuD,CAAC;AAC5G,eAAO,MAAM,YAAY,UAAW,oBAAoB,qDAA4D,CAAC;AACrH,eAAO,MAAM,UAAU,UAAW,oBAAoB,qDAA0D,CAAC"}
|
package/lib/Layout/MatchMedia.js
CHANGED
|
@@ -22,8 +22,9 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
22
22
|
*/
|
|
23
23
|
const react_1 = require("react");
|
|
24
24
|
const mediaQueries_1 = require("../mediaQueries");
|
|
25
|
-
const useMatchMedia = (query) => {
|
|
26
|
-
const
|
|
25
|
+
const useMatchMedia = (query, customWindowObj) => {
|
|
26
|
+
const windowObj = customWindowObj || window;
|
|
27
|
+
const matchMedia = (0, react_1.useMemo)(() => windowObj.matchMedia(`(${query})`), [query, windowObj]);
|
|
27
28
|
const [isMatching, setIsMatching] = (0, react_1.useState)(matchMedia.matches);
|
|
28
29
|
const updateMatching = (event) => {
|
|
29
30
|
setIsMatching(event.matches);
|
package/package.json
CHANGED