@elliemae/ds-pills 2.0.0-alpha.10 → 2.0.0-alpha.14

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 (69) hide show
  1. package/cjs/components/Pill.js +6 -1
  2. package/cjs/components/PillButton.js +7 -2
  3. package/cjs/components/PillGroup.js +23 -9
  4. package/cjs/components/styled.js +24 -8
  5. package/cjs/components/types/DropdownPill.js +43 -23
  6. package/cjs/components/types/InputPill.js +16 -13
  7. package/cjs/components/types/LabelPill.js +30 -15
  8. package/cjs/components/types/ReadOnlyPill.js +22 -9
  9. package/cjs/components/types/RemovablePill.js +25 -15
  10. package/cjs/components/types/ValuePill.js +37 -22
  11. package/cjs/deprecated/DropdownPill.js +8 -3
  12. package/cjs/deprecated/InputPill.js +22 -18
  13. package/cjs/deprecated/LabeledDropdownPills.js +5 -0
  14. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +18 -8
  15. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +13 -5
  16. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +19 -14
  17. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +4 -2
  18. package/cjs/deprecated/LabeledPills.js +9 -8
  19. package/cjs/deprecated/OverflowPill.js +12 -7
  20. package/cjs/deprecated/Pill.js +18 -10
  21. package/cjs/deprecated/PillGroup.js +25 -17
  22. package/cjs/deprecated/ReadOnlyPill.js +26 -22
  23. package/cjs/deprecated/RemovablePill.js +13 -13
  24. package/cjs/deprecated/index.js +1 -0
  25. package/cjs/props.js +20 -8
  26. package/cjs/utils.js +19 -9
  27. package/esm/components/Pill.js +6 -1
  28. package/esm/components/PillButton.js +7 -2
  29. package/esm/components/PillGroup.js +23 -9
  30. package/esm/components/styled.js +24 -9
  31. package/esm/components/types/DropdownPill.js +44 -22
  32. package/esm/components/types/InputPill.js +16 -12
  33. package/esm/components/types/LabelPill.js +30 -15
  34. package/esm/components/types/ReadOnlyPill.js +22 -9
  35. package/esm/components/types/RemovablePill.js +25 -14
  36. package/esm/components/types/ValuePill.js +38 -23
  37. package/esm/deprecated/DropdownPill.js +7 -1
  38. package/esm/deprecated/InputPill.js +19 -12
  39. package/esm/deprecated/LabeledDropdownPills.js +5 -0
  40. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +15 -5
  41. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +10 -2
  42. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +15 -8
  43. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +3 -1
  44. package/esm/deprecated/LabeledPills.js +9 -8
  45. package/esm/deprecated/OverflowPill.js +12 -7
  46. package/esm/deprecated/Pill.js +18 -10
  47. package/esm/deprecated/PillGroup.js +25 -17
  48. package/esm/deprecated/ReadOnlyPill.js +26 -21
  49. package/esm/deprecated/RemovablePill.js +11 -10
  50. package/esm/deprecated/index.js +1 -1
  51. package/esm/props.js +18 -4
  52. package/esm/utils.js +19 -9
  53. package/package.json +21 -12
  54. package/types/components/PillGroup.d.ts +8 -2
  55. package/types/components/styled.d.ts +17 -33
  56. package/types/deprecated/DropdownPill.d.ts +51 -7
  57. package/types/deprecated/LabeledDropdownPills.d.ts +65 -9
  58. package/types/deprecated/LabeledDropdownPillsTypes/utils.d.ts +1 -1
  59. package/types/deprecated/LabeledPills.d.ts +37 -5
  60. package/types/deprecated/OverflowPill.d.ts +22 -3
  61. package/types/deprecated/Pill.d.ts +44 -6
  62. package/types/deprecated/PillGroup.d.ts +36 -5
  63. package/types/deprecated/ReadOnlyPill.d.ts +43 -6
  64. package/types/deprecated/RemovablePill.d.ts +37 -6
  65. package/types/deprecated/index.d.ts +1 -0
  66. package/types/index.d.ts +1 -1
  67. package/types/props.d.ts +69 -16
  68. package/cjs/package.json +0 -7
  69. package/esm/package.json +0 -7
@@ -1,30 +1,45 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/esnext.async-iterator.filter.js';
3
+ import 'core-js/modules/esnext.iterator.constructor.js';
4
+ import 'core-js/modules/esnext.iterator.filter.js';
2
5
  import React from 'react';
3
- import { DSTooltipV3 } from '@elliemae/ds-tooltip';
6
+ import { DSTooltipV2 } from '@elliemae/ds-tooltip';
4
7
  import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
5
8
  import { StyledValuePillWrapper, StyledSpanWithTooltip } from '../styled.js';
6
9
 
7
- const ValuePill = /*#__PURE__*/React.memo(({
8
- label,
9
- tooltipValue,
10
- iconLeft,
11
- ariaLabel
12
- }) => /*#__PURE__*/_jsx(StyledValuePillWrapper, {
13
- alignItems: "center",
14
- className: "ds-pill-wrapper ds-pill-wrapper-value",
15
- "data-testid": "ds-pill-wrapper",
16
- "aria-label": ariaLabel || label,
17
- cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
18
- gutter: "xxxs",
19
- hasIcon: iconLeft !== null
20
- }, void 0, iconLeft, tooltipValue !== '' ? /*#__PURE__*/_jsx(DSTooltipV3, {
21
- text: tooltipValue,
22
- startPlacementPreference: "bottom"
23
- }, void 0, /*#__PURE__*/_jsx(StyledSpanWithTooltip, {
24
- className: "ds-pill-tooltip-value",
25
- tabIndex: 0
26
- }, void 0, label)) : /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
27
- value: label
28
- })));
10
+ const ValuePill = /*#__PURE__*/React.memo(_ref => {
11
+ let {
12
+ label,
13
+ size,
14
+ labelTruncated,
15
+ tooltipValue,
16
+ iconLeft,
17
+ ariaLabel
18
+ } = _ref;
19
+ const TextComponent = labelTruncated ? _ref2 => {
20
+ let {
21
+ children
22
+ } = _ref2;
23
+ return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
24
+ value: children
25
+ });
26
+ } : React.Fragment;
27
+ return /*#__PURE__*/_jsx(StyledValuePillWrapper, {
28
+ size: size,
29
+ alignItems: "center",
30
+ className: "ds-pill-wrapper ds-pill-wrapper-value",
31
+ "data-testid": "ds-pill-wrapper",
32
+ "aria-label": ariaLabel || label,
33
+ cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
34
+ gutter: "xxxs",
35
+ hasIcon: iconLeft !== null
36
+ }, void 0, iconLeft, tooltipValue !== '' ? /*#__PURE__*/_jsx(DSTooltipV2, {
37
+ title: tooltipValue,
38
+ triggerComponent: /*#__PURE__*/_jsx(StyledSpanWithTooltip, {
39
+ className: "ds-pill-tooltip-value",
40
+ tabIndex: 0
41
+ }, void 0, label)
42
+ }) : /*#__PURE__*/_jsx(TextComponent, {}, void 0, label));
43
+ });
29
44
 
30
45
  export { ValuePill };
@@ -1,10 +1,16 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
4
+ import 'core-js/modules/web.dom-collections.iterator.js';
5
+ import 'core-js/modules/esnext.async-iterator.filter.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.filter.js';
8
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
9
+ import 'core-js/modules/esnext.iterator.for-each.js';
4
10
  import { useRef, useState } from 'react';
5
11
  import { PropTypes, describe } from 'react-desc';
6
12
  import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
7
- import ChevronDown from '@elliemae/ds-icons/ChevronDown';
13
+ import { ChevronDown } from '@elliemae/ds-icons';
8
14
  import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
9
15
  import { Pill } from './Pill.js';
10
16
  import { jsx } from 'react/jsx-runtime';
@@ -1,11 +1,15 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
4
9
  import 'react';
5
- import CloseIcon from '@elliemae/ds-icons/CloseXsmall';
10
+ import { CloseXsmall } from '@elliemae/ds-icons';
6
11
  import { aggregatedClasses } from '@elliemae/ds-classnames';
7
- import DSInputMask from '@elliemae/ds-form/InputMask';
8
- import DSInput from '@elliemae/ds-form/Input';
12
+ import { DSInput, DSInputMask } from '@elliemae/ds-form';
9
13
  import { Pill } from './Pill.js';
10
14
  import { jsx } from 'react/jsx-runtime';
11
15
 
@@ -14,12 +18,15 @@ const _excluded = ["containerProps", "placeholder", "onChange", "onRemove", "val
14
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
19
 
16
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
- const StyledInputPill = aggregatedClasses(Pill)('input-pill', null, ({
18
- value
19
- }) => ({
20
- value
21
- }));
22
- function InputPill(_ref) {
21
+ const StyledInputPill = aggregatedClasses(Pill)('input-pill', null, _ref => {
22
+ let {
23
+ value
24
+ } = _ref;
25
+ return {
26
+ value
27
+ };
28
+ });
29
+ function InputPill(_ref2) {
23
30
  let {
24
31
  containerProps = {},
25
32
  placeholder = 'Enter Value',
@@ -27,8 +34,8 @@ function InputPill(_ref) {
27
34
  onRemove,
28
35
  value,
29
36
  type
30
- } = _ref,
31
- otherProps = _objectWithoutProperties(_ref, _excluded);
37
+ } = _ref2,
38
+ otherProps = _objectWithoutProperties(_ref2, _excluded);
32
39
 
33
40
  let TypeOfInput = DSInput; // TODO: implement the DSTimeInput, see how because it returns a moment()
34
41
  // TODO: implement the DSDateInput
@@ -55,7 +62,7 @@ function InputPill(_ref) {
55
62
  placeholder: placeholder,
56
63
  value: value
57
64
  }, otherProps)),
58
- rightAddon: value && /*#__PURE__*/_jsx(CloseIcon, {
65
+ rightAddon: value && /*#__PURE__*/_jsx(CloseXsmall, {
59
66
  className: "remove-pill-button",
60
67
  "data-testid": "remove-pill-button",
61
68
  onClick: onRemove
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
@@ -1,8 +1,16 @@
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
3
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
4
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
5
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
6
+ import 'core-js/modules/esnext.async-iterator.map.js';
7
+ import 'core-js/modules/esnext.iterator.map.js';
8
+ import 'core-js/modules/web.dom-collections.iterator.js';
9
+ import 'core-js/modules/esnext.async-iterator.filter.js';
10
+ import 'core-js/modules/esnext.iterator.constructor.js';
11
+ import 'core-js/modules/esnext.iterator.filter.js';
4
12
  import { createElement } from 'react';
5
- import { isFunction, addOrRemove } from '@elliemae/ds-utilities/utils';
13
+ import { isFunction, addOrRemove } from '@elliemae/ds-utilities';
6
14
  import { PillGroup } from '../PillGroup.js';
7
15
  import { RemovablePill } from '../RemovablePill.js';
8
16
  import { DropdownPill } from '../DropdownPill.js';
@@ -66,10 +74,12 @@ function LabeledDropdownCascadeMenuPill(_ref) {
66
74
  const selectionValues = selection[selectionId] || '';
67
75
  const dropdownLabel = Array.isArray(selectionValues) ? getSubmenuOptionLabelById(options, selectionId) : selectionValues;
68
76
 
69
- const handleSelectChange = ({
70
- item,
71
- group
72
- }) => {
77
+ const handleSelectChange = _ref2 => {
78
+ let {
79
+ item,
80
+ group
81
+ } = _ref2;
82
+
73
83
  if (isFunction(onChange)) {
74
84
  const nextSelection = group ? {
75
85
  [group.id]: addOrRemove([...(selection[group.id] || [])], item, o => o.id)
@@ -1,9 +1,17 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
4
+ import 'core-js/modules/web.dom-collections.iterator.js';
5
+ import 'core-js/modules/esnext.async-iterator.filter.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.filter.js';
8
+ import 'core-js/modules/esnext.async-iterator.map.js';
9
+ import 'core-js/modules/esnext.iterator.map.js';
10
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
11
+ import 'core-js/modules/esnext.iterator.for-each.js';
4
12
  import { useState, useEffect, useCallback } from 'react';
5
13
  import { find } from 'lodash';
6
- import { isFunction, addOrRemove } from '@elliemae/ds-utilities/utils';
14
+ import { isFunction, addOrRemove } from '@elliemae/ds-utilities';
7
15
  import { RemovablePill } from '../RemovablePill.js';
8
16
  import { Pill } from '../Pill.js';
9
17
  import { OverflowPill } from '../OverflowPill.js';
@@ -128,7 +136,7 @@ function LabeledDropdownMultiPills(_ref) {
128
136
 
129
137
  return null;
130
138
  }), selectedOptions && selectedOptions.length > overflowQuantity && /*#__PURE__*/_jsx(OverflowPill, {
131
- label: `+ ${selectedOptions.length - overflowQuantity}`,
139
+ label: "+ ".concat(selectedOptions.length - overflowQuantity),
132
140
  options: overflowOptions
133
141
  })]
134
142
  });
@@ -1,10 +1,16 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
4
+ import 'core-js/modules/web.dom-collections.iterator.js';
5
+ import 'core-js/modules/esnext.async-iterator.find.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.find.js';
8
+ import 'core-js/modules/esnext.async-iterator.filter.js';
9
+ import 'core-js/modules/esnext.iterator.filter.js';
10
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
11
+ import 'core-js/modules/esnext.iterator.for-each.js';
4
12
  import { useState, useEffect, useLayoutEffect, useCallback } from 'react';
5
- import usePrevious from '@elliemae/ds-utilities/hooks/usePrevious';
6
- import useShouldRecalculate from '@elliemae/ds-utilities/hooks/useShouldRecalculate';
7
- import { isFunction, isString } from '@elliemae/ds-utilities/utils';
13
+ import { usePrevious, useShouldRecalculate, isFunction, isString } from '@elliemae/ds-utilities';
8
14
  import { DropdownPill } from '../DropdownPill.js';
9
15
  import { InputPill } from '../InputPill.js';
10
16
  import { Pill } from '../Pill.js';
@@ -61,11 +67,12 @@ function LabeledDropdownSinglePill(_ref) {
61
67
  setOptionValue(option);
62
68
  onSelect(option);
63
69
  }, [onChange, onSelect]);
64
- const onChangeInputValue = useCallback(({
65
- target: {
66
- value: inputValue
67
- }
68
- }) => {
70
+ const onChangeInputValue = useCallback(_ref2 => {
71
+ let {
72
+ target: {
73
+ value: inputValue
74
+ }
75
+ } = _ref2;
69
76
  const {
70
77
  onChangeInput
71
78
  } = optionValue;
@@ -1,4 +1,6 @@
1
- import { isEqual } from '@elliemae/ds-utilities/utils';
1
+ import 'core-js/modules/esnext.async-iterator.map.js';
2
+ import 'core-js/modules/esnext.iterator.map.js';
3
+ import { isEqual } from '@elliemae/ds-utilities';
2
4
  import { omit } from 'lodash';
3
5
 
4
6
  const hasOptionChanged = (prevOptions, options) => {
@@ -5,14 +5,15 @@ import { PillGroup } from './PillGroup.js';
5
5
  import { RemovablePill } from './RemovablePill.js';
6
6
  import { Pill } from './Pill.js';
7
7
 
8
- function LabeledPills({
9
- children,
10
- label = '',
11
- leftAddon,
12
- onFocusGroupSet,
13
- onFocusNextGroup,
14
- onFocusPreviousGroup
15
- }) {
8
+ function LabeledPills(_ref) {
9
+ let {
10
+ children,
11
+ label = '',
12
+ leftAddon,
13
+ onFocusGroupSet,
14
+ onFocusNextGroup,
15
+ onFocusPreviousGroup
16
+ } = _ref;
16
17
  return /*#__PURE__*/_jsx(PillGroup, {
17
18
  onFocusGroupSet: onFocusGroupSet,
18
19
  onFocusNextGroup: onFocusNextGroup,
@@ -1,15 +1,20 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
4
+ import 'core-js/modules/esnext.iterator.constructor.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
2
6
  import { useRef, useState, useEffect } from 'react';
3
7
  import { PropTypes, describe } from 'react-desc';
4
8
  import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
5
9
  import DSTooltip from '@elliemae/ds-tooltip';
6
10
  import { Pill } from './Pill.js';
7
11
 
8
- function OverflowPill({
9
- containerProps = {},
10
- label = '',
11
- options = []
12
- }) {
12
+ function OverflowPill(_ref) {
13
+ let {
14
+ containerProps = {},
15
+ label = '',
16
+ options = []
17
+ } = _ref;
13
18
  const ref = useRef(null);
14
19
  const [tooltipIsOpen, setTooltipIsOpen] = useState(false);
15
20
  const [tooltipText, setTooltipText] = useState('');
@@ -17,9 +22,9 @@ function OverflowPill({
17
22
  let text = '';
18
23
  options.forEach(option => {
19
24
  if (!tooltipText || option === options[0]) {
20
- text = `${option.label}`;
25
+ text = "".concat(option.label);
21
26
  } else {
22
- text = text.concat(`, ${option.label}`);
27
+ text = text.concat(", ".concat(option.label));
23
28
  }
24
29
  });
25
30
  setTooltipText(text);
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _jsx from '@babel/runtime/helpers/esm/jsx';
3
8
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
@@ -12,17 +17,20 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
12
17
 
13
18
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
14
19
  const pillBlockName = 'pill';
15
- const PillWrapper = aggregatedClasses('div')(pillBlockName, null, ({
16
- size,
17
- variant
18
- }) => ({
19
- [variant]: !!variant,
20
- [size]: !!size
21
- }));
20
+ const PillWrapper = aggregatedClasses('div')(pillBlockName, null, _ref => {
21
+ let {
22
+ size,
23
+ variant
24
+ } = _ref;
25
+ return {
26
+ [variant]: !!variant,
27
+ [size]: !!size
28
+ };
29
+ });
22
30
  const PillLabel = aggregatedClasses('span')(pillBlockName, 'label');
23
31
  const PillAddon = aggregatedClasses('div')(pillBlockName, 'addon');
24
32
 
25
- function Pill(_ref) {
33
+ function Pill(_ref2) {
26
34
  let {
27
35
  containerProps = {},
28
36
  label = '',
@@ -30,8 +38,8 @@ function Pill(_ref) {
30
38
  rightAddon,
31
39
  variant = 'value',
32
40
  size = 'm'
33
- } = _ref,
34
- otherProps = _objectWithoutProperties(_ref, _excluded);
41
+ } = _ref2,
42
+ otherProps = _objectWithoutProperties(_ref2, _excluded);
35
43
 
36
44
  return /*#__PURE__*/jsxs(PillWrapper, _objectSpread(_objectSpread(_objectSpread({}, containerProps), {}, {
37
45
  classProps: {
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import 'react';
@@ -12,23 +17,26 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
12
17
  const pillGroupBlockName = 'pill-group';
13
18
  const Container = aggregatedClasses('div')(pillGroupBlockName);
14
19
 
15
- const PillGroup = ({
16
- containerProps = {},
17
- onFocusNextGroup,
18
- onFocusPreviousGroup,
19
- onFocusGroupSet,
20
- children
21
- }) => /*#__PURE__*/_jsx(FocusGroupProvider, {
22
- keyBindings: {
23
- Tab: 'next'
24
- },
25
- onFocusGroupSet: onFocusGroupSet,
26
- onFocusNextGroup: onFocusNextGroup,
27
- onFocusPreviousGroup: onFocusPreviousGroup,
28
- orientation: "horizontal"
29
- }, void 0, /*#__PURE__*/jsx(Container, _objectSpread(_objectSpread({}, containerProps), {}, {
30
- children: children
31
- })));
20
+ const PillGroup = _ref => {
21
+ let {
22
+ containerProps = {},
23
+ onFocusNextGroup,
24
+ onFocusPreviousGroup,
25
+ onFocusGroupSet,
26
+ children
27
+ } = _ref;
28
+ return /*#__PURE__*/_jsx(FocusGroupProvider, {
29
+ keyBindings: {
30
+ Tab: 'next'
31
+ },
32
+ onFocusGroupSet: onFocusGroupSet,
33
+ onFocusNextGroup: onFocusNextGroup,
34
+ onFocusPreviousGroup: onFocusPreviousGroup,
35
+ orientation: "horizontal"
36
+ }, void 0, /*#__PURE__*/jsx(Container, _objectSpread(_objectSpread({}, containerProps), {}, {
37
+ children: children
38
+ })));
39
+ };
32
40
 
33
41
  const props = {
34
42
  /** props injected to component wrapper */
@@ -1,20 +1,22 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
3
  import { useRef, useState } from 'react';
3
4
  import { PropTypes, describe } from 'react-desc';
4
- import InfoCircleSmall from '@elliemae/ds-icons/InfoCircleSmall';
5
+ import { InfoCircleSmall } from '@elliemae/ds-icons';
5
6
  import DSModal, { MODAL_TYPE_V2 } from '@elliemae/ds-modal';
6
7
  import Popover from '@elliemae/ds-popover';
7
8
  import { Pill } from './Pill.js';
8
9
  import { jsxs, Fragment } from 'react/jsx-runtime';
9
10
 
10
- const ReadOnlyPill = ({
11
- containerProps = {},
12
- modalContent = '',
13
- label = '',
14
- leftAddon,
15
- modalTitle = '',
16
- tooltipText = ''
17
- }) => {
11
+ const ReadOnlyPill = _ref => {
12
+ let {
13
+ containerProps = {},
14
+ modalContent = '',
15
+ label = '',
16
+ leftAddon,
17
+ modalTitle = '',
18
+ tooltipText = ''
19
+ } = _ref;
18
20
  const ref = useRef(null);
19
21
  const [isModalOpen, setIsModalOpen] = useState(false);
20
22
  const [isTooltipOpen, setIsTooltipOpen] = useState(false);
@@ -36,18 +38,21 @@ const ReadOnlyPill = ({
36
38
  content: tooltipText,
37
39
  placement: "top",
38
40
  showArrow: true,
39
- renderTrigger: ({
40
- ref
41
- }) => /*#__PURE__*/_jsx(InfoCircleSmall, {
42
- role: "button",
43
- "data-testid": "read-only-info-btn",
44
- className: "remove-pill-button",
45
- onClick: toggle,
46
- onMouseEnter: () => setIsTooltipOpen(true),
47
- onMouseLeave: () => setIsTooltipOpen(false),
48
- color: ['brand-primary', '600'],
49
- innerRef: ref
50
- })
41
+ renderTrigger: _ref2 => {
42
+ let {
43
+ ref
44
+ } = _ref2;
45
+ return /*#__PURE__*/_jsx(InfoCircleSmall, {
46
+ role: "button",
47
+ "data-testid": "read-only-info-btn",
48
+ className: "remove-pill-button",
49
+ onClick: toggle,
50
+ onMouseEnter: () => setIsTooltipOpen(true),
51
+ onMouseLeave: () => setIsTooltipOpen(false),
52
+ color: ['brand-primary', '600'],
53
+ innerRef: ref
54
+ });
55
+ }
51
56
  }),
52
57
  tabIndex: -1
53
58
  }), /*#__PURE__*/_jsx(DSModal, {
@@ -1,18 +1,19 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import { useRef } from 'react';
3
3
  import { PropTypes, describe } from 'react-desc';
4
- import { isFunction } from '@elliemae/ds-utilities/utils';
5
- import CloseIcon from '@elliemae/ds-icons/CloseXsmall';
4
+ import { isFunction } from '@elliemae/ds-utilities';
5
+ import { CloseXsmall } from '@elliemae/ds-icons';
6
6
  import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
7
7
  import { Pill } from './Pill.js';
8
8
 
9
- function RemovablePill({
10
- containerProps = {},
11
- label = '',
12
- onRemove,
13
- size = 'm',
14
- leftAddon
15
- }) {
9
+ function RemovablePill(_ref) {
10
+ let {
11
+ containerProps = {},
12
+ label = '',
13
+ onRemove,
14
+ size = 'm',
15
+ leftAddon
16
+ } = _ref;
16
17
  const ref = useRef(null);
17
18
  const {
18
19
  focusPrevious
@@ -31,7 +32,7 @@ function RemovablePill({
31
32
  if (isFunction(focusPrevious)) focusPrevious();
32
33
  }
33
34
  },
34
- rightAddon: /*#__PURE__*/_jsx(CloseIcon, {
35
+ rightAddon: /*#__PURE__*/_jsx(CloseXsmall, {
35
36
  role: "button",
36
37
  "data-testid": "remove-pill-button",
37
38
  className: "remove-pill-button",
@@ -1,4 +1,4 @@
1
- export { DSPillWithSchema, Pill } from './Pill.js';
1
+ export { DSPillWithSchema, Pill, Pill as default } from './Pill.js';
2
2
  export { Container, DSPillGroupWithSchema, PillGroup } from './PillGroup.js';
3
3
  export { DSLabeledDropdownPillsWithSchema, LabeledDropdownPills } from './LabeledDropdownPills.js';
4
4
  export { DSLabeledPillsWithSchema, LabeledPills } from './LabeledPills.js';
package/esm/props.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PropTypes } from 'react-desc';
2
- import DSInput from '@elliemae/ds-form/Input';
2
+ import { DSInput } from '@elliemae/ds-form';
3
3
 
4
4
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
5
5
  const pillTypes = PropTypes.oneOf(['label', 'value', 'input', 'dropdown', 'removable', 'readonly']);
@@ -7,7 +7,9 @@ const DSPillV2PropTypes = {
7
7
  label: PropTypes.string.description('Label to show in the pill').isRequired,
8
8
  type: pillTypes.description('The type of pill that you want to render').isRequired,
9
9
  innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)').defaultValue(() => null),
10
+ size: PropTypes.oneOf(['s', 'm']).description('Vertical pill size').defaultValue('m'),
10
11
  ariaLabel: PropTypes.string.description('Aria label for the pill. If not provided we will use the label').defaultValue(''),
12
+ labelTruncated: PropTypes.bool.description('Whether to truncate the pills label').defaultValue(true),
11
13
  tooltipValue: PropTypes.string.description('String to show as a tooltip in the value pill').defaultValue(''),
12
14
  iconLeft: PropTypes.node.description('A component to show int the left of a readonly pill').defaultValue(null),
13
15
  iconRight: PropTypes.node.description('A component to show in the right of a readonly pill').defaultValue(null),
@@ -16,16 +18,23 @@ const DSPillV2PropTypes = {
16
18
  onInputChange: PropTypes.func.description('Callback triggered when user provides input to the input pill').defaultValue(() => null),
17
19
  onInputClear: PropTypes.func.description('Callback triggered when the user clears an input pill').defaultValue(() => null),
18
20
  inputWidth: PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),
19
- dropdownProps: PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({})
21
+ dropdownProps: PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),
22
+ onDropdownClick: PropTypes.func.description('Callback when dropdown button is clicked or pressed').defaultValue(() => null)
20
23
  };
21
24
  const DSPillButtonPropTypes = {
22
25
  type: PropTypes.oneOf(['only', 'left', 'right']).description('The position in which this button will be placed. Only used for css styling internally').defaultValue('right'),
23
26
  width: PropTypes.string.description('Width of the button').defaultValue('100%'),
24
27
  height: PropTypes.string.description('Height of the button').defaultValue('100%')
25
28
  };
29
+ const DSPillGroupPropTypes = {
30
+ width: PropTypes.string.description('Width of the group').defaultValue('fit-content'),
31
+ innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Reference to the pill group wrapper').defaultValue(() => null)
32
+ };
26
33
  const DSPillV2DefaultProps = {
27
34
  innerRef: () => null,
28
35
  ariaLabel: '',
36
+ size: 'm',
37
+ labelTruncated: true,
29
38
  tooltipValue: '',
30
39
  iconLeft: null,
31
40
  iconRight: null,
@@ -35,12 +44,17 @@ const DSPillV2DefaultProps = {
35
44
  onInputClear: () => null,
36
45
  inputWidth: 72,
37
46
  inputRender: DSInput,
38
- dropdownProps: {}
47
+ dropdownProps: {},
48
+ onDropdownClick: () => null
39
49
  };
40
50
  const DSPillButtonDefaultProps = {
41
51
  type: 'right',
42
52
  width: '100%',
43
53
  height: '100%'
44
54
  };
55
+ const DSPillGroupDefaultProps = {
56
+ width: 'fit-content',
57
+ innerRef: () => null
58
+ };
45
59
 
46
- export { DSPillButtonDefaultProps, DSPillButtonPropTypes, DSPillV2DefaultProps, DSPillV2PropTypes };
60
+ export { DSPillButtonDefaultProps, DSPillButtonPropTypes, DSPillGroupDefaultProps, DSPillGroupPropTypes, DSPillV2DefaultProps, DSPillV2PropTypes };
package/esm/utils.js CHANGED
@@ -1,14 +1,24 @@
1
- const setMultipleRefs = (...refs) => _ref => {
2
- refs.forEach(ref => {
3
- if (!ref || !_ref) return;
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.for-each.js';
4
4
 
5
- if (typeof ref === 'function') {
6
- ref(_ref);
7
- return;
8
- }
5
+ const setMultipleRefs = function () {
6
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
7
+ refs[_key] = arguments[_key];
8
+ }
9
9
 
10
- if (ref) ref.current = _ref;
11
- });
10
+ return _ref => {
11
+ refs.forEach(ref => {
12
+ if (!ref || !_ref) return;
13
+
14
+ if (typeof ref === 'function') {
15
+ ref(_ref);
16
+ return;
17
+ }
18
+
19
+ if (ref) ref.current = _ref;
20
+ });
21
+ };
12
22
  };
13
23
 
14
24
  export { setMultipleRefs };