glints-aries 4.0.222 → 4.0.224

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.
@@ -5,9 +5,13 @@ export interface ComboboxProps {
5
5
  children?: React.ReactNode;
6
6
  label?: React.ReactNode;
7
7
  onClose?: () => void;
8
+ /** Margin Top = 8 ; Option height = 48 ; optionListHeight = (n options * option height) + margin top; */
9
+ listHeight?: number;
10
+ /** true = Allow vertical scroll, default by 6 options. */
11
+ scrollable?: boolean;
8
12
  }
9
13
  export declare const Combobox: {
10
- ({ activator, allowMultiple, children, onClose, }: ComboboxProps): JSX.Element;
14
+ ({ activator, allowMultiple, children, onClose, listHeight, scrollable, }: ComboboxProps): JSX.Element;
11
15
  Label: ({ children }: {
12
16
  children: React.ReactNode;
13
17
  }) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useState } from 'react';
1
+ import React, { useCallback, useEffect, useState } from 'react';
2
2
  import { Popover } from '../Popover';
3
3
  import { Typography } from '../Typography';
4
4
  import { Neutral } from '../utilities/colors';
@@ -10,13 +10,28 @@ export var Combobox = function Combobox(_ref) {
10
10
  _ref$allowMultiple = _ref.allowMultiple,
11
11
  allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
12
12
  children = _ref.children,
13
- onClose = _ref.onClose;
13
+ onClose = _ref.onClose,
14
+ listHeight = _ref.listHeight,
15
+ scrollable = _ref.scrollable;
14
16
  var _useState = useState(false),
15
17
  popoverActive = _useState[0],
16
18
  setPopoverActive = _useState[1];
17
19
  var _useState2 = useState(),
18
20
  textInputWidth = _useState2[0],
19
21
  setTextInputWidth = _useState2[1];
22
+ var _useState3 = useState(''),
23
+ optionListHeight = _useState3[0],
24
+ setOptionListHeight = _useState3[1];
25
+ useEffect(function () {
26
+ if (listHeight) {
27
+ setOptionListHeight(listHeight + 24 + "px");
28
+ return;
29
+ }
30
+ if (scrollable) {
31
+ setOptionListHeight(296 + 24 + "px");
32
+ return;
33
+ }
34
+ }, [listHeight, scrollable]);
20
35
  var handleClose = useCallback(function () {
21
36
  setPopoverActive(false);
22
37
  onClose == null ? void 0 : onClose();
@@ -47,7 +62,9 @@ export var Combobox = function Combobox(_ref) {
47
62
  autofocusTarget: "none",
48
63
  preventFocusOnClose: true,
49
64
  fullWidth: true
50
- }, /*#__PURE__*/React.createElement(Popover.Pane, null, /*#__PURE__*/React.createElement(ComboboxOptionContext.Provider, {
65
+ }, /*#__PURE__*/React.createElement(Popover.Pane, {
66
+ height: optionListHeight
67
+ }, /*#__PURE__*/React.createElement(ComboboxOptionContext.Provider, {
51
68
  value: optionContextValue
52
69
  }, /*#__PURE__*/React.createElement(ComboboxTextInputContext.Provider, {
53
70
  value: textInputContextValue
@@ -2,3 +2,4 @@ import { Meta } from '@storybook/react';
2
2
  declare const _default: Meta<import("@storybook/react").Args>;
3
3
  export default _default;
4
4
  export declare const MultiSelect: any;
5
+ export declare const MultiSelectScrollable: any;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { OptionType } from '../components/OptionList/Option';
3
+ interface ComboboxMultiSelectProps {
4
+ countries: OptionType[];
5
+ }
6
+ export declare const ComboboxMultiSelect: ({ countries, ...args }: ComboboxMultiSelectProps) => JSX.Element;
7
+ export {};
@@ -0,0 +1,97 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
+ var _excluded = ["countries"];
4
+ import React, { useCallback, useEffect, useState } from 'react';
5
+ import { Blue } from '../../utilities/colors';
6
+ import { space8 } from '../../utilities/spacing';
7
+ import { Combobox } from '../Combobox';
8
+ import { StyledTag } from './TagStyle';
9
+ export var ComboboxMultiSelect = function ComboboxMultiSelect(_ref) {
10
+ var countries = _ref.countries,
11
+ args = _objectWithoutPropertiesLoose(_ref, _excluded);
12
+ var _useState = useState(''),
13
+ inputValue = _useState[0],
14
+ setInputValue = _useState[1];
15
+ var _useState2 = useState([]),
16
+ selectedOptions = _useState2[0],
17
+ setSelectedOptions = _useState2[1];
18
+ var _useState3 = useState(false),
19
+ isSearchEmpty = _useState3[0],
20
+ setIsSearchEmpty = _useState3[1];
21
+ var _useState4 = useState(countries),
22
+ options = _useState4[0],
23
+ setOptions = _useState4[1];
24
+ var handleInputChange = function handleInputChange(value) {
25
+ setInputValue(value);
26
+ if (value === '') {
27
+ setOptions(countries);
28
+ return;
29
+ }
30
+ var filterRegex = new RegExp(value, 'i');
31
+ var filterOptions = options.filter(function (country) {
32
+ return country.label.match(filterRegex);
33
+ });
34
+ setOptions(filterOptions);
35
+ };
36
+ var handleSelect = function handleSelect(selected) {
37
+ if (selectedOptions.includes(selected)) {
38
+ setSelectedOptions(selectedOptions.filter(function (option) {
39
+ return option !== selected;
40
+ }));
41
+ } else {
42
+ setSelectedOptions([].concat(selectedOptions, [selected]));
43
+ }
44
+ };
45
+ var optionsMarkup = (options == null ? void 0 : options.length) > 0 ? options.map(function (option) {
46
+ var label = option.label,
47
+ value = option.value;
48
+ return /*#__PURE__*/React.createElement(Combobox.Option, {
49
+ key: value,
50
+ label: label,
51
+ value: value,
52
+ selected: selectedOptions.includes(value)
53
+ });
54
+ }) : null;
55
+ var removeTag = useCallback(function (tag) {
56
+ return function () {
57
+ var options = [].concat(selectedOptions);
58
+ options.splice(options.indexOf(tag), 1);
59
+ setSelectedOptions(options);
60
+ };
61
+ }, [selectedOptions]);
62
+ var tagsMarkup = selectedOptions.map(function (option) {
63
+ return /*#__PURE__*/React.createElement(StyledTag, {
64
+ key: "option-" + option,
65
+ onRemove: removeTag(option),
66
+ textColor: Blue.S99
67
+ }, option);
68
+ });
69
+ useEffect(function () {
70
+ if (options.length === 0) {
71
+ setIsSearchEmpty(true);
72
+ }
73
+ if (options.length > 0 && isSearchEmpty === true) {
74
+ setIsSearchEmpty(false);
75
+ }
76
+ }, [isSearchEmpty, options]);
77
+ return /*#__PURE__*/React.createElement("div", {
78
+ style: {
79
+ maxWidth: '500px'
80
+ }
81
+ }, /*#__PURE__*/React.createElement(Combobox.Label, null, "Label"), /*#__PURE__*/React.createElement(Combobox, _extends({}, args, {
82
+ activator: /*#__PURE__*/React.createElement(Combobox.TextInput, {
83
+ value: inputValue,
84
+ onChange: function onChange(value) {
85
+ return handleInputChange(value);
86
+ },
87
+ placeholder: "Search"
88
+ })
89
+ }), /*#__PURE__*/React.createElement(Combobox.OptionList, {
90
+ onSelect: handleSelect,
91
+ isEmpty: isSearchEmpty
92
+ }, optionsMarkup)), /*#__PURE__*/React.createElement("div", {
93
+ style: {
94
+ paddingTop: space8
95
+ }
96
+ }, tagsMarkup));
97
+ };
@@ -3,6 +3,7 @@ import { NoOptionListProps } from './Option';
3
3
  export interface OptionListProps extends NoOptionListProps {
4
4
  children: React.ReactNode;
5
5
  isEmpty?: boolean;
6
+ height?: string;
6
7
  onSelect?(value: string): void;
7
8
  }
8
9
  export declare const OptionList: ({ children, isEmpty, noOptionsMessage, onSelect, }: OptionListProps) => JSX.Element;
@@ -18,7 +18,7 @@ export var StyledModalHeader = styled.div.withConfig({
18
18
  export var StyledModalContent = styled.div.withConfig({
19
19
  displayName: "ModalStyle__StyledModalContent",
20
20
  componentId: "sc-1694up4-3"
21
- })(["min-height:24px;color:#202223;width:fit-content;padding:20px;word-break:break-all;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, space16);
21
+ })(["min-height:24px;color:#202223;width:fit-content;padding:20px;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, space16);
22
22
  export var StyledModalActions = styled.div.withConfig({
23
23
  displayName: "ModalStyle__StyledModalActions",
24
24
  componentId: "sc-1694up4-4"
@@ -1,7 +1,7 @@
1
1
  import { createGlobalStyle } from 'styled-components';
2
2
  import { borderRadius8 } from '../utilities/borderRadius';
3
- import { Neutral } from '../utilities/colors';
3
+ import { Blue, Neutral } from '../utilities/colors';
4
4
  import { space16, space4, space8 } from '../utilities/spacing';
5
5
 
6
6
  // we need to use global style here because popover is created outside the root element for react app
7
- export var StyledPopover = createGlobalStyle([".Polaris-Popover{max-width:calc(100vw - ", ");margin:0.3125rem 2px ", ";box-shadow:0px ", " 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);border-radius:", ";backface-visibility:hidden;will-change:left,top;}.Polaris-Popover__PopoverOverlay{opacity:0;transition:opacity 100ms ease,transform 100ms ease;transform:translateY(-0.3125rem);}.Polaris-Popover__PopoverOverlay--entering{opacity:1;transform:translateY(0);}.Polaris-Popover__PopoverOverlay--open{opacity:1;transform:none;}.Polaris-Popover__PopoverOverlay--exiting{opacity:1;transform:translateY(0);transition-duration:0ms;}.Polaris-Popover--measuring:not(.Polaris-Popover__PopoverOverlay--exiting){opacity:0;transform:translateY(-0.3125rem);}.Polaris-Popover--fullWidth{margin:0.3125rem auto 0 auto;width:fit-content;}.Polaris-Popover--fullWidth .Polaris-Popover__Content{max-width:none;}.Polaris-Popover--positionedAbove{margin:", " 2px 0.3125rem;}.Polaris-Popover--positionedAbove.Polaris-Popover--fullWidth{margin:0 auto 0.3125rem auto;}.Polaris-Popover__Wrapper{position:relative;overflow:hidden;background-color:", ";border-radius:", ";outline:1px solid transparent;}.Polaris-Popover__Content{position:relative;display:flex;flex-direction:column;border-radius:1px;max-width:25rem;max-height:31.25rem;}.Polaris-Popover__Content:focus{outline:none;}.Polaris-Popover__Content--fullHeight{max-height:none;}.Polaris-Popover__Content--fluidContent{max-height:none;max-width:none;}.Polaris-Popover__Pane{flex:1 1;max-width:100%;}.Polaris-Popover__Pane + .Polaris-Popover__Pane{border-top:1px solid ", ";}.Polaris-Popover__Pane:focus{outline:none;}.Polaris-Popover__Pane--fixed{overflow:visible;flex:0 0 auto;}.Polaris-Popover__Pane--captureOverscroll{overscroll-behavior:contain;}.Polaris-Popover__Section{padding:", ";color:", ";}.Polaris-Popover__Section + .Polaris-Popover__Section{border-top:1px solid #e1e3e5;}.Polaris-Popover__FocusTracker{position:absolute !important;top:0;width:0.0625rem !important;height:0.0625rem !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important;}@media print{.Polaris-Popover__PopoverOverlay--hideOnPrint{display:none !important;}}.Polaris-PositionedOverlay{position:absolute;z-index:400;}.Polaris-PositionedOverlay--fixed{position:fixed;}.Polaris-PositionedOverlay--calculating{visibility:hidden;}.Polaris-PositionedOverlay--preventInteraction{pointer-events:none;}"], space8, space4, space8, borderRadius8, space4, Neutral.B100, borderRadius8, Neutral.B85, space16, Neutral.B40);
7
+ export var StyledPopover = createGlobalStyle([".Polaris-Popover{max-width:calc(100vw - ", ");margin:0.3125rem 2px ", ";box-shadow:0px ", " 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);border-radius:", ";backface-visibility:hidden;will-change:left,top;}.Polaris-Popover__PopoverOverlay{opacity:0;transition:opacity 100ms ease,transform 100ms ease;transform:translateY(-0.3125rem);}.Polaris-Popover__PopoverOverlay--entering{opacity:1;transform:translateY(0);}.Polaris-Popover__PopoverOverlay--open{opacity:1;transform:none;}.Polaris-Popover__PopoverOverlay--exiting{opacity:1;transform:translateY(0);transition-duration:0ms;}.Polaris-Popover--measuring:not(.Polaris-Popover__PopoverOverlay--exiting){opacity:0;transform:translateY(-0.3125rem);}.Polaris-Popover--fullWidth{margin:0.3125rem auto 0 auto;width:fit-content;}.Polaris-Popover--fullWidth .Polaris-Popover__Content{max-width:none;}.Polaris-Popover--positionedAbove{margin:", " 2px 0.3125rem;}.Polaris-Popover--positionedAbove.Polaris-Popover--fullWidth{margin:0 auto 0.3125rem auto;}.Polaris-Popover__Wrapper{position:relative;overflow:hidden;background-color:", ";border-radius:", ";outline:1px solid transparent;}.Polaris-Popover__Content{position:relative;display:flex;flex-direction:column;border-radius:1px;max-width:25rem;max-height:31.25rem;}.Polaris-Popover__Content:focus{outline:none;}.Polaris-Popover__Content--fullHeight{max-height:none;}.Polaris-Popover__Content--fluidContent{max-height:none;max-width:none;}.Polaris-Popover__Pane{flex:1 1;max-width:100%;}.Polaris-Popover__Pane + .Polaris-Popover__Pane{border-top:1px solid ", ";}.Polaris-Popover__Pane:focus{outline:none;}.Polaris-Popover__Pane--fixed{overflow:visible;flex:0 0 auto;}.Polaris-Popover__Pane--captureOverscroll{overscroll-behavior:contain;}.Polaris-Popover__Section{padding:", ";color:", ";}.Polaris-Popover__Section + .Polaris-Popover__Section{border-top:1px solid #e1e3e5;}.Polaris-Popover__FocusTracker{position:absolute !important;top:0;width:0.0625rem !important;height:0.0625rem !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important;}@media print{.Polaris-Popover__PopoverOverlay--hideOnPrint{display:none !important;}}.Polaris-PositionedOverlay{position:absolute;z-index:400;}.Polaris-PositionedOverlay--fixed{position:fixed;}.Polaris-PositionedOverlay--calculating{visibility:hidden;}.Polaris-PositionedOverlay--preventInteraction{pointer-events:none;}.Polaris-Scrollable{position:relative;max-height:none;overflow-x:hidden;overflow-y:hidden;:focus{outline:0.125rem solid ", ";outline-offset:0.125rem;}}.Polaris-Scrollable--horizontal{overflow-x:auto;}.Polaris-Scrollable--vertical{overflow-y:auto;}"], space8, space4, space8, borderRadius8, space4, Neutral.B100, borderRadius8, Neutral.B85, space16, Neutral.B40, Blue.S54);
@@ -5,9 +5,13 @@ export interface ComboboxProps {
5
5
  children?: React.ReactNode;
6
6
  label?: React.ReactNode;
7
7
  onClose?: () => void;
8
+ /** Margin Top = 8 ; Option height = 48 ; optionListHeight = (n options * option height) + margin top; */
9
+ listHeight?: number;
10
+ /** true = Allow vertical scroll, default by 6 options. */
11
+ scrollable?: boolean;
8
12
  }
9
13
  export declare const Combobox: {
10
- ({ activator, allowMultiple, children, onClose, }: ComboboxProps): JSX.Element;
14
+ ({ activator, allowMultiple, children, onClose, listHeight, scrollable, }: ComboboxProps): JSX.Element;
11
15
  Label: ({ children }: {
12
16
  children: React.ReactNode;
13
17
  }) => JSX.Element;
@@ -16,13 +16,28 @@ var Combobox = function Combobox(_ref) {
16
16
  _ref$allowMultiple = _ref.allowMultiple,
17
17
  allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
18
18
  children = _ref.children,
19
- onClose = _ref.onClose;
19
+ onClose = _ref.onClose,
20
+ listHeight = _ref.listHeight,
21
+ scrollable = _ref.scrollable;
20
22
  var _useState = (0, _react.useState)(false),
21
23
  popoverActive = _useState[0],
22
24
  setPopoverActive = _useState[1];
23
25
  var _useState2 = (0, _react.useState)(),
24
26
  textInputWidth = _useState2[0],
25
27
  setTextInputWidth = _useState2[1];
28
+ var _useState3 = (0, _react.useState)(''),
29
+ optionListHeight = _useState3[0],
30
+ setOptionListHeight = _useState3[1];
31
+ (0, _react.useEffect)(function () {
32
+ if (listHeight) {
33
+ setOptionListHeight(listHeight + 24 + "px");
34
+ return;
35
+ }
36
+ if (scrollable) {
37
+ setOptionListHeight(296 + 24 + "px");
38
+ return;
39
+ }
40
+ }, [listHeight, scrollable]);
26
41
  var handleClose = (0, _react.useCallback)(function () {
27
42
  setPopoverActive(false);
28
43
  onClose == null ? void 0 : onClose();
@@ -53,7 +68,9 @@ var Combobox = function Combobox(_ref) {
53
68
  autofocusTarget: "none",
54
69
  preventFocusOnClose: true,
55
70
  fullWidth: true
56
- }, /*#__PURE__*/_react["default"].createElement(_Popover.Popover.Pane, null, /*#__PURE__*/_react["default"].createElement(_OptionListContext.ComboboxOptionContext.Provider, {
71
+ }, /*#__PURE__*/_react["default"].createElement(_Popover.Popover.Pane, {
72
+ height: optionListHeight
73
+ }, /*#__PURE__*/_react["default"].createElement(_OptionListContext.ComboboxOptionContext.Provider, {
57
74
  value: optionContextValue
58
75
  }, /*#__PURE__*/_react["default"].createElement(_TextInputContext.ComboboxTextInputContext.Provider, {
59
76
  value: textInputContextValue
@@ -2,3 +2,4 @@ import { Meta } from '@storybook/react';
2
2
  declare const _default: Meta<import("@storybook/react").Args>;
3
3
  export default _default;
4
4
  export declare const MultiSelect: any;
5
+ export declare const MultiSelectScrollable: any;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { OptionType } from '../components/OptionList/Option';
3
+ interface ComboboxMultiSelectProps {
4
+ countries: OptionType[];
5
+ }
6
+ export declare const ComboboxMultiSelect: ({ countries, ...args }: ComboboxMultiSelectProps) => JSX.Element;
7
+ export {};
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.ComboboxMultiSelect = void 0;
6
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _colors = require("../../utilities/colors");
10
+ var _spacing = require("../../utilities/spacing");
11
+ var _Combobox = require("../Combobox");
12
+ var _TagStyle = require("./TagStyle");
13
+ var _excluded = ["countries"];
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ var ComboboxMultiSelect = function ComboboxMultiSelect(_ref) {
17
+ var countries = _ref.countries,
18
+ args = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
19
+ var _useState = (0, _react.useState)(''),
20
+ inputValue = _useState[0],
21
+ setInputValue = _useState[1];
22
+ var _useState2 = (0, _react.useState)([]),
23
+ selectedOptions = _useState2[0],
24
+ setSelectedOptions = _useState2[1];
25
+ var _useState3 = (0, _react.useState)(false),
26
+ isSearchEmpty = _useState3[0],
27
+ setIsSearchEmpty = _useState3[1];
28
+ var _useState4 = (0, _react.useState)(countries),
29
+ options = _useState4[0],
30
+ setOptions = _useState4[1];
31
+ var handleInputChange = function handleInputChange(value) {
32
+ setInputValue(value);
33
+ if (value === '') {
34
+ setOptions(countries);
35
+ return;
36
+ }
37
+ var filterRegex = new RegExp(value, 'i');
38
+ var filterOptions = options.filter(function (country) {
39
+ return country.label.match(filterRegex);
40
+ });
41
+ setOptions(filterOptions);
42
+ };
43
+ var handleSelect = function handleSelect(selected) {
44
+ if (selectedOptions.includes(selected)) {
45
+ setSelectedOptions(selectedOptions.filter(function (option) {
46
+ return option !== selected;
47
+ }));
48
+ } else {
49
+ setSelectedOptions([].concat(selectedOptions, [selected]));
50
+ }
51
+ };
52
+ var optionsMarkup = (options == null ? void 0 : options.length) > 0 ? options.map(function (option) {
53
+ var label = option.label,
54
+ value = option.value;
55
+ return /*#__PURE__*/_react["default"].createElement(_Combobox.Combobox.Option, {
56
+ key: value,
57
+ label: label,
58
+ value: value,
59
+ selected: selectedOptions.includes(value)
60
+ });
61
+ }) : null;
62
+ var removeTag = (0, _react.useCallback)(function (tag) {
63
+ return function () {
64
+ var options = [].concat(selectedOptions);
65
+ options.splice(options.indexOf(tag), 1);
66
+ setSelectedOptions(options);
67
+ };
68
+ }, [selectedOptions]);
69
+ var tagsMarkup = selectedOptions.map(function (option) {
70
+ return /*#__PURE__*/_react["default"].createElement(_TagStyle.StyledTag, {
71
+ key: "option-" + option,
72
+ onRemove: removeTag(option),
73
+ textColor: _colors.Blue.S99
74
+ }, option);
75
+ });
76
+ (0, _react.useEffect)(function () {
77
+ if (options.length === 0) {
78
+ setIsSearchEmpty(true);
79
+ }
80
+ if (options.length > 0 && isSearchEmpty === true) {
81
+ setIsSearchEmpty(false);
82
+ }
83
+ }, [isSearchEmpty, options]);
84
+ return /*#__PURE__*/_react["default"].createElement("div", {
85
+ style: {
86
+ maxWidth: '500px'
87
+ }
88
+ }, /*#__PURE__*/_react["default"].createElement(_Combobox.Combobox.Label, null, "Label"), /*#__PURE__*/_react["default"].createElement(_Combobox.Combobox, (0, _extends2["default"])({}, args, {
89
+ activator: /*#__PURE__*/_react["default"].createElement(_Combobox.Combobox.TextInput, {
90
+ value: inputValue,
91
+ onChange: function onChange(value) {
92
+ return handleInputChange(value);
93
+ },
94
+ placeholder: "Search"
95
+ })
96
+ }), /*#__PURE__*/_react["default"].createElement(_Combobox.Combobox.OptionList, {
97
+ onSelect: handleSelect,
98
+ isEmpty: isSearchEmpty
99
+ }, optionsMarkup)), /*#__PURE__*/_react["default"].createElement("div", {
100
+ style: {
101
+ paddingTop: _spacing.space8
102
+ }
103
+ }, tagsMarkup));
104
+ };
105
+ exports.ComboboxMultiSelect = ComboboxMultiSelect;
@@ -3,6 +3,7 @@ import { NoOptionListProps } from './Option';
3
3
  export interface OptionListProps extends NoOptionListProps {
4
4
  children: React.ReactNode;
5
5
  isEmpty?: boolean;
6
+ height?: string;
6
7
  onSelect?(value: string): void;
7
8
  }
8
9
  export declare const OptionList: ({ children, isEmpty, noOptionsMessage, onSelect, }: OptionListProps) => JSX.Element;
@@ -28,7 +28,7 @@ exports.StyledModalHeader = StyledModalHeader;
28
28
  var StyledModalContent = _styledComponents["default"].div.withConfig({
29
29
  displayName: "ModalStyle__StyledModalContent",
30
30
  componentId: "sc-1694up4-3"
31
- })(["min-height:24px;color:#202223;width:fit-content;padding:20px;word-break:break-all;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, _spacing.space16);
31
+ })(["min-height:24px;color:#202223;width:fit-content;padding:20px;@media (max-width:", "){padding:20px ", ";}"], Breakpoints.large, _spacing.space16);
32
32
  exports.StyledModalContent = StyledModalContent;
33
33
  var StyledModalActions = _styledComponents["default"].div.withConfig({
34
34
  displayName: "ModalStyle__StyledModalActions",
@@ -7,5 +7,5 @@ var _borderRadius = require("../utilities/borderRadius");
7
7
  var _colors = require("../utilities/colors");
8
8
  var _spacing = require("../utilities/spacing");
9
9
  // we need to use global style here because popover is created outside the root element for react app
10
- var StyledPopover = (0, _styledComponents.createGlobalStyle)([".Polaris-Popover{max-width:calc(100vw - ", ");margin:0.3125rem 2px ", ";box-shadow:0px ", " 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);border-radius:", ";backface-visibility:hidden;will-change:left,top;}.Polaris-Popover__PopoverOverlay{opacity:0;transition:opacity 100ms ease,transform 100ms ease;transform:translateY(-0.3125rem);}.Polaris-Popover__PopoverOverlay--entering{opacity:1;transform:translateY(0);}.Polaris-Popover__PopoverOverlay--open{opacity:1;transform:none;}.Polaris-Popover__PopoverOverlay--exiting{opacity:1;transform:translateY(0);transition-duration:0ms;}.Polaris-Popover--measuring:not(.Polaris-Popover__PopoverOverlay--exiting){opacity:0;transform:translateY(-0.3125rem);}.Polaris-Popover--fullWidth{margin:0.3125rem auto 0 auto;width:fit-content;}.Polaris-Popover--fullWidth .Polaris-Popover__Content{max-width:none;}.Polaris-Popover--positionedAbove{margin:", " 2px 0.3125rem;}.Polaris-Popover--positionedAbove.Polaris-Popover--fullWidth{margin:0 auto 0.3125rem auto;}.Polaris-Popover__Wrapper{position:relative;overflow:hidden;background-color:", ";border-radius:", ";outline:1px solid transparent;}.Polaris-Popover__Content{position:relative;display:flex;flex-direction:column;border-radius:1px;max-width:25rem;max-height:31.25rem;}.Polaris-Popover__Content:focus{outline:none;}.Polaris-Popover__Content--fullHeight{max-height:none;}.Polaris-Popover__Content--fluidContent{max-height:none;max-width:none;}.Polaris-Popover__Pane{flex:1 1;max-width:100%;}.Polaris-Popover__Pane + .Polaris-Popover__Pane{border-top:1px solid ", ";}.Polaris-Popover__Pane:focus{outline:none;}.Polaris-Popover__Pane--fixed{overflow:visible;flex:0 0 auto;}.Polaris-Popover__Pane--captureOverscroll{overscroll-behavior:contain;}.Polaris-Popover__Section{padding:", ";color:", ";}.Polaris-Popover__Section + .Polaris-Popover__Section{border-top:1px solid #e1e3e5;}.Polaris-Popover__FocusTracker{position:absolute !important;top:0;width:0.0625rem !important;height:0.0625rem !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important;}@media print{.Polaris-Popover__PopoverOverlay--hideOnPrint{display:none !important;}}.Polaris-PositionedOverlay{position:absolute;z-index:400;}.Polaris-PositionedOverlay--fixed{position:fixed;}.Polaris-PositionedOverlay--calculating{visibility:hidden;}.Polaris-PositionedOverlay--preventInteraction{pointer-events:none;}"], _spacing.space8, _spacing.space4, _spacing.space8, _borderRadius.borderRadius8, _spacing.space4, _colors.Neutral.B100, _borderRadius.borderRadius8, _colors.Neutral.B85, _spacing.space16, _colors.Neutral.B40);
10
+ var StyledPopover = (0, _styledComponents.createGlobalStyle)([".Polaris-Popover{max-width:calc(100vw - ", ");margin:0.3125rem 2px ", ";box-shadow:0px ", " 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);border-radius:", ";backface-visibility:hidden;will-change:left,top;}.Polaris-Popover__PopoverOverlay{opacity:0;transition:opacity 100ms ease,transform 100ms ease;transform:translateY(-0.3125rem);}.Polaris-Popover__PopoverOverlay--entering{opacity:1;transform:translateY(0);}.Polaris-Popover__PopoverOverlay--open{opacity:1;transform:none;}.Polaris-Popover__PopoverOverlay--exiting{opacity:1;transform:translateY(0);transition-duration:0ms;}.Polaris-Popover--measuring:not(.Polaris-Popover__PopoverOverlay--exiting){opacity:0;transform:translateY(-0.3125rem);}.Polaris-Popover--fullWidth{margin:0.3125rem auto 0 auto;width:fit-content;}.Polaris-Popover--fullWidth .Polaris-Popover__Content{max-width:none;}.Polaris-Popover--positionedAbove{margin:", " 2px 0.3125rem;}.Polaris-Popover--positionedAbove.Polaris-Popover--fullWidth{margin:0 auto 0.3125rem auto;}.Polaris-Popover__Wrapper{position:relative;overflow:hidden;background-color:", ";border-radius:", ";outline:1px solid transparent;}.Polaris-Popover__Content{position:relative;display:flex;flex-direction:column;border-radius:1px;max-width:25rem;max-height:31.25rem;}.Polaris-Popover__Content:focus{outline:none;}.Polaris-Popover__Content--fullHeight{max-height:none;}.Polaris-Popover__Content--fluidContent{max-height:none;max-width:none;}.Polaris-Popover__Pane{flex:1 1;max-width:100%;}.Polaris-Popover__Pane + .Polaris-Popover__Pane{border-top:1px solid ", ";}.Polaris-Popover__Pane:focus{outline:none;}.Polaris-Popover__Pane--fixed{overflow:visible;flex:0 0 auto;}.Polaris-Popover__Pane--captureOverscroll{overscroll-behavior:contain;}.Polaris-Popover__Section{padding:", ";color:", ";}.Polaris-Popover__Section + .Polaris-Popover__Section{border-top:1px solid #e1e3e5;}.Polaris-Popover__FocusTracker{position:absolute !important;top:0;width:0.0625rem !important;height:0.0625rem !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important;}@media print{.Polaris-Popover__PopoverOverlay--hideOnPrint{display:none !important;}}.Polaris-PositionedOverlay{position:absolute;z-index:400;}.Polaris-PositionedOverlay--fixed{position:fixed;}.Polaris-PositionedOverlay--calculating{visibility:hidden;}.Polaris-PositionedOverlay--preventInteraction{pointer-events:none;}.Polaris-Scrollable{position:relative;max-height:none;overflow-x:hidden;overflow-y:hidden;:focus{outline:0.125rem solid ", ";outline-offset:0.125rem;}}.Polaris-Scrollable--horizontal{overflow-x:auto;}.Polaris-Scrollable--vertical{overflow-y:auto;}"], _spacing.space8, _spacing.space4, _spacing.space8, _borderRadius.borderRadius8, _spacing.space4, _colors.Neutral.B100, _borderRadius.borderRadius8, _colors.Neutral.B85, _spacing.space16, _colors.Neutral.B40, _colors.Blue.S54);
11
11
  exports.StyledPopover = StyledPopover;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glints-aries",
3
- "version": "4.0.222",
3
+ "version": "4.0.224",
4
4
  "description": "Glints ui-kit for frontend",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",