glints-aries 4.0.304 → 4.0.305

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.
Files changed (27) hide show
  1. package/es/@next/DataTable/DataTable.d.ts +1 -1
  2. package/es/@next/DataTable/DataTable.js +2 -2
  3. package/es/@next/Select/Select.d.ts +3 -1
  4. package/es/@next/Select/Select.js +4 -1
  5. package/es/@next/Select/Select.stories.d.ts +1 -0
  6. package/es/@next/Select/components/Activator/ActivatorSelect.d.ts +5 -2
  7. package/es/@next/Select/components/Activator/ActivatorSelect.js +8 -7
  8. package/es/@next/Select/components/Activator/ActivatorStyle.d.ts +3 -0
  9. package/es/@next/Select/components/Activator/ActivatorStyle.js +14 -1
  10. package/es/@next/Select/selectStoryHelper/NonSearchableSingleSelect.js +3 -9
  11. package/es/@next/Select/selectStoryHelper/SelectStoryStyle.d.ts +0 -1
  12. package/es/@next/Select/selectStoryHelper/SelectStoryStyle.js +1 -5
  13. package/es/@next/SideSheet/SideSheet.js +1 -1
  14. package/lib/@next/DataTable/DataTable.d.ts +1 -1
  15. package/lib/@next/DataTable/DataTable.js +2 -2
  16. package/lib/@next/Select/Select.d.ts +3 -1
  17. package/lib/@next/Select/Select.js +4 -1
  18. package/lib/@next/Select/Select.stories.d.ts +1 -0
  19. package/lib/@next/Select/components/Activator/ActivatorSelect.d.ts +5 -2
  20. package/lib/@next/Select/components/Activator/ActivatorSelect.js +7 -6
  21. package/lib/@next/Select/components/Activator/ActivatorStyle.d.ts +3 -0
  22. package/lib/@next/Select/components/Activator/ActivatorStyle.js +19 -3
  23. package/lib/@next/Select/selectStoryHelper/NonSearchableSingleSelect.js +3 -9
  24. package/lib/@next/Select/selectStoryHelper/SelectStoryStyle.d.ts +0 -1
  25. package/lib/@next/Select/selectStoryHelper/SelectStoryStyle.js +2 -7
  26. package/lib/@next/SideSheet/SideSheet.js +1 -1
  27. package/package.json +1 -1
@@ -11,7 +11,7 @@ export interface DataTableProps extends React.TableHTMLAttributes<HTMLTableEleme
11
11
  /** If the title in TableHeading is of type ReactNode and you require sorting functionality, please make sure to provide 'id' for the TableHeading */
12
12
  headings: TableHeading[];
13
13
  children: React.ReactNode;
14
- emptyState: React.ReactElement<EmptyStateProps>;
14
+ emptyState?: React.ReactElement<EmptyStateProps>;
15
15
  totals?: Total[];
16
16
  loading?: boolean;
17
17
  loadingLabel?: string;
@@ -68,9 +68,9 @@ var DataTableComponent = /*#__PURE__*/React.forwardRef(function DataTable(_ref,
68
68
  }
69
69
  rows.push(reactEl);
70
70
  }
71
- var emptyRow = /*#__PURE__*/React.createElement(StyledTableRow, null, /*#__PURE__*/React.createElement(StyledTableCell, {
71
+ var emptyRow = emptyState ? /*#__PURE__*/React.createElement(StyledTableRow, null, /*#__PURE__*/React.createElement(StyledTableCell, {
72
72
  colSpan: headings.length
73
- }, emptyState));
73
+ }, emptyState)) : null;
74
74
  var hasRows = rows.length > 0;
75
75
  var rowsMarkup = hasRows ? rows : emptyRow;
76
76
  var showFooter = !!footer;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Option, Section } from '../Menu';
3
+ import { IconNames } from '../Icon/icons/icons';
3
4
  interface SearchableProps {
4
5
  /** value of TextInput activator when Select is searchable */
5
6
  inputValue?: string;
@@ -8,6 +9,7 @@ interface SearchableProps {
8
9
  }
9
10
  export interface SelectProps {
10
11
  allowMultiple?: boolean;
12
+ customActivatorIcon?: IconNames;
11
13
  disabled?: boolean;
12
14
  hasError?: boolean;
13
15
  helpText?: React.ReactNode;
@@ -41,5 +43,5 @@ export interface SelectProps {
41
43
  /** sets z-index override for option list dropdown. z-index default to 400 */
42
44
  zIndexOverride?: number;
43
45
  }
44
- export declare const Select: ({ allowMultiple, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
46
+ export declare const Select: ({ allowMultiple, customActivatorIcon, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
45
47
  export {};
@@ -9,6 +9,7 @@ import { ActivatorWrapper, HelpTextContainer } from './SelectStyle';
9
9
  export var Select = function Select(_ref) {
10
10
  var _ref$allowMultiple = _ref.allowMultiple,
11
11
  allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
12
+ customActivatorIcon = _ref.customActivatorIcon,
12
13
  _ref$disabled = _ref.disabled,
13
14
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
14
15
  _ref$hasError = _ref.hasError,
@@ -127,6 +128,7 @@ export var Select = function Select(_ref) {
127
128
  }
128
129
  return /*#__PURE__*/React.createElement(ActivatorSelect, {
129
130
  allowMultiple: allowMultiple,
131
+ customActivatorIcon: customActivatorIcon,
130
132
  disabled: disabled,
131
133
  hasError: hasError,
132
134
  placeholder: placeholder != null ? placeholder : 'Placeholder',
@@ -135,7 +137,8 @@ export var Select = function Select(_ref) {
135
137
  width: width,
136
138
  selectedValues: selectedValues,
137
139
  options: options,
138
- name: name
140
+ name: name,
141
+ prefix: prefix
139
142
  });
140
143
  };
141
144
  return /*#__PURE__*/React.createElement(Popover, {
@@ -5,6 +5,7 @@ export declare const NonSearchableSingleSelect: any;
5
5
  export declare const NonSearchableMultipleSelect: any;
6
6
  export declare const WithErrorNonSearchable: any;
7
7
  export declare const NonSearchableDisabled: any;
8
+ export declare const NonSearchablePrefixed: any;
8
9
  export declare const SearchableMultiSelect: any;
9
10
  export declare const SearchableSingleSelect: any;
10
11
  export declare const SearchableSingleSelectWithOverflowingInputState: any;
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Option } from '../../../Menu';
3
- export interface ActivatorSelectProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ import { IconNames } from '../../../Icon/icons/icons';
4
+ export interface ActivatorSelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'> {
4
5
  allowMultiple?: boolean;
6
+ customActivatorIcon?: IconNames;
5
7
  hasError?: boolean;
6
8
  selectedValues?: string[];
7
9
  placeholder?: string;
10
+ prefix?: React.ReactNode;
8
11
  onRemoveTag?({ option }: {
9
12
  option: string;
10
13
  }): void;
@@ -12,4 +15,4 @@ export interface ActivatorSelectProps extends React.ButtonHTMLAttributes<HTMLBut
12
15
  options?: Option[];
13
16
  width?: string;
14
17
  }
15
- export declare const ActivatorSelect: ({ placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, ...props }: ActivatorSelectProps) => JSX.Element;
18
+ export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, ...props }: ActivatorSelectProps) => JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options"];
3
+ var _excluded = ["customActivatorIcon", "placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options", "prefix"];
4
4
  import React, { useEffect, useRef, useState } from 'react';
5
- import { Icon } from '../../../Icon';
6
5
  import { Typography } from '../../../Typography';
7
6
  import { Blue, Neutral } from '../../../utilities/colors';
8
- import { StyledSelect, StyledSelectTypography, StyledTag, TagsContainer } from './ActivatorStyle';
7
+ import { StyledIcon, StyledPrefixContainer, StyledSelect, StyledSelectTypography, StyledTag, TagsContainer, WithPrefixContainer } from './ActivatorStyle';
9
8
  export var ActivatorSelect = function ActivatorSelect(_ref) {
10
- var placeholder = _ref.placeholder,
9
+ var customActivatorIcon = _ref.customActivatorIcon,
10
+ placeholder = _ref.placeholder,
11
11
  selectedValues = _ref.selectedValues,
12
12
  onClick = _ref.onClick,
13
13
  onRemoveTag = _ref.onRemoveTag,
@@ -20,6 +20,7 @@ export var ActivatorSelect = function ActivatorSelect(_ref) {
20
20
  _ref$hasError = _ref.hasError,
21
21
  hasError = _ref$hasError === void 0 ? false : _ref$hasError,
22
22
  options = _ref.options,
23
+ prefix = _ref.prefix,
23
24
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
24
25
  var _useState = useState([]),
25
26
  filteredValues = _useState[0],
@@ -76,13 +77,13 @@ export var ActivatorSelect = function ActivatorSelect(_ref) {
76
77
  onClick: handleClick,
77
78
  disabled: disabled,
78
79
  width: width
79
- }), allowMultiple ? tagsMarkup() : /*#__PURE__*/React.createElement(StyledSelectTypography, {
80
+ }), /*#__PURE__*/React.createElement(WithPrefixContainer, null, prefix && /*#__PURE__*/React.createElement(StyledPrefixContainer, null, prefix), allowMultiple ? tagsMarkup() : /*#__PURE__*/React.createElement(StyledSelectTypography, {
80
81
  variant: "body1",
81
82
  "data-disabled": disabled,
82
83
  color: hasSelectedValues ? Neutral.B18 : Neutral.B40
83
- }, hasSelectedValues ? selectedLabels[0] : placeholderMarkup), /*#__PURE__*/React.createElement(Icon, {
84
+ }, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/React.createElement(StyledIcon, {
84
85
  height: 24,
85
- name: "ri-arrow-m-down-line",
86
+ name: customActivatorIcon || 'ri-arrow-m-down-line',
86
87
  fill: disabled ? Neutral.B85 : Neutral.B40
87
88
  }));
88
89
  };
@@ -8,3 +8,6 @@ export declare const StyledTextInput: import("styled-components").StyledComponen
8
8
  onChange?: (value: string) => void;
9
9
  } & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
10
10
  export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
11
+ export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
13
+ export declare const StyledIcon: import("styled-components").StyledComponent<({ name, ...props }: import("../../../Icon").IconProps) => JSX.Element, any, {}, never>;
@@ -7,6 +7,7 @@ import { space8 } from '../../../utilities/spacing';
7
7
  import { TextInput } from '../../../TextInput';
8
8
  import { Tag } from '../../../Tag';
9
9
  import { Typography } from '../../../Typography';
10
+ import { Icon } from '../../../Icon';
10
11
  export var StyledSelect = styled.button.withConfig({
11
12
  displayName: "ActivatorStyle__StyledSelect",
12
13
  componentId: "sc-rui73p-0"
@@ -30,4 +31,16 @@ export var StyledTextInput = styled(TextInput).withConfig({
30
31
  export var StyledSelectTypography = styled(Typography).withConfig({
31
32
  displayName: "ActivatorStyle__StyledSelectTypography",
32
33
  componentId: "sc-rui73p-4"
33
- })(["&[data-disabled='true']{color:", ";}"], Neutral.B85);
34
+ })(["display:flex;margin-left:auto;&[data-disabled='true']{color:", ";}"], Neutral.B85);
35
+ export var WithPrefixContainer = styled.div.withConfig({
36
+ displayName: "ActivatorStyle__WithPrefixContainer",
37
+ componentId: "sc-rui73p-5"
38
+ })(["display:flex;align-items:center;"]);
39
+ export var StyledPrefixContainer = styled.div.withConfig({
40
+ displayName: "ActivatorStyle__StyledPrefixContainer",
41
+ componentId: "sc-rui73p-6"
42
+ })(["display:flex;width:20px;margin-right:8px;"]);
43
+ export var StyledIcon = styled(Icon).withConfig({
44
+ displayName: "ActivatorStyle__StyledIcon",
45
+ componentId: "sc-rui73p-7"
46
+ })(["margin-left:auto;"]);
@@ -3,7 +3,6 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
3
3
  var _excluded = ["options", "allowMultiple", "disabled"];
4
4
  import React, { useState } from 'react';
5
5
  import { Select } from '../Select';
6
- import { SelectWrapper } from './SelectStoryStyle';
7
6
  export var SingleSelect = function SingleSelect(_ref) {
8
7
  var options = _ref.options,
9
8
  allowMultiple = _ref.allowMultiple,
@@ -16,18 +15,13 @@ export var SingleSelect = function SingleSelect(_ref) {
16
15
  var value = _ref2.value;
17
16
  setSelected(value);
18
17
  };
19
- return /*#__PURE__*/React.createElement(SelectWrapper, {
20
- style: {
21
- display: 'flex',
22
- width: '400px'
23
- }
24
- }, /*#__PURE__*/React.createElement(Select, _extends({}, args, {
18
+ return /*#__PURE__*/React.createElement(Select, _extends({}, args, {
25
19
  allowMultiple: allowMultiple,
26
20
  disabled: disabled,
27
21
  options: options,
28
22
  onSelect: handleSelect,
29
23
  selectedValues: [selected],
30
- width: "100%",
24
+ width: "400px",
31
25
  label: "Label"
32
- })));
26
+ }));
33
27
  };
@@ -1,3 +1,2 @@
1
1
  /// <reference types="react" />
2
2
  export declare const StyledTag: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../Tag").TagProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
3
- export declare const SelectWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -4,8 +4,4 @@ import { space8 } from '../../utilities/spacing';
4
4
  export var StyledTag = styled(Tag).withConfig({
5
5
  displayName: "SelectStoryStyle__StyledTag",
6
6
  componentId: "sc-1xv9wvg-0"
7
- })(["margin-right:", ";"], space8);
8
- export var SelectWrapper = styled.div.withConfig({
9
- displayName: "SelectStoryStyle__SelectWrapper",
10
- componentId: "sc-1xv9wvg-1"
11
- })(["div{width:100%;}"]);
7
+ })(["margin-right:", ";"], space8);
@@ -88,7 +88,7 @@ var SideSheet = /*#__PURE__*/React.forwardRef(function SideSheet(_ref, ref) {
88
88
  onClick: handleClose
89
89
  }, /*#__PURE__*/React.createElement(Icon, {
90
90
  name: "ri-close"
91
- })))), showHorizontalLine && /*#__PURE__*/React.createElement(StyledHorizontalLine, null), children, /*#__PURE__*/React.createElement(StyledSideSheetFooter, null, /*#__PURE__*/React.createElement(StyledHorizontalLine, null), /*#__PURE__*/React.createElement(StyledButtonGroupContainer, null, /*#__PURE__*/React.createElement(ButtonGroup, {
91
+ })))), showHorizontalLine && /*#__PURE__*/React.createElement(StyledHorizontalLine, null), children, (basicButtonAction || primaryButtonAction) && /*#__PURE__*/React.createElement(StyledSideSheetFooter, null, /*#__PURE__*/React.createElement(StyledHorizontalLine, null), /*#__PURE__*/React.createElement(StyledButtonGroupContainer, null, /*#__PURE__*/React.createElement(ButtonGroup, {
92
92
  fullWidth: true
93
93
  }, basicButtonAction && /*#__PURE__*/React.createElement(Button, {
94
94
  onClick: basicButtonAction.action,
@@ -11,7 +11,7 @@ export interface DataTableProps extends React.TableHTMLAttributes<HTMLTableEleme
11
11
  /** If the title in TableHeading is of type ReactNode and you require sorting functionality, please make sure to provide 'id' for the TableHeading */
12
12
  headings: TableHeading[];
13
13
  children: React.ReactNode;
14
- emptyState: React.ReactElement<EmptyStateProps>;
14
+ emptyState?: React.ReactElement<EmptyStateProps>;
15
15
  totals?: Total[];
16
16
  loading?: boolean;
17
17
  loadingLabel?: string;
@@ -73,9 +73,9 @@ var DataTableComponent = /*#__PURE__*/_react["default"].forwardRef(function Data
73
73
  }
74
74
  rows.push(reactEl);
75
75
  }
76
- var emptyRow = /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableRow, null, /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableCell, {
76
+ var emptyRow = emptyState ? /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableRow, null, /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableCell, {
77
77
  colSpan: headings.length
78
- }, emptyState));
78
+ }, emptyState)) : null;
79
79
  var hasRows = rows.length > 0;
80
80
  var rowsMarkup = hasRows ? rows : emptyRow;
81
81
  var showFooter = !!footer;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Option, Section } from '../Menu';
3
+ import { IconNames } from '../Icon/icons/icons';
3
4
  interface SearchableProps {
4
5
  /** value of TextInput activator when Select is searchable */
5
6
  inputValue?: string;
@@ -8,6 +9,7 @@ interface SearchableProps {
8
9
  }
9
10
  export interface SelectProps {
10
11
  allowMultiple?: boolean;
12
+ customActivatorIcon?: IconNames;
11
13
  disabled?: boolean;
12
14
  hasError?: boolean;
13
15
  helpText?: React.ReactNode;
@@ -41,5 +43,5 @@ export interface SelectProps {
41
43
  /** sets z-index override for option list dropdown. z-index default to 400 */
42
44
  zIndexOverride?: number;
43
45
  }
44
- export declare const Select: ({ allowMultiple, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
46
+ export declare const Select: ({ allowMultiple, customActivatorIcon, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
45
47
  export {};
@@ -15,6 +15,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
15
15
  var Select = function Select(_ref) {
16
16
  var _ref$allowMultiple = _ref.allowMultiple,
17
17
  allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
18
+ customActivatorIcon = _ref.customActivatorIcon,
18
19
  _ref$disabled = _ref.disabled,
19
20
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
20
21
  _ref$hasError = _ref.hasError,
@@ -133,6 +134,7 @@ var Select = function Select(_ref) {
133
134
  }
134
135
  return /*#__PURE__*/_react["default"].createElement(_ActivatorSelect.ActivatorSelect, {
135
136
  allowMultiple: allowMultiple,
137
+ customActivatorIcon: customActivatorIcon,
136
138
  disabled: disabled,
137
139
  hasError: hasError,
138
140
  placeholder: placeholder != null ? placeholder : 'Placeholder',
@@ -141,7 +143,8 @@ var Select = function Select(_ref) {
141
143
  width: width,
142
144
  selectedValues: selectedValues,
143
145
  options: options,
144
- name: name
146
+ name: name,
147
+ prefix: prefix
145
148
  });
146
149
  };
147
150
  return /*#__PURE__*/_react["default"].createElement(_Popover.Popover, {
@@ -5,6 +5,7 @@ export declare const NonSearchableSingleSelect: any;
5
5
  export declare const NonSearchableMultipleSelect: any;
6
6
  export declare const WithErrorNonSearchable: any;
7
7
  export declare const NonSearchableDisabled: any;
8
+ export declare const NonSearchablePrefixed: any;
8
9
  export declare const SearchableMultiSelect: any;
9
10
  export declare const SearchableSingleSelect: any;
10
11
  export declare const SearchableSingleSelectWithOverflowingInputState: any;
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Option } from '../../../Menu';
3
- export interface ActivatorSelectProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ import { IconNames } from '../../../Icon/icons/icons';
4
+ export interface ActivatorSelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'> {
4
5
  allowMultiple?: boolean;
6
+ customActivatorIcon?: IconNames;
5
7
  hasError?: boolean;
6
8
  selectedValues?: string[];
7
9
  placeholder?: string;
10
+ prefix?: React.ReactNode;
8
11
  onRemoveTag?({ option }: {
9
12
  option: string;
10
13
  }): void;
@@ -12,4 +15,4 @@ export interface ActivatorSelectProps extends React.ButtonHTMLAttributes<HTMLBut
12
15
  options?: Option[];
13
16
  width?: string;
14
17
  }
15
- export declare const ActivatorSelect: ({ placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, ...props }: ActivatorSelectProps) => JSX.Element;
18
+ export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, ...props }: ActivatorSelectProps) => JSX.Element;
@@ -6,15 +6,15 @@ exports.ActivatorSelect = void 0;
6
6
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
7
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
8
8
  var _react = _interopRequireWildcard(require("react"));
9
- var _Icon = require("../../../Icon");
10
9
  var _Typography = require("../../../Typography");
11
10
  var _colors = require("../../../utilities/colors");
12
11
  var _ActivatorStyle = require("./ActivatorStyle");
13
- var _excluded = ["placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options"];
12
+ var _excluded = ["customActivatorIcon", "placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options", "prefix"];
14
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); }
15
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; }
16
15
  var ActivatorSelect = function ActivatorSelect(_ref) {
17
- var placeholder = _ref.placeholder,
16
+ var customActivatorIcon = _ref.customActivatorIcon,
17
+ placeholder = _ref.placeholder,
18
18
  selectedValues = _ref.selectedValues,
19
19
  onClick = _ref.onClick,
20
20
  onRemoveTag = _ref.onRemoveTag,
@@ -27,6 +27,7 @@ var ActivatorSelect = function ActivatorSelect(_ref) {
27
27
  _ref$hasError = _ref.hasError,
28
28
  hasError = _ref$hasError === void 0 ? false : _ref$hasError,
29
29
  options = _ref.options,
30
+ prefix = _ref.prefix,
30
31
  props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
31
32
  var _useState = (0, _react.useState)([]),
32
33
  filteredValues = _useState[0],
@@ -83,13 +84,13 @@ var ActivatorSelect = function ActivatorSelect(_ref) {
83
84
  onClick: handleClick,
84
85
  disabled: disabled,
85
86
  width: width
86
- }), allowMultiple ? tagsMarkup() : /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledSelectTypography, {
87
+ }), /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.WithPrefixContainer, null, prefix && /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledPrefixContainer, null, prefix), allowMultiple ? tagsMarkup() : /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledSelectTypography, {
87
88
  variant: "body1",
88
89
  "data-disabled": disabled,
89
90
  color: hasSelectedValues ? _colors.Neutral.B18 : _colors.Neutral.B40
90
- }, hasSelectedValues ? selectedLabels[0] : placeholderMarkup), /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
91
+ }, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledIcon, {
91
92
  height: 24,
92
- name: "ri-arrow-m-down-line",
93
+ name: customActivatorIcon || 'ri-arrow-m-down-line',
93
94
  fill: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
94
95
  }));
95
96
  };
@@ -8,3 +8,6 @@ export declare const StyledTextInput: import("styled-components").StyledComponen
8
8
  onChange?: (value: string) => void;
9
9
  } & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
10
10
  export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
11
+ export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
13
+ export declare const StyledIcon: import("styled-components").StyledComponent<({ name, ...props }: import("../../../Icon").IconProps) => JSX.Element, any, {}, never>;
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
- exports.TagsContainer = exports.StyledTextInput = exports.StyledTag = exports.StyledSelectTypography = exports.StyledSelect = void 0;
5
+ exports.WithPrefixContainer = exports.TagsContainer = exports.StyledTextInput = exports.StyledTag = exports.StyledSelectTypography = exports.StyledSelect = exports.StyledPrefixContainer = exports.StyledIcon = void 0;
6
6
  var _styledComponents = _interopRequireDefault(require("styled-components"));
7
7
  var Breakpoints = _interopRequireWildcard(require("../../../utilities/breakpoints/Breakpoints"));
8
8
  var _borderRadius = require("../../../utilities/borderRadius");
@@ -12,6 +12,7 @@ var _spacing = require("../../../utilities/spacing");
12
12
  var _TextInput = require("../../../TextInput");
13
13
  var _Tag = require("../../../Tag");
14
14
  var _Typography = require("../../../Typography");
15
+ var _Icon = require("../../../Icon");
15
16
  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
17
  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
18
  var StyledSelect = _styledComponents["default"].button.withConfig({
@@ -41,5 +42,20 @@ exports.StyledTextInput = StyledTextInput;
41
42
  var StyledSelectTypography = (0, _styledComponents["default"])(_Typography.Typography).withConfig({
42
43
  displayName: "ActivatorStyle__StyledSelectTypography",
43
44
  componentId: "sc-rui73p-4"
44
- })(["&[data-disabled='true']{color:", ";}"], _colors.Neutral.B85);
45
- exports.StyledSelectTypography = StyledSelectTypography;
45
+ })(["display:flex;margin-left:auto;&[data-disabled='true']{color:", ";}"], _colors.Neutral.B85);
46
+ exports.StyledSelectTypography = StyledSelectTypography;
47
+ var WithPrefixContainer = _styledComponents["default"].div.withConfig({
48
+ displayName: "ActivatorStyle__WithPrefixContainer",
49
+ componentId: "sc-rui73p-5"
50
+ })(["display:flex;align-items:center;"]);
51
+ exports.WithPrefixContainer = WithPrefixContainer;
52
+ var StyledPrefixContainer = _styledComponents["default"].div.withConfig({
53
+ displayName: "ActivatorStyle__StyledPrefixContainer",
54
+ componentId: "sc-rui73p-6"
55
+ })(["display:flex;width:20px;margin-right:8px;"]);
56
+ exports.StyledPrefixContainer = StyledPrefixContainer;
57
+ var StyledIcon = (0, _styledComponents["default"])(_Icon.Icon).withConfig({
58
+ displayName: "ActivatorStyle__StyledIcon",
59
+ componentId: "sc-rui73p-7"
60
+ })(["margin-left:auto;"]);
61
+ exports.StyledIcon = StyledIcon;
@@ -7,7 +7,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
7
7
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _Select = require("../Select");
10
- var _SelectStoryStyle = require("./SelectStoryStyle");
11
10
  var _excluded = ["options", "allowMultiple", "disabled"];
12
11
  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); }
13
12
  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; }
@@ -23,19 +22,14 @@ var SingleSelect = function SingleSelect(_ref) {
23
22
  var value = _ref2.value;
24
23
  setSelected(value);
25
24
  };
26
- return /*#__PURE__*/_react["default"].createElement(_SelectStoryStyle.SelectWrapper, {
27
- style: {
28
- display: 'flex',
29
- width: '400px'
30
- }
31
- }, /*#__PURE__*/_react["default"].createElement(_Select.Select, (0, _extends2["default"])({}, args, {
25
+ return /*#__PURE__*/_react["default"].createElement(_Select.Select, (0, _extends2["default"])({}, args, {
32
26
  allowMultiple: allowMultiple,
33
27
  disabled: disabled,
34
28
  options: options,
35
29
  onSelect: handleSelect,
36
30
  selectedValues: [selected],
37
- width: "100%",
31
+ width: "400px",
38
32
  label: "Label"
39
- })));
33
+ }));
40
34
  };
41
35
  exports.SingleSelect = SingleSelect;
@@ -1,3 +1,2 @@
1
1
  /// <reference types="react" />
2
2
  export declare const StyledTag: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../Tag").TagProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
3
- export declare const SelectWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
- exports.StyledTag = exports.SelectWrapper = void 0;
5
+ exports.StyledTag = void 0;
6
6
  var _styledComponents = _interopRequireDefault(require("styled-components"));
7
7
  var _Tag = require("../../Tag");
8
8
  var _spacing = require("../../utilities/spacing");
@@ -10,9 +10,4 @@ var StyledTag = (0, _styledComponents["default"])(_Tag.Tag).withConfig({
10
10
  displayName: "SelectStoryStyle__StyledTag",
11
11
  componentId: "sc-1xv9wvg-0"
12
12
  })(["margin-right:", ";"], _spacing.space8);
13
- exports.StyledTag = StyledTag;
14
- var SelectWrapper = _styledComponents["default"].div.withConfig({
15
- displayName: "SelectStoryStyle__SelectWrapper",
16
- componentId: "sc-1xv9wvg-1"
17
- })(["div{width:100%;}"]);
18
- exports.SelectWrapper = SelectWrapper;
13
+ exports.StyledTag = StyledTag;
@@ -95,7 +95,7 @@ var SideSheet = /*#__PURE__*/_react["default"].forwardRef(function SideSheet(_re
95
95
  onClick: handleClose
96
96
  }, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
97
97
  name: "ri-close"
98
- })))), showHorizontalLine && /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), children, /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledSideSheetFooter, null, /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledButtonGroupContainer, null, /*#__PURE__*/_react["default"].createElement(_ButtonGroup.ButtonGroup, {
98
+ })))), showHorizontalLine && /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), children, (basicButtonAction || primaryButtonAction) && /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledSideSheetFooter, null, /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledButtonGroupContainer, null, /*#__PURE__*/_react["default"].createElement(_ButtonGroup.ButtonGroup, {
99
99
  fullWidth: true
100
100
  }, basicButtonAction && /*#__PURE__*/_react["default"].createElement(_Button.Button, {
101
101
  onClick: basicButtonAction.action,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glints-aries",
3
- "version": "4.0.304",
3
+ "version": "4.0.305",
4
4
  "description": "Glints ui-kit for frontend",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",