@wireapp/react-ui-kit 9.54.0 → 9.54.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.
@@ -1,9 +1,15 @@
1
- import { Option } from '../Select';
1
+ import { CSSObject } from '@emotion/react';
2
+ import { MenuPosition } from 'react-select';
3
+ export type ComboboxSelectOption = {
4
+ value: string | number;
5
+ label: string;
6
+ description?: string;
7
+ };
2
8
  export interface ComboboxSelectProps {
3
9
  id: string;
4
- options: Option[];
5
- value?: Option | Option[];
6
- onChange?: (value: Option | Option[]) => void;
10
+ options: ComboboxSelectOption[];
11
+ value?: ComboboxSelectOption | ComboboxSelectOption[];
12
+ onChange?: (value: ComboboxSelectOption | ComboboxSelectOption[]) => void;
7
13
  isDisabled?: boolean;
8
14
  placeholder?: string;
9
15
  dataUieName?: string;
@@ -12,6 +18,9 @@ export interface ComboboxSelectProps {
12
18
  noOptionsMessage: string;
13
19
  label?: string;
14
20
  required?: boolean;
21
+ menuPotralTarget?: HTMLElement;
22
+ menuPosition?: MenuPosition;
23
+ menuListCSS?: CSSObject;
15
24
  }
16
- export declare const ComboboxSelect: ({ id, options, value, onChange, isDisabled, placeholder, dataUieName, onCreateOption, createOptionLabel, noOptionsMessage, label, required, }: ComboboxSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
25
+ export declare const ComboboxSelect: ({ id, options, value, onChange, isDisabled, placeholder, dataUieName, onCreateOption, createOptionLabel, noOptionsMessage, label, required, menuPotralTarget, menuPosition, menuListCSS, }: ComboboxSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
17
26
  //# sourceMappingURL=ComboboxSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComboboxSelect.d.ts","sourceRoot":"","sources":["../../../../src/Form/Select/ComboboxSelect/ComboboxSelect.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IACl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AAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,WAAW,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,eAAO,MAAM,cAAc,+LAgBxB,mBAAmB,qDAmCrB,CAAC"}
@@ -30,9 +30,9 @@ const ComboboxSelect_styles_1 = require("./ComboboxSelect.styles");
30
30
  const CloseIcon_1 = require("../../../Icon/CloseIcon");
31
31
  const InputLabel_1 = require("../../InputLabel");
32
32
  const BaseSelectDropdownIndicator_1 = require("../BaseSelect/BaseSelectDropdownIndicator");
33
- const ComboboxSelect = ({ id, options, value, onChange, isDisabled = false, placeholder, dataUieName, onCreateOption, createOptionLabel, noOptionsMessage, label, required, }) => {
33
+ const ComboboxSelect = ({ id, options, value, onChange, isDisabled = false, placeholder, dataUieName, onCreateOption, createOptionLabel, noOptionsMessage, label, required, menuPotralTarget, menuPosition = 'absolute', menuListCSS, }) => {
34
34
  const theme = (0, react_1.useTheme)();
35
- return ((0, jsx_runtime_1.jsxs)("div", { css: ComboboxSelect_styles_1.wrapperStyles, "data-uie-name": dataUieName, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, isRequired: required, children: label })), (0, jsx_runtime_1.jsx)(creatable_1.default, { id: id, options: options, value: value, onChange: onChange, isMulti: true, isSearchable: true, isDisabled: isDisabled, placeholder: placeholder, styles: (0, ComboboxSelect_styles_1.selectStyles)({ theme }), classNamePrefix: "select", formatCreateLabel: createOptionLabel, onCreateOption: onCreateOption, closeMenuOnSelect: false, components: {
35
+ return ((0, jsx_runtime_1.jsxs)("div", { css: ComboboxSelect_styles_1.wrapperStyles, "data-uie-name": dataUieName, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, isRequired: required, children: label })), (0, jsx_runtime_1.jsx)(creatable_1.default, { id: id, options: options, value: value, onChange: onChange, isMulti: true, isSearchable: true, isDisabled: isDisabled, placeholder: placeholder, menuPortalTarget: menuPotralTarget, menuPosition: menuPosition, styles: (0, ComboboxSelect_styles_1.selectStyles)({ theme, menuListCSS }), classNamePrefix: "select", formatCreateLabel: createOptionLabel, onCreateOption: onCreateOption, closeMenuOnSelect: false, components: {
36
36
  ClearIndicator: () => null,
37
37
  DropdownIndicator: BaseSelectDropdownIndicator_1.BaseSelectDropdownIndicator,
38
38
  MultiValueRemove: props => (0, jsx_runtime_1.jsx)(MultiValueRemove, { ...props }),
@@ -1,17 +1,16 @@
1
1
  import type { StoryObj } from '@storybook/react';
2
2
  import { type ComboboxSelectProps } from './ComboboxSelect';
3
- import type { Option } from '../Select';
4
3
  declare const meta: {
5
4
  title: string;
6
- component: ({ id, options, value, onChange, isDisabled, placeholder, dataUieName, onCreateOption, createOptionLabel, noOptionsMessage, label, required, }: ComboboxSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ component: ({ id, options, value, onChange, isDisabled, placeholder, dataUieName, onCreateOption, createOptionLabel, noOptionsMessage, label, required, menuPotralTarget, menuPosition, menuListCSS, }: ComboboxSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
6
  parameters: {
8
7
  layout: string;
9
8
  };
10
9
  decorators: ((Story: import("@storybook/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
11
10
  id: string;
12
- options: Option[];
13
- value?: Option | Option[];
14
- onChange?: (value: Option | Option[]) => void;
11
+ options: import("./ComboboxSelect").ComboboxSelectOption[];
12
+ value?: import("./ComboboxSelect").ComboboxSelectOption | import("./ComboboxSelect").ComboboxSelectOption[];
13
+ onChange?: (value: import("./ComboboxSelect").ComboboxSelectOption | import("./ComboboxSelect").ComboboxSelectOption[]) => void;
15
14
  isDisabled?: boolean;
16
15
  placeholder?: string;
17
16
  dataUieName?: string;
@@ -20,6 +19,9 @@ declare const meta: {
20
19
  noOptionsMessage: string;
21
20
  label?: string;
22
21
  required?: boolean;
22
+ menuPotralTarget?: HTMLElement;
23
+ menuPosition?: import("react-select").MenuPosition;
24
+ menuListCSS?: import("@emotion/serialize").CSSObject;
23
25
  }>) => import("@emotion/react/jsx-runtime").JSX.Element)[];
24
26
  tags: string[];
25
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ComboboxSelect.stories.d.ts","sourceRoot":"","sources":["../../../../src/Form/Select/ComboboxSelect/ComboboxSelect.stories.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAO,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAiB,KAAK,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAE1E,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAQtC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;CAc6B,CAAC;AAExC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AA8BF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KASvB,CAAC"}
1
+ {"version":3,"file":"ComboboxSelect.stories.d.ts","sourceRoot":"","sources":["../../../../src/Form/Select/ComboboxSelect/ComboboxSelect.stories.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAO,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAiB,KAAK,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAU1E,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAc6B,CAAC;AAExC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AA8BF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KASvB,CAAC"}
@@ -7,9 +7,10 @@ interface SelectStylesParams {
7
7
  menuPosition?: 'absolute' | 'relative';
8
8
  controlCSS?: CSSObject;
9
9
  containerCSS?: CSSObject;
10
+ menuListCSS?: CSSObject;
10
11
  }
11
12
  export declare const wrapperStyles: CSSObject;
12
- export declare const selectStyles: ({ theme, markInvalid, controlCSS, containerCSS, }: SelectStylesParams) => StylesConfig;
13
+ export declare const selectStyles: ({ theme, markInvalid, controlCSS, containerCSS, menuListCSS, }: SelectStylesParams) => StylesConfig;
13
14
  export declare const noOptionsMessageStyles: {
14
15
  padding: string;
15
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ComboboxSelect.styles.d.ts","sourceRoot":"","sources":["../../../../src/Form/Select/ComboboxSelect/ComboboxSelect.styles.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAYtC,UAAU,kBAAkB;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACvC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,SAO3B,CAAC;AAEF,eAAO,MAAM,YAAY,sDAKtB,kBAAkB,KAAG,YAgFtB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;CAElC,CAAC"}
1
+ {"version":3,"file":"ComboboxSelect.styles.d.ts","sourceRoot":"","sources":["../../../../src/Form/Select/ComboboxSelect/ComboboxSelect.styles.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAYtC,UAAU,kBAAkB;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACvC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,eAAO,MAAM,aAAa,EAAE,SAO3B,CAAC;AAEF,eAAO,MAAM,YAAY,mEAMtB,kBAAkB,KAAG,YAqFtB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;CAElC,CAAC"}
@@ -28,7 +28,7 @@ exports.wrapperStyles = {
28
28
  position: 'absolute',
29
29
  },
30
30
  };
31
- const selectStyles = ({ theme, markInvalid = false, controlCSS = {}, containerCSS = {}, }) => ({
31
+ const selectStyles = ({ theme, markInvalid = false, controlCSS = {}, containerCSS = {}, menuListCSS = {}, }) => ({
32
32
  indicatorSeparator: () => (0, BaseSelect_styles_1.baseIndicatorSeparatorStyles)(),
33
33
  indicatorsContainer: provided => provided,
34
34
  container: provided => ({
@@ -43,6 +43,7 @@ const selectStyles = ({ theme, markInvalid = false, controlCSS = {}, containerCS
43
43
  menuList: provided => ({
44
44
  ...provided,
45
45
  ...(0, BaseSelect_styles_1.baseMenuListStyles)(),
46
+ ...menuListCSS,
46
47
  }),
47
48
  option: (provided, { isDisabled, isFocused, isSelected, isMulti }) => ({
48
49
  ...provided,
@@ -67,9 +68,13 @@ const selectStyles = ({ theme, markInvalid = false, controlCSS = {}, containerCS
67
68
  ...provided,
68
69
  ...(0, BaseSelect_styles_1.baseMenuStyles)({ theme, menuPosition: 'absolute' }),
69
70
  width: '100%',
70
- zIndex: 1,
71
+ zIndex: 'var(--z-index-modal)',
71
72
  position: 'absolute',
72
73
  }),
74
+ menuPortal: provided => ({
75
+ ...provided,
76
+ zIndex: 'var(--z-index-modal)',
77
+ }),
73
78
  multiValue: provided => ({
74
79
  ...provided,
75
80
  backgroundColor: theme.Select.optionHoverBg,
package/package.json CHANGED
@@ -78,6 +78,6 @@
78
78
  "test:watch": "jest --watch",
79
79
  "test:update": "jest --updateSnapshot"
80
80
  },
81
- "version": "9.54.0",
82
- "gitHead": "9e335e7c2e065af2c8879f523c1cdb5cfdd62c0c"
81
+ "version": "9.54.1",
82
+ "gitHead": "9a03e450b8c2608ec02c595d7b39fb5cfa260c74"
83
83
  }