glints-aries 4.0.231 → 4.0.232
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/es/@next/Checkbox/Checkbox.js +3 -1
- package/es/@next/IndexTable/IndexTable.js +3 -2
- package/es/@next/IndexTable/IndexTableStyle.js +3 -1
- package/es/@next/IndexTable/components/Checkbox/Checkbox.js +3 -1
- package/es/@next/IndexTable/components/Checkbox/CheckboxStyle.js +2 -1
- package/es/@next/Menu/Menu.d.ts +12 -5
- package/es/@next/Menu/Menu.js +84 -31
- package/es/@next/Menu/Menu.stories.d.ts +2 -0
- package/es/@next/Menu/MenuStyle.d.ts +1 -0
- package/es/@next/Menu/MenuStyle.js +7 -3
- package/es/@next/Menu/components/MenuOption.d.ts +12 -0
- package/es/@next/Menu/components/MenuOption.js +24 -0
- package/es/@next/Menu/components/MenuOptionCheckbox.d.ts +6 -0
- package/es/@next/Menu/components/MenuOptionCheckbox.js +12 -0
- package/es/@next/Menu/components/MenuOptionLabel.d.ts +4 -0
- package/es/@next/Menu/components/MenuOptionLabel.js +11 -0
- package/es/@next/Menu/components/index.d.ts +3 -0
- package/es/@next/Menu/components/index.js +3 -0
- package/es/@next/Menu/index.d.ts +1 -0
- package/es/@next/Menu/index.js +2 -1
- package/es/@next/Menu/menuStoryHelper/PopoverMenu.d.ts +7 -0
- package/es/@next/Menu/menuStoryHelper/PopoverMenu.js +52 -0
- package/es/@next/Select/Select.d.ts +36 -0
- package/es/@next/Select/Select.js +118 -0
- package/es/@next/Select/Select.stories.d.ts +11 -0
- package/es/@next/Select/SelectStyle.d.ts +6 -0
- package/es/@next/Select/SelectStyle.js +12 -0
- package/es/@next/Select/components/Activator/ActivatorContext.d.ts +17 -0
- package/es/@next/Select/components/Activator/ActivatorContext.js +17 -0
- package/es/@next/Select/components/Activator/ActivatorSelect.d.ts +10 -0
- package/es/@next/Select/components/Activator/ActivatorSelect.js +71 -0
- package/es/@next/Select/components/Activator/ActivatorStyle.d.ts +9 -0
- package/es/@next/Select/components/Activator/ActivatorStyle.js +28 -0
- package/es/@next/Select/components/Activator/ActivatorTextInput.d.ts +8 -0
- package/es/@next/Select/components/Activator/ActivatorTextInput.js +38 -0
- package/es/@next/Select/components/Activator/index.d.ts +2 -0
- package/es/@next/Select/components/Activator/index.js +2 -0
- package/es/@next/Select/components/Label/Label.d.ts +4 -0
- package/es/@next/Select/components/Label/Label.js +11 -0
- package/es/@next/Select/components/OptionList/OptionList.d.ts +15 -0
- package/es/@next/Select/components/OptionList/OptionList.js +46 -0
- package/es/@next/Select/components/OptionList/OptionListStyle.d.ts +6 -0
- package/es/@next/Select/components/OptionList/OptionListStyle.js +12 -0
- package/es/@next/Select/components/OptionList/index.d.ts +1 -0
- package/es/@next/Select/components/OptionList/index.js +1 -0
- package/es/@next/Select/components/index.d.ts +2 -0
- package/es/@next/Select/components/index.js +2 -0
- package/es/@next/Select/index.d.ts +2 -0
- package/es/@next/Select/index.js +2 -0
- package/es/@next/Select/selectStoryHelper/NonSearchableMultiSelect.d.ts +3 -0
- package/es/@next/Select/selectStoryHelper/NonSearchableMultiSelect.js +40 -0
- package/es/@next/Select/selectStoryHelper/NonSearchableSingleSelect.d.ts +3 -0
- package/es/@next/Select/selectStoryHelper/NonSearchableSingleSelect.js +27 -0
- package/es/@next/Select/selectStoryHelper/Searchable.d.ts +7 -0
- package/es/@next/Select/selectStoryHelper/Searchable.js +85 -0
- package/es/@next/Select/selectStoryHelper/SelectStoryStyle.d.ts +2 -0
- package/es/@next/Select/selectStoryHelper/SelectStoryStyle.js +7 -0
- package/es/@next/Tag/Tag.d.ts +1 -1
- package/es/@next/Tag/TagStyle.js +1 -1
- package/es/@next/TextInput/TextInput.js +4 -2
- package/es/@next/index.d.ts +1 -0
- package/es/@next/index.js +1 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/@next/Checkbox/Checkbox.js +3 -1
- package/lib/@next/IndexTable/IndexTable.js +3 -2
- package/lib/@next/IndexTable/IndexTableStyle.js +3 -1
- package/lib/@next/IndexTable/components/Checkbox/Checkbox.js +3 -1
- package/lib/@next/IndexTable/components/Checkbox/CheckboxStyle.js +2 -1
- package/lib/@next/Menu/Menu.d.ts +12 -5
- package/lib/@next/Menu/Menu.js +83 -30
- package/lib/@next/Menu/Menu.stories.d.ts +2 -0
- package/lib/@next/Menu/MenuStyle.d.ts +1 -0
- package/lib/@next/Menu/MenuStyle.js +9 -4
- package/lib/@next/Menu/components/MenuOption.d.ts +12 -0
- package/lib/@next/Menu/components/MenuOption.js +30 -0
- package/lib/@next/Menu/components/MenuOptionCheckbox.d.ts +6 -0
- package/lib/@next/Menu/components/MenuOptionCheckbox.js +18 -0
- package/lib/@next/Menu/components/MenuOptionLabel.d.ts +4 -0
- package/lib/@next/Menu/components/MenuOptionLabel.js +17 -0
- package/lib/@next/Menu/components/index.d.ts +3 -0
- package/lib/@next/Menu/components/index.js +11 -0
- package/lib/@next/Menu/index.d.ts +1 -0
- package/lib/@next/Menu/index.js +6 -0
- package/lib/@next/Menu/menuStoryHelper/PopoverMenu.d.ts +7 -0
- package/lib/@next/Menu/menuStoryHelper/PopoverMenu.js +60 -0
- package/lib/@next/Select/Select.d.ts +36 -0
- package/lib/@next/Select/Select.js +125 -0
- package/lib/@next/Select/Select.stories.d.ts +11 -0
- package/lib/@next/Select/SelectStyle.d.ts +6 -0
- package/lib/@next/Select/SelectStyle.js +19 -0
- package/lib/@next/Select/components/Activator/ActivatorContext.d.ts +17 -0
- package/lib/@next/Select/components/Activator/ActivatorContext.js +25 -0
- package/lib/@next/Select/components/Activator/ActivatorSelect.d.ts +10 -0
- package/lib/@next/Select/components/Activator/ActivatorSelect.js +79 -0
- package/lib/@next/Select/components/Activator/ActivatorStyle.d.ts +9 -0
- package/lib/@next/Select/components/Activator/ActivatorStyle.js +39 -0
- package/lib/@next/Select/components/Activator/ActivatorTextInput.d.ts +8 -0
- package/lib/@next/Select/components/Activator/ActivatorTextInput.js +46 -0
- package/lib/@next/Select/components/Activator/index.d.ts +2 -0
- package/lib/@next/Select/components/Activator/index.js +8 -0
- package/lib/@next/Select/components/Label/Label.d.ts +4 -0
- package/lib/@next/Select/components/Label/Label.js +17 -0
- package/lib/@next/Select/components/OptionList/OptionList.d.ts +15 -0
- package/lib/@next/Select/components/OptionList/OptionList.js +53 -0
- package/lib/@next/Select/components/OptionList/OptionListStyle.d.ts +6 -0
- package/lib/@next/Select/components/OptionList/OptionListStyle.js +19 -0
- package/lib/@next/Select/components/OptionList/index.d.ts +1 -0
- package/lib/@next/Select/components/OptionList/index.js +6 -0
- package/lib/@next/Select/components/index.d.ts +2 -0
- package/lib/@next/Select/components/index.js +18 -0
- package/lib/@next/Select/index.d.ts +2 -0
- package/lib/@next/Select/index.js +15 -0
- package/lib/@next/Select/selectStoryHelper/NonSearchableMultiSelect.d.ts +3 -0
- package/lib/@next/Select/selectStoryHelper/NonSearchableMultiSelect.js +48 -0
- package/lib/@next/Select/selectStoryHelper/NonSearchableSingleSelect.d.ts +3 -0
- package/lib/@next/Select/selectStoryHelper/NonSearchableSingleSelect.js +35 -0
- package/lib/@next/Select/selectStoryHelper/Searchable.d.ts +7 -0
- package/lib/@next/Select/selectStoryHelper/Searchable.js +93 -0
- package/lib/@next/Select/selectStoryHelper/SelectStoryStyle.d.ts +2 -0
- package/lib/@next/Select/selectStoryHelper/SelectStoryStyle.js +13 -0
- package/lib/@next/Tag/Tag.d.ts +1 -1
- package/lib/@next/Tag/TagStyle.js +1 -1
- package/lib/@next/TextInput/TextInput.js +4 -2
- package/lib/@next/index.d.ts +1 -0
- package/lib/@next/index.js +4 -1
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.TitleContainer = exports.StyledMenu = exports.ListContainer = void 0;
|
|
5
|
+
exports.TitleContainer = exports.StyledSections = exports.StyledMenu = exports.ListContainer = void 0;
|
|
6
6
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
7
|
var _borderRadius = require("../utilities/borderRadius");
|
|
8
8
|
var _colors = require("../utilities/colors");
|
|
@@ -10,15 +10,20 @@ var _spacing = require("../utilities/spacing");
|
|
|
10
10
|
var StyledMenu = _styledComponents["default"].ul.withConfig({
|
|
11
11
|
displayName: "MenuStyle__StyledMenu",
|
|
12
12
|
componentId: "sc-zm0l1a-0"
|
|
13
|
-
})(["list-style:none;
|
|
13
|
+
})(["list-style:none;padding:0;margin:0;li{display:flex;height:44px;position:relative;align-items:center;padding:0 ", ";margin-bottom:", ";svg{height:24px;width:24px;}&:hover{background:", ";border-radius:", ";cursor:pointer;}&:focus{outline:none;background:rgba(255,255,255,0.001);border:2px solid ", ";border-radius:", ";}&[aria-disabled='true']{cursor:default;pointer-events:none;span{color:", ";}}&[data-active='true']{background:", ";border-radius:", ";cursor:default;::before{content:'';display:block;position:absolute;top:0;left:-", ";height:44px;width:3px;background-color:", ";border-radius:0px 4px 4px 0px;}&[data-multiple='true']{background:", ";::before{content:none;}}}}"], _spacing.space8, _spacing.space4, _colors.Neutral.B99, _borderRadius.borderRadius4, _colors.Blue.S54, _spacing.space4, _colors.Neutral.B85, _colors.Blue.S08, _borderRadius.borderRadius4, _spacing.space8, _colors.Blue.S99, _colors.Neutral.B100);
|
|
14
14
|
exports.StyledMenu = StyledMenu;
|
|
15
15
|
var TitleContainer = _styledComponents["default"].div.withConfig({
|
|
16
16
|
displayName: "MenuStyle__TitleContainer",
|
|
17
17
|
componentId: "sc-zm0l1a-1"
|
|
18
|
-
})(["padding:", " ", ";span{text-transform:uppercase;}"], _spacing.space8, _spacing.space16);
|
|
18
|
+
})(["margin:", " 0 ", ";padding:", " ", ";span{text-transform:uppercase;}"], _spacing.space8, _spacing.space4, _spacing.space8, _spacing.space16);
|
|
19
19
|
exports.TitleContainer = TitleContainer;
|
|
20
20
|
var ListContainer = _styledComponents["default"].div.withConfig({
|
|
21
21
|
displayName: "MenuStyle__ListContainer",
|
|
22
22
|
componentId: "sc-zm0l1a-2"
|
|
23
23
|
})(["padding:0 ", ";"], _spacing.space8);
|
|
24
|
-
exports.ListContainer = ListContainer;
|
|
24
|
+
exports.ListContainer = ListContainer;
|
|
25
|
+
var StyledSections = _styledComponents["default"].ul.withConfig({
|
|
26
|
+
displayName: "MenuStyle__StyledSections",
|
|
27
|
+
componentId: "sc-zm0l1a-3"
|
|
28
|
+
})(["list-style:none;padding:0;margin:", " 0;"], _spacing.space8);
|
|
29
|
+
exports.StyledSections = StyledSections;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MenuOptionProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'onClick'> {
|
|
3
|
+
id?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
isSelected?: boolean;
|
|
6
|
+
value: string;
|
|
7
|
+
onClick?({ value }: {
|
|
8
|
+
value: string;
|
|
9
|
+
}): void;
|
|
10
|
+
allowMultiple?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const MenuOption: ({ children, disabled, isSelected, onClick, value, allowMultiple, }: MenuOptionProps) => JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.MenuOption = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _MenuStyle = require("../MenuStyle");
|
|
8
|
+
var MenuOption = function MenuOption(_ref) {
|
|
9
|
+
var children = _ref.children,
|
|
10
|
+
disabled = _ref.disabled,
|
|
11
|
+
isSelected = _ref.isSelected,
|
|
12
|
+
onClick = _ref.onClick,
|
|
13
|
+
value = _ref.value,
|
|
14
|
+
allowMultiple = _ref.allowMultiple;
|
|
15
|
+
var handleClick = function handleClick(value) {
|
|
16
|
+
onClick({
|
|
17
|
+
value: value
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuStyle.ListContainer, null, /*#__PURE__*/_react["default"].createElement("li", {
|
|
21
|
+
"aria-disabled": disabled,
|
|
22
|
+
"data-active": isSelected,
|
|
23
|
+
"data-multiple": allowMultiple,
|
|
24
|
+
value: value,
|
|
25
|
+
onClick: function onClick() {
|
|
26
|
+
return handleClick(value);
|
|
27
|
+
}
|
|
28
|
+
}, children));
|
|
29
|
+
};
|
|
30
|
+
exports.MenuOption = MenuOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.MenuOptionCheckbox = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _Checkbox = require("../../Checkbox");
|
|
8
|
+
var MenuOptionCheckbox = function MenuOptionCheckbox(_ref) {
|
|
9
|
+
var disabled = _ref.disabled,
|
|
10
|
+
isSelected = _ref.isSelected,
|
|
11
|
+
label = _ref.label;
|
|
12
|
+
return /*#__PURE__*/_react["default"].createElement(_Checkbox.Checkbox, {
|
|
13
|
+
label: label,
|
|
14
|
+
checked: isSelected,
|
|
15
|
+
disabled: disabled
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.MenuOptionCheckbox = MenuOptionCheckbox;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.MenuOptionLabel = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _Typography = require("../../Typography");
|
|
8
|
+
var _colors = require("../../utilities/colors");
|
|
9
|
+
var MenuOptionLabel = function MenuOptionLabel(_ref) {
|
|
10
|
+
var label = _ref.label;
|
|
11
|
+
return /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
12
|
+
as: "span",
|
|
13
|
+
variant: "body1",
|
|
14
|
+
color: _colors.Neutral.B18
|
|
15
|
+
}, label);
|
|
16
|
+
};
|
|
17
|
+
exports.MenuOptionLabel = MenuOptionLabel;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.MenuOptionProps = exports.MenuOptionLabel = exports.MenuOptionCheckbox = exports.MenuOption = void 0;
|
|
5
|
+
var _MenuOption = require("./MenuOption");
|
|
6
|
+
exports.MenuOption = _MenuOption.MenuOption;
|
|
7
|
+
exports.MenuOptionProps = _MenuOption.MenuOptionProps;
|
|
8
|
+
var _MenuOptionLabel = require("./MenuOptionLabel");
|
|
9
|
+
exports.MenuOptionLabel = _MenuOptionLabel.MenuOptionLabel;
|
|
10
|
+
var _MenuOptionCheckbox = require("./MenuOptionCheckbox");
|
|
11
|
+
exports.MenuOptionCheckbox = _MenuOptionCheckbox.MenuOptionCheckbox;
|
package/lib/@next/Menu/index.js
CHANGED
|
@@ -6,4 +6,10 @@ Object.keys(_Menu).forEach(function (key) {
|
|
|
6
6
|
if (key === "default" || key === "__esModule") return;
|
|
7
7
|
if (key in exports && exports[key] === _Menu[key]) return;
|
|
8
8
|
exports[key] = _Menu[key];
|
|
9
|
+
});
|
|
10
|
+
var _components = require("./components");
|
|
11
|
+
Object.keys(_components).forEach(function (key) {
|
|
12
|
+
if (key === "default" || key === "__esModule") return;
|
|
13
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
14
|
+
exports[key] = _components[key];
|
|
9
15
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuProps } from '../Menu';
|
|
3
|
+
interface PopoverMenuProps extends MenuProps {
|
|
4
|
+
activatorLabel?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const PopoverMenu: ({ activatorLabel, allowMultiple, ...props }: PopoverMenuProps) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.PopoverMenu = 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 _Button = require("../../Button");
|
|
10
|
+
var _Popover = require("../../Popover");
|
|
11
|
+
var _Menu = require("../Menu");
|
|
12
|
+
var _excluded = ["activatorLabel", "allowMultiple"];
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
var PopoverMenu = function PopoverMenu(_ref) {
|
|
16
|
+
var _ref$activatorLabel = _ref.activatorLabel,
|
|
17
|
+
activatorLabel = _ref$activatorLabel === void 0 ? 'Menu' : _ref$activatorLabel,
|
|
18
|
+
allowMultiple = _ref.allowMultiple,
|
|
19
|
+
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
20
|
+
var _useState = (0, _react.useState)(true),
|
|
21
|
+
popoverActive = _useState[0],
|
|
22
|
+
setPopoverActive = _useState[1];
|
|
23
|
+
var _useState2 = (0, _react.useState)([]),
|
|
24
|
+
selectedOptions = _useState2[0],
|
|
25
|
+
setSelectedOptions = _useState2[1];
|
|
26
|
+
var togglePopoverActive = (0, _react.useCallback)(function () {
|
|
27
|
+
return setPopoverActive(function (popoverActive) {
|
|
28
|
+
return !popoverActive;
|
|
29
|
+
});
|
|
30
|
+
}, []);
|
|
31
|
+
var handleSelect = function handleSelect(_ref2) {
|
|
32
|
+
var value = _ref2.value;
|
|
33
|
+
if (!allowMultiple) {
|
|
34
|
+
setSelectedOptions([value]);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!selectedOptions.includes(value)) {
|
|
38
|
+
setSelectedOptions([].concat(selectedOptions, [value]));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setSelectedOptions(selectedOptions.filter(function (option) {
|
|
42
|
+
return option !== value;
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
var activator = /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
46
|
+
onClick: togglePopoverActive
|
|
47
|
+
}, activatorLabel);
|
|
48
|
+
return /*#__PURE__*/_react["default"].createElement(_Popover.Popover, {
|
|
49
|
+
active: popoverActive,
|
|
50
|
+
activator: activator,
|
|
51
|
+
onClose: function onClose() {
|
|
52
|
+
return setPopoverActive(false);
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/_react["default"].createElement(_Popover.Popover.Pane, null, /*#__PURE__*/_react["default"].createElement(_Menu.Menu, (0, _extends2["default"])({}, props, {
|
|
55
|
+
allowMultiple: allowMultiple,
|
|
56
|
+
onClick: handleSelect,
|
|
57
|
+
selectedValues: selectedOptions
|
|
58
|
+
}))));
|
|
59
|
+
};
|
|
60
|
+
exports.PopoverMenu = PopoverMenu;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Option, Section } from '../Menu';
|
|
3
|
+
interface SearchableProps {
|
|
4
|
+
/** value of TextInput activator when Select is searchable */
|
|
5
|
+
inputValue?: string;
|
|
6
|
+
/** onChange of TextInput activator when Select is searchable */
|
|
7
|
+
onInputChange?(value: string): void;
|
|
8
|
+
}
|
|
9
|
+
export interface SelectProps {
|
|
10
|
+
allowMultiple?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
hasError?: boolean;
|
|
13
|
+
helpText?: React.ReactNode;
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
/** Margin Top = 8 ; Option height = 48 ; optionListHeight = (n options * option height) + margin top; */
|
|
16
|
+
listHeight?: number;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
onRemoveTag?({ option }: {
|
|
19
|
+
option: string;
|
|
20
|
+
}): void;
|
|
21
|
+
onSelect?({ value }: {
|
|
22
|
+
value: string;
|
|
23
|
+
}): void;
|
|
24
|
+
options?: Option[];
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** sets whether to be able to type in to search from the options*/
|
|
27
|
+
searchableProps?: SearchableProps;
|
|
28
|
+
/** true = Allow vertical scroll, default by 6 options. */
|
|
29
|
+
scrollable?: boolean;
|
|
30
|
+
sections?: Section[];
|
|
31
|
+
selectedValues?: string[];
|
|
32
|
+
/** sets a width for the Select component*/
|
|
33
|
+
width: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const Select: ({ allowMultiple, disabled, hasError, helpText, label, onClose, onRemoveTag, onSelect, options, placeholder, listHeight, searchableProps, scrollable, sections, selectedValues, width, }: SelectProps) => JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.Select = void 0;
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
var _Popover = require("../Popover");
|
|
7
|
+
var _Typography = require("../Typography");
|
|
8
|
+
var _colors = require("../utilities/colors");
|
|
9
|
+
var _components = require("./components");
|
|
10
|
+
var _ActivatorContext = require("./components/Activator/ActivatorContext");
|
|
11
|
+
var _ActivatorSelect = require("./components/Activator/ActivatorSelect");
|
|
12
|
+
var _Label = require("./components/Label/Label");
|
|
13
|
+
var _SelectStyle = require("./SelectStyle");
|
|
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 Select = function Select(_ref) {
|
|
17
|
+
var _ref$allowMultiple = _ref.allowMultiple,
|
|
18
|
+
allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
|
|
19
|
+
disabled = _ref.disabled,
|
|
20
|
+
hasError = _ref.hasError,
|
|
21
|
+
helpText = _ref.helpText,
|
|
22
|
+
label = _ref.label,
|
|
23
|
+
onClose = _ref.onClose,
|
|
24
|
+
onRemoveTag = _ref.onRemoveTag,
|
|
25
|
+
onSelect = _ref.onSelect,
|
|
26
|
+
options = _ref.options,
|
|
27
|
+
placeholder = _ref.placeholder,
|
|
28
|
+
listHeight = _ref.listHeight,
|
|
29
|
+
searchableProps = _ref.searchableProps,
|
|
30
|
+
scrollable = _ref.scrollable,
|
|
31
|
+
sections = _ref.sections,
|
|
32
|
+
selectedValues = _ref.selectedValues,
|
|
33
|
+
width = _ref.width;
|
|
34
|
+
var _useState = (0, _react.useState)(false),
|
|
35
|
+
popoverActive = _useState[0],
|
|
36
|
+
setPopoverActive = _useState[1];
|
|
37
|
+
var _useState2 = (0, _react.useState)(''),
|
|
38
|
+
optionListHeight = _useState2[0],
|
|
39
|
+
setOptionListHeight = _useState2[1];
|
|
40
|
+
var handleClose = (0, _react.useCallback)(function () {
|
|
41
|
+
setPopoverActive(false);
|
|
42
|
+
onClose == null ? void 0 : onClose();
|
|
43
|
+
}, [onClose]);
|
|
44
|
+
var handleFocus = function handleFocus() {
|
|
45
|
+
setPopoverActive(true);
|
|
46
|
+
};
|
|
47
|
+
var handleBlur = function handleBlur() {
|
|
48
|
+
if (popoverActive) {
|
|
49
|
+
handleClose();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var handleSelectClick = function handleSelectClick() {
|
|
53
|
+
setPopoverActive(!popoverActive);
|
|
54
|
+
};
|
|
55
|
+
var activatorSelectContextValue = {
|
|
56
|
+
allowMultiple: allowMultiple,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
hasError: hasError,
|
|
59
|
+
onSelectClick: handleSelectClick,
|
|
60
|
+
selectedValues: selectedValues
|
|
61
|
+
};
|
|
62
|
+
var activatorTextInputContextValue = {
|
|
63
|
+
disabled: disabled,
|
|
64
|
+
hasError: hasError,
|
|
65
|
+
onFocus: handleFocus,
|
|
66
|
+
onBlur: handleBlur
|
|
67
|
+
};
|
|
68
|
+
(0, _react.useEffect)(function () {
|
|
69
|
+
if (listHeight) {
|
|
70
|
+
setOptionListHeight(listHeight + 24 + "px");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (scrollable) {
|
|
74
|
+
setOptionListHeight(296 + 24 + "px");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}, [listHeight, scrollable]);
|
|
78
|
+
var activator = function activator() {
|
|
79
|
+
if (searchableProps) {
|
|
80
|
+
var inputValue = searchableProps.inputValue,
|
|
81
|
+
_onInputChange = searchableProps.onInputChange;
|
|
82
|
+
return /*#__PURE__*/_react["default"].createElement(_ActivatorContext.ActivatorTextInputContext.Provider, {
|
|
83
|
+
value: activatorTextInputContextValue
|
|
84
|
+
}, /*#__PURE__*/_react["default"].createElement(_components.ActivatorTextInput, {
|
|
85
|
+
value: inputValue,
|
|
86
|
+
onChange: _onInputChange,
|
|
87
|
+
placeholder: placeholder != null ? placeholder : 'Search',
|
|
88
|
+
width: width
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
return /*#__PURE__*/_react["default"].createElement(_ActivatorContext.ActivatorSelectContext.Provider, {
|
|
92
|
+
value: activatorSelectContextValue
|
|
93
|
+
}, /*#__PURE__*/_react["default"].createElement(_ActivatorSelect.ActivatorSelect, {
|
|
94
|
+
disabled: disabled,
|
|
95
|
+
placeholder: "Placeholder",
|
|
96
|
+
onRemoveTag: onRemoveTag,
|
|
97
|
+
width: width,
|
|
98
|
+
values: selectedValues
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement(_Popover.Popover, {
|
|
102
|
+
active: popoverActive,
|
|
103
|
+
activator: /*#__PURE__*/_react["default"].createElement(_SelectStyle.ActivatorWrapper, {
|
|
104
|
+
width: width
|
|
105
|
+
}, label && /*#__PURE__*/_react["default"].createElement(_Label.Label, null, label), activator(), helpText && /*#__PURE__*/_react["default"].createElement(_SelectStyle.HelpTextContainer, null, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
106
|
+
as: "span",
|
|
107
|
+
variant: "subtitle2",
|
|
108
|
+
color: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
109
|
+
}, helpText))),
|
|
110
|
+
onClose: handleClose,
|
|
111
|
+
autofocusTarget: "none",
|
|
112
|
+
preventFocusOnClose: true,
|
|
113
|
+
fullWidth: true
|
|
114
|
+
}, /*#__PURE__*/_react["default"].createElement(_Popover.Popover.Pane, {
|
|
115
|
+
height: optionListHeight
|
|
116
|
+
}, /*#__PURE__*/_react["default"].createElement(_components.OptionList, {
|
|
117
|
+
allowMultiple: allowMultiple,
|
|
118
|
+
onSelect: onSelect,
|
|
119
|
+
options: options,
|
|
120
|
+
sections: sections,
|
|
121
|
+
selectedValues: selectedValues,
|
|
122
|
+
width: width
|
|
123
|
+
})));
|
|
124
|
+
};
|
|
125
|
+
exports.Select = Select;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const NonSearchableSingleSelect: any;
|
|
5
|
+
export declare const NonSearchableMultipleSelect: any;
|
|
6
|
+
export declare const WithErrorNonSearchable: any;
|
|
7
|
+
export declare const NonSearchableDisabled: any;
|
|
8
|
+
export declare const SearchableMultiSelect: any;
|
|
9
|
+
export declare const MultiSelectScrollable: any;
|
|
10
|
+
export declare const WithInlineError: any;
|
|
11
|
+
export declare const SearchableDisabled: any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface ActivatorWrapperProps {
|
|
2
|
+
width?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const HelpTextContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const ActivatorWrapper: import("styled-components").StyledComponent<"div", any, ActivatorWrapperProps, never>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.HelpTextContainer = exports.ActivatorWrapper = void 0;
|
|
6
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
|
+
var _spacing = require("../utilities/spacing");
|
|
8
|
+
var HelpTextContainer = _styledComponents["default"].div.withConfig({
|
|
9
|
+
displayName: "SelectStyle__HelpTextContainer",
|
|
10
|
+
componentId: "sc-c6sc8m-0"
|
|
11
|
+
})(["margin-top:", ";"], _spacing.space4);
|
|
12
|
+
exports.HelpTextContainer = HelpTextContainer;
|
|
13
|
+
var ActivatorWrapper = _styledComponents["default"].div.withConfig({
|
|
14
|
+
displayName: "SelectStyle__ActivatorWrapper",
|
|
15
|
+
componentId: "sc-c6sc8m-1"
|
|
16
|
+
})(["display:flex;flex-direction:column;width:", ";"], function (props) {
|
|
17
|
+
return props.width;
|
|
18
|
+
});
|
|
19
|
+
exports.ActivatorWrapper = ActivatorWrapper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActivatorSelectProps } from './ActivatorSelect';
|
|
3
|
+
import { ActivatorTextInputProps } from './ActivatorTextInput';
|
|
4
|
+
export interface ActivatorSelectContextProps extends ActivatorSelectProps {
|
|
5
|
+
allowMultiple?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
hasError?: boolean;
|
|
8
|
+
onSelectClick(): void;
|
|
9
|
+
selectedValues?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ActivatorTextInputContextProps extends ActivatorTextInputProps {
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const ActivatorSelectContext: import("react").Context<ActivatorSelectContextProps>;
|
|
15
|
+
export declare const ActivatorTextInputContext: import("react").Context<ActivatorTextInputContextProps>;
|
|
16
|
+
export declare const useActivatorSelect: () => ActivatorSelectContextProps;
|
|
17
|
+
export declare const useActivatorTextInput: () => ActivatorTextInputContextProps;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useActivatorTextInput = exports.useActivatorSelect = exports.ActivatorTextInputContext = exports.ActivatorSelectContext = void 0;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
var ActivatorSelectContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
7
|
+
exports.ActivatorSelectContext = ActivatorSelectContext;
|
|
8
|
+
var ActivatorTextInputContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
9
|
+
exports.ActivatorTextInputContext = ActivatorTextInputContext;
|
|
10
|
+
var useActivatorSelect = function useActivatorSelect() {
|
|
11
|
+
var context = (0, _react.useContext)(ActivatorSelectContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
throw new Error('No ActivatorSelectContext was provided. Your component must be wrapped in a <ActivatorSelectContext.Provider>');
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
};
|
|
17
|
+
exports.useActivatorSelect = useActivatorSelect;
|
|
18
|
+
var useActivatorTextInput = function useActivatorTextInput() {
|
|
19
|
+
var context = (0, _react.useContext)(ActivatorTextInputContext);
|
|
20
|
+
if (!context) {
|
|
21
|
+
throw new Error('No ActivatorTextInputContext was provided. Your component must be wrapped in a <ActivatorTextInputContext.Provider>');
|
|
22
|
+
}
|
|
23
|
+
return context;
|
|
24
|
+
};
|
|
25
|
+
exports.useActivatorTextInput = useActivatorTextInput;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ActivatorSelectProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
values?: string[];
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
onRemoveTag?({ option }: {
|
|
6
|
+
option: string;
|
|
7
|
+
}): void;
|
|
8
|
+
width?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ActivatorSelect: ({ placeholder, values, onClick, onRemoveTag, width, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.ActivatorSelect = 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 _Icon = require("../../../Icon");
|
|
10
|
+
var _Typography = require("../../../Typography");
|
|
11
|
+
var _colors = require("../../../utilities/colors");
|
|
12
|
+
var _ActivatorContext = require("./ActivatorContext");
|
|
13
|
+
var _ActivatorStyle = require("./ActivatorStyle");
|
|
14
|
+
var _excluded = ["placeholder", "values", "onClick", "onRemoveTag", "width"];
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
18
|
+
var placeholder = _ref.placeholder,
|
|
19
|
+
values = _ref.values,
|
|
20
|
+
onClick = _ref.onClick,
|
|
21
|
+
onRemoveTag = _ref.onRemoveTag,
|
|
22
|
+
width = _ref.width,
|
|
23
|
+
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
24
|
+
var activatorRef = (0, _react.useRef)(null);
|
|
25
|
+
var filteredValues = values == null ? void 0 : values.filter(function (value) {
|
|
26
|
+
return value != '';
|
|
27
|
+
});
|
|
28
|
+
var hasValue = filteredValues.length > 0;
|
|
29
|
+
var activatorContext = (0, _ActivatorContext.useActivatorSelect)();
|
|
30
|
+
var allowMultiple = activatorContext.allowMultiple,
|
|
31
|
+
disabled = activatorContext.disabled,
|
|
32
|
+
onSelectClick = activatorContext.onSelectClick,
|
|
33
|
+
hasError = activatorContext.hasError,
|
|
34
|
+
selectedValues = activatorContext.selectedValues;
|
|
35
|
+
var handleClick = function handleClick(e) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
onSelectClick();
|
|
39
|
+
onClick;
|
|
40
|
+
};
|
|
41
|
+
var placeholderMarkup = /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
42
|
+
variant: "body1",
|
|
43
|
+
as: "span",
|
|
44
|
+
color: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
45
|
+
}, placeholder);
|
|
46
|
+
var tagsMarkup = function tagsMarkup() {
|
|
47
|
+
var hasSelectedValues = selectedValues.length > 0;
|
|
48
|
+
if (!hasSelectedValues) {
|
|
49
|
+
return placeholderMarkup;
|
|
50
|
+
}
|
|
51
|
+
if (hasSelectedValues) {
|
|
52
|
+
return /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.TagsContainer, null, /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledTag, {
|
|
53
|
+
key: "option-" + selectedValues[0],
|
|
54
|
+
onRemove: onRemoveTag({
|
|
55
|
+
option: selectedValues[0]
|
|
56
|
+
}),
|
|
57
|
+
textColor: _colors.Blue.S99
|
|
58
|
+
}, selectedValues[0]), selectedValues.length > 1 && /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
59
|
+
variant: "caption",
|
|
60
|
+
color: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
61
|
+
}, "... and ", selectedValues.length - 1, " more"));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledSelect, (0, _extends2["default"])({}, props, {
|
|
65
|
+
ref: activatorRef,
|
|
66
|
+
"data-error": hasError,
|
|
67
|
+
onClick: handleClick,
|
|
68
|
+
disabled: disabled,
|
|
69
|
+
width: width
|
|
70
|
+
}), allowMultiple ? tagsMarkup() : /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
71
|
+
variant: "body1",
|
|
72
|
+
color: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
73
|
+
}, hasValue ? filteredValues[0] : placeholderMarkup), /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
74
|
+
height: 24,
|
|
75
|
+
name: "ri-arrow-m-down-line",
|
|
76
|
+
fill: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
exports.ActivatorSelect = ActivatorSelect;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActivatorSelectProps } from './ActivatorSelect';
|
|
3
|
+
export declare const StyledSelect: import("styled-components").StyledComponent<"button", any, ActivatorSelectProps, never>;
|
|
4
|
+
export declare const TagsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const StyledTag: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../Tag").TagProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
6
|
+
export declare const StyledTextInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../../../Input/Input").InputProps, "type" | "onChange"> & {
|
|
7
|
+
canClear?: boolean;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
} & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.TagsContainer = exports.StyledTextInput = exports.StyledTag = exports.StyledSelect = void 0;
|
|
6
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
|
+
var Breakpoints = _interopRequireWildcard(require("../../../utilities/breakpoints/Breakpoints"));
|
|
8
|
+
var _borderRadius = require("../../../utilities/borderRadius");
|
|
9
|
+
var _colors = require("../../../utilities/colors");
|
|
10
|
+
var _fonts = require("../../../utilities/fonts");
|
|
11
|
+
var _spacing = require("../../../utilities/spacing");
|
|
12
|
+
var _TextInput = require("../../../TextInput");
|
|
13
|
+
var _Tag = require("../../../Tag");
|
|
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 StyledSelect = _styledComponents["default"].button.withConfig({
|
|
17
|
+
displayName: "ActivatorStyle__StyledSelect",
|
|
18
|
+
componentId: "sc-rui73p-0"
|
|
19
|
+
})(["display:flex;align-items:center;justify-content:space-between;height:36px;cursor:pointer;padding:0px 8px 0px 12px;border:1px solid ", ";box-shadow:0px 1px 0px rgba(0,0,0,0.05);border-radius:", ";background:", ";width:", ";color:", ";font-family:", ",sans-serif;font-weight:400;font-size:16px;line-height:150%;letter-spacing:0px;@media (max-width:", "){font-size:14px;}&:focus{outline:none;box-shadow:0px 0px 0px 1px #ffffff,0px 0px 0px 3px #6cc9ec;}&:disabled{background:", ";pointer-events:none;cursor:default;border:1px solid ", ";}&[data-error='true']{border:1px solid ", ";border-radius:", ";}"], _colors.Neutral.B68, _borderRadius.borderRadius4, _colors.Neutral.B100, function (props) {
|
|
20
|
+
return props.width;
|
|
21
|
+
}, _colors.Neutral.B18, _fonts.NotoSans, Breakpoints.large, _colors.Neutral.B95, _colors.Neutral.B85, _colors.Red.B93, _borderRadius.borderRadius4);
|
|
22
|
+
exports.StyledSelect = StyledSelect;
|
|
23
|
+
var TagsContainer = _styledComponents["default"].div.withConfig({
|
|
24
|
+
displayName: "ActivatorStyle__TagsContainer",
|
|
25
|
+
componentId: "sc-rui73p-1"
|
|
26
|
+
})(["display:flex;justify-content:space-between;flex-direction:row;align-items:center;"]);
|
|
27
|
+
exports.TagsContainer = TagsContainer;
|
|
28
|
+
var StyledTag = (0, _styledComponents["default"])(_Tag.Tag).withConfig({
|
|
29
|
+
displayName: "ActivatorStyle__StyledTag",
|
|
30
|
+
componentId: "sc-rui73p-2"
|
|
31
|
+
})(["height:28px;margin-right:", ";"], _spacing.space8);
|
|
32
|
+
exports.StyledTag = StyledTag;
|
|
33
|
+
var StyledTextInput = (0, _styledComponents["default"])(_TextInput.TextInput).withConfig({
|
|
34
|
+
displayName: "ActivatorStyle__StyledTextInput",
|
|
35
|
+
componentId: "sc-rui73p-3"
|
|
36
|
+
})(["width:", ";"], function (props) {
|
|
37
|
+
return props.width;
|
|
38
|
+
});
|
|
39
|
+
exports.StyledTextInput = StyledTextInput;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextInputProps } from '../../../TextInput';
|
|
3
|
+
export interface ActivatorTextInputProps extends Omit<TextInputProps, 'onChange'> {
|
|
4
|
+
hasError?: boolean;
|
|
5
|
+
onChange?(value: string): void;
|
|
6
|
+
width?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ActivatorTextInput: ({ onChange, value, width, ...props }: ActivatorTextInputProps) => JSX.Element;
|